Quantcast
Viewing all articles
Browse latest Browse all 4852

Device Tree • Re: PWM driver questions

Apologies if you aren't targetting Pi 5 specifically - everything else seems to be Pi 5 at the moment.

If you restrict yourself to GPIOs 12 & 13 then you can make your overlay cross platform. The legacy brcm,pins style of pinmux declaration is supported on Pi 5, using the same numbering as BCM2711/Pi 4 - what you had before looked fine. Also, the rp1_pwm0 node has other labels - pwm and pwm0 - for backwards-compatability. I already used that in my overlay, just not consistently.

Code:

/dts-v1/;/plugin/;/ {compatible = "brcm,bcm2835";fragment@0 {target = <&gpio>;__overlay__ {williespwm_pins: williespwm_pins {brcm,pins = <12>;brcm,function = <4>;};};};fragment@1 {target = <&pwm>;__overlay__ {status = "okay";};};fragment@2 {target-path = "/";__overlay__ {williespwm {compatible = "williespwm";pwms = <&pwm 0 3500000 0>;pinctrl-names = "default";pinctrl-0 = <&williespwm_pins>;status = "okay";};};};};

Statistics: Posted by PhilE — Sat Mar 09, 2024 8:02 am



Viewing all articles
Browse latest Browse all 4852

Trending Articles