From: Hyeonseong Gil Date: Wed, 23 Mar 2016 00:56:37 +0000 (+0900) Subject: [COMMON] theraml: exynos: added parse dynamic coeff X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c6e5a732a1c8f09fd6d73762a7d868f09e0f9122;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] theraml: exynos: added parse dynamic coeff Change-Id: Iab544abd62415623f98cce49b8eee7c67ba0079e Signed-off-by: Hyeonseong Gil --- diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 72bfe84bffc5..f89ac734d69f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -1173,6 +1173,8 @@ static int exynos_cpufreq_cooling_register(struct exynos_tmu_data *data) struct of_phandle_args cooling_spec; struct cpumask mask_val; int cpu, ret; + const char *governor_name; + u32 power_coefficient = 0; np = of_find_node_by_name(NULL, "thermal-zones"); if (!np) @@ -1199,7 +1201,13 @@ static int exynos_cpufreq_cooling_register(struct exynos_tmu_data *data) if (cpu_topology[cpu].cluster_id == data->id) cpumask_copy(&mask_val, topology_core_cpumask(cpu)); - data->cool_dev = of_cpufreq_cooling_register(cool_np, &mask_val); + if (!of_property_read_string(child, "governor", &governor_name)) { + if (!strncasecmp(governor_name, "power_allocator", THERMAL_NAME_LENGTH)) { + of_property_read_u32(cool_np, "dynamic-power-coefficient", &power_coefficient); + } + } + + data->cool_dev = of_cpufreq_power_cooling_register(cool_np, &mask_val, power_coefficient, NULL); if (IS_ERR(data->cool_dev)) pr_err("cooling device register fail (mask = %x) \n", *(unsigned int*)cpumask_bits(&mask_val));