From: Johan Hovold <johan@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Rob Herring" <robh@kernel.org>,
"Alexandre Courbot" <gnurou@gmail.com>,
"Mark Rutland" <mark.rutland@arm.com>,
"Sascha Hauer" <kernel@pengutronix.de>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] gpio: document how to order GPIO controllers
Date: Wed, 6 Jul 2016 12:27:50 +0200 [thread overview]
Message-ID: <20160706102750.GH23470@localhost> (raw)
In-Reply-To: <CACRpkdbH+KRXbxFdfyAE44fBNctK4cWV+KRLwQBTzSGLvLMEDg@mail.gmail.com>
On Wed, Jul 06, 2016 at 11:34:37AM +0200, Linus Walleij wrote:
> On Tue, Jul 5, 2016 at 8:04 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> > root@hostname:/sys/bus/gpio/devices ls -l
> > lrwxrwxrwx 1 root root 0 Jul 5 20:52 gpiochip0 -> ../../../devices/platform/soc/53f00000.aips/53f9c000.gpio/gpiochip0
> > lrwxrwxrwx 1 root root 0 Jul 5 20:52 gpiochip1 -> ../../../devices/platform/soc/53f00000.aips/53fa4000.gpio/gpiochip1
> > lrwxrwxrwx 1 root root 0 Jul 5 20:52 gpiochip2 -> ../../../devices/platform/soc/53f00000.aips/53fcc000.gpio/gpiochip2
> > lrwxrwxrwx 1 root root 0 Jul 5 20:52 gpiochip3 -> ../../../devices/platform/soc/53f00000.aips/53fd0000.gpio/gpiochip3
> >
> > That is we have:
> >
> > Hardware name | software gpiochip
> > GPIO4 | gpiochip0
> > GPIO3 | gpiochip1
> > GPIO1 | gpiochip2
> > GPIO2 | gpiochip3
> >
> > I bet that's the probe order because when sorted by address (and so
> > by order in the device tree) we have exactly this ordering. (Compare
> > with $(grep gpio@ arch/arm/boot/dts/imx25.dtsi).)
>
> That is super-unintuitive for a human user, I agree 100%.
>
> > For a new interface this is OK, still I predict users will complain if
> > the numbers used don't match naturally the hardware names. And IMHO they
> > are right.
>
> I agree, and I think that if aliases can alleviate the situation we should
> allow them and encourage them. They are the best duct-tape we can
> find for the DT systems.
>
> Unfortunately it is not my call, because DT bindings and alias use
> is not under my jurisdiction.
>
> I *THINK* the view of the device core maintainers is that udev
> and sysfs hierarchies should be used to uniquely identify a certain
> device, and that relying on device numbering is too fragile.
I thought the whole idea (or at least a large part of) the new
user-space interface was to allow lookups by line names precisely in
order not to have to rely on gpio numbers, which may not only change
between boots, but also between hardware revisions, etc.
What's wrong with naming the pins in DT and use that for lookups?
I've been too busy with other stuff this spring to follow the new
user-space interface development, but I assume that this had been taken
into account in the design?
Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-07-06 10:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-01 6:42 [PATCH] gpio: document how to order GPIO controllers Uwe Kleine-König
2016-07-05 14:05 ` Rob Herring
2016-07-05 18:04 ` Uwe Kleine-König
2016-07-06 7:24 ` Lothar Waßmann
2016-07-06 7:54 ` Alexander Stein
2016-07-06 9:34 ` Linus Walleij
2016-07-06 10:27 ` Johan Hovold [this message]
2016-07-06 12:34 ` Linus Walleij
2016-07-06 14:12 ` Permissions for GPIOs [Was: [PATCH] gpio: document how to order GPIO controllers] Jan Lübbe
[not found] ` <1467814334.2472.154.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2016-07-08 11:25 ` Linus Walleij
2016-07-13 13:14 ` [PATCH] gpio: document how to order GPIO controllers Johan Hovold
2016-07-22 14:34 ` Linus Walleij
2016-07-17 22:03 ` Rob Herring
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=20160706102750.GH23470@localhost \
--to=johan@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).