Skip to content

Commit a93a302

Browse files
Hieu Nguyenkartben
authored andcommitted
tests: drivers: pwm: Add support for RZ/G3S-SMARC
Enable PWM driver tests for RZ/G3S Signed-off-by: Hieu Nguyen <[email protected]> Signed-off-by: Binh Nguyen <[email protected]>
1 parent f134d3b commit a93a302

File tree

3 files changed

+48
-0
lines changed

3 files changed

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

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@
5656
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_ra_pwm)
5757
#define PWM_DEV_NODE DT_INST(0, renesas_ra_pwm)
5858

59+
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_rz_gpt_pwm)
60+
#define PWM_DEV_NODE DT_INST(0, renesas_rz_gpt_pwm)
61+
5962
#else
6063
#error "Define a PWM device"
6164
#endif
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2024 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 = <&pwm3 RZ_PWM_GPT_IO_A 0 PWM_POLARITY_NORMAL>,
14+
<&pwm6 RZ_PWM_GPT_IO_A 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&gpt32e3 {
19+
pwm3: pwm {
20+
status = "okay";
21+
pinctrl-0 = <&gpt3_pins>;
22+
pinctrl-names = "default";
23+
};
24+
};
25+
26+
&gpt32e6 {
27+
pwm6: pwm {
28+
status = "okay";
29+
pinctrl-0 = <&gpt6_pins>;
30+
pinctrl-names = "default";
31+
};
32+
};

0 commit comments

Comments
 (0)