Skip to content

Commit da687ab

Browse files
Hieu Nguyentiennguyenzg
authored andcommitted
tests: drivers: pwm: Add PWM support for Renesas RZ/A3UL
Add PWM test support for Renesas RZ/A3UL-SMARC Signed-off-by: Hieu Nguyen <[email protected]> Signed-off-by: Tien Nguyen <[email protected]>
1 parent 244f550 commit da687ab

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&mtu1 {
8+
prescaler = <4>;
9+
status = "okay";
10+
11+
pwm1: pwm {
12+
status = "okay";
13+
pinctrl-0 = <&mtu1_pins>;
14+
pinctrl-names = "default";
15+
};
16+
};

tests/drivers/pwm/pwm_api/src/test_pwm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@
5959
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_rz_gpt_pwm)
6060
#define PWM_DEV_NODE DT_INST(0, renesas_rz_gpt_pwm)
6161

62+
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_rz_mtu_pwm)
63+
#define PWM_DEV_NODE DT_INST(0, renesas_rz_mtu_pwm)
64+
6265
#else
6366
#error "Define a PWM device"
6467
#endif
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2025 Renesas Electronics Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pwm/pwm.h>
8+
#include <zephyr/dt-bindings/pwm/renesas_rz_pwm.h>
9+
10+
/ {
11+
pwm_loopback_0 {
12+
compatible = "test-pwm-loopback";
13+
pwms = <&pwm1 RZ_PWM_MTIOCxA 0 PWM_POLARITY_NORMAL>,
14+
<&pwm3 RZ_PWM_MTIOCxA 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&mtu1 {
19+
prescaler = <1024>;
20+
status = "okay";
21+
22+
pwm1: pwm {
23+
status = "okay";
24+
pinctrl-0 = <&mtu1_pins>;
25+
pinctrl-names = "default";
26+
};
27+
};
28+
29+
&mtu3 {
30+
status = "okay";
31+
32+
pwm3: pwm {
33+
status = "okay";
34+
pinctrl-0 = <&mtu3_pins>;
35+
pinctrl-names = "default";
36+
};
37+
};

0 commit comments

Comments
 (0)