Re: AM335x: how to mux a pin for libgpiod to use?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux