aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/regulator/anatop-regulator.txt29
-rw-r--r--drivers/regulator/anatop-regulator.c5
2 files changed, 32 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/regulator/anatop-regulator.txt b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
new file mode 100644
index 000000000000..357758cb6e92
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/anatop-regulator.txt
@@ -0,0 +1,29 @@
1Anatop Voltage regulators
2
3Required properties:
4- compatible: Must be "fsl,anatop-regulator"
5- anatop-reg-offset: Anatop MFD register offset
6- anatop-vol-bit-shift: Bit shift for the register
7- anatop-vol-bit-width: Number of bits used in the register
8- anatop-min-bit-val: Minimum value of this register
9- anatop-min-voltage: Minimum voltage of this regulator
10- anatop-max-voltage: Maximum voltage of this regulator
11
12Any property defined as part of the core regulator
13binding, defined in regulator.txt, can also be used.
14
15Example:
16
17 regulator-vddpu {
18 compatible = "fsl,anatop-regulator";
19 regulator-name = "vddpu";
20 regulator-min-microvolt = <725000>;
21 regulator-max-microvolt = <1300000>;
22 regulator-always-on;
23 anatop-reg-offset = <0x140>;
24 anatop-vol-bit-shift = <9>;
25 anatop-vol-bit-width = <5>;
26 anatop-min-bit-val = <1>;
27 anatop-min-voltage = <725000>;
28 anatop-max-voltage = <1300000>;
29 };
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c
index 17499a55113d..53969af17558 100644
--- a/drivers/regulator/anatop-regulator.c
+++ b/drivers/regulator/anatop-regulator.c
@@ -138,9 +138,10 @@ static int __devinit anatop_regulator_probe(struct platform_device *pdev)
138 rdesc->type = REGULATOR_VOLTAGE; 138 rdesc->type = REGULATOR_VOLTAGE;
139 rdesc->owner = THIS_MODULE; 139 rdesc->owner = THIS_MODULE;
140 sreg->mfd = anatopmfd; 140 sreg->mfd = anatopmfd;
141 ret = of_property_read_u32(np, "reg", &sreg->control_reg); 141 ret = of_property_read_u32(np, "anatop-reg-offset",
142 &sreg->control_reg);
142 if (ret) { 143 if (ret) {
143 dev_err(dev, "no reg property set\n"); 144 dev_err(dev, "no anatop-reg-offset property set\n");
144 goto anatop_probe_end; 145 goto anatop_probe_end;
145 } 146 }
146 ret = of_property_read_u32(np, "anatop-vol-bit-width", 147 ret = of_property_read_u32(np, "anatop-vol-bit-width",