diff mbox series

[1/6] arm64: dts: qcom: sm8250-edo: Add hardware keys

Message ID 20210616005843.79579-1-konrad.dybcio@somainline.org
State Accepted
Commit 46e14907c71628ea82daea8911b9f449f478f9b4
Headers show
Series [1/6] arm64: dts: qcom: sm8250-edo: Add hardware keys | expand

Commit Message

Konrad Dybcio June 16, 2021, 12:58 a.m. UTC
Volume Down, GAssist (pdx206 only) and camera keys live on PMIC pins,
with the latter kind being broken for now.. Add these and PON-connected
Volume Up & PWR.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
Depends on https://patchwork.kernel.org/project/linux-arm-msm/patch/20210613124822.124039-1-konrad.dybcio@somainline.org/
 .../qcom/sm8250-sony-xperia-edo-pdx206.dts    | 11 +++++++
 .../boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 30 +++++++++++++++++++
 2 files changed, 41 insertions(+)

Comments

Bjorn Andersson June 16, 2021, 2:41 a.m. UTC | #1
On Tue 15 Jun 19:58 CDT 2021, Konrad Dybcio wrote:
[..]
> diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
[..]
> @@ -3490,6 +3508,89 @@ data {
>  					bias-pull-up;
>  				};
>  			};
> +
> +			pcie0_default_state: pcie0-default {

I thought I answered the other way around (that it should be in the
board file), that said I don't think these are moving much, so I'm not
against keeping them here.

> +				pcie0_perst_default: perst {
> +					pins = "gpio79";
> +					function = "gpio";
> +					drive-strength = <2>;
> +					bias-pull-down;
> +				};
> +
> +				clkreq {
> +					pins = "gpio80";
> +					function = "pci_e0";
> +					drive-strength = <2>;
> +					bias-pull-up;
> +				};
> +
> +				wake {
> +					pins = "gpio81";
> +					function = "gpio";
> +					drive-strength = <2>;
> +					bias-pull-up;
> +				};
> +			};
[..]
> +
> +			mdm2ap_default: mdm2ap-default {

These however are presumably only present on devices with SDX55, so
please move these two to your board file.

Thanks,
Bjorn
Konrad Dybcio June 16, 2021, 12:18 p.m. UTC | #2
> Are you okay with the default firmware paths? Or perhaps would it be
> better to shove them into qcom/sm8250/sony/<some-identifier>/* to avoid
> moving them later?

Since we have to either symlink or copy the binaries from the device Linux

is running on to stay clear wrt proprietary blobs licensing, the default

path is fine, as there won't be any other firmware there. If it turns out we

have a better way of managing this, one can always send a patch changing

it.


Konrad
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts
index 999b662f4679..16c96e838534 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo-pdx206.dts
@@ -18,6 +18,17 @@  &framebuffer {
 	stride = <(1080 * 4)>;
 };
 
+&gpio_keys {
+	g-assist-key {
+		label = "Google Assistant Key";
+		linux,code = <KEY_LEFTMETA>;
+		gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
+		debounce-interval = <15>;
+		linux,can-disable;
+		gpio-key,wakeup;
+	};
+};
+
 &vreg_l2f_1p3 {
 	regulator-min-microvolt = <1200000>;
 	regulator-max-microvolt = <1200000>;
diff --git a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi
index 0db63eb08c60..52ed4b082bd7 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi
@@ -47,6 +47,26 @@  framebuffer: framebuffer@9c000000 {
 		};
 	};
 
+	gpio_keys: gpio-keys {
+		compatible = "gpio-keys";
+
+		/*
+		 * Camera focus (light press) and camera snapshot (full press)
+		 * seem not to work properly.. Adding the former one stalls the CPU
+		 * and the latter kills the volume down key for whatever reason. In any
+		 * case, they are both on &pm8150b_gpios: camera focus(2), camera snapshot(1).
+		 */
+
+		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";
@@ -436,6 +456,16 @@  &i2c15 {
 	/* Richwave RTC6226 FM Radio Receiver @ 64 */
 };
 
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	status = "okay";
+
+	linux,code = <KEY_VOLUMEUP>;
+};
+
 &qupv3_id_0 {
 	status = "okay";
 };