]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
arm64: dts: qcom: x1e80100-romulus: Add lid switch
authorKonrad Dybcio <quic_kdybcio@quicinc.com>
Mon, 2 Sep 2024 14:50:33 +0000 (16:50 +0200)
committerBjorn Andersson <andersson@kernel.org>
Sun, 6 Oct 2024 03:15:27 +0000 (22:15 -0500)
One of the best parts of having a laptop is being able to close the lid
and go on with your day. Enable this feature by defining the lid switch.

Signed-off-by: Konrad Dybcio <quic_kdybcio@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240902-topic-sl7_updates-v1-1-3ee667e6652d@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/x1e80100-microsoft-romulus.dtsi

index 42e02ad6a9c3286db22315a678977d33734b5291..5419d0b02785bb33c596201cc64af03dc28c3889 100644 (file)
@@ -4,6 +4,8 @@
  */
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 
                pinctrl-names = "default";
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&hall_int_n_default>;
+               pinctrl-names = "default";
+
+               switch-lid {
+                       gpios = <&tlmm 2 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_LID>;
+                       wakeup-source;
+                       wakeup-event-action = <EV_ACT_DEASSERTED>;
+               };
+       };
+
        leds {
                compatible = "gpio-leds";
 
        gpio-reserved-ranges = <44 4>, /* SPI (TPM) */
                               <238 1>; /* UFS Reset */
 
+       hall_int_n_default: hall-int-n-state {
+               pins = "gpio2";
+               function = "gpio";
+               bias-disable;
+       };
+
        nvme_reg_en: nvme-reg-en-state {
                pins = "gpio18";
                function = "gpio";