public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Punit Agrawal <punit.agrawal-5wv7dgnIgG8@public.gmane.org>
To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Punit Agrawal <punit.agrawal-5wv7dgnIgG8@public.gmane.org>,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dawei.chien-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
	javi.merino-5wv7dgnIgG8@public.gmane.org
Subject: [PATCH v4 2/3] cpufreq-dt: Supply power coefficient when registering cooling devices
Date: Mon, 16 Nov 2015 19:30:24 +0000	[thread overview]
Message-ID: <1447702225-13323-3-git-send-email-punit.agrawal@arm.com> (raw)
In-Reply-To: <1447702225-13323-1-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>

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-5wv7dgnIgG8@public.gmane.org>
Acked-by: Viresh Kumar <viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Reviewed-by: Javi Merino <javi.merino-5wv7dgnIgG8@public.gmane.org>
Cc: Eduardo Valentin <edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 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 90d6408..1ceece9 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.6.2

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-11-16 19:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 19:30 [PATCH v4 0/3] Dynamic power model from device tree Punit Agrawal
2015-11-16 19:30 ` [PATCH v4 1/3] devicetree: bindings: Add optional dynamic-power-coefficient property Punit Agrawal
2015-11-16 23:23   ` Rob Herring
2015-11-17  4:36   ` Viresh Kumar
     [not found] ` <1447702225-13323-1-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>
2015-11-16 19:30   ` Punit Agrawal [this message]
2015-11-16 19:30 ` [PATCH v4 3/3] cpufreq: arm_big_little: Add support to register a cpufreq cooling device Punit Agrawal
     [not found]   ` <1447702225-13323-4-git-send-email-punit.agrawal-5wv7dgnIgG8@public.gmane.org>
2015-11-17  4:43     ` Viresh Kumar
2015-11-17 10:58       ` Punit Agrawal
2015-11-17  4:35 ` [PATCH v4 0/3] Dynamic power model from device tree Viresh Kumar
2015-11-17 10:05   ` 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=1447702225-13323-3-git-send-email-punit.agrawal@arm.com \
    --to=punit.agrawal-5wv7dgnigg8@public.gmane.org \
    --cc=dawei.chien-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=edubezval-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=javi.merino-5wv7dgnIgG8@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.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