Re: [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name

From: Linus Walleij
Date: Mon May 18 2020 - 04:20:25 EST


On Mon, May 11, 2020 at 4:53 PM Geert Uytterhoeven
<geert+renesas@xxxxxxxxx> wrote:

> Currently a GPIO lookup table can only refer to a specific GPIO by a
> tuple, consisting of a GPIO controller label and a GPIO offset inside
> the controller.
>
> However, a GPIO may also carry a line name, defined by DT or ACPI.
> If present, the line name is the most use-centric way to refer to a
> GPIO. Hence add support for looking up GPIOs by line name.
> Note that there is no guarantee that GPIO line names are globally
> unique, so this will use the first match found.
>
> Implement this by reusing the existing gpiod_lookup infrastructure.
> Rename gpiod_lookup.chip_label to gpiod_lookup.key, to make it clear
> that this field can have two meanings, and update the kerneldoc and
> GPIO_LOOKUP*() macros.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> Reviewed-by: Ulrich Hecht <uli+renesas@xxxxxxxx>
> Reviewed-by: Eugeniu Rosca <erosca@xxxxxxxxxxxxxx>
> Tested-by: Eugeniu Rosca <erosca@xxxxxxxxxxxxxx>
> ---
> v7:
> - Document non-uniqueness of line names,
> - Rebase on top of commit a0b66a73785ccc8f ("gpio: Rename variable in

This is likely the most controversial patch of this series but since
noone seems to be especially upset, I think I just accept this
heuristic.

It is pretty clearly cut I think, and fits very well with the
aggregator use case, which is an important one.

Yours,
Linus Walleij