This commit is contained in:
Mark Brown 2019-03-03 23:49:46 +00:00
commit 1aad9f2f79
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
5 changed files with 8 additions and 7 deletions

View File

@ -135,7 +135,7 @@ static int pv88060_set_current_limit(struct regulator_dev *rdev, int min,
int i;
/* 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]
&& max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap,

View File

@ -279,7 +279,7 @@ static int pv88080_set_current_limit(struct regulator_dev *rdev, int min,
int i;
/* 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]
&& max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap,

View File

@ -157,7 +157,7 @@ static int pv88090_set_current_limit(struct regulator_dev *rdev, int min,
int i;
/* 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]
&& max >= info->current_limits[i]) {
return regmap_update_bits(rdev->regmap,

View File

@ -188,7 +188,8 @@ static struct regulator_ops tps65218_ldo1_dcdc34_ops = {
.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,
int lim_uA)
@ -215,7 +216,7 @@ static int tps65218_pmic_set_current_limit(struct regulator_dev *dev,
unsigned int num_currents = ARRAY_SIZE(ls3_currents);
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--;

View File

@ -304,8 +304,8 @@ static int wm831x_buckv_get_voltage_sel(struct regulator_dev *rdev)
}
/* Current limit options */
static u16 wm831x_dcdc_ilim[] = {
125, 250, 375, 500, 625, 750, 875, 1000
static const unsigned int wm831x_dcdc_ilim[] = {
125000, 250000, 375000, 500000, 625000, 750000, 875000, 1000000
};
static int wm831x_buckv_set_current_limit(struct regulator_dev *rdev,