diff options
author | Zhang Rui <rui.zhang@intel.com> | 2012-06-26 21:54:33 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2012-09-24 02:44:36 -0400 |
commit | 601f3d4242be6ed6f72a2aadabc91e8255dad811 (patch) | |
tree | 497f09fcf665c066e4efc5d9542b33f021632ea9 /include/linux/thermal.h | |
parent | 9d99842f99d847191ebd0c28469d2c70fcc5bf9e (diff) |
Thermal: Introduce .get_trend() callback.
According to ACPI spec, tc1 and tc2 are used by OSPM
to anticipate the temperature trends.
We introduced the same concept to the generic thermal layer
for passive cooling, but now it seems that these values
are hard to be used on other platforms.
So We introduce .get_trend() as a more general solution.
For the platform thermal drivers that have their own way to
anticipate the temperature trends, they should provide
their own .get_trend() callback.
Or else, we will calculate the temperature trends by simply
comparing the current temperature and the cached previous
temperature reading.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl>
Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com>
Diffstat (limited to 'include/linux/thermal.h')
-rw-r--r-- | include/linux/thermal.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 5946a3b90bb2..6a1d43d2ec92 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -44,6 +44,12 @@ enum thermal_trip_type { | |||
44 | THERMAL_TRIP_CRITICAL, | 44 | THERMAL_TRIP_CRITICAL, |
45 | }; | 45 | }; |
46 | 46 | ||
47 | enum thermal_trend { | ||
48 | THERMAL_TREND_STABLE, /* temperature is stable */ | ||
49 | THERMAL_TREND_RAISING, /* temperature is raising */ | ||
50 | THERMAL_TREND_DROPPING, /* temperature is dropping */ | ||
51 | }; | ||
52 | |||
47 | struct thermal_zone_device_ops { | 53 | struct thermal_zone_device_ops { |
48 | int (*bind) (struct thermal_zone_device *, | 54 | int (*bind) (struct thermal_zone_device *, |
49 | struct thermal_cooling_device *); | 55 | struct thermal_cooling_device *); |
@@ -65,6 +71,8 @@ struct thermal_zone_device_ops { | |||
65 | int (*set_trip_hyst) (struct thermal_zone_device *, int, | 71 | int (*set_trip_hyst) (struct thermal_zone_device *, int, |
66 | unsigned long); | 72 | unsigned long); |
67 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); | 73 | int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *); |
74 | int (*get_trend) (struct thermal_zone_device *, int, | ||
75 | enum thermal_trend *); | ||
68 | int (*notify) (struct thermal_zone_device *, int, | 76 | int (*notify) (struct thermal_zone_device *, int, |
69 | enum thermal_trip_type); | 77 | enum thermal_trip_type); |
70 | }; | 78 | }; |
@@ -111,6 +119,7 @@ struct thermal_zone_device { | |||
111 | int tc2; | 119 | int tc2; |
112 | int passive_delay; | 120 | int passive_delay; |
113 | int polling_delay; | 121 | int polling_delay; |
122 | int temperature; | ||
114 | int last_temperature; | 123 | int last_temperature; |
115 | bool passive; | 124 | bool passive; |
116 | unsigned int forced_passive; | 125 | unsigned int forced_passive; |