Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302134
b: refs/heads/master
c: f8ee339
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 1, 2012
1 parent dc3ff89 commit 2fb1ab4
Show file tree
Hide file tree
Showing 2 changed files with 4 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: 0df8c96fa1c1adb23c49124685dde77b6560bef2
refs/heads/master: f8ee33936f07d49b8e902920e7a5950ac2118d6a
18 changes: 3 additions & 15 deletions trunk/drivers/regulator/tps6524x-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,30 +458,18 @@ static int list_voltage(struct regulator_dev *rdev, unsigned selector)
info->voltages[selector] : -EINVAL);
}

static int set_voltage(struct regulator_dev *rdev, int min_uV, int max_uV,
unsigned *selector)
static int set_voltage_sel(struct regulator_dev *rdev, unsigned selector)
{
const struct supply_info *info;
struct tps6524x *hw;
unsigned i;

hw = rdev_get_drvdata(rdev);
info = &supply_info[rdev_get_id(rdev)];

if (info->flags & FIXED_VOLTAGE)
return -EINVAL;

for (i = 0; i < info->n_voltages; i++)
if (min_uV <= info->voltages[i] &&
max_uV >= info->voltages[i])
break;

if (i >= info->n_voltages)
i = info->n_voltages - 1;

*selector = i;

return write_field(hw, &info->voltage, i);
return write_field(hw, &info->voltage, selector);
}

static int get_voltage(struct regulator_dev *rdev)
Expand Down Expand Up @@ -588,7 +576,7 @@ static struct regulator_ops regulator_ops = {
.enable = enable_supply,
.disable = disable_supply,
.get_voltage = get_voltage,
.set_voltage = set_voltage,
.set_voltage_sel = set_voltage_sel,
.list_voltage = list_voltage,
.set_current_limit = set_current_limit,
.get_current_limit = get_current_limit,
Expand Down

0 comments on commit 2fb1ab4

Please sign in to comment.