Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302161
b: refs/heads/master
c: dd16b1f
h: refs/heads/master
i:
  302159: fc1d81b
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 6, 2012
1 parent 4d8b545 commit a9ec0e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 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: 4eb06453648bb0d1eca3669f26798a19b6f40eb8
refs/heads/master: dd16b1f8e7814cad47e09951529facaba4350302
27 changes: 4 additions & 23 deletions trunk/drivers/regulator/twl-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,31 +473,12 @@ static int twl4030ldo_list_voltage(struct regulator_dev *rdev, unsigned index)
}

static int
twl4030ldo_set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
unsigned *selector)
twl4030ldo_set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{
struct twlreg_info *info = rdev_get_drvdata(rdev);
int vsel;

for (vsel = 0; vsel < info->table_len; vsel++) {
int mV = info->table[vsel];
int uV;

if (IS_UNSUP(mV))
continue;
uV = LDO_MV(mV) * 1000;

/* REVISIT for VAUX2, first match may not be best/lowest */

/* use the first in-range value */
if (min_uV <= uV && uV <= max_uV) {
*selector = vsel;
return twlreg_write(info, TWL_MODULE_PM_RECEIVER,
VREG_VOLTAGE, vsel);
}
}

return -EDOM;
return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_VOLTAGE,
selector);
}

static int twl4030ldo_get_voltage(struct regulator_dev *rdev)
Expand All @@ -516,7 +497,7 @@ static int twl4030ldo_get_voltage(struct regulator_dev *rdev)
static struct regulator_ops twl4030ldo_ops = {
.list_voltage = twl4030ldo_list_voltage,

.set_voltage = twl4030ldo_set_voltage,
.set_voltage_sel = twl4030ldo_set_voltage_sel,
.get_voltage = twl4030ldo_get_voltage,

.enable = twl4030reg_enable,
Expand Down

0 comments on commit a9ec0e3

Please sign in to comment.