From: benh@kernel.crashing.org (Benjamin Herrenschmidt)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 2/2] ARM:Tegra: Device Tree Support: Initialize audio card gpio's from the device tree.
Date: Tue, 31 May 2011 09:26:00 +1000 [thread overview]
Message-ID: <1306797960.7481.640.camel@pasglop> (raw)
In-Reply-To: <20110530061155.GC23517@ponder.secretlab.ca>
On Mon, 2011-05-30 at 00:11 -0600, Grant Likely wrote:
> > Interesting... what was the reasoning behind this? It's a definite
> > step backwards but it does explain my major concern with the new batch
> > of device tree patches.
>
> The binding for gpios was defined a few years ago and it is in fairly
> wide use within the powerpc sphere. The design followed the pattern
> established for specifying irqs, and in that regard satisfied the
> principle of least surprise.
>
> That said, it isn't a very large leap to go from a single 'gpios'
> property to allowing multiple named gpios properties with meaningful
> names, particularly if they are fully specified by the device
> binding, and they follow exactly the same binding semantics as the
> existing 'gpios' proprety (phandle + gpio specifier).
>
> Personally, I'm /cautious/ about saying okay to extending the binding,
> simply because once the extension is in use it is really hard to go
> back on it, but I cannot think of any reason why this particular case
> wouldn't be a good idea. Anyone have thoughts on this? Ben? Mitch?
So first, I wasn't involved in the definition of the GPIO binding much
if at all :-)
Second, I can see advantages in both the numbered and the named
approaches, it's not totally clear cut and it's definitely not a
"definite step backward" which explains "major concerns" since, Mark,
you just discovered it ;-) You -do- write like you just found the excuse
for your general hostility :-)
Now more seriously, referencing GPIOs as a list of phandle/number in an
array has the advantage of being compact. It works well for many setups,
and GPIOs in practice are -often- referenced by number within a GPIO
block. I think it's probably the right approach to "target" a given GPIO
-provider-.
The question is how do you relate the entries in that array with
basically wires on the "client" chip. This is the same problem faced by
the clock binding btw, tho there's usually a bit less clocks than GPIOs
(but still more than interrupts :-)
The approach apple uses is interesting, where they essentially use
device-specific properties that contain a GPIO binding. For example, a
reset-gpio property, that points to the GPIO doing the reset, etc...
We -could- do just that. For 'busses' such a property can easily contain
more than one entry.
Or we could keep a gpio "map" and have a parallel property to name the
entries like I was originally thinking for the clocks.
In any case, it's something that can reasonably easily be added on top
of the existing binding, and it would be much more productive Mark if
you actually proposed solutions rather than just opposing things :-)
Cheers,
Ben.
next prev parent reply other threads:[~2011-05-30 23:26 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-27 20:56 [RFC 0/2] ARM: Tegra: Device Tree: Audio John Bonesio
[not found] ` <20110527205721.21000.78599.stgit@riker>
2011-05-27 21:06 ` [RFC 2/2] ARM:Tegra: Device Tree Support: Initialize audio card gpio's from the device tree Grant Likely
2011-05-28 1:24 ` Mark Brown
2011-05-30 3:11 ` Olof Johansson
2011-05-30 3:38 ` Mark Brown
2011-05-30 6:11 ` Grant Likely
2011-05-30 6:18 ` Mitch Bradley
2011-05-30 6:22 ` Grant Likely
2011-05-30 7:01 ` Mark Brown
2011-05-30 16:22 ` Grant Likely
2011-05-30 18:54 ` Segher Boessenkool
2011-05-30 19:20 ` Grant Likely
2011-05-30 20:53 ` Mitch Bradley
2011-05-31 17:55 ` Stephen Warren
2011-05-31 18:42 ` Mitch Bradley
2011-06-01 15:59 ` Stephen Warren
2011-06-01 16:18 ` Mark Brown
2011-06-02 15:40 ` Grant Likely
2011-06-01 21:32 ` Mitch Bradley
2011-06-03 21:24 ` Stephen Warren
2011-06-04 0:25 ` Mitch Bradley
2011-06-02 14:59 ` Grant Likely
2011-06-02 15:40 ` Grant Likely
2011-06-28 21:39 ` Grant Likely
2011-05-30 23:27 ` Benjamin Herrenschmidt
2011-05-30 23:49 ` Olof Johansson
2011-05-31 0:58 ` Segher Boessenkool
2011-05-31 10:24 ` Mark Brown
2011-05-30 7:10 ` Mark Brown
2011-05-30 23:26 ` Benjamin Herrenschmidt [this message]
2011-05-31 10:03 ` Mark Brown
[not found] ` <20110527205706.21000.34832.stgit@riker>
2011-05-27 21:05 ` [RFC 1/2] ARM:Tegra: Device Tree Support: Initialize the audio card " Grant Likely
2011-05-28 1:28 ` Mark Brown
2011-06-01 7:07 ` Barry Song
2011-06-01 16:47 ` Grant Likely
2011-06-02 9:07 ` Barry Song
2011-06-02 16:04 ` Grant Likely
2011-06-02 16:21 ` Barry Song
2011-06-02 21:43 ` Russell King - ARM Linux
2011-06-03 2:32 ` Barry Song
2011-06-03 6:20 ` Russell King - ARM Linux
2011-06-02 21:36 ` Russell King - ARM Linux
2011-06-03 1:19 ` Barry Song
2011-06-07 3:44 ` Barry Song
2011-06-14 15:42 ` Grant Likely
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=1306797960.7481.640.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=linux-arm-kernel@lists.infradead.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).