Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302108
b: refs/heads/master
c: f72d643
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 1, 2012
1 parent 5c4d4ee commit e90890f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 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: c8237f01db63b458c34222d07f66c5417cfd866b
refs/heads/master: f72d643e87581cbee49f39c1fd8268b1a9252b80
23 changes: 7 additions & 16 deletions trunk/drivers/regulator/tps65912-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,12 +372,14 @@ static unsigned int tps65912_get_mode(struct regulator_dev *dev)
return mode;
}

static int tps65912_list_voltage_dcdc(struct regulator_dev *dev,
unsigned selector)
static int tps65912_list_voltage(struct regulator_dev *dev, unsigned selector)
{
struct tps65912_reg *pmic = rdev_get_drvdata(dev);
int range, voltage = 0, id = rdev_get_id(dev);

if (id >= TPS65912_REG_LDO1 && id <= TPS65912_REG_LDO10)
return tps65912_vsel_to_uv_ldo(selector);

if (id > TPS65912_REG_DCDC4)
return -EINVAL;

Expand Down Expand Up @@ -418,7 +420,7 @@ static int tps65912_get_voltage_dcdc(struct regulator_dev *dev)
vsel = tps65912_reg_read(mfd, reg);
vsel &= 0x3F;

return tps65912_list_voltage_dcdc(dev, vsel);
return tps65912_list_voltage(dev, vsel);
}

static int tps65912_set_voltage_sel(struct regulator_dev *dev,
Expand Down Expand Up @@ -451,17 +453,6 @@ static int tps65912_get_voltage_ldo(struct regulator_dev *dev)
return tps65912_vsel_to_uv_ldo(vsel);
}

static int tps65912_list_voltage_ldo(struct regulator_dev *dev,
unsigned selector)
{
int ldo = rdev_get_id(dev);

if (ldo < TPS65912_REG_LDO1 || ldo > TPS65912_REG_LDO10)
return -EINVAL;

return tps65912_vsel_to_uv_ldo(selector);
}

/* Operations permitted on DCDCx */
static struct regulator_ops tps65912_ops_dcdc = {
.is_enabled = tps65912_reg_is_enabled,
Expand All @@ -471,7 +462,7 @@ static struct regulator_ops tps65912_ops_dcdc = {
.get_mode = tps65912_get_mode,
.get_voltage = tps65912_get_voltage_dcdc,
.set_voltage_sel = tps65912_set_voltage_sel,
.list_voltage = tps65912_list_voltage_dcdc,
.list_voltage = tps65912_list_voltage,
};

/* Operations permitted on LDOx */
Expand All @@ -481,7 +472,7 @@ static struct regulator_ops tps65912_ops_ldo = {
.disable = tps65912_reg_disable,
.get_voltage = tps65912_get_voltage_ldo,
.set_voltage_sel = tps65912_set_voltage_sel,
.list_voltage = tps65912_list_voltage_ldo,
.list_voltage = tps65912_list_voltage,
};

static __devinit int tps65912_probe(struct platform_device *pdev)
Expand Down

0 comments on commit e90890f

Please sign in to comment.