[COMMON] theraml: exynos: added parse dynamic coeff
authorHyeonseong Gil <hs.gil@samsung.com>
Wed, 23 Mar 2016 00:56:37 +0000 (09:56 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:09:30 +0000 (17:09 +0900)
Change-Id: Iab544abd62415623f98cce49b8eee7c67ba0079e
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/thermal/samsung/exynos_tmu.c

index 72bfe84bffc5f208882e77468bf1debdce6b45c6..f89ac734d69fd302a3fd7fffbbae6824ef856379 100644 (file)
@@ -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));