diff options
-rw-r--r-- | Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt | 48 | ||||
-rw-r--r-- | drivers/regulator/qcom_smd-regulator.c | 121 | ||||
-rw-r--r-- | include/linux/soc/qcom/smd-rpm.h | 1 |
3 files changed, 170 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 4e3dfb5b5f16..58a1d97972f5 100644 --- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt +++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt | |||
@@ -23,7 +23,9 @@ Regulator nodes are identified by their compatible: | |||
23 | "qcom,rpm-pm8916-regulators" | 23 | "qcom,rpm-pm8916-regulators" |
24 | "qcom,rpm-pm8941-regulators" | 24 | "qcom,rpm-pm8941-regulators" |
25 | "qcom,rpm-pm8994-regulators" | 25 | "qcom,rpm-pm8994-regulators" |
26 | "qcom,rpm-pm8998-regulators" | ||
26 | "qcom,rpm-pma8084-regulators" | 27 | "qcom,rpm-pma8084-regulators" |
28 | "qcom,rpm-pmi8998-regulators" | ||
27 | 29 | ||
28 | - vdd_s1-supply: | 30 | - vdd_s1-supply: |
29 | - vdd_s2-supply: | 31 | - vdd_s2-supply: |
@@ -131,6 +133,38 @@ Regulator nodes are identified by their compatible: | |||
131 | - vdd_s10-supply: | 133 | - vdd_s10-supply: |
132 | - vdd_s11-supply: | 134 | - vdd_s11-supply: |
133 | - vdd_s12-supply: | 135 | - vdd_s12-supply: |
136 | - vdd_s13-supply: | ||
137 | - vdd_l1_l27-supply: | ||
138 | - vdd_l20_l24-supply: | ||
139 | - vdd_l26-supply: | ||
140 | - vdd_l2_l8_l17-supply: | ||
141 | - vdd_l3_l11-supply: | ||
142 | - vdd_l4_l5-supply: | ||
143 | - vdd_l6-supply: | ||
144 | - vdd_l7_l12_l14_l15-supply: | ||
145 | - vdd_l9-supply: | ||
146 | - vdd_l10_l23_l25-supply: | ||
147 | - vdd_l13_l19_l21-supply: | ||
148 | - vdd_l16_l28-supply: | ||
149 | - vdd_l18_l22-supply: | ||
150 | - vdd_lvs1_lvs2-supply: | ||
151 | Usage: optional (pmi8998 only) | ||
152 | Value type: <phandle> | ||
153 | Definition: reference to regulator supplying the input pin, as | ||
154 | described in the data sheet | ||
155 | |||
156 | - vdd_s1-supply: | ||
157 | - vdd_s2-supply: | ||
158 | - vdd_s3-supply: | ||
159 | - vdd_s4-supply: | ||
160 | - vdd_s5-supply: | ||
161 | - vdd_s6-supply: | ||
162 | - vdd_s7-supply: | ||
163 | - vdd_s8-supply: | ||
164 | - vdd_s9-supply: | ||
165 | - vdd_s10-supply: | ||
166 | - vdd_s11-supply: | ||
167 | - vdd_s12-supply: | ||
134 | - vdd_l1_l11-supply: | 168 | - vdd_l1_l11-supply: |
135 | - vdd_l2_l3_l4_l27-supply: | 169 | - vdd_l2_l3_l4_l27-supply: |
136 | - vdd_l5_l7-supply: | 170 | - vdd_l5_l7-supply: |
@@ -148,6 +182,12 @@ Regulator nodes are identified by their compatible: | |||
148 | Definition: reference to regulator supplying the input pin, as | 182 | Definition: reference to regulator supplying the input pin, as |
149 | described in the data sheet | 183 | described in the data sheet |
150 | 184 | ||
185 | - vdd_bob-supply: | ||
186 | Usage: optional (pmi8998 only) | ||
187 | Value type: <phandle> | ||
188 | Definition: reference to regulator supplying the input pin, as | ||
189 | described in the data sheet | ||
190 | |||
151 | The regulator node houses sub-nodes for each regulator within the device. Each | 191 | The regulator node houses sub-nodes for each regulator within the device. Each |
152 | sub-node is identified using the node's name, with valid values listed for each | 192 | sub-node is identified using the node's name, with valid values listed for each |
153 | of the pmics below. | 193 | of the pmics below. |
@@ -169,11 +209,19 @@ pm8994: | |||
169 | l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, | 209 | l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, |
170 | l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2 | 210 | l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, lvs1, lvs2 |
171 | 211 | ||
212 | pm8998: | ||
213 | s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, l1, l2, l3, l4, | ||
214 | l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, | ||
215 | l20, l21, l22, l23, l24, l25, l26, l27, l28, lvs1, lvs2 | ||
216 | |||
172 | pma8084: | 217 | pma8084: |
173 | s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5, | 218 | s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, l1, l2, l3, l4, l5, |
174 | l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, | 219 | l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, |
175 | l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1 | 220 | l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1 |
176 | 221 | ||
222 | pmi8998: | ||
223 | bob | ||
224 | |||
177 | The content of each sub-node is defined by the standard binding for regulators - | 225 | The content of each sub-node is defined by the standard binding for regulators - |
178 | see regulator.txt. | 226 | see regulator.txt. |
179 | 227 | ||
diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index 940fe1b78411..ef51db5f0d9b 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c | |||
@@ -165,6 +165,15 @@ static const struct regulator_ops rpm_switch_ops = { | |||
165 | .is_enabled = rpm_reg_is_enabled, | 165 | .is_enabled = rpm_reg_is_enabled, |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static const struct regulator_ops rpm_bob_ops = { | ||
169 | .enable = rpm_reg_enable, | ||
170 | .disable = rpm_reg_disable, | ||
171 | .is_enabled = rpm_reg_is_enabled, | ||
172 | |||
173 | .get_voltage = rpm_reg_get_voltage, | ||
174 | .set_voltage = rpm_reg_set_voltage, | ||
175 | }; | ||
176 | |||
168 | static const struct regulator_desc pma8084_hfsmps = { | 177 | static const struct regulator_desc pma8084_hfsmps = { |
169 | .linear_ranges = (struct regulator_linear_range[]) { | 178 | .linear_ranges = (struct regulator_linear_range[]) { |
170 | REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), | 179 | REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), |
@@ -355,6 +364,64 @@ static const struct regulator_desc pm8994_lnldo = { | |||
355 | .ops = &rpm_smps_ldo_ops_fixed, | 364 | .ops = &rpm_smps_ldo_ops_fixed, |
356 | }; | 365 | }; |
357 | 366 | ||
367 | static const struct regulator_desc pm8998_ftsmps = { | ||
368 | .linear_ranges = (struct regulator_linear_range[]) { | ||
369 | REGULATOR_LINEAR_RANGE(320000, 0, 258, 4000), | ||
370 | }, | ||
371 | .n_linear_ranges = 1, | ||
372 | .n_voltages = 259, | ||
373 | .ops = &rpm_smps_ldo_ops, | ||
374 | }; | ||
375 | |||
376 | static const struct regulator_desc pm8998_hfsmps = { | ||
377 | .linear_ranges = (struct regulator_linear_range[]) { | ||
378 | REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), | ||
379 | }, | ||
380 | .n_linear_ranges = 1, | ||
381 | .n_voltages = 216, | ||
382 | .ops = &rpm_smps_ldo_ops, | ||
383 | }; | ||
384 | |||
385 | static const struct regulator_desc pm8998_nldo = { | ||
386 | .linear_ranges = (struct regulator_linear_range[]) { | ||
387 | REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), | ||
388 | }, | ||
389 | .n_linear_ranges = 1, | ||
390 | .n_voltages = 128, | ||
391 | .ops = &rpm_smps_ldo_ops, | ||
392 | }; | ||
393 | |||
394 | static const struct regulator_desc pm8998_pldo = { | ||
395 | .linear_ranges = (struct regulator_linear_range[]) { | ||
396 | REGULATOR_LINEAR_RANGE(1664000, 0, 255, 8000), | ||
397 | }, | ||
398 | .n_linear_ranges = 1, | ||
399 | .n_voltages = 256, | ||
400 | .ops = &rpm_smps_ldo_ops, | ||
401 | }; | ||
402 | |||
403 | static const struct regulator_desc pm8998_pldo_lv = { | ||
404 | .linear_ranges = (struct regulator_linear_range[]) { | ||
405 | REGULATOR_LINEAR_RANGE(1256000, 0, 127, 8000), | ||
406 | }, | ||
407 | .n_linear_ranges = 1, | ||
408 | .n_voltages = 128, | ||
409 | .ops = &rpm_smps_ldo_ops, | ||
410 | }; | ||
411 | |||
412 | static const struct regulator_desc pm8998_switch = { | ||
413 | .ops = &rpm_switch_ops, | ||
414 | }; | ||
415 | |||
416 | static const struct regulator_desc pmi8998_bob = { | ||
417 | .linear_ranges = (struct regulator_linear_range[]) { | ||
418 | REGULATOR_LINEAR_RANGE(1824000, 0, 83, 32000), | ||
419 | }, | ||
420 | .n_linear_ranges = 1, | ||
421 | .n_voltages = 84, | ||
422 | .ops = &rpm_bob_ops, | ||
423 | }; | ||
424 | |||
358 | struct rpm_regulator_data { | 425 | struct rpm_regulator_data { |
359 | const char *name; | 426 | const char *name; |
360 | u32 type; | 427 | u32 type; |
@@ -544,12 +611,66 @@ static const struct rpm_regulator_data rpm_pm8994_regulators[] = { | |||
544 | {} | 611 | {} |
545 | }; | 612 | }; |
546 | 613 | ||
614 | static const struct rpm_regulator_data rpm_pm8998_regulators[] = { | ||
615 | { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8998_ftsmps, "vdd_s1" }, | ||
616 | { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8998_ftsmps, "vdd_s2" }, | ||
617 | { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8998_hfsmps, "vdd_s3" }, | ||
618 | { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8998_hfsmps, "vdd_s4" }, | ||
619 | { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8998_hfsmps, "vdd_s5" }, | ||
620 | { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8998_ftsmps, "vdd_s6" }, | ||
621 | { "s7", QCOM_SMD_RPM_SMPA, 7, &pm8998_ftsmps, "vdd_s7" }, | ||
622 | { "s8", QCOM_SMD_RPM_SMPA, 8, &pm8998_ftsmps, "vdd_s8" }, | ||
623 | { "s9", QCOM_SMD_RPM_SMPA, 9, &pm8998_ftsmps, "vdd_s9" }, | ||
624 | { "s10", QCOM_SMD_RPM_SMPA, 10, &pm8998_ftsmps, "vdd_s10" }, | ||
625 | { "s11", QCOM_SMD_RPM_SMPA, 11, &pm8998_ftsmps, "vdd_s11" }, | ||
626 | { "s12", QCOM_SMD_RPM_SMPA, 12, &pm8998_ftsmps, "vdd_s12" }, | ||
627 | { "s13", QCOM_SMD_RPM_SMPA, 13, &pm8998_ftsmps, "vdd_s13" }, | ||
628 | { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8998_nldo, "vdd_l1_l27" }, | ||
629 | { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8998_nldo, "vdd_l2_l8_l17" }, | ||
630 | { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8998_nldo, "vdd_l3_l11" }, | ||
631 | { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8998_nldo, "vdd_l4_l5" }, | ||
632 | { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8998_nldo, "vdd_l4_l5" }, | ||
633 | { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8998_pldo, "vdd_l6" }, | ||
634 | { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, | ||
635 | { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8998_nldo, "vdd_l2_l8_l17" }, | ||
636 | { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8998_pldo, "vdd_l9" }, | ||
637 | { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8998_pldo, "vdd_l10_l23_l25" }, | ||
638 | { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8998_nldo, "vdd_l3_l11" }, | ||
639 | { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, | ||
640 | { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8998_pldo, "vdd_l13_l19_l21" }, | ||
641 | { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, | ||
642 | { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, | ||
643 | { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8998_pldo, "vdd_l16_l28" }, | ||
644 | { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8998_nldo, "vdd_l2_l8_l17" }, | ||
645 | { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8998_pldo, "vdd_l18_l22" }, | ||
646 | { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8998_pldo, "vdd_l13_l19_l21" }, | ||
647 | { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8998_pldo, "vdd_l20_l24" }, | ||
648 | { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8998_pldo, "vdd_l13_l19_l21" }, | ||
649 | { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8998_pldo, "vdd_l18_l22" }, | ||
650 | { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8998_pldo, "vdd_l10_l23_l25" }, | ||
651 | { "l24", QCOM_SMD_RPM_LDOA, 24, &pm8998_pldo, "vdd_l20_l24" }, | ||
652 | { "l25", QCOM_SMD_RPM_LDOA, 25, &pm8998_pldo, "vdd_l10_l23_l25" }, | ||
653 | { "l26", QCOM_SMD_RPM_LDOA, 26, &pm8998_nldo, "vdd_l26" }, | ||
654 | { "l27", QCOM_SMD_RPM_LDOA, 27, &pm8998_nldo, "vdd_l1_l27" }, | ||
655 | { "l28", QCOM_SMD_RPM_LDOA, 28, &pm8998_pldo, "vdd_l16_l28" }, | ||
656 | { "lvs1", QCOM_SMD_RPM_VSA, 1, &pm8998_switch, "vdd_lvs1_lvs2" }, | ||
657 | { "lvs2", QCOM_SMD_RPM_VSA, 2, &pm8998_switch, "vdd_lvs1_lvs2" }, | ||
658 | {} | ||
659 | }; | ||
660 | |||
661 | static const struct rpm_regulator_data rpm_pmi8998_regulators[] = { | ||
662 | { "bob", QCOM_SMD_RPM_BOBB, 1, &pmi8998_bob, "vdd_bob" }, | ||
663 | {} | ||
664 | }; | ||
665 | |||
547 | static const struct of_device_id rpm_of_match[] = { | 666 | static const struct of_device_id rpm_of_match[] = { |
548 | { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, | 667 | { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, |
549 | { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, | 668 | { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, |
550 | { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators }, | 669 | { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators }, |
551 | { .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators }, | 670 | { .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators }, |
671 | { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators }, | ||
552 | { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, | 672 | { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, |
673 | { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators }, | ||
553 | {} | 674 | {} |
554 | }; | 675 | }; |
555 | MODULE_DEVICE_TABLE(of, rpm_of_match); | 676 | MODULE_DEVICE_TABLE(of, rpm_of_match); |
diff --git a/include/linux/soc/qcom/smd-rpm.h b/include/linux/soc/qcom/smd-rpm.h index 9f5c6e53f3a5..9e4fdd861a51 100644 --- a/include/linux/soc/qcom/smd-rpm.h +++ b/include/linux/soc/qcom/smd-rpm.h | |||
@@ -10,6 +10,7 @@ struct qcom_smd_rpm; | |||
10 | /* | 10 | /* |
11 | * Constants used for addressing resources in the RPM. | 11 | * Constants used for addressing resources in the RPM. |
12 | */ | 12 | */ |
13 | #define QCOM_SMD_RPM_BOBB 0x62626f62 | ||
13 | #define QCOM_SMD_RPM_BOOST 0x61747362 | 14 | #define QCOM_SMD_RPM_BOOST 0x61747362 |
14 | #define QCOM_SMD_RPM_BUS_CLK 0x316b6c63 | 15 | #define QCOM_SMD_RPM_BUS_CLK 0x316b6c63 |
15 | #define QCOM_SMD_RPM_BUS_MASTER 0x73616d62 | 16 | #define QCOM_SMD_RPM_BUS_MASTER 0x73616d62 |