"cell-index" vs. "index" vs. no index in I2C device nodes

Jean Delvare khali at linux-fr.org
Fri Jun 6 16:21:50 EST 2008


Hi Ben,

On Fri, 06 Jun 2008 14:16:23 +1000, Benjamin Herrenschmidt wrote:
> On Thu, 2008-06-05 at 09:48 +0200, Jean Delvare wrote:
> > As far as I am concerned, it's really up to the maintainers and users
> > of this platform. All I am asking for is that you do not call
> > i2c_add_numbered_adapter() on an adapter with an automatically
> > generated number. This function must only be used for adapter's those
> > number is well defined. If an adapter doesn't have a well-defined
> > number then use i2c_add_adapter() (but then you can no longer declare
> > your I2C devices as part of the platform data.)
> 
> Can't we just give those things -names- instead of numbers ?

Good question. These i2c adapters already have names
(i2c_adapter.name), which are set by their respective drivers with more
or less grace depending on the driver [1]. What we don't have though is
the possibility to instantiate i2c devices by adapter name.

We could certainly add a busname field to struct i2c_devinfo and
implement i2c_register_board_info_by_name() if it seems to be worth the
extra code and memory. I am open to the idea if it solves a problem
with no other clean solution.

[1] radeonfb is notoriously bad at that ;)

-- 
Jean Delvare



More information about the Linuxppc-dev mailing list