arm64: dts: qcom: x1e80100-crd: Add LID switch
authorStephan Gerhold <stephan.gerhold@linaro.org>
Wed, 10 Jul 2024 08:18:20 +0000 (10:18 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 29 Jul 2024 02:34:40 +0000 (21:34 -0500)
Add gpio-keys for exposing the LID switch state, similar to
sc8280xp-lenovo-thinkpad-x13s.dts. Only the GPIO number is different.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240710-x1e80100-crd-lid-v1-1-0156e8a62af6@linaro.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/x1e80100-crd.dts

index 7b90c9e..06829cf 100644 (file)
@@ -6,6 +6,8 @@
 /dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 
 #include "x1e80100.dtsi"
                stdout-path = "serial0:115200n8";
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&hall_int_n_default>;
+               pinctrl-names = "default";
+
+               switch-lid {
+                       gpios = <&tlmm 92 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_LID>;
+                       wakeup-source;
+                       wakeup-event-action = <EV_ACT_DEASSERTED>;
+               };
+       };
+
        pmic-glink {
                compatible = "qcom,x1e80100-pmic-glink",
                             "qcom,sm8550-pmic-glink",
                bias-disable;
        };
 
+       hall_int_n_default: hall-int-n-state {
+               pins = "gpio92";
+               function = "gpio";
+               bias-disable;
+       };
+
        kybd_default: kybd-default-state {
                pins = "gpio67";
                function = "gpio";