summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@nokia.com>2010-01-12 12:25:13 +0200
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-03-03 14:49:23 +0000
commiteda79a3041a2cada0d4ee9491c99c3874b322356 (patch)
tree34f10eeca2ce681fc5701ce06380b4902f0303f0 /drivers/regulator/fixed.c
parent75c8ac22e4b8ebea8169a090e64d034a96758644 (diff)
downloadlinux-eda79a3041a2cada0d4ee9491c99c3874b322356.tar.gz
linux-eda79a3041a2cada0d4ee9491c99c3874b322356.tar.bz2
linux-eda79a3041a2cada0d4ee9491c99c3874b322356.zip
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.c5
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 @@
#include <linux/regulator/driver.h>
#include <linux/regulator/fixed.h>
#include <linux/gpio.h>
+#include <linux/delay.h>
struct fixed_voltage_data {
struct regulator_desc desc;
struct regulator_dev *dev;
int microvolts;
int gpio;
+ unsigned startup_delay;
unsigned enable_high:1;
unsigned is_enabled:1;
};
@@ -48,6 +50,8 @@ 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;
@@ -117,6 +121,7 @@ static int regulator_fixed_voltage_probe(struct platform_device *pdev)
drvdata->microvolts = config->microvolts;
drvdata->gpio = config->gpio;
+ drvdata->startup_delay = config->startup_delay;
if (gpio_is_valid(config->gpio)) {
drvdata->enable_high = config->enable_high;