Skip to content

Commit e92a404

Browse files
bebarinobroonie
authored andcommitted
regulator: Add QCOM SPMI regulator driver
Add an SPMI regulator driver for Qualcomm's PM8841, PM8941, and PM8916 PMICs. This driver is based largely on code from codeaurora.org[1]. [1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/regulator/qpnp-regulator.c?h=msm-3.10 Cc: David Collins <[email protected]> Cc: <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent b787f68 commit e92a404

File tree

4 files changed

+1570
-0
lines changed

4 files changed

+1570
-0
lines changed
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Qualcomm SPMI Regulators
2+
3+
- compatible:
4+
Usage: required
5+
Value type: <string>
6+
Definition: must be one of:
7+
"qcom,pm8841-regulators"
8+
"qcom,pm8916-regulators"
9+
"qcom,pm8941-regulators"
10+
11+
- interrupts:
12+
Usage: optional
13+
Value type: <prop-encoded-array>
14+
Definition: List of OCP interrupts.
15+
16+
- interrupt-names:
17+
Usage: required if 'interrupts' property present
18+
Value type: <string-array>
19+
Definition: List of strings defining the names of the
20+
interrupts in the 'interrupts' property 1-to-1.
21+
Supported values are "ocp-<regulator_name>", where
22+
<regulator_name> corresponds to a voltage switch
23+
type regulator.
24+
25+
- vdd_s1-supply:
26+
- vdd_s2-supply:
27+
- vdd_s3-supply:
28+
- vdd_s4-supply:
29+
- vdd_s5-supply:
30+
- vdd_s6-supply:
31+
- vdd_s7-supply:
32+
- vdd_s8-supply:
33+
Usage: optional (pm8841 only)
34+
Value type: <phandle>
35+
Definition: Reference to regulator supplying the input pin, as
36+
described in the data sheet.
37+
38+
- vdd_s1-supply:
39+
- vdd_s2-supply:
40+
- vdd_s3-supply:
41+
- vdd_s4-supply:
42+
- vdd_l1_l3-supply:
43+
- vdd_l2-supply:
44+
- vdd_l4_l5_l6-supply:
45+
- vdd_l7-supply:
46+
- vdd_l8_l11_l14_l15_l16-supply:
47+
- vdd_l9_l10_l12_l13_l17_l18-supply:
48+
Usage: optional (pm8916 only)
49+
Value type: <phandle>
50+
Definition: Reference to regulator supplying the input pin, as
51+
described in the data sheet.
52+
53+
- vdd_s1-supply:
54+
- vdd_s2-supply:
55+
- vdd_s3-supply:
56+
- vdd_l1_l3-supply:
57+
- vdd_l2_lvs_1_2_3-supply:
58+
- vdd_l4_l11-supply:
59+
- vdd_l5_l7-supply:
60+
- vdd_l6_l12_l14_l15-supply:
61+
- vdd_l8_l16_l18_19-supply:
62+
- vdd_l9_l10_l17_l22-supply:
63+
- vdd_l13_l20_l23_l24-supply:
64+
- vdd_l21-supply:
65+
- vin_5vs-supply:
66+
Usage: optional (pm8941 only)
67+
Value type: <phandle>
68+
Definition: Reference to regulator supplying the input pin, as
69+
described in the data sheet.
70+
71+
72+
The regulator node houses sub-nodes for each regulator within the device. Each
73+
sub-node is identified using the node's name, with valid values listed for each
74+
of the PMICs below.
75+
76+
pm8841:
77+
s1, s2, s3, s4, s5, s6, s7, s8
78+
79+
pm8916:
80+
s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13,
81+
l14, l15, l16, l17, l18
82+
83+
pm8941:
84+
s1, s2, s3, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14,
85+
l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2, lvs3,
86+
mvs1, mvs2
87+
88+
The content of each sub-node is defined by the standard binding for regulators -
89+
see regulator.txt - with additional custom properties described below:
90+
91+
- regulator-initial-mode:
92+
Usage: optional
93+
Value type: <u32>
94+
Descrption: 1 = Set initial mode to high power mode (HPM), also referred
95+
to as NPM. HPM consumes more ground current than LPM, but
96+
it can source significantly higher load current. HPM is not
97+
available on boost type regulators. For voltage switch type
98+
regulators, HPM implies that over current protection and
99+
soft start are active all the time. 0 = Set initial mode to
100+
low power mode (LPM).
101+
102+
Example:
103+
104+
regulators {
105+
compatible = "qcom,pm8941-regulators";
106+
vdd_l1_l3-supply = <&s1>;
107+
108+
s1: s1 {
109+
regulator-min-microvolt = <1300000>;
110+
regulator-max-microvolt = <1400000>;
111+
};
112+
113+
...
114+
115+
l1: l1 {
116+
regulator-min-microvolt = <1225000>;
117+
regulator-max-microvolt = <1300000>;
118+
};
119+
120+
....
121+
};

drivers/regulator/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,17 @@ config REGULATOR_QCOM_RPM
512512
Qualcomm RPM as a module. The module will be named
513513
"qcom_rpm-regulator".
514514

515+
config REGULATOR_QCOM_SPMI
516+
tristate "Qualcomm SPMI regulator driver"
517+
depends on SPMI || COMPILE_TEST
518+
help
519+
If you say yes to this option, support will be included for the
520+
regulators found in Qualcomm SPMI PMICs.
521+
522+
Say M here if you want to include support for the regulators on the
523+
Qualcomm SPMI PMICs as a module. The module will be named
524+
"qcom_spmi-regulator".
525+
515526
config REGULATOR_RC5T583
516527
tristate "RICOH RC5T583 Power regulators"
517528
depends on MFD_RC5T583

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
6161
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
6262
obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
6363
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
64+
obj-$(CONFIG_REGULATOR_QCOM_SPMI) += qcom_spmi-regulator.o
6465
obj-$(CONFIG_REGULATOR_PALMAS) += palmas-regulator.o
6566
obj-$(CONFIG_REGULATOR_PFUZE100) += pfuze100-regulator.o
6667
obj-$(CONFIG_REGULATOR_PWM) += pwm-regulator.o

0 commit comments

Comments
 (0)