All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys
@ 2022-12-13 12:09 Konrad Dybcio
  2022-12-13 12:26 ` Marijn Suijten
  2022-12-22 19:02 ` Marijn Suijten
  0 siblings, 2 replies; 3+ messages in thread
From: Konrad Dybcio @ 2022-12-13 12:09 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross, krzysztof.kozlowski
  Cc: marijn.suijten, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-kernel

With enough pins set properly, the hardware buttons now also work
like a charm.

Fixes: c2721b0c23d9 ("arm64: dts: qcom: Add support for Xperia 1 III / 5 III")
Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Xperia 5 III
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes in v2:
- Look at the 1 III again, realize there's a recessed button, add it
to the common DT to make it work on both devices.. (Marijn)

 .../dts/qcom/sm8350-sony-xperia-sagami.dtsi   | 64 ++++++++++++++++++-
 1 file changed, 63 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
index d73e1f3fa501..2f727e4f2e57 100644
--- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
@@ -49,7 +49,35 @@ framebuffer: framebuffer@e1000000 {
 	gpio-keys {
 		compatible = "gpio-keys";
 
-		/* For reasons still unknown, GAssist key and Camera Focus/Shutter don't work.. */
+		pinctrl-names = "default";
+		pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &g_assist_n>;
+
+		key-camera-focus {
+			label = "Camera Focus";
+			linux,code = <KEY_CAMERA_FOCUS>;
+			gpios = <&pm8350b_gpios 8 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+			linux,can-disable;
+			gpio-key,wakeup;
+		};
+
+		key-camera-snapshot {
+			label = "Camera Snapshot";
+			linux,code = <KEY_CAMERA>;
+			gpios = <&pm8350b_gpios 5 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+			linux,can-disable;
+			gpio-key,wakeup;
+		};
+
+		key-google-assist {
+			label = "Google Assistant Key";
+			gpios = <&pm8350_gpios 9 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_LEFTMETA>;
+			debounce-interval = <15>;
+			linux,can-disable;
+			gpio-key,wakeup;
+		};
 
 		key-vol-down {
 			label = "Volume Down";
@@ -545,6 +573,32 @@ &pm8350_gpios {
 			  "NC",
 			  "G_ASSIST_N",
 			  "PM8350_OPTION"; /* GPIO_10 */
+
+	g_assist_n: g-assist-n-state {
+		pins = "gpio9";
+		function = "normal";
+		power-source = <1>;
+		bias-pull-up;
+		input-enable;
+	};
+};
+
+&pm8350b_gpios {
+	snapshot_n: snapshot-n-state {
+		pins = "gpio5";
+		function = "normal";
+		power-source = <0>;
+		bias-pull-up;
+		input-enable;
+	};
+
+	focus_n: focus-n-state {
+		pins = "gpio8";
+		function = "normal";
+		power-source = <0>;
+		input-enable;
+		bias-pull-up;
+	};
 };
 
 &pmk8350_gpios {
@@ -552,6 +606,14 @@ &pmk8350_gpios {
 			  "NC",
 			  "VOL_DOWN_N",
 			  "PMK8350_OPTION";
+
+	vol_down_n: vol-down-n-state {
+		pins = "gpio3";
+		function = "normal";
+		power-source = <0>;
+		bias-pull-up;
+		input-enable;
+	};
 };
 
 &pmk8350_rtc {
-- 
2.39.0


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

* Re: [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys
  2022-12-13 12:09 [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys Konrad Dybcio
@ 2022-12-13 12:26 ` Marijn Suijten
  2022-12-22 19:02 ` Marijn Suijten
  1 sibling, 0 replies; 3+ messages in thread
From: Marijn Suijten @ 2022-12-13 12:26 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 13:09:43, Konrad Dybcio wrote:
> With enough pins set properly, the hardware buttons now also work
> like a charm.
> 
> Fixes: c2721b0c23d9 ("arm64: dts: qcom: Add support for Xperia 1 III / 5 III")
> Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Xperia 5 III

And now of course also on:

Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Xperia 1 III and Xperia 5 III

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

* Re: [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys
  2022-12-13 12:09 [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys Konrad Dybcio
  2022-12-13 12:26 ` Marijn Suijten
@ 2022-12-22 19:02 ` Marijn Suijten
  1 sibling, 0 replies; 3+ messages in thread
From: Marijn Suijten @ 2022-12-22 19:02 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: linux-arm-msm, andersson, agross, krzysztof.kozlowski,
	Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel

On 2022-12-13 13:09:43, Konrad Dybcio wrote:
> With enough pins set properly, the hardware buttons now also work
> like a charm.
> 
> Fixes: c2721b0c23d9 ("arm64: dts: qcom: Add support for Xperia 1 III / 5 III")
> Tested-by: Marijn Suijten <marijn.suijten@somainline.org> # On Xperia 5 III
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> Changes in v2:
> - Look at the 1 III again, realize there's a recessed button, add it
> to the common DT to make it work on both devices.. (Marijn)
> 
>  .../dts/qcom/sm8350-sony-xperia-sagami.dtsi   | 64 ++++++++++++++++++-
>  1 file changed, 63 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
> index d73e1f3fa501..2f727e4f2e57 100644
> --- a/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8350-sony-xperia-sagami.dtsi
> @@ -49,7 +49,35 @@ framebuffer: framebuffer@e1000000 {
>  	gpio-keys {
>  		compatible = "gpio-keys";
>  
> -		/* For reasons still unknown, GAssist key and Camera Focus/Shutter don't work.. */
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&focus_n &snapshot_n &vol_down_n &g_assist_n>;
> +
> +		key-camera-focus {
> +			label = "Camera Focus";
> +			linux,code = <KEY_CAMERA_FOCUS>;
> +			gpios = <&pm8350b_gpios 8 GPIO_ACTIVE_LOW>;
> +			debounce-interval = <15>;
> +			linux,can-disable;
> +			gpio-key,wakeup;

I just found out that this property is deprecated in favour of
wakeup-source.  The one you use doesn't pass bindings validation anyway.

After fixing that:

Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>

- Marijn

> +		};
> +
> +		key-camera-snapshot {
> +			label = "Camera Snapshot";
> +			linux,code = <KEY_CAMERA>;
> +			gpios = <&pm8350b_gpios 5 GPIO_ACTIVE_LOW>;
> +			debounce-interval = <15>;
> +			linux,can-disable;
> +			gpio-key,wakeup;
> +		};
> +
> +		key-google-assist {
> +			label = "Google Assistant Key";
> +			gpios = <&pm8350_gpios 9 GPIO_ACTIVE_LOW>;
> +			linux,code = <KEY_LEFTMETA>;
> +			debounce-interval = <15>;
> +			linux,can-disable;
> +			gpio-key,wakeup;
> +		};
>  
>  		key-vol-down {
>  			label = "Volume Down";
> @@ -545,6 +573,32 @@ &pm8350_gpios {
>  			  "NC",
>  			  "G_ASSIST_N",
>  			  "PM8350_OPTION"; /* GPIO_10 */
> +
> +	g_assist_n: g-assist-n-state {
> +		pins = "gpio9";
> +		function = "normal";
> +		power-source = <1>;
> +		bias-pull-up;
> +		input-enable;
> +	};
> +};
> +
> +&pm8350b_gpios {
> +	snapshot_n: snapshot-n-state {
> +		pins = "gpio5";
> +		function = "normal";
> +		power-source = <0>;
> +		bias-pull-up;
> +		input-enable;
> +	};
> +
> +	focus_n: focus-n-state {
> +		pins = "gpio8";
> +		function = "normal";
> +		power-source = <0>;
> +		input-enable;
> +		bias-pull-up;
> +	};
>  };
>  
>  &pmk8350_gpios {
> @@ -552,6 +606,14 @@ &pmk8350_gpios {
>  			  "NC",
>  			  "VOL_DOWN_N",
>  			  "PMK8350_OPTION";
> +
> +	vol_down_n: vol-down-n-state {
> +		pins = "gpio3";
> +		function = "normal";
> +		power-source = <0>;
> +		bias-pull-up;
> +		input-enable;
> +	};
>  };
>  
>  &pmk8350_rtc {
> -- 
> 2.39.0
> 

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

end of thread, other threads:[~2022-12-22 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 12:09 [PATCH v2] arm64: dts: qcom: sm8350-sagami: Rectify GPIO keys Konrad Dybcio
2022-12-13 12:26 ` Marijn Suijten
2022-12-22 19:02 ` Marijn Suijten

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.