boards: nrf: Align with recent changes made to pwm_nrf5_sw driver

... and "nordic,nrf-sw-pwm" binding:

- add `channel-gpios` property with GPIO assignments for PWM channels
  to `sw_pwm` nodes
- use channel indexes instead of pin numbers in `pwms` properties that
  define PWM LEDs
- add the period and flags cells to `pwms` properties in all PWM LED
  definitions; use the commonly used period of 20 ms (giving 50 Hz)
  as a default setting

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-04-14 17:09:52 +02:00 committed by Carles Cufí
parent 793362ae5a
commit f301dc2382
2 changed files with 14 additions and 2 deletions

View file

@ -46,7 +46,7 @@
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&sw_pwm 21>;
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};
@ -85,6 +85,12 @@
};
};
&sw_pwm {
status ="okay";
channel-gpios = <&gpio0 21 0>;
clock-prescaler = <8>;
};
&gpiote {
status = "okay";
};

View file

@ -42,7 +42,7 @@
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&sw_pwm 21>;
pwms = <&sw_pwm 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};
@ -55,6 +55,12 @@
};
};
&sw_pwm {
status ="okay";
channel-gpios = <&gpio0 21 0>;
clock-prescaler = <8>;
};
&gpiote {
status ="okay";
};