aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorAndrey Konovalov <andrey.konovalov@linaro.org>2013-05-08 22:31:27 +0400
committerAndrey Konovalov <andrey.konovalov@linaro.org>2013-05-08 22:31:27 +0400
commit79dbf9d1a443fc015e05dbeb5ab610059c6d9bf1 (patch)
tree044b23d8cb4827763dc0728dbaa76c4cd0eb7ac2 /drivers/acpi/thermal.c
parentde507154419bcaf3c135b94ba3bbb3f3a6464447 (diff)
parentc554f06fc801004f3fc3b162c490d8fdf4e79725 (diff)
Merge branch 'tracking-linux-3.9.y' into merge-linux-linaro-core-trackingllct-20130508.0
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 8470771e5eae..a33821ca3895 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -723,9 +723,19 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
return -EINVAL;
if (type == THERMAL_TRIP_ACTIVE) {
- /* aggressive active cooling */
- *trend = THERMAL_TREND_RAISING;
- return 0;
+ unsigned long trip_temp;
+ unsigned long temp = KELVIN_TO_MILLICELSIUS(tz->temperature,
+ tz->kelvin_offset);
+ if (thermal_get_trip_temp(thermal, trip, &trip_temp))
+ return -EINVAL;
+
+ if (temp > trip_temp) {
+ *trend = THERMAL_TREND_RAISING;
+ return 0;
+ } else {
+ /* Fall back on default trend */
+ return -EINVAL;
+ }
}
/*