Files
BPI-CM9-Linux/build/patch/kernel/archive/sm8250-6.18/0035-arm64-dts-qcom-sm8250-lenovo-q706f-Add-hall-sensor-f.patch

57 lines
1.5 KiB
Diff

From 2a271b93c7e5c93f80a4b29524e3adfc313b8188 Mon Sep 17 00:00:00 2001
From: chalkin <[email protected]>
Date: Fri, 24 Jan 2025 10:09:39 +0800
Subject: [PATCH 35/62] arm64: dts: qcom: sm8250-lenovo-q706f: Add hall sensor
for magnetic cover and magnetic keyboard detection
Signed-off-by: Jiali Chen <[email protected]>
---
.../boot/dts/qcom/sm8250-lenovo-q706f.dts | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8250-lenovo-q706f.dts b/arch/arm64/boot/dts/qcom/sm8250-lenovo-q706f.dts
index 14dd97f7a612..24df36a29be5 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-lenovo-q706f.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-lenovo-q706f.dts
@@ -49,6 +49,23 @@ battery: battery {
voltage-min-design-microvolt = <3870000>;
};
+ gpio-hall-sensor {
+ compatible = "gpio-keys";
+ label = "Hall effect sensor";
+
+ pinctrl-0 = <&hall_sensor_default>;
+ pinctrl-names = "default";
+
+ event-hall-sensor {
+ gpios = <&tlmm 121 GPIO_ACTIVE_LOW>;
+ label = "Hall Effect Sensor";
+ linux,input-type = <EV_SW>;
+ linux,code = <SW_LID>;
+ linux,can-disable;
+ wakeup-source;
+ };
+ };
+
gpio-keys {
compatible = "gpio-keys";
@@ -1280,6 +1297,13 @@ touchscreen@0 {
&tlmm {
gpio-reserved-ranges = <40 4>;
+ hall_sensor_default: hall-sensor-default-state {
+ pins = "gpio121";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
pri_tdm_active: pri-tdm-active-state {
sck-pins {
pins = "gpio138";
--
2.47.3