Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302302
b: refs/heads/master
c: a9b2899
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed May 16, 2012
1 parent 32aba20 commit 070e39d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b7a7a4e837269a8a157a19ac93ddb207f2bd0b6
refs/heads/master: a9b2899b9deeae0f83a1a1f5761ee8d2fd7824cd
17 changes: 5 additions & 12 deletions trunk/drivers/regulator/isl6271a-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 070e39d

Please sign in to comment.