[PATCH 1/2] gpio: dwapb: Use human understandable gpio numbering.

Linus Walleij linus.walleij at linaro.org
Thu Jul 16 00:57:23 PDT 2015


On Thu, Jul 2, 2015 at 4:20 PM, Richard Cochran
<richardcochran at gmail.com> wrote:
> On Thu, Jul 02, 2015 at 08:05:26AM +0100, Michael van der Westhuizen wrote:

> Anyhow, the whole point is, when the data sheet says that the SoC has
> GPIO0 to GPION, then those numbers should be exposed to user space.

The gpio_chip has this:

struct gpio_chip {
        const char              *label;
        struct device           *dev;
(...)
        const char              *const *names;
(...)

If you want to help the users, provide string names for all the GPIO lines
and suggest them to do code in userspace that use these names instead
of GPIO numbers.

Also the string names "gpio0", "gpio1" etc are much better than just using
the Linux-specific numbers.

So what about making a patch to drivers/gpio/gpio-dwapb.c that adds the
.names property to its GPIO chip?

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list