diff mbox series

[1/1] arm64: dts: qcom: msm8994-angler: Enable power key, volume up/down

Message ID 20241123221708.862901-1-petr.vorel@gmail.com (mailing list archive)
State New
Headers show
Series [1/1] arm64: dts: qcom: msm8994-angler: Enable power key, volume up/down | expand

Commit Message

Petr Vorel Nov. 23, 2024, 10:17 p.m. UTC
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Tested:
# evtest /dev/input/event0 # KEY_POWER
/ # Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "pm8941_pwrkey"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 116 (KEY_POWER)
Properties:
Testing ... (interrupt to exit)
Event: time 31.770919, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 31.770919, -------------- SYN_REPORT ------------
Event: time 32.077229, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 32.077229, -------------- SYN_REPORT ------------

# evtest /dev/input/event1 # KEY_VOLUMEDOWN
Input driver version is 1.0.1
/ # Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "pm8941_resin"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
Properties:
Testing ... (interrupt to exit)
Event: time 44.979203, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 44.979203, -------------- SYN_REPORT ------------
Event: time 45.222189, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 45.222189, -------------- SYN_REPORT ------------

# evtest /dev/input/event2 # KEY_VOLUMEUP
Input driver version is 1.0.1
/ # Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 115 (KEY_VOLUMEUP)
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    250
    Repeat code 1 (REP_PERIOD)
      Value     33
Properties:
Testing ... (interrupt to exit)
Event: time 54.630877, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 54.630877, -------------- SYN_REPORT ------------
Event: time 54.912013, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 2
Event: time 54.912013, -------------- SYN_REPORT ------------
Event: time 54.931493, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 54.931493, -------------- SYN_REPORT ------------

# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:	pm8941_pwrkey
/ # /dev/input/event1:	pm8941_resin
/dev/input/event2:	gpio-keys
Select the device event number [0-2]: USAGE:
...

 .../qcom/msm8994-huawei-angler-rev-101.dts    | 21 ++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts b/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts
index 29e79ae0849d8..1aca11daf83c0 100644
--- a/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts
+++ b/arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts
@@ -2,12 +2,13 @@ 
 /*
  * Copyright (c) 2015, Huawei Inc. All rights reserved.
  * Copyright (c) 2016, The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023, Petr Vorel <petr.vorel@gmail.com>
+ * Copyright (c) 2021-2024, Petr Vorel <petr.vorel@gmail.com>
  */
 
 /dts-v1/;
 
 #include "msm8994.dtsi"
+#include "pm8994.dtsi"
 
 / {
 	model = "Huawei Nexus 6P";
@@ -46,6 +47,24 @@  reserved@6300000 {
 			no-map;
 		};
 	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		button-vol-up {
+			label = "volume up";
+			gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_VOLUMEUP>;
+			wakeup-source;
+			debounce-interval = <15>;
+		};
+	};
+};
+
+&pm8994_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+	status = "okay";
 };
 
 &blsp1_uart2 {