[COMMON] cpufreq: acme: register/unregister cpu_cooling
authorHyeonseong Gil <hs.gil@samsung.com>
Fri, 16 Mar 2018 12:00:16 +0000 (21:00 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:08 +0000 (20:22 +0300)
Change-Id: I259196e71acb3348a9e9868824b476be7ff49bef
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
drivers/cpufreq/exynos-acme.c
drivers/cpufreq/exynos-acme.h

index 763c5482b8e355ac0eba2f2c4e1afeea0ef05b06..c65985026e154fe38fba3c16018e52d9c6978dfd 100644 (file)
@@ -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;
 }
 
index 04112edd2a2a8875e4a0609cd2b3f816a0c2a863..1d15e7a3dbef0ea0ffe83616f3f4a0fd49f6727f 100644 (file)
@@ -62,6 +62,8 @@ struct exynos_cpufreq_domain {
 
        /* list head of DVFS Manager constraints */
        struct list_head                dm_list;
+
+       struct thermal_cooling_device *cdev;
 };
 
 /*