2021-11-20 21:42:49

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 0/8] Improve support for Xiaomi Redmi Note 7

This series expand the Redmi Note 7 device port to support:
+ Regulators
+ Volume keys
+ eMMC and SD card slot
+ Framebuffer display
+ USB

Changes in v2:
- Dropped linux,input-type from volume up as 1 is set by default.
- Dropped gpio-key,wakeup as it's a legacy property name and is
not relevant for a volume button.
- Rename label cont_splash_mem to framebuffer_mem and change node
name to memory.

Changes in v3:
- Add voltage range for vph_pwr
- Move RESIN to PM660 and make PON keys disabled by default
- Addressed review comments from Konrad
- Make Alexey Min the author of the USB patch as he came up with
the patch first on downstream.

Changes in v4:
- Dropped gpio.h from device tree as it's defined in sdm630.dtsi

Alexey Min (1):
arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB

Dang Huynh (7):
arm64: dts: qcom: sdm630: Assign numbers to eMMC and SD
arm64: dts: qcom: sdm630-pm660: Move RESIN to pm660 dtsi
arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators
arm64: dts: qcom: sdm660-xiaomi-lavender: Add PWRKEY and RESIN
arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume up button
arm64: dts: qcom: sdm660-xiaomi-lavender: Add eMMC and SD
arm64: dts: qcom: sdm660-xiaomi-lavender: Enable Simple Framebuffer

arch/arm64/boot/dts/qcom/pm660.dtsi | 12 +-
.../dts/qcom/sdm630-sony-xperia-nile.dtsi | 16 +-
arch/arm64/boot/dts/qcom/sdm630.dtsi | 5 +
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 352 ++++++++++++++++++
4 files changed, 376 insertions(+), 9 deletions(-)

--
2.33.1



2021-11-20 21:42:55

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 1/8] arm64: dts: qcom: sdm630: Assign numbers to eMMC and SD

This makes eMMC/SD device number consistent.

Reviewed-by: Martin Botka <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm630.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi
index 3e0165bb61c5..b75bb87ed290 100644
--- a/arch/arm64/boot/dts/qcom/sdm630.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi
@@ -19,6 +19,11 @@ / {
#address-cells = <2>;
#size-cells = <2>;

+ aliases {
+ mmc1 = &sdhc_1;
+ mmc2 = &sdhc_2;
+ };
+
chosen { };

clocks {
--
2.33.1


2021-11-20 21:43:02

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 2/8] arm64: dts: qcom: sdm630-pm660: Move RESIN to pm660 dtsi

It's not worth duplicating the same node over and over again,
so let's keep the common bits in the pm660 DTSI, making only
changing the status and keycode necessary.

Also, disable RESIN/PWR by default just in case if there are
devices that doesn't use them.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
arch/arm64/boot/dts/qcom/pm660.dtsi | 12 +++++++++++-
.../boot/dts/qcom/sdm630-sony-xperia-nile.dtsi | 16 ++++++++--------
2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
index d0ef8a1675e2..c482663aad56 100644
--- a/arch/arm64/boot/dts/qcom/pm660.dtsi
+++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
@@ -54,14 +54,24 @@ pon: pon@800 {
mode-bootloader = <0x2>;
mode-recovery = <0x1>;

- pwrkey {
+ pon_pwrkey: pwrkey {
compatible = "qcom,pm8941-pwrkey";
interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
debounce = <15625>;
bias-pull-up;
linux,code = <KEY_POWER>;
+
+ status = "disabled";
};

+ pon_resin: resin {
+ compatible = "qcom,pm8941-resin";
+ interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+
+ status = "disabled";
+ };
};

pm660_temp: temp-alarm@2400 {
diff --git a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
index 11d0a8c1cf35..e90c9ec84675 100644
--- a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
@@ -215,14 +215,14 @@ &blsp2_uart1 {
/* HCI Bluetooth */
};

-&pon {
- volup {
- compatible = "qcom,pm8941-resin";
- interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
- debounce = <15625>;
- bias-pull-up;
- linux,code = <KEY_VOLUMEUP>;
- };
+&pon_pwrkey {
+ status = "okay";
+};
+
+&pon_resin {
+ status = "okay";
+
+ linux,code = <KEY_VOLUMEUP>;
};

&qusb2phy {
--
2.33.1


2021-11-20 21:43:02

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 3/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators

Add most of the RPM PM660/PM660L regulators and the fixed ones,
defining the common electrical part of this platform.

Signed-off-by: Dang Huynh <[email protected]>
---
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 266 ++++++++++++++++++
1 file changed, 266 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index 1edc53fd6941..eccbeecef192 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -1,11 +1,14 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2020, Alexey Minnekhanov <[email protected]>
+ * Copyright (c) 2021, Dang Huynh <[email protected]>
*/

/dts-v1/;

#include "sdm660.dtsi"
+#include "pm660.dtsi"
+#include "pm660l.dtsi"

/ {
model = "Xiaomi Redmi Note 7";
@@ -20,6 +23,16 @@ chosen {
stdout-path = "serial0:115200n8";
};

+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+ regulator-min-microvolt = <3700000>;
+ regulator-max-microvolt = <3700000>;
+
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
@@ -40,6 +53,259 @@ &blsp1_uart2 {
status = "okay";
};

+&rpm_requests {
+ pm660l-regulators {
+ compatible = "qcom,rpm-pm660l-regulators";
+
+ vdd_s1-supply = <&vph_pwr>;
+ vdd_s2-supply = <&vph_pwr>;
+ vdd_s3_s4-supply = <&vph_pwr>;
+ vdd_s5-supply = <&vph_pwr>;
+ vdd_s6-supply = <&vph_pwr>;
+
+ vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
+ vdd_l2-supply = <&vreg_bob>;
+ vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
+ vdd_l4_l6-supply = <&vreg_bob>;
+ vdd_bob-supply = <&vph_pwr>;
+
+ vreg_s1b_1p125: s1 {
+ regulator-min-microvolt = <1125000>;
+ regulator-max-microvolt = <1125000>;
+ regulator-enable-ramp-delay = <200>;
+ };
+
+ vreg_s2b_1p05: s2 {
+ regulator-min-microvolt = <1050000>;
+ regulator-max-microvolt = <1050000>;
+ regulator-enable-ramp-delay = <200>;
+ };
+
+ /* LDOs */
+ vreg_l1b_0p925: l1 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <925000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ /* SDHCI 3.3V signal doesn't seem to be supported. */
+ vreg_l2b_2p95: l2 {
+ regulator-min-microvolt = <1648000>;
+ regulator-max-microvolt = <2696000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l3b_3p3: l3 {
+ regulator-min-microvolt = <1700000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l4b_2p95: l4 {
+ regulator-min-microvolt = <2944000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-enable-ramp-delay = <250>;
+
+ regulator-min-microamp = <200>;
+ regulator-max-microamp = <600000>;
+ regulator-system-load = <570000>;
+ regulator-allow-set-load;
+ };
+
+ /*
+ * Downstream specifies a range of 1721-3600mV,
+ * but the only assigned consumers are SDHCI2 VMMC
+ * and Coresight QPDI that both request pinned 2.95V.
+ * Tighten the range to 1.8-3.328 (closest to 3.3) to
+ * make the mmc driver happy.
+ */
+ vreg_l5b_2p95: l5 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3328000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ regulator-system-load = <800000>;
+ };
+
+ vreg_l7b_3p125: l7 {
+ regulator-min-microvolt = <2700000>;
+ regulator-max-microvolt = <3125000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l8b_3p3: l8 {
+ regulator-min-microvolt = <3200000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_bob: bob {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-enable-ramp-delay = <500>;
+ };
+ };
+
+ pm660-regulators {
+ compatible = "qcom,rpm-pm660-regulators";
+
+ vdd_s1-supply = <&vph_pwr>;
+ vdd_s2-supply = <&vph_pwr>;
+ vdd_s3-supply = <&vph_pwr>;
+ vdd_s4-supply = <&vph_pwr>;
+ vdd_s5-supply = <&vph_pwr>;
+ vdd_s6-supply = <&vph_pwr>;
+
+ vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
+ vdd_l2_l3-supply = <&vreg_s2b_1p05>;
+ vdd_l5-supply = <&vreg_s2b_1p05>;
+ vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
+ vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
+
+ /*
+ * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
+ * by the Core Power Reduction hardened (CPRh) and the
+ * Operating State Manager (OSM) HW automatically.
+ */
+
+ vreg_s4a_2p04: s4 {
+ regulator-min-microvolt = <1805000>;
+ regulator-max-microvolt = <2040000>;
+ regulator-enable-ramp-delay = <200>;
+ regulator-always-on;
+ };
+
+ vreg_s5a_1p35: s5 {
+ regulator-min-microvolt = <1224000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-enable-ramp-delay = <200>;
+ };
+
+ vreg_s6a_0p87: s6 {
+ regulator-min-microvolt = <504000>;
+ regulator-max-microvolt = <992000>;
+ regulator-enable-ramp-delay = <150>;
+ };
+
+ /* LDOs */
+ vreg_l1a_1p225: l1 {
+ regulator-min-microvolt = <1150000>;
+ regulator-max-microvolt = <1250000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l2a_1p0: l2 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1010000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l3a_1p0: l3 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1010000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l5a_0p848: l5 {
+ regulator-min-microvolt = <525000>;
+ regulator-max-microvolt = <950000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l6a_1p3: l6 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1370000>;
+ regulator-allow-set-load;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l7a_1p2: l7 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l8a_1p8: l8 {
+ regulator-min-microvolt = <1750000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-system-load = <325000>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l9a_1p8: l9 {
+ regulator-min-microvolt = <1750000>;
+ regulator-max-microvolt = <1900000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l10a_1p8: l10 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l11a_1p8: l11 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l12a_1p8: l12 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ /* This gives power to the LPDDR4: never turn it off! */
+ vreg_l13a_1p8: l13 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vreg_l14a_1p8: l14 {
+ regulator-min-microvolt = <1710000>;
+ regulator-max-microvolt = <1900000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l15a_1p8: l15 {
+ regulator-min-microvolt = <1650000>;
+ regulator-max-microvolt = <2950000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l16a_2p7: l16 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-always-on;
+ };
+
+ vreg_l17a_1p8: l17 {
+ regulator-min-microvolt = <1648000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-enable-ramp-delay = <250>;
+ };
+
+ vreg_l19a_3p3: l19 {
+ regulator-min-microvolt = <3312000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-allow-set-load;
+ };
+ };
+};
+
&tlmm {
gpio-reserved-ranges = <8 4>;
};
--
2.33.1


2021-11-20 21:43:06

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 4/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add PWRKEY and RESIN

This enables the volume down key as well as the power button.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index eccbeecef192..9a6684922804 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -53,6 +53,16 @@ &blsp1_uart2 {
status = "okay";
};

+&pon_pwrkey {
+ status = "okay";
+};
+
+&pon_resin {
+ status = "okay";
+
+ linux,code = <KEY_VOLUMEDOWN>;
+};
+
&rpm_requests {
pm660l-regulators {
compatible = "qcom,rpm-pm660l-regulators";
--
2.33.1


2021-11-20 21:43:09

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 5/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume up button

This enables the volume up key.

Signed-off-by: Dang Huynh <[email protected]>
---
.../arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index 9a6684922804..c7bdf4c28be4 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -9,6 +9,8 @@
#include "sdm660.dtsi"
#include "pm660.dtsi"
#include "pm660l.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/input/gpio-keys.h>

/ {
model = "Xiaomi Redmi Note 7";
@@ -33,6 +35,18 @@ vph_pwr: vph-pwr-regulator {
regulator-boot-on;
};

+ gpio-keys {
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+
+ volup {
+ label = "Volume Up";
+ gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_VOLUMEUP>;
+ debounce-interval = <15>;
+ };
+ };
+
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
--
2.33.1


2021-11-20 21:43:19

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 7/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Enable Simple Framebuffer

This lets the user sees the framebuffer console.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index d30cdc6c160a..45e58714af71 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -22,7 +22,20 @@ aliases {
};

chosen {
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
stdout-path = "serial0:115200n8";
+
+ framebuffer0: framebuffer@9d400000 {
+ compatible = "simple-framebuffer";
+ reg = <0 0x9d400000 0 (1080 * 2340 * 4)>;
+ width = <1080>;
+ height = <2340>;
+ stride = <(1080 * 4)>;
+ format = "a8r8g8b8";
+ };
};

vph_pwr: vph-pwr-regulator {
@@ -60,6 +73,11 @@ ramoops@a0000000 {
ftrace-size = <0x0>;
pmsg-size = <0x20000>;
};
+
+ framebuffer_mem: memory@9d400000 {
+ reg = <0x0 0x9d400000 0x0 0x23ff000>;
+ no-map;
+ };
};
};

--
2.33.1


2021-11-20 21:43:26

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 8/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB

From: Alexey Min <[email protected]>

Enable and configure DWC3 and QUSB2 PHY to enable USB
functionality on the Redmi Note 7.

Signed-off-by: Alexey Min <[email protected]>
Co-developed-by: Dang Huynh <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index 45e58714af71..6cdd9f7c864b 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -79,6 +79,15 @@ framebuffer_mem: memory@9d400000 {
no-map;
};
};
+
+ /*
+ * Until we hook up type-c detection, we
+ * have to stick with this. But it works.
+ */
+ extcon_usb: extcon-usb {
+ compatible = "linux,extcon-usb-gpio";
+ id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
+ };
};

&blsp1_uart2 {
@@ -95,6 +104,13 @@ &pon_resin {
linux,code = <KEY_VOLUMEDOWN>;
};

+&qusb2phy {
+ status = "okay";
+
+ vdd-supply = <&vreg_l1b_0p925>;
+ vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
+};
+
&rpm_requests {
pm660l-regulators {
compatible = "qcom,rpm-pm660l-regulators";
@@ -370,3 +386,12 @@ &sdhc_2 {
&tlmm {
gpio-reserved-ranges = <8 4>;
};
+
+&usb3 {
+ status = "okay";
+};
+
+&usb3_dwc3 {
+ dr_mode = "peripheral";
+ extcon = <&extcon_usb>;
+};
--
2.33.1


2021-11-20 21:44:04

by Dang Huynh

[permalink] [raw]
Subject: [PATCH v4 6/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add eMMC and SD

This commit enable the SD card slot and internal MMC.

Signed-off-by: Dang Huynh <[email protected]>
---
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
index c7bdf4c28be4..d30cdc6c160a 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -330,6 +330,25 @@ vreg_l19a_3p3: l19 {
};
};

+&sdhc_1 {
+ status = "okay";
+ supports-cqe;
+
+ mmc-hs200-1_8v;
+ mmc-hs400-1_8v;
+ mmc-hs400-enhanced-strobe;
+
+ vmmc-supply = <&vreg_l4b_2p95>;
+ vqmmc-supply = <&vreg_l8a_1p8>;
+};
+
+&sdhc_2 {
+ status = "okay";
+
+ vmmc-supply = <&vreg_l5b_2p95>;
+ vqmmc-supply = <&vreg_l2b_2p95>;
+};
+
&tlmm {
gpio-reserved-ranges = <8 4>;
};
--
2.33.1


2021-11-20 21:48:04

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 2/8] arm64: dts: qcom: sdm630-pm660: Move RESIN to pm660 dtsi



On 20/11/2021 21:42, Dang Huynh wrote:
> It's not worth duplicating the same node over and over again,
> so let's keep the common bits in the pm660 DTSI, making only
> changing the status and keycode necessary.
>
> Also, disable RESIN/PWR by default just in case if there are
> devices that doesn't use them.
>
> Reviewed-by: Konrad Dybcio <[email protected]>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/pm660.dtsi | 12 +++++++++++-
> .../boot/dts/qcom/sdm630-sony-xperia-nile.dtsi | 16 ++++++++--------
> 2 files changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/pm660.dtsi b/arch/arm64/boot/dts/qcom/pm660.dtsi
> index d0ef8a1675e2..c482663aad56 100644
> --- a/arch/arm64/boot/dts/qcom/pm660.dtsi
> +++ b/arch/arm64/boot/dts/qcom/pm660.dtsi
> @@ -54,14 +54,24 @@ pon: pon@800 {
> mode-bootloader = <0x2>;
> mode-recovery = <0x1>;
>
> - pwrkey {
> + pon_pwrkey: pwrkey {
> compatible = "qcom,pm8941-pwrkey";
> interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
> debounce = <15625>;
> bias-pull-up;
> linux,code = <KEY_POWER>;
> +
> + status = "disabled";
> };
>
> + pon_resin: resin {
> + compatible = "qcom,pm8941-resin";
> + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> + debounce = <15625>;
> + bias-pull-up;
> +
> + status = "disabled";
> + };
> };
>
> pm660_temp: temp-alarm@2400 {
> diff --git a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
> index 11d0a8c1cf35..e90c9ec84675 100644
> --- a/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi
> @@ -215,14 +215,14 @@ &blsp2_uart1 {
> /* HCI Bluetooth */
> };
>
> -&pon {
> - volup {
> - compatible = "qcom,pm8941-resin";
> - interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> - debounce = <15625>;
> - bias-pull-up;
> - linux,code = <KEY_VOLUMEUP>;
> - };
> +&pon_pwrkey {
> + status = "okay";
> +};
> +
> +&pon_resin {
> + status = "okay";
> +
> + linux,code = <KEY_VOLUMEUP>;
> };
>
> &qusb2phy {
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <[email protected]>

--
Kind Regards,
Caleb


2021-11-20 21:48:27

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 3/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators



On 20/11/2021 21:42, Dang Huynh wrote:
> Add most of the RPM PM660/PM660L regulators and the fixed ones,
> defining the common electrical part of this platform.
>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 266 ++++++++++++++++++
> 1 file changed, 266 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index 1edc53fd6941..eccbeecef192 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -1,11 +1,14 @@
> // SPDX-License-Identifier: GPL-2.0-only
> /*
> * Copyright (c) 2020, Alexey Minnekhanov <[email protected]>
> + * Copyright (c) 2021, Dang Huynh <[email protected]>
> */
>
> /dts-v1/;
>
> #include "sdm660.dtsi"
> +#include "pm660.dtsi"
> +#include "pm660l.dtsi"
>
> / {
> model = "Xiaomi Redmi Note 7";
> @@ -20,6 +23,16 @@ chosen {
> stdout-path = "serial0:115200n8";
> };
>
> + vph_pwr: vph-pwr-regulator {
> + compatible = "regulator-fixed";
> + regulator-name = "vph_pwr";
> + regulator-min-microvolt = <3700000>;
> + regulator-max-microvolt = <3700000>;
> +
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> reserved-memory {
> #address-cells = <2>;
> #size-cells = <2>;
> @@ -40,6 +53,259 @@ &blsp1_uart2 {
> status = "okay";
> };
>
> +&rpm_requests {
> + pm660l-regulators {
> + compatible = "qcom,rpm-pm660l-regulators";
> +
> + vdd_s1-supply = <&vph_pwr>;
> + vdd_s2-supply = <&vph_pwr>;
> + vdd_s3_s4-supply = <&vph_pwr>;
> + vdd_s5-supply = <&vph_pwr>;
> + vdd_s6-supply = <&vph_pwr>;
> +
> + vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
> + vdd_l2-supply = <&vreg_bob>;
> + vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
> + vdd_l4_l6-supply = <&vreg_bob>;
> + vdd_bob-supply = <&vph_pwr>;
> +
> + vreg_s1b_1p125: s1 {
> + regulator-min-microvolt = <1125000>;
> + regulator-max-microvolt = <1125000>;
> + regulator-enable-ramp-delay = <200>;
> + };
> +
> + vreg_s2b_1p05: s2 {
> + regulator-min-microvolt = <1050000>;
> + regulator-max-microvolt = <1050000>;
> + regulator-enable-ramp-delay = <200>;
> + };
> +
> + /* LDOs */
> + vreg_l1b_0p925: l1 {
> + regulator-min-microvolt = <800000>;
> + regulator-max-microvolt = <925000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + /* SDHCI 3.3V signal doesn't seem to be supported. */
> + vreg_l2b_2p95: l2 {
> + regulator-min-microvolt = <1648000>;
> + regulator-max-microvolt = <2696000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l3b_3p3: l3 {
> + regulator-min-microvolt = <1700000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l4b_2p95: l4 {
> + regulator-min-microvolt = <2944000>;
> + regulator-max-microvolt = <2952000>;
> + regulator-enable-ramp-delay = <250>;
> +
> + regulator-min-microamp = <200>;
> + regulator-max-microamp = <600000>;
> + regulator-system-load = <570000>;
> + regulator-allow-set-load;
> + };
> +
> + /*
> + * Downstream specifies a range of 1721-3600mV,
> + * but the only assigned consumers are SDHCI2 VMMC
> + * and Coresight QPDI that both request pinned 2.95V.
> + * Tighten the range to 1.8-3.328 (closest to 3.3) to
> + * make the mmc driver happy.
> + */
> + vreg_l5b_2p95: l5 {
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <3328000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + regulator-system-load = <800000>;
> + };
> +
> + vreg_l7b_3p125: l7 {
> + regulator-min-microvolt = <2700000>;
> + regulator-max-microvolt = <3125000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l8b_3p3: l8 {
> + regulator-min-microvolt = <3200000>;
> + regulator-max-microvolt = <3400000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_bob: bob {
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3600000>;
> + regulator-enable-ramp-delay = <500>;
> + };
> + };
> +
> + pm660-regulators {
> + compatible = "qcom,rpm-pm660-regulators";
> +
> + vdd_s1-supply = <&vph_pwr>;
> + vdd_s2-supply = <&vph_pwr>;
> + vdd_s3-supply = <&vph_pwr>;
> + vdd_s4-supply = <&vph_pwr>;
> + vdd_s5-supply = <&vph_pwr>;
> + vdd_s6-supply = <&vph_pwr>;
> +
> + vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
> + vdd_l2_l3-supply = <&vreg_s2b_1p05>;
> + vdd_l5-supply = <&vreg_s2b_1p05>;
> + vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
> + vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
> +
> + /*
> + * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
> + * by the Core Power Reduction hardened (CPRh) and the
> + * Operating State Manager (OSM) HW automatically.
> + */
> +
> + vreg_s4a_2p04: s4 {
> + regulator-min-microvolt = <1805000>;
> + regulator-max-microvolt = <2040000>;
> + regulator-enable-ramp-delay = <200>;
> + regulator-always-on;
> + };
> +
> + vreg_s5a_1p35: s5 {
> + regulator-min-microvolt = <1224000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-enable-ramp-delay = <200>;
> + };
> +
> + vreg_s6a_0p87: s6 {
> + regulator-min-microvolt = <504000>;
> + regulator-max-microvolt = <992000>;
> + regulator-enable-ramp-delay = <150>;
> + };
> +
> + /* LDOs */
> + vreg_l1a_1p225: l1 {
> + regulator-min-microvolt = <1150000>;
> + regulator-max-microvolt = <1250000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l2a_1p0: l2 {
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1010000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l3a_1p0: l3 {
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1010000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l5a_0p848: l5 {
> + regulator-min-microvolt = <525000>;
> + regulator-max-microvolt = <950000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l6a_1p3: l6 {
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1370000>;
> + regulator-allow-set-load;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l7a_1p2: l7 {
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l8a_1p8: l8 {
> + regulator-min-microvolt = <1750000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-system-load = <325000>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l9a_1p8: l9 {
> + regulator-min-microvolt = <1750000>;
> + regulator-max-microvolt = <1900000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l10a_1p8: l10 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l11a_1p8: l11 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l12a_1p8: l12 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + /* This gives power to the LPDDR4: never turn it off! */
> + vreg_l13a_1p8: l13 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
> +
> + vreg_l14a_1p8: l14 {
> + regulator-min-microvolt = <1710000>;
> + regulator-max-microvolt = <1900000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l15a_1p8: l15 {
> + regulator-min-microvolt = <1650000>;
> + regulator-max-microvolt = <2950000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l16a_2p7: l16 {
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-always-on;
> + };
> +
> + vreg_l17a_1p8: l17 {
> + regulator-min-microvolt = <1648000>;
> + regulator-max-microvolt = <2952000>;
> + regulator-enable-ramp-delay = <250>;
> + };
> +
> + vreg_l19a_3p3: l19 {
> + regulator-min-microvolt = <3312000>;
> + regulator-max-microvolt = <3400000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-allow-set-load;
> + };
> + };
> +};
> +
> &tlmm {
> gpio-reserved-ranges = <8 4>;
> };
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <[email protected]>

--
Kind Regards,
Caleb


2021-11-20 21:49:17

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 4/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add PWRKEY and RESIN



On 20/11/2021 21:42, Dang Huynh wrote:
> This enables the volume down key as well as the power button.
>
> Reviewed-by: Konrad Dybcio <[email protected]>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index eccbeecef192..9a6684922804 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -53,6 +53,16 @@ &blsp1_uart2 {
> status = "okay";
> };
>
> +&pon_pwrkey {
> + status = "okay";
> +};
> +
> +&pon_resin {
> + status = "okay";
> +
> + linux,code = <KEY_VOLUMEDOWN>;
> +};
> +
> &rpm_requests {
> pm660l-regulators {
> compatible = "qcom,rpm-pm660l-regulators";
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <[email protected]>

--
Kind Regards,
Caleb


2021-11-20 21:51:13

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 5/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume up button



On 20/11/2021 21:42, Dang Huynh wrote:
> This enables the volume up key.
>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index 9a6684922804..c7bdf4c28be4 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -9,6 +9,8 @@
> #include "sdm660.dtsi"
> #include "pm660.dtsi"
> #include "pm660l.dtsi"
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/input/gpio-keys.h>
>
> / {
> model = "Xiaomi Redmi Note 7";
> @@ -33,6 +35,18 @@ vph_pwr: vph-pwr-regulator {
> regulator-boot-on;
> };
>
> + gpio-keys {
> + compatible = "gpio-keys";
> + input-name = "gpio-keys";
I don't think input-name is used anymore.
> +
> + volup {
> + label = "Volume Up";
> + gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
> + linux,code = <KEY_VOLUMEUP>;
> + debounce-interval = <15>;
> + };
> + };
> +
> reserved-memory {
> #address-cells = <2>;
> #size-cells = <2>;
> --
> 2.33.1
>

--
Kind Regards,
Caleb


2021-11-20 21:51:33

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 6/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add eMMC and SD



On 20/11/2021 21:42, Dang Huynh wrote:
> This commit enable the SD card slot and internal MMC.
>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index c7bdf4c28be4..d30cdc6c160a 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -330,6 +330,25 @@ vreg_l19a_3p3: l19 {
> };
> };
>
> +&sdhc_1 {
> + status = "okay";
> + supports-cqe;
> +
> + mmc-hs200-1_8v;
> + mmc-hs400-1_8v;
> + mmc-hs400-enhanced-strobe;
> +
> + vmmc-supply = <&vreg_l4b_2p95>;
> + vqmmc-supply = <&vreg_l8a_1p8>;
> +};
> +
> +&sdhc_2 {
> + status = "okay";
> +
> + vmmc-supply = <&vreg_l5b_2p95>;
> + vqmmc-supply = <&vreg_l2b_2p95>;
> +};
> +
> &tlmm {
> gpio-reserved-ranges = <8 4>;
> };
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <[email protected]>

--
Kind Regards,
Caleb


2021-11-20 21:51:53

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 7/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Enable Simple Framebuffer



On 20/11/2021 21:42, Dang Huynh wrote:
> This lets the user sees the framebuffer console.
>
> Reviewed-by: Konrad Dybcio <[email protected]>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index d30cdc6c160a..45e58714af71 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -22,7 +22,20 @@ aliases {
> };
>
> chosen {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + ranges;
> +
> stdout-path = "serial0:115200n8";
> +
> + framebuffer0: framebuffer@9d400000 {
> + compatible = "simple-framebuffer";
> + reg = <0 0x9d400000 0 (1080 * 2340 * 4)>;
> + width = <1080>;
> + height = <2340>;
> + stride = <(1080 * 4)>;
> + format = "a8r8g8b8";
> + };
> };
>
> vph_pwr: vph-pwr-regulator {
> @@ -60,6 +73,11 @@ ramoops@a0000000 {
> ftrace-size = <0x0>;
> pmsg-size = <0x20000>;
> };
> +
> + framebuffer_mem: memory@9d400000 {
> + reg = <0x0 0x9d400000 0x0 0x23ff000>;
> + no-map;
> + };
> };
> };
>
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <[email protected]>

--
Kind Regards,
Caleb


2021-11-20 21:56:42

by Caleb Connolly

[permalink] [raw]
Subject: Re: [PATCH v4 8/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB



On 20/11/2021 21:42, Dang Huynh wrote:
> From: Alexey Min <[email protected]>
>
> Enable and configure DWC3 and QUSB2 PHY to enable USB
> functionality on the Redmi Note 7.
>
> Signed-off-by: Alexey Min <[email protected]>
> Co-developed-by: Dang Huynh <[email protected]>
> Reviewed-by: Konrad Dybcio <[email protected]>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 25 +++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> index 45e58714af71..6cdd9f7c864b 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -79,6 +79,15 @@ framebuffer_mem: memory@9d400000 {
> no-map;
> };
> };
> +
> + /*
> + * Until we hook up type-c detection, we
> + * have to stick with this. But it works.
> + */
> + extcon_usb: extcon-usb {
> + compatible = "linux,extcon-usb-gpio";
> + id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
> + };
> };
>
> &blsp1_uart2 {
> @@ -95,6 +104,13 @@ &pon_resin {
> linux,code = <KEY_VOLUMEDOWN>;
> };
>
> +&qusb2phy {
> + status = "okay";
> +
> + vdd-supply = <&vreg_l1b_0p925>;
> + vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
> +};
> +
> &rpm_requests {
> pm660l-regulators {
> compatible = "qcom,rpm-pm660l-regulators";
> @@ -370,3 +386,12 @@ &sdhc_2 {
> &tlmm {
> gpio-reserved-ranges = <8 4>;
> };
> +
> +&usb3 {
> + status = "okay";
> +};
> +
> +&usb3_dwc3 {
> + dr_mode = "peripheral";
> + extcon = <&extcon_usb>;
> +};
> --
> 2.33.1
>

Reviewed-by: Caleb Connolly <caleb@connolly>

--
Kind Regards,
Caleb


2021-11-20 23:55:45

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v4 0/8] Improve support for Xiaomi Redmi Note 7

On Sun, 21 Nov 2021 04:42:19 +0700, Dang Huynh wrote:
> This series expand the Redmi Note 7 device port to support:
> + Regulators
> + Volume keys
> + eMMC and SD card slot
> + Framebuffer display
> + USB
>
> [...]

Applied, thanks!

[1/8] arm64: dts: qcom: sdm630: Assign numbers to eMMC and SD
commit: b139425115b801e56fe2d6dbcd2e798be87e2e06
[2/8] arm64: dts: qcom: sdm630-pm660: Move RESIN to pm660 dtsi
commit: 9f6cbe37a72fc9dafe8f560e557c93209cc100e7
[3/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators
commit: 262a8ad19cdfd8e177d32bfbec1691a2069951b1
[4/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add PWRKEY and RESIN
commit: 4c420a0449ce0882f225e6e7ae3edc87becd2e85
[6/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add eMMC and SD
commit: cf85e9aee210fefd7a85c1ced0a73382e5edcfd0
[7/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Enable Simple Framebuffer
commit: e631e904e1d89650e3c8facdfb37cfca3491a52d
[8/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB
commit: e5d3e752b050e03d2046011a3865721a3f200216

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

2021-11-20 23:57:50

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v4 5/8] arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume up button

On Sat 20 Nov 15:51 CST 2021, Caleb Connolly wrote:

>
>
> On 20/11/2021 21:42, Dang Huynh wrote:
> > This enables the volume up key.
> >
> > Signed-off-by: Dang Huynh <[email protected]>
> > ---
> > .../arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> > index 9a6684922804..c7bdf4c28be4 100644
> > --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> > +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> > @@ -9,6 +9,8 @@
> > #include "sdm660.dtsi"
> > #include "pm660.dtsi"
> > #include "pm660l.dtsi"
> > +#include <dt-bindings/input/input.h>
> > +#include <dt-bindings/input/gpio-keys.h>
> >
> > / {
> > model = "Xiaomi Redmi Note 7";
> > @@ -33,6 +35,18 @@ vph_pwr: vph-pwr-regulator {
> > regulator-boot-on;
> > };
> >
> > + gpio-keys {
> > + compatible = "gpio-keys";
> > + input-name = "gpio-keys";
> I don't think input-name is used anymore.

It seems you're correct, we have it in a number of dts files, but I
don't see it in the binding document or the Linux implementation.

I've applied the rest of the patches in the series for now.

Thanks,
Bjorn

> > +
> > + volup {
> > + label = "Volume Up";
> > + gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
> > + linux,code = <KEY_VOLUMEUP>;
> > + debounce-interval = <15>;
> > + };
> > + };
> > +
> > reserved-memory {
> > #address-cells = <2>;
> > #size-cells = <2>;
> > --
> > 2.33.1
> >
>
> --
> Kind Regards,
> Caleb
>