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

Michael van der Westhuizen michael at smart-africa.com
Thu Jul 16 01:18:38 PDT 2015


> On 16 Jul 2015, at 9:57 AM, Linus Walleij <linus.walleij at linaro.org> wrote:
> 
> 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?

That would meet my needs.  I’ll start putting something together.

Michael




More information about the linux-arm-kernel mailing list