public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] regulator: Don't increment use_count for boot_on regulators
@ 2009-03-16 19:36 Mark Brown
  2009-03-16 19:36 ` [PATCH 2/2] regulator: Support disabling of unused regulators by machines Mark Brown
  2009-03-19 18:09 ` [PATCH 1/2] regulator: Don't increment use_count for boot_on regulators Liam Girdwood
  0 siblings, 2 replies; 4+ messages in thread
From: Mark Brown @ 2009-03-16 19:36 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: linux-kernel, Mark Brown

Don't set use_count for regulators that are enabled at boot since this
stops the supply being disabled by well-behaved consumers which do
balanced enables and disabled. Any consumers which don't do disables
which are not matched by enables are unable to share regulators - shared
regulators are the common case so the API should facilitate them.

Consumers that want to disable regulators that are enabled when they
start have two options:

 - Do a regulator_enable() prior to the disable to bring the use count
   in sync with the hardware state; this will ensure that if the
   regulator was enabled by another driver then this consumer will play
   nicely with it.
 - Use regulator_force_disable(); this explicitly bypasses any checks
   done by the core and documents the inability of the driver to share
   the supply.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 drivers/regulator/core.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9448875..8588a24 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -814,7 +814,6 @@ static int set_machine_constraints(struct regulator_dev *rdev,
 			rdev->constraints = NULL;
 			goto out;
 		}
-		rdev->use_count = 1;
 	}
 
 	print_constraints(rdev);
-- 
1.6.2


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

end of thread, other threads:[~2009-03-19 18:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-16 19:36 [PATCH 1/2] regulator: Don't increment use_count for boot_on regulators Mark Brown
2009-03-16 19:36 ` [PATCH 2/2] regulator: Support disabling of unused regulators by machines Mark Brown
2009-03-19 18:09   ` Liam Girdwood
2009-03-19 18:09 ` [PATCH 1/2] regulator: Don't increment use_count for boot_on regulators Liam Girdwood

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