aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-08-08 08:23:54 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-28 14:00:26 -0400
commit19d23c21a64d1312be48def8ac49180bd60fc76d (patch)
tree9c4b00c06b847ee51a4540594ea38b7dca96b479 /drivers/regulator
parent4e1d67eddf70f815b77af5354aaa5e60084fde8b (diff)
regulator: da9052: set_current_limit should select the maximum current in specific range
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/da9052-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c
index 903299cf15cf..27355b1199e5 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -133,8 +133,8 @@ static int da9052_dcdc_set_current_limit(struct regulator_dev *rdev, int min_uA,
133 max_uA < da9052_current_limits[row][DA9052_MIN_UA]) 133 max_uA < da9052_current_limits[row][DA9052_MIN_UA])
134 return -EINVAL; 134 return -EINVAL;
135 135
136 for (i = 0; i < DA9052_CURRENT_RANGE; i++) { 136 for (i = DA9052_CURRENT_RANGE - 1; i >= 0; i--) {
137 if (min_uA <= da9052_current_limits[row][i]) { 137 if (da9052_current_limits[row][i] <= max_uA) {
138 reg_val = i; 138 reg_val = i;
139 break; 139 break;
140 } 140 }