Commit 1aad9f2f authored by Mark Brown's avatar Mark Brown

Merge branch 'for-5.0' of...

Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.1
parents 6c98ac2a c25d4788
...@@ -135,7 +135,7 @@ static int pv88060_set_current_limit(struct regulator_dev *rdev, int min, ...@@ -135,7 +135,7 @@ static int pv88060_set_current_limit(struct regulator_dev *rdev, int min,
int i; int i;
/* search for closest to maximum */ /* search for closest to maximum */
for (i = info->n_current_limits; i >= 0; i--) { for (i = info->n_current_limits - 1; i >= 0; i--) {
if (min <= info->current_limits[i] if (min <= info->current_limits[i]
&& max >= info->current_limits[i]) { && max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap, return regmap_update_bits(rdev->regmap,
......
...@@ -279,7 +279,7 @@ static int pv88080_set_current_limit(struct regulator_dev *rdev, int min, ...@@ -279,7 +279,7 @@ static int pv88080_set_current_limit(struct regulator_dev *rdev, int min,
int i; int i;
/* search for closest to maximum */ /* search for closest to maximum */
for (i = info->n_current_limits; i >= 0; i--) { for (i = info->n_current_limits - 1; i >= 0; i--) {
if (min <= info->current_limits[i] if (min <= info->current_limits[i]
&& max >= info->current_limits[i]) { && max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap, return regmap_update_bits(rdev->regmap,
......
...@@ -157,7 +157,7 @@ static int pv88090_set_current_limit(struct regulator_dev *rdev, int min, ...@@ -157,7 +157,7 @@ static int pv88090_set_current_limit(struct regulator_dev *rdev, int min,
int i; int i;
/* search for closest to maximum */ /* search for closest to maximum */
for (i = info->n_current_limits; i >= 0; i--) { for (i = info->n_current_limits - 1; i >= 0; i--) {
if (min <= info->current_limits[i] if (min <= info->current_limits[i]
&& max >= info->current_limits[i]) { && max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap, return regmap_update_bits(rdev->regmap,
......
...@@ -188,7 +188,8 @@ static struct regulator_ops tps65218_ldo1_dcdc34_ops = { ...@@ -188,7 +188,8 @@ static struct regulator_ops tps65218_ldo1_dcdc34_ops = {
.set_suspend_disable = tps65218_pmic_set_suspend_disable, .set_suspend_disable = tps65218_pmic_set_suspend_disable,
}; };
static const int ls3_currents[] = { 100, 200, 500, 1000 }; static const int ls3_currents[] = { 100000, 200000, 500000, 1000000 };
static int tps65218_pmic_set_input_current_lim(struct regulator_dev *dev, static int tps65218_pmic_set_input_current_lim(struct regulator_dev *dev,
int lim_uA) int lim_uA)
...@@ -215,7 +216,7 @@ static int tps65218_pmic_set_current_limit(struct regulator_dev *dev, ...@@ -215,7 +216,7 @@ static int tps65218_pmic_set_current_limit(struct regulator_dev *dev,
unsigned int num_currents = ARRAY_SIZE(ls3_currents); unsigned int num_currents = ARRAY_SIZE(ls3_currents);
struct tps65218 *tps = rdev_get_drvdata(dev); struct tps65218 *tps = rdev_get_drvdata(dev);
while (index < num_currents && ls3_currents[index] < max_uA) while (index < num_currents && ls3_currents[index] <= max_uA)
index++; index++;
index--; index--;
......
...@@ -304,8 +304,8 @@ static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev) ...@@ -304,8 +304,8 @@ static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev)
} }
/* Current limit options */ /* Current limit options */
static u16 wm831x_dcdc_ilim[] = { static const unsigned int wm831x_dcdc_ilim[] = {
125, 250, 375, 500, 625, 750, 875, 1000 125000, 250000, 375000, 500000, 625000, 750000, 875000, 1000000
}; };
static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev, static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,
......
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