aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ab8500.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-02-24 04:15:45 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-11 16:48:43 -0400
commit3bf6e90e476fb34ca47b6dda270f41d9cebcb1ac (patch)
tree0f54f8d5eb262a723202a8d9f710997961241dea /drivers/regulator/ab8500.c
parentdfb9b8a4f3ed7b85c9d65cb0e47ec07543ce317d (diff)
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: Axel Lin <axel.lin@gmail.com> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/ab8500.c')
-rw-r--r--drivers/regulator/ab8500.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index c9b92531ae60..c7ee4c15d6f5 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -201,7 +201,7 @@ static int ab8500_list_voltage(struct regulator_dev *rdev, unsigned selector)
201 return info->voltages[selector]; 201 return info->voltages[selector];
202} 202}
203 203
204static int ab8500_regulator_get_voltage(struct regulator_dev *rdev) 204static int ab8500_regulator_get_voltage_sel(struct regulator_dev *rdev)
205{ 205{
206 int ret, val; 206 int ret, val;
207 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev); 207 struct ab8500_regulator_info *info = rdev_get_drvdata(rdev);
@@ -229,11 +229,9 @@ static int ab8500_regulator_get_voltage(struct regulator_dev *rdev)
229 /* vintcore has a different layout */ 229 /* vintcore has a different layout */
230 val = regval & info->voltage_mask; 230 val = regval & info->voltage_mask;
231 if (info->desc.id == AB8500_LDO_INTCORE) 231 if (info->desc.id == AB8500_LDO_INTCORE)
232 ret = info->voltages[val >> 0x3]; 232 return val >> 0x3;
233 else 233 else
234 ret = info->voltages[val]; 234 return val;
235
236 return ret;
237} 235}
238 236
239static int ab8500_get_best_voltage_index(struct regulator_dev *rdev, 237static int ab8500_get_best_voltage_index(struct regulator_dev *rdev,
@@ -320,7 +318,7 @@ static struct regulator_ops ab8500_regulator_ops = {
320 .enable = ab8500_regulator_enable, 318 .enable = ab8500_regulator_enable,
321 .disable = ab8500_regulator_disable, 319 .disable = ab8500_regulator_disable,
322 .is_enabled = ab8500_regulator_is_enabled, 320 .is_enabled = ab8500_regulator_is_enabled,
323 .get_voltage = ab8500_regulator_get_voltage, 321 .get_voltage_sel = ab8500_regulator_get_voltage_sel,
324 .set_voltage = ab8500_regulator_set_voltage, 322 .set_voltage = ab8500_regulator_set_voltage,
325 .list_voltage = ab8500_list_voltage, 323 .list_voltage = ab8500_list_voltage,
326 .enable_time = ab8500_regulator_enable_time, 324 .enable_time = ab8500_regulator_enable_time,