Re: [PATCH 0/6] GPIO character device skeleton

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 30, 2015 at 08:48:44PM +0100, Linus Walleij wrote:
> On Fri, Oct 30, 2015 at 2:55 AM, Alexandre Courbot <gnurou@xxxxxxxxx> wrote:
> > On Sun, Oct 25, 2015 at 3:42 AM, Markus Pargmann <mpa@xxxxxxxxxxxxxx> wrote:
> 
> >> What happens if we have two I2C gpio expanders with the same I2C
> >> addresses connected to different I2C busses? If I see this correctly
> >> they would both show up with the same name. Is there an easy and
> >> race-free way to see which GPIO chip is connected to which I2C bus?
> >
> > I suppose the bus path could be part of the GPIO chip name to avoid
> > this ambiguity, something like: 7000c000.i2c/0-001c.gpio
> 
> For DT that is the simple solution.

Not all devices are platform devices, and the bus path can become quite
long, for example for usb to uniquely identify the gpio controller this
could be:

	platform/68000000.ocp/48064000.usbhshost/48064800.ehci/usb1/1-2/1-2.3/1-2.3:1.0/gpiochip7

> Right now it used gpiochip->label if that is set, else the name of
> the gpiochip device like gpiochip0, gpiochip1 etc.

Perhaps better to just stick to the bus unique names (e.g. gpopchip7),
and possibly export the label as an additional attribute.

This is the lsgpio output I get on an omap system by the way:

GPIO chip: gpio, 32 GPIO lines
GPIO chip: gpio, 32 GPIO lines
GPIO chip: gpio, 32 GPIO lines
GPIO chip: gpio, 32 GPIO lines
GPIO chip: gpio, 32 GPIO lines
GPIO chip: gpio, 32 GPIO lines
GPIO chip: twl4030, 20 GPIO lines
GPIO chip: pl2303, 2 GPIO lines

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux