summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-08-15 20:32:59 +0200
committerRafael J. Wysocki <rjw@sisk.pl>2012-09-04 01:36:53 +0200
commit74a2799ab51acec9410f467fef8678ebb1125d7d (patch)
treed26ffff8d487e5412c5b18c00bfda61623f2c4df /drivers/base
parentPM / Domains: Document cpuidle-related functions and change their names (diff)
downloadlinux-74a2799ab51acec9410f467fef8678ebb1125d7d.tar.xz
linux-74a2799ab51acec9410f467fef8678ebb1125d7d.zip
PM / Domains: Operations related to cpuidle using domain names
Make it possible to use domain names in operations connecting cpuidle to and disconnecting it from a PM domain. This is useful on platforms where PM domain objects are organized in such a way that the names of the domains are easier to use than the addresses of those objects. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/power/domain.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index e44e1a8e8376..12ad070c244f 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1888,6 +1888,16 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
}
/**
+ * pm_genpd_name_attach_cpuidle - Find PM domain and connect cpuidle to it.
+ * @name: Name of the domain to connect to cpuidle.
+ * @state: cpuidle state this domain can manipulate.
+ */
+int pm_genpd_name_attach_cpuidle(const char *name, int state)
+{
+ return pm_genpd_attach_cpuidle(pm_genpd_lookup_name(name), state);
+}
+
+/**
* pm_genpd_detach_cpuidle - Remove the cpuidle connection from a PM domain.
* @genpd: PM domain to remove the cpuidle connection from.
*
@@ -1925,6 +1935,15 @@ int pm_genpd_detach_cpuidle(struct generic_pm_domain *genpd)
return ret;
}
+/**
+ * pm_genpd_name_detach_cpuidle - Find PM domain and disconnect cpuidle from it.
+ * @name: Name of the domain to disconnect cpuidle from.
+ */
+int pm_genpd_name_detach_cpuidle(const char *name)
+{
+ return pm_genpd_detach_cpuidle(pm_genpd_lookup_name(name));
+}
+
/* Default device callbacks for generic PM domains. */
/**