arm64: dts: qcom: sm8150-kumano: Add GPIO keys
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Sat, 10 Dec 2022 14:25:23 +0000 (15:25 +0100)
committerBjorn Andersson <andersson@kernel.org>
Wed, 28 Dec 2022 04:07:44 +0000 (22:07 -0600)
Configure hardware buttons (V-, Camera Shutter/Focus) on Kumano
devices.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Xperia 1 and Xperia 5
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221210142525.16974-1-konrad.dybcio@linaro.org
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi

index fd8c0097072ab1d16285691fe18add3da195c15f..7fab4b9b5b0ab0eae32770ed659a6ccbfe831dc5 100644 (file)
                };
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-names = "default";
+               pinctrl-0 = <&focus_n &snapshot_n &vol_down_n>;
+
+               key-camera-focus {
+                       label = "Camera Focus";
+                       linux,code = <KEY_CAMERA_FOCUS>;
+                       gpios = <&pm8150b_gpios 2 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <15>;
+                       linux,can-disable;
+                       gpio-key,wakeup;
+               };
+
+               key-camera-snapshot {
+                       label = "Camera Snapshot";
+                       linux,code = <KEY_CAMERA>;
+                       gpios = <&pm8150b_gpios 1 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <15>;
+                       linux,can-disable;
+                       gpio-key,wakeup;
+               };
+
+               key-vol-down {
+                       label = "Volume Down";
+                       linux,code = <KEY_VOLUMEDOWN>;
+                       gpios = <&pm8150_gpios 1 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <15>;
+                       linux,can-disable;
+                       gpio-key,wakeup;
+               };
+       };
+
        vph_pwr: vph-pwr-regulator {
                compatible = "regulator-fixed";
                regulator-name = "vph_pwr";
        /* Samsung touchscreen @ 48 */
 };
 
+&pm8150_gpios {
+       vol_down_n: vol-down-n-state {
+               pins = "gpio1";
+               function = "normal";
+               power-source = <0>;
+               bias-pull-up;
+               input-enable;
+       };
+};
+
+&pm8150b_gpios {
+       snapshot_n: snapshot-n-state {
+               pins = "gpio1";
+               function = "normal";
+               power-source = <0>;
+               bias-pull-up;
+               input-enable;
+       };
+
+       focus_n: focus-n-state {
+               pins = "gpio2";
+               function = "normal";
+               power-source = <0>;
+               bias-pull-up;
+               input-enable;
+       };
+};
+
 &pon_pwrkey {
        status = "okay";
 };