aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2013-02-05 22:10:51 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-08 06:23:43 -0500
commitc6163a70237bba13e9cdcf6a71e6c28875e7a734 (patch)
treecf661bdd7d61a97bd2cd4159c016b70b69f1bc80 /drivers/regulator
parent88b62b915b0b7e25870eb0604ed9a92ba4bfc9f7 (diff)
regulator: max8998: Let regulator core handle the case selector == old_selector
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max8998.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 1f0df4046b86..24e2d1dec8c3 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -311,25 +311,13 @@ static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev,
311 dev_get_platdata(max8998->iodev->dev); 311 dev_get_platdata(max8998->iodev->dev);
312 struct i2c_client *i2c = max8998->iodev->i2c; 312 struct i2c_client *i2c = max8998->iodev->i2c;
313 int buck = rdev_get_id(rdev); 313 int buck = rdev_get_id(rdev);
314 int reg, shift = 0, mask, ret; 314 int reg, shift = 0, mask, ret, j;
315 int j, previous_sel;
316 static u8 buck1_last_val; 315 static u8 buck1_last_val;
317 316
318 ret = max8998_get_voltage_register(rdev, &reg, &shift, &mask); 317 ret = max8998_get_voltage_register(rdev, &reg, &shift, &mask);
319 if (ret) 318 if (ret)
320 return ret; 319 return ret;
321 320
322 previous_sel = max8998_get_voltage_sel(rdev);
323
324 /* Check if voltage needs to be changed */
325 /* if previous_voltage equal new voltage, return */
326 if (previous_sel == selector) {
327 dev_dbg(max8998->dev, "No voltage change, old:%d, new:%d\n",
328 regulator_list_voltage_linear(rdev, previous_sel),
329 regulator_list_voltage_linear(rdev, selector));
330 return ret;
331 }
332
333 switch (buck) { 321 switch (buck) {
334 case MAX8998_BUCK1: 322 case MAX8998_BUCK1:
335 dev_dbg(max8998->dev, 323 dev_dbg(max8998->dev,