From a607fe5ea21324a91f03301194bfcda1df2108a6 Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sat, 30 Jul 2022 12:36:17 -0700 Subject: [PATCH] arm64: dts: qcom: sc8280xp-x13s: Add LID switch Add gpio-keys for exposing the LID switch state. Signed-off-by: Bjorn Andersson Reviewed-by: Johan Hovold Tested-by: Johan Hovold Reviewed-by: Konrad Dybcio Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220730193617.1688563-1-bjorn.andersson@linaro.org --- .../qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index cf0076d7e798..02083342bfca 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include #include "sc8280xp.dtsi" @@ -75,6 +77,21 @@ }; }; + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-names = "default"; + pinctrl-0 = <&hall_int_n_default>; + + switch-lid { + gpios = <&tlmm 107 GPIO_ACTIVE_LOW>; + linux,input-type = ; + linux,code = ; + wakeup-source; + wakeup-event-action = ; + }; + }; + vreg_edp_bl: regulator-edp-bl { compatible = "regulator-fixed"; @@ -548,6 +565,13 @@ &tlmm { gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>; + hall_int_n_default: hall-int-n-state { + pins = "gpio107"; + function = "gpio"; + input-enable; + bias-disable; + }; + kybd_default: kybd-default-state { disable-pins { pins = "gpio102"; -- 2.25.1