regulator: qcom-rpmh: Update ranges for FTSMPS525
PATCH 1/1 regulator: qcom-rpmh: Update ranges for FTSMPS525
The FTSMPS525 regulator has several potential ranges, so update the ranges accordingly for SM8750.
--- drivers/regulator/qcom-rpmh-regulator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/regulator/qcom-rpmh-regulator.c +6 -3
@@ -848,9 +848,10 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { .ops = &rpmh_regulator_vrm_ops, .voltage_ranges = (struct linear_range []) {REGULATOR_LINEAR_RANGE (300000 ,0 ,267 ,4000 ), +REGULATOR_LINEAR_RANGE (1376000 ,268 ,438 ,8000 ), }, - .n_linear_ranges = 1, - .n_voltages = 268, + .n_linear_ranges = 2, + .n_voltages = 439, .pmic_mode_map = pmic_mode_map_pmic5_smps, .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, };
@@ -1196,6 +1197,8 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_lv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_mv,"vdd-s6" ), +RPMH_VREG ("smps7" ,"smp%s7" , &pmic5_ftsmps525_lv,"vdd-s7" ), +RPMH_VREG ("smps8" ,"smp%s8" , &pmic5_ftsmps525_lv,"vdd-s8" ),RPMH_VREG ("ldo1" ,"ldo%s1" , &pmic5_nldo515,"vdd-l1" ),RPMH_VREG ("ldo2" ,"ldo%s2" , &pmic5_nldo515,"vdd-l2" ), RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),
@@ -1205,7 +1208,7 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {RPMH_VREG ("smps1" ,"smp%s1" , &pmic5_ftsmps525_lv,"vdd-s1" ),RPMH_VREG ("smps2" ,"smp%s2" , &pmic5_ftsmps525_lv,"vdd-s2" ), -RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_lv,"vdd-s3" ), +RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_mv,"vdd-s3" ),RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_mv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_lv,"vdd-s6" ),
base-commit: 63b3ff03d91ae8f875fe8747c781a521f78cde17
Signature · 1 line
2.46.1
Quoted 15 lines · Melody Olvera
The FTSMPS525 regulator has several potential ranges, so update the ranges accordingly for SM8750.
Signed-off-by Melody Olvera <[email protected]>--- drivers/regulator/qcom-rpmh-regulator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/regulator/qcom-rpmh-regulator.c +0
-0@@ -848,9 +848,10 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { .ops = &rpmh_regulator_vrm_ops, .voltage_ranges = (struct linear_range[]) {
drivers/regulator/qcom-rpmh-regulator.c static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { · line 857
Quoted 10 lines
drivers/regulator/qcom-rpmh-regulator.c +3
-2REGULATOR_LINEAR_RANGE(300000, 0, 267, 4000), + REGULATOR_LINEAR_RANGE(1376000, 268, 438, 8000), }, - .n_linear_ranges = 1, - .n_voltages = 268, + .n_linear_ranges = 2, + .n_voltages = 439, .pmic_mode_map = pmic_mode_map_pmic5_smps, .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, };
This configuration which specifies both LV and MV ranges should replace the pmic5_ftsmps525_lv and pmic5_ftsmps525_mv configurations. It should then be used in the per-PMIC data tables below.
All FTSMPS525 type regulators physically support both LV and MV ranges. However, the per-regulator selection of which range is used can only be set by boot loader firmware and the configuration is locked in hardware after initialization. Unfortunately, the qcom-rpmh-regulator driver has no mechanism to determine at runtime if LV or MV range has been set for a particular regulator. Additionally, that exact same regulator in the same PMIC could be configured for the other range when used on a different board (where the power grid has different requirements).
Listing support in a unified configuration for both LV and MV ranges fixes the situation as it will work on all boards regardless of firmware LV vs MV selection. This also accurately captures the capability of the regulator at a hardware level.
drivers/regulator/qcom-rpmh-regulator.c static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = { · line 1201
Quoted 6 lines
drivers/regulator/qcom-rpmh-regulator.c +2
-0@@ -1196,6 +1197,8 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_lv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_mv,"vdd-s6" ), +RPMH_VREG ("smps7" ,"smp%s7" , &pmic5_ftsmps525_lv,"vdd-s7" ), + RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"),
These lines should not be added. PMIC PM8550VS only has 6 FTSMPS525 regulators inside.
Quoted 13 lines
drivers/regulator/qcom-rpmh-regulator.c +1
-1RPMH_VREG ("ldo1" ,"ldo%s1" , &pmic5_nldo515,"vdd-l1" ),RPMH_VREG ("ldo2" ,"ldo%s2" , &pmic5_nldo515,"vdd-l2" ), RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),@@ -1205,7 +1208,7 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {RPMH_VREG ("smps1" ,"smp%s1" , &pmic5_ftsmps525_lv,"vdd-s1" ),RPMH_VREG ("smps2" ,"smp%s2" , &pmic5_ftsmps525_lv,"vdd-s2" ), -RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_lv,"vdd-s3" ), +RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_mv,"vdd-s3" ),RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_mv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_lv,"vdd-s6" ),
Quoted 1 line
base-commit:
63b3ff03d91ae8f875fe8747c781a521f78cde17
Take care,
David Collins
Quoted 39 lines · David Collins
Quoted 15 lines · Melody Olvera
The FTSMPS525 regulator has several potential ranges, so update the ranges accordingly for SM8750.
Signed-off-by Melody Olvera <[email protected]>--- drivers/regulator/qcom-rpmh-regulator.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/regulator/qcom-rpmh-regulator.c +0
-0@@ -848,9 +848,10 @@ static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { .ops = &rpmh_regulator_vrm_ops, .voltage_ranges = (struct linear_range[]) {drivers/regulator/qcom-rpmh-regulator.c static const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { · line 857
Quoted 10 lines
drivers/regulator/qcom-rpmh-regulator.c +3
-2REGULATOR_LINEAR_RANGE(300000, 0, 267, 4000), + REGULATOR_LINEAR_RANGE(1376000, 268, 438, 8000), }, - .n_linear_ranges = 1, - .n_voltages = 268, + .n_linear_ranges = 2, + .n_voltages = 439, .pmic_mode_map = pmic_mode_map_pmic5_smps, .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, };This configuration which specifies both LV and MV ranges should replace the
pmic5_ftsmps525_lvandpmic5_ftsmps525_mvconfigurations. It should then be used in the per-PMIC data tables below.All FTSMPS525 type regulators physically support both LV and MV ranges. However, the per-regulator selection of which range is used can only be set by boot loader firmware and the configuration is locked in hardware after initialization. Unfortunately, the qcom-rpmh-regulator driver has no mechanism to determine at runtime if LV or MV range has been set for a particular regulator. Additionally, that exact same regulator in the same PMIC could be configured for the other range when used on a different board (where the power grid has different requirements).
Quoted 4 lines
Listing support in a unified configuration for both LV and MV ranges fixes the situation as it will work on all boards regardless of firmware LV vs MV selection. This also accurately captures the capability of the regulator at a hardware level.
Understood; I'll merge the lv and mv configs together as we discussed and update the driver accordingly.
Quoted 9 lines
drivers/regulator/qcom-rpmh-regulator.c static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = { · line 1201
Quoted 7 lines
drivers/regulator/qcom-rpmh-regulator.c +2
-0@@ -1196,6 +1197,8 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_lv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_mv,"vdd-s6" ), +RPMH_VREG ("smps7" ,"smp%s7" , &pmic5_ftsmps525_lv,"vdd-s7" ), + RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"),These lines should not be added. PMIC PM8550VS only has 6 FTSMPS525 regulators inside.
Ack.
Quoted 18 lines
Quoted 14 lines
drivers/regulator/qcom-rpmh-regulator.c +1
-1RPMH_VREG ("ldo1" ,"ldo%s1" , &pmic5_nldo515,"vdd-l1" ),RPMH_VREG ("ldo2" ,"ldo%s2" , &pmic5_nldo515,"vdd-l2" ), RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"),@@ -1205,7 +1208,7 @@ static const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = {static const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = {RPMH_VREG ("smps1" ,"smp%s1" , &pmic5_ftsmps525_lv,"vdd-s1" ),RPMH_VREG ("smps2" ,"smp%s2" , &pmic5_ftsmps525_lv,"vdd-s2" ), -RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_lv,"vdd-s3" ), +RPMH_VREG ("smps3" ,"smp%s3" , &pmic5_ftsmps525_mv,"vdd-s3" ),RPMH_VREG ("smps4" ,"smp%s4" , &pmic5_ftsmps525_mv,"vdd-s4" ),RPMH_VREG ("smps5" ,"smp%s5" , &pmic5_ftsmps525_lv,"vdd-s5" ),RPMH_VREG ("smps6" ,"smp%s6" , &pmic5_ftsmps525_lv,"vdd-s6" ),Quoted 1 line
base-commit:
63b3ff03d91ae8f875fe8747c781a521f78cde17Take care,
David Collins