diff options
author | Adrian Hunter <adrian.hunter@nokia.com> | 2010-01-12 05:25:13 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-03-03 09:49:23 -0500 |
commit | eda79a3041a2cada0d4ee9491c99c3874b322356 (patch) | |
tree | 34f10eeca2ce681fc5701ce06380b4902f0303f0 /drivers/regulator/fixed.c | |
parent | 75c8ac22e4b8ebea8169a090e64d034a96758644 (diff) |
regulator: Add 'start-up time' to fixed voltage regulators
Add a field to specify a delay for the start-up time of
a fixed voltage regulator.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r-- | drivers/regulator/fixed.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index f9f516a3028a..ee3e7eb97b1c 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c | |||
@@ -24,12 +24,14 @@ | |||
24 | #include <linux/regulator/driver.h> | 24 | #include <linux/regulator/driver.h> |
25 | #include <linux/regulator/fixed.h> | 25 | #include <linux/regulator/fixed.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/delay.h> | ||
27 | 28 | ||
28 | struct fixed_voltage_data { | 29 | struct fixed_voltage_data { |
29 | struct regulator_desc desc; | 30 | struct regulator_desc desc; |
30 | struct regulator_dev *dev; | 31 | struct regulator_dev *dev; |
31 | int microvolts; | 32 | int microvolts; |
32 | int gpio; | 33 | int gpio; |
34 | unsigned startup_delay; | ||
33 | unsigned enable_high:1; | 35 | unsigned enable_high:1; |
34 | unsigned is_enabled:1; | 36 | unsigned is_enabled:1; |
35 | }; | 37 | }; |
@@ -48,6 +50,8 @@ static int fixed_voltage_enable(struct regulator_dev *dev) | |||
48 | if (gpio_is_valid(data->gpio)) { | 50 | if (gpio_is_valid(data->gpio)) { |
49 | gpio_set_value_cansleep(data->gpio, data->enable_high); | 51 | gpio_set_value_cansleep(data->gpio, data->enable_high); |
50 | data->is_enabled = 1; | 52 | data->is_enabled = 1; |
53 | if (data->startup_delay) | ||
54 | udelay(data->startup_delay); | ||
51 | } | 55 | } |
52 | 56 | ||
53 | return 0; | 57 | return 0; |
@@ -117,6 +121,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev) | |||
117 | 121 | ||
118 | drvdata->microvolts = config->microvolts; | 122 | drvdata->microvolts = config->microvolts; |
119 | drvdata->gpio = config->gpio; | 123 | drvdata->gpio = config->gpio; |
124 | drvdata->startup_delay = config->startup_delay; | ||
120 | 125 | ||
121 | if (gpio_is_valid(config->gpio)) { | 126 | if (gpio_is_valid(config->gpio)) { |
122 | drvdata->enable_high = config->enable_high; | 127 | drvdata->enable_high = config->enable_high; |