42a02865a3217e908bafb12ad4f0e2066b416120
[openwrt/staging/zorun.git] / target / linux / ipq806x / patches-5.10 / 091-v5.8-regulator-add-smb208-support.patch
1 From b5f25304aece9f2e7eaab275bbb5461c666bf38c Mon Sep 17 00:00:00 2001
2 From: Ansuel Smith <ansuelsmth@gmail.com>
3 Date: Wed, 19 Feb 2020 17:37:11 +0100
4 Subject: regulator: add smb208 support
5
6 Smb208 regulators are used on some ipq806x soc.
7 Add support for it to make it avaiable on some routers
8 that use it.
9
10 Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
11 Signed-off-by: Adrian Panella <ianchi74@outlook.com>
12 Acked-by: Lee Jones <lee.jones@linaro.org>
13 Link: https://lore.kernel.org/r/20200219163711.479-1-ansuelsmth@gmail.com
14 Signed-off-by: Mark Brown <broonie@kernel.org>
15 ---
16 Documentation/devicetree/bindings/mfd/qcom-rpm.txt | 4 ++++
17 drivers/regulator/qcom_rpm-regulator.c | 9 +++++++++
18 2 files changed, 13 insertions(+)
19
20 --- a/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
21 +++ b/Documentation/devicetree/bindings/mfd/qcom-rpm.txt
22 @@ -61,6 +61,7 @@ Regulator nodes are identified by their
23 "qcom,rpm-pm8901-regulators"
24 "qcom,rpm-pm8921-regulators"
25 "qcom,rpm-pm8018-regulators"
26 + "qcom,rpm-smb208-regulators"
27
28 - vdd_l0_l1_lvs-supply:
29 - vdd_l2_l11_l12-supply:
30 @@ -171,6 +172,9 @@ pm8018:
31 s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
32 l12, l14, lvs1
33
34 +smb208:
35 + s1a, s1b, s2a, s2b
36 +
37 The content of each sub-node is defined by the standard binding for regulators -
38 see regulator.txt - with additional custom properties described below:
39
40 --- a/drivers/regulator/qcom_rpm-regulator.c
41 +++ b/drivers/regulator/qcom_rpm-regulator.c
42 @@ -925,12 +925,21 @@ static const struct rpm_regulator_data r
43 { }
44 };
45
46 +static const struct rpm_regulator_data rpm_smb208_regulators[] = {
47 + { "s1a", QCOM_RPM_SMB208_S1a, &smb208_smps, "vin_s1a" },
48 + { "s1b", QCOM_RPM_SMB208_S1b, &smb208_smps, "vin_s1b" },
49 + { "s2a", QCOM_RPM_SMB208_S2a, &smb208_smps, "vin_s2a" },
50 + { "s2b", QCOM_RPM_SMB208_S2b, &smb208_smps, "vin_s2b" },
51 + { }
52 +};
53 +
54 static const struct of_device_id rpm_of_match[] = {
55 { .compatible = "qcom,rpm-pm8018-regulators",
56 .data = &rpm_pm8018_regulators },
57 { .compatible = "qcom,rpm-pm8058-regulators", .data = &rpm_pm8058_regulators },
58 { .compatible = "qcom,rpm-pm8901-regulators", .data = &rpm_pm8901_regulators },
59 { .compatible = "qcom,rpm-pm8921-regulators", .data = &rpm_pm8921_regulators },
60 + { .compatible = "qcom,rpm-smb208-regulators", .data = &rpm_smb208_regulators },
61 { }
62 };
63 MODULE_DEVICE_TABLE(of, rpm_of_match);