Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19d23c21 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: da9052: set_current_limit should select the maximum current in specific range

parent 4e1d67ed
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ static int da9052_dcdc_set_current_limit(struct regulator_dev *rdev, int min_uA,
	    max_uA < da9052_current_limits[row][DA9052_MIN_UA])
		return -EINVAL;

	for (i = 0; i < DA9052_CURRENT_RANGE; i++) {
		if (min_uA <= da9052_current_limits[row][i]) {
	for (i = DA9052_CURRENT_RANGE - 1; i >= 0; i--) {
		if (da9052_current_limits[row][i] <= max_uA) {
			reg_val = i;
			break;
		}