From: Stephen Warren <swarren@wwwdotorg.org>
To: Matthias Klein <matthias.klein@linux.com>,
linux-rpi-kernel@lists.infradead.org, linus.walleij@linaro.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] pinctrl: bcm2835: Start GPIO numeration at zero
Date: Mon, 27 Oct 2014 18:00:54 -0600 [thread overview]
Message-ID: <544EDCB6.7090001@wwwdotorg.org> (raw)
In-Reply-To: <544ECFB4.7040704@linux.com>
On 10/27/2014 05:05 PM, Matthias Klein wrote:
>
> Am 27.10.2014 um 23:44 schrieb Stephen Warren:
>> On 10/27/2014 04:09 PM, Matthias Klein wrote:
>>> Numerate the GPIOs from 0..53 instead of 202..255.
>>
>> What's the motivation for this? The GPIO IDs should all come from DT,
>> which encodes everything as an ID relative to a particular
>> controllers, and hence the actual value of the base address should be
>> irrelevant.
>
> - To be in sync with the GPIO numbers in the datasheet / documentation
I assume that's only relevant because of the second point; the GPIO IDs
in DT files already match the datasheet.
> - For userland applications which rely on these GPIO numbers
This isn't a scalable solution for that; this "fix" can only work for a
single GPIO controller in any one system. It'd be better for all usage
to search for the correct GPIO controller in sysfs, find the base
address of that, and then add on the controller-relative GPIO ID. That
way, the same approach is taken irrespective of which GPIO controller is
in use, and there are no special cases.
Perhaps this could be simplified (removing the need to adding
base+offset to get the Linux ID) if the GPIO core exported a
per-controller directory in sysfs for GPIO manipulation (the files in
which used controller-relative numbering), rather than having a single
directory using Linux-internal global GPIO numbering; something like
/sys/class/gpio/gpio@7e200000/export which uses ID 0..N vs.
/sys/class/gpio/export which uses IDs X..X+N where X is arbitary.
next prev parent reply other threads:[~2014-10-28 0:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 22:09 [PATCH v2] pinctrl: bcm2835: Start GPIO numeration at zero Matthias Klein
2014-10-27 22:44 ` Stephen Warren
2014-10-27 23:05 ` Matthias Klein
2014-10-28 0:00 ` Stephen Warren [this message]
2014-10-28 7:10 ` Matthias Klein
[not found] ` <544F3FDA.60407@linux.com>
2014-10-29 1:15 ` Stephen Warren
2014-10-31 9:49 ` Linus Walleij
2014-11-01 6:13 ` Alexandre Courbot
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=544EDCB6.7090001@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=matthias.klein@linux.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