This device uses ANPEC APX9131 hall sensor. It is a basic GPIO hall
sensor for which a generic "gpio-keys" device tree node configuration
suffices.

Signed-off-by: Erikas Bitovtas <[email protected]>
---
 arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts 
b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
index b58f0a04abfd..7343fb00f986 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-asus-z00t.dts
@@ -46,7 +46,7 @@ chosen {
        gpio-keys {
                compatible = "gpio-keys";
 
-               pinctrl-0 = <&gpio_keys_default>;
+               pinctrl-0 = <&gpio_hall_sensor_default>, <&gpio_keys_default>;
                pinctrl-names = "default";
 
                button-volume-up {
@@ -62,6 +62,15 @@ button-volume-down {
                        linux,code = <KEY_VOLUMEDOWN>;
                        debounce-interval = <15>;
                };
+
+               event-hall-sensor {
+                       label = "Hall Effect Sensor";
+                       gpios = <&tlmm 108 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_LID>;
+                       linux,can-disable;
+                       debounce-interval = <150>;
+               };
        };
 
        reg_sd_vmmc: regulator-sdcard-vmmc {
@@ -265,6 +274,13 @@ gpio_keys_default: gpio-keys-default-state {
                bias-pull-up;
        };
 
+       gpio_hall_sensor_default: gpio-hall-sensor-default-state {
+               pins = "gpio108";
+               function = "gpio";
+               drive-strength = <2>;
+               bias-pull-up;
+       };
+
        usb_id_default: usb-id-default-state {
                pins = "gpio110";
                function = "gpio";

-- 
2.52.0


Reply via email to