linux-kernelbeagleboneblackdevice-treepwm

Linux kernel - BeagleBone - PWM pin multiplexing - Device Tree


I'm trying to multiplex the gpmc_ad9 pin in PWM mode through the device tree.

File arch/arm/boot/dts/am335x-boneblack.dts

&am33xx_pinmux {
    hw_pins: hw_pins {
        pinctrl-single,pins = <
             AM33XX_IOPAD(0x824, PIN_OUTPUT | MUX_MODE4)    /* gpmc_ad9.ehrpwm2B  */
        >;
     };
};

/ {
    soc {
        pinctrl-names = "default";
        pinctrl-0 = <&hw_pins>;
    };
};

However, the debugfs still shows mode 7 for the pin:

cd /sys/kernel/debug/pinctrl/44e10800.pinmux-pinctrl-single
cat pins | grep 824

Output:

pin 9 (PIN9) 44e10824 00000027 pinctrl-single

I don't see in the device tree that this pin gets redefined.

What am I doing wrong here?


Solution

  • I've found the solution; I had to put the pinctrl properties inside another node.

    I guess that's because the 'soc' node already has pinctrl properties defined.

    &am33xx_pinmux {
        hw_pins: hw_pins {
            pinctrl-single,pins = <
                 AM33XX_IOPAD(0x824, PIN_OUTPUT | MUX_MODE4)    /* gpmc_ad9.ehrpwm2B  */
            >;
         };
    };
    
    / {
        soc {
            mydriver {
                  compatible = "mydriver";
    
                  pinctrl-names = "default";
                  pinctrl-0 = <&hw_pins>;
            };
        };
    };