Commit c6163a70 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: max8998: Let regulator core handle the case selector == old_selector

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 88b62b91
...@@ -311,25 +311,13 @@ static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev, ...@@ -311,25 +311,13 @@ static int max8998_set_voltage_buck_sel(struct regulator_dev *rdev,
dev_get_platdata(max8998->iodev->dev); dev_get_platdata(max8998->iodev->dev);
struct i2c_client *i2c = max8998->iodev->i2c; struct i2c_client *i2c = max8998->iodev->i2c;
int buck = rdev_get_id(rdev); int buck = rdev_get_id(rdev);
int reg, shift = 0, mask, ret; int reg, shift = 0, mask, ret, j;
int j, previous_sel;
static u8 buck1_last_val; static u8 buck1_last_val;
ret = max8998_get_voltage_register(rdev, &reg, &shift, &mask); ret = max8998_get_voltage_register(rdev, &reg, &shift, &mask);
if (ret) if (ret)
return ret; return ret;
previous_sel = max8998_get_voltage_sel(rdev);
/* Check if voltage needs to be changed */
/* if previous_voltage equal new voltage, return */
if (previous_sel == selector) {
dev_dbg(max8998->dev, "No voltage change, old:%d, new:%d\n",
regulator_list_voltage_linear(rdev, previous_sel),
regulator_list_voltage_linear(rdev, selector));
return ret;
}
switch (buck) { switch (buck) {
case MAX8998_BUCK1: case MAX8998_BUCK1:
dev_dbg(max8998->dev, dev_dbg(max8998->dev,
......
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