Hi Ben,

On Wed, 14 May 2008 22:20:06 +0100, Ben Dooks wrote:
> On Tue, May 13, 2008 at 03:45:29PM +0300, Darius wrote:
> > Thanks, there was the problem. I have modified i2c adapter driver to use 
> >   i2c_add_numbered_adapter() instead i2c_add_adapter() and pass to the 
> > adapter->nr = pdev->id. now probe is called.
> 
> I'm not so sure this 1:1 mapping of platform to i2c bus ID is such a
> good idea, what if you have two i2c controllers and want to swap the
> two of them around?

You are right that using the platform device ID as the bus number has
limitations. It seems that it has worked fine for everyone so far
though. I guess that most embedded platforms have only one type of I2C
controllers so there are no collisions. If a platform was to use
several types of I2C controllers, presumably requiring different
drivers, then the current strategy may lead to collisions. But then it
shouldn't be too difficult to work around it, by passing the correct
I2C bus number as platform data. I guess developers have been using the
platform device ID merely as a shortcut.

I'm not too sure what you mean with "swapping the i2c controllers"
though. Why would you want to do that? Maybe a concrete example would
help.

-- 
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

Reply via email to