Skip to content

Commit

Permalink
regulator: Convert WM8994 to use get_voltage_sel()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Jan 12, 2011
1 parent c24516a commit d9f0f28
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions drivers/regulator/wm8994-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int wm8994_ldo1_list_voltage(struct regulator_dev *rdev,
return (selector * 100000) + 2400000;
}

static int wm8994_ldo1_get_voltage(struct regulator_dev *rdev)
static int wm8994_ldo1_get_voltage_sel(struct regulator_dev *rdev)
{
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
int val;
Expand All @@ -95,9 +95,7 @@ static int wm8994_ldo1_get_voltage(struct regulator_dev *rdev)
if (val < 0)
return val;

val = (val & WM8994_LDO1_VSEL_MASK) >> WM8994_LDO1_VSEL_SHIFT;

return wm8994_ldo1_list_voltage(rdev, val);
return (val & WM8994_LDO1_VSEL_MASK) >> WM8994_LDO1_VSEL_SHIFT;
}

static int wm8994_ldo1_set_voltage(struct regulator_dev *rdev,
Expand Down Expand Up @@ -125,7 +123,7 @@ static struct regulator_ops wm8994_ldo1_ops = {
.enable_time = wm8994_ldo_enable_time,

.list_voltage = wm8994_ldo1_list_voltage,
.get_voltage = wm8994_ldo1_get_voltage,
.get_voltage_sel = wm8994_ldo1_get_voltage_sel,
.set_voltage = wm8994_ldo1_set_voltage,
};

Expand All @@ -138,7 +136,7 @@ static int wm8994_ldo2_list_voltage(struct regulator_dev *rdev,
return (selector * 100000) + 900000;
}

static int wm8994_ldo2_get_voltage(struct regulator_dev *rdev)
static int wm8994_ldo2_get_voltage_sel(struct regulator_dev *rdev)
{
struct wm8994_ldo *ldo = rdev_get_drvdata(rdev);
int val;
Expand All @@ -147,9 +145,7 @@ static int wm8994_ldo2_get_voltage(struct regulator_dev *rdev)
if (val < 0)
return val;

val = (val & WM8994_LDO2_VSEL_MASK) >> WM8994_LDO2_VSEL_SHIFT;

return wm8994_ldo2_list_voltage(rdev, val);
return (val & WM8994_LDO2_VSEL_MASK) >> WM8994_LDO2_VSEL_SHIFT;
}

static int wm8994_ldo2_set_voltage(struct regulator_dev *rdev,
Expand Down Expand Up @@ -177,7 +173,7 @@ static struct regulator_ops wm8994_ldo2_ops = {
.enable_time = wm8994_ldo_enable_time,

.list_voltage = wm8994_ldo2_list_voltage,
.get_voltage = wm8994_ldo2_get_voltage,
.get_voltage_sel = wm8994_ldo2_get_voltage_sel,
.set_voltage = wm8994_ldo2_set_voltage,
};

Expand Down

0 comments on commit d9f0f28

Please sign in to comment.