Re: [PATCH v2] gpio: of: make it possible to name GPIO lines

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

 




On Wed, Apr 20, 2016 at 5:16 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> Make it possible to name the producer side of a GPIO line using
> a "gpio-names" property array, modeled on the "clock-names"
> property from the clock bindings.

Except clock-names is the consumer side. There is clock-output-names
for the clock controller side though.

>
> This naming is especially useful for:
>
> - Debugging: lines are named after function, not just opaque
>   offset numbers.
>
> - Exploration: systems where some or all GPIO lines are available
>   to end users, such as prototyping, one-off's "makerspace usecases"
>   users are helped by the names of the GPIO lines when tinkering.
>   This usecase has been surfacing recently.
>
> The gpio-names attribute is completely optional.
>
> Cc: Rob Herring <robh+dt@xxxxxxxxxx>
> Cc: Grant Likely <grant.likely@xxxxxxxxxx>
> Cc: devicetree@xxxxxxxxxxxxxxx
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> ChangeLog v1->v2:
> - Make the naming function return void: we continue at all times
>   and always return 0 anyway.
> - Fix a return value check.
>
> This has been discussed at some length now.
>
> Why we are not using hogs: these are consumer side, not producer
> side. The gpio-controller in DT (gpio_chip in Linux) is a
> producer, not a consumer.

Arguably, the names you have are the consumer side. The consumer side
is what defines the function. The consumer name is typically local
like vddio being the input supply pin, but the producer names are more
global like ldo3.

> This patch is not about assigning initial values to GPIO lines.
> That is an orthogonal usecase. This is just about naming lines.

It is unless we decide that both should use the same structure.

I'm also worried that just putting in somewhat random names doesn't
buy much. If you have to figure out what the name is for the GPIO line
you want from userspace, then you might as well know the chip and
offset. I'm doubtful we could standardize naming across platforms.

I'm not saying yes or no yet, just raising some of the concerns I have.

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



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux