Subject: Re: "cell-index" vs. "index" vs. no index in I2C device nodes

From: Timur Tabi <[email-masked]>
Date: Thu, 05 Jun 2008 11:18:38 -0500

Grant Likely wrote:

> multifunction@0 {
>         #size-cells = <1>;
>         #address-cells = <1>;
>         ranges = <0 0xe00000000 0x1000>;
>         i2c@0 {
>                 cell-index = <0>;
>                 regs = <0 0x100>;
>         }
>         i2c@100 {
>                 cell-index = <1>;
>                 regs = <0x100 0x100>;
>         }
> }
> multifunction@1 {
>         #size-cells = <1>;
>         #address-cells = <1>;
>         ranges = <0 0xe10000000 0x1000>;
>         i2c@0 {
>                 cell-index = <0>;
>                 regs = <0 0x100>;
>         }
>         i2c@100 {
>                 cell-index = <1>;
>                 regs = <0x100 0x100>;
>         }
> }

What resources are being shared in this example?  Each I2C device has its own
address ranges.  I don't see how cell-index provides any useful info here.

> cell-index must *not* be repurposed as a system level index.

It's a little late for that.  I'm okay with coming up with a new property to
provide system-level indexing, but it needs to be the same property name for
each type of device.  I don't want linux,i2c-index and linux,dma-index and
linux,ssi-index, etc.  I also don't understand why we need the linux, prefix,
since device enumeration is not specific to Linux.

-- 
Timur Tabi
Linux kernel developer at Freescale