[PATCH] gpio: allow passing NULL to gpio_request_by_line_name() to search all gpio controllers

Rasmus Villemoes rasmus.villemoes at prevas.dk
Sun Mar 19 01:38:14 CET 2023

On 18/03/2023 21.20, Simon Glass wrote:
> Hi Rasmus,
> On Fri, 17 Mar 2023 at 14:13, Rasmus Villemoes
> <rasmus.villemoes at prevas.dk> wrote:
>> The API is more convenient to use if one doesn't have to know upfront
>> which gpio controller has a line with the name one is searching for,
>> and arrange to look that device up somehow. Or implement this loop
>> oneself.
>> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
>> ---
>>  drivers/gpio/gpio-uclass.c | 7 +++++++
>>  include/asm-generic/gpio.h | 3 ++-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
> Reviewed-by: Simon Glass <sjg at chromium.org>
> What is a line name? I don't see any mention of its purpose in the
> binding doc[1].

Nah, those yaml-files are usually completely useless to gain some
understanding of what stuff is for, I much preferred the free-form prose.

has this text:

Optionally, a GPIO controller may have a "gpio-line-names" property. This is
an array of strings defining the names of the GPIO lines going out of the
GPIO controller. This name should be the most meaningful producer name
for the system, such as a rail name indicating the usage. Package names
such as pin name are discouraged: such lines have opaque names (since they
are by definition generic purpose) and such names are usually not very
helpful. For example "MMC-CD", "Red LED Vdd" and "ethernet reset" are
reasonable line names as they describe what the line is used for.


More information about the U-Boot mailing list