Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282165
b: refs/heads/master
c: 8f446e6
h: refs/heads/master
i:
  282163: 3e771eb
v: v3
  • Loading branch information
Rajendra Nayak authored and Mark Brown committed Nov 23, 2011
1 parent 4ba30bc commit 2eae4f5
Show file tree
Hide file tree
Showing 12 changed files with 349 additions and 144 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 68aaa37d0e8232d62a7e9411699e0dc005750186
refs/heads/master: 8f446e6fa1d506be2cb80f91c214f1705327c7f9
54 changes: 54 additions & 0 deletions trunk/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>;
};
1 change: 0 additions & 1 deletion trunk/drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ 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
1 change: 1 addition & 0 deletions trunk/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 Down
3 changes: 1 addition & 2 deletions trunk/drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2503,8 +2503,7 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
int status = 0;

/* some attributes need specific methods to be displayed */
if ((ops->get_voltage && ops->get_voltage(rdev) >= 0) ||
(ops->get_voltage_sel && ops->get_voltage_sel(rdev) >= 0)) {
if (ops->get_voltage || ops->get_voltage_sel) {
status = device_create_file(dev, &dev_attr_microvolts);
if (status < 0)
return status;
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);

if (data->microvolts)
return data->microvolts;
else
return -EINVAL;
return data->microvolts;
}

static int fixed_voltage_list_voltage(struct regulator_dev *dev,
Expand Down
Loading

0 comments on commit 2eae4f5

Please sign in to comment.