Skip to content

Commit

Permalink
Merge tag 'regulator-3.9-rc1' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
 "A few small things here and there, nothing major here really.  The
  conversion of twl4030ldo_ops to get_voltage_sel is a fix, as covered
  in the commit log it fixes inconsistency in handling of the IS_UNSUP()
  feature in the driver."

* tag 'regulator-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: fixed regulator_bulk_enable unwinding code
  regulator: twl: Convert twl4030ldo_ops to get_voltage_sel
  regulator: palmas: fix number of SMPS voltages
  regulator: core: fix documentation error in regulator_allow_bypass
  regulator: core: update kernel documentation for regulator_desc
  regulator: db8500-prcmu - remove incorrect __exit markup
  • Loading branch information
Linus Torvalds committed Mar 7, 2013
2 parents 0c8150d + 8870d40 commit d345243
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
12 changes: 8 additions & 4 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,7 @@ EXPORT_SYMBOL_GPL(regulator_get_bypass_regmap);
* regulator_allow_bypass - allow the regulator to go into bypass mode
*
* @regulator: Regulator to configure
* @allow: enable or disable bypass mode
* @enable: enable or disable bypass mode
*
* Allow the regulator to go into bypass mode if all other consumers
* for the regulator also enable bypass mode and the machine
Expand Down Expand Up @@ -3057,9 +3057,13 @@ int regulator_bulk_enable(int num_consumers,
return 0;

err:
pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret);
while (--i >= 0)
regulator_disable(consumers[i].consumer);
for (i = 0; i < num_consumers; i++) {
if (consumers[i].ret < 0)
pr_err("Failed to enable %s: %d\n", consumers[i].supply,
consumers[i].ret);
else
regulator_disable(consumers[i].consumer);
}

return ret;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/regulator/db8500-prcmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int db8500_regulator_probe(struct platform_device *pdev)
return 0;
}

static int __exit db8500_regulator_remove(struct platform_device *pdev)
static int db8500_regulator_remove(struct platform_device *pdev)
{
int i;

Expand All @@ -553,7 +553,7 @@ static struct platform_driver db8500_regulator_driver = {
.owner = THIS_MODULE,
},
.probe = db8500_regulator_probe,
.remove = __exit_p(db8500_regulator_remove),
.remove = db8500_regulator_remove,
};

static int __init db8500_regulator_init(void)
Expand Down
3 changes: 2 additions & 1 deletion drivers/regulator/palmas-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright 2011-2012 Texas Instruments Inc.
*
* Author: Graeme Gregory <gg@slimlogic.co.uk>
* Author: Ian Lartey <ian@slimlogic.co.uk>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -156,7 +157,7 @@ static const struct regs_info palmas_regs_info[] = {
*
* So they are basically (maxV-minV)/stepV
*/
#define PALMAS_SMPS_NUM_VOLTAGES 116
#define PALMAS_SMPS_NUM_VOLTAGES 117
#define PALMAS_SMPS10_NUM_VOLTAGES 2
#define PALMAS_LDO_NUM_VOLTAGES 50

Expand Down
9 changes: 4 additions & 5 deletions drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,24 +471,23 @@ twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
selector);
}

static int twl4030ldo_get_voltage(struct regulator_dev *rdev)
static int twl4030ldo_get_voltage_sel(struct regulator_dev *rdev)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);
int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER,
VREG_VOLTAGE);
int vsel = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE);

if (vsel < 0)
return vsel;

vsel &= info->table_len - 1;
return LDO_MV(info->table[vsel]) * 1000;
return vsel;
}

static struct regulator_ops twl4030ldo_ops = {
.list_voltage = twl4030ldo_list_voltage,

.set_voltage_sel = twl4030ldo_set_voltage_sel,
.get_voltage = twl4030ldo_get_voltage,
.get_voltage_sel = twl4030ldo_get_voltage_sel,

.enable = twl4030reg_enable,
.disable = twl4030reg_disable,
Expand Down
2 changes: 2 additions & 0 deletions include/linux/regulator/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ enum regulator_type {
* output when using regulator_set_voltage_sel_regmap
* @enable_reg: Register for control when using regmap enable/disable ops
* @enable_mask: Mask for control when using regmap enable/disable ops
* @bypass_reg: Register for control when using regmap set_bypass
* @bypass_mask: Mask for control when using regmap set_bypass
*
* @enable_time: Time taken for initial enable of regulator (in uS).
*/
Expand Down

0 comments on commit d345243

Please sign in to comment.