This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm365 evm: random problems with tvp7002 when opening /dev/video0

Other Parts Discussed in Thread: TVP7002

Hello,

I'm using the dm365 evm to capture 720P video through component y/cb/cr connectors. Sometimes the tvp7002 driver issues errors when I try to open "/dev/video0":

kobject_add failed for  (-13)
Failed to register TVP7002 I2C client.
vpfe ccdc capture vpfe ccdc capture.1: Error in initializing channel

The only solution I've found is to rmmod tvp7002.ko, reset the tvp7002, reload the driver.
Has anybody else found this problem?
Thanks.

  • Ok I think I've found the problem.

    Then /dev/video0 is opened, the function "tvp7002_initialize" in tvp7002.ko is called. But in the static struct defining i2c_driver there is no "name" for the "driver" entry.

    The result is that the chain of calls:

    i2c_add_driver

    i2c_register_driver

    driver_register

    bus_add_driver

    kobject_register

    fails, since the name can be random characters or a null. This makes the "sysfs_create_dir" fail. In fact when it does not fail, in /sys/bus/i2c/drivers there is an entry with a junk name.

  • An addenda:

    driver name is set in the "tvp7002_i2c_init", but a pointer to a local variable is used. This means that after the module has been loaded, the pointer is invalid... Clearly a bug in the driver initialization code.