ARM: dts: rskrza1: Add input switches
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 2 May 2019 12:32:20 +0000 (14:32 +0200)
committerSimon Horman <horms+renesas@verge.net.au>
Mon, 20 May 2019 11:27:35 +0000 (13:27 +0200)
Add support for input switches SW1-3 on the Renesas RZ/A1 RSK+RZA1
development board.

Note that this uses the IRQ interrupts, as the RZ/A1 GPIO controller
does not include interrupt support.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/boot/dts/r7s72100-rskrza1.dts

index ff24301dc1be54de6dad77934b75e645395d5142..99acfe4fe11aaed9d07221763874ed1f50d70896 100644 (file)
@@ -8,6 +8,7 @@
 /dts-v1/;
 #include "r7s72100.dtsi"
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/r7s72100-pinctrl.h>
 
 / {
                reg = <0x08000000 0x02000000>;
        };
 
+       keyboard {
+               compatible = "gpio-keys";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&keyboard_pins>;
+
+               key-1 {
+                       interrupt-parent = <&irqc>;
+                       interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
+                       linux,code = <KEY_1>;
+                       label = "SW1";
+                       wakeup-source;
+               };
+
+               key-2 {
+                       interrupt-parent = <&irqc>;
+                       interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
+                       linux,code = <KEY_2>;
+                       label = "SW2";
+                       wakeup-source;
+               };
+
+               key-3 {
+                       interrupt-parent = <&irqc>;
+                       interrupts = <5 IRQ_TYPE_EDGE_BOTH>;
+                       linux,code = <KEY_3>;
+                       label = "SW3";
+                       wakeup-source;
+               };
+       };
+
        lbsc {
                #address-cells = <1>;
                #size-cells = <1>;
                         <RZA1_PINMUX(1, 7, 1)>;        /* RIIC3SDA */
        };
 
+       keyboard_pins: keyboard {
+               pinmux = <RZA1_PINMUX(1, 9, 3)>,        /* IRQ3 */
+                        <RZA1_PINMUX(1, 8, 3)>,        /* IRQ2 */
+                        <RZA1_PINMUX(1, 11, 3)>;       /* IRQ5 */
+       };
+
        /* Serial Console */
        scif2_pins: serial2 {
                pinmux = <RZA1_PINMUX(3, 0, 6)>,        /* TxD2 */