diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 08:58:47 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-01 08:58:47 -0700 |
commit | aae6f989c6e97ff8197717fa4d032ad4eba091a7 (patch) | |
tree | 3908e2748a91045688a4778872785b8b0660d073 /drivers/regulator/wm831x-dcdc.c | |
parent | b34e5f55a1e6667a800280fc4045632c139b4e4e (diff) | |
parent | 6a2027abd2048f7f7fdcc6e11ff10b3d9b0d0899 (diff) |
Merge tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown:
- Support for putting regulators into bypass mode where they simply
switch their input to the output (mainly used for low power
retention).
- A new API for setting voltages based on a voltage plus tolerance
rather than an explicit voltage range.
- Lots of cleanups and API updates from Axel Lin.
- New driver for MAX8907.
* tag 'regulator-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (71 commits)
regulator: arizona-ldo: Remove top voltage
regulator: tps6586x: remove regulator-compatible from DT docs
regulator: tps65217.txt: remove regulator-compatible from DT docs
regulator: deprecate regulator-compatible DT property
regulator: fan53555: remove vsel_max not used
regulator: aat2870: Don't explicitly initialise the first field
extcon: arizona: Use bypass mode for MICVDD
regulator: wm831x-ldo: Add bypass support
regulator: arizona-micsupp: Support get/set bypass
regulator: arizona-ldo: Support get/set bypass
regulator: core: Provide regmap get/set bypass operations
regulator: core: Support bypass mode
regulator: Fairchild fan53555 support
regulator: twl: Remove another unused variable warning
regulator: core: Try using the parent device for the default regmap
regulator: core: Fast path non-deferred disables
regulator: core: Report microvolts in sysfs even with only list_voltage()
regulator: tps6586x: add support for SYS rail
regulator: lp872x: remove unnecessary function
regulator: lp872x: fix NULL pointer access problem
...
Diffstat (limited to 'drivers/regulator/wm831x-dcdc.c')
-rw-r--r-- | drivers/regulator/wm831x-dcdc.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 7413885be01..90cbcc68370 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c @@ -339,16 +339,15 @@ static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev, u16 reg = dcdc->base + WM831X_DCDC_CONTROL_2; int i; - for (i = 0; i < ARRAY_SIZE(wm831x_dcdc_ilim); i++) { + for (i = ARRAY_SIZE(wm831x_dcdc_ilim) - 1; i >= 0; i--) { if ((min_uA <= wm831x_dcdc_ilim[i]) && (wm831x_dcdc_ilim[i] <= max_uA)) - break; + return wm831x_set_bits(wm831x, reg, + WM831X_DC1_HC_THR_MASK, + i << WM831X_DC1_HC_THR_SHIFT); } - if (i == ARRAY_SIZE(wm831x_dcdc_ilim)) - return -EINVAL; - return wm831x_set_bits(wm831x, reg, WM831X_DC1_HC_THR_MASK, - i << WM831X_DC1_HC_THR_SHIFT); + return -EINVAL; } static int wm831x_buckv_get_current_limit(struct regulator_dev *rdev) |