Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302111
b: refs/heads/master
c: 9d44206
h: refs/heads/master
i:
  302109: 5ea229a
  302107: 5c4d4ee
  302103: 313a445
  302095: 1aca4ed
  302079: efcea51
v: v3
  • Loading branch information
Mark Brown committed Apr 1, 2012
1 parent dd8a7cf commit 8ca496a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 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: c45bb35f8b76439f4b6c0efaca510f871e9b1840
refs/heads/master: 9d442061da08e679ec8e7c004fd0450e799a2af7
27 changes: 13 additions & 14 deletions trunk/drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);

if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, data->enable_high);
data->is_enabled = true;
}
gpio_set_value_cansleep(data->gpio, data->enable_high);
data->is_enabled = true;

return 0;
}
Expand All @@ -117,10 +115,8 @@ static int fixed_voltage_disable(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);

if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, !data->enable_high);
data->is_enabled = false;
}
gpio_set_value_cansleep(data->gpio, !data->enable_high);
data->is_enabled = false;

return 0;
}
Expand Down Expand Up @@ -153,7 +149,7 @@ static int fixed_voltage_list_voltage(struct regulator_dev *dev,
return data->microvolts;
}

static struct regulator_ops fixed_voltage_ops = {
static struct regulator_ops fixed_voltage_gpio_ops = {
.is_enabled = fixed_voltage_is_enabled,
.enable = fixed_voltage_enable,
.disable = fixed_voltage_disable,
Expand All @@ -162,6 +158,11 @@ static struct regulator_ops fixed_voltage_ops = {
.list_voltage = fixed_voltage_list_voltage,
};

static struct regulator_ops fixed_voltage_ops = {
.get_voltage = fixed_voltage_get_voltage,
.list_voltage = fixed_voltage_list_voltage,
};

static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
{
struct fixed_voltage_config *config;
Expand Down Expand Up @@ -192,7 +193,6 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
}
drvdata->desc.type = REGULATOR_VOLTAGE;
drvdata->desc.owner = THIS_MODULE;
drvdata->desc.ops = &fixed_voltage_ops;

if (config->microvolts)
drvdata->desc.n_voltages = 1;
Expand Down Expand Up @@ -242,11 +242,10 @@ static int __devinit reg_fixed_voltage_probe(struct platform_device *pdev)
goto err_gpio;
}

drvdata->desc.ops = &fixed_voltage_gpio_ops;

} else {
/* Regulator without GPIO control is considered
* always enabled
*/
drvdata->is_enabled = true;
drvdata->desc.ops = &fixed_voltage_ops;
}

drvdata->dev = regulator_register(&drvdata->desc, &pdev->dev,
Expand Down

0 comments on commit 8ca496a

Please sign in to comment.