ipq806x: 5.15: add regulator experiemntal fixup patch
authorChristian Marangi <ansuelsmth@gmail.com>
Mon, 10 Oct 2022 08:50:11 +0000 (10:50 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 10 Oct 2022 08:52:38 +0000 (10:52 +0200)
Add regulator experiemntal fixup patch that port QSDK regulator initial
values.

Add settling time support to qcom_rpm regulator. From original source, a
settling time of 10us was applied after every voltage increase/decrease.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/ipq806x/patches-5.15/107-01-ARM-dts-qcom-ipq8064-fix-smb208-regulator-node.patch [new file with mode: 0644]
target/linux/ipq806x/patches-5.15/123-regulator-qcom_rpm-add-support-for-settling-time.patch [new file with mode: 0644]

diff --git a/target/linux/ipq806x/patches-5.15/107-01-ARM-dts-qcom-ipq8064-fix-smb208-regulator-node.patch b/target/linux/ipq806x/patches-5.15/107-01-ARM-dts-qcom-ipq8064-fix-smb208-regulator-node.patch
new file mode 100644 (file)
index 0000000..defd1f4
--- /dev/null
@@ -0,0 +1,212 @@
+From 81ca06557c6071c3e64556123ac6f6afd0af4d42 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Tue, 16 Aug 2022 13:53:28 +0200
+Subject: [PATCH] ARM: dts: qcom: ipq8064: fix smb208 regulator node
+
+Fix wrong switch-mode-frequency binding. The smb208 regulators support
+only 500Hz or 1Mhz, fix the wrong value to 500Hz following original QSDK
+code.
+Add missing system-load and bias-pull-down binding for smb208
+regulators. These binding were never added and the values comes from
+ancient QSDK board data.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+---
+ arch/arm/boot/dts/qcom-ipq8062-smb208.dtsi      | 16 ++++++++++++----
+ arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi      | 16 ++++++++++++----
+ arch/arm/boot/dts/qcom-ipq8064-v2.0-smb208.dtsi | 16 ++++++++++++----
+ arch/arm/boot/dts/qcom-ipq8065-smb208.dtsi      | 16 ++++++++++++----
+ 4 files changed, 48 insertions(+), 16 deletions(-)
+
+--- a/arch/arm/boot/dts/qcom-ipq8062-smb208.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8062-smb208.dtsi
+@@ -9,29 +9,41 @@
+               smb208_s1a: s1a {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1200000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s1b: s1b {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1679000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2a: s2a {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2b: s2b {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+       };
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064-smb208.dtsi
+@@ -9,29 +9,41 @@
+               smb208_s1a: s1a {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1200000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s1b: s1b {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1679000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2a: s2a {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2b: s2b {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+       };
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8064-v2.0-smb208.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8064-v2.0-smb208.dtsi
+@@ -9,29 +9,41 @@
+               smb208_s1a: s1a {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1200000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s1b: s1b {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1679000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2a: s2a {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2b: s2b {
+                       regulator-min-microvolt = < 800000>;
+                       regulator-max-microvolt = <1250000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+       };
+ };
+--- a/arch/arm/boot/dts/qcom-ipq8065-smb208.dtsi
++++ b/arch/arm/boot/dts/qcom-ipq8065-smb208.dtsi
+@@ -9,29 +9,41 @@
+               smb208_s1a: s1a {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1200000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s1b: s1b {
+                       regulator-min-microvolt = <1050000>;
+                       regulator-max-microvolt = <1150000>;
++                      regulator-system-load = <1679000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2a: s2a {
+                       regulator-min-microvolt = <775000>;
+                       regulator-max-microvolt = <1275000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+               smb208_s2b: s2b {
+                       regulator-min-microvolt = <775000>;
+                       regulator-max-microvolt = <1275000>;
++                      regulator-system-load = <1740000>;
++                      regulator-settling-time-us = <10>;
+-                      qcom,switch-mode-frequency = <1200000>;
++                      qcom,switch-mode-frequency = <500000>;
++                      bias-pull-down;
+               };
+       };
+ };
diff --git a/target/linux/ipq806x/patches-5.15/123-regulator-qcom_rpm-add-support-for-settling-time.patch b/target/linux/ipq806x/patches-5.15/123-regulator-qcom_rpm-add-support-for-settling-time.patch
new file mode 100644 (file)
index 0000000..b3a104a
--- /dev/null
@@ -0,0 +1,39 @@
+From f31cf7ab2bf0c830fe3bfe24a8b44c263ff2e65a Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth@gmail.com>
+Date: Sat, 24 Sep 2022 15:08:40 +0200
+Subject: [PATCH] regulator: qcom_rpm: add support for settling time
+
+Some regulator may need a delay to settle the new voltage. The value can
+be provided by dt but the driver needs to have support for it.
+
+Add support for this by using the generic regulator_set_voltage_time_sel
+helper. When the delay value is not set in dt, no delay is applied.
+
+Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
+---
+ drivers/regulator/qcom_rpm-regulator.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/regulator/qcom_rpm-regulator.c b/drivers/regulator/qcom_rpm-regulator.c
+index 3c41b71a1f52..e3aea82a3d14 100644
+--- a/drivers/regulator/qcom_rpm-regulator.c
++++ b/drivers/regulator/qcom_rpm-regulator.c
+@@ -412,6 +412,7 @@ static const struct regulator_ops uV_ops = {
+       .set_voltage_sel = rpm_reg_set_uV_sel,
+       .get_voltage = rpm_reg_get_voltage,
++      .set_voltage_time_sel = regulator_set_voltage_time_sel,
+       .enable = rpm_reg_uV_enable,
+       .disable = rpm_reg_uV_disable,
+@@ -425,6 +426,7 @@ static const struct regulator_ops mV_ops = {
+       .set_voltage_sel = rpm_reg_set_mV_sel,
+       .get_voltage = rpm_reg_get_voltage,
++      .set_voltage_time_sel = regulator_set_voltage_time_sel,
+       .enable = rpm_reg_mV_enable,
+       .disable = rpm_reg_mV_disable,
+-- 
+2.37.2
+