public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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: Tue, 28 Oct 2014 19:15:09 -0600	[thread overview]
Message-ID: <54503F9D.7080808@wwwdotorg.org> (raw)
In-Reply-To: <544F3FDA.60407@linux.com>

On 10/28/2014 01:03 AM, Matthias Klein wrote:
> 
> Am 28.10.2014 um 01:00 schrieb Stephen Warren:
>> On 10/27/2014 05:05 PM, Matthias Klein wrote:
>>
>>> - 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.
> 
> Would you accept a patch which implements the "gpio-base" property into
> the device tree for pinctrl-bcm2835?

DT is supposed to represent HW features, in an OS-agnostic way, and a
"GPIO base" is a Linux-specific SW concept.

  parent reply	other threads:[~2014-10-29  1:15 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
2014-10-28  7:10       ` Matthias Klein
     [not found]       ` <544F3FDA.60407@linux.com>
2014-10-29  1:15         ` Stephen Warren [this message]
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=54503F9D.7080808@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