Commit 4e62cce2 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branch 'regulator/topic/da9052' into regulator-next

parents 6234427e 1e369bcd
......@@ -129,17 +129,17 @@ static int da9052_dcdc_set_current_limit(struct regulator_dev *rdev, int min_uA,
else if (offset == 0)
row = 1;
if (min_uA > da9052_current_limits[row][DA9052_MAX_UA] ||
max_uA < da9052_current_limits[row][DA9052_MIN_UA])
return -EINVAL;
for (i = DA9052_CURRENT_RANGE - 1; i >= 0; i--) {
if (da9052_current_limits[row][i] <= max_uA) {
if ((min_uA <= da9052_current_limits[row][i]) &&
(da9052_current_limits[row][i] <= max_uA)) {
reg_val = i;
break;
}
}
if (i < 0)
return -EINVAL;
/* Determine the even or odd position of the buck current limit
* register field
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment