aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-05-14 12:15:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-14 12:34:48 -0400
commit40baecee48fc47399338972f9ae121f965225876 (patch)
treec72060798045d15363a9d7886531ef01df1f7462
parent0fb737b566d8eafbb2ff25b2643c037e0517a9c1 (diff)
regulator: max8649: Convert to regulator_set_voltage_sel_regmap and regulator_map_voltage_linear
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/max8649.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index 0cfd1724748..39fffb2e403 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -70,25 +70,6 @@ static inline int check_range(int min_uV, int max_uV)
70 return 0; 70 return 0;
71} 71}
72 72
73static int max8649_set_voltage(struct regulator_dev *rdev,
74 int min_uV, int max_uV, unsigned *selector)
75{
76 struct max8649_regulator_info *info = rdev_get_drvdata(rdev);
77 unsigned char data, mask;
78
79 if (check_range(min_uV, max_uV)) {
80 dev_err(info->dev, "invalid voltage range (%d, %d) uV\n",
81 min_uV, max_uV);
82 return -EINVAL;
83 }
84 data = DIV_ROUND_UP(min_uV - MAX8649_DCDC_VMIN, MAX8649_DCDC_STEP);
85 mask = MAX8649_VOL_MASK;
86 *selector = data & mask;
87
88 return regmap_update_bits(info->regmap, rdev->desc->vsel_reg, mask,
89 data);
90}
91
92/* EN_PD means pulldown on EN input */ 73/* EN_PD means pulldown on EN input */
93static int max8649_enable(struct regulator_dev *rdev) 74static int max8649_enable(struct regulator_dev *rdev)
94{ 75{
@@ -176,9 +157,10 @@ static unsigned int max8649_get_mode(struct regulator_dev *rdev)
176} 157}
177 158
178static struct regulator_ops max8649_dcdc_ops = { 159static struct regulator_ops max8649_dcdc_ops = {
179 .set_voltage = max8649_set_voltage, 160 .set_voltage_sel = regulator_set_voltage_sel_regmap,
180 .get_voltage_sel = regulator_get_voltage_sel_regmap, 161 .get_voltage_sel = regulator_get_voltage_sel_regmap,
181 .list_voltage = regulator_list_voltage_linear, 162 .list_voltage = regulator_list_voltage_linear,
163 .map_voltage = regulator_map_voltage_linear,
182 .enable = max8649_enable, 164 .enable = max8649_enable,
183 .disable = max8649_disable, 165 .disable = max8649_disable,
184 .is_enabled = max8649_is_enabled, 166 .is_enabled = max8649_is_enabled,