From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Alexandre Courbot <gnurou@gmail.com>,
Linux-OMAP <linux-omap@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Sascha Hauer <kernel@pengutronix.de>
Subject: Re: [PATCH] gpio: omap: make gpio numbering deterministical by using of aliases
Date: Wed, 15 Jun 2016 09:24:04 +0200 [thread overview]
Message-ID: <20160615072404.GB26768@pengutronix.de> (raw)
In-Reply-To: <CACRpkdaVRTj4jpGQp9nDKo8RAPDPUaApp4jAdBGRgd45bqo2zQ@mail.gmail.com>
Hello Linus,
On Wed, Jun 15, 2016 at 08:56:58AM +0200, Linus Walleij wrote:
> On Tue, Jun 14, 2016 at 12:03 PM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>
> > Traditionally the n-th gpio device probed by the omap gpio driver got
> > the gpio number range [n*32 .. n*32+31].
> > When order of the devices probed by the driver changes (which can happen
> > already now when some devices have a pinctrl and so the first probe
> > attempt returns -ENODEV) the numbering changes.
> >
> > To ensure a deterministical numbering use of_alias_get_id to determine
> > the number base for a given device. If no respective alias exists fall
> > back to the traditional numbering.
>
> I'm not too happy about this approach.
>
> The patch doesn't mention what practical problems it is trying to
> solve.
the practical problem is that a (binary-only and hardware specific)
application uses GPIO47 via /sys/class/gpio and this number refers to
the wrong GPIO since I introduced gpio-hogs in the device tree together
with pinctrl stuff to make the gpio-hogs work.
I agree that this doesn't need to be a reason to care for it from a
mainline POV.
> The GPIO numbering scheme is a matter of Linux internals and
> not about hardware description IMO.
Not sure if I should agree here or not. It's very usual that the
"internal" gpio numbers match the hardware reference manual. I know this
from imx, at91, all pre-dt platforms, I'm sure there are more, and I bet
I'm not the only one relying on this for omap.
And this is very usual in the dt world, too:
$ git grep -El 'gpio. = \&gpio' arch/arm/boot/dts | wc -l
37
> The way forward is to use the character device and use gpiochip
> devices with offset indexes and look up GPIOs by name from the
> character devices. If nothing substantial happens I am merging the
> final pieces of the GPIO chardev ABI for v4.8 and that is doing all that
> sysfs was doing and then some. I just need to change a small thing
> before sending the final version for review.
Hmm, so /sys/class/gpio was obsoleted before the substitution was ready?
I'd say an overlapping of several kernel versions would be good as we
cannot expect that userspace changes as fast as the kernel.
Independent of the inclusion of my patch series in the mainline kernel
I'll have to use it on my custom kernel to keep the hardware do what it
should.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
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-06-15 7:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-14 10:03 [PATCH] gpio: omap: make gpio numbering deterministical by using of aliases Uwe Kleine-König
2016-06-14 11:18 ` Grygorii Strashko
2016-06-14 12:01 ` Uwe Kleine-König
2016-06-14 15:10 ` Grygorii Strashko
2016-06-15 0:00 ` kbuild test robot
2016-06-15 6:56 ` Linus Walleij
2016-06-15 7:24 ` Uwe Kleine-König [this message]
2016-06-15 8:27 ` Tony Lindgren
2016-06-15 9:56 ` Grygorii Strashko
2016-06-18 8:30 ` Linus Walleij
2016-06-18 8:29 ` Linus Walleij
2016-06-18 8:25 ` Linus Walleij
2016-06-19 1:08 ` Uwe Kleine-König
2016-06-22 16:16 ` Mark Rutland
2016-06-23 9:04 ` Linus Walleij
2016-06-23 9:38 ` Grygorii Strashko
2016-06-23 12:08 ` Linus Walleij
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=20160615072404.GB26768@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=gnurou@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=kernel@pengutronix.de \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=ssantosh@kernel.org \
/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).