Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 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 | |
| 27 | #include <linux/thermal.h> |
Eduardo Valentin | 198f38f | 2013-04-24 23:10:28 +0800 | [diff] [blame] | 28 | #include <linux/cpumask.h> |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 29 | |
Zhang Rui | bbf7fc8 | 2013-03-26 23:57:01 +0800 | [diff] [blame] | 30 | #ifdef CONFIG_CPU_THERMAL |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 31 | /** |
| 32 | * cpufreq_cooling_register - function to create cpufreq cooling device. |
| 33 | * @clip_cpus: cpumask of cpus where the frequency constraints will happen |
| 34 | */ |
Eduardo Valentin | d44ada5 | 2013-04-17 17:12:23 +0000 | [diff] [blame] | 35 | struct thermal_cooling_device * |
| 36 | cpufreq_cooling_register(const struct cpumask *clip_cpus); |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 37 | |
| 38 | /** |
| 39 | * cpufreq_cooling_unregister - function to remove cpufreq cooling device. |
| 40 | * @cdev: thermal cooling device pointer. |
| 41 | */ |
| 42 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); |
Zhang Rui | 57df810 | 2013-02-08 14:52:06 +0800 | [diff] [blame] | 43 | |
| 44 | unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int); |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 45 | #else /* !CONFIG_CPU_THERMAL */ |
Eduardo Valentin | d44ada5 | 2013-04-17 17:12:23 +0000 | [diff] [blame] | 46 | static inline struct thermal_cooling_device * |
| 47 | cpufreq_cooling_register(const struct cpumask *clip_cpus) |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 48 | { |
| 49 | return NULL; |
| 50 | } |
Eduardo Valentin | d44ada5 | 2013-04-17 17:12:23 +0000 | [diff] [blame] | 51 | static inline |
| 52 | void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 53 | { |
| 54 | return; |
| 55 | } |
Eduardo Valentin | d44ada5 | 2013-04-17 17:12:23 +0000 | [diff] [blame] | 56 | static inline |
| 57 | unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int) |
Zhang Rui | 57df810 | 2013-02-08 14:52:06 +0800 | [diff] [blame] | 58 | { |
| 59 | return THERMAL_CSTATE_INVALID; |
| 60 | } |
Amit Daniel Kachhap | 0236141 | 2012-08-16 17:11:40 +0530 | [diff] [blame] | 61 | #endif /* CONFIG_CPU_THERMAL */ |
| 62 | |
| 63 | #endif /* __CPU_COOLING_H__ */ |