Skip to content

Commit 61be53f

Browse files
committed
Merge tag 'regulator-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "In terms of big picture changes this has been an extremely quiet release however there's a lot of changes and a fairly big diffstat thanks to a bunch of small fixes, mainly coming from Axel Lin. Thanks to his work this release removes code overall even though we've added a new (albiet fairly small) driver. Notable things: - A fix for a long standing issue with locking on error interrupts from Steve Twiss. - A new driver for ST Microelectonics STM32 PWR" * tag 'regulator-v5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (134 commits) regulator: core: simplify return value on suported_voltage regulator: da9xxx: Switch to SPDX identifier regulator: stm32-pwr: Remove unneeded .min_uV and .list_volage regulator: stm32-pwr: Remove unneeded *desc from struct stm32_pwr_reg regulator: ab3100: Set fixed_uV instead of min_uV for fixed regulators regulator: ab3100: Constify regulator_ops and ab3100_regulator_desc regulator: pv880x0: Switch to SPDX identifier regulator: hi6xxx: Switch to SPDX identifier regulator: vexpress: Switch to SPDX identifier regulator: vexpress: Get rid of struct vexpress_regulator regulator: sky81452: Switch to SPDX identifier regulator: sky81452: Constify sky81452_reg_ops regulator: sy8106a: Get rid of struct sy8106a regulator: core: do not report EPROBE_DEFER as error but as debug regulator: mt63xx: Switch to SPDX identifier regulator: fan53555: Switch to SPDX identifier regulator: fan53555: Clean up unneeded fields from struct fan53555_device_info regulator: ltc3589: Switch to SPDX identifier regulator: ltc3589: Get rid of struct ltc3589_regulator regulator: ltc3589: Convert to use simplified DT parsing ...
2 parents 962d5ec + e2a23af commit 61be53f

File tree

90 files changed

+1332
-2780
lines changed

Some content is hidden

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

90 files changed

+1332
-2780
lines changed

Documentation/devicetree/bindings/regulator/gpio-regulator.txt

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,30 @@ Required properties:
44
- compatible : Must be "regulator-gpio".
55
- regulator-name : Defined in regulator.txt as optional, but required
66
here.
7-
- states : Selection of available voltages and GPIO configs.
8-
if there are no states, then use a fixed regulator
7+
- gpios : Array of one or more GPIO pins used to select the
8+
regulator voltage/current listed in "states".
9+
- states : Selection of available voltages/currents provided by
10+
this regulator and matching GPIO configurations to
11+
achieve them. If there are no states in the "states"
12+
array, use a fixed regulator instead.
913

1014
Optional properties:
11-
- enable-gpio : GPIO to use to enable/disable the regulator.
12-
- gpios : GPIO group used to control voltage.
13-
- gpios-states : gpios pin's initial states array. 0: LOW, 1: HIGH.
14-
defualt is LOW if nothing is specified.
15+
- enable-gpios : GPIO used to enable/disable the regulator.
16+
Warning, the GPIO phandle flags are ignored and the
17+
GPIO polarity is controlled solely by the presence
18+
of "enable-active-high" DT property. This is due to
19+
compatibility with old DTs.
20+
- enable-active-high : Polarity of "enable-gpio" GPIO is active HIGH.
21+
Default is active LOW.
22+
- gpios-states : On operating systems, that don't support reading back
23+
gpio values in output mode (most notably linux), this
24+
array provides the state of GPIO pins set when
25+
requesting them from the gpio controller. Systems,
26+
that are capable of preserving state when requesting
27+
the lines, are free to ignore this property.
28+
0: LOW, 1: HIGH. Default is LOW if nothing else
29+
is specified.
1530
- startup-delay-us : Startup time in microseconds.
16-
- enable-active-high : Polarity of GPIO is active high (default is low).
1731
- regulator-type : Specifies what is being regulated, must be either
1832
"voltage" or "current", defaults to voltage.
1933

@@ -30,7 +44,7 @@ Example:
3044
regulator-max-microvolt = <2600000>;
3145
regulator-boot-on;
3246

33-
enable-gpio = <&gpio0 23 0x4>;
47+
enable-gpios = <&gpio0 23 0x4>;
3448
gpios = <&gpio0 24 0x4
3549
&gpio0 25 0x4>;
3650
states = <1800000 0x3
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
STM32MP1 PWR Regulators
2+
-----------------------
3+
4+
Available Regulators in STM32MP1 PWR block are:
5+
- reg11 for regulator 1V1
6+
- reg18 for regulator 1V8
7+
- usb33 for the swtich USB3V3
8+
9+
Required properties:
10+
- compatible: Must be "st,stm32mp1,pwr-reg"
11+
- list of child nodes that specify the regulator reg11, reg18 or usb33
12+
initialization data for defined regulators. The definition for each of
13+
these nodes is defined using the standard binding for regulators found at
14+
Documentation/devicetree/bindings/regulator/regulator.txt.
15+
- vdd-supply: phandle to the parent supply/regulator node for vdd input
16+
- vdd_3v3_usbfs-supply: phandle to the parent supply/regulator node for usb33
17+
18+
Example:
19+
20+
pwr_regulators: pwr@50001000 {
21+
compatible = "st,stm32mp1,pwr-reg";
22+
reg = <0x50001000 0x10>;
23+
vdd-supply = <&vdd>;
24+
vdd_3v3_usbfs-supply = <&vdd_usb>;
25+
26+
reg11: reg11 {
27+
regulator-name = "reg11";
28+
regulator-min-microvolt = <1100000>;
29+
regulator-max-microvolt = <1100000>;
30+
};
31+
32+
reg18: reg18 {
33+
regulator-name = "reg18";
34+
regulator-min-microvolt = <1800000>;
35+
regulator-max-microvolt = <1800000>;
36+
};
37+
38+
usb33: usb33 {
39+
regulator-name = "usb33";
40+
regulator-min-microvolt = <3300000>;
41+
regulator-max-microvolt = <3300000>;
42+
};
43+
};

drivers/mfd/wm831x-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* Current settings - values are 2*2^(reg_val/4) microamps. These are
3535
* exported since they are used by multiple drivers.
3636
*/
37-
int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
37+
const unsigned int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
3838
2,
3939
2,
4040
3,

drivers/mfd/wm8400-core.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ static bool wm8400_volatile(struct device *dev, unsigned int reg)
3535
}
3636
}
3737

38-
int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data)
39-
{
40-
return regmap_bulk_read(wm8400->regmap, reg, data, count);
41-
}
42-
EXPORT_SYMBOL_GPL(wm8400_block_read);
43-
4438
static int wm8400_register_codec(struct wm8400 *wm8400)
4539
{
4640
const struct mfd_cell cell = {

drivers/regulator/88pm800.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@ struct pm800_regulator_info {
7777
int max_ua;
7878
};
7979

80-
struct pm800_regulators {
81-
struct pm80x_chip *chip;
82-
struct regmap *map;
83-
};
84-
8580
/*
8681
* vreg - the buck regs string.
8782
* ereg - the string for the enable register.
@@ -235,7 +230,6 @@ static int pm800_regulator_probe(struct platform_device *pdev)
235230
{
236231
struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
237232
struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent);
238-
struct pm800_regulators *pm800_data;
239233
struct regulator_config config = { };
240234
struct regulator_init_data *init_data;
241235
int i, ret;
@@ -252,18 +246,8 @@ static int pm800_regulator_probe(struct platform_device *pdev)
252246
return -EINVAL;
253247
}
254248

255-
pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
256-
GFP_KERNEL);
257-
if (!pm800_data)
258-
return -ENOMEM;
259-
260-
pm800_data->map = chip->subchip->regmap_power;
261-
pm800_data->chip = chip;
262-
263-
platform_set_drvdata(pdev, pm800_data);
264-
265249
config.dev = chip->dev;
266-
config.regmap = pm800_data->map;
250+
config.regmap = chip->subchip->regmap_power;
267251
for (i = 0; i < PM800_ID_RG_MAX; i++) {
268252
struct regulator_dev *regulator;
269253

drivers/regulator/88pm8607.c

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ static const struct regulator_ops pm8606_preg_ops = {
235235
{ \
236236
.desc = { \
237237
.name = "PREG", \
238+
.of_match = of_match_ptr("PREG"), \
239+
.regulators_node = of_match_ptr("regulators"), \
238240
.ops = &pm8606_preg_ops, \
239241
.type = REGULATOR_CURRENT, \
240242
.id = PM8606_ID_PREG, \
@@ -249,6 +251,8 @@ static const struct regulator_ops pm8606_preg_ops = {
249251
{ \
250252
.desc = { \
251253
.name = #vreg, \
254+
.of_match = of_match_ptr(#vreg), \
255+
.regulators_node = of_match_ptr("regulators"), \
252256
.ops = &pm8607_regulator_ops, \
253257
.type = REGULATOR_VOLTAGE, \
254258
.id = PM8607_ID_##vreg, \
@@ -270,6 +274,8 @@ static const struct regulator_ops pm8606_preg_ops = {
270274
{ \
271275
.desc = { \
272276
.name = "LDO" #_id, \
277+
.of_match = of_match_ptr("LDO" #_id), \
278+
.regulators_node = of_match_ptr("regulators"), \
273279
.ops = &pm8607_regulator_ops, \
274280
.type = REGULATOR_VOLTAGE, \
275281
.id = PM8607_ID_LDO##_id, \
@@ -309,36 +315,6 @@ static struct pm8607_regulator_info pm8606_regulator_info[] = {
309315
PM8606_PREG(PREREGULATORB, 5),
310316
};
311317

312-
#ifdef CONFIG_OF
313-
static int pm8607_regulator_dt_init(struct platform_device *pdev,
314-
struct pm8607_regulator_info *info,
315-
struct regulator_config *config)
316-
{
317-
struct device_node *nproot, *np;
318-
nproot = pdev->dev.parent->of_node;
319-
if (!nproot)
320-
return -ENODEV;
321-
nproot = of_get_child_by_name(nproot, "regulators");
322-
if (!nproot) {
323-
dev_err(&pdev->dev, "failed to find regulators node\n");
324-
return -ENODEV;
325-
}
326-
for_each_child_of_node(nproot, np) {
327-
if (of_node_name_eq(np, info->desc.name)) {
328-
config->init_data =
329-
of_get_regulator_init_data(&pdev->dev, np,
330-
&info->desc);
331-
config->of_node = np;
332-
break;
333-
}
334-
}
335-
of_node_put(nproot);
336-
return 0;
337-
}
338-
#else
339-
#define pm8607_regulator_dt_init(x, y, z) (-1)
340-
#endif
341-
342318
static int pm8607_regulator_probe(struct platform_device *pdev)
343319
{
344320
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
@@ -373,12 +349,11 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
373349
if ((i == PM8607_ID_BUCK3) && chip->buck3_double)
374350
info->slope_double = 1;
375351

376-
config.dev = &pdev->dev;
352+
config.dev = chip->dev;
377353
config.driver_data = info;
378354

379-
if (pm8607_regulator_dt_init(pdev, info, &config))
380-
if (pdata)
381-
config.init_data = pdata;
355+
if (pdata)
356+
config.init_data = pdata;
382357

383358
if (chip->id == CHIP_PM8607)
384359
config.regmap = chip->regmap;

drivers/regulator/Kconfig

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ config REGULATOR_CPCAP
223223
config REGULATOR_DA903X
224224
tristate "Dialog Semiconductor DA9030/DA9034 regulators"
225225
depends on PMIC_DA903X
226+
depends on !CC_IS_CLANG # https://bugs.llvm.org/show_bug.cgi?id=38789
226227
help
227228
Say y here to support the BUCKs and LDOs regulators found on
228229
Dialog Semiconductor DA9030/DA9034 PMIC.
@@ -839,6 +840,13 @@ config REGULATOR_STM32_VREFBUF
839840
This driver can also be built as a module. If so, the module
840841
will be called stm32-vrefbuf.
841842

843+
config REGULATOR_STM32_PWR
844+
bool "STMicroelectronics STM32 PWR"
845+
depends on ARCH_STM32 || COMPILE_TEST
846+
help
847+
This driver supports internal regulators (1V1, 1V8, 3V3) in the
848+
STMicroelectronics STM32 chips.
849+
842850
config REGULATOR_STPMIC1
843851
tristate "STMicroelectronics STPMIC1 PMIC Regulators"
844852
depends on MFD_STPMIC1
@@ -1010,7 +1018,8 @@ config REGULATOR_TWL4030
10101018
config REGULATOR_UNIPHIER
10111019
tristate "UniPhier regulator driver"
10121020
depends on ARCH_UNIPHIER || COMPILE_TEST
1013-
depends on OF && MFD_SYSCON
1021+
depends on OF
1022+
select REGMAP_MMIO
10141023
default ARCH_UNIPHIER
10151024
help
10161025
Support for regulators implemented on Socionext UniPhier SoCs.

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
105105
obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
106106
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
107107
obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
108+
obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o
108109
obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o
109110
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
110111
obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o

0 commit comments

Comments
 (0)