linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: disable supply regulator if it is enabled for boot-on
@ 2012-08-14 10:07 Laxman Dewangan
  2012-08-14 11:08 ` Rabin Vincent
  2012-08-22  9:45 ` Laxman Dewangan
  0 siblings, 2 replies; 10+ messages in thread
From: Laxman Dewangan @ 2012-08-14 10:07 UTC (permalink / raw)
  To: broonie, lrg; +Cc: linux-kernel, rabin.vincent, Laxman Dewangan

If supply regulator is enabled because of boot-on (not always-on)
then disable regulator need to be call if regulator have some
user or full constraint has been enabled.
This will make sure that reference count of supply regulator
is in sync with child regulator's state.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reported-by: Rabin Vincent <rabin.vincent@gmail.com>
---
 drivers/regulator/core.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 0fffeae..4632909 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3614,8 +3614,11 @@ static int __init regulator_init_complete(void)
 
 		mutex_lock(&rdev->mutex);
 
-		if (rdev->use_count)
+		if (rdev->use_count) {
+			if (rdev->supply && c->boot_on)
+				regulator_disable(rdev->supply);
 			goto unlock;
+		}
 
 		/* If we can't read the status assume it's on. */
 		if (ops->is_enabled)
@@ -3634,6 +3637,8 @@ static int __init regulator_init_complete(void)
 			if (ret != 0) {
 				rdev_err(rdev, "couldn't disable: %d\n", ret);
 			}
+			if (rdev->supply)
+				regulator_disable(rdev->supply);
 		} else {
 			/* The intention is that in future we will
 			 * assume that full constraints are provided
-- 
1.7.1.1


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

end of thread, other threads:[~2012-08-28 15:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-14 10:07 [PATCH] regulator: disable supply regulator if it is enabled for boot-on Laxman Dewangan
2012-08-14 11:08 ` Rabin Vincent
2012-08-22  9:45 ` Laxman Dewangan
2012-08-23 14:53   ` Mark Brown
2012-08-23 14:43     ` Laxman Dewangan
2012-08-24 17:52       ` Laxman Dewangan
2012-08-24 23:40         ` Rabin Vincent
2012-08-28 12:20           ` Laxman Dewangan
2012-08-28 15:52             ` Rabin Vincent
2012-08-24 17:53       ` Laxman Dewangan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).