Commit 3bf6e90e authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: Convert ab8499 to use get_voltage_sel()

This change is required to make ab8500_regulator_get_voltage_sel work.
The regulator core will call set_voltage_time_sel only when get_voltage_sel is
implemented.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Tested-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent dfb9b8a4
...@@ -201,7 +201,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector) ...@@ -201,7 +201,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
return info->voltages[selector]; return info->voltages[selector];
} }
static int ab8500_regulator_get_voltage(struct regulator_dev *rdev) static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
{ {
int ret, val; int ret, val;
struct ab8500_regulator_info *info = rdev_get_drvdata(rdev); struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
...@@ -229,11 +229,9 @@ static int ab8500_regulator_get_voltage(struct regulator_dev *rdev) ...@@ -229,11 +229,9 @@ static int ab8500_regulator_get_voltage(struct regulator_dev *rdev)
/* vintcore has a different layout */ /* vintcore has a different layout */
val = regval & info->voltage_mask; val = regval & info->voltage_mask;
if (info->desc.id == AB8500_LDO_INTCORE) if (info->desc.id == AB8500_LDO_INTCORE)
ret = info->voltages[val >> 0x3]; return val >> 0x3;
else else
ret = info->voltages[val]; return val;
return ret;
} }
static int ab8500_get_best_voltage_index(struct regulator_dev *rdev, static int ab8500_get_best_voltage_index(struct regulator_dev *rdev,
...@@ -320,7 +318,7 @@ static struct regulator_ops ab8500_regulator_ops = { ...@@ -320,7 +318,7 @@ static struct regulator_ops ab8500_regulator_ops = {
.enable = ab8500_regulator_enable, .enable = ab8500_regulator_enable,
.disable = ab8500_regulator_disable, .disable = ab8500_regulator_disable,
.is_enabled = ab8500_regulator_is_enabled, .is_enabled = ab8500_regulator_is_enabled,
.get_voltage = ab8500_regulator_get_voltage, .get_voltage_sel = ab8500_regulator_get_voltage_sel,
.set_voltage = ab8500_regulator_set_voltage, .set_voltage = ab8500_regulator_set_voltage,
.list_voltage = ab8500_list_voltage, .list_voltage = ab8500_list_voltage,
.enable_time = ab8500_regulator_enable_time, .enable_time = ab8500_regulator_enable_time,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment