2024-01-30 20:28:55

by Anton Bambura

[permalink] [raw]
Subject: [PATCH v1 0/5] Device-tree improvements for Lenovo Flex/Yoga 5G laptop

This improves device-tree of Lenovo Flex/Yoga 5G laptop with these changes:
- fix GPU firmware path (make it use device-specific firmware directory);
- set names for i2c hid nodes (so it is clear which node corresponds to which
device);
- add touchscreen support;
- fix touchpad issue when it gets stuck on right or middle click;
- allow UFS regulators load/mode setting.


Anton Bambura (5):
arm64: dts: qcom: sc8180x-lenovo-flex-5g: fix GPU firmware path
arm64: dts: qcom: sc8180x-lenovo-flex-5g: set names for i2c hid nodes
arm64: dts: qcom: sc8180x-lenovo-flex-5g: enable touchscreen
arm64: dts: qcom: sc8180x-lenovo-flex-5g: set touchpad i2c frequency
to 10 kHz
arm64: dts: qcom: sc8180x-lenovo-flex-5g: Allow UFS regulators
load/mode setting

.../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 48 ++++++++++++++++---
1 file changed, 41 insertions(+), 7 deletions(-)

--
2.42.0



2024-01-30 20:29:24

by Anton Bambura

[permalink] [raw]
Subject: [PATCH v1 3/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: enable touchscreen

Set regulators, reset gpio and delays according to ACPI tables.

Signed-off-by: Anton Bambura <[email protected]>
---
.../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 32 +++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
index af61acf58d68..8e8e1fca11c0 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
@@ -271,6 +271,12 @@ vreg_l3c_1p2: ldo3 {
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
};

+ vreg_l4c_3p3: ldo4 {
+ regulator-min-microvolt = <3296000>;
+ regulator-max-microvolt = <3304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
vreg_l10c_3p3: ldo10 {
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3312000>;
@@ -337,6 +343,12 @@ vreg_l10e_2p9: ldo10 {
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
};

+ vreg_l12e_1p8: ldo12 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
vreg_l16e_3p0: ldo16 {
regulator-min-microvolt = <3072000>;
regulator-max-microvolt = <3072000>;
@@ -357,7 +369,7 @@ zap-shader {
&i2c1 {
clock-frequency = <100000>;

- pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
+ pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>, <&ts_reset>;
pinctrl-names = "default";

status = "okay";
@@ -365,9 +377,17 @@ &i2c1 {
touchscreen@10 {
compatible = "hid-over-i2c";
reg = <0x10>;
+
hid-descr-addr = <0x1>;
+ reset-gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
+
+ vdd-supply = <&vreg_l4c_3p3>;
+ vddl-supply = <&vreg_l12e_1p8>;

- interrupts-extended = <&tlmm 122 IRQ_TYPE_LEVEL_LOW>;
+ post-power-on-delay-ms = <3>;
+ post-reset-deassert-delay-ms = <200>;
+
+ interrupts-extended = <&tlmm 122 IRQ_TYPE_EDGE_FALLING>;
};
};

@@ -718,6 +738,14 @@ wake-n-pins {
};
};

+ ts_reset: ts-reset-state {
+ pins = "gpio54";
+ function = "gpio";
+
+ bias-disable;
+ drive-strength = <16>;
+ };
+
usbprim_sbu_default: usbprim-sbu-state {
oe-n-pins {
pins = "gpio152";
--
2.42.0


2024-01-30 20:42:29

by Anton Bambura

[permalink] [raw]
Subject: [PATCH v1 4/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: set touchpad i2c frequency to 10 kHz

This solves the issue when touchpad gets stuck on right or middle
click. This also makes touchpad working smoother.

Signed-off-by: Anton Bambura <[email protected]>
---
arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
index 8e8e1fca11c0..a8816ff0ba51 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
@@ -392,7 +392,7 @@ touchscreen@10 {
};

&i2c7 {
- clock-frequency = <100000>;
+ clock-frequency = <1000000>;

pinctrl-0 = <&i2c7_active>, <&i2c7_hid_active>;
pinctrl-names = "default";
--
2.42.0


2024-01-30 20:43:36

by Anton Bambura

[permalink] [raw]
Subject: [PATCH v1 5/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: Allow UFS regulators load/mode setting

The UFS driver expects to be able to set load (and by extension, mode)
on the supplied regulators. Add the necessary properties to make that
possible.

Based on https://lore.kernel.org/r/[email protected]

Signed-off-by: Anton Bambura <[email protected]>
---
arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
index a8816ff0ba51..3e2c7846d95e 100644
--- a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
+++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
@@ -335,12 +335,18 @@ vreg_l7e_1p8: ldo7 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
+ regulator-allow-set-load;
};

vreg_l10e_2p9: ldo10 {
regulator-min-microvolt = <2904000>;
regulator-max-microvolt = <2904000>;
regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
+ RPMH_REGULATOR_MODE_HPM>;
+ regulator-allow-set-load;
};

vreg_l12e_1p8: ldo12 {
--
2.42.0


2024-02-01 19:29:31

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v1 3/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: enable touchscreen

On 30.01.2024 21:27, Anton Bambura wrote:
> Set regulators, reset gpio and delays according to ACPI tables.
>
> Signed-off-by: Anton Bambura <[email protected]>
> ---
> .../boot/dts/qcom/sc8180x-lenovo-flex-5g.dts | 32 +++++++++++++++++--
> 1 file changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> index af61acf58d68..8e8e1fca11c0 100644
> --- a/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8180x-lenovo-flex-5g.dts
> @@ -271,6 +271,12 @@ vreg_l3c_1p2: ldo3 {
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> };
>
> + vreg_l4c_3p3: ldo4 {
> + regulator-min-microvolt = <3296000>;
> + regulator-max-microvolt = <3304000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> vreg_l10c_3p3: ldo10 {
> regulator-min-microvolt = <3000000>;
> regulator-max-microvolt = <3312000>;
> @@ -337,6 +343,12 @@ vreg_l10e_2p9: ldo10 {
> regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> };
>
> + vreg_l12e_1p8: ldo12 {
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> + };
> +
> vreg_l16e_3p0: ldo16 {
> regulator-min-microvolt = <3072000>;
> regulator-max-microvolt = <3072000>;
> @@ -357,7 +369,7 @@ zap-shader {
> &i2c1 {
> clock-frequency = <100000>;
>
> - pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>;
> + pinctrl-0 = <&i2c1_active>, <&i2c1_hid_active>, <&ts_reset>;

I think you want to add a reference under the touchscreen node instead.

Konrad

2024-02-01 19:30:09

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v1 4/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: set touchpad i2c frequency to 10 kHz

On 30.01.2024 21:27, Anton Bambura wrote:
> This solves the issue when touchpad gets stuck on right or middle
> click. This also makes touchpad working smoother.
>
> Signed-off-by: Anton Bambura <[email protected]>
> ---

You mean to 1 MHz?

Konrad

2024-02-01 19:30:37

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v1 5/5] arm64: dts: qcom: sc8180x-lenovo-flex-5g: Allow UFS regulators load/mode setting

On 30.01.2024 21:27, Anton Bambura wrote:
> The UFS driver expects to be able to set load (and by extension, mode)
> on the supplied regulators. Add the necessary properties to make that
> possible.
>
> Based on https://lore.kernel.org/r/[email protected]
>
> Signed-off-by: Anton Bambura <[email protected]>
> ---

Reviewed-by: Konrad Dybcio <[email protected]>

Konrad