[uClinux-dev] new I2C driver model and fixed I2C bus number

Alexander Stein alexander.stein at systec-electronic.com
Tue Jun 30 05:25:10 EDT 2009


I'm currently working on a driver for an I2C device (which is a bridge to SPI, 
just FYI) using the "new" driver model with probe/remove. My used uClinux 
version is 20080808. As this is done on a board (Coldfire 5208) with a fixed 
configuration I added a new I2C_BOARD_INFO to my i2c_board_info.
But after loading the driver module for the new device, my probe function 
doesn't get called. After some investigations I found out that the I2C bus 
num doesn't match the preconfigured one during driver-device comparison, so 
my statically declared list of devices is useless.
I check other I2C bus implementations and found that their bus numbers are 
configured in a platform device. But the I2C Bus driver for Coldfires doesn't 
support this. I work around my problem by setting the adapter number to 0 and 
call i2c_add_numbered_adapter instead.
Now i figured other things:
* I must not specify the pcf8563 rtc and tmp101 in the i2c_board_info. 
Otherweise they weren't detected. They seem to use the old driver model. Is 
this behavior as expected?
* Other I2C bus drivers are using platform devices for specifying the bus 
number. But in the meanwhile compared to 20090520 e.g. i2c-mpc does not 
support the bus number any more. Is this intended? How can I declare a static 
list of I2C devices then?

Hopefully someone can answer/comment this questions/problems.


More information about the uClinux-dev mailing list