summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq-dt.c
diff options
context:
space:
mode:
authorPunit Agrawal <punit.agrawal@arm.com>2015-11-17 07:06:22 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-09 18:14:58 -0500
commitf8fa8ae06b8c2c25d81c99766f9226adc5c3e073 (patch)
tree4c2b761f47ee1261e969e5e5e2eb8d1c74a94cdb /drivers/cpufreq/cpufreq-dt.c
parent3be3f8f36e7349006f19c8c8f0d686e98462a993 (diff)
cpufreq-dt: Supply power coefficient when registering cooling devices
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> Reviewed-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq-dt.c')
-rw-r--r--drivers/cpufreq/cpufreq-dt.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 90d64081ddb3..1ceece9d6711 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)
407 * thermal DT code takes care of matching them. 407 * thermal DT code takes care of matching them.
408 */ 408 */
409 if (of_find_property(np, "#cooling-cells", NULL)) { 409 if (of_find_property(np, "#cooling-cells", NULL)) {
410 priv->cdev = of_cpufreq_cooling_register(np, 410 u32 power_coefficient = 0;
411 policy->related_cpus); 411
412 of_property_read_u32(np, "dynamic-power-coefficient",
413 &power_coefficient);
414
415 priv->cdev = of_cpufreq_power_cooling_register(np,
416 policy->related_cpus, power_coefficient, NULL);
412 if (IS_ERR(priv->cdev)) { 417 if (IS_ERR(priv->cdev)) {
413 dev_err(priv->cpu_dev, 418 dev_err(priv->cpu_dev,
414 "running cpufreq without cooling device: %ld\n", 419 "running cpufreq without cooling device: %ld\n",