[i2c] I2C Bus Driver needed?

James Chapman jchapman at katalix.com
Fri Apr 27 20:17:09 CEST 2007


Markus Franke wrote:

> After reading a lot of documentation about howto implement I2C 
> bus/algorithm/chip drivers, I am still a bit confused. First of all, is 
> it really necessary to develop an I2C bus driver by itself? I mean, I 
> have already an I2C Controller available in hardware on my SoC, which 
> should handle all protocoll related stuff, right?

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.

> It sounds maybe a bit confusing but some people told me already that an 
> I2C bus driver is not needed in my case, but I still don't understand why.

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.

-- 
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development




More information about the i2c mailing list