Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/broonie/regulator

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (40 commits)
  regulator: set constraints.apply_uV to 0 in of_get_fixed_voltage_config
  regulator: max8925: fix enabled/disabled judgement mistake
  regulator: add regulator_bulk_force_disable function
  regulator: pass regulator_register of_node in fixed voltage driver
  regulator: add regulator_force_disable() definition for !CONFIG_REGULATOR
  regulator: Enable supply regulator if child rail is enabled.
  regulator: mc13892: Convert to devm_kzalloc()
  regulator: mc13783: Convert to devm_kzalloc()
  regulator: Fix checking return value of create_regulator
  regulator: Fix the error handling if create_regulator fails
  regulator: Export regulator_is_supported_voltage()
  regulator: mc13892: add device tree probe support
  regulator: mc13892: remove the unnecessary prefix from regulator name
  regulator: Convert wm831x regulator drivers to devm_kzalloc()
  regulator: da9052: Staticize non-exported symbols
  regulator: Replace kzalloc with devm_kzalloc and if-else with a switch-case for da9052-regulator
  regulator: Update da9052-regulator for DT changes
  regulator: DA9052/53 Regulator support
  regulator: pass device_node to of_get_regulator_init_data()
  regulator: If a single voltage is set with device tree then set apply_uV
  ...
  • Loading branch information
torvalds committed Jan 10, 2012
2 parents d52739c + 0c437c4 commit 269d430
Show file tree
Hide file tree
Showing 57 changed files with 1,368 additions and 341 deletions.
29 changes: 29 additions & 0 deletions Documentation/devicetree/bindings/regulator/fixed-regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Fixed Voltage regulators

Required properties:
- compatible: Must be "regulator-fixed";

Optional properties:
- gpio: gpio to use for enable control
- startup-delay-us: startup time in microseconds
- enable-active-high: Polarity of GPIO is Active high
If this property is missing, the default assumed is Active low.

Any property defined as part of the core regulator
binding, defined in regulator.txt, can also be used.
However a fixed voltage regulator is expected to have the
regulator-min-microvolt and regulator-max-microvolt
to be the same.

Example:

abc: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio1 16 0>;
startup-delay-us = <70000>;
enable-active-high;
regulator-boot-on
};
54 changes: 54 additions & 0 deletions Documentation/devicetree/bindings/regulator/regulator.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Voltage/Current Regulators

Optional properties:
- regulator-name: A string used as a descriptive name for regulator outputs
- regulator-min-microvolt: smallest voltage consumers may set
- regulator-max-microvolt: largest voltage consumers may set
- regulator-microvolt-offset: Offset applied to voltages to compensate for voltage drops
- regulator-min-microamp: smallest current consumers may set
- regulator-max-microamp: largest current consumers may set
- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator
- <name>-supply: phandle to the parent supply/regulator node

Example:

xyzreg: regulator@0 {
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <2500000>;
regulator-always-on;
vin-supply = <&vin>;
};

Regulator Consumers:
Consumer nodes can reference one or more of its supplies/
regulators using the below bindings.

- <name>-supply: phandle to the regulator node

These are the same bindings that a regulator in the above
example used to reference its own supply, in which case
its just seen as a special case of a regulator being a
consumer itself.

Example of a consumer device node (mmc) referencing two
regulators (twl_reg1 and twl_reg2),

twl_reg1: regulator@0 {
...
...
...
};

twl_reg2: regulator@1 {
...
...
...
};

mmc: mmc@0x0 {
...
...
vmmc-supply = <&twl_reg1>;
vmmcaux-supply = <&twl_reg2>;
};
2 changes: 1 addition & 1 deletion Documentation/power/regulator/regulator.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Drivers can register a regulator by calling :-

struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc,
struct device *dev, struct regulator_init_data *init_data,
void *driver_data);
void *driver_data, struct device_node *of_node);

This will register the regulators capabilities and operations to the regulator
core.
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/88pm8607.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)

/* replace driver_data with info */
info->regulator = regulator_register(&info->desc, &pdev->dev,
pdata, info);
pdata, info, NULL);
if (IS_ERR(info->regulator)) {
dev_err(&pdev->dev, "failed to register regulator %s\n",
info->desc.name);
Expand Down
8 changes: 8 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ config REGULATOR_MAX1586
config REGULATOR_MAX8649
tristate "Maxim 8649 voltage regulator"
depends on I2C
select REGMAP_I2C
help
This driver controls a Maxim 8649 voltage output regulator via
I2C bus.
Expand Down Expand Up @@ -177,6 +178,13 @@ config REGULATOR_DA903X
Say y here to support the BUCKs and LDOs regulators found on
Dialog Semiconductor DA9030/DA9034 PMIC.

config REGULATOR_DA9052
tristate "Dialog DA9052/DA9053 regulators"
depends on PMIC_DA9052
help
This driver supports the voltage regulators of DA9052-BC and
DA9053-AA/Bx PMIC.

config REGULATOR_PCF50633
tristate "PCF50633 regulator driver"
depends on MFD_PCF50633
Expand Down
2 changes: 2 additions & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


obj-$(CONFIG_REGULATOR) += core.o dummy.o
obj-$(CONFIG_OF) += of_regulator.o
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
obj-$(CONFIG_REGULATOR_USERSPACE_CONSUMER) += userspace-consumer.o
Expand All @@ -29,6 +30,7 @@ obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
obj-$(CONFIG_REGULATOR_TPS6586X) += tps6586x-regulator.o
obj-$(CONFIG_REGULATOR_DA903X) += da903x.o
obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o
obj-$(CONFIG_REGULATOR_PCF50633) += pcf50633-regulator.o
obj-$(CONFIG_REGULATOR_PCAP) += pcap-regulator.o
obj-$(CONFIG_REGULATOR_MC13783) += mc13783-regulator.o
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/aat2870-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static int aat2870_ldo_set_voltage_sel(struct regulator_dev *rdev,
struct aat2870_data *aat2870 = dev_get_drvdata(ri->pdev->dev.parent);

return aat2870->update(aat2870, ri->voltage_addr, ri->voltage_mask,
(selector << ri->voltage_shift) & ri->voltage_mask);
selector << ri->voltage_shift);
}

static int aat2870_ldo_get_voltage_sel(struct regulator_dev *rdev)
Expand Down Expand Up @@ -188,7 +188,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
ri->pdev = pdev;

rdev = regulator_register(&ri->desc, &pdev->dev,
pdev->dev.platform_data, ri);
pdev->dev.platform_data, ri, NULL);
if (IS_ERR(rdev)) {
dev_err(&pdev->dev, "Failed to register regulator %s\n",
ri->desc.name);
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/ab3100.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
rdev = regulator_register(&ab3100_regulator_desc[i],
&pdev->dev,
&plfdata->reg_constraints[i],
reg);
reg, NULL);

if (IS_ERR(rdev)) {
err = PTR_ERR(rdev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev)

/* register regulator with framework */
info->regulator = regulator_register(&info->desc, &pdev->dev,
&pdata->regulator[i], info);
&pdata->regulator[i], info, NULL);
if (IS_ERR(info->regulator)) {
err = PTR_ERR(info->regulator);
dev_err(&pdev->dev, "failed to register regulator %s\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/ad5398.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ static int __devinit ad5398_probe(struct i2c_client *client,
chip->current_mask = (chip->current_level - 1) << chip->current_offset;

chip->rdev = regulator_register(&ad5398_reg, &client->dev,
init_data, chip);
init_data, chip, NULL);
if (IS_ERR(chip->rdev)) {
ret = PTR_ERR(chip->rdev);
dev_err(&client->dev, "failed to register %s %s\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/regulator/bq24022.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int __init bq24022_probe(struct platform_device *pdev)
ret = gpio_direction_output(pdata->gpio_nce, 1);

bq24022 = regulator_register(&bq24022_desc, &pdev->dev,
pdata->init_data, pdata);
pdata->init_data, pdata, NULL);
if (IS_ERR(bq24022)) {
dev_dbg(&pdev->dev, "couldn't register regulator\n");
ret = PTR_ERR(bq24022);
Expand Down
Loading

0 comments on commit 269d430

Please sign in to comment.