Devicetree
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys
@ 2026-08-29 18:41 Dale Whinham
  2026-08-31  7:13 ` Konrad Dybcio
  0 siblings, 1 reply; 4+ messages in thread
From: Dale Whinham @ 2026-08-29 18:41 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel,
	Jérôme de Bretagne, Dale Whinham

Configure gpio6 and gpio8 as volume up and volume down respectively, to
enable the volume rocker located at the top of the screen.

Signed-off-by: Dale Whinham <daleyo@gmail.com>
---
 arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi | 36 ++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi b/arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi
index 7559557610ed..c467f61545cb 100644
--- a/arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi
+++ b/arch/arm64/boot/dts/qcom/x1-microsoft-denali.dtsi
@@ -20,7 +20,7 @@ aliases {
 	gpio-keys {
 		compatible = "gpio-keys";
 
-		pinctrl-0 = <&hall_int_n_default>;
+		pinctrl-0 = <&hall_int_n_default>, <&vol_down_n>, <&vol_up_n>;
 		pinctrl-names = "default";
 
 		switch-lid {
@@ -30,6 +30,24 @@ switch-lid {
 			wakeup-source;
 			wakeup-event-action = <EV_ACT_DEASSERTED>;
 		};
+
+		key-vol-down {
+			debounce-interval = <15>;
+			gpios = <&pm8550_gpios 8 GPIO_ACTIVE_LOW>;
+			label = "Volume Down";
+			linux,can-disable;
+			linux,code = <KEY_VOLUMEDOWN>;
+			wakeup-source;
+		};
+
+		key-vol-up {
+			debounce-interval = <15>;
+			gpios = <&pm8550_gpios 6 GPIO_ACTIVE_LOW>;
+			label = "Volume Up";
+			linux,can-disable;
+			linux,code = <KEY_VOLUMEUP>;
+			wakeup-source;
+		};
 	};
 
 	pmic-glink {
@@ -995,6 +1013,22 @@ rtmr0_3p3_reg_en: rtmr0-3p3-reg-en-state {
 		function = "normal";
 		power-source = <1>; /* 1.8V */
 	};
+
+	vol_down_n: vol-down-n-state {
+		bias-pull-up;
+		input-enable;
+		pins = "gpio8";
+		function = "normal";
+		power-source = <1>; /* 1.8V */
+	};
+
+	vol_up_n: vol-up-n-state {
+		bias-pull-up;
+		input-enable;
+		pins = "gpio6";
+		function = "normal";
+		power-source = <1>; /* 1.8V */
+	};
 };
 
 &pm8550ve_9_gpios {

---
base-commit: 8d3ae59288f1e7d58d76558a6ee96d533bc5019f
change-id: 20260829-surface-pro-11-volume-buttons-f4b40e25cecb

Best regards,
--  
Dale Whinham <daleyo@gmail.com>


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

* Re: [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys
  2026-08-29 18:41 [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys Dale Whinham
@ 2026-08-31  7:13 ` Konrad Dybcio
  2026-08-31 15:51   ` Dale Whinham
  0 siblings, 1 reply; 4+ messages in thread
From: Konrad Dybcio @ 2026-08-31  7:13 UTC (permalink / raw)
  To: Dale Whinham, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-arm-msm, devicetree, linux-kernel,
	Jérôme de Bretagne

On 8/29/26 8:41 PM, Dale Whinham wrote:
> Configure gpio6 and gpio8 as volume up and volume down respectively, to
> enable the volume rocker located at the top of the screen.
> 
> Signed-off-by: Dale Whinham <daleyo@gmail.com>
> ---

[...]

>  	pmic-glink {
> @@ -995,6 +1013,22 @@ rtmr0_3p3_reg_en: rtmr0-3p3-reg-en-state {
>  		function = "normal";
>  		power-source = <1>; /* 1.8V */
>  	};
> +
> +	vol_down_n: vol-down-n-state {
> +		bias-pull-up;
> +		input-enable;
> +		pins = "gpio8";
> +		function = "normal";
> +		power-source = <1>; /* 1.8V */
> +	};
> +
> +	vol_up_n: vol-up-n-state {
> +		bias-pull-up;
> +		input-enable;
> +		pins = "gpio6";
> +		function = "normal";
> +		power-source = <1>; /* 1.8V */
> +	};

Let's order the pin nodes by their gpio number

otherwise:

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys
  2026-08-31  7:13 ` Konrad Dybcio
@ 2026-08-31 15:51   ` Dale Whinham
  2026-09-02 16:24     ` Konrad Dybcio
  0 siblings, 1 reply; 4+ messages in thread
From: Dale Whinham @ 2026-08-31 15:51 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-arm-msm, devicetree, linux-kernel,
	Jérôme de Bretagne

On Mon, 31 Aug 2026 at 08:13, Konrad Dybcio
<konrad.dybcio@oss.qualcomm.com> wrote:
> Let's order the pin nodes by their gpio number
>
> otherwise:
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Konrad

(Resending as plain text, apologies)

Thank you Konrad - how about the gpio-keys { } section, should we
re-order them to:

key-vol-up   { pm8550 6 }
key-vol-down { pm8850 8 }
switch-lid   { tlmm 2 }

Cheers,
Dale

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

* Re: [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys
  2026-08-31 15:51   ` Dale Whinham
@ 2026-09-02 16:24     ` Konrad Dybcio
  0 siblings, 0 replies; 4+ messages in thread
From: Konrad Dybcio @ 2026-09-02 16:24 UTC (permalink / raw)
  To: Dale Whinham
  Cc: Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-arm-msm, devicetree, linux-kernel,
	Jérôme de Bretagne

On 8/31/26 5:51 PM, Dale Whinham wrote:
> On Mon, 31 Aug 2026 at 08:13, Konrad Dybcio
> <konrad.dybcio@oss.qualcomm.com> wrote:
>> Let's order the pin nodes by their gpio number
>>
>> otherwise:
>>
>> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>>
>> Konrad
> 
> (Resending as plain text, apologies)
> 
> Thank you Konrad - how about the gpio-keys { } section, should we
> re-order them to:
> 
> key-vol-up   { pm8550 6 }
> key-vol-down { pm8850 8 }
> switch-lid   { tlmm 2 }

Generally if there's not a better criterion, nodes are supposed to be
ordered by their unit address (the number after '@' - none here) or
their name

via

https://docs.kernel.org/devicetree/bindings/dts-coding-style.html#order-of-nodes

Konrad

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

end of thread, other threads:[~2026-09-02 16:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-29 18:41 [PATCH] arm64: dts: qcom: x1-denali: Add volume up/down GPIO keys Dale Whinham
2026-08-31  7:13 ` Konrad Dybcio
2026-08-31 15:51   ` Dale Whinham
2026-09-02 16:24     ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox