public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] regulator: Add enable_time on probe of WM8994
@ 2010-02-07  0:41 Joonyoung Shim
  2010-02-07 23:56 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Joonyoung Shim @ 2010-02-07  0:41 UTC (permalink / raw)
  To: lrg; +Cc: linux-kernel, broonie, kyungmin.park

WM8994 regulator needs some delay to enable when it is probed too.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 drivers/regulator/wm8994-regulator.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index 1639806..a9f0c89 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -15,6 +15,7 @@
 #include <linux/moduleparam.h>
 #include <linux/init.h>
 #include <linux/bitops.h>
+#include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/platform_device.h>
 #include <linux/regulator/driver.h>
@@ -206,7 +207,7 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
 	struct wm8994_pdata *pdata = wm8994->dev->platform_data;
 	int id = pdev->id % ARRAY_SIZE(pdata->ldo);
 	struct wm8994_ldo *ldo;
-	int ret;
+	int ret, delay;
 
 	dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1);
 
@@ -239,6 +240,12 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
 				ret);
 			goto err_gpio;
 		}
+
+		delay = wm8994_ldo_enable_time(NULL);
+		if (delay >= 1000)
+			mdelay(delay / 1000);
+		else if (delay)
+			udelay(delay);
 	}
 
 	ldo->regulator = regulator_register(&wm8994_ldo_desc[id], &pdev->dev,
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: Add enable_time on probe of WM8994
  2010-02-07  0:41 [PATCH] regulator: Add enable_time on probe of WM8994 Joonyoung Shim
@ 2010-02-07 23:56 ` Mark Brown
  2010-02-08  6:03   ` Joonyoung Shim
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2010-02-07 23:56 UTC (permalink / raw)
  To: Joonyoung Shim; +Cc: lrg, linux-kernel, kyungmin.park

On Sun, Feb 07, 2010 at 09:41:26AM +0900, Joonyoung Shim wrote:
> WM8994 regulator needs some delay to enable when it is probed too.

What is the problem that's fixed by this change?

The only case I can think of where it would help is if the regulator
constraints are used to enable the regulators and run them at a
non-default voltage.  (which is not a recommended configuration since
this would mean raising the voltage and therefore increasing power
consumption).  For that case this is not quite enough of a change since
the LDO that is being controlled may not be the one that brings the
device out of power on reset.  More extensive rearrangement of the core
regulator code would be required to deal with that, reordering the
application of constraints.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] regulator: Add enable_time on probe of WM8994
  2010-02-07 23:56 ` Mark Brown
@ 2010-02-08  6:03   ` Joonyoung Shim
  0 siblings, 0 replies; 3+ messages in thread
From: Joonyoung Shim @ 2010-02-08  6:03 UTC (permalink / raw)
  To: Mark Brown; +Cc: lrg, linux-kernel, kyungmin.park

On 2/8/2010 8:56 AM, Mark Brown wrote:
> On Sun, Feb 07, 2010 at 09:41:26AM +0900, Joonyoung Shim wrote:
>> WM8994 regulator needs some delay to enable when it is probed too.
> 
> What is the problem that's fixed by this change?
> 
> The only case I can think of where it would help is if the regulator
> constraints are used to enable the regulators and run them at a
> non-default voltage.  (which is not a recommended configuration since

You're right. I misunderstanded something. The default voltage already 
is setted at the WM8994 ldo registers, but i made a mistake that set it
again on probe via the regulator constraints.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-08  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-07  0:41 [PATCH] regulator: Add enable_time on probe of WM8994 Joonyoung Shim
2010-02-07 23:56 ` Mark Brown
2010-02-08  6:03   ` Joonyoung Shim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox