Skip to content

Commit dc38787

Browse files
committed
Merge tag 'regulator-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "This is a quiet release in terms of code volume but a fairly big one in terms of framework changes - we've got one long awaited feature in the form of runtime configuration of suspend and the start of coupled regulator support too: - Support for modifying the voltage and enable configuration devices will have in suspend, contributed by Chunyan Zhang. - Support for the Spreadtrum SC2731, contributed by Erick Chen. - The start of changes to support coupled regulators from Maciej Purski, the rest of the series should arrive for v4.17" * tag 'regulator-v4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: Fix build error regulator: core: Refactor regulator_list_voltage() regulator: core: Move of_find_regulator_by_node() to of_regulator.c regulator: add PM suspend and resume hooks regulator: empty the old suspend functions regulator: leave one item to record whether regulator is enabled regulator: make regulator voltage be an array to support more states regulator: added support for suspend states regulator: qcom_spmi: Use regmap helpers for enable/disable/is_enabled callback regulator: sc2731: Fix defines for SC2731_WR_UNLOCK and SC2731_PWR_WR_PROT_VALUE regulator: fix incorrect indentation of two assignment statements regulator: sc2731: Add regulator driver to support Spreadtrum SC2731 PMIC regulator: Add Spreadtrum SC2731 regulator documentation regulator: Update code examples in documentation MAINTAINERS: regulator: Add Documentation/power/regulator/ regulator: tps65218: Add NULL test for devm_kzalloc call regulator: tps65218: Remove unused enum tps65218_regulators
2 parents 8e32647 + 4e79f3f commit dc38787

File tree

14 files changed

+697
-231
lines changed

14 files changed

+697
-231
lines changed

Documentation/devicetree/bindings/regulator/regulator.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ Optional properties:
4242
- regulator-state-[mem/disk] node has following common properties:
4343
- regulator-on-in-suspend: regulator should be on in suspend state.
4444
- regulator-off-in-suspend: regulator should be off in suspend state.
45-
- regulator-suspend-microvolt: regulator should be set to this voltage
46-
in suspend.
45+
- regulator-suspend-min-microvolt: minimum voltage may be set in
46+
suspend state.
47+
- regulator-suspend-max-microvolt: maximum voltage may be set in
48+
suspend state.
49+
- regulator-suspend-microvolt: the default voltage which regulator
50+
would be set in suspend. This property is now deprecated, instead
51+
setting voltage for suspend mode via the API which regulator
52+
driver provides is recommended.
53+
- regulator-changeable-in-suspend: whether the default voltage and
54+
the regulator on/off in suspend can be changed in runtime.
4755
- regulator-mode: operating mode in the given suspend state.
4856
The set of possible operating modes depends on the capabilities of
4957
every hardware so the valid modes are documented on each regulator
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Spreadtrum SC2731 Voltage regulators
2+
3+
The SC2731 integrates low-voltage and low quiescent current DCDC/LDO.
4+
14 LDO and 3 DCDCs are designed for external use. All DCDCs/LDOs have
5+
their own bypass (power-down) control signals. External tantalum or MLCC
6+
ceramic capacitors are recommended to use with these LDOs.
7+
8+
Required properties:
9+
- compatible: should be "sprd,sc27xx-regulator".
10+
11+
List of regulators provided by this controller. It is named according to
12+
its regulator type, BUCK_<name> and LDO_<name>. The definition for each
13+
of these nodes is defined using the standard binding for regulators at
14+
Documentation/devicetree/bindings/regulator/regulator.txt.
15+
16+
The valid names for regulators are:
17+
BUCK:
18+
BUCK_CPU0, BUCK_CPU1, BUCK_RF
19+
LDO:
20+
LDO_CAMA0, LDO_CAMA1, LDO_CAMMOT, LDO_VLDO, LDO_EMMCCORE, LDO_SDCORE,
21+
LDO_SDIO, LDO_WIFIPA, LDO_USB33, LDO_CAMD0, LDO_CAMD1, LDO_CON,
22+
LDO_CAMIO, LDO_SRAM
23+
24+
Example:
25+
regulators {
26+
compatible = "sprd,sc27xx-regulator";
27+
28+
vddarm0: BUCK_CPU0 {
29+
regulator-name = "vddarm0";
30+
regulator-min-microvolt = <400000>;
31+
regulator-max-microvolt = <1996875>;
32+
regulator-ramp-delay = <25000>;
33+
regulator-always-on;
34+
};
35+
36+
vddcama0: LDO_CAMA0 {
37+
regulator-name = "vddcama0";
38+
regulator-min-microvolt = <1200000>;
39+
regulator-max-microvolt = <3750000>;
40+
regulator-enable-ramp-delay = <100>;
41+
};
42+
...
43+
};

Documentation/power/regulator/machine.txt

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ struct regulator_consumer_supply {
2323
e.g. for the machine above
2424

2525
static struct regulator_consumer_supply regulator1_consumers[] = {
26-
{
27-
.dev_name = "dev_name(consumer B)",
28-
.supply = "Vcc",
29-
},};
26+
REGULATOR_SUPPLY("Vcc", "consumer B"),
27+
};
3028

3129
static struct regulator_consumer_supply regulator2_consumers[] = {
32-
{
33-
.dev = "dev_name(consumer A"),
34-
.supply = "Vcc",
35-
},};
30+
REGULATOR_SUPPLY("Vcc", "consumer A"),
31+
};
3632

3733
This maps Regulator-1 to the 'Vcc' supply for Consumer B and maps Regulator-2
3834
to the 'Vcc' supply for Consumer A.
@@ -78,20 +74,20 @@ static struct regulator_init_data regulator2_data = {
7874
Finally the regulator devices must be registered in the usual manner.
7975

8076
static struct platform_device regulator_devices[] = {
81-
{
82-
.name = "regulator",
83-
.id = DCDC_1,
84-
.dev = {
85-
.platform_data = &regulator1_data,
77+
{
78+
.name = "regulator",
79+
.id = DCDC_1,
80+
.dev = {
81+
.platform_data = &regulator1_data,
82+
},
8683
},
87-
},
88-
{
89-
.name = "regulator",
90-
.id = DCDC_2,
91-
.dev = {
92-
.platform_data = &regulator2_data,
84+
{
85+
.name = "regulator",
86+
.id = DCDC_2,
87+
.dev = {
88+
.platform_data = &regulator2_data,
89+
},
9390
},
94-
},
9591
};
9692
/* register regulator 1 device */
9793
platform_device_register(&regulator_devices[0]);

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14670,6 +14670,7 @@ W: http://www.slimlogic.co.uk/?p=48
1467014670
T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
1467114671
S: Supported
1467214672
F: Documentation/devicetree/bindings/regulator/
14673+
F: Documentation/power/regulator/
1467314674
F: drivers/regulator/
1467414675
F: include/dt-bindings/regulator/
1467514676
F: include/linux/regulator/

drivers/regulator/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,13 @@ config REGULATOR_S5M8767
744744
via I2C bus. S5M8767A have 9 Bucks and 28 LDOs output and
745745
supports DVS mode with 8bits of output voltage control.
746746

747+
config REGULATOR_SC2731
748+
tristate "Spreadtrum SC2731 power regulator driver"
749+
depends on MFD_SC27XX_PMIC || COMPILE_TEST
750+
help
751+
This driver provides support for the voltage regulators on the
752+
SC2731 PMIC.
753+
747754
config REGULATOR_SKY81452
748755
tristate "Skyworks Solutions SKY81452 voltage regulator"
749756
depends on MFD_SKY81452

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ obj-$(CONFIG_REGULATOR_RT5033) += rt5033-regulator.o
9595
obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
9696
obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
9797
obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
98+
obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
9899
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
99100
obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
100101
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o

0 commit comments

Comments
 (0)