blob: 75ef931fc4fc4b1e5271dae83b6f0233bef023fb [file] [log] [blame]
Amit Daniel Kachhap02361412012-08-16 17:11:40 +05301/*
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 Valentin198f38f2013-04-24 23:10:28 +080028#include <linux/cpumask.h>
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053029
30#define CPUFREQ_COOLING_START 0
31#define CPUFREQ_COOLING_STOP 1
32
Zhang Ruibbf7fc82013-03-26 23:57:01 +080033#ifdef CONFIG_CPU_THERMAL
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053034/**
35 * cpufreq_cooling_register - function to create cpufreq cooling device.
36 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
37 */
38struct thermal_cooling_device *cpufreq_cooling_register(
Eduardo Valentin3778ff52012-11-12 15:58:50 +000039 const struct cpumask *clip_cpus);
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053040
41/**
42 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
43 * @cdev: thermal cooling device pointer.
44 */
45void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
Zhang Rui57df8102013-02-08 14:52:06 +080046
47unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int);
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053048#else /* !CONFIG_CPU_THERMAL */
49static inline struct thermal_cooling_device *cpufreq_cooling_register(
Eduardo Valentin3778ff52012-11-12 15:58:50 +000050 const struct cpumask *clip_cpus)
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053051{
52 return NULL;
53}
54static inline void cpufreq_cooling_unregister(
55 struct thermal_cooling_device *cdev)
56{
57 return;
58}
Zhang Rui57df8102013-02-08 14:52:06 +080059static inline unsigned long cpufreq_cooling_get_level(unsigned int,
60 unsigned int)
61{
62 return THERMAL_CSTATE_INVALID;
63}
Amit Daniel Kachhap02361412012-08-16 17:11:40 +053064#endif /* CONFIG_CPU_THERMAL */
65
66#endif /* __CPU_COOLING_H__ */