[i2c] i2c device attached to a SoC bus

Jorge Luis Zapata Muga jorgeluis.zapata at gmail.com
Mon Jun 11 12:22:51 CEST 2007


Hi all, ive already posted a message to the v4l ml without luck. I'll
explain first what im trying to do:
I have a tvp5150 device attached to a SoC i2c bus and would like to
use a v4l interface for it, so basically my driver would be an i2c
driver wrapper. The tvp5150 is already on the kernel with an
i2c_client interface, and i already coded the SoC bus driver under
drivers/i2c/busses.

Now, in order to send commands to the i2c client, i need the
i2c_client struct, which is stored on the client_register callback of
the adapter. This approach fits well when the i2c bus is part of the
device driver i want to code (like in other v4l drivers), but as my
i2c bus code is generic (i.e there can be any type of i2c client
attached, not a static list) there's no way to retrieve what clients
are attached to an adapter from kernel space, but it is possible from
user space using the i2c-dev interface.

There is a possible solution i could use: code my v4l driver as an i2c
adapter,  and reuse my generic i2c bus algo. I would need to export
some symbols, but still it don't like this approach because some arch
specific code (like setting up the gpios, clocks, etc) are also
duplicated and may cause errors.

Is some other way? someone with experience on a similar problem?

thanks all



More information about the i2c mailing list