From: Drew Fustini <drew@beagleboard.org>
To: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org,
Jason Kridner <jkridner@beagleboard.org>,
Robert Nelson <robertcnelson@gmail.com>
Subject: Re: AM335x: how to mux a pin for libgpiod to use?
Date: Fri, 26 Jun 2020 17:57:05 +0200 [thread overview]
Message-ID: <20200626155705.GA80557@x1> (raw)
In-Reply-To: <8d5ff801-62a1-935e-3746-e1c51817a3b6@ti.com>
On Fri, Jun 26, 2020 at 01:36:50PM +0300, Grygorii Strashko wrote:
>
>
> On 26/06/2020 02:22, Drew Fustini wrote:
> > I am trying to determine an upstream method to be able to mux an AM3358
> > pin to gpio and then allow that line to be used from the gpiod userspace
> > ABI. A "pinctrl-single,pins" device tree property can easily define a
> > gpio mux for a given pin. For example, the P9_14 pin on the BeagleBone
> > [0] can be set to gpio (mode 7) with this node:
> >
> > P9_14_gpio_pin: pinmux_P9_14_gpio_pin {
> > pinctrl-single,pins = <
> > AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_INPUT_PULLDOWN, MUX_MODE7)
> > >;
> > };
> >
> > GPMC_A2 is gpio1_18 per the AM3358 datasheet [1]. Normally, a node for
> > a driver, like gpio-keys, would have a gpio property that cause the
> > driver to claim the gpio line. But, in that case, the line will not be
> > available to be used through the gpiod userspace ABI.
> >
> > If no driver claims the gpio line, then I find that the pin mux in
> > "pinctrl-single,pins" does not get applied by the pinctrl-single driver.
>
> pinmux node can have default node by itself, like
>
> &am43xx_pinmux {
> pinctrl-names = "default";
> pinctrl-0 = <&cm_t43_led_pins>;
>
Thank you, this is what I was missing.
I think this should do what I was looking for:
&am33xx_pinmux {
pinctrl-names = "default";
pinctrl-0 = <&libgpiod_pins>;
libgpiod_pins: pinmux-libgpiod-pins {
pinctrl-single,pins = <
AM33XX_PADCONF(AM335X_PIN_GPMC_A2, PIN_INPUT_PULLDOWN, MUX_MODE7)
>;
};
-Drew
prev parent reply other threads:[~2020-06-26 15:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 23:22 AM335x: how to mux a pin for libgpiod to use? Drew Fustini
2020-06-26 10:36 ` Grygorii Strashko
2020-06-26 15:57 ` Drew Fustini [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=20200626155705.GA80557@x1 \
--to=drew@beagleboard.org \
--cc=grygorii.strashko@ti.com \
--cc=haojian.zhuang@linaro.org \
--cc=jkridner@beagleboard.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=robertcnelson@gmail.com \
--cc=tony@atomide.com \
/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).