aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 12:40:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-09 12:40:49 -0400
commitb29bdba51924f6fd5971352ba111784dee3a5853 (patch)
tree95f8b7adfd75ce1d6c86b06f9347247aefecd075 /include/linux
parente0fd9affeb64088eff407dfc98bbd3a5c17ea479 (diff)
parentde6558dc964f6a3243218f17d8032ad810864e2b (diff)
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management update from Zhang Rui: "The most important one is to build thermal core and governor and cpu cooling code into one module. This fixes a regression that thermal core does not work if it is built as module, since 3.7. I'll backport them to stable kernel once those changes are in upstream. The largest batch is the thermal kernel-doc & coding style updates/cleanups from Eduardo. Highlights: - build all thermal framework code into one module to fix a regression that thermal does not work if it is built as module. - Marvell Armada 370/XP thermal sensor driver - thermal core/cpu cooling kernel-doc & coding style updates and cleanups. - Add Eduardo Valentin as thermal sub-maintainer, both in mailing list and patchwork. He will help me on arm thermal drivers." * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (68 commits) thermal: db8500_cpufreq_cooling: remove usage of IS_ERR_OR_NULL() thermal: thermal_core: remove usage of IS_ERR_OR_NULL thermal: cpu_cooling: improve line breaking thermal: cpu_cooling: alignment improvements thermal: cpu_cooling: remove checkpatch.pl warning thermal: cpu_cooling: remove trailing blank line thermal: cpu_cooling: align on open parenthesis thermal: cpu_cooling: standardize comment style thermal: cpu_cooling: standardize end of function thermal: cpu_cooling: remove trailing white spaces Thermal: update documentation for thermal_zone_device_register thermal: update kernel-doc for thermal_zone_device_register thermal: update kernel-doc for create_trip_attrs thermal: update kernel-doc for thermal_cooling_device_register thermal: update kernel-doc for thermal_zone_unbind_cooling_device thermal: update kernel-doc for thermal_zone_bind_cooling_device thermal: use EXPORT_SYMBOL_GPL thermal: rename notify_thermal_framework to thermal_notify_framework thermal: update driver license thermal: use strlcpy instead of strcpy ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpu_cooling.h25
-rw-r--r--include/linux/thermal.h15
2 files changed, 23 insertions, 17 deletions
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index 40b4ef54cc7d..282e27028418 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -25,34 +25,39 @@
25#define __CPU_COOLING_H__ 25#define __CPU_COOLING_H__
26 26
27#include <linux/thermal.h> 27#include <linux/thermal.h>
28#include <linux/cpumask.h>
28 29
29#define CPUFREQ_COOLING_START 0 30#ifdef CONFIG_CPU_THERMAL
30#define CPUFREQ_COOLING_STOP 1
31
32#if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE)
33/** 31/**
34 * cpufreq_cooling_register - function to create cpufreq cooling device. 32 * cpufreq_cooling_register - function to create cpufreq cooling device.
35 * @clip_cpus: cpumask of cpus where the frequency constraints will happen 33 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
36 */ 34 */
37struct thermal_cooling_device *cpufreq_cooling_register( 35struct thermal_cooling_device *
38 const struct cpumask *clip_cpus); 36cpufreq_cooling_register(const struct cpumask *clip_cpus);
39 37
40/** 38/**
41 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 39 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
42 * @cdev: thermal cooling device pointer. 40 * @cdev: thermal cooling device pointer.
43 */ 41 */
44void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); 42void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
43
44unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int);
45#else /* !CONFIG_CPU_THERMAL */ 45#else /* !CONFIG_CPU_THERMAL */
46static inline struct thermal_cooling_device *cpufreq_cooling_register( 46static inline struct thermal_cooling_device *
47 const struct cpumask *clip_cpus) 47cpufreq_cooling_register(const struct cpumask *clip_cpus)
48{ 48{
49 return NULL; 49 return NULL;
50} 50}
51static inline void cpufreq_cooling_unregister( 51static inline
52 struct thermal_cooling_device *cdev) 52void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
53{ 53{
54 return; 54 return;
55} 55}
56static inline
57unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int)
58{
59 return THERMAL_CSTATE_INVALID;
60}
56#endif /* CONFIG_CPU_THERMAL */ 61#endif /* CONFIG_CPU_THERMAL */
57 62
58#endif /* __CPU_COOLING_H__ */ 63#endif /* __CPU_COOLING_H__ */
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index e3c0ae9bb1fa..a386a1cbb6e1 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -33,8 +33,11 @@
33#define THERMAL_MAX_TRIPS 12 33#define THERMAL_MAX_TRIPS 12
34#define THERMAL_NAME_LENGTH 20 34#define THERMAL_NAME_LENGTH 20
35 35
36/* invalid cooling state */
37#define THERMAL_CSTATE_INVALID -1UL
38
36/* No upper/lower limit requirement */ 39/* No upper/lower limit requirement */
37#define THERMAL_NO_LIMIT -1UL 40#define THERMAL_NO_LIMIT THERMAL_CSTATE_INVALID
38 41
39/* Unit conversion macros */ 42/* Unit conversion macros */
40#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \ 43#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
@@ -184,7 +187,6 @@ struct thermal_governor {
184 char name[THERMAL_NAME_LENGTH]; 187 char name[THERMAL_NAME_LENGTH];
185 int (*throttle)(struct thermal_zone_device *tz, int trip); 188 int (*throttle)(struct thermal_zone_device *tz, int trip);
186 struct list_head governor_list; 189 struct list_head governor_list;
187 struct module *owner;
188}; 190};
189 191
190/* Structure that holds binding parameters for a zone */ 192/* Structure that holds binding parameters for a zone */
@@ -237,21 +239,20 @@ void thermal_zone_device_update(struct thermal_zone_device *);
237struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 239struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
238 const struct thermal_cooling_device_ops *); 240 const struct thermal_cooling_device_ops *);
239void thermal_cooling_device_unregister(struct thermal_cooling_device *); 241void thermal_cooling_device_unregister(struct thermal_cooling_device *);
242struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
243int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);
240 244
241int get_tz_trend(struct thermal_zone_device *, int); 245int get_tz_trend(struct thermal_zone_device *, int);
242struct thermal_instance *get_thermal_instance(struct thermal_zone_device *, 246struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
243 struct thermal_cooling_device *, int); 247 struct thermal_cooling_device *, int);
244void thermal_cdev_update(struct thermal_cooling_device *); 248void thermal_cdev_update(struct thermal_cooling_device *);
245void notify_thermal_framework(struct thermal_zone_device *, int); 249void thermal_notify_framework(struct thermal_zone_device *, int);
246
247int thermal_register_governor(struct thermal_governor *);
248void thermal_unregister_governor(struct thermal_governor *);
249 250
250#ifdef CONFIG_NET 251#ifdef CONFIG_NET
251extern int thermal_generate_netlink_event(struct thermal_zone_device *tz, 252extern int thermal_generate_netlink_event(struct thermal_zone_device *tz,
252 enum events event); 253 enum events event);
253#else 254#else
254static int thermal_generate_netlink_event(struct thermal_zone_device *tz, 255static inline int thermal_generate_netlink_event(struct thermal_zone_device *tz,
255 enum events event) 256 enum events event)
256{ 257{
257 return 0; 258 return 0;