From: Johannes Stezenbach <js@sig21.net>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Mitch Bradley <wmb@firmworks.com>,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: DT GPIO numbering?
Date: Tue, 14 Aug 2012 15:05:47 +0200 [thread overview]
Message-ID: <20120814130547.GB14756@sig21.net> (raw)
In-Reply-To: <CACRpkdbQVHFWej=CPv0QOjH7OUr8Jj7wVjG=eRqkM=cbih1vAQ@mail.gmail.com>
On Tue, Aug 14, 2012 at 12:00:23PM +0200, Linus Walleij wrote:
> On Fri, Aug 10, 2012 at 11:34 AM, Johannes Stezenbach <js@sig21.net> wrote:
>
> > Actually I think the kernel internal GPIO numbers shouldn't be in the
> > sysfs API, instead userspace should use the names.
>
> This is true, but we cannot remove these numbers because they
> are now in Documentation/ABI/testing/sysfs-gpio
>
> And while the "testing" ABI is, well for testing, it would probably
> break a lot of stuff it we removed it.
>
> But we can sure add names. However these would still sit under
> /sys/class/gpio/gpioN/name
>
> Or do you suggest we simply duplicate all GPIOs which have
> names under /sys/class/gpio/named/<name>
> or something like that?
I'm still not sure. One idea was to add /proc/gpios which maps
names to numbers, then userspace can look up the number and use that.
But the more I think about it /sys/class/gpio/export is just
a debug hack and shouldn't be used. Board code should export
the available gpio according to pinctrl setup and schematics.
The only catch here is that board code then needs to know which gpio are
for userspace and which are used by in-kernel drivers.
E.g. a LED could be set by LED Triggers or by userspace
Blinkenlight app.
Johannes
prev parent reply other threads:[~2012-08-14 13:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-01 15:22 DT GPIO numbering? Johannes Stezenbach
2012-08-05 10:06 ` Linus Walleij
2012-08-06 2:18 ` Stephen Warren
2012-08-06 6:35 ` Linus Walleij
2012-08-06 9:58 ` Johannes Stezenbach
2012-08-06 11:10 ` Mitch Bradley
2012-08-10 9:34 ` Johannes Stezenbach
2012-08-14 10:00 ` Linus Walleij
2012-08-14 13:05 ` Johannes Stezenbach [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120814130547.GB14756@sig21.net \
--to=js@sig21.net \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wmb@firmworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox