Linux-ARM-MSM Archive mirror
 help / color / mirror / Atom feed
* [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons
@ 2024-03-11 10:09 Hui Liu via B4 Relay
  2024-03-12  0:13 ` Konrad Dybcio
  2024-03-19  2:48 ` Bjorn Andersson
  0 siblings, 2 replies; 3+ messages in thread
From: Hui Liu via B4 Relay @ 2024-03-11 10:09 UTC (permalink / raw
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel, Hui Liu

From: Hui Liu <quic_huliu@quicinc.com>

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>
---
Changes in v5:
- Removed the status setting for pmk8350_pon, because the default
status is "okay".
- Link to v4: https://lore.kernel.org/r/20240304-gpio-keys-v4-1-03604d778c86@quicinc.com

Changes in v4:
- Switch the order of "pinctrl-0" and "pinctrl-names".
- Update "volume_up" to "Volume_up".
- Remove "linux,input-type", because the default value is 1(EV_KEY).
- Link to v3: https://lore.kernel.org/r/20240301-gpio-keys-v3-1-ca664de8775c@quicinc.com

Changes in v3:
- Update the commit more concise and explicit.
- remove "power-source" property and update the numeric value to defined
name for "qcom,drive-strength".
- Link to v2: https://lore.kernel.org/r/20240223-gpio-keys-v2-1-19f48b3d8762@quicinc.com

Changes in v2:
- Update the commit description.
- Link to v1: https://lore.kernel.org/r/20240206-gpio-keys-v1-1-7683799daf8d@quicinc.com
---
 arch/arm64/boot/dts/qcom/qcm6490-idp.dts | 37 ++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts
index acf145d1d97c..a4a7d55fb45c 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-idp.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-idp.dts
@@ -9,7 +9,9 @@
 #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>
 #include "sc7280.dtsi"
 #include "pm7250b.dtsi"
@@ -39,6 +41,22 @@ chosen {
 		stdout-path = "serial0:115200n8";
 	};
 
+	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>;
@@ -421,6 +439,16 @@ vreg_bob_3p296: bob {
 	};
 };
 
+&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 {
 	status = "okay";
 
@@ -448,6 +476,15 @@ led@3 {
 	};
 };
 
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	linux,code = <KEY_VOLUMEDOWN>;
+	status = "okay";
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };

---
base-commit: 23e11d0318521e8693459b0e4d23aec614b3b68b
change-id: 20240206-gpio-keys-138bbd850298

Best regards,
-- 
Hui Liu <quic_huliu@quicinc.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons
  2024-03-11 10:09 [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons Hui Liu via B4 Relay
@ 2024-03-12  0:13 ` Konrad Dybcio
  2024-03-19  2:48 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Konrad Dybcio @ 2024-03-12  0:13 UTC (permalink / raw
  To: quic_huliu, Bjorn Andersson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel



On 3/11/24 11:09, Hui Liu via B4 Relay wrote:
> From: Hui Liu <quic_huliu@quicinc.com>
> 
> 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>

Konrad

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons
  2024-03-11 10:09 [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons Hui Liu via B4 Relay
  2024-03-12  0:13 ` Konrad Dybcio
@ 2024-03-19  2:48 ` Bjorn Andersson
  1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2024-03-19  2:48 UTC (permalink / raw
  To: Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Hui Liu
  Cc: linux-arm-msm, devicetree, linux-kernel


On Mon, 11 Mar 2024 18:09:31 +0800, Hui Liu wrote:
> 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.
> 
> 
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons
      commit: 511b4858dc8a1b4d857dc847976a5481c9b367fa

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-19  2:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-11 10:09 [PATCH v5] arm64: dts: qcom: qcm6490-idp: enable PMIC Volume and Power buttons Hui Liu via B4 Relay
2024-03-12  0:13 ` Konrad Dybcio
2024-03-19  2:48 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).