Commit 53b8a9d9 authored by Juha Keski-Saari's avatar Juha Keski-Saari Committed by Liam Girdwood

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: default avatarJuha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 30010fa5
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/delay.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regulator/driver.h> #include <linux/regulator/driver.h>
#include <linux/regulator/machine.h> #include <linux/regulator/machine.h>
...@@ -134,6 +135,7 @@ static int twlreg_enable(struct regulator_dev *rdev) ...@@ -134,6 +135,7 @@ static int twlreg_enable(struct regulator_dev *rdev)
{ {
struct twlreg_info *info = rdev_get_drvdata(rdev); struct twlreg_info *info = rdev_get_drvdata(rdev);
int grp; int grp;
int ret;
grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP); grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
if (grp < 0) if (grp < 0)
...@@ -144,7 +146,11 @@ static int twlreg_enable(struct regulator_dev *rdev) ...@@ -144,7 +146,11 @@ static int twlreg_enable(struct regulator_dev *rdev)
else else
grp |= P1_GRP_6030; grp |= P1_GRP_6030;
return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp);
udelay(info->delay);
return ret;
} }
static int twlreg_disable(struct regulator_dev *rdev) static int twlreg_disable(struct regulator_dev *rdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment