Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302303
b: refs/heads/master
c: dde2b72
h: refs/heads/master
i:
  302301: 32aba20
  302299: 03895d9
  302295: 9c35fe8
  302287: c70fdd8
  302271: c074861
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed May 16, 2012
1 parent 070e39d commit b7e9496
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 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: a9b2899b9deeae0f83a1a1f5761ee8d2fd7824cd
refs/heads/master: dde2b724e6bd6a6ea8516345398d3b8fe06a031b
21 changes: 6 additions & 15 deletions trunk/drivers/regulator/isl6271a-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,15 @@ static int isl6271a_get_voltage_sel(struct regulator_dev *dev)
return idx;
}

static int isl6271a_set_voltage(struct regulator_dev *dev,
int minuV, int maxuV,
unsigned *selector)
static int isl6271a_set_voltage_sel(struct regulator_dev *dev,
unsigned selector)
{
struct isl_pmic *pmic = rdev_get_drvdata(dev);
int err, data;

if (minuV < ISL6271A_VOLTAGE_MIN || minuV > ISL6271A_VOLTAGE_MAX)
return -EINVAL;
if (maxuV < ISL6271A_VOLTAGE_MIN || maxuV > ISL6271A_VOLTAGE_MAX)
return -EINVAL;

data = DIV_ROUND_UP(minuV - ISL6271A_VOLTAGE_MIN,
ISL6271A_VOLTAGE_STEP);
*selector = data;
int err;

mutex_lock(&pmic->mtx);

err = i2c_smbus_write_byte(pmic->client, data);
err = i2c_smbus_write_byte(pmic->client, selector);
if (err < 0)
dev_err(&pmic->client->dev, "Error setting voltage\n");

Expand All @@ -78,8 +68,9 @@ static int isl6271a_set_voltage(struct regulator_dev *dev,

static struct regulator_ops isl_core_ops = {
.get_voltage_sel = isl6271a_get_voltage_sel,
.set_voltage = isl6271a_set_voltage,
.set_voltage_sel = isl6271a_set_voltage_sel,
.list_voltage = regulator_list_voltage_linear,
.map_voltage = regulator_map_voltage_linear,
};

static int isl6271a_get_fixed_voltage(struct regulator_dev *dev)
Expand Down

0 comments on commit b7e9496

Please sign in to comment.