From: Hyeonseong Gil Date: Fri, 16 Mar 2018 12:00:16 +0000 (+0900) Subject: [COMMON] cpufreq: acme: register/unregister cpu_cooling X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f208acab27a47afdb8b08988902a859d6f7fd004;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] cpufreq: acme: register/unregister cpu_cooling Change-Id: I259196e71acb3348a9e9868824b476be7ff49bef Signed-off-by: Hyeonseong Gil --- diff --git a/drivers/cpufreq/exynos-acme.c b/drivers/cpufreq/exynos-acme.c index 763c5482b8e3..c65985026e15 100644 --- a/drivers/cpufreq/exynos-acme.c +++ b/drivers/cpufreq/exynos-acme.c @@ -459,10 +459,24 @@ static int exynos_cpufreq_resume(struct cpufreq_policy *policy) static void exynos_cpufreq_ready(struct cpufreq_policy *policy) { + struct exynos_cpufreq_domain *domain = find_domain(policy->cpu); + + domain->cdev = exynos_cpufreq_cooling_register(domain->dn, policy); + if (IS_ERR(domain->cdev)) { + pr_err("running cpufreq without cooling device: %ld\n", + PTR_ERR(domain->cdev)); + + domain->cdev = NULL; + } } static int exynos_cpufreq_exit(struct cpufreq_policy *policy) { + struct exynos_cpufreq_domain *domain = find_domain(policy->cpu); + + if (domain->cdev) + cpufreq_cooling_unregister(domain->cdev); + return 0; } diff --git a/drivers/cpufreq/exynos-acme.h b/drivers/cpufreq/exynos-acme.h index 04112edd2a2a..1d15e7a3dbef 100644 --- a/drivers/cpufreq/exynos-acme.h +++ b/drivers/cpufreq/exynos-acme.h @@ -62,6 +62,8 @@ struct exynos_cpufreq_domain { /* list head of DVFS Manager constraints */ struct list_head dm_list; + + struct thermal_cooling_device *cdev; }; /*