aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/thermal.h
diff options
context:
space:
mode:
authorMatthew Garrett <mjg59@srcf.ucam.org>2008-11-27 12:48:13 -0500
committerLen Brown <len.brown@intel.com>2009-02-20 10:52:37 -0500
commit6503e5df08008b9a47022b5e9ebba658c8fa69af (patch)
tree8ef36d1b85d2a03ac9e61f5074d717b67f9259ba /include/linux/thermal.h
parentd2f8d7ee1a9b4650b4e43325b321801264f7c37a (diff)
thermal: use integers rather than strings for thermal values
The thermal API currently uses strings to pass values to userspace. This makes it difficult to use from within the kernel. Change the interface to use integers and fix up the consumers. Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r--include/linux/thermal.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 917707e6151d..4cb3292fb6e4 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -31,23 +31,39 @@
31struct thermal_zone_device; 31struct thermal_zone_device;
32struct thermal_cooling_device; 32struct thermal_cooling_device;
33 33
34enum thermal_device_mode {
35 THERMAL_DEVICE_DISABLED = 0,
36 THERMAL_DEVICE_ENABLED,
37};
38
39enum thermal_trip_type {
40 THERMAL_TRIP_ACTIVE = 0,
41 THERMAL_TRIP_PASSIVE,
42 THERMAL_TRIP_HOT,
43 THERMAL_TRIP_CRITICAL,
44};
45
34struct thermal_zone_device_ops { 46struct thermal_zone_device_ops {
35 int (*bind) (struct thermal_zone_device *, 47 int (*bind) (struct thermal_zone_device *,
36 struct thermal_cooling_device *); 48 struct thermal_cooling_device *);
37 int (*unbind) (struct thermal_zone_device *, 49 int (*unbind) (struct thermal_zone_device *,
38 struct thermal_cooling_device *); 50 struct thermal_cooling_device *);
39 int (*get_temp) (struct thermal_zone_device *, char *); 51 int (*get_temp) (struct thermal_zone_device *, unsigned long *);
40 int (*get_mode) (struct thermal_zone_device *, char *); 52 int (*get_mode) (struct thermal_zone_device *,
41 int (*set_mode) (struct thermal_zone_device *, const char *); 53 enum thermal_device_mode *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *); 54 int (*set_mode) (struct thermal_zone_device *,
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *); 55 enum thermal_device_mode);
56 int (*get_trip_type) (struct thermal_zone_device *, int,
57 enum thermal_trip_type *);
58 int (*get_trip_temp) (struct thermal_zone_device *, int,
59 unsigned long *);
44 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); 60 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
45}; 61};
46 62
47struct thermal_cooling_device_ops { 63struct thermal_cooling_device_ops {
48 int (*get_max_state) (struct thermal_cooling_device *, char *); 64 int (*get_max_state) (struct thermal_cooling_device *, unsigned long *);
49 int (*get_cur_state) (struct thermal_cooling_device *, char *); 65 int (*get_cur_state) (struct thermal_cooling_device *, unsigned long *);
50 int (*set_cur_state) (struct thermal_cooling_device *, unsigned int); 66 int (*set_cur_state) (struct thermal_cooling_device *, unsigned long);
51}; 67};
52 68
53#define THERMAL_TRIPS_NONE -1 69#define THERMAL_TRIPS_NONE -1