devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal@arm.com>
To: devicetree@vger.kernel.org
Cc: viresh.kumar@linaro.org, Punit Agrawal <punit.agrawal@arm.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	edubezval@gmail.com, dawei.chien@mediatek.com
Subject: [PATCH v3 2/3] cpufreq-dt: Supply power coefficient when registering cooling devices
Date: Mon,  9 Nov 2015 17:29:22 +0000	[thread overview]
Message-ID: <1447090163-13700-3-git-send-email-punit.agrawal@arm.com> (raw)
In-Reply-To: <1447090163-13700-1-git-send-email-punit.agrawal@arm.com>

Support registering cooling devices with dynamic power coefficient
where provided by the device tree. This allows OF registered cooling
devices driver to be used with the power_allocator thermal governor.

Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Eduardo Valentin <edubezval@gmail.com>
---
 drivers/cpufreq/cpufreq-dt.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 7c0d70e..4434e45 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -407,8 +407,13 @@ static void cpufreq_ready(struct cpufreq_policy *policy)
 	 * thermal DT code takes care of matching them.
 	 */
 	if (of_find_property(np, "#cooling-cells", NULL)) {
-		priv->cdev = of_cpufreq_cooling_register(np,
-							 policy->related_cpus);
+		u32 power_coefficient = 0;
+
+		of_property_read_u32(np, "dynamic-power-coefficient",
+				     &power_coefficient);
+
+		priv->cdev = of_cpufreq_power_cooling_register(np,
+				policy->related_cpus, power_coefficient, NULL);
 		if (IS_ERR(priv->cdev)) {
 			dev_err(priv->cpu_dev,
 				"running cpufreq without cooling device: %ld\n",
-- 
2.5.3

  parent reply	other threads:[~2015-11-09 17:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-09 17:29 [PATCH v3 0/3] Dynamic power model from device tree Punit Agrawal
     [not found] ` <1447090163-13700-1-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>
2015-11-09 17:29   ` [PATCH v3 1/3] devicetree: bindings: Add optional dynamic-power-coefficient property Punit Agrawal
2015-11-09 17:45     ` Rob Herring
2015-11-09 18:39       ` Punit Agrawal
2015-11-09 17:29 ` Punit Agrawal [this message]
     [not found]   ` <1447090163-13700-3-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>
2015-11-10 12:28     ` [PATCH v3 2/3] cpufreq-dt: Supply power coefficient when registering cooling devices Javi Merino
2015-11-09 17:29 ` [PATCH v3 3/3] cpufreq: arm_big_little: Add support to register a cpufreq cooling device Punit Agrawal
     [not found]   ` <1447090163-13700-4-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>
2015-11-10 12:34     ` Javi Merino
2015-11-13  4:56   ` Viresh Kumar
2015-11-16 15:29     ` Punit Agrawal

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=1447090163-13700-3-git-send-email-punit.agrawal@arm.com \
    --to=punit.agrawal@arm.com \
    --cc=dawei.chien@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=edubezval@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=viresh.kumar@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).