[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name
From: |
Linus Walleij |
Subject: |
Re: [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name |
Date: |
Mon, 18 May 2020 10:20:10 +0200 |
On Mon, May 11, 2020 at 4:53 PM Geert Uytterhoeven
<address@hidden> 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 <address@hidden>
> Reviewed-by: Ulrich Hecht <address@hidden>
> Reviewed-by: Eugeniu Rosca <address@hidden>
> Tested-by: Eugeniu Rosca <address@hidden>
> ---
> 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
- [PATCH v7 0/6] gpio: Add GPIO Aggregator, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 1/6] i2c: i801: Use GPIO_LOOKUP() helper macro, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name, Geert Uytterhoeven, 2020/05/11
- Re: [PATCH v7 3/6] gpiolib: Add support for GPIO lookup by line name,
Linus Walleij <=
- [PATCH v7 6/6] MAINTAINERS: Add GPIO Aggregator section, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 4/6] gpio: Add GPIO Aggregator, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 2/6] mfd: sm501: Use GPIO_LOOKUP_IDX() helper macro, Geert Uytterhoeven, 2020/05/11
- [PATCH v7 5/6] docs: gpio: Add GPIO Aggregator documentation, Geert Uytterhoeven, 2020/05/11
- Re: [PATCH v7 0/6] gpio: Add GPIO Aggregator, Linus Walleij, 2020/05/18
- Re: [PATCH v7 0/6] gpio: Add GPIO Aggregator, Andy Shevchenko, 2020/05/20