From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Leela Krishna Amudala
<leelakrishna.a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: <Query> How to read arguments from a gpio handle
Date: Fri, 03 Aug 2012 09:34:57 -0600 [thread overview]
Message-ID: <501BEFA1.8030303@wwwdotorg.org> (raw)
In-Reply-To: <CAL1wa8cJpcnNZ_p6Ueu07GQ=m2zP6MpQHKqC4dKGDFVO7zRY2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 08/03/2012 02:47 AM, Leela Krishna Amudala wrote:
> Hello,
>
> On Fri, Aug 3, 2012 at 10:58 AM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
>> On 08/02/2012 09:39 PM, Leela Krishna Amudala wrote:
>>> Hello,
>>>
>>> Can some one please tell me how to read the args from the gpio handle
>>>
>>> For example:
>>> Consider lcd-reset-gpio = <&gpx0 1 2 3 4>; as my phandle.
>>>
>>> The 4 args in the above handle denotes
>>>
>>> <[phandle of the gpio controller node]
>>> [pin number within the gpio controller]
>>> [mux function]
>>> [pull up/down]
>>> [drive strength]>
>>>
>>> My intention is to read the "mux function" and "pull up/down" values
>>> from the above handle and do the corresponding operations on that
>>> particular gpio.
>>>
>>> I tried using of_get_named_gpio_flags(struct device_node *np, const
>>> char *propname,
>>> int index, enum of_gpio_flags *flags);
>>> function and I always gets the flags value as '0' irrespective of the
>>> values present in phandle of GPIO.
...
> I got the required values using of_parse_phandle_with_args() function.
OK, you can certainly do that, but I fully expect pushback on such code
if you try and upstream it. Also, it's most likely fragile if your DT
property needs to represent a list of GPIOs rather than just 1, given
that of_get_named_gpio_flags() doesn't do what you'd expect.
prev parent reply other threads:[~2012-08-03 15:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 3:39 <Query> How to read arguments from a gpio handle Leela Krishna Amudala
[not found] ` <CAL1wa8fdYCmTNpO=7v5S7o-Oi3nRD_7uUgCCVpM5TEP9ZUXedw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-03 4:40 ` Daniel Mack
2012-08-03 5:28 ` Stephen Warren
[not found] ` <501B6190.9060101-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-08-03 8:47 ` Leela Krishna Amudala
[not found] ` <CAL1wa8cJpcnNZ_p6Ueu07GQ=m2zP6MpQHKqC4dKGDFVO7zRY2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-03 15:34 ` Stephen Warren [this message]
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=501BEFA1.8030303@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
--cc=leelakrishna.a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).