diff options
author | Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com> | 2009-12-16 07:55:26 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-12-17 05:27:29 -0500 |
commit | 53b8a9d92a713fa82316bf418dcc19d6da32ca05 (patch) | |
tree | 739a3a1543c88c9077f2ecda316cf59cd6b3e59b /drivers/regulator/twl-regulator.c | |
parent | 30010fa52c7bd466b441e3f9020ba4cf6154fa41 (diff) |
twl-regulator: Add turnon delay to reg_enable
This change implements a basic turnon delay in the regulator enable function
to make it less probable that reg_enable returns before the regulator
output is at target level
Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator/twl-regulator.c')
-rw-r--r-- | drivers/regulator/twl-regulator.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 6c464b86b29c..9bcea4d131be 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/err.h> | 14 | #include <linux/err.h> |
15 | #include <linux/delay.h> | ||
15 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
16 | #include <linux/regulator/driver.h> | 17 | #include <linux/regulator/driver.h> |
17 | #include <linux/regulator/machine.h> | 18 | #include <linux/regulator/machine.h> |
@@ -134,6 +135,7 @@ static int twlreg_enable(struct regulator_dev *rdev) | |||
134 | { | 135 | { |
135 | struct twlreg_info *info = rdev_get_drvdata(rdev); | 136 | struct twlreg_info *info = rdev_get_drvdata(rdev); |
136 | int grp; | 137 | int grp; |
138 | int ret; | ||
137 | 139 | ||
138 | grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP); | 140 | grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP); |
139 | if (grp < 0) | 141 | if (grp < 0) |
@@ -144,7 +146,11 @@ static int twlreg_enable(struct regulator_dev *rdev) | |||
144 | else | 146 | else |
145 | grp |= P1_GRP_6030; | 147 | grp |= P1_GRP_6030; |
146 | 148 | ||
147 | return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); | 149 | ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); |
150 | |||
151 | udelay(info->delay); | ||
152 | |||
153 | return ret; | ||
148 | } | 154 | } |
149 | 155 | ||
150 | static int twlreg_disable(struct regulator_dev *rdev) | 156 | static int twlreg_disable(struct regulator_dev *rdev) |