arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons
authorHui Liu <quic_huliu@quicinc.com>
Mon, 11 Mar 2024 10:09:31 +0000 (18:09 +0800)
committerBjorn Andersson <andersson@kernel.org>
Mon, 18 Mar 2024 03:45:40 +0000 (22:45 -0500)
The Volume Down & Power buttons are controlled by the PMIC via
the PON hardware, and the Volume Up is connected to a PMIC gpio.

Enable the necessary hardware and setup the GPIO state for the
Volume Up gpio key.

Signed-off-by: Hui Liu <quic_huliu@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240311-gpio-keys-v5-1-08823582f6c9@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/qcm6490-idp.dts

index 5bbe8aa63927269b93212ce37fe65503e283d719..f8f8a43f638d4bc47f042c7d7d223cca769c13f2 100644 (file)
@@ -9,6 +9,7 @@
 #define PM7250B_SID 8
 #define PM7250B_SID1 9
 
+#include <dt-bindings/input/linux-event-codes.h>
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
                pinctrl-names = "default";
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&key_vol_up_default>;
+               pinctrl-names = "default";
+
+               key-volume-up {
+                       label = "Volume_up";
+                       gpios = <&pm7325_gpios 6 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       wakeup-source;
+                       debounce-interval = <15>;
+                       linux,can-disable;
+               };
+       };
+
        reserved-memory {
                xbl_mem: xbl@80700000 {
                        reg = <0x0 0x80700000 0x0 0x100000>;
        };
 };
 
+&pm7325_gpios {
+       key_vol_up_default: key-vol-up-state {
+               pins = "gpio6";
+               function = "normal";
+               input-enable;
+               bias-pull-up;
+               qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+       };
+};
+
 &pm8350c_pwm {
        pinctrl-0 = <&pmic_lcd_bl_pwm>;
        pinctrl-names = "default";
        };
 };
 
+&pon_pwrkey {
+       status = "okay";
+};
+
+&pon_resin {
+       linux,code = <KEY_VOLUMEDOWN>;
+       status = "okay";
+};
+
 &qupv3_id_0 {
        status = "okay";
 };