Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611006 > unrolled thread

[RFC PATCH 1/4] PM / Domains: Prepare for supporting explicit PM domain control

Started byJon Hunter <jonathanh@nvidia.com>
First post2017-03-28 16:20 +0200
Last post2017-03-28 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC PATCH 1/4] PM / Domains: Prepare for supporting explicit PM domain control Jon Hunter <jonathanh@nvidia.com> - 2017-03-28 16:20 +0200

#1611006 — [RFC PATCH 1/4] PM / Domains: Prepare for supporting explicit PM domain control

FromJon Hunter <jonathanh@nvidia.com>
Date2017-03-28 16:20 +0200
Subject[RFC PATCH 1/4] PM / Domains: Prepare for supporting explicit PM domain control
Message-ID<tq08y-pa-27@gated-at.bofh.it>
The generic PM domain framework only supports consumers that require a
single PM domain. In order to extend the framework so that consumers can
explicitly control more than one PM domain, detect if the consumers
specifies more than one PM domain and if it does then don't
automatically bind the device with any of the PM domains and (leap of
faith!) assume the consumer knows what to do!

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/base/power/domain.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index e697dec9d25b..0eb75954c087 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -2011,6 +2011,16 @@ int genpd_dev_pm_attach(struct device *dev)
 	if (dev->pm_domain)
 		return -EEXIST;
 
+	/*
+	 * If there are more than one PM domain defined for a device,
+	 * then these need to be manually controlled by the driver
+	 * that device, because the genpd core cannot bind a device
+	 * with more than one PM domain.
+	 */
+	if (of_count_phandle_with_args(dev->of_node, "power-domains",
+				       "#power-domain-cells") > 1)
+		return 0;
+
 	ret = of_parse_phandle_with_args(dev->of_node, "power-domains",
 					"#power-domain-cells", 0, &pd_args);
 	if (ret < 0) {
-- 
2.7.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web