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.
Dang Huynh (7):
arm64: dts: qcom: sdm630: Assign numbers to eMMC and SD
arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators
arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume down button
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
arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB
arch/arm64/boot/dts/qcom/sdm630.dtsi | 5 +
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 385 ++++++++++++++++++
2 files changed, 390 insertions(+)
--
2.33.1
This enables the volume up key.
Reviewed-by: Caleb Connolly <[email protected]>
Reviewed-by: Martin Botka <[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 28408240735b..ab814dc8a875 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -9,6 +9,9 @@
#include "sdm660.dtsi"
#include "pm660.dtsi"
#include "pm660l.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/input/gpio-keys.h>
/ {
model = "Xiaomi Redmi Note 7";
@@ -31,6 +34,21 @@ vph_pwr: vph-pwr-regulator {
regulator-boot-on;
};
+ gpio_keys {
+ status = "okay";
+ compatible = "gpio-keys";
+ input-name = "gpio-keys";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ vol_up {
+ 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
This enables the volume down key.
Reviewed-by: Caleb Connolly <[email protected]>
Reviewed-by: Martin Botka <[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 365a03b56cde..28408240735b 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -51,6 +51,16 @@ &blsp1_uart2 {
status = "okay";
};
+&pon {
+ voldown {
+ compatible = "qcom,pm8941-resin";
+ interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
+ debounce = <15625>;
+ bias-pull-up;
+ linux,code = <KEY_VOLUMEDOWN>;
+ };
+};
+
&rpm_requests {
pm660l-regulators {
compatible = "qcom,rpm-pm660l-regulators";
--
2.33.1
Enable and configure DWC3 and QUSB2 PHY to enable USB
functionality on the Redmi Note 7.
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 122b487f197b..a34812e91160 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -82,6 +82,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 {
@@ -98,6 +107,13 @@ voldown {
};
};
+&qusb2phy {
+ status = "okay";
+
+ vdd-supply = <&vreg_l1b_0p925>;
+ vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
+};
+
&rpm_requests {
pm660l-regulators {
compatible = "qcom,rpm-pm660l-regulators";
@@ -403,3 +419,12 @@ &sdhc_2 {
&tlmm {
gpio-reserved-ranges = <8 4>;
};
+
+&usb3 {
+ status = "okay";
+};
+
+&usb3_dwc3 {
+ dr_mode = "peripheral";
+ extcon = <&extcon_usb>;
+};
--
2.33.1
Add most of the RPM PM660/PM660L regulators and the fixed ones,
defining the common electrical part of this platform.
Reviewed-by: Caleb Connolly <[email protected]>
Signed-off-by: Dang Huynh <[email protected]>
---
.../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 294 ++++++++++++++++++
1 file changed, 294 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..365a03b56cde 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,14 @@ chosen {
stdout-path = "serial0:115200n8";
};
+ vph_pwr: vph-pwr-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vph_pwr";
+
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
@@ -40,6 +51,289 @@ &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>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_s2b_1p05: s2 {
+ regulator-min-microvolt = <1050000>;
+ regulator-max-microvolt = <1050000>;
+ regulator-enable-ramp-delay = <200>;
+ regulator-ramp-delay = <0>;
+ };
+
+ /* LDOs */
+ vreg_l1b_0p925: l1 {
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <925000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ 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-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l3b_3p3: l3 {
+ regulator-min-microvolt = <1700000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l4b_2p95: l4 {
+ regulator-min-microvolt = <2944000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+
+ 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-ramp-delay = <0>;
+ 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>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l8b_3p3: l8 {
+ regulator-min-microvolt = <3200000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_bob: bob {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3600000>;
+ regulator-enable-ramp-delay = <500>;
+ regulator-ramp-delay = <0>;
+ };
+ };
+
+ 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-ramp-delay = <0>;
+ regulator-always-on;
+ };
+
+ vreg_s5a_1p35: s5 {
+ regulator-min-microvolt = <1224000>;
+ regulator-max-microvolt = <1350000>;
+ regulator-enable-ramp-delay = <200>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_s6a_0p87: s6 {
+ regulator-min-microvolt = <504000>;
+ regulator-max-microvolt = <992000>;
+ regulator-enable-ramp-delay = <150>;
+ regulator-ramp-delay = <0>;
+ };
+
+ /* LDOs */
+ vreg_l1a_1p225: l1 {
+ regulator-min-microvolt = <1150000>;
+ regulator-max-microvolt = <1250000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l2a_1p0: l2 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1010000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l3a_1p0: l3 {
+ regulator-min-microvolt = <950000>;
+ regulator-max-microvolt = <1010000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l5a_0p848: l5 {
+ regulator-min-microvolt = <525000>;
+ regulator-max-microvolt = <950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l6a_1p3: l6 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1370000>;
+ regulator-allow-set-load;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l7a_1p2: l7 {
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <1200000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l8a_1p8: l8 {
+ regulator-min-microvolt = <1750000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ 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-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l10a_1p8: l10 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+
+ vreg_l11a_1p8: l11 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l12a_1p8: l12 {
+ regulator-min-microvolt = <1780000>;
+ regulator-max-microvolt = <1950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ /* 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-ramp-delay = <0>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ vreg_l14a_1p8: l14 {
+ regulator-min-microvolt = <1710000>;
+ regulator-max-microvolt = <1900000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l15a_1p8: l15 {
+ regulator-min-microvolt = <1650000>;
+ regulator-max-microvolt = <2950000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l16a_2p7: l16 {
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ regulator-always-on;
+ };
+
+ vreg_l17a_1p8: l17 {
+ regulator-min-microvolt = <1648000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ };
+
+ vreg_l19a_3p3: l19 {
+ regulator-min-microvolt = <3312000>;
+ regulator-max-microvolt = <3400000>;
+ regulator-enable-ramp-delay = <250>;
+ regulator-ramp-delay = <0>;
+ regulator-allow-set-load;
+ };
+ };
+};
+
&tlmm {
gpio-reserved-ranges = <8 4>;
};
--
2.33.1
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
This commit enable the SD card slot and internal MMC.
Reviewed-by: Caleb Connolly <[email protected]>
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 ab814dc8a875..8fd4d1732d94 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -362,6 +362,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
This lets the user sees the framebuffer console.
Reviewed-by: Caleb Connolly <[email protected]>
Reviewed-by: Martin Botka <[email protected]>
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 8fd4d1732d94..122b487f197b 100644
--- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
+++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
@@ -23,7 +23,21 @@ 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";
+ status= "okay";
+ };
};
vph_pwr: vph-pwr-regulator {
@@ -62,6 +76,11 @@ ramoops@a0000000 {
ftrace-size = <0x0>;
pmsg-size = <0x20000>;
};
+
+ framebuffer_mem: memory@9d400000 {
+ reg = <0x0 0x9d400000 0x0 0x23ff000>;
+ no-map;
+ };
};
};
--
2.33.1
On 08/11/2021 06:03, Dang Huynh wrote:
> This lets the user sees the framebuffer console.
>
> Reviewed-by: Caleb Connolly <[email protected]>
> Reviewed-by: Martin Botka <[email protected]>
> 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 8fd4d1732d94..122b487f197b 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -23,7 +23,21 @@ 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";
> + status= "okay";
This line is redundant.
Konrad
On 08/11/2021 06:03, Dang Huynh wrote:
> Add most of the RPM PM660/PM660L regulators and the fixed ones,
> defining the common electrical part of this platform.
>
> Reviewed-by: Caleb Connolly <[email protected]>
> Signed-off-by: Dang Huynh <[email protected]>
> ---
> .../boot/dts/qcom/sdm660-xiaomi-lavender.dts | 294 ++++++++++++++++++
> 1 file changed, 294 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..365a03b56cde 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,14 @@ chosen {
> stdout-path = "serial0:115200n8";
> };
>
> + vph_pwr: vph-pwr-regulator {
> + compatible = "regulator-fixed";
> + regulator-name = "vph_pwr";
> +
> + regulator-always-on;
> + regulator-boot-on;
> + };
You need to specify a voltage range for this regulator.
> +
> reserved-memory {
> #address-cells = <2>;
> #size-cells = <2>;
> @@ -40,6 +51,289 @@ &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>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_s2b_1p05: s2 {
> + regulator-min-microvolt = <1050000>;
> + regulator-max-microvolt = <1050000>;
> + regulator-enable-ramp-delay = <200>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + /* LDOs */
> + vreg_l1b_0p925: l1 {
> + regulator-min-microvolt = <800000>;
> + regulator-max-microvolt = <925000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + // SDHCI 3.3V signal doesn't seem to be supported.
C-style comments, please.
> + vreg_l2b_2p95: l2 {
> + regulator-min-microvolt = <1648000>;
> + regulator-max-microvolt = <2696000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l3b_3p3: l3 {
> + regulator-min-microvolt = <1700000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l4b_2p95: l4 {
> + regulator-min-microvolt = <2944000>;
> + regulator-max-microvolt = <2952000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> +
> + 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-ramp-delay = <0>;
> + 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>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l8b_3p3: l8 {
> + regulator-min-microvolt = <3200000>;
> + regulator-max-microvolt = <3400000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_bob: bob {
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3600000>;
> + regulator-enable-ramp-delay = <500>;
> + regulator-ramp-delay = <0>;
> + };
> + };
> +
> + 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-ramp-delay = <0>;
> + regulator-always-on;
> + };
> +
> + vreg_s5a_1p35: s5 {
> + regulator-min-microvolt = <1224000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-enable-ramp-delay = <200>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_s6a_0p87: s6 {
> + regulator-min-microvolt = <504000>;
> + regulator-max-microvolt = <992000>;
> + regulator-enable-ramp-delay = <150>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + /* LDOs */
> + vreg_l1a_1p225: l1 {
> + regulator-min-microvolt = <1150000>;
> + regulator-max-microvolt = <1250000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l2a_1p0: l2 {
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1010000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l3a_1p0: l3 {
> + regulator-min-microvolt = <950000>;
> + regulator-max-microvolt = <1010000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l5a_0p848: l5 {
> + regulator-min-microvolt = <525000>;
> + regulator-max-microvolt = <950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l6a_1p3: l6 {
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1370000>;
> + regulator-allow-set-load;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l7a_1p2: l7 {
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1200000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l8a_1p8: l8 {
> + regulator-min-microvolt = <1750000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + 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-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l10a_1p8: l10 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> +
> + vreg_l11a_1p8: l11 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l12a_1p8: l12 {
> + regulator-min-microvolt = <1780000>;
> + regulator-max-microvolt = <1950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + /* 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-ramp-delay = <0>;
> + regulator-boot-on;
> + regulator-always-on;
> + };
> +
> + vreg_l14a_1p8: l14 {
> + regulator-min-microvolt = <1710000>;
> + regulator-max-microvolt = <1900000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l15a_1p8: l15 {
> + regulator-min-microvolt = <1650000>;
> + regulator-max-microvolt = <2950000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l16a_2p7: l16 {
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-always-on;
> + };
> +
> + vreg_l17a_1p8: l17 {
> + regulator-min-microvolt = <1648000>;
> + regulator-max-microvolt = <2952000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + };
> +
> + vreg_l19a_3p3: l19 {
> + regulator-min-microvolt = <3312000>;
> + regulator-max-microvolt = <3400000>;
> + regulator-enable-ramp-delay = <250>;
> + regulator-ramp-delay = <0>;
> + regulator-allow-set-load;
> + };
> + };
> +};
> +
> &tlmm {
> gpio-reserved-ranges = <8 4>;
> };
Konrad
On 08/11/2021 06:03, Dang Huynh wrote:
> This enables the volume down key.
>
> Reviewed-by: Caleb Connolly <[email protected]>
> Reviewed-by: Martin Botka <[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 365a03b56cde..28408240735b 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -51,6 +51,16 @@ &blsp1_uart2 {
> status = "okay";
> };
>
> +&pon {
> + voldown {
> + compatible = "qcom,pm8941-resin";
> + interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
> + debounce = <15625>;
> + bias-pull-up;
> + linux,code = <KEY_VOLUMEDOWN>;
> + };
> +};
Could you commonize the RESIN instead, like in here [1]?
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm64/boot/dts/qcom?h=v5.15&id=b135d097eb1a2586ee2c0ebcc0d0aa4a9b641b68
Konrad
On 08/11/2021 06:03, Dang Huynh wrote:
> This enables the volume up key.
>
> Reviewed-by: Caleb Connolly <[email protected]>
> Reviewed-by: Martin Botka <[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 28408240735b..ab814dc8a875 100644
> --- a/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm660-xiaomi-lavender.dts
> @@ -9,6 +9,9 @@
> #include "sdm660.dtsi"
> #include "pm660.dtsi"
> #include "pm660l.dtsi"
> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/input/gpio-keys.h>
>
> / {
> model = "Xiaomi Redmi Note 7";
> @@ -31,6 +34,21 @@ vph_pwr: vph-pwr-regulator {
> regulator-boot-on;
> };
>
> + gpio_keys {
Nodes shouldn't use underscores.
> + status = "okay";
It's set to "okay" by default, no need for this line.
> + compatible = "gpio-keys";
> + input-name = "gpio-keys";
> + #address-cells = <1>;
> + #size-cells = <0>;
Not sure if you need -cells here, as the child nodes don't have a reg.
> +
> + vol_up {
Ditto
> + 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>;
>
Konrad
Il 08/11/21 06:03, Dang Huynh ha scritto:
> 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(+)
>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>