aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt35
-rw-r--r--drivers/regulator/qcom_smd-regulator.c95
2 files changed, 130 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
index 82557e174258..1f8d6f84b657 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
@@ -22,6 +22,7 @@ Regulator nodes are identified by their compatible:
22 "qcom,rpm-pm8841-regulators" 22 "qcom,rpm-pm8841-regulators"
23 "qcom,rpm-pm8916-regulators" 23 "qcom,rpm-pm8916-regulators"
24 "qcom,rpm-pm8941-regulators" 24 "qcom,rpm-pm8941-regulators"
25 "qcom,rpm-pma8084-regulators"
25 26
26- vdd_s1-supply: 27- vdd_s1-supply:
27- vdd_s2-supply: 28- vdd_s2-supply:
@@ -67,6 +68,35 @@ Regulator nodes are identified by their compatible:
67 Definition: reference to regulator supplying the input pin, as 68 Definition: reference to regulator supplying the input pin, as
68 described in the data sheet 69 described in the data sheet
69 70
71- vdd_s1-supply:
72- vdd_s2-supply:
73- vdd_s3-supply:
74- vdd_s4-supply:
75- vdd_s5-supply:
76- vdd_s6-supply:
77- vdd_s7-supply:
78- vdd_s8-supply:
79- vdd_s9-supply:
80- vdd_s10-supply:
81- vdd_s11-supply:
82- vdd_s12-supply:
83- vdd_l1_l11-supply:
84- vdd_l2_l3_l4_l27-supply:
85- vdd_l5_l7-supply:
86- vdd_l6_l12_l14_l15_l26-supply:
87- vdd_l8-supply:
88- vdd_l9_l10_l13_l20_l23_l24-supply:
89- vdd_l16_l25-supply:
90- vdd_l17-supply:
91- vdd_l18-supply:
92- vdd_l19-supply:
93- vdd_l21-supply:
94- vdd_l22-supply:
95 Usage: optional (pma8084 only)
96 Value type: <phandle>
97 Definition: reference to regulator supplying the input pin, as
98 described in the data sheet
99
70The regulator node houses sub-nodes for each regulator within the device. Each 100The regulator node houses sub-nodes for each regulator within the device. Each
71sub-node is identified using the node's name, with valid values listed for each 101sub-node is identified using the node's name, with valid values listed for each
72of the pmics below. 102of the pmics below.
@@ -83,6 +113,11 @@ pm8941:
83 l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, 113 l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2,
84 lvs3, 5vs1, 5vs2 114 lvs3, 5vs1, 5vs2
85 115
116pma8084:
117 s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5,
118 l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
119 l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1
120
86The content of each sub-node is defined by the standard binding for regulators - 121The content of each sub-node is defined by the standard binding for regulators -
87see regulator.txt. 122see regulator.txt.
88 123
diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
index 8464eadf2c85..56a17ec5b5ef 100644
--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -153,6 +153,49 @@ static const struct regulator_ops rpm_switch_ops = {
153 .is_enabled = rpm_reg_is_enabled, 153 .is_enabled = rpm_reg_is_enabled,
154}; 154};
155 155
156static const struct regulator_desc pma8084_hfsmps = {
157 .linear_ranges = (struct regulator_linear_range[]) {
158 REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500),
159 REGULATOR_LINEAR_RANGE(1550000, 96, 158, 25000),
160 },
161 .n_linear_ranges = 2,
162 .n_voltages = 159,
163 .ops = &rpm_smps_ldo_ops,
164};
165
166static const struct regulator_desc pma8084_ftsmps = {
167 .linear_ranges = (struct regulator_linear_range[]) {
168 REGULATOR_LINEAR_RANGE(350000, 0, 184, 5000),
169 REGULATOR_LINEAR_RANGE(700000, 185, 339, 10000),
170 },
171 .n_linear_ranges = 2,
172 .n_voltages = 340,
173 .ops = &rpm_smps_ldo_ops,
174};
175
176static const struct regulator_desc pma8084_pldo = {
177 .linear_ranges = (struct regulator_linear_range[]) {
178 REGULATOR_LINEAR_RANGE(750000, 0, 30, 25000),
179 REGULATOR_LINEAR_RANGE(1500000, 31, 99, 50000),
180 },
181 .n_linear_ranges = 2,
182 .n_voltages = 100,
183 .ops = &rpm_smps_ldo_ops,
184};
185
186static const struct regulator_desc pma8084_nldo = {
187 .linear_ranges = (struct regulator_linear_range[]) {
188 REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500),
189 },
190 .n_linear_ranges = 1,
191 .n_voltages = 64,
192 .ops = &rpm_smps_ldo_ops,
193};
194
195static const struct regulator_desc pma8084_switch = {
196 .ops = &rpm_switch_ops,
197};
198
156static const struct regulator_desc pm8x41_hfsmps = { 199static const struct regulator_desc pm8x41_hfsmps = {
157 .linear_ranges = (struct regulator_linear_range[]) { 200 .linear_ranges = (struct regulator_linear_range[]) {
158 REGULATOR_LINEAR_RANGE( 375000, 0, 95, 12500), 201 REGULATOR_LINEAR_RANGE( 375000, 0, 95, 12500),
@@ -335,10 +378,62 @@ static const struct rpm_regulator_data rpm_pm8941_regulators[] = {
335 {} 378 {}
336}; 379};
337 380
381static const struct rpm_regulator_data rpm_pma8084_regulators[] = {
382 { "s1", QCOM_SMD_RPM_SMPA, 1, &pma8084_ftsmps, "vdd_s1" },
383 { "s2", QCOM_SMD_RPM_SMPA, 2, &pma8084_ftsmps, "vdd_s2" },
384 { "s3", QCOM_SMD_RPM_SMPA, 3, &pma8084_hfsmps, "vdd_s3" },
385 { "s4", QCOM_SMD_RPM_SMPA, 4, &pma8084_hfsmps, "vdd_s4" },
386 { "s5", QCOM_SMD_RPM_SMPA, 5, &pma8084_hfsmps, "vdd_s5" },
387 { "s6", QCOM_SMD_RPM_SMPA, 6, &pma8084_ftsmps, "vdd_s6" },
388 { "s7", QCOM_SMD_RPM_SMPA, 7, &pma8084_ftsmps, "vdd_s7" },
389 { "s8", QCOM_SMD_RPM_SMPA, 8, &pma8084_ftsmps, "vdd_s8" },
390 { "s9", QCOM_SMD_RPM_SMPA, 9, &pma8084_ftsmps, "vdd_s9" },
391 { "s10", QCOM_SMD_RPM_SMPA, 10, &pma8084_ftsmps, "vdd_s10" },
392 { "s11", QCOM_SMD_RPM_SMPA, 11, &pma8084_ftsmps, "vdd_s11" },
393 { "s12", QCOM_SMD_RPM_SMPA, 12, &pma8084_ftsmps, "vdd_s12" },
394
395 { "l1", QCOM_SMD_RPM_LDOA, 1, &pma8084_nldo, "vdd_l1_l11" },
396 { "l2", QCOM_SMD_RPM_LDOA, 2, &pma8084_nldo, "vdd_l2_l3_l4_l27" },
397 { "l3", QCOM_SMD_RPM_LDOA, 3, &pma8084_nldo, "vdd_l2_l3_l4_l27" },
398 { "l4", QCOM_SMD_RPM_LDOA, 4, &pma8084_nldo, "vdd_l2_l3_l4_l27" },
399 { "l5", QCOM_SMD_RPM_LDOA, 5, &pma8084_pldo, "vdd_l5_l7" },
400 { "l6", QCOM_SMD_RPM_LDOA, 6, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" },
401 { "l7", QCOM_SMD_RPM_LDOA, 7, &pma8084_pldo, "vdd_l5_l7" },
402 { "l8", QCOM_SMD_RPM_LDOA, 8, &pma8084_pldo, "vdd_l8" },
403 { "l9", QCOM_SMD_RPM_LDOA, 9, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
404 { "l10", QCOM_SMD_RPM_LDOA, 10, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
405 { "l11", QCOM_SMD_RPM_LDOA, 11, &pma8084_nldo, "vdd_l1_l11" },
406 { "l12", QCOM_SMD_RPM_LDOA, 12, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" },
407 { "l13", QCOM_SMD_RPM_LDOA, 13, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
408 { "l14", QCOM_SMD_RPM_LDOA, 14, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" },
409 { "l15", QCOM_SMD_RPM_LDOA, 15, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" },
410 { "l16", QCOM_SMD_RPM_LDOA, 16, &pma8084_pldo, "vdd_l16_l25" },
411 { "l17", QCOM_SMD_RPM_LDOA, 17, &pma8084_pldo, "vdd_l17" },
412 { "l18", QCOM_SMD_RPM_LDOA, 18, &pma8084_pldo, "vdd_l18" },
413 { "l19", QCOM_SMD_RPM_LDOA, 19, &pma8084_pldo, "vdd_l19" },
414 { "l20", QCOM_SMD_RPM_LDOA, 20, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
415 { "l21", QCOM_SMD_RPM_LDOA, 21, &pma8084_pldo, "vdd_l21" },
416 { "l22", QCOM_SMD_RPM_LDOA, 22, &pma8084_pldo, "vdd_l22" },
417 { "l23", QCOM_SMD_RPM_LDOA, 23, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
418 { "l24", QCOM_SMD_RPM_LDOA, 24, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" },
419 { "l25", QCOM_SMD_RPM_LDOA, 25, &pma8084_pldo, "vdd_l16_l25" },
420 { "l26", QCOM_SMD_RPM_LDOA, 26, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" },
421 { "l27", QCOM_SMD_RPM_LDOA, 27, &pma8084_nldo, "vdd_l2_l3_l4_l27" },
422
423 { "lvs1", QCOM_SMD_RPM_VSA, 1, &pma8084_switch },
424 { "lvs2", QCOM_SMD_RPM_VSA, 2, &pma8084_switch },
425 { "lvs3", QCOM_SMD_RPM_VSA, 3, &pma8084_switch },
426 { "lvs4", QCOM_SMD_RPM_VSA, 4, &pma8084_switch },
427 { "5vs1", QCOM_SMD_RPM_VSA, 5, &pma8084_switch },
428
429 {}
430};
431
338static const struct of_device_id rpm_of_match[] = { 432static const struct of_device_id rpm_of_match[] = {
339 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, 433 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators },
340 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, 434 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators },
341 { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators }, 435 { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators },
436 { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators },
342 {} 437 {}
343}; 438};
344MODULE_DEVICE_TABLE(of, rpm_of_match); 439MODULE_DEVICE_TABLE(of, rpm_of_match);