devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <colin.helliwell-ZqAGQOxBGgIxoycv7ERPSQ@public.gmane.org>
To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Device driver - parsing GPIOs from tree
Date: Tue, 25 Oct 2016 13:50:45 +0100	[thread overview]
Message-ID: <047d01d22ebe$6803f740$380be5c0$@ln-systems.com> (raw)
In-Reply-To: 

I'm writing my own device driver for some GPIOs on my hardware. I’ve
successfully created the pins in the Device Tree, and in my driver I’ve been
able to find the pins in the device tree using 'of_get_named_gpio_flags()'
when they are at a top level (e.g. ‘test-name’ shown below).
But for neatness I would prefer to group them hierarchically e.g.

    rfctrl: rfctrl {
        compatible = "wg2xx-rfctrl";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_rfctrl>;
        status = "okay";

        test-name = <&gpio4 25 0>;
        jn {
            jnProgN = <&gpio4 26 0>;
        };
        alt {
            altGpio0 = <&gpio4 27 0 >;
            altGpio1 = <&gpio4 28 0 >;
            altGpio2 = <&gpio4 29 0 >;
            altGpio3 = <&gpio4 30 0 >;
        };
    };
 
Is there a way to search within the subtree ("jn" or "alt"), or to descend
into it and then use 'of_get_named_gpio_flags()’?
Thanks.


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

                 reply	other threads:[~2016-10-25 12:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='047d01d22ebe$6803f740$380be5c0$@ln-systems.com' \
    --to=colin.helliwell-zqagqoxbggixoycv7erpsq@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@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).