]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: qcom: glymur-crd: Enable LID sensor
authorAbel Vesa <abel.vesa@oss.qualcomm.com>
Tue, 28 Apr 2026 12:32:29 +0000 (15:32 +0300)
committerBjorn Andersson <andersson@kernel.org>
Sun, 10 May 2026 03:17:45 +0000 (22:17 -0500)
The Glymur CRD has a Hall-effect sensor used for detecting when the
lid is opened or closed. Describe it as an SW_LID gpio-key switch.

Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260428-glymur-dts-add-lid-sensor-v1-1-470cc168e70a@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/glymur-crd.dtsi

index 2852d257ac8c0e55758a7bf216946cd8772cb39d..357d4ad8380a6561a477b16d76a1940bbf778f14 100644 (file)
@@ -10,6 +10,8 @@
 #include "pmk8850.dtsi"         /* SPMI0: SID-0                  */
 #include "smb2370.dtsi"         /* SPMI2: SID-9/10/11            */
 
+#include <dt-bindings/input/gpio-keys.h>
+
 / {
        model = "Qualcomm Technologies, Inc. Glymur CRD";
        compatible = "qcom,glymur-crd", "qcom,glymur";
@@ -44,7 +46,7 @@
        gpio-keys {
                compatible = "gpio-keys";
 
-               pinctrl-0 = <&key_vol_up_default>;
+               pinctrl-0 = <&key_vol_up_default>, <&hall_int_n_default>;
                pinctrl-names = "default";
 
                key-volume-up {
                        linux,can-disable;
                        wakeup-source;
                };
+
+               switch-lid {
+                       label = "lid";
+                       gpios = <&tlmm 92 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_LID>;
+                       wakeup-source;
+                       wakeup-event-action = <EV_ACT_DEASSERTED>;
+               };
        };
 
        vreg_nvme: regulator-nvme {
                               <10 2>, /* OOB UART */
                               <44 4>; /* Security SPI (TPM) */
 
+       hall_int_n_default: hall-int-n-state {
+               pins = "gpio92";
+               function = "gpio";
+               bias-disable;
+       };
+
        pcie4_default: pcie4-default-state {
                clkreq-n-pins {
                        pins = "gpio147";