arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators
authorStephan Gerhold <stephan@gerhold.net>
Wed, 17 May 2023 18:48:47 +0000 (20:48 +0200)
committerBjorn Andersson <andersson@kernel.org>
Thu, 25 May 2023 04:50:47 +0000 (21:50 -0700)
Some of the regulators must be always-on to ensure correct operation of
the system, e.g. PM8916 L2 for the LPDDR RAM, L5 for most digital I/O
and L7 for the CPU PLL (strictly speaking the CPU PLL might only need
an active-only vote but this is not supported for regulators in
mainline currently).

The RPM firmware seems to enforce that internally, these supplies stay
on even if we vote for them to power off (and there is no other
processor running). This means it's pointless to keep sending
enable/disable requests because they will just be ignored.
Also, drivers are much more likely to get a wrong impression of the
regulator status, because regulator_is_enabled() will return false when
there are no users, even though the regulator is always on.

Describe this properly by marking the regulators as always-on.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230510-msm8916-regulators-v1-8-54d4960a05fc@gerhold.net
arch/arm64/boot/dts/qcom/apq8016-sbc.dts
arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi

index ab8dfd858025c29c9c1e0afee70e2fabacb50f9c..1c5d55854893225d32aaba729ac6f05458bf6e37 100644 (file)
        };
 };
 
-&pm8916_s4 {
-       regulator-always-on;
-       regulator-boot-on;
-};
-
 &sdhc_1 {
        status = "okay";
 
index b38eecbd62538d9500a9c4098ad5abb73ce462e3..64d7228bee07d01d7afa74147bd2a19669cecb80 100644 (file)
                pm8916_s3: s3 {
                        regulator-min-microvolt = <1250000>;
                        regulator-max-microvolt = <1350000>;
+                       regulator-always-on; /* Needed for L2 */
                };
 
                pm8916_s4: s4 {
                        regulator-min-microvolt = <1850000>;
                        regulator-max-microvolt = <2150000>;
+                       regulator-always-on; /* Needed for L5/L7 */
                };
 
                /*
@@ -93,6 +95,7 @@
                pm8916_l2: l2 {
                        regulator-min-microvolt = <1200000>;
                        regulator-max-microvolt = <1200000>;
+                       regulator-always-on; /* Needed for LPDDR RAM */
                };
 
                /* pm8916_l3 is managed by rpmpd (MSM8916_VDDMX) */
                pm8916_l5: l5 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
+                       regulator-always-on; /* Needed for most digital I/O */
                };
 
                pm8916_l6: l6 {
                pm8916_l7: l7 {
                        regulator-min-microvolt = <1800000>;
                        regulator-max-microvolt = <1800000>;
+                       regulator-always-on; /* Needed for CPU PLL */
                };
 
                pm8916_l8: l8 {