2024-01-23 08:50:03

by Fenglin Wu via B4 Relay

[permalink] [raw]
Subject: [PATCH v2 1/2] arm64: dts: qcom: sm8650-mtp: add PM8010 regulators

From: Fenglin Wu <[email protected]>

Add PM8010 regulator device nodes for sm8650-mtp board.

Reviewed-by: Neil Armstrong <[email protected]>
Signed-off-by: Fenglin Wu <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8650-mtp.dts | 118 ++++++++++++++++++++++++++++++++
1 file changed, 118 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
index 9d916edb1c73..3791971efee6 100644
--- a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
@@ -428,6 +428,124 @@ vreg_l3i_1p2: ldo3 {
RPMH_REGULATOR_MODE_HPM>;
};
};
+
+ regulators-6 {
+ compatible = "qcom,pm8010-rpmh-regulators";
+ qcom,pmic-id = "m";
+
+ vdd-l1-l2-supply = <&vreg_s1c_1p2>;
+ vdd-l3-l4-supply = <&vreg_bob2>;
+ vdd-l5-supply = <&vreg_s6c_1p8>;
+ vdd-l6-l7-supply = <&vreg_bob1>;
+
+ vreg_l1m_1p1: ldo1 {
+ regulator-name = "vreg_l1m_1p1";
+ regulator-min-microvolt = <1104000>;
+ regulator-max-microvolt = <1104000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l2m_1p056: ldo2 {
+ regulator-name = "vreg_l2m_1p056";
+ regulator-min-microvolt = <1056000>;
+ regulator-max-microvolt = <1056000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3m_2p8: ldo3 {
+ regulator-name = "vreg_l3m_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l4m_2p8: ldo4 {
+ regulator-name = "vreg_l4m_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5m_1p8: ldo5 {
+ regulator-name = "vreg_l5m_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6m_2p8: ldo6 {
+ regulator-name = "vreg_l6m_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7m_2p96: ldo7 {
+ regulator-name = "vreg_l7m_2p96";
+ regulator-min-microvolt = <2960000>;
+ regulator-max-microvolt = <2960000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
+
+ regulators-7 {
+ compatible = "qcom,pm8010-rpmh-regulators";
+ qcom,pmic-id = "n";
+
+ vdd-l1-l2-supply = <&vreg_s1c_1p2>;
+ vdd-l3-l4-supply = <&vreg_s6c_1p8>;
+ vdd-l5-l6-supply = <&vreg_bob2>;
+ vdd-l7-supply = <&vreg_bob1>;
+
+ vreg_l1n_1p1: ldo1 {
+ regulator-name = "vreg_l1n_1p1";
+ regulator-min-microvolt = <1104000>;
+ regulator-max-microvolt = <1104000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l2n_1p056: ldo2 {
+ regulator-name = "vreg_l2n_1p056";
+ regulator-min-microvolt = <1056000>;
+ regulator-max-microvolt = <1056000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l3n_1p8: ldo3 {
+ regulator-name = "vreg_l3n_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l4n_1p8: ldo4 {
+ regulator-name = "vreg_l4n_1p8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l5n_2p8: ldo5 {
+ regulator-name = "vreg_l5n_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l6n_2p8: ldo6 {
+ regulator-name = "vreg_l6n_2p8";
+ regulator-min-microvolt = <2800000>;
+ regulator-max-microvolt = <2800000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+
+ vreg_l7n_3p3: ldo7 {
+ regulator-name = "vreg_l7n_3p3";
+ regulator-min-microvolt = <3304000>;
+ regulator-max-microvolt = <3304000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+ };
+ };
};

&dispcc {

--
2.25.1



2024-01-24 19:22:18

by David Collins

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] arm64: dts: qcom: sm8650-mtp: add PM8010 regulators

On 1/23/24 00:49, Fenglin Wu via B4 Relay wrote:
> From: Fenglin Wu <[email protected]>
>
> Add PM8010 regulator device nodes for sm8650-mtp board.
>
> Reviewed-by: Neil Armstrong <[email protected]>
> Signed-off-by: Fenglin Wu <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sm8650-mtp.dts | 118 ++++++++++++++++++++++++++++++++
> 1 file changed, 118 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> index 9d916edb1c73..3791971efee6 100644
> --- a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> @@ -428,6 +428,124 @@ vreg_l3i_1p2: ldo3 {
> RPMH_REGULATOR_MODE_HPM>;
> };
> };
> +
> + regulators-6 {
> + compatible = "qcom,pm8010-rpmh-regulators";
> + qcom,pmic-id = "m";
> +
> + vdd-l1-l2-supply = <&vreg_s1c_1p2>;
> + vdd-l3-l4-supply = <&vreg_bob2>;
> + vdd-l5-supply = <&vreg_s6c_1p8>;
> + vdd-l6-l7-supply = <&vreg_bob1>;

Please replace this line with:

vdd-l6-supply = <&vreg_bob1>;
vdd-l7-supply = <&vreg_bob1>;

> +
> + vreg_l1m_1p1: ldo1 {
> + regulator-name = "vreg_l1m_1p1";
> + regulator-min-microvolt = <1104000>;
> + regulator-max-microvolt = <1104000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;

Optional:
PM8010 L1 and L2 physically support LPM vs HPM configuration.
Therefore, these lines could be added here to allow such configuration
by software at runtime:

regulator-allow-set-load;
regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
RPMH_REGULATOR_MODE_HPM>;

> + };
> +
> + vreg_l2m_1p056: ldo2 {
> + regulator-name = "vreg_l2m_1p056";
> + regulator-min-microvolt = <1056000>;
> + regulator-max-microvolt = <1056000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;

The same comment about LPM vs HPM configuration applies here.

> + regulators-7 {
> + compatible = "qcom,pm8010-rpmh-regulators";
> + qcom,pmic-id = "n";
> +
> + vdd-l1-l2-supply = <&vreg_s1c_1p2>;
> + vdd-l3-l4-supply = <&vreg_s6c_1p8>;
> + vdd-l5-l6-supply = <&vreg_bob2>;

Please replace this line with:

vdd-l5-supply = <&vreg_bob2>;
vdd-l6-supply = <&vreg_bob2>;

> + vdd-l7-supply = <&vreg_bob1>;
> +
> + vreg_l1n_1p1: ldo1 {
> + regulator-name = "vreg_l1n_1p1";
> + regulator-min-microvolt = <1104000>;
> + regulator-max-microvolt = <1104000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;

The same comment about LPM vs HPM configuration applies here.

> + };
> +
> + vreg_l2n_1p056: ldo2 {
> + regulator-name = "vreg_l2n_1p056";
> + regulator-min-microvolt = <1056000>;
> + regulator-max-microvolt = <1056000>;
> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;

The same comment about LPM vs HPM configuration applies here.

Thanks,
David


2024-01-24 23:36:47

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] arm64: dts: qcom: sm8650-mtp: add PM8010 regulators



On 1/24/24 20:15, David Collins wrote:
> On 1/23/24 00:49, Fenglin Wu via B4 Relay wrote:
>> From: Fenglin Wu <[email protected]>
>>
>> Add PM8010 regulator device nodes for sm8650-mtp board.
>>
>> Reviewed-by: Neil Armstrong <[email protected]>
>> Signed-off-by: Fenglin Wu <[email protected]>
>> ---
>> arch/arm64/boot/dts/qcom/sm8650-mtp.dts | 118 ++++++++++++++++++++++++++++++++
>> 1 file changed, 118 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
>> index 9d916edb1c73..3791971efee6 100644
>> --- a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
>> +++ b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
>> @@ -428,6 +428,124 @@ vreg_l3i_1p2: ldo3 {
>> RPMH_REGULATOR_MODE_HPM>;
>> };
>> };
>> +
>> + regulators-6 {
>> + compatible = "qcom,pm8010-rpmh-regulators";
>> + qcom,pmic-id = "m";
>> +
>> + vdd-l1-l2-supply = <&vreg_s1c_1p2>;
>> + vdd-l3-l4-supply = <&vreg_bob2>;
>> + vdd-l5-supply = <&vreg_s6c_1p8>;
>> + vdd-l6-l7-supply = <&vreg_bob1>;
>
> Please replace this line with:
>
> vdd-l6-supply = <&vreg_bob1>;
> vdd-l7-supply = <&vreg_bob1>;
>
>> +
>> + vreg_l1m_1p1: ldo1 {
>> + regulator-name = "vreg_l1m_1p1";
>> + regulator-min-microvolt = <1104000>;
>> + regulator-max-microvolt = <1104000>;
>> + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>
> Optional:
> PM8010 L1 and L2 physically support LPM vs HPM configuration.
> Therefore, these lines could be added here to allow such configuration
> by software at runtime:
>
> regulator-allow-set-load;
> regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
> RPMH_REGULATOR_MODE_HPM>;

David,

I was under the impression that *all* RPMh regulators support
modesetting. Would that be an incorrect assumption to make?

Konrad

2024-01-25 02:53:23

by David Collins

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] arm64: dts: qcom: sm8650-mtp: add PM8010 regulators

On 1/24/24 15:36, Konrad Dybcio wrote:
> On 1/24/24 20:15, David Collins wrote:
>> On 1/23/24 00:49, Fenglin Wu via B4 Relay wrote:
>>> From: Fenglin Wu <[email protected]>
>>>
>>> Add PM8010 regulator device nodes for sm8650-mtp board.
>>>
>>> Reviewed-by: Neil Armstrong <[email protected]>
>>> Signed-off-by: Fenglin Wu <[email protected]>
..
>>> +
>>> +        vreg_l1m_1p1: ldo1 {
>>> +            regulator-name = "vreg_l1m_1p1";
>>> +            regulator-min-microvolt = <1104000>;
>>> +            regulator-max-microvolt = <1104000>;
>>> +            regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>>
>> Optional:
>> PM8010 L1 and L2 physically support LPM vs HPM configuration.
>> Therefore, these lines could be added here to allow such configuration
>> by software at runtime:
>>
>> regulator-allow-set-load;
>> regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
>>                RPMH_REGULATOR_MODE_HPM>;
>
> David,
>
> I was under the impression that *all* RPMh regulators support
> modesetting. Would that be an incorrect assumption to make?
>
> Konrad

Hello Konrad,

That is generally true. However, PM8010 LDOs 3-7 are a special case.
These do not support LPM configuration. The limitation is enforced in
the driver by this change:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2544631faa7f3244c9bcb9b511ca4f1a4f5a3ba0
.

Take care,
David


2024-01-25 09:54:41

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] arm64: dts: qcom: sm8650-mtp: add PM8010 regulators



On 1/25/24 03:52, David Collins wrote:
> On 1/24/24 15:36, Konrad Dybcio wrote:
>> On 1/24/24 20:15, David Collins wrote:
>>> On 1/23/24 00:49, Fenglin Wu via B4 Relay wrote:
>>>> From: Fenglin Wu <[email protected]>
>>>>
>>>> Add PM8010 regulator device nodes for sm8650-mtp board.
>>>>
>>>> Reviewed-by: Neil Armstrong <[email protected]>
>>>> Signed-off-by: Fenglin Wu <[email protected]>
> ...
>>>> +
>>>> +        vreg_l1m_1p1: ldo1 {
>>>> +            regulator-name = "vreg_l1m_1p1";
>>>> +            regulator-min-microvolt = <1104000>;
>>>> +            regulator-max-microvolt = <1104000>;
>>>> +            regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>>>
>>> Optional:
>>> PM8010 L1 and L2 physically support LPM vs HPM configuration.
>>> Therefore, these lines could be added here to allow such configuration
>>> by software at runtime:
>>>
>>> regulator-allow-set-load;
>>> regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM
>>>                RPMH_REGULATOR_MODE_HPM>;
>>
>> David,
>>
>> I was under the impression that *all* RPMh regulators support
>> modesetting. Would that be an incorrect assumption to make?
>>
>> Konrad
>
> Hello Konrad,
>
> That is generally true. However, PM8010 LDOs 3-7 are a special case.
> These do not support LPM configuration. The limitation is enforced in
> the driver by this change:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2544631faa7f3244c9bcb9b511ca4f1a4f5a3ba0

Oh, I never noticed that. Thanks a lot for confirming!

Konrad