aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-05-14 12:14:05 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-14 12:34:48 -0400
commit0fb737b566d8eafbb2ff25b2643c037e0517a9c1 (patch)
tree082f5575fd5e9a8118cde306750576a6730bc3e9 /drivers/regulator
parent817d8c2d9bd52bcfad292ae940b1e4083be62958 (diff)
regulator: max8649: Convert to regulator_list_voltage_linear()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max8649.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c
index 575cf484bfd1..0cfd17247485 100644
--- a/drivers/regulator/max8649.c
+++ b/drivers/regulator/max8649.c
@@ -70,11 +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_list_voltage(struct regulator_dev *rdev, unsigned index)
74{
75 return (MAX8649_DCDC_VMIN + index * MAX8649_DCDC_STEP);
76}
77
78static int max8649_set_voltage(struct regulator_dev *rdev, 73static int max8649_set_voltage(struct regulator_dev *rdev,
79 int min_uV, int max_uV, unsigned *selector) 74 int min_uV, int max_uV, unsigned *selector)
80{ 75{
@@ -135,7 +130,7 @@ static int max8649_enable_time(struct regulator_dev *rdev)
135 if (ret != 0) 130 if (ret != 0)
136 return ret; 131 return ret;
137 val &= MAX8649_VOL_MASK; 132 val &= MAX8649_VOL_MASK;
138 voltage = max8649_list_voltage(rdev, (unsigned char)val); /* uV */ 133 voltage = regulator_list_voltage_linear(rdev, (unsigned char)val);
139 134
140 /* get rate */ 135 /* get rate */
141 ret = regmap_read(info->regmap, MAX8649_RAMP, &val); 136 ret = regmap_read(info->regmap, MAX8649_RAMP, &val);
@@ -183,7 +178,7 @@ static unsigned int max8649_get_mode(struct regulator_dev *rdev)
183static struct regulator_ops max8649_dcdc_ops = { 178static struct regulator_ops max8649_dcdc_ops = {
184 .set_voltage = max8649_set_voltage, 179 .set_voltage = max8649_set_voltage,
185 .get_voltage_sel = regulator_get_voltage_sel_regmap, 180 .get_voltage_sel = regulator_get_voltage_sel_regmap,
186 .list_voltage = max8649_list_voltage, 181 .list_voltage = regulator_list_voltage_linear,
187 .enable = max8649_enable, 182 .enable = max8649_enable,
188 .disable = max8649_disable, 183 .disable = max8649_disable,
189 .is_enabled = max8649_is_enabled, 184 .is_enabled = max8649_is_enabled,
@@ -200,6 +195,8 @@ static struct regulator_desc dcdc_desc = {
200 .n_voltages = 1 << 6, 195 .n_voltages = 1 << 6,
201 .owner = THIS_MODULE, 196 .owner = THIS_MODULE,
202 .vsel_mask = MAX8649_VOL_MASK, 197 .vsel_mask = MAX8649_VOL_MASK,
198 .min_uV = MAX8649_DCDC_VMIN,
199 .uV_step = MAX8649_DCDC_STEP,
203}; 200};
204 201
205static struct regmap_config max8649_regmap_config = { 202static struct regmap_config max8649_regmap_config = {