aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt23
-rw-r--r--drivers/regulator/qcom_smd-regulator.c77
2 files changed, 100 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 58a1d97972f5..45025b5b67f6 100644
--- a/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
+++ b/Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.txt
@@ -26,6 +26,7 @@ Regulator nodes are identified by their compatible:
26 "qcom,rpm-pm8998-regulators" 26 "qcom,rpm-pm8998-regulators"
27 "qcom,rpm-pma8084-regulators" 27 "qcom,rpm-pma8084-regulators"
28 "qcom,rpm-pmi8998-regulators" 28 "qcom,rpm-pmi8998-regulators"
29 "qcom,rpm-pms405-regulators"
29 30
30- vdd_s1-supply: 31- vdd_s1-supply:
31- vdd_s2-supply: 32- vdd_s2-supply:
@@ -188,6 +189,24 @@ Regulator nodes are identified by their compatible:
188 Definition: reference to regulator supplying the input pin, as 189 Definition: reference to regulator supplying the input pin, as
189 described in the data sheet 190 described in the data sheet
190 191
192- vdd_s1-supply:
193- vdd_s2-supply:
194- vdd_s3-supply:
195- vdd_s4-supply:
196- vdd_s5-supply:
197- vdd_l1_l2-supply:
198- vdd_l3_l8-supply:
199- vdd_l4-supply:
200- vdd_l5_l6-supply:
201- vdd_l7-supply:
202- vdd_l3_l8-supply:
203- vdd_l9-supply:
204- vdd_l10_l11_l12_l13-supply:
205 Usage: optional (pms405 only)
206 Value type: <phandle>
207 Definition: reference to regulator supplying the input pin, as
208 described in the data sheet
209
191The regulator node houses sub-nodes for each regulator within the device. Each 210The regulator node houses sub-nodes for each regulator within the device. Each
192sub-node is identified using the node's name, with valid values listed for each 211sub-node is identified using the node's name, with valid values listed for each
193of the pmics below. 212of the pmics below.
@@ -222,6 +241,10 @@ pma8084:
222pmi8998: 241pmi8998:
223 bob 242 bob
224 243
244pms405:
245 s1, s2, s3, s4, s5, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12,
246 l13
247
225The content of each sub-node is defined by the standard binding for regulators - 248The content of each sub-node is defined by the standard binding for regulators -
226see regulator.txt. 249see regulator.txt.
227 250
diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c
index fe2fb36803e0..f5bca77d67c1 100644
--- a/drivers/regulator/qcom_smd-regulator.c
+++ b/drivers/regulator/qcom_smd-regulator.c
@@ -420,6 +420,60 @@ static const struct regulator_desc pmi8998_bob = {
420 .ops = &rpm_bob_ops, 420 .ops = &rpm_bob_ops,
421}; 421};
422 422
423static const struct regulator_desc pms405_hfsmps3 = {
424 .linear_ranges = (struct regulator_linear_range[]) {
425 REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000),
426 },
427 .n_linear_ranges = 1,
428 .n_voltages = 216,
429 .ops = &rpm_smps_ldo_ops,
430};
431
432static const struct regulator_desc pms405_nldo300 = {
433 .linear_ranges = (struct regulator_linear_range[]) {
434 REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000),
435 },
436 .n_linear_ranges = 1,
437 .n_voltages = 128,
438 .ops = &rpm_smps_ldo_ops,
439};
440
441static const struct regulator_desc pms405_nldo1200 = {
442 .linear_ranges = (struct regulator_linear_range[]) {
443 REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000),
444 },
445 .n_linear_ranges = 1,
446 .n_voltages = 128,
447 .ops = &rpm_smps_ldo_ops,
448};
449
450static const struct regulator_desc pms405_pldo50 = {
451 .linear_ranges = (struct regulator_linear_range[]) {
452 REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000),
453 },
454 .n_linear_ranges = 1,
455 .n_voltages = 129,
456 .ops = &rpm_smps_ldo_ops,
457};
458
459static const struct regulator_desc pms405_pldo150 = {
460 .linear_ranges = (struct regulator_linear_range[]) {
461 REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000),
462 },
463 .n_linear_ranges = 1,
464 .n_voltages = 129,
465 .ops = &rpm_smps_ldo_ops,
466};
467
468static const struct regulator_desc pms405_pldo600 = {
469 .linear_ranges = (struct regulator_linear_range[]) {
470 REGULATOR_LINEAR_RANGE(1256000, 0, 98, 8000),
471 },
472 .n_linear_ranges = 1,
473 .n_voltages = 99,
474 .ops = &rpm_smps_ldo_ops,
475};
476
423struct rpm_regulator_data { 477struct rpm_regulator_data {
424 const char *name; 478 const char *name;
425 u32 type; 479 u32 type;
@@ -661,6 +715,28 @@ static const struct rpm_regulator_data rpm_pmi8998_regulators[] = {
661 {} 715 {}
662}; 716};
663 717
718static const struct rpm_regulator_data rpm_pms405_regulators[] = {
719 { "s1", QCOM_SMD_RPM_SMPA, 1, &pms405_hfsmps3, "vdd_s1" },
720 { "s2", QCOM_SMD_RPM_SMPA, 2, &pms405_hfsmps3, "vdd_s2" },
721 { "s3", QCOM_SMD_RPM_SMPA, 3, &pms405_hfsmps3, "vdd_s3" },
722 { "s4", QCOM_SMD_RPM_SMPA, 4, &pms405_hfsmps3, "vdd_s4" },
723 { "s5", QCOM_SMD_RPM_SMPA, 5, &pms405_hfsmps3, "vdd_s5" },
724 { "l1", QCOM_SMD_RPM_LDOA, 1, &pms405_nldo1200, "vdd_l1_l2" },
725 { "l2", QCOM_SMD_RPM_LDOA, 2, &pms405_nldo1200, "vdd_l1_l2" },
726 { "l3", QCOM_SMD_RPM_LDOA, 3, &pms405_nldo1200, "vdd_l3_l8" },
727 { "l4", QCOM_SMD_RPM_LDOA, 4, &pms405_nldo300, "vdd_l4" },
728 { "l5", QCOM_SMD_RPM_LDOA, 5, &pms405_pldo600, "vdd_l5_l6" },
729 { "l6", QCOM_SMD_RPM_LDOA, 6, &pms405_pldo600, "vdd_l5_l6" },
730 { "l7", QCOM_SMD_RPM_LDOA, 7, &pms405_pldo150, "vdd_l7" },
731 { "l8", QCOM_SMD_RPM_LDOA, 8, &pms405_nldo1200, "vdd_l3_l8" },
732 { "l9", QCOM_SMD_RPM_LDOA, 9, &pms405_nldo1200, "vdd_l9" },
733 { "l10", QCOM_SMD_RPM_LDOA, 10, &pms405_pldo50, "vdd_l10_l11_l12_l13" },
734 { "l11", QCOM_SMD_RPM_LDOA, 11, &pms405_pldo150, "vdd_l10_l11_l12_l13" },
735 { "l12", QCOM_SMD_RPM_LDOA, 12, &pms405_pldo150, "vdd_l10_l11_l12_l13" },
736 { "l13", QCOM_SMD_RPM_LDOA, 13, &pms405_pldo150, "vdd_l10_l11_l12_l13" },
737 {}
738};
739
664static const struct of_device_id rpm_of_match[] = { 740static const struct of_device_id rpm_of_match[] = {
665 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, 741 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators },
666 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, 742 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators },
@@ -669,6 +745,7 @@ static const struct of_device_id rpm_of_match[] = {
669 { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators }, 745 { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators },
670 { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, 746 { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators },
671 { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators }, 747 { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators },
748 { .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators },
672 {} 749 {}
673}; 750};
674MODULE_DEVICE_TABLE(of, rpm_of_match); 751MODULE_DEVICE_TABLE(of, rpm_of_match);