arm64: dts: renesas: rzg3s-smarc: Add gpio keys
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 27 Dec 2023 13:08:10 +0000 (15:08 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 22 Jan 2024 08:13:53 +0000 (09:13 +0100)
RZ SMARC Carrier II board has 3 user buttons called USER_SW1, USER_SW2,
USER_SW3. Add a DT node in device tree to propertly instantiate the
gpio-keys driver for these buttons.

Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20231227130810.2744550-1-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi

index 21452013723084991f23dcf07c0a823f41633092..deb2ad37bb2e5d198efbf6c7fe8b94a52bf35685 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
 
 / {
                mmc1 = &sdhi1;
        };
 
+       keys {
+               compatible = "gpio-keys";
+
+               key-1 {
+                       interrupts = <RZG2L_GPIO(18, 0) IRQ_TYPE_EDGE_FALLING>;
+                       interrupt-parent = <&pinctrl>;
+                       linux,code = <KEY_1>;
+                       label = "USER_SW1";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+
+               key-2 {
+                       interrupts = <RZG2L_GPIO(0, 1) IRQ_TYPE_EDGE_FALLING>;
+                       interrupt-parent = <&pinctrl>;
+                       linux,code = <KEY_2>;
+                       label = "USER_SW2";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+
+               key-3 {
+                       interrupts = <RZG2L_GPIO(0, 3) IRQ_TYPE_EDGE_FALLING>;
+                       interrupt-parent = <&pinctrl>;
+                       linux,code = <KEY_3>;
+                       label = "USER_SW3";
+                       wakeup-source;
+                       debounce-interval = <20>;
+               };
+       };
+
        vcc_sdhi1: regulator-vcc-sdhi1 {
                compatible = "regulator-fixed";
                regulator-name = "SDHI1 Vcc";
 };
 
 &pinctrl {
+       key-1-gpio-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>;
+               input;
+               line-name = "key-1-gpio-irq";
+       };
+
+       key-2-gpio-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(0, 1) GPIO_ACTIVE_LOW>;
+               input;
+               line-name = "key-2-gpio-irq";
+       };
+
+       key-3-gpio-hog {
+               gpio-hog;
+               gpios = <RZG2L_GPIO(0, 3) GPIO_ACTIVE_LOW>;
+               input;
+               line-name = "key-3-gpio-irq";
+       };
+
        scif0_pins: scif0 {
                pinmux = <RZG2L_PORT_PINMUX(6, 3, 1)>, /* RXD */
                         <RZG2L_PORT_PINMUX(6, 4, 1)>; /* TXD */