Skip to content

Commit

Permalink
thermal: mediatek: Add cpu dynamic power cooling model.
Browse files Browse the repository at this point in the history
MT8173 cpufreq driver select of_cpufreq_power_cooling_register registering
cooling devices with dynamic power coefficient.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Dawei Chien <dawei.chien@mediatek.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Dawei Chien authored and Eduardo Valentin committed May 17, 2016
1 parent b3aef78 commit d290160
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/cpufreq/mt8173-cpufreq.c
Original file line number Diff line number Diff line change
@@ -310,17 +310,24 @@ static int mtk_cpufreq_set_target(struct cpufreq_policy *policy,
return 0;
}

#define DYNAMIC_POWER "dynamic-power-coefficient"

static void mtk_cpufreq_ready(struct cpufreq_policy *policy)
{
struct mtk_cpu_dvfs_info *info = policy->driver_data;
struct device_node *np = of_node_get(info->cpu_dev->of_node);
u32 capacitance = 0;

if (WARN_ON(!np))
return;

if (of_find_property(np, "#cooling-cells", NULL)) {
info->cdev = of_cpufreq_cooling_register(np,
policy->related_cpus);
of_property_read_u32(np, DYNAMIC_POWER, &capacitance);

info->cdev = of_cpufreq_power_cooling_register(np,
policy->related_cpus,
capacitance,
NULL);

if (IS_ERR(info->cdev)) {
dev_err(info->cpu_dev,

0 comments on commit d290160

Please sign in to comment.