All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thara Gopinath <thara.gopinath@linaro.org>
To: edubezval@gmail.com, rui.zhang@intel.com, ulf.hansson@linaro.org,
	daniel.lezcano@linaro.org, bjorn.andersson@linaro.org,
	agross@kernel.org
Cc: amit.kucheria@verdurent.com, mark.rutland@arm.com,
	rjw@rjwysocki.net, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v3 5/7] soc: qcom: Extend RPMh power controller driver to register warming devices.
Date: Wed, 16 Oct 2019 15:37:19 -0400	[thread overview]
Message-ID: <1571254641-13626-6-git-send-email-thara.gopinath@linaro.org> (raw)
In-Reply-To: <1571254641-13626-1-git-send-email-thara.gopinath@linaro.org>

RPMh power control hosts power domains that can be used as
thermal warming devices. Register these power domains
with the generic power domain warming device thermal framework.

Signed-off-by: Thara Gopinath <thara.gopinath@linaro.org>
---
 drivers/soc/qcom/rpmhpd.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/rpmhpd.c b/drivers/soc/qcom/rpmhpd.c
index 9d37534..88ba615 100644
--- a/drivers/soc/qcom/rpmhpd.c
+++ b/drivers/soc/qcom/rpmhpd.c
@@ -11,6 +11,7 @@
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/pm_opp.h>
+#include <linux/pwr_domain_warming.h>
 #include <soc/qcom/cmd-db.h>
 #include <soc/qcom/rpmh.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
@@ -333,6 +334,7 @@ static int rpmhpd_probe(struct platform_device *pdev)
 	struct genpd_onecell_data *data;
 	struct rpmhpd **rpmhpds;
 	const struct rpmhpd_desc *desc;
+	struct device_node *child;
 
 	desc = of_device_get_match_data(dev);
 	if (!desc)
@@ -396,7 +398,24 @@ static int rpmhpd_probe(struct platform_device *pdev)
 					       &rpmhpds[i]->pd);
 	}
 
-	return of_genpd_add_provider_onecell(pdev->dev.of_node, data);
+	ret = of_genpd_add_provider_onecell(pdev->dev.of_node, data);
+
+	if (ret)
+		return ret;
+
+	for_each_available_child_of_node(dev->of_node, child) {
+		if (!of_find_property(child, "#cooling-cells", NULL))
+			continue;
+
+		for (i = 0; i < num_pds; i++)
+			if (strcmp(child->name, rpmhpds[i]->pd.name) == 0)
+				break;
+		if (i == num_pds)
+			continue;
+		pwr_domain_warming_register(child, &rpmhpds[i]->pd);
+	}
+
+	return 0;
 }
 
 static struct platform_driver rpmhpd_driver = {
-- 
2.1.4


  parent reply	other threads:[~2019-10-16 19:37 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16 19:37 [PATCH v3 0/7]Introduce Power domain based warming device driver Thara Gopinath
2019-10-16 19:37 ` [PATCH v3 1/7] PM/Domains: Add support for retrieving genpd performance states information Thara Gopinath
2019-10-17  8:49   ` Ulf Hansson
2019-10-17 16:11     ` Thara Gopinath
2019-10-16 19:37 ` [PATCH v3 2/7] soc: qcom: rpmhpd: Introduce function to retrieve power domain performance state count Thara Gopinath
2019-10-16 19:37 ` [PATCH v3 3/7] thermal: core: Add late init hook to cooling device ops Thara Gopinath
2019-12-03 17:04   ` Amit Kucheria
2019-12-03 17:09     ` Thara Gopinath
2019-12-03 17:11     ` Amit Kucheria
2019-10-16 19:37 ` [PATCH v3 4/7] thermal: Add generic power domain warming device driver Thara Gopinath
2019-10-17  8:47   ` Ulf Hansson
2019-10-17 15:46     ` Thara Gopinath
2019-10-16 19:37 ` Thara Gopinath [this message]
2019-10-16 19:37 ` [PATCH v3 6/7] dt-bindings: soc: qcom: Extend RPMh power controller binding to describe thermal warming device Thara Gopinath
2019-10-17  9:04   ` Ulf Hansson
2019-10-17 15:28     ` Thara Gopinath
2019-10-17 15:43       ` Ulf Hansson
2019-10-17 16:10         ` Thara Gopinath
2019-10-29  1:36           ` Rob Herring
2019-10-29 10:06             ` Ulf Hansson
2019-10-29 20:16               ` Rob Herring
2019-10-30  9:27                 ` Ulf Hansson
2019-10-30 14:27                 ` Thara Gopinath
2019-10-16 19:37 ` [PATCH v3 7/7] arm64: dts: qcom: Add mx power domain as " Thara Gopinath
2019-10-29  1:31   ` Rob Herring
2019-10-30 14:23     ` Thara Gopinath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1571254641-13626-6-git-send-email-thara.gopinath@linaro.org \
    --to=thara.gopinath@linaro.org \
    --cc=agross@kernel.org \
    --cc=amit.kucheria@verdurent.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=rui.zhang@intel.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.