Skip to content

Commit 8f8fb1c

Browse files
thenguyenyfkartben
authored andcommitted
boards: renesas: add on-board button support on Renesas RA boards
Add gpio keys support for these boards: ek_ra2a1, ek_ra4e2, ek_ra4m2, ek_ra4m3, ek_ra4w1, ek_ra6e2, ek_ra6m1, ek_ra6m2, ek_ra6m3, ek_ra6m4, ek_ra6m5, ek_ra8d1, ek_ra8m1, fpb_ra6e1, fpb_ra6e2 Signed-off-by: The Nguyen <[email protected]>
1 parent 3a7aef7 commit 8f8fb1c

File tree

15 files changed

+387
-0
lines changed

15 files changed

+387
-0
lines changed

boards/renesas/ek_ra2a1/ek_ra2a1.dts

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra2/r7fa2a1ab3cfm.dtsi>
99
#include <zephyr/dt-bindings/gpio/gpio.h>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
1011

1112
#include "ek_ra2a1-pinctrl.dtsi"
1213

@@ -29,8 +30,18 @@
2930
};
3031
};
3132

33+
buttons {
34+
compatible = "gpio-keys";
35+
button0: s1 {
36+
gpios = <&ioport2 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
37+
label = "Push button switch 1";
38+
zephyr,code = <INPUT_KEY_0>;
39+
};
40+
};
41+
3242
aliases {
3343
led0 = &led1;
44+
sw0 = &button0;
3445
};
3546
};
3647

@@ -69,3 +80,8 @@
6980
&ioport1 {
7081
status = "okay";
7182
};
83+
84+
&port_irq6 {
85+
interrupts = <29 3>;
86+
status = "okay";
87+
};

boards/renesas/ek_ra4e2/ek_ra4e2.dts

+35
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra4/r7fa4e2b93cfm.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112
#include "ek_ra4e2-pinctrl.dtsi"
1213

@@ -38,8 +39,24 @@
3839
};
3940
};
4041

42+
buttons {
43+
compatible = "gpio-keys";
44+
button0: s1 {
45+
gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
46+
label = "Push button switch 1";
47+
zephyr,code = <INPUT_KEY_0>;
48+
};
49+
button1: s2 {
50+
gpios = <&ioport3 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
51+
label = "Push button switch 2";
52+
zephyr,code = <INPUT_KEY_1>;
53+
};
54+
};
55+
4156
aliases {
4257
led0 = &led1;
58+
sw0 = &button0;
59+
sw1 = &button1;
4360
};
4461

4562
transceiver0: can-phy0 {
@@ -78,6 +95,10 @@
7895
};
7996
};
8097

98+
&ioport0 {
99+
status = "okay";
100+
};
101+
81102
&ioport1 {
82103
status = "okay";
83104
};
@@ -118,3 +139,17 @@
118139
pinctrl-0 = <&adc0_default>;
119140
pinctrl-names = "default";
120141
};
142+
143+
&ioport3 {
144+
status = "okay";
145+
};
146+
147+
&port_irq9 {
148+
interrupts = <4 12>;
149+
status = "okay";
150+
};
151+
152+
&port_irq10 {
153+
interrupts = <5 12>;
154+
status = "okay";
155+
};

boards/renesas/ek_ra4m2/ek_ra4m2.dts

+31
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra4/r7fa4m2ad3cfp.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112
#include "ek_ra4m2-pinctrl.dtsi"
1213

@@ -37,8 +38,24 @@
3738
};
3839
};
3940

41+
buttons {
42+
compatible = "gpio-keys";
43+
button0: s1 {
44+
gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
45+
label = "Push button switch 1";
46+
zephyr,code = <INPUT_KEY_0>;
47+
};
48+
button1: s2 {
49+
gpios = <&ioport0 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50+
label = "Push button switch 2";
51+
zephyr,code = <INPUT_KEY_1>;
52+
};
53+
};
54+
4055
aliases {
4156
led0 = &led1;
57+
sw0 = &button0;
58+
sw1 = &button1;
4259
};
4360
};
4461

@@ -70,6 +87,10 @@
7087
};
7188
};
7289

90+
&ioport0 {
91+
status = "okay";
92+
};
93+
7394
&ioport4 {
7495
status = "okay";
7596
};
@@ -85,3 +106,13 @@
85106
pinctrl-0 = <&adc0_default>;
86107
pinctrl-names = "default";
87108
};
109+
110+
&port_irq10 {
111+
interrupts = <41 12>;
112+
status = "okay";
113+
};
114+
115+
&port_irq11 {
116+
interrupts = <42 12>;
117+
status = "okay";
118+
};

boards/renesas/ek_ra4m3/ek_ra4m3.dts

+31
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra4/r7fa4m3af3cfb.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112
#include "ek_ra4m3-pinctrl.dtsi"
1213

@@ -37,8 +38,24 @@
3738
};
3839
};
3940

41+
buttons {
42+
compatible = "gpio-keys";
43+
button0: s1 {
44+
gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
45+
label = "Push button switch 1";
46+
zephyr,code = <INPUT_KEY_0>;
47+
};
48+
button1: s2 {
49+
gpios = <&ioport0 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
50+
label = "Push button switch 2";
51+
zephyr,code = <INPUT_KEY_1>;
52+
};
53+
};
54+
4055
aliases {
4156
led0 = &led1;
57+
sw0 = &button0;
58+
sw1 = &button1;
4259
};
4360
};
4461

@@ -70,6 +87,10 @@
7087
};
7188
};
7289

90+
&ioport0 {
91+
status = "okay";
92+
};
93+
7394
&ioport4 {
7495
status = "okay";
7596
};
@@ -85,3 +106,13 @@
85106
pinctrl-0 = <&adc0_default>;
86107
pinctrl-names = "default";
87108
};
109+
110+
&port_irq10 {
111+
interrupts = <41 12>;
112+
status = "okay";
113+
};
114+
115+
&port_irq11 {
116+
interrupts = <42 12>;
117+
status = "okay";
118+
};

boards/renesas/ek_ra4w1/ek_ra4w1.dts

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra4/r7fa4w1ad2cng.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112
#include "ek_ra4w1-pinctrl.dtsi"
1213

@@ -35,8 +36,18 @@
3536
};
3637
};
3738

39+
buttons {
40+
compatible = "gpio-keys";
41+
button0: s1 {
42+
gpios = <&ioport4 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
43+
label = "Push button switch 1";
44+
zephyr,code = <INPUT_KEY_0>;
45+
};
46+
};
47+
3848
aliases {
3949
led0 = &led1;
50+
sw0 = &button0;
4051
};
4152
};
4253

@@ -77,3 +88,8 @@
7788
pinctrl-0 = <&adc0_default>;
7889
pinctrl-names = "default";
7990
};
91+
92+
&port_irq4 {
93+
interrupts = <31 12>;
94+
status = "okay";
95+
};

boards/renesas/ek_ra6e2/ek_ra6e2.dts

+35
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra6/r7fa6e2bb3cfm.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112

1213
#include "ek_ra6e2-pinctrl.dtsi"
@@ -39,8 +40,24 @@
3940
};
4041
};
4142

43+
buttons {
44+
compatible = "gpio-keys";
45+
button0: s1 {
46+
gpios = <&ioport0 5 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
47+
label = "Push button switch 1";
48+
zephyr,code = <INPUT_KEY_0>;
49+
};
50+
button1: s2 {
51+
gpios = <&ioport3 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
52+
label = "Push button switch 2";
53+
zephyr,code = <INPUT_KEY_1>;
54+
};
55+
};
56+
4257
aliases {
4358
led0 = &led1;
59+
sw0 = &button0;
60+
sw1 = &button1;
4461
};
4562
};
4663

@@ -54,6 +71,10 @@
5471
};
5572
};
5673

74+
&ioport0 {
75+
status = "okay";
76+
};
77+
5778
&ioport1 {
5879
status = "okay";
5980
};
@@ -68,6 +89,10 @@
6889
status = "okay";
6990
};
7091

92+
&ioport3 {
93+
status = "okay";
94+
};
95+
7196
&ioport4 {
7297
status = "okay";
7398
};
@@ -133,3 +158,13 @@
133158
pinctrl-0 = <&adc0_default>;
134159
pinctrl-names = "default";
135160
};
161+
162+
&port_irq9 {
163+
interrupts = <4 12>;
164+
status = "okay";
165+
};
166+
167+
&port_irq10 {
168+
interrupts = <5 12>;
169+
status = "okay";
170+
};

boards/renesas/ek_ra6m1/ek_ra6m1.dts

+20
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <renesas/ra/ra6/r7fa6m1ad3cfp.dtsi>
99
#include <dt-bindings/gpio/gpio.h>
10+
#include <dt-bindings/input/input-event-codes.h>
1011
#include <zephyr/dt-bindings/adc/adc.h>
1112

1213
#include "ek_ra6m1-pinctrl.dtsi"
@@ -31,8 +32,18 @@
3132
};
3233
};
3334

35+
buttons {
36+
compatible = "gpio-keys";
37+
button0: s1 {
38+
gpios = <&ioport4 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
39+
label = "Push button switch 1";
40+
zephyr,code = <INPUT_KEY_0>;
41+
};
42+
};
43+
3444
aliases {
3545
led0 = &led1;
46+
sw0 = &button0;
3647
};
3748
};
3849

@@ -67,6 +78,10 @@
6778
status = "okay";
6879
};
6980

81+
&ioport4 {
82+
status = "okay";
83+
};
84+
7085
&xtal {
7186
clock-frequency = <DT_FREQ_M(12)>;
7287
mosel = <0>;
@@ -94,3 +109,8 @@
94109
pinctrl-0 = <&adc0_default>;
95110
pinctrl-names = "default";
96111
};
112+
113+
&port_irq8 {
114+
interrupts = <41 12>;
115+
status = "okay";
116+
};

0 commit comments

Comments
 (0)