aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/tps65023-regulator.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/tps65023-regulator.c')
-rw-r--r--drivers/regulator/tps65023-regulator.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c
index cd6d4fc9d74f..60a7ca5409e9 100644
--- a/drivers/regulator/tps65023-regulator.c
+++ b/drivers/regulator/tps65023-regulator.c
@@ -321,7 +321,8 @@ static int tps65023_dcdc_get_voltage(struct regulator_dev *dev)
321} 321}
322 322
323static int tps65023_dcdc_set_voltage(struct regulator_dev *dev, 323static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
324 int min_uV, int max_uV) 324 int min_uV, int max_uV,
325 unsigned *selector)
325{ 326{
326 struct tps_pmic *tps = rdev_get_drvdata(dev); 327 struct tps_pmic *tps = rdev_get_drvdata(dev);
327 int dcdc = rdev_get_id(dev); 328 int dcdc = rdev_get_id(dev);
@@ -346,6 +347,8 @@ static int tps65023_dcdc_set_voltage(struct regulator_dev *dev,
346 break; 347 break;
347 } 348 }
348 349
350 *selector = vsel;
351
349 /* write to the register in case we found a match */ 352 /* write to the register in case we found a match */
350 if (vsel == tps->info[dcdc]->table_len) 353 if (vsel == tps->info[dcdc]->table_len)
351 return -EINVAL; 354 return -EINVAL;
@@ -371,7 +374,7 @@ static int tps65023_ldo_get_voltage(struct regulator_dev *dev)
371} 374}
372 375
373static int tps65023_ldo_set_voltage(struct regulator_dev *dev, 376static int tps65023_ldo_set_voltage(struct regulator_dev *dev,
374 int min_uV, int max_uV) 377 int min_uV, int max_uV, unsigned *selector)
375{ 378{
376 struct tps_pmic *tps = rdev_get_drvdata(dev); 379 struct tps_pmic *tps = rdev_get_drvdata(dev);
377 int data, vsel, ldo = rdev_get_id(dev); 380 int data, vsel, ldo = rdev_get_id(dev);
@@ -396,6 +399,8 @@ static int tps65023_ldo_set_voltage(struct regulator_dev *dev,
396 if (vsel == tps->info[ldo]->table_len) 399 if (vsel == tps->info[ldo]->table_len)
397 return -EINVAL; 400 return -EINVAL;
398 401
402 *selector = vsel;
403
399 data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL); 404 data = tps_65023_reg_read(tps, TPS65023_REG_LDO_CTRL);
400 if (data < 0) 405 if (data < 0)
401 return data; 406 return data;