diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-04 13:09:30 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-04-04 13:09:30 -0400 |
| commit | 4a1e8ebc5e5918079109cc1cd1c44c2f0fd0e11b (patch) | |
| tree | 3fcdeb8579c47735d82f44306282d7af2140a102 | |
| parent | 66cfb32772495068fbb5627b2dc88649ad66c3e5 (diff) | |
| parent | d49fe3c4cd22965de7422dd81d46110fc3d4deef (diff) | |
Merge tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown:
"A bunch of smallish fixes that came up during the merge window as
things got more testing - even more fixes from Axel, a fix for error
handling in more complex systems using -EPROBE_DEFER and a couple of
small fixes for the new dummy regulators."
* tag 'regulator-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: Remove non-existent parameter from fixed-helper.c kernel doc
regulator: Fix setting new voltage in s5m8767_set_voltage
regulator: fix sysfs name collision between dummy and fixed dummy regulator
regulator: Fix deadlock on removal of regulators with supplies
regulator: Fix comments in include/linux/regulator/machine.h
regulator: Only update [LDOx|DCx]_HIB_MODE bits in wm8350_[ldo|dcdc]_set_suspend_disable
regulator: Fix setting low power mode for wm831x aldo
regulator: Return microamps in wm8350_isink_get_current
regulator: wm8350: Fix the logic to choose best current limit setting
regulator: wm831x-isink: Fix the logic to choose best current limit setting
regulator: wm831x-dcdc: Fix the logic to choose best current limit setting
regulator: anatop: patching to device-tree property "reg".
regulator: Do proper shift to set correct bit for DC[2|5]_HIB_MODE setting
regulator: Fix restoring pmic.dcdcx_hib_mode settings in wm8350_dcdc_set_suspend_enable
regulator: Fix unbalanced lock/unlock in mc13892_regulator_probe error path
regulator: Fix set and get current limit for wm831x_buckv
regulator: tps6586x: Fix list minimal voltage setting for LDO0
| -rw-r--r-- | Documentation/devicetree/bindings/regulator/anatop-regulator.txt | 29 | ||||
| -rw-r--r-- | drivers/regulator/anatop-regulator.c | 5 | ||||
| -rw-r--r-- | drivers/regulator/core.c | 4 | ||||
| -rw-r--r-- | drivers/regulator/fixed-helper.c | 3 | ||||
| -rw-r--r-- | drivers/regulator/mc13892-regulator.c | 10 | ||||
| -rw-r--r-- | drivers/regulator/s5m8767.c | 14 | ||||
| -rw-r--r-- | drivers/regulator/tps6586x-regulator.c | 5 | ||||
| -rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 9 | ||||
| -rw-r--r-- | drivers/regulator/wm831x-isink.c | 2 | ||||
| -rw-r--r-- | drivers/regulator/wm831x-ldo.c | 7 | ||||
| -rw-r--r-- | drivers/regulator/wm8350-regulator.c | 34 | ||||
| -rw-r--r-- | include/linux/regulator/machine.h | 8 |
12 files changed, 81 insertions, 49 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 @@ | |||
| 1 | Anatop Voltage regulators | ||
| 2 | |||
| 3 | Required 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 | |||
| 12 | Any property defined as part of the core regulator | ||
| 13 | binding, defined in regulator.txt, can also be used. | ||
| 14 | |||
| 15 | Example: | ||
| 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", |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c056abd7562a..e70dd382a009 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -2992,14 +2992,14 @@ void regulator_unregister(struct regulator_dev *rdev) | |||
| 2992 | if (rdev == NULL) | 2992 | if (rdev == NULL) |
| 2993 | return; | 2993 | return; |
| 2994 | 2994 | ||
| 2995 | if (rdev->supply) | ||
| 2996 | regulator_put(rdev->supply); | ||
| 2995 | mutex_lock(®ulator_list_mutex); | 2997 | mutex_lock(®ulator_list_mutex); |
| 2996 | debugfs_remove_recursive(rdev->debugfs); | 2998 | debugfs_remove_recursive(rdev->debugfs); |
| 2997 | flush_work_sync(&rdev->disable_work.work); | 2999 | flush_work_sync(&rdev->disable_work.work); |
| 2998 | WARN_ON(rdev->open_count); | 3000 | WARN_ON(rdev->open_count); |
| 2999 | unset_regulator_supplies(rdev); | 3001 | unset_regulator_supplies(rdev); |
| 3000 | list_del(&rdev->list); | 3002 | list_del(&rdev->list); |
| 3001 | if (rdev->supply) | ||
| 3002 | regulator_put(rdev->supply); | ||
| 3003 | kfree(rdev->constraints); | 3003 | kfree(rdev->constraints); |
| 3004 | device_unregister(&rdev->dev); | 3004 | device_unregister(&rdev->dev); |
| 3005 | mutex_unlock(®ulator_list_mutex); | 3005 | mutex_unlock(®ulator_list_mutex); |
diff --git a/drivers/regulator/fixed-helper.c b/drivers/regulator/fixed-helper.c index 30d0a15b8949..cacd33c9d042 100644 --- a/drivers/regulator/fixed-helper.c +++ b/drivers/regulator/fixed-helper.c | |||
| @@ -18,7 +18,6 @@ static void regulator_fixed_release(struct device *dev) | |||
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | * regulator_register_fixed - register a no-op fixed regulator | 20 | * regulator_register_fixed - register a no-op fixed regulator |
| 21 | * @name: supply name | ||
| 22 | * @id: platform device id | 21 | * @id: platform device id |
| 23 | * @supplies: consumers for this regulator | 22 | * @supplies: consumers for this regulator |
| 24 | * @num_supplies: number of consumers | 23 | * @num_supplies: number of consumers |
| @@ -32,7 +31,7 @@ struct platform_device *regulator_register_fixed(int id, | |||
| 32 | if (!data) | 31 | if (!data) |
| 33 | return NULL; | 32 | return NULL; |
| 34 | 33 | ||
| 35 | data->cfg.supply_name = "dummy"; | 34 | data->cfg.supply_name = "fixed-dummy"; |
| 36 | data->cfg.microvolts = 0; | 35 | data->cfg.microvolts = 0; |
| 37 | data->cfg.gpio = -EINVAL; | 36 | data->cfg.gpio = -EINVAL; |
| 38 | data->cfg.enabled_at_boot = 1; | 37 | data->cfg.enabled_at_boot = 1; |
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index e8cfc99dd8f0..845aa2263b8a 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c | |||
| @@ -552,7 +552,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
| 552 | mc13xxx_lock(mc13892); | 552 | mc13xxx_lock(mc13892); |
| 553 | ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val); | 553 | ret = mc13xxx_reg_read(mc13892, MC13892_REVISION, &val); |
| 554 | if (ret) | 554 | if (ret) |
| 555 | goto err_free; | 555 | goto err_unlock; |
| 556 | 556 | ||
| 557 | /* enable switch auto mode */ | 557 | /* enable switch auto mode */ |
| 558 | if ((val & 0x0000FFFF) == 0x45d0) { | 558 | if ((val & 0x0000FFFF) == 0x45d0) { |
| @@ -562,7 +562,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
| 562 | MC13892_SWITCHERS4_SW1MODE_AUTO | | 562 | MC13892_SWITCHERS4_SW1MODE_AUTO | |
| 563 | MC13892_SWITCHERS4_SW2MODE_AUTO); | 563 | MC13892_SWITCHERS4_SW2MODE_AUTO); |
| 564 | if (ret) | 564 | if (ret) |
| 565 | goto err_free; | 565 | goto err_unlock; |
| 566 | 566 | ||
| 567 | ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5, | 567 | ret = mc13xxx_reg_rmw(mc13892, MC13892_SWITCHERS5, |
| 568 | MC13892_SWITCHERS5_SW3MODE_M | | 568 | MC13892_SWITCHERS5_SW3MODE_M | |
| @@ -570,7 +570,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
| 570 | MC13892_SWITCHERS5_SW3MODE_AUTO | | 570 | MC13892_SWITCHERS5_SW3MODE_AUTO | |
| 571 | MC13892_SWITCHERS5_SW4MODE_AUTO); | 571 | MC13892_SWITCHERS5_SW4MODE_AUTO); |
| 572 | if (ret) | 572 | if (ret) |
| 573 | goto err_free; | 573 | goto err_unlock; |
| 574 | } | 574 | } |
| 575 | mc13xxx_unlock(mc13892); | 575 | mc13xxx_unlock(mc13892); |
| 576 | 576 | ||
| @@ -612,10 +612,10 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
| 612 | err: | 612 | err: |
| 613 | while (--i >= 0) | 613 | while (--i >= 0) |
| 614 | regulator_unregister(priv->regulators[i]); | 614 | regulator_unregister(priv->regulators[i]); |
| 615 | return ret; | ||
| 615 | 616 | ||
| 616 | err_free: | 617 | err_unlock: |
| 617 | mc13xxx_unlock(mc13892); | 618 | mc13xxx_unlock(mc13892); |
| 618 | |||
| 619 | return ret; | 619 | return ret; |
| 620 | } | 620 | } |
| 621 | 621 | ||
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c index 58447db15de1..4ca2db059004 100644 --- a/drivers/regulator/s5m8767.c +++ b/drivers/regulator/s5m8767.c | |||
| @@ -311,8 +311,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev, | |||
| 311 | struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); | 311 | struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); |
| 312 | const struct s5m_voltage_desc *desc; | 312 | const struct s5m_voltage_desc *desc; |
| 313 | int reg_id = rdev_get_id(rdev); | 313 | int reg_id = rdev_get_id(rdev); |
| 314 | int reg, mask, ret; | 314 | int sel, reg, mask, ret; |
| 315 | int i; | ||
| 316 | u8 val; | ||
