twl-regulator: Add turnon delay to reg_enable

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, December 17, 2009 - 9:59 am

Gitweb:     http://git.kernel.org/linus/53b8a9d92a713fa82316bf418dcc19d6da32ca05
Commit:     53b8a9d92a713fa82316bf418dcc19d6da32ca05
Parent:     30010fa52c7bd466b441e3f9020ba4cf6154fa41
Author:     Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
AuthorDate: Wed Dec 16 14:55:26 2009 +0200
Committer:  Liam Girdwood <lrg@slimlogic.co.uk>
CommitDate: Thu Dec 17 10:27:29 2009 +0000

    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>
---
 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 6c464b8..9bcea4d 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/err.h>
+#include <linux/delay.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
 #include <linux/regulator/machine.h>
@@ -134,6 +135,7 @@ static int twlreg_enable(struct regulator_dev *rdev)
 {
 	struct twlreg_info	*info = rdev_get_drvdata(rdev);
 	int			grp;
+	int			ret;
 
 	grp = twlreg_read(info, TWL_MODULE_PM_RECEIVER, VREG_GRP);
 	if (grp < 0)
@@ -144,7 +146,11 @@ static int twlreg_enable(struct regulator_dev *rdev)
 	else
 		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)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
twl-regulator: Add turnon delay to reg_enable, Linux Kernel Mailing ..., (Thu Dec 17, 9:59 am)