]>
Commit | Line | Data |
---|---|---|
02361418 ADK |
1 | /* |
2 | * linux/include/linux/cpu_cooling.h | |
3 | * | |
4 | * Copyright (C) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com) | |
5 | * Copyright (C) 2012 Amit Daniel <amit.kachhap@linaro.org> | |
6 | * | |
7 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
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. | |
20 | * | |
21 | * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
22 | */ | |
23 | ||
24 | #ifndef __CPU_COOLING_H__ | |
25 | #define __CPU_COOLING_H__ | |
26 | ||
39d99cff | 27 | #include <linux/of.h> |
02361418 | 28 | #include <linux/thermal.h> |
198f38f7 | 29 | #include <linux/cpumask.h> |
02361418 | 30 | |
4d753aa7 VK |
31 | struct cpufreq_policy; |
32 | ||
bbf7fc88 | 33 | #ifdef CONFIG_CPU_THERMAL |
02361418 ADK |
34 | /** |
35 | * cpufreq_cooling_register - function to create cpufreq cooling device. | |
4d753aa7 | 36 | * @policy: cpufreq policy. |
02361418 | 37 | */ |
d44ada51 | 38 | struct thermal_cooling_device * |
4d753aa7 | 39 | cpufreq_cooling_register(struct cpufreq_policy *policy); |
02361418 ADK |
40 | |
41 | /** | |
42 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. | |
43 | * @cdev: thermal cooling device pointer. | |
44 | */ | |
45 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); | |
57df8106 | 46 | |
02361418 | 47 | #else /* !CONFIG_CPU_THERMAL */ |
d44ada51 | 48 | static inline struct thermal_cooling_device * |
4d753aa7 | 49 | cpufreq_cooling_register(struct cpufreq_policy *policy) |
02361418 | 50 | { |
503ccc3f | 51 | return ERR_PTR(-ENOSYS); |
02361418 | 52 | } |
c36cf071 | 53 | |
3ebb62ff VK |
54 | static inline |
55 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) | |
39d99cff | 56 | { |
3ebb62ff | 57 | return; |
39d99cff | 58 | } |
3ebb62ff | 59 | #endif /* CONFIG_CPU_THERMAL */ |
c36cf071 | 60 | |
3ebb62ff VK |
61 | #if defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) |
62 | /** | |
63 | * of_cpufreq_cooling_register - create cpufreq cooling device based on DT. | |
64 | * @policy: cpufreq policy. | |
65 | */ | |
66 | struct thermal_cooling_device * | |
67 | of_cpufreq_cooling_register(struct cpufreq_policy *policy); | |
68 | #else | |
c36cf071 | 69 | static inline struct thermal_cooling_device * |
3ebb62ff | 70 | of_cpufreq_cooling_register(struct cpufreq_policy *policy) |
c36cf071 JM |
71 | { |
72 | return NULL; | |
73 | } | |
3ebb62ff | 74 | #endif /* defined(CONFIG_THERMAL_OF) && defined(CONFIG_CPU_THERMAL) */ |
02361418 ADK |
75 | |
76 | #endif /* __CPU_COOLING_H__ */ |