Skip to content

Commit cab3511

Browse files
committed
ARM: dts: marzen: Add slide switches
Describe the four General Purpose Switches on the Marzen development board, so they can be used for user input and/or for wake-up from s2ram. The GPIO block on R-Car H1 does not support triggering interrupts on both edges of a changing input signal, hence one cannot use gpio-keys with gpios properties. Instead, one of two alternatives needs to be used: 1. Use gpio-keys with interrupts instead of gpios properties, at the expense of receiving only key presses (release events will be auto-generated), 2. Use gpio-keys-polled with gpios properties, at the expense of making these keys unusable as wake-up sources. As the DTS for the Marzen development board serves mainly as an example, the approach taken is to use the first alternative for the first two switches, and the second alternative for the last two switches. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/f834a3c397362f2424fcae6a0c0440356208b182.1679329829.git.geert+renesas@glider.be
1 parent 2114ab8 commit cab3511

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

arch/arm/boot/dts/r8a7779-marzen.dts

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
/dts-v1/;
1010
#include "r8a7779.dtsi"
1111
#include <dt-bindings/gpio/gpio.h>
12+
#include <dt-bindings/input/input.h>
1213
#include <dt-bindings/interrupt-controller/irq.h>
1314

1415
/ {
@@ -66,6 +67,51 @@
6667
vdd33a-supply = <&fixedregulator3v3>;
6768
};
6869

70+
keyboard-irq {
71+
compatible = "gpio-keys";
72+
73+
pinctrl-0 = <&keyboard_irq_pins>;
74+
pinctrl-names = "default";
75+
76+
interrupt-parent = <&gpio0>;
77+
78+
key-1 {
79+
interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
80+
linux,code = <KEY_1>;
81+
label = "SW1-1";
82+
wakeup-source;
83+
debounce-interval = <20>;
84+
};
85+
key-2 {
86+
interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
87+
linux,code = <KEY_2>;
88+
label = "SW1-2";
89+
wakeup-source;
90+
debounce-interval = <20>;
91+
};
92+
};
93+
94+
keyboard-gpio {
95+
compatible = "gpio-keys-polled";
96+
poll-interval = <50>;
97+
98+
pinctrl-0 = <&keyboard_gpio_pins>;
99+
pinctrl-names = "default";
100+
101+
key-3 {
102+
gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
103+
linux,code = <KEY_3>;
104+
label = "SW1-3";
105+
debounce-interval = <20>;
106+
};
107+
key-4 {
108+
gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
109+
linux,code = <KEY_4>;
110+
label = "SW1-4";
111+
debounce-interval = <20>;
112+
};
113+
};
114+
69115
leds {
70116
compatible = "gpio-leds";
71117
led2 {
@@ -161,6 +207,14 @@
161207
};
162208
};
163209

210+
&gpio0 {
211+
keyboard-irq-hog {
212+
gpio-hog;
213+
gpios = <17 GPIO_ACTIVE_LOW>, <18 GPIO_ACTIVE_LOW>;
214+
input;
215+
};
216+
};
217+
164218
&irqpin0 {
165219
status = "okay";
166220
};
@@ -223,6 +277,15 @@
223277
groups = "hspi0";
224278
function = "hspi0";
225279
};
280+
281+
keyboard_irq_pins: keyboard-irq {
282+
pins = "GP_0_17", "GP_0_18";
283+
bias-pull-up;
284+
};
285+
keyboard_gpio_pins: keyboard-gpio {
286+
pins = "GP_0_19", "GP_0_20";
287+
bias-pull-up;
288+
};
226289
};
227290

228291
&sata {

0 commit comments

Comments
 (0)