From f208acab27a47afdb8b08988902a859d6f7fd004 Mon Sep 17 00:00:00 2001 From: Hyeonseong Gil Date: Fri, 16 Mar 2018 21:00:16 +0900 Subject: [PATCH] [COMMON] cpufreq: acme: register/unregister cpu_cooling Change-Id: I259196e71acb3348a9e9868824b476be7ff49bef Signed-off-by: Hyeonseong Gil --- drivers/cpufreq/exynos-acme.c | 14 ++++++++++++++ drivers/cpufreq/exynos-acme.h | 2 ++ 2 files changed, 16 insertions(+) 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; }; /* -- 2.20.1