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

Josh Boyer jwboyer at linux.vnet.ibm.com
Thu Jun 5 13:05:55 EST 2008


On Wed, 4 Jun 2008 22:54:32 -0400
Sean MacLennan <smaclennan at pikatech.com> wrote:

> On Wed, 4 Jun 2008 21:19:42 -0500
> "Josh Boyer" <jwboyer at linux.vnet.ibm.com> wrote:
> 
> > From a device tree perspective, index and cell-index are both
> > incorrect.  The IIC macros don't share register blocks with anything,
> > are enumerated as unique instances per macro in the device tree, and
> > should be able to be distinguished by "regs" and/or unit address.
> 
> So say I have an i2c bus and I want to call i2c_get_adapter.
> Would I have to know the register address of the i2c bus to lookup the
> adapter?
> 
> Or would they have aliases like serial ports do?

I have no idea.  But if you look at the actual driver code, the only
thing the current "index" property is used for is to fill the idx
member of the ibm_iic_private structure.

I'm not proposing we remove that.  I'm just proposing that it can be
derived from something other than an "index" property.  Fill it in
using a static integer that gets incremented for each new device
found.  It's not like we have an indeterminate probe order, or these
IIC macros can be hot-plugged.

josh



More information about the Linuxppc-dev mailing list