hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/include/linux/cpu_cooling.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * linux/include/linux/cpu_cooling.h
34 *
....@@ -5,18 +6,6 @@
56 * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org>
67 *
78 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; version 2 of the License.
11
- *
12
- * This program is distributed in the hope that it will be useful, but
13
- * WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
- * General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along
18
- * with this program; if not, write to the Free Software Foundation, Inc.,
19
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
209 *
2110 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2211 */
....@@ -30,13 +19,7 @@
3019
3120 struct cpufreq_policy;
3221
33
-typedef int (*plat_mitig_t)(int cpu, u32 clip_freq);
34
-
35
-struct cpu_cooling_ops {
36
- plat_mitig_t ceil_limit, floor_limit;
37
-};
38
-
39
-#ifdef CONFIG_CPU_THERMAL
22
+#ifdef CONFIG_CPU_FREQ_THERMAL
4023 /**
4124 * cpufreq_cooling_register - function to create cpufreq cooling device.
4225 * @policy: cpufreq policy.
....@@ -44,28 +27,24 @@
4427 struct thermal_cooling_device *
4528 cpufreq_cooling_register(struct cpufreq_policy *policy);
4629
47
-struct thermal_cooling_device *
48
-cpufreq_platform_cooling_register(struct cpufreq_policy *policy,
49
- struct cpu_cooling_ops *ops);
50
-
5130 /**
5231 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
5332 * @cdev: thermal cooling device pointer.
5433 */
5534 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
5635
57
-#else /* !CONFIG_CPU_THERMAL */
36
+/**
37
+ * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
38
+ * @policy: cpufreq policy.
39
+ */
40
+struct thermal_cooling_device *
41
+of_cpufreq_cooling_register(struct cpufreq_policy *policy);
42
+
43
+#else /* !CONFIG_CPU_FREQ_THERMAL */
5844 static inline struct thermal_cooling_device *
5945 cpufreq_cooling_register(struct cpufreq_policy *policy)
6046 {
6147 return ERR_PTR(-ENOSYS);
62
-}
63
-
64
-static inline struct thermal_cooling_device *
65
-cpufreq_platform_cooling_register(struct cpufreq_policy *policy,
66
- struct cpu_cooling_ops *ops)
67
-{
68
- return NULL;
6948 }
7049
7150 static inline
....@@ -73,21 +52,22 @@
7352 {
7453 return;
7554 }
76
-#endif /* CONFIG_CPU_THERMAL */
7755
78
-#if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL)
79
-/**
80
- * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
81
- * @policy: cpufreq policy.
82
- */
83
-struct thermal_cooling_device *
84
-of_cpufreq_cooling_register(struct cpufreq_policy *policy);
85
-#else
8656 static inline struct thermal_cooling_device *
8757 of_cpufreq_cooling_register(struct cpufreq_policy *policy)
8858 {
8959 return NULL;
9060 }
91
-#endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */
61
+#endif /* CONFIG_CPU_FREQ_THERMAL */
62
+
63
+struct cpuidle_driver;
64
+
65
+#ifdef CONFIG_CPU_IDLE_THERMAL
66
+void cpuidle_cooling_register(struct cpuidle_driver *drv);
67
+#else /* CONFIG_CPU_IDLE_THERMAL */
68
+static inline void cpuidle_cooling_register(struct cpuidle_driver *drv)
69
+{
70
+}
71
+#endif /* CONFIG_CPU_IDLE_THERMAL */
9272
9373 #endif /* __CPU_COOLING_H__ */