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