Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8093

Device Tree • Re: PWM driver questions

$
0
0

Code:

    compatible = "brcm,bcm2835";    /* PWM0 function */    fragment@0 {        target = <&gpio>;        __overlay__ {            pwm_pins: pwm_pins {                brcm,pins = <12>;                brcm,function = <4>;                brcm,pull = <0>;            };        };    };    fragment@1 {        target = <&pwm>;        frag1: __overlay__ {            pinctrl-names = "default";            pinctrl-0 = <&pwm_pins>;            assigned-clock-rates = <100000000>;            status = "okay";        };    };
This needs to go into your overlay.
As PWM on GPIO12 is PWM0_0 below is still valid
I am missing something I create pwm-gpio12.dtbo in /boot/overlays and added dtoverlay=pwm-gpio12 to /boot/config.txt from. This on Pi5 running 6.1.0-rpi6-rpi-2712.

Code:

/dts-v1/;/plugin/;/ {    compatible = "brcm,bcm2835";    /* PWM0 function */    fragment@0 {        target = <&gpio>;        __overlay__ {            pwm_pins: pwm_pins {                brcm,pins = <12>;                brcm,function = <4>;                brcm,pull = <0>;            };        };    };    fragment@1 {        target = <&pwm>;        frag1: __overlay__ {            pinctrl-names = "default";            pinctrl-0 = <&pwm_pins>;            assigned-clock-rates = <100000000>;            status = "okay";        };    };};

neither my driver/program or the sysfs interface seem to work on gpio12. Let me know if you see what I a doing wrong.

Thanks

Statistics: Posted by wkeeling — Sun Mar 03, 2024 7:41 pm



Viewing all articles
Browse latest Browse all 8093

Trending Articles