Skip to content

Commit 2295d33

Browse files
TonyHan11cfriedt
authored andcommitted
boards: microchip: sam: add PWM to sama7g54-ek dts and yaml files
Add PWM and pwmled nodes to sama7g54_ek.dts file. Add pwm to sama7g54_ek.yaml support list. Signed-off-by: Tony Han <[email protected]>
1 parent 802fdc4 commit 2295d33

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

boards/microchip/sam/sama7g54_ek/sama7g54_ek.dts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <dt-bindings/gpio/gpio.h>
1313
#include <dt-bindings/gpio/microchip-sam-gpio.h>
1414
#include <dt-bindings/input/input-event-codes.h>
15+
#include <dt-bindings/pwm/pwm.h>
1516
#include <microchip/sam/sama7g5.dtsi>
1617

1718
/ {
@@ -20,6 +21,7 @@
2021

2122
aliases {
2223
led0 = &led_green;
24+
pwm-led0 = &pwm_led_green;
2325
sw0 = &button_user;
2426
sdhc0 = &sdmmc0;
2527
sdhc1 = &sdmmc1;
@@ -76,6 +78,19 @@
7678
zephyr,code = <INPUT_KEY_0>;
7779
};
7880
};
81+
82+
pwmleds: pwmleds {
83+
compatible = "pwm-leds";
84+
status = "disabled"; /* Conflict with leds. */
85+
86+
pwm_led_green: pwm_led_green {
87+
pwms = <&pwm 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
88+
};
89+
90+
pwm_led_blue: pwm_led_blue {
91+
pwms = <&pwm 3 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
92+
};
93+
};
7994
};
8095

8196
&flx3 {
@@ -138,6 +153,18 @@
138153
};
139154
};
140155

156+
pinctrl_mikrobus_pwm_default: pinctrl_mikrobus_pwm_default {
157+
mikrobus1_pwm2 {
158+
pinmux = <PIN_PA13__PWMH2>;
159+
bias-disable;
160+
};
161+
162+
mikrobus2_pwm3 {
163+
pinmux = <PIN_PD20__PWMH3>;
164+
bias-disable;
165+
};
166+
};
167+
141168
pinctrl_sdmmc0_default: sdmmc0_default {
142169
cmd_data {
143170
pinmux = <PIN_PA1__SDMMC0_CMD>,
@@ -185,6 +212,11 @@
185212
clock-frequency = <DT_FREQ_M(10)>;
186213
};
187214

215+
&pwm {
216+
pinctrl-0 = <&pinctrl_mikrobus_pwm_default>;
217+
pinctrl-names = "default";
218+
};
219+
188220
&sdmmc0 {
189221
pinctrl-names = "default";
190222
pinctrl-0 = <&pinctrl_sdmmc0_default>;

boards/microchip/sam/sama7g54_ek/sama7g54_ek.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ toolchain:
99
- zephyr
1010
ram: 128
1111
supported:
12+
- pwm
1213
- sdhc
1314
- shell
1415
- uart

0 commit comments

Comments
 (0)