Skip to content

Commit

Permalink
regulator: Convert fixed voltage regulator to use enable_time()
Browse files Browse the repository at this point in the history
It had an open coded version in enable().

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed Mar 3, 2010
1 parent 69dc16c commit 17133dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ static int fixed_voltage_enable(struct regulator_dev *dev)
if (gpio_is_valid(data->gpio)) {
gpio_set_value_cansleep(data->gpio, data->enable_high);
data->is_enabled = 1;
if (data->startup_delay)
udelay(data->startup_delay);
}

return 0;
Expand All @@ -69,6 +67,13 @@ static int fixed_voltage_disable(struct regulator_dev *dev)
return 0;
}

static int fixed_voltage_enable_time(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);

return data->startup_delay;
}

static int fixed_voltage_get_voltage(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
Expand All @@ -91,6 +96,7 @@ static struct regulator_ops fixed_voltage_ops = {
.is_enabled = fixed_voltage_is_enabled,
.enable = fixed_voltage_enable,
.disable = fixed_voltage_disable,
.enable_time = fixed_voltage_enable_time,
.get_voltage = fixed_voltage_get_voltage,
.list_voltage = fixed_voltage_list_voltage,
};
Expand Down

0 comments on commit 17133dc

Please sign in to comment.