devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Thu, 02 Aug 2012 23:28:48 -0600	[thread overview]
Message-ID: <501B6190.9060101@wwwdotorg.org> (raw)
In-Reply-To: <CAL1wa8fdYCmTNpO=7v5S7o-Oi3nRD_7uUgCCVpM5TEP9ZUXedw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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.

Perhaps the GPIO controller referenced by &gpx0 has #gpio-cells=1?

Alternatively, the GPIO controller's xlate function may simply be
setting the flags value to 0, rather than deriving the value from the
extra cells in the GPIO specifier.

Either way, the mux function, pull, and driver strength should be
represented using the pinctrl bindings not as part of the GPIO
specifier. See Documentation/devicetree/bindings/pinctrl/pinctrl.txt for
the basics.

  parent reply	other threads:[~2012-08-03  5:28 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 [this message]
     [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

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=501B6190.9060101@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).