diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-06-04 05:41:38 +0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-06-04 13:48:18 +0400 |
commit | 9152c36a3b37a95c1161508dc105719456d7f7d0 (patch) | |
tree | 7ce3621ad6ef52ccf98f4187a702bfe79a346041 /drivers/regulator/core.c | |
parent | 3a4b0a07fa69cbfbdd4bc2ebe769cf789949db46 (diff) | |
download | linux-9152c36a3b37a95c1161508dc105719456d7f7d0.tar.xz |
regulator: core: Use map_voltage_linear() if list_voltage_linear() is in use and nothing is set
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 8521e0d6b3bc..3cbe3129ed3b 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2118,12 +2118,18 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, ret = rdev->desc->ops->set_voltage(rdev, min_uV, max_uV, &selector); } else if (rdev->desc->ops->set_voltage_sel) { - if (rdev->desc->ops->map_voltage) + if (rdev->desc->ops->map_voltage) { ret = rdev->desc->ops->map_voltage(rdev, min_uV, max_uV); - else - ret = regulator_map_voltage_iterate(rdev, min_uV, - max_uV); + } else { + if (rdev->desc->ops->list_voltage == + regulator_list_voltage_linear) + ret = regulator_map_voltage_linear(rdev, + min_uV, max_uV); + else + ret = regulator_map_voltage_iterate(rdev, + min_uV, max_uV); + } if (ret >= 0) { selector = ret; |