Skip to content

Commit

Permalink
Merge branch 'regulator-5.2' into regulator-next
Browse files Browse the repository at this point in the history
  • Loading branch information
broonie committed May 6, 2019
2 parents c7b5128 + 4982094 commit e2a23af
Show file tree
Hide file tree
Showing 89 changed files with 1,323 additions and 2,770 deletions.
30 changes: 22 additions & 8 deletions Documentation/devicetree/bindings/regulator/gpio-regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,30 @@ Required properties:
- compatible : Must be "regulator-gpio".
- regulator-name : Defined in regulator.txt as optional, but required
here.
- states : Selection of available voltages and GPIO configs.
if there are no states, then use a fixed regulator
- gpios : Array of one or more GPIO pins used to select the
regulator voltage/current listed in "states".
- states : Selection of available voltages/currents provided by
this regulator and matching GPIO configurations to
achieve them. If there are no states in the "states"
array, use a fixed regulator instead.

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

Expand All @@ -30,7 +44,7 @@ Example:
regulator-max-microvolt = <2600000>;
regulator-boot-on;

enable-gpio = <&gpio0 23 0x4>;
enable-gpios = <&gpio0 23 0x4>;
gpios = <&gpio0 24 0x4
&gpio0 25 0x4>;
states = <1800000 0x3
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
STM32MP1 PWR Regulators
-----------------------

Available Regulators in STM32MP1 PWR block are:
- reg11 for regulator 1V1
- reg18 for regulator 1V8
- usb33 for the swtich USB3V3

Required properties:
- compatible: Must be "st,stm32mp1,pwr-reg"
- list of child nodes that specify the regulator reg11, reg18 or usb33
initialization data for defined regulators. The definition for each of
these nodes is defined using the standard binding for regulators found at
Documentation/devicetree/bindings/regulator/regulator.txt.
- vdd-supply: phandle to the parent supply/regulator node for vdd input
- vdd_3v3_usbfs-supply: phandle to the parent supply/regulator node for usb33

Example:

pwr_regulators: pwr@50001000 {
compatible = "st,stm32mp1,pwr-reg";
reg = <0x50001000 0x10>;
vdd-supply = <&vdd>;
vdd_3v3_usbfs-supply = <&vdd_usb>;

reg11: reg11 {
regulator-name = "reg11";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
};

reg18: reg18 {
regulator-name = "reg18";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};

usb33: usb33 {
regulator-name = "usb33";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
};
};
2 changes: 1 addition & 1 deletion drivers/mfd/wm831x-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/* Current settings - values are 2*2^(reg_val/4) microamps. These are
* exported since they are used by multiple drivers.
*/
int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
const unsigned int wm831x_isinkv_values[WM831X_ISINK_MAX_ISEL + 1] = {
2,
2,
3,
Expand Down
6 changes: 0 additions & 6 deletions drivers/mfd/wm8400-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ static bool wm8400_volatile(struct device *dev, unsigned int reg)
}
}

int wm8400_block_read(struct wm8400 *wm8400, u8 reg, int count, u16 *data)
{
return regmap_bulk_read(wm8400->regmap, reg, data, count);
}
EXPORT_SYMBOL_GPL(wm8400_block_read);

static int wm8400_register_codec(struct wm8400 *wm8400)
{
const struct mfd_cell cell = {
Expand Down
18 changes: 1 addition & 17 deletions drivers/regulator/88pm800.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ struct pm800_regulator_info {
int max_ua;
};

struct pm800_regulators {
struct pm80x_chip *chip;
struct regmap *map;
};

/*
* vreg - the buck regs string.
* ereg - the string for the enable register.
Expand Down Expand Up @@ -235,7 +230,6 @@ static int pm800_regulator_probe(struct platform_device *pdev)
{
struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent);
struct pm800_regulators *pm800_data;
struct regulator_config config = { };
struct regulator_init_data *init_data;
int i, ret;
Expand All @@ -252,18 +246,8 @@ static int pm800_regulator_probe(struct platform_device *pdev)
return -EINVAL;
}

pm800_data = devm_kzalloc(&pdev->dev, sizeof(*pm800_data),
GFP_KERNEL);
if (!pm800_data)
return -ENOMEM;

pm800_data->map = chip->subchip->regmap_power;
pm800_data->chip = chip;

platform_set_drvdata(pdev, pm800_data);

config.dev = chip->dev;
config.regmap = pm800_data->map;
config.regmap = chip->subchip->regmap_power;
for (i = 0; i < PM800_ID_RG_MAX; i++) {
struct regulator_dev *regulator;

Expand Down
43 changes: 9 additions & 34 deletions drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ static const struct regulator_ops pm8606_preg_ops = {
{ \
.desc = { \
.name = "PREG", \
.of_match = of_match_ptr("PREG"), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &pm8606_preg_ops, \
.type = REGULATOR_CURRENT, \
.id = PM8606_ID_PREG, \
Expand All @@ -249,6 +251,8 @@ static const struct regulator_ops pm8606_preg_ops = {
{ \
.desc = { \
.name = #vreg, \
.of_match = of_match_ptr(#vreg), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &pm8607_regulator_ops, \
.type = REGULATOR_VOLTAGE, \
.id = PM8607_ID_##vreg, \
Expand All @@ -270,6 +274,8 @@ static const struct regulator_ops pm8606_preg_ops = {
{ \
.desc = { \
.name = "LDO" #_id, \
.of_match = of_match_ptr("LDO" #_id), \
.regulators_node = of_match_ptr("regulators"), \
.ops = &pm8607_regulator_ops, \
.type = REGULATOR_VOLTAGE, \
.id = PM8607_ID_LDO##_id, \
Expand Down Expand Up @@ -309,36 +315,6 @@ static struct pm8607_regulator_info pm8606_regulator_info[] = {
PM8606_PREG(PREREGULATORB, 5),
};

#ifdef CONFIG_OF
static int pm8607_regulator_dt_init(struct platform_device *pdev,
struct pm8607_regulator_info *info,
struct regulator_config *config)
{
struct device_node *nproot, *np;
nproot = pdev->dev.parent->of_node;
if (!nproot)
return -ENODEV;
nproot = of_get_child_by_name(nproot, "regulators");
if (!nproot) {
dev_err(&pdev->dev, "failed to find regulators node\n");
return -ENODEV;
}
for_each_child_of_node(nproot, np) {
if (of_node_name_eq(np, info->desc.name)) {
config->init_data =
of_get_regulator_init_data(&pdev->dev, np,
&info->desc);
config->of_node = np;
break;
}
}
of_node_put(nproot);
return 0;
}
#else
#define pm8607_regulator_dt_init(x, y, z) (-1)
#endif

static int pm8607_regulator_probe(struct platform_device *pdev)
{
struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
Expand Down Expand Up @@ -373,12 +349,11 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
if ((i == PM8607_ID_BUCK3) && chip->buck3_double)
info->slope_double = 1;

config.dev = &pdev->dev;
config.dev = chip->dev;
config.driver_data = info;

if (pm8607_regulator_dt_init(pdev, info, &config))
if (pdata)
config.init_data = pdata;
if (pdata)
config.init_data = pdata;

if (chip->id == CHIP_PM8607)
config.regmap = chip->regmap;
Expand Down
11 changes: 10 additions & 1 deletion drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ config REGULATOR_CPCAP
config REGULATOR_DA903X
tristate "Dialog Semiconductor DA9030/DA9034 regulators"
depends on PMIC_DA903X
depends on !CC_IS_CLANG # https://bugs.llvm.org/show_bug.cgi?id=38789
help
Say y here to support the BUCKs and LDOs regulators found on
Dialog Semiconductor DA9030/DA9034 PMIC.
Expand Down Expand Up @@ -839,6 +840,13 @@ config REGULATOR_STM32_VREFBUF
This driver can also be built as a module. If so, the module
will be called stm32-vrefbuf.

config REGULATOR_STM32_PWR
bool "STMicroelectronics STM32 PWR"
depends on ARCH_STM32 || COMPILE_TEST
help
This driver supports internal regulators (1V1, 1V8, 3V3) in the
STMicroelectronics STM32 chips.

config REGULATOR_STPMIC1
tristate "STMicroelectronics STPMIC1 PMIC Regulators"
depends on MFD_STPMIC1
Expand Down Expand Up @@ -1010,7 +1018,8 @@ config REGULATOR_TWL4030
config REGULATOR_UNIPHIER
tristate "UniPhier regulator driver"
depends on ARCH_UNIPHIER || COMPILE_TEST
depends on OF && MFD_SYSCON
depends on OF
select REGMAP_MMIO
default ARCH_UNIPHIER
help
Support for regulators implemented on Socionext UniPhier SoCs.
Expand Down
1 change: 1 addition & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o
obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o
Expand Down
Loading

0 comments on commit e2a23af

Please sign in to comment.