aboutsummaryrefslogtreecommitdiff
path: root/drivers/regulator/isl6271a-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-05-16 10:10:22 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-05-16 09:46:57 +0100
commita9b2899b9deeae0f83a1a1f5761ee8d2fd7824cd (patch)
tree2c61dbaba49a724bb994f9452b43da94f1d60bca /drivers/regulator/isl6271a-regulator.c
parent2b7a7a4e837269a8a157a19ac93ddb207f2bd0b6 (diff)
regulator: isl6271a: Convert to get_voltage_sel
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/isl6271a-regulator.c')
-rw-r--r--drivers/regulator/isl6271a-regulator.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c
index 78cdc90e0a7..00cb2881672 100644
--- a/drivers/regulator/isl6271a-regulator.c
+++ b/drivers/regulator/isl6271a-regulator.c
@@ -35,26 +35,19 @@ struct isl_pmic {
struct mutex mtx;
};
-static int isl6271a_get_voltage(struct regulator_dev *dev)
+static int isl6271a_get_voltage_sel(struct regulator_dev *dev)
{
struct isl_pmic *pmic = rdev_get_drvdata(dev);
- int idx, data;
+ int idx;
mutex_lock(&pmic->mtx);
idx = i2c_smbus_read_byte(pmic->client);
- if (idx < 0) {
+ if (idx < 0)
dev_err(&pmic->client->dev, "Error getting voltage\n");
- data = idx;
- goto out;
- }
-
- /* Convert the data from chip to microvolts */
- data = ISL6271A_VOLTAGE_MIN + (ISL6271A_VOLTAGE_STEP * (idx & 0xf));
-out:
mutex_unlock(&pmic->mtx);
- return data;
+ return idx;
}
static int isl6271a_set_voltage(struct regulator_dev *dev,
@@ -84,7 +77,7 @@ static int isl6271a_set_voltage(struct regulator_dev *dev,
}
static struct regulator_ops isl_core_ops = {
- .get_voltage = isl6271a_get_voltage,
+ .get_voltage_sel = isl6271a_get_voltage_sel,
.set_voltage = isl6271a_set_voltage,
.list_voltage = regulator_list_voltage_linear,
};