Skip to content

Commit aae6f98

Browse files
committed
Merge tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: - Support for putting regulators into bypass mode where they simply switch their input to the output (mainly used for low power retention). - A new API for setting voltages based on a voltage plus tolerance rather than an explicit voltage range. - Lots of cleanups and API updates from Axel Lin. - New driver for MAX8907. * tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (71 commits) regulator: arizona-ldo: Remove top voltage regulator: tps6586x: remove regulator-compatible from DT docs regulator: tps65217.txt: remove regulator-compatible from DT docs regulator: deprecate regulator-compatible DT property regulator: fan53555: remove vsel_max not used regulator: aat2870: Don't explicitly initialise the first field extcon: arizona: Use bypass mode for MICVDD regulator: wm831x-ldo: Add bypass support regulator: arizona-micsupp: Support get/set bypass regulator: arizona-ldo: Support get/set bypass regulator: core: Provide regmap get/set bypass operations regulator: core: Support bypass mode regulator: Fairchild fan53555 support regulator: twl: Remove another unused variable warning regulator: core: Try using the parent device for the default regmap regulator: core: Fast path non-deferred disables regulator: core: Report microvolts in sysfs even with only list_voltage() regulator: tps6586x: add support for SYS rail regulator: lp872x: remove unnecessary function regulator: lp872x: fix NULL pointer access problem ...
2 parents b34e5f5 + 6a2027a commit aae6f98

43 files changed

Lines changed: 1417 additions & 563 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/ABI/testing/sysfs-class-regulator‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,24 @@ Description:
349349

350350
This will be one of the same strings reported by
351351
the "state" attribute.
352+
353+
What: /sys/class/regulator/.../bypass
354+
Date: September 2012
355+
KernelVersion: 3.7
356+
Contact: Mark Brown <broonie@opensource.wolfsonmicro.com>
357+
Description:
358+
Some regulator directories will contain a field called
359+
bypass. This indicates if the device is in bypass mode.
360+
361+
This will be one of the following strings:
362+
363+
'enabled'
364+
'disabled'
365+
'unknown'
366+
367+
'enabled' means the regulator is in bypass mode.
368+
369+
'disabled' means that the regulator is regulating.
370+
371+
'unknown' means software cannot determine the state, or
372+
the reported state is invalid.

‎Documentation/devicetree/bindings/regulator/regulator.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ Optional properties:
1111
- regulator-boot-on: bootloader/firmware enabled regulator
1212
- <name>-supply: phandle to the parent supply/regulator node
1313
- regulator-ramp-delay: ramp delay for regulator(in uV/uS)
14+
15+
Deprecated properties:
1416
- regulator-compatible: If a regulator chip contains multiple
1517
regulators, and if the chip's binding contains a child node that
1618
describes each regulator, then this property indicates which regulator
17-
this child node is intended to configure.
19+
this child node is intended to configure. If this property is missing,
20+
the node's name will be used instead.
1821

1922
Example:
2023

‎Documentation/devicetree/bindings/regulator/tps65217.txt‎

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,66 +22,49 @@ Example:
2222
compatible = "ti,tps65217";
2323

2424
regulators {
25-
#address-cells = <1>;
26-
#size-cells = <0>;
27-
28-
dcdc1_reg: regulator@0 {
29-
reg = <0>;
30-
regulator-compatible = "dcdc1";
25+
dcdc1_reg: dcdc1 {
3126
regulator-min-microvolt = <900000>;
3227
regulator-max-microvolt = <1800000>;
3328
regulator-boot-on;
3429
regulator-always-on;
3530
};
3631

37-
dcdc2_reg: regulator@1 {
38-
reg = <1>;
39-
regulator-compatible = "dcdc2";
32+
dcdc2_reg: dcdc2 {
4033
regulator-min-microvolt = <900000>;
4134
regulator-max-microvolt = <3300000>;
4235
regulator-boot-on;
4336
regulator-always-on;
4437
};
4538

46-
dcdc3_reg: regulator@2 {
47-
reg = <2>;
48-
regulator-compatible = "dcdc3";
39+
dcdc3_reg: dcc3 {
4940
regulator-min-microvolt = <900000>;
5041
regulator-max-microvolt = <1500000>;
5142
regulator-boot-on;
5243
regulator-always-on;
5344
};
5445

55-
ldo1_reg: regulator@3 {
56-
reg = <3>;
57-
regulator-compatible = "ldo1";
46+
ldo1_reg: ldo1 {
5847
regulator-min-microvolt = <1000000>;
5948
regulator-max-microvolt = <3300000>;
6049
regulator-boot-on;
6150
regulator-always-on;
6251
};
6352

64-
ldo2_reg: regulator@4 {
65-
reg = <4>;
66-
regulator-compatible = "ldo2";
53+
ldo2_reg: ldo2 {
6754
regulator-min-microvolt = <900000>;
6855
regulator-max-microvolt = <3300000>;
6956
regulator-boot-on;
7057
regulator-always-on;
7158
};
7259

73-
ldo3_reg: regulator@5 {
74-
reg = <5>;
75-
regulator-compatible = "ldo3";
60+
ldo3_reg: ldo3 {
7661
regulator-min-microvolt = <1800000>;
7762
regulator-max-microvolt = <3300000>;
7863
regulator-boot-on;
7964
regulator-always-on;
8065
};
8166

82-
ldo4_reg: regulator@6 {
83-
reg = <6>;
84-
regulator-compatible = "ldo4";
67+
ldo4_reg: ldo4 {
8568
regulator-min-microvolt = <1800000>;
8669
regulator-max-microvolt = <3300000>;
8770
regulator-boot-on;

‎Documentation/devicetree/bindings/regulator/tps6586x.txt‎

Lines changed: 29 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ Required properties:
66
- interrupts: the interrupt outputs of the controller
77
- #gpio-cells: number of cells to describe a GPIO
88
- gpio-controller: mark the device as a GPIO controller
9-
- regulators: list of regulators provided by this controller, must have
10-
property "regulator-compatible" to match their hardware counterparts:
11-
sm[0-2], ldo[0-9] and ldo_rtc
9+
- regulators: A node that houses a sub-node for each regulator within the
10+
device. Each sub-node is identified using the node's name (or the deprecated
11+
regulator-compatible property if present), with valid values listed below.
12+
The content of each sub-node is defined by the standard binding for
13+
regulators; see regulator.txt.
14+
sys, sm[0-2], ldo[0-9] and ldo_rtc
15+
- sys-supply: The input supply for SYS.
1216
- vin-sm0-supply: The input supply for the SM0.
1317
- vin-sm1-supply: The input supply for the SM1.
1418
- vin-sm2-supply: The input supply for the SM2.
@@ -20,6 +24,9 @@ Required properties:
2024

2125
Each regulator is defined using the standard binding for regulators.
2226

27+
Note: LDO5 and LDO_RTC is supplied by SYS regulator internally and driver
28+
take care of making proper parent child relationship.
29+
2330
Example:
2431

2532
pmu: tps6586x@34 {
@@ -30,6 +37,7 @@ Example:
3037
#gpio-cells = <2>;
3138
gpio-controller;
3239

40+
sys-supply = <&some_reg>;
3341
vin-sm0-supply = <&some_reg>;
3442
vin-sm1-supply = <&some_reg>;
3543
vin-sm2-supply = <&some_reg>;
@@ -40,103 +48,80 @@ Example:
4048
vinldo9-supply = <...>;
4149

4250
regulators {
43-
#address-cells = <1>;
44-
#size-cells = <0>;
51+
sys_reg: sys {
52+
regulator-name = "vdd_sys";
53+
regulator-boot-on;
54+
regulator-always-on;
55+
};
4556

46-
sm0_reg: regulator@0 {
47-
reg = <0>;
48-
regulator-compatible = "sm0";
57+
sm0_reg: sm0 {
4958
regulator-min-microvolt = < 725000>;
5059
regulator-max-microvolt = <1500000>;
5160
regulator-boot-on;
5261
regulator-always-on;
5362
};
5463

55-
sm1_reg: regulator@1 {
56-
reg = <1>;
57-
regulator-compatible = "sm1";
64+
sm1_reg: sm1 {
5865
regulator-min-microvolt = < 725000>;
5966
regulator-max-microvolt = <1500000>;
6067
regulator-boot-on;
6168
regulator-always-on;
6269
};
6370

64-
sm2_reg: regulator@2 {
65-
reg = <2>;
66-
regulator-compatible = "sm2";
71+
sm2_reg: sm2 {
6772
regulator-min-microvolt = <3000000>;
6873
regulator-max-microvolt = <4550000>;
6974
regulator-boot-on;
7075
regulator-always-on;
7176
};
7277

73-
ldo0_reg: regulator@3 {
74-
reg = <3>;
75-
regulator-compatible = "ldo0";
78+
ldo0_reg: ldo0 {
7679
regulator-name = "PCIE CLK";
7780
regulator-min-microvolt = <3300000>;
7881
regulator-max-microvolt = <3300000>;
7982
};
8083

81-
ldo1_reg: regulator@4 {
82-
reg = <4>;
83-
regulator-compatible = "ldo1";
84+
ldo1_reg: ldo1 {
8485
regulator-min-microvolt = < 725000>;
8586
regulator-max-microvolt = <1500000>;
8687
};
8788

88-
ldo2_reg: regulator@5 {
89-
reg = <5>;
90-
regulator-compatible = "ldo2";
89+
ldo2_reg: ldo2 {
9190
regulator-min-microvolt = < 725000>;
9291
regulator-max-microvolt = <1500000>;
9392
};
9493

95-
ldo3_reg: regulator@6 {
96-
reg = <6>;
97-
regulator-compatible = "ldo3";
94+
ldo3_reg: ldo3 {
9895
regulator-min-microvolt = <1250000>;
9996
regulator-max-microvolt = <3300000>;
10097
};
10198

102-
ldo4_reg: regulator@7 {
103-
reg = <7>;
104-
regulator-compatible = "ldo4";
99+
ldo4_reg: ldo4 {
105100
regulator-min-microvolt = <1700000>;
106101
regulator-max-microvolt = <2475000>;
107102
};
108103

109-
ldo5_reg: regulator@8 {
110-
reg = <8>;
111-
regulator-compatible = "ldo5";
104+
ldo5_reg: ldo5 {
112105
regulator-min-microvolt = <1250000>;
113106
regulator-max-microvolt = <3300000>;
114107
};
115108

116-
ldo6_reg: regulator@9 {
117-
reg = <9>;
118-
regulator-compatible = "ldo6";
109+
ldo6_reg: ldo6 {
119110
regulator-min-microvolt = <1250000>;
120111
regulator-max-microvolt = <3300000>;
121112
};
122113

123-
ldo7_reg: regulator@10 {
124-
reg = <10>;
125-
regulator-compatible = "ldo7";
114+
ldo7_reg: ldo7 {
126115
regulator-min-microvolt = <1250000>;
127116
regulator-max-microvolt = <3300000>;
128117
};
129118

130-
ldo8_reg: regulator@11 {
131-
reg = <11>;
132-
regulator-compatible = "ldo8";
119+
ldo8_reg: ldo8 {
133120
regulator-min-microvolt = <1250000>;
134121
regulator-max-microvolt = <3300000>;
135122
};
136123

137-
ldo9_reg: regulator@12 {
138-
reg = <12>;
139-
regulator-compatible = "ldo9";
124+
ldo9_reg: ldo9 {
140125
regulator-min-microvolt = <1250000>;
141126
regulator-max-microvolt = <3300000>;
142127
};

‎arch/arm/mach-tegra/board-harmony-power.c‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,21 @@ static struct regulator_init_data ldo0_data = {
6767
}, \
6868
}
6969

70+
static struct regulator_init_data sys_data = {
71+
.supply_regulator = "vdd_5v0",
72+
.constraints = {
73+
.name = "vdd_sys",
74+
},
75+
};
76+
7077
HARMONY_REGULATOR_INIT(sm0, "vdd_sm0", "vdd_sys", 725, 1500, 1);
7178
HARMONY_REGULATOR_INIT(sm1, "vdd_sm1", "vdd_sys", 725, 1500, 1);
7279
HARMONY_REGULATOR_INIT(sm2, "vdd_sm2", "vdd_sys", 3000, 4550, 1);
7380
HARMONY_REGULATOR_INIT(ldo1, "vdd_ldo1", "vdd_sm2", 725, 1500, 1);
7481
HARMONY_REGULATOR_INIT(ldo2, "vdd_ldo2", "vdd_sm2", 725, 1500, 0);
7582
HARMONY_REGULATOR_INIT(ldo3, "vdd_ldo3", "vdd_sm2", 1250, 3300, 1);
7683
HARMONY_REGULATOR_INIT(ldo4, "vdd_ldo4", "vdd_sm2", 1700, 2475, 1);
77-
HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", NULL, 1250, 3300, 1);
84+
HARMONY_REGULATOR_INIT(ldo5, "vdd_ldo5", "vdd_sys", 1250, 3300, 1);
7885
HARMONY_REGULATOR_INIT(ldo6, "vdd_ldo6", "vdd_sm2", 1250, 3300, 0);
7986
HARMONY_REGULATOR_INIT(ldo7, "vdd_ldo7", "vdd_sm2", 1250, 3300, 0);
8087
HARMONY_REGULATOR_INIT(ldo8, "vdd_ldo8", "vdd_sm2", 1250, 3300, 0);
@@ -88,6 +95,7 @@ HARMONY_REGULATOR_INIT(ldo9, "vdd_ldo9", "vdd_sm2", 1250, 3300, 1);
8895
}
8996

9097
static struct tps6586x_subdev_info tps_devs[] = {
98+
TPS_REG(SYS, &sys_data),
9199
TPS_REG(SM_0, &sm0_data),
92100
TPS_REG(SM_1, &sm1_data),
93101
TPS_REG(SM_2, &sm2_data),
@@ -120,7 +128,7 @@ static struct i2c_board_info __initdata harmony_regulators[] = {
120128

121129
int __init harmony_regulator_init(void)
122130
{
123-
regulator_register_always_on(0, "vdd_sys",
131+
regulator_register_always_on(0, "vdd_5v0",
124132
NULL, 0, 5000000);
125133

126134
if (machine_is_harmony()) {

‎drivers/extcon/extcon-arizona.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,11 @@ static int __devinit arizona_extcon_probe(struct platform_device *pdev)
434434
regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE,
435435
ARIZONA_JD1_ENA, ARIZONA_JD1_ENA);
436436

437+
ret = regulator_allow_bypass(info->micvdd, true);
438+
if (ret != 0)
439+
dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n",
440+
ret);
441+
437442
pm_runtime_put(&pdev->dev);
438443

439444
return 0;

‎drivers/mfd/tps6586x.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/i2c.h>
2626
#include <linux/regmap.h>
2727
#include <linux/regulator/of_regulator.h>
28+
#include <linux/regulator/machine.h>
2829

2930
#include <linux/mfd/core.h>
3031
#include <linux/mfd/tps6586x.h>
@@ -346,6 +347,7 @@ static int __devinit tps6586x_add_subdevs(struct tps6586x *tps6586x,
346347

347348
#ifdef CONFIG_OF
348349
static struct of_regulator_match tps6586x_matches[] = {
350+
{ .name = "sys", .driver_data = (void *)TPS6586X_ID_SYS },
349351
{ .name = "sm0", .driver_data = (void *)TPS6586X_ID_SM_0 },
350352
{ .name = "sm1", .driver_data = (void *)TPS6586X_ID_SM_1 },
351353
{ .name = "sm2", .driver_data = (void *)TPS6586X_ID_SM_2 },
@@ -369,6 +371,7 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
369371
struct tps6586x_platform_data *pdata;
370372
struct tps6586x_subdev_info *devs;
371373
struct device_node *regs;
374+
const char *sys_rail_name = NULL;
372375
unsigned int count;
373376
unsigned int i, j;
374377
int err;
@@ -391,12 +394,22 @@ static struct tps6586x_platform_data *tps6586x_parse_dt(struct i2c_client *clien
391394
return NULL;
392395

393396
for (i = 0, j = 0; i < num && j < count; i++) {
397+
struct regulator_init_data *reg_idata;
398+
394399
if (!tps6586x_matches[i].init_data)
395400
continue;
396401

402+
reg_idata = tps6586x_matches[i].init_data;
397403
devs[j].name = "tps6586x-regulator";
398404
devs[j].platform_data = tps6586x_matches[i].init_data;
399405
devs[j].id = (int)tps6586x_matches[i].driver_data;
406+
if (devs[j].id == TPS6586X_ID_SYS)
407+
sys_rail_name = reg_idata->constraints.name;
408+
409+
if ((devs[j].id == TPS6586X_ID_LDO_5) ||
410+
(devs[j].id == TPS6586X_ID_LDO_RTC))
411+
reg_idata->supply_regulator = sys_rail_name;
412+
400413
devs[j].of_node = tps6586x_matches[i].of_node;
401414
j++;
402415
}

0 commit comments

Comments
 (0)