[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1571254641-13626-6-git-send-email-thara.gopinath@linaro.org>
Date: Wed, 16 Oct 2019 15:37:19 -0400
From: Thara Gopinath <thara.gopinath@...aro.org>
To: edubezval@...il.com, rui.zhang@...el.com, ulf.hansson@...aro.org,
daniel.lezcano@...aro.org, bjorn.andersson@...aro.org,
agross@...nel.org
Cc: amit.kucheria@...durent.com, mark.rutland@....com,
rjw@...ysocki.net, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v3 5/7] soc: qcom: Extend RPMh power controller driver to register warming devices.
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@...aro.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
Powered by blists - more mailing lists