[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdb5bRK6n_-Rpr1WDG5H_C9WDVuLT+sop2_9hR8TW4N3fg@mail.gmail.com>
Date: Fri, 25 Apr 2014 11:29:49 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Haojian Zhuang <haojian.zhuang@...aro.org>
Cc: Grant Likely <grant.likely@...aro.org>,
Xu Wei <xuwei5@...ilicon.com>,
Rob Herring <robh+dt@...nel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Baruch Siach <baruch@...s.co.il>
Subject: Re: [PATCH 1/2] gpio: pl061: get gpio base from alias id
On Fri, Apr 25, 2014 at 2:27 AM, Haojian Zhuang
<haojian.zhuang@...aro.org> wrote:
> Go it. But the gpio sysfs interface is using the gpio name with an
> internal number. It'll make developer confusion since it's different
> from datasheet
> or schematics. Is there any plan to remove the confusion?
First I am as always very suspicious about the sysfs interface
since it is often used for madness like reimplementing
leds-gpio.c, gpio_keys.c, extcon-gpio.c, gpio-regulator.c
spi-gpio.c, w1-gpio.c or gpio_wdt.c in userspace for no
good reason when the kernel should handle it.
Yet there are exceptions where it's actually warranted.
There is a possibility to set a label on the gpio line,
so this should be used.
C.f.
commit 781f6d710d4482eab05cfaad50060a0ea8c0e4e0
"gpio: generic: Add label to platform data"
Something like this is needed in this and other drivers
needing to label its GPIO lines. It's much like how we name
all pins in a pin controller really.
I don't exactly know how we should achieve the same
for labels to offsets in any given gpio_chip using
some generic device tree labels for example, but I
imagine it could be implemented in a generic fashion?
Describing the names of gpio lines should be quite
obvious hardware description suitable for the device
tree.
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists