ARM: dts: qcom: msm8960: expressatt: Add gpio-keys
authorRudraksha Gupta <guptarud@gmail.com>
Sat, 20 Jan 2024 08:45:23 +0000 (00:45 -0800)
committerBjorn Andersson <andersson@kernel.org>
Tue, 30 Jan 2024 22:24:53 +0000 (16:24 -0600)
Adds volume up, volume down, and home keys to expressatt

Signed-off-by: Rudraksha Gupta <guptarud@gmail.com>
Link: https://lore.kernel.org/r/20240120-expressatt-gpio-keys-v1-1-4da7e37440b1@gmail.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm/boot/dts/qcom/qcom-msm8960-samsung-expressatt.dts

index 1a5116336ff0290691a152b14a60676f3d8f9baf..47e0e26ad9f05e1306a2f68021e848cc3fe700d3 100644 (file)
@@ -4,6 +4,9 @@
 
 #include "qcom-msm8960.dtsi"
 #include "pm8921.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
 
 / {
        model = "Samsung Galaxy Express SGH-I437";
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&gpio_keys_pin_a>;
+
+               key-home {
+                       label = "Home";
+                       gpios = <&msmgpio 40 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <5>;
+                       linux,code = <KEY_HOMEPAGE>;
+                       wakeup-event-action = <EV_ACT_ASSERTED>;
+                       wakeup-source;
+               };
+
+               key-volume-up {
+                       label = "Volume Up";
+                       gpios = <&msmgpio 50 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <5>;
+                       linux,code = <KEY_VOLUMEUP>;
+               };
+
+               key-volume-down {
+                       label = "Volume Down";
+                       gpios = <&msmgpio 81 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <5>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+               };
+       };
 };
 
 &gsbi5 {
                        bias-disable;
                };
        };
+
+       gpio_keys_pin_a: gpio-keys-active-state {
+               pins = "gpio40", "gpio50", "gpio81";
+               function = "gpio";
+               drive-strength = <8>;
+               bias-disable;
+       };
 };
 
 &pm8921 {