Skip to content

Commit 5b1a8eb

Browse files
punitagrawalAlex Shi
authored andcommitted
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> (cherry picked from commit f8fa8ae06b8c2c25d81c99766f9226adc5c3e073) Signed-off-by: Alex Shi <alex.shi@linaro.org>
1 parent 811cd74 commit 5b1a8eb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/cpufreq/cpufreq-dt.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,13 @@ static void cpufreq_ready(struct cpufreq_policy *policy)
406406
* thermal DT code takes care of matching them.
407407
*/
408408
if (of_find_property(np, "#cooling-cells", NULL)) {
409-
priv->cdev = of_cpufreq_cooling_register(np,
410-
policy->related_cpus);
409+
u32 power_coefficient = 0;
410+
411+
of_property_read_u32(np, "dynamic-power-coefficient",
412+
&power_coefficient);
413+
414+
priv->cdev = of_cpufreq_power_cooling_register(np,
415+
policy->related_cpus, power_coefficient, NULL);
411416
if (IS_ERR(priv->cdev)) {
412417
dev_err(priv->cpu_dev,
413418
"running cpufreq without cooling device: %ld\n",

0 commit comments

Comments
 (0)