aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/lp3972.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/lp3972.c')
-rw-r--r--drivers/regulator/lp3972.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/regulator/lp3972.c b/drivers/regulator/lp3972.c
index e07062fd0b42..6aa1b506fb5d 100644
--- a/drivers/regulator/lp3972.c
+++ b/drivers/regulator/lp3972.c
@@ -292,7 +292,8 @@ static int lp3972_ldo_get_voltage(struct regulator_dev *dev)
292} 292}
293 293
294static int lp3972_ldo_set_voltage(struct regulator_dev *dev, 294static int lp3972_ldo_set_voltage(struct regulator_dev *dev,
295 int min_uV, int max_uV) 295 int min_uV, int max_uV,
296 unsigned int *selector)
296{ 297{
297 struct lp3972 *lp3972 = rdev_get_drvdata(dev); 298 struct lp3972 *lp3972 = rdev_get_drvdata(dev);
298 int ldo = rdev_get_id(dev) - LP3972_LDO1; 299 int ldo = rdev_get_id(dev) - LP3972_LDO1;
@@ -313,6 +314,8 @@ static int lp3972_ldo_set_voltage(struct regulator_dev *dev,
313 if (val > LP3972_LDO_VOL_MAX_IDX(ldo) || vol_map[val] > max_vol) 314 if (val > LP3972_LDO_VOL_MAX_IDX(ldo) || vol_map[val] > max_vol)
314 return -EINVAL; 315 return -EINVAL;
315 316
317 *selector = val;
318
316 shift = LP3972_LDO_VOL_CONTR_SHIFT(ldo); 319 shift = LP3972_LDO_VOL_CONTR_SHIFT(ldo);
317 ret = lp3972_set_bits(lp3972, LP3972_LDO_VOL_CONTR_REG(ldo), 320 ret = lp3972_set_bits(lp3972, LP3972_LDO_VOL_CONTR_REG(ldo),
318 LP3972_LDO_VOL_MASK(ldo) << shift, val << shift); 321 LP3972_LDO_VOL_MASK(ldo) << shift, val << shift);
@@ -416,7 +419,8 @@ static int lp3972_dcdc_get_voltage(struct regulator_dev *dev)
416} 419}
417 420
418static int lp3972_dcdc_set_voltage(struct regulator_dev *dev, 421static int lp3972_dcdc_set_voltage(struct regulator_dev *dev,
419 int min_uV, int max_uV) 422 int min_uV, int max_uV,
423 unsigned int *selector)
420{ 424{
421 struct lp3972 *lp3972 = rdev_get_drvdata(dev); 425 struct lp3972 *lp3972 = rdev_get_drvdata(dev);
422 int buck = rdev_get_id(dev) - LP3972_DCDC1; 426 int buck = rdev_get_id(dev) - LP3972_DCDC1;
@@ -438,6 +442,8 @@ static int lp3972_dcdc_set_voltage(struct regulator_dev *dev,
438 vol_map[val] > max_vol) 442 vol_map[val] > max_vol)
439 return -EINVAL; 443 return -EINVAL;
440 444
445 *selector = val;
446
441 ret = lp3972_set_bits(lp3972, LP3972_BUCK_VOL1_REG(buck), 447 ret = lp3972_set_bits(lp3972, LP3972_BUCK_VOL1_REG(buck),
442 LP3972_BUCK_VOL_MASK, val); 448 LP3972_BUCK_VOL_MASK, val);
443 if (ret) 449 if (ret)