arm64: dts: qcom: qcs6490-rb3gen2: Enable PWR/VOL keys
authorKonrad Dybcio <quic_kdybcio@quicinc.com>
Sat, 5 Oct 2024 02:47:17 +0000 (19:47 -0700)
committerBjorn Andersson <andersson@kernel.org>
Mon, 7 Oct 2024 22:05:34 +0000 (17:05 -0500)
RB3Gen2 has three tiny buttons located under the blue USB-A ports.
They're all connected through the various PMICs and are used for
volume and power.

Describe them.

Signed-off-by: Konrad Dybcio <quic_kdybcio@quicinc.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241004-rb3gen2-pwr-vol-keys-v1-1-4b1859c7cc4f@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts

index bef184f10b46e1ccd10b232164eb4590dbc9ada0..0de25657437a4b504246b4f5c2d3718983c9b06c 100644 (file)
@@ -9,6 +9,7 @@
 #define PM7250B_SID 8
 #define PM7250B_SID1 9
 
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
 #include "sc7280.dtsi"
 #include "pm7250b.dtsi"
                };
        };
 
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               pinctrl-0 = <&kypd_vol_up_n>;
+               pinctrl-names = "default";
+
+               key-volume-up {
+                       label = "Volume Up";
+                       gpios = <&pm7325_gpios 6 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_VOLUMEUP>;
+                       linux,can-disable;
+               };
+       };
+
        pmic-glink {
                compatible = "qcom,qcm6490-pmic-glink", "qcom,pmic-glink";
 
        status = "okay";
 };
 
+&pm7325_gpios {
+       kypd_vol_up_n: kypd-vol-up-n-state {
+               pins = "gpio6";
+               function = PMIC_GPIO_FUNC_NORMAL;
+               power-source = <1>;
+               bias-pull-up;
+               input-enable;
+       };
+};
+
 &pmk8350_rtc {
        status = "okay";
 };
 
+&pon_pwrkey {
+       status = "okay";
+};
+
+&pon_resin {
+       linux,code = <KEY_VOLUMEDOWN>;
+
+       status = "okay";
+};
+
 &qupv3_id_0 {
        status = "okay";
 };