From mboxrd@z Thu Jan 1 00:00:00 1970 From: Punit Agrawal Subject: [PATCH 2/9] cpufreq-dt: Supply power coefficient when registering cooling devices Date: Wed, 22 Jul 2015 15:02:36 +0100 Message-ID: <1437573763-6525-3-git-send-email-punit.agrawal@arm.com> References: <1437573763-6525-1-git-send-email-punit.agrawal@arm.com> Return-path: In-Reply-To: <1437573763-6525-1-git-send-email-punit.agrawal@arm.com> Sender: linux-kernel-owner@vger.kernel.org To: linux-pm@vger.kernel.org Cc: Punit Agrawal , lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Viresh Kumar , Eduardo Valentin List-Id: devicetree@vger.kernel.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 Cc: Viresh Kumar Cc: Eduardo Valentin --- 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 528a82bf..1d1f61a 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -344,8 +344,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.1.4