Skip to content

Commit 2544631

Browse files
Fenglin Wubroonie
authored andcommitted
regulator: qcom-rpmh: add support for pm8010 regulators
Add RPMH regulators exposed by Qualcomm Technologies, Inc. PM8010 PMIC. It has 7 LDOs with 3 different types, LDO1 - LDO2 are L502 NMOS LDOs, LDO5 and LDO7 are L502 PMOS LDOs, LDO3/LDO4/LDO6 are L502 PMOS LDO for low noise applications. Also, LDO3 - LDO7 don't support LPM. Suggested-by: David Collins <quic_collinsd@quicinc.com> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com> Link: https://msgid.link/r/20231214-pm8010-regulator-v2-3-82131df6b97b@quicinc.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 638baab commit 2544631

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

drivers/regulator/qcom-rpmh-regulator.c

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,14 @@ static const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = {
511511
[REGULATOR_MODE_FAST] = -EINVAL,
512512
};
513513

514+
static const int pmic_mode_map_pmic5_ldo_hpm[REGULATOR_MODE_STANDBY + 1] = {
515+
[REGULATOR_MODE_INVALID] = -EINVAL,
516+
[REGULATOR_MODE_STANDBY] = -EINVAL,
517+
[REGULATOR_MODE_IDLE] = -EINVAL,
518+
[REGULATOR_MODE_NORMAL] = PMIC5_LDO_MODE_HPM,
519+
[REGULATOR_MODE_FAST] = -EINVAL,
520+
};
521+
514522
static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode)
515523
{
516524
unsigned int mode;
@@ -733,6 +741,33 @@ static const struct rpmh_vreg_hw_data pmic5_pldo515_mv = {
733741
.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
734742
};
735743

744+
static const struct rpmh_vreg_hw_data pmic5_pldo502 = {
745+
.regulator_type = VRM,
746+
.ops = &rpmh_regulator_vrm_ops,
747+
.voltage_ranges = (struct linear_range[]) {
748+
REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000),
749+
},
750+
.n_linear_ranges = 1,
751+
.n_voltages = 256,
752+
.pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm,
753+
.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
754+
};
755+
756+
static const struct rpmh_vreg_hw_data pmic5_pldo502ln = {
757+
.regulator_type = VRM,
758+
.ops = &rpmh_regulator_vrm_ops,
759+
.voltage_ranges = (struct linear_range[]) {
760+
REGULATOR_LINEAR_RANGE(1800000, 0, 2, 200000),
761+
REGULATOR_LINEAR_RANGE(2608000, 3, 28, 16000),
762+
REGULATOR_LINEAR_RANGE(3104000, 29, 30, 96000),
763+
REGULATOR_LINEAR_RANGE(3312000, 31, 31, 0),
764+
},
765+
.n_linear_ranges = 4,
766+
.n_voltages = 32,
767+
.pmic_mode_map = pmic_mode_map_pmic5_ldo_hpm,
768+
.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
769+
};
770+
736771
static const struct rpmh_vreg_hw_data pmic5_nldo = {
737772
.regulator_type = VRM,
738773
.ops = &rpmh_regulator_vrm_drms_ops,
@@ -759,6 +794,19 @@ static const struct rpmh_vreg_hw_data pmic5_nldo515 = {
759794
.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
760795
};
761796

797+
static const struct rpmh_vreg_hw_data pmic5_nldo502 = {
798+
.regulator_type = VRM,
799+
.ops = &rpmh_regulator_vrm_drms_ops,
800+
.voltage_ranges = (struct linear_range[]) {
801+
REGULATOR_LINEAR_RANGE(528000, 0, 127, 8000),
802+
},
803+
.n_linear_ranges = 1,
804+
.n_voltages = 128,
805+
.hpm_min_load_uA = 30000,
806+
.pmic_mode_map = pmic_mode_map_pmic5_ldo,
807+
.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
808+
};
809+
762810
static const struct rpmh_vreg_hw_data pmic5_hfsmps510 = {
763811
.regulator_type = VRM,
764812
.ops = &rpmh_regulator_vrm_ops,
@@ -1210,6 +1258,16 @@ static const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = {
12101258
{}
12111259
};
12121260

1261+
static const struct rpmh_vreg_init_data pm8010_vreg_data[] = {
1262+
RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo502, "vdd-l1-l2"),
1263+
RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo502, "vdd-l1-l2"),
1264+
RPMH_VREG("ldo3", "ldo%s3", &pmic5_pldo502ln, "vdd-l3-l4"),
1265+
RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo502ln, "vdd-l3-l4"),
1266+
RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo502, "vdd-l5"),
1267+
RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo502ln, "vdd-l6"),
1268+
RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo502, "vdd-l7"),
1269+
};
1270+
12131271
static const struct rpmh_vreg_init_data pm6150_vreg_data[] = {
12141272
RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"),
12151273
RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"),
@@ -1525,6 +1583,10 @@ static const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = {
15251583
.compatible = "qcom,pm8009-1-rpmh-regulators",
15261584
.data = pm8009_1_vreg_data,
15271585
},
1586+
{
1587+
.compatible = "qcom,pm8010-rpmh-regulators",
1588+
.data = pm8010_vreg_data,
1589+
},
15281590
{
15291591
.compatible = "qcom,pm8150-rpmh-regulators",
15301592
.data = pm8150_vreg_data,

0 commit comments

Comments
 (0)