Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310649
b: refs/heads/master
c: b0e4d7b
h: refs/heads/master
i:
  310647: f174393
v: v3
  • Loading branch information
Heiko Stübner authored and Mark Brown committed Jun 4, 2012
1 parent dabc702 commit ff49130
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 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: 00926369b745fb0c1e5c27cec35f6adc9752f2c4
refs/heads/master: b0e4d7bf8b5704904a5d138d81a8ec8b7145767f
8 changes: 5 additions & 3 deletions trunk/drivers/regulator/gpio-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int gpio_regulator_get_value(struct regulator_dev *dev)
}

static int gpio_regulator_set_value(struct regulator_dev *dev,
int min, int max)
int min, int max, unsigned *selector)
{
struct gpio_regulator_data *data = rdev_get_drvdata(dev);
int ptr, target = 0, state, best_val = INT_MAX;
Expand All @@ -112,6 +112,8 @@ static int gpio_regulator_set_value(struct regulator_dev *dev,
data->states[ptr].value <= max) {
target = data->states[ptr].gpios;
best_val = data->states[ptr].value;
if (selector)
*selector = ptr;
}

if (best_val == INT_MAX)
Expand All @@ -130,7 +132,7 @@ static int gpio_regulator_set_voltage(struct regulator_dev *dev,
int min_uV, int max_uV,
unsigned *selector)
{
return gpio_regulator_set_value(dev, min_uV, max_uV);
return gpio_regulator_set_value(dev, min_uV, max_uV, selector);
}

static int gpio_regulator_list_voltage(struct regulator_dev *dev,
Expand All @@ -147,7 +149,7 @@ static int gpio_regulator_list_voltage(struct regulator_dev *dev,
static int gpio_regulator_set_current_limit(struct regulator_dev *dev,
int min_uA, int max_uA)
{
return gpio_regulator_set_value(dev, min_uA, max_uA);
return gpio_regulator_set_value(dev, min_uA, max_uA, NULL);
}

static struct regulator_ops gpio_regulator_voltage_ops = {
Expand Down

0 comments on commit ff49130

Please sign in to comment.