Skip to content

Commit 86332c3

Browse files
anderssonbroonie
authored andcommitted
regulator: qcom_smd: Add pmi8994 regulator support
The pmi8994 is commonly found on MSM8996 based devices, such as the Dragonboard 820c, where it supplies power to a number of LDOs on the primary PMIC. Signed-off-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent bd3ebed commit 86332c3

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Regulator nodes are identified by their compatible:
2626
"qcom,rpm-pm8994-regulators"
2727
"qcom,rpm-pm8998-regulators"
2828
"qcom,rpm-pma8084-regulators"
29+
"qcom,rpm-pmi8994-regulators"
2930
"qcom,rpm-pmi8998-regulators"
3031
"qcom,rpm-pms405-regulators"
3132

@@ -143,6 +144,15 @@ Regulator nodes are identified by their compatible:
143144
Definition: reference to regulator supplying the input pin, as
144145
described in the data sheet
145146

147+
- vdd_s1-supply:
148+
- vdd_s2-supply:
149+
- vdd_s3-supply:
150+
- vdd_bst_byp-supply:
151+
Usage: optional (pmi8994 only)
152+
Value type: <phandle>
153+
Definition: reference to regulator supplying the input pin, as
154+
described in the data sheet
155+
146156
- vdd_s1-supply:
147157
- vdd_s2-supply:
148158
- vdd_s3-supply:
@@ -259,6 +269,9 @@ pma8084:
259269
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
260270
l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1
261271

272+
pmi8994:
273+
s1, s2, s3, boost-bypass
274+
262275
pmi8998:
263276
bob
264277

drivers/regulator/qcom_smd-regulator.c

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,44 @@ static const struct regulator_desc pm8994_lnldo = {
445445
.ops = &rpm_smps_ldo_ops_fixed,
446446
};
447447

448+
static const struct regulator_desc pmi8994_ftsmps = {
449+
.linear_ranges = (struct regulator_linear_range[]) {
450+
REGULATOR_LINEAR_RANGE(350000, 0, 199, 5000),
451+
REGULATOR_LINEAR_RANGE(700000, 200, 349, 10000),
452+
},
453+
.n_linear_ranges = 2,
454+
.n_voltages = 350,
455+
.ops = &rpm_smps_ldo_ops,
456+
};
457+
458+
static const struct regulator_desc pmi8994_hfsmps = {
459+
.linear_ranges = (struct regulator_linear_range[]) {
460+
REGULATOR_LINEAR_RANGE(350000, 0, 80, 12500),
461+
REGULATOR_LINEAR_RANGE(700000, 81, 141, 25000),
462+
},
463+
.n_linear_ranges = 2,
464+
.n_voltages = 142,
465+
.ops = &rpm_smps_ldo_ops,
466+
};
467+
468+
static const struct regulator_desc pmi8994_bby = {
469+
.linear_ranges = (struct regulator_linear_range[]) {
470+
REGULATOR_LINEAR_RANGE(3000000, 0, 44, 50000),
471+
},
472+
.n_linear_ranges = 1,
473+
.n_voltages = 45,
474+
.ops = &rpm_bob_ops,
475+
};
476+
477+
static const struct regulator_desc pmi8994_boost = {
478+
.linear_ranges = (struct regulator_linear_range[]) {
479+
REGULATOR_LINEAR_RANGE(4000000, 0, 30, 50000),
480+
},
481+
.n_linear_ranges = 1,
482+
.n_voltages = 31,
483+
.ops = &rpm_smps_ldo_ops,
484+
};
485+
448486
static const struct regulator_desc pm8998_ftsmps = {
449487
.linear_ranges = (struct regulator_linear_range[]) {
450488
REGULATOR_LINEAR_RANGE(320000, 0, 258, 4000),
@@ -780,6 +818,14 @@ static const struct rpm_regulator_data rpm_pm8994_regulators[] = {
780818
{}
781819
};
782820

821+
static const struct rpm_regulator_data rpm_pmi8994_regulators[] = {
822+
{ "s1", QCOM_SMD_RPM_SMPB, 1, &pmi8994_ftsmps, "vdd_s1" },
823+
{ "s2", QCOM_SMD_RPM_SMPB, 2, &pmi8994_hfsmps, "vdd_s2" },
824+
{ "s2", QCOM_SMD_RPM_SMPB, 3, &pmi8994_hfsmps, "vdd_s3" },
825+
{ "boost-bypass", QCOM_SMD_RPM_BBYB, 1, &pmi8994_bby, "vdd_bst_byp" },
826+
{}
827+
};
828+
783829
static const struct rpm_regulator_data rpm_pm8998_regulators[] = {
784830
{ "s1", QCOM_SMD_RPM_SMPA, 1, &pm8998_ftsmps, "vdd_s1" },
785831
{ "s2", QCOM_SMD_RPM_SMPA, 2, &pm8998_ftsmps, "vdd_s2" },
@@ -862,6 +908,7 @@ static const struct of_device_id rpm_of_match[] = {
862908
{ .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators },
863909
{ .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators },
864910
{ .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators },
911+
{ .compatible = "qcom,rpm-pmi8994-regulators", .data = &rpm_pmi8994_regulators },
865912
{ .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators },
866913
{ .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators },
867914
{}

include/linux/soc/qcom/smd-rpm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct qcom_smd_rpm;
1010
/*
1111
* Constants used for addressing resources in the RPM.
1212
*/
13+
#define QCOM_SMD_RPM_BBYB 0x62796262
1314
#define QCOM_SMD_RPM_BOBB 0x62626f62
1415
#define QCOM_SMD_RPM_BOOST 0x61747362
1516
#define QCOM_SMD_RPM_BUS_CLK 0x316b6c63

0 commit comments

Comments
 (0)