]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/acpi/thermal.c
Merge tag 'f2fs-for-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk...
[karo-tx-linux.git] / drivers / acpi / thermal.c
index 8470771e5eae1a2c69bc9df34c70c09138403128..a33821ca3895e672a32d1d145aca7108751667e5 100644 (file)
@@ -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;
+               }
        }
 
        /*