Gitweb: http://git.kernel.org/linus/ca7255614e0861e36480103f4a402a115803d7b5
Commit: ca7255614e0861e36480103f4a402a115803d7b5
Parent: 50f075963f127d713ff0c30359baefc0f89d9ae2
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
AuthorDate: Mon Mar 16 19:36:34 2009 +0000
Committer: Liam Girdwood <lrg@slimlogic.co.uk>
CommitDate: Tue Mar 31 09:56:29 2009 +0100
regulator: Support disabling of unused regulators by machines
At present it is not possible for machine constraints to disable
regulators which have been left on when the system starts, for example
as a result of fixed default configurations in hardware. This means that
power may be wasted by these regulators if they are not in use.
Provide intial support for this with a late_initcall which will disable
any unused regulators if the machine has enabled this feature by calling
regulator_has_full_constraints(). If this has not been called then print
a warning to encourage users to fully specify their constraints so that
we can change this to be the default behaviour in future.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
---
drivers/regulator/core.c | 92 +++++++++++++++++++++++++++++++++++++
include/linux/regulator/machine.h | 2 +
2 files changed, 94 insertions(+), 0 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8588a24..01f7702 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -28,6 +28,7 @@
static DEFINE_MUTEX(regulator_list_mutex);
static LIST_HEAD(regulator_list);
static LIST_HEAD(regulator_map_list);
+static int has_full_constraints;
/*
* struct regulator_map
@@ -2143,6 +2144,23 @@ out:
EXPORT_SYMBOL_GPL(regulator_suspend_prepare);
/**
+ * regulator_has_full_constraints - the system has fully specified constraints
+ *
+ * Calling this function will cause the regulator ...