From: Alex Courbot <acourbot@nvidia.com>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: How about a gpio_get(device *, char *) function?
Date: Thu, 1 Nov 2012 11:48:13 +0900 [thread overview]
Message-ID: <17133691.o4iLtizVux@percival> (raw)
In-Reply-To: <509142F5.4010307@wwwdotorg.org>
On Wednesday 31 October 2012 23:25:41 Stephen Warren wrote:
> On 10/31/2012 03:04 AM, Alex Courbot wrote:
> > Hi,
> >
> > Would anyone be opposed to having a gpio_get() function that works
> > similarly to e.g. regulator_get() and clk_get()?
>
> One major stumbling block is that with device tree, each individual
> binding gets to decide on the specific naming of the propert{y,ies} that
> define the GPIO(s) for the device, and so there's no way to provide a
> generic implementation of that function.
The idea is not to make every GPIOs declared so far accessible through this
function - as you point out this would be tricky at best - but to also define
how they should be properly declared (similarly to regulators and pals) for
bindings that need to use get_gpio(). Existing bindings and drivers that can
live without it should not be modified. And now that you mention it, the end of
the GPIO declaration anarchy would be another point in favor of this feature.
Now I am aware that almost every subsystem comes with its own scheme for
declaring resources in the DT and there will be an long fight to decide which
one should apply here, but I'm willing to take that road.
> Related, I've always wished that DT nodes looked like:
>
> device {
> reg = <...>;
> compatible = <...>;
> resources {
> pwms = <...>;
> regulators = <...>;
> clocks = <...>;
> gpios = <...>;
> other-devices = <...>; /* for custom API dependencies */
> };
> config {
> /* device-specific properties */
> };
> child-busses {
> 0 = { ... };
> 1 = { ... };
> };
> };
>
> ... specifically so that all resource allocation, and perhaps even child
> bus enumeration, could be completely standardized in the DT/device core.
> This could also feed into deferred probe, which could then be purely
> implemented inside the DT/driver core. However, that'd require something
> incompatible like "device tree 2.0"
I think this would be awesome. This could even probably be implemented without
breaking things, if everything takes place inside well-defined subnodes of the
device.
Alex.
next prev parent reply other threads:[~2012-11-01 2:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-31 9:04 Alex Courbot
2012-10-31 15:25 ` Stephen Warren
2012-11-01 2:48 ` Alex Courbot [this message]
2012-11-04 18:04 ` Linus Walleij
2012-11-05 7:31 ` Alex Courbot
2012-11-05 12:09 ` Linus Walleij
2012-11-26 11:25 ` Grant Likely
2012-11-05 17:35 ` Stephen Warren
2012-11-06 1:33 ` Alex Courbot
2012-11-07 21:24 ` Linus Walleij
2012-11-08 6:14 ` Alex Courbot
2012-11-08 6:23 ` Alex Courbot
2012-11-13 13:13 ` Linus Walleij
2012-11-07 21:28 ` Linus Walleij
2012-11-26 11:14 ` Grant Likely
2012-11-28 3:38 ` Alex Courbot
2012-11-29 17:34 ` Grant Likely
2012-12-01 18:41 ` Linus Walleij
2012-12-03 14:15 ` Grant Likely
2012-11-26 11:17 ` 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=17133691.o4iLtizVux@percival \
--to=acourbot@nvidia.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swarren@wwwdotorg.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
Powered by JetHome