[i2c] I2C Bus Driver needed?
Markus Franke
markus.franke at s2002.tu-chemnitz.de
Tue May 1 08:29:26 CEST 2007
Hi,
many thanks for your reply.
Quoting James Chapman <jchapman at katalix.com>:
> For general i2c, you'll need a bus driver so that the kernel i2c core
> knows how to control the i2c bus with your hardware. Look at examples
> in drivers/i2c/busses. Some bus drivers are quite complex while others
> can be simple, depending on the capabilities of the actual i2c
> hardware. If you need to write one, study the code of another driver
> which has similar characteristics to your device. See Documentation/i2c
> for more info.
> Perhaps you won't need to write one yourself if one already exists in
> the kernel for the i2c controller device that you are using. Or perhaps
> your SoC has hardware support that effectively hides I2C for accessing
> certain connected devices using direct SoC register access? If so, a
> device driver for the specific device (providing register access via a
> char device) might be more appropriate. It all depends on your hardware.
All the drivers in "chips" directory are using a bus driver. I still
don't understand how it can work without a bus driver. The chip driver
has to call at some point in time "i2c_attach_adapter()". But
generally this function is only called when a new adapter is attached
to the bus via "i2c_add_adapter()", through the detect function of the
chip driver. But if I don't need a bus driver by itself because my
hardware hides I2C access somehow, how can this fit into the general
linux i2c scheme? I would like to use the existing drivers in "chips"
directory as a reference but it seems that it doesn't work in my case.
It would be really nice to see an example driver which is designed for
a SoC/AMBA/APB. If anyone is able to provide something like that I
would be really glad.
BTW, there is no bus driver already available in linux for my i2c controller.
Regards,
Markus
More information about the i2c
mailing list