summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-20 14:36:14 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-20 17:05:13 +0400
commitb9b49af5efa405f3c394a6395e79092c785999a3 (patch)
treec6dec65f57d4e9311272646a202b432dcca98d29
parent7c842a1d244cb70d0ef85f47141f0f6f432f2521 (diff)
downloadlinux-b9b49af5efa405f3c394a6395e79092c785999a3.tar.xz
regulator: max8952: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--drivers/regulator/max8952.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c
index c0ab4ddc1023..62ae140d8d9f 100644
--- a/drivers/regulator/max8952.c
+++ b/drivers/regulator/max8952.c
@@ -69,11 +69,6 @@ static int max8952_write_reg(struct max8952_data *max8952,
return i2c_smbus_write_byte_data(max8952->client, reg, value);
}
-static int max8952_voltage(struct max8952_data *max8952, u8 mode)
-{
- return (max8952->pdata->dvs_mode[mode] * 10 + 770) * 1000;
-}
-
static int max8952_list_voltage(struct regulator_dev *rdev,
unsigned int selector)
{
@@ -82,7 +77,7 @@ static int max8952_list_voltage(struct regulator_dev *rdev,
if (rdev_get_id(rdev) != 0)
return -EINVAL;
- return max8952_voltage(max8952, selector);
+ return (max8952->pdata->dvs_mode[selector] * 10 + 770) * 1000;
}
static int max8952_is_enabled(struct regulator_dev *rdev)
@@ -117,7 +112,7 @@ static int max8952_disable(struct regulator_dev *rdev)
return 0;
}
-static int max8952_get_voltage(struct regulator_dev *rdev)
+static int max8952_get_voltage_sel(struct regulator_dev *rdev)
{
struct max8952_data *max8952 = rdev_get_drvdata(rdev);
u8 vid = 0;
@@ -127,7 +122,7 @@ static int max8952_get_voltage(struct regulator_dev *rdev)
if (max8952->vid1)
vid += 2;
- return max8952_voltage(max8952, vid);
+ return vid;
}
static int max8952_set_voltage_sel(struct regulator_dev *rdev,
@@ -154,7 +149,7 @@ static struct regulator_ops max8952_ops = {
.is_enabled = max8952_is_enabled,
.enable = max8952_enable,
.disable = max8952_disable,
- .get_voltage = max8952_get_voltage,
+ .get_voltage_sel = max8952_get_voltage_sel,
.set_voltage_sel = max8952_set_voltage_sel,
.set_suspend_disable = max8952_disable,
};