[PATCH 2/5] gpio: pca953x: Name the gpiochip after the I2C address

Linus Walleij linus.walleij at linaro.org
Thu Nov 30 06:45:22 PST 2017


On Fri, Nov 24, 2017 at 3:26 PM, Andrew Lunn <andrew at lunn.ch> wrote:
> On Fri, Nov 24, 2017 at 10:30:42AM +0100, Linus Walleij wrote:
>> Just putting the name of the I2C device as name for the
>> GPIO chip (label) is ambigous, and makes it hard for us
>> to use GPIO descriptor tables on systems such as DaVinci
>> DA850EVM which has two chips but on I2C address 0x20 and 0x21.
>>
>> Instead, append "-XX" to the GPIOchip name using the I2C
>> address so we get a unique chip name that can be used
>> in descriptor tables, such as "tca6416-20" and
>> "tca6416-21" on the DaVinci DA850EVM.
>
> Hi Linus
>
> Are you making the assumption that there are not two devices at the
> same address but on different I2C busses?

Yes.

> How safe is that assumption? Can you include the adapter ID in the
> string?

Sure, I just had to come up with something.

The universe of board files is not very big, so the number of
potentially clashing things is not eternal. This is just a transient
"contain and deprecate" thing so I think it's unlikely that they
clash but usually when I say something like that the next day
it happens...

So I can add the adapter number :)

I am waiting for more feedback on the series before resending.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list