ARM: dts: qcom: msm8974-oneplus-bacon: Add volume keys and hall sensor
authorLuca Weiss <luca@z3ntu.xyz>
Mon, 6 Feb 2023 20:40:16 +0000 (21:40 +0100)
committerBjorn Andersson <andersson@kernel.org>
Thu, 9 Feb 2023 03:30:53 +0000 (19:30 -0800)
Add nodes for the volume buttons and the hall sensor that are found on
the device.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230122-msm8974-bacon-features-v2-3-06bb83c20a58@z3ntu.xyz
arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts

index 63180fe1d292421cbe8e30ad95530d8c16af2d19..c4c3555331496d8ab3a42cd51bcabb808cc8baf2 100644 (file)
        chosen {
                stdout-path = "serial0:115200n8";
        };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&gpio_keys_default>, <&gpio_hall_sensor_default>;
+               pinctrl-names = "default";
+
+               key-volume-down {
+                       label = "Volume Down";
+                       gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       wakeup-source;
+                       debounce-interval = <15>;
+               };
+
+               key-volume-up {
+                       label = "Volume Up";
+                       gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       wakeup-source;
+                       debounce-interval = <15>;
+               };
+
+               event-hall-sensor {
+                       label = "Hall Effect Sensor";
+                       gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
+                       linux,input-type = <EV_SW>;
+                       linux,code = <SW_LID>;
+                       linux,can-disable;
+                       debounce-interval = <150>;
+               };
+       };
 };
 
 &blsp1_i2c1 {
        status = "okay";
 };
 
+&pm8941_gpios {
+       gpio_keys_default: gpio-keys-active-state {
+               pins = "gpio2", "gpio5";
+               function = "normal";
+               input-enable;
+               bias-disable;
+               power-source = <PM8941_GPIO_S3>;
+       };
+};
+
 &pm8941_vib {
        status = "okay";
 };
 };
 
 &tlmm {
+       gpio_hall_sensor_default: gpio-hall-sensor-default-state {
+               pins = "gpio68";
+               function = "gpio";
+               drive-strength = <8>;
+               bias-pull-up;
+       };
+
        sdc1_on: sdc1-on-state {
                clk-pins {
                        pins = "sdc1_clk";