Skip to content

Commit 9f02551

Browse files
nandojvembolivar-nordic
authored andcommitted
drivers: pwm: sam: Enable sam3x and sam4e SoCs
Add support to Atmel SAM SAM3X and SAM4E PWM feature. Signed-off-by: Gerson Fernando Budke <[email protected]>
1 parent d2e9b46 commit 9f02551

File tree

6 files changed

+55
-3
lines changed

6 files changed

+55
-3
lines changed

boards/arm/arduino_due/arduino_due-pinctrl.dtsi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Gerson Fernando Budke <[email protected]>
2+
* Copyright (c) 2022-2023, Gerson Fernando Budke <[email protected]>
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -52,4 +52,11 @@
5252
<PD4B_USART3_TXD>;
5353
};
5454
};
55+
56+
pwm0_default: pwm0_default {
57+
group1 {
58+
pinmux = <PC4B_PWM_PWML1>,
59+
<PC5B_PWM_PWMH1>;
60+
};
61+
};
5562
};

boards/arm/arduino_due/arduino_due.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
uart-0 = &uart;
1414
i2c-0 = &twi0;
1515
i2c-1 = &twi1;
16+
pwm-0 = &pwm0;
1617
led0 = &yellow_led;
1718
watchdog0 = &wdt;
1819
};
@@ -64,4 +65,11 @@
6465
pinctrl-names = "default";
6566
};
6667

68+
&pwm0 {
69+
status = "okay";
70+
71+
pinctrl-0 = <&pwm0_default>;
72+
pinctrl-names = "default";
73+
};
74+
6775
arduino_i2c: &twi1 { };

boards/arm/sam4e_xpro/sam4e_xpro-pinctrl.dtsi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Gerson Fernando Budke <[email protected]>
2+
* Copyright (c) 2022-2023, Gerson Fernando Budke <[email protected]>
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -74,4 +74,11 @@
7474
<PA25A_USART1_CTS>;
7575
};
7676
};
77+
78+
pwm0_default: pwm0_default {
79+
group1 {
80+
pinmux = <PD20A_PWM_PWMH0>,
81+
<PD24A_PWM_PWML0>;
82+
};
83+
};
7784
};

boards/arm/sam4e_xpro/sam4e_xpro.dts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 Gerson Fernando Budke
2+
* Copyright (c) 2019-2023 Gerson Fernando Budke
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -15,6 +15,7 @@
1515

1616
aliases {
1717
i2c-0 = &twi0;
18+
pwm-0 = &pwm0;
1819
led0 = &yellow_led_1;
1920
sw0 = &user_button;
2021
wdog = &wdt;
@@ -187,6 +188,13 @@
187188
pinctrl-names = "default";
188189
};
189190

191+
&pwm0 {
192+
status = "okay";
193+
194+
pinctrl-0 = <&pwm0_default>;
195+
pinctrl-names = "default";
196+
};
197+
190198
&wdt {
191199
status = "okay";
192200
};

dts/arm/atmel/sam3x.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,17 @@
229229
status = "disabled";
230230
};
231231

232+
pwm0: pwm@40094000 {
233+
compatible = "atmel,sam-pwm";
234+
reg = <0x40094000 0x4000>;
235+
interrupts = <36 1>;
236+
clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
237+
prescaler = <10>;
238+
divider = <1>;
239+
#pwm-cells = <3>;
240+
status = "disabled";
241+
};
242+
232243
rstc: rstc@400e1a00 {
233244
compatible = "atmel,sam-rstc";
234245
reg = <0x400e1a00 0x10>;

dts/arm/atmel/sam4e.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,17 @@
248248
status = "disabled";
249249
};
250250

251+
pwm0: pwm@40000000 {
252+
compatible = "atmel,sam-pwm";
253+
reg = <0x40000000 0x4000>;
254+
interrupts = <36 1>;
255+
clocks = <&pmc PMC_TYPE_PERIPHERAL 36>;
256+
prescaler = <10>;
257+
divider = <1>;
258+
#pwm-cells = <3>;
259+
status = "disabled";
260+
};
261+
251262
rstc: rstc@400e1800 {
252263
compatible = "atmel,sam-rstc";
253264
reg = <0x400e1800 0x10>;

0 commit comments

Comments
 (0)