2022-12-10 16:09:19

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH 1/3] arm64: dts: qcom: sm8150-kumano: Add GPIO keys

Configure hardware buttons (V-, Camera Shutter/Focus) on Kumano
devices.

Signed-off-by: Konrad Dybcio <[email protected]>
---
.../dts/qcom/sm8150-sony-xperia-kumano.dtsi | 62 +++++++++++++++++++
1 file changed, 62 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index c958a8b16730..2352dff213fc 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -46,6 +46,40 @@ framebuffer: framebuffer@9c000000 {
};
};

+ gpio-keys {
+ compatible = "gpio-keys";
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&focus_n &snapshot_n &vol_down_n>;
+
+ key-camera-focus {
+ label = "Camera Focus";
+ linux,code = <KEY_CAMERA_FOCUS>;
+ gpios = <&pm8150b_gpios 2 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ linux,can-disable;
+ gpio-key,wakeup;
+ };
+
+ key-camera-snapshot {
+ label = "Camera Snapshot";
+ linux,code = <KEY_CAMERA>;
+ gpios = <&pm8150b_gpios 1 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ linux,can-disable;
+ gpio-key,wakeup;
+ };
+
+ key-vol-down {
+ label = "Volume Down";
+ linux,code = <KEY_VOLUMEDOWN>;
+ gpios = <&pm8150_gpios 1 GPIO_ACTIVE_LOW>;
+ debounce-interval = <15>;
+ linux,can-disable;
+ gpio-key,wakeup;
+ };
+ };
+
vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
@@ -410,6 +444,34 @@ &i2c10 {
/* Samsung touchscreen @ 48 */
};

+&pm8150_gpios {
+ vol_down_n: vol-down-n-state {
+ pins = "gpio1";
+ function = "normal";
+ power-source = <0>;
+ bias-pull-up;
+ input-enable;
+ };
+};
+
+&pm8150b_gpios {
+ snapshot_n: snapshot-n-state {
+ pins = "gpio1";
+ function = "normal";
+ power-source = <0>;
+ bias-pull-up;
+ input-enable;
+ };
+
+ focus_n: focus-n-state {
+ pins = "gpio2";
+ function = "normal";
+ power-source = <0>;
+ bias-pull-up;
+ input-enable;
+ };
+};
+
&pon_pwrkey {
status = "okay";
};
--
2.38.1


2022-12-10 16:19:26

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: qcom: sm8150-kumano: Configure resin as volume up key

From: Marijn Suijten <[email protected]>

The volume-up button on both kumanos (Xperia 1 and Xperia 5) are mapped
to resin.

Signed-off-by: Marijn Suijten <[email protected]>
Signed-off-by: Konrad Dybcio <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index 9d667bb6f25b..d64f2b04e267 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -486,6 +486,11 @@ &pon_pwrkey {
status = "okay";
};

+&pon_resin {
+ linux,code = <KEY_VOLUMEUP>;
+ status = "okay";
+};
+
&qupv3_id_0 {
status = "okay";
};
--
2.38.1

2022-12-10 16:20:07

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH 2/3] arm64: dts: qcom: sm8150-kumano: Add NXP PN553 NFC

Add a node for NXP PN553 NFC (or PN557, unclear data), using the
nxp-nci driver.

Signed-off-by: Konrad Dybcio <[email protected]>
---
.../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
index 2352dff213fc..9d667bb6f25b 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
@@ -428,8 +428,18 @@ &i2c4 {

/* Qcom SMB1355 @ c */
/* Qcom SMB1390 @ 10 */
- /* NXP PN553 NFC @ 28 */
/* Qcom FSA4480 USB-C audio switch @ 43 */
+
+ nfc@28 {
+ compatible = "nxp,nxp-nci-i2c";
+ reg = <0x28>;
+
+ interrupt-parent = <&tlmm>;
+ interrupts = <47 IRQ_TYPE_EDGE_RISING>;
+
+ enable-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
+ firmware-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
+ };
};

&i2c7 {
--
2.38.1

2022-12-13 11:51:24

by Marijn Suijten

[permalink] [raw]
Subject: Re: [PATCH 1/3] arm64: dts: qcom: sm8150-kumano: Add GPIO keys

On 2022-12-10 15:25:23, Konrad Dybcio wrote:
> Configure hardware buttons (V-, Camera Shutter/Focus) on Kumano
> devices.
>
> Signed-off-by: Konrad Dybcio <[email protected]>

Reviewed-by: Marijn Suijten <[email protected]>
Tested-by: Marijn Suijten <[email protected]> # On Xperia 1 and Xperia 5

2022-12-13 12:02:37

by Marijn Suijten

[permalink] [raw]
Subject: Re: [PATCH 2/3] arm64: dts: qcom: sm8150-kumano: Add NXP PN553 NFC

On 2022-12-10 15:25:24, Konrad Dybcio wrote:
> Add a node for NXP PN553 NFC (or PN557, unclear data), using the
> nxp-nci driver.
>
> Signed-off-by: Konrad Dybcio <[email protected]>

Reviewed-by: Marijn Suijten <[email protected]>
Tested-by: Marijn Suijten <[email protected]> # On Xperia 1 and Xperia 5

Unfortunately I can only test this with neard-tools' nfctool, which
reports a tag (from another phone) has been detected but does not allow
me to show its contents (I may have simply not figured out /how/), and
the other phone with the "NFC Tools" app shows nothing when trying to
read from any of the kumano phones (but then I am also unsure how to
"present" a tag via nfctool, and expected it to be implicit when running
as "initiator").

Debug/testing advice appreciated :)

- Marijn

> ---
> .../boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> index 2352dff213fc..9d667bb6f25b 100644
> --- a/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano.dtsi
> @@ -428,8 +428,18 @@ &i2c4 {
>
> /* Qcom SMB1355 @ c */
> /* Qcom SMB1390 @ 10 */
> - /* NXP PN553 NFC @ 28 */
> /* Qcom FSA4480 USB-C audio switch @ 43 */
> +
> + nfc@28 {
> + compatible = "nxp,nxp-nci-i2c";
> + reg = <0x28>;
> +
> + interrupt-parent = <&tlmm>;
> + interrupts = <47 IRQ_TYPE_EDGE_RISING>;
> +
> + enable-gpios = <&tlmm 41 GPIO_ACTIVE_HIGH>;
> + firmware-gpios = <&tlmm 48 GPIO_ACTIVE_HIGH>;
> + };
> };
>
> &i2c7 {
> --
> 2.38.1
>

2022-12-28 04:39:41

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH 1/3] arm64: dts: qcom: sm8150-kumano: Add GPIO keys

On Sat, 10 Dec 2022 15:25:23 +0100, Konrad Dybcio wrote:
> Configure hardware buttons (V-, Camera Shutter/Focus) on Kumano
> devices.
>
>

Applied, thanks!

[1/3] arm64: dts: qcom: sm8150-kumano: Add GPIO keys
commit: 0ead2d1758714fb724e062f76fdb4868ba8303e6
[2/3] arm64: dts: qcom: sm8150-kumano: Add NXP PN553 NFC
commit: 6cef82a8a7d9cbfacc94914791fbbe526709aa43
[3/3] arm64: dts: qcom: sm8150-kumano: Configure resin as volume up key
commit: 632a35e24fefa24f79a97310e8c4642e33919204

Best regards,
--
Bjorn Andersson <[email protected]>