Re: [PATCH v5 2/3] usb: serial: xr_serial: Add gpiochip support

From: Johan Hovold
Date: Thu Dec 10 2020 - 04:04:56 EST


On Thu, Dec 10, 2020 at 09:53:45AM +0100, Johan Hovold wrote:
> On Wed, Dec 09, 2020 at 05:25:32PM +0100, Linus Walleij wrote:
> > On Wed, Dec 9, 2020 at 4:24 PM Johan Hovold <johan@xxxxxxxxxx> wrote:

> > > So it sounds like there's nothing preventing per-chip-unique names in
> > > the rest of gpiolib and the new chardev interface then? Are the
> > > user-space libraries able to cope with it, etc?
> >
> > Yes the documentation refers to libgpiod a very well maintained
> > library:
> > https://www.kernel.org/doc/html/latest/driver-api/gpio/using-gpio.html
> > https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/
>
> Just did a super quick check and it seems libgpiod still assumes a flat
> name space. For example, gpiod_chip_find_line() returns only the first
> line found that matches a name. Shouldn't be impossible to extend, but
> just want to make sure this flat namespace assumption hasn't been to
> heavily relied upon.

That should have been gpiod_line_find() (which in turn uses the above
mentioned helper for per-chip lookups).

Johan