summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65218-regulator.c
diff options
context:
space:
mode:
authorChristian Hohnstaedt <Christian.Hohnstaedt@wago.com>2019-02-20 09:15:50 +0100
committerMark Brown <broonie@kernel.org>2019-02-20 17:45:48 +0100
commit71a64ba2031f4b67769618b9e35389906026130d (patch)
tree17612606e7bea169bc94ad796554ec3bdb09e97f /drivers/regulator/tps65218-regulator.c
parentregulator: pv88090: Fix array out-of-bounds access (diff)
downloadlinux-71a64ba2031f4b67769618b9e35389906026130d.tar.xz
linux-71a64ba2031f4b67769618b9e35389906026130d.zip
regulator: tps65218.c: fix LS3 issues
- Fix list of valid LS3 currents from mA to µA - Fix selection of min/max microAmps of LS3. Selecting one of the configured values as max value now really selects it instead of the next lower one Signed-off-by: Christian Hohnstaedt <Christian.Hohnstaedt@wago.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/tps65218-regulator.c')
-rw-r--r--drivers/regulator/tps65218-regulator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
index 6209beee1018..5dd559eabc81 100644
--- a/drivers/regulator/tps65218-regulator.c
+++ b/drivers/regulator/tps65218-regulator.c
@@ -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)
@@ -214,7 +215,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--;