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>

authored by Juha Keski-Saari and committed by Liam Girdwood 53b8a9d9 30010fa5

+7 -1
+7 -1
drivers/regulator/twl-regulator.c
··· 12 12 #include <linux/module.h> 13 13 #include <linux/init.h> 14 14 #include <linux/err.h> 15 + #include <linux/delay.h> 15 16 #include <linux/platform_device.h> 16 17 #include <linux/regulator/driver.h> 17 18 #include <linux/regulator/machine.h> ··· 135 134 { 136 135 struct twlreg_info *info = rdev_get_drvdata(rdev); 137 136 int grp; 137 + int ret; 138 138 139 139 grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP); 140 140 if (grp < 0) ··· 146 144 else 147 145 grp |= P1_GRP_6030; 148 146 149 - return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); 147 + ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); 148 + 149 + udelay(info->delay); 150 + 151 + return ret; 150 152 } 151 153 152 154 static int twlreg_disable(struct regulator_dev *rdev)