2022-12-22 22:13:54

by Marijn Suijten

[permalink] [raw]
Subject: [PATCH v2] arm64: dts: qcom: sm6350-lena: Flatten gpio-keys pinctrl state

Pinctrl states typically collate multiple related pins. In the case of
gpio-keys there's no hardware-defined relation at all except all pins
representing a key; and especially on Sony's lena board there's only one
pin regardless. Flatten it similar to other boards [1].

As a drive-by fix, clean up the label string.

[1]: https://lore.kernel.org/linux-arm-msm/[email protected]/

Fixes: 2b8bbe985659 ("arm64: dts: qcom: sm6350-lena: Include pm6350 and configure buttons")
Signed-off-by: Marijn Suijten <[email protected]>
---

Changes since v1:

- Replace accidental semicolon in patch title with colon.

v1: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#u

.../qcom/sm6350-sony-xperia-lena-pdx213.dts | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
index 94f77d376662..4916d0db5b47 100644
--- a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
+++ b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
@@ -35,10 +35,10 @@ framebuffer: framebuffer@a0000000 {
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
- pinctrl-0 = <&gpio_keys_state>;
+ pinctrl-0 = <&vol_down_n>;

key-volume-down {
- label = "volume_down";
+ label = "Volume Down";
linux,code = <KEY_VOLUMEDOWN>;
gpios = <&pm6350_gpios 2 GPIO_ACTIVE_LOW>;
};
@@ -305,14 +305,12 @@ touchscreen@48 {
};

&pm6350_gpios {
- gpio_keys_state: gpio-keys-state {
- key-volume-down-pins {
- pins = "gpio2";
- function = PMIC_GPIO_FUNC_NORMAL;
- power-source = <0>;
- bias-disable;
- input-enable;
- };
+ vol_down_n: vol-down-n-state {
+ pins = "gpio2";
+ function = PMIC_GPIO_FUNC_NORMAL;
+ power-source = <0>;
+ bias-disable;
+ input-enable;
};
};

--
2.39.0


2022-12-22 22:15:50

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2] arm64: dts: qcom: sm6350-lena: Flatten gpio-keys pinctrl state



On 22.12.2022 22:59, Marijn Suijten wrote:
> Pinctrl states typically collate multiple related pins. In the case of
> gpio-keys there's no hardware-defined relation at all except all pins
> representing a key; and especially on Sony's lena board there's only one
> pin regardless. Flatten it similar to other boards [1].
>
> As a drive-by fix, clean up the label string.
>
> [1]: https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> Fixes: 2b8bbe985659 ("arm64: dts: qcom: sm6350-lena: Include pm6350 and configure buttons")
> Signed-off-by: Marijn Suijten <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
>
> Changes since v1:
>
> - Replace accidental semicolon in patch title with colon.
>
> v1: https://lore.kernel.org/linux-arm-msm/[email protected]/T/#u
>
> .../qcom/sm6350-sony-xperia-lena-pdx213.dts | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
> index 94f77d376662..4916d0db5b47 100644
> --- a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
> +++ b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
> @@ -35,10 +35,10 @@ framebuffer: framebuffer@a0000000 {
> gpio-keys {
> compatible = "gpio-keys";
> pinctrl-names = "default";
> - pinctrl-0 = <&gpio_keys_state>;
> + pinctrl-0 = <&vol_down_n>;
>
> key-volume-down {
> - label = "volume_down";
> + label = "Volume Down";
> linux,code = <KEY_VOLUMEDOWN>;
> gpios = <&pm6350_gpios 2 GPIO_ACTIVE_LOW>;
> };
> @@ -305,14 +305,12 @@ touchscreen@48 {
> };
>
> &pm6350_gpios {
> - gpio_keys_state: gpio-keys-state {
> - key-volume-down-pins {
> - pins = "gpio2";
> - function = PMIC_GPIO_FUNC_NORMAL;
> - power-source = <0>;
> - bias-disable;
> - input-enable;
> - };
> + vol_down_n: vol-down-n-state {
> + pins = "gpio2";
> + function = PMIC_GPIO_FUNC_NORMAL;
> + power-source = <0>;
> + bias-disable;
> + input-enable;
> };
> };
>

2022-12-29 17:43:34

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2] arm64: dts: qcom: sm6350-lena: Flatten gpio-keys pinctrl state

On Thu, 22 Dec 2022 22:59:06 +0100, Marijn Suijten wrote:
> Pinctrl states typically collate multiple related pins. In the case of
> gpio-keys there's no hardware-defined relation at all except all pins
> representing a key; and especially on Sony's lena board there's only one
> pin regardless. Flatten it similar to other boards [1].
>
> As a drive-by fix, clean up the label string.
>
> [...]

Applied, thanks!

[1/1] arm64: dts: qcom: sm6350-lena: Flatten gpio-keys pinctrl state
commit: a40f5ae1ea64ab9e981faf47c31817dc4d7923e4

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