From fd8ce18c233c403432cc60b48e6dc51d67d4a10f Mon Sep 17 00:00:00 2001 From: robertijtsma <37256770+robertijtsma@users.noreply.github.com> Date: Sun, 22 Nov 2026 12:08:01 +0100 Subject: [PATCH] arm64: dts: qcom: sc8180x-surface-pro-x: add Type Cover Hall-sensor lid switch Add the gpio-keys Type Cover Hall-effect lid switch (SW_LID) wired to TLMM GPIO 121 (active-low), configured as a wakeup source on lid open (EV_ACT_DEASSERTED). Tested on Microsoft Surface Pro X SQ2 (SC8180X, Linux 7.3.1-1-surface) for lid-close s2idle suspend and lid-open wake. Signed-off-by: robertijtsma <37256770+robertijtsma@users.noreply.github.com> --- .../boot/dts/qcom/sc8180x-surface-pro-x.dts | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8180x-surface-pro-x.dts b/arch/arm64/boot/dts/qcom/sc8180x-surface-pro-x.dts index 91bf6480f0026..d16210a729f9b 100644 --- a/arch/arm64/boot/dts/qcom/sc8180x-surface-pro-x.dts +++ b/arch/arm64/boot/dts/qcom/sc8180x-surface-pro-x.dts @@ -8,6 +8,7 @@ /dts-v1/; #include +#include #include #include #include @@ -58,6 +59,23 @@ }; }; + gpio-keys-lid { + compatible = "gpio-keys"; + label = "Lid"; + + pinctrl-names = "default"; + pinctrl-0 = <&lid_default>; + + switch-lid { + label = "Lid"; + gpios = <&tlmm 121 GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + wakeup-source; + wakeup-event-action = ; + }; + }; + chosen { }; @@ -888,6 +906,14 @@ pins = "gpio10"; function = "edp_hot"; }; + + lid_default: lid-default-state { + pins = "gpio121"; + function = "gpio"; + + input-enable; + bias-disable; + }; }; &pmc8180a_gpios {