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

Device Tree • Re: Pi5 - overlay for enabling 3 SPI interfaces and using RP1 PWM controller

$
0
0
Why are you trying to define the RP1 PWM node? It's already defined by https://github.com/raspberrypi/linux/bl ... #L380-L388
It's then aliased to pwm0 and pwm by https://github.com/raspberrypi/linux/bl ... #L172-L174

About the only property of it that you should be poking is status to enable it.

It should behave in the same in the same way as all the existing overlays using &pwm.
as said, there is no example.
In pre-Pi5 days I did it like this.

Code:

#include <dt-bindings/pinctrl/bcm2835.h>/ {compatible = "brcm,bcm2835";/* PWM0 function */fragment@0 {target = <&gpio>;__overlay__ {pwm_pins: pwm_pins {brcm,pins = <18 19>;brcm,function = <BCM2835_FSEL_ALT5>;brcm,pull = <0>;};};};fragment@1 {target = <&pwm>;frag1: __overlay__ {pinctrl-names = "default";pinctrl-0 = <&pwm_pins>;assigned-clock-rates = <1000000000>;status = "okay";};};fragment@2 {target-path = "/";__overlay__ {//#gpio-cells = <2>;/* Panel backlight through PWM0 on GPIO 18 */backlight_lcd0: backlight_lcd0 {compatible = "pwm-backlight";pwms = <&pwm 0 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};/* Panel backlight through PWM1 on GPIO 19 */backlight_lcd1: backlight_lcd1 {compatible = "pwm-backlight";pwms = <&pwm 1 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};};};
How to change @0 and @1 if case I want to change @2 like below:

Code:

fragment@2 {target-path = "/";__overlay__ {/* Panel backlight through PWM0[0] on GPIO 12 */backlight_lcd0: backlight_lcd0 {compatible = "pwm-backlight";pwms = <&pwm0 0 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};/* Panel backlight through PWM0[1] on GPIO 13 */backlight_lcd1: backlight_lcd1 {compatible = "pwm-backlight";pwms = <&pwm0 1 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};/* Panel backlight through PWM0[2] on GPIO 14*/backlight_lcd2: backlight_lcd2 {compatible = "pwm-backlight";pwms = <&pwm0 2 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};/* Panel backlight through PWM0[3]on GPIO 15*/backlight_lcd3: backlight_lcd3 {compatible = "pwm-backlight";pwms = <&pwm0 3 3500000 0>; brightness-levels = <0  1000>;num-interpolated-steps = <1000>;default-brightness-level = <800>;};};};
is it just getting rid of @0 and

Code:

fragment@1 {target = <&pwm0>;status = "okay";};};

Statistics: Posted by aBUGSworstnightmare — Wed Feb 21, 2024 5:42 pm



Viewing all articles
Browse latest Browse all 4962

Trending Articles