Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302272
b: refs/heads/master
c: d4eb56a
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed May 12, 2012
1 parent c074861 commit 9c2c06f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 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: 5ceba7bab02df45260452e06f3b9c391ad1d776e
refs/heads/master: d4eb56a16273a04f10eb7f959e1bb59b6f88d8c9
20 changes: 19 additions & 1 deletion trunk/drivers/regulator/da903x.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,24 @@ static int da9030_get_ldo14_voltage(struct regulator_dev *rdev)
info->step_uV * (val & ~0x4);
}

static int da9030_list_ldo14_voltage(struct regulator_dev *rdev,
unsigned selector)
{
struct da903x_regulator_info *info = rdev_get_drvdata(rdev);
int volt;

if (selector & 0x4)
volt = info->min_uV + info->step_uV * (3 - (selector & ~0x4));
else
volt = (info->max_uV + info->min_uV) / 2 +
info->step_uV * (selector & ~0x4);

if (volt > info->max_uV)
return -EINVAL;

return volt;
}

/* DA9034 specific operations */
static int da9034_set_dvc_voltage(struct regulator_dev *rdev,
int min_uV, int max_uV, unsigned *selector)
Expand Down Expand Up @@ -357,7 +375,7 @@ static struct regulator_ops da903x_regulator_ldo_ops = {
static struct regulator_ops da9030_regulator_ldo14_ops = {
.set_voltage = da9030_set_ldo14_voltage,
.get_voltage = da9030_get_ldo14_voltage,
.list_voltage = da903x_list_voltage,
.list_voltage = da9030_list_ldo14_voltage,
.enable = da903x_enable,
.disable = da903x_disable,
.is_enabled = da903x_is_enabled,
Expand Down

0 comments on commit 9c2c06f

Please sign in to comment.