Commit | Line | Data |
---|---|---|
873e65bc | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
02361418 ADK |
2 | /* |
3 | * linux/include/linux/cpu_cooling.h | |
4 | * | |
5 | * Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com) | |
6 | * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org> | |
7 | * | |
8 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
02361418 ADK |
9 | * |
10 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
11 | */ | |
12 | ||
13 | #ifndef __CPU_COOLING_H__ | |
14 | #define __CPU_COOLING_H__ | |
15 | ||
39d99cff | 16 | #include <linux/of.h> |
02361418 | 17 | #include <linux/thermal.h> |
198f38f7 | 18 | #include <linux/cpumask.h> |
02361418 | 19 | |
4d753aa7 VK |
20 | struct cpufreq_policy; |
21 | ||
2b586fea | 22 | #ifdef CONFIG_CPU_FREQ_THERMAL |
02361418 ADK |
23 | /** |
24 | * cpufreq_cooling_register - function to create cpufreq cooling device. | |
4d753aa7 | 25 | * @policy: cpufreq policy. |
02361418 | 26 | */ |
d44ada51 | 27 | struct thermal_cooling_device * |
4d753aa7 | 28 | cpufreq_cooling_register(struct cpufreq_policy *policy); |
02361418 ADK |
29 | |
30 | /** | |
31 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. | |
32 | * @cdev: thermal cooling device pointer. | |
33 | */ | |
34 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); | |
57df8106 | 35 | |
0cac7559 DL |
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 | ||
2b586fea | 43 | #else /* !CONFIG_CPU_FREQ_THERMAL */ |
d44ada51 | 44 | static inline struct thermal_cooling_device * |
4d753aa7 | 45 | cpufreq_cooling_register(struct cpufreq_policy *policy) |
02361418 | 46 | { |
503ccc3f | 47 | return ERR_PTR(-ENOSYS); |
02361418 | 48 | } |
c36cf071 | 49 | |
3ebb62ff VK |
50 | static inline |
51 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) | |
39d99cff | 52 | { |
3ebb62ff | 53 | return; |
39d99cff | 54 | } |
c36cf071 JM |
55 | |
56 | static inline struct thermal_cooling_device * | |
3ebb62ff | 57 | of_cpufreq_cooling_register(struct cpufreq_policy *policy) |
c36cf071 JM |
58 | { |
59 | return NULL; | |
60 | } | |
2b586fea | 61 | #endif /* CONFIG_CPU_FREQ_THERMAL */ |
02361418 | 62 | |
a4c428e5 DL |
63 | struct cpuidle_driver; |
64 | ||
65 | #ifdef CONFIG_CPU_IDLE_THERMAL | |
dfd0bda3 | 66 | void cpuidle_cooling_register(struct cpuidle_driver *drv); |
a4c428e5 | 67 | #else /* CONFIG_CPU_IDLE_THERMAL */ |
dfd0bda3 | 68 | static inline void cpuidle_cooling_register(struct cpuidle_driver *drv) |
a4c428e5 | 69 | { |
a4c428e5 DL |
70 | } |
71 | #endif /* CONFIG_CPU_IDLE_THERMAL */ | |
72 | ||
02361418 | 73 | #endif /* __CPU_COOLING_H__ */ |