diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-10 09:38:29 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 09:32:59 -0500 |
commit | 3a93f2a9f4d8f73d74c0e552feb68a10f778a219 (patch) | |
tree | 8a9f503f2f061ad3fe9712b0986b0da346f4c8d2 /drivers/regulator/ab3100.c | |
parent | 63cee946148821bca42be10130b061c2d0f5af7e (diff) |
regulator: Report actual configured voltage to set_voltage()
Change the interface used by set_voltage() to report the selected value
to the regulator core in terms of a selector used by list_voltage().
This allows the regulator core to know the voltage that was chosen
without having to do an explict get_voltage(), which would be much more
expensive as it will generally access hardware.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/ab3100.c')
-rw-r--r-- | drivers/regulator/ab3100.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index b349266a43de..ed6feaf9398d 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -362,7 +362,8 @@ static int ab3100_get_best_voltage_index(struct regulator_dev *reg, | |||
362 | } | 362 | } |
363 | 363 | ||
364 | static int ab3100_set_voltage_regulator(struct regulator_dev *reg, | 364 | static int ab3100_set_voltage_regulator(struct regulator_dev *reg, |
365 | int min_uV, int max_uV) | 365 | int min_uV, int max_uV, |
366 | unsigned *selector) | ||
366 | { | 367 | { |
367 | struct ab3100_regulator *abreg = reg->reg_data; | 368 | struct ab3100_regulator *abreg = reg->reg_data; |
368 | u8 regval; | 369 | u8 regval; |
@@ -373,6 +374,8 @@ static int ab3100_set_voltage_regulator(struct regulator_dev *reg, | |||
373 | if (bestindex < 0) | 374 | if (bestindex < 0) |
374 | return bestindex; | 375 | return bestindex; |
375 | 376 | ||
377 | *selector = bestindex; | ||
378 | |||
376 | err = abx500_get_register_interruptible(abreg->dev, 0, | 379 | err = abx500_get_register_interruptible(abreg->dev, 0, |
377 | abreg->regreg, ®val); | 380 | abreg->regreg, ®val); |
378 | if (err) { | 381 | if (err) { |