aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2012-06-26 22:05:39 -0400
committerZhang Rui <rui.zhang@intel.com>2012-09-24 02:44:37 -0400
commit4ae46befb49d4173122e0afa995c4e93d01948a2 (patch)
tree8585d4f0e2b67d51f5d945e3ab78fe610f592971 /drivers/acpi/thermal.c
parent1b7ddb840c3908464b19d4aa4f6dc4c463302442 (diff)
Thermal: Introduce thermal_zone_trip_update()
This function is used to update the cooling state of all the cooling devices that are bound to an active trip point. This will be used for passive cooling as well, in the future patches. as both active and passive cooling can share the same algorithm, which is 1. if the temperature is higher than a trip point, a. if the trend is THERMAL_TREND_RAISING, use higher cooling state for this trip point b. if the trend is THERMAL_TREND_DROPPING, use lower cooling state for this trip point 2. if the temperature is lower than a trip point, use lower cooling state for this trip point. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Eduardo Valentin <eduardo.valentin@ti.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 07cb2172bd09..bd66bd28a43f 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -716,9 +716,11 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
716 if (thermal_get_trip_type(thermal, trip, &type)) 716 if (thermal_get_trip_type(thermal, trip, &type))
717 return -EINVAL; 717 return -EINVAL;
718 718
719 /* Only PASSIVE trip points need TREND */ 719 if (type == THERMAL_TRIP_ACTIVE) {
720 if (type != THERMAL_TRIP_PASSIVE) 720 /* aggressive active cooling */
721 return -EINVAL; 721 *trend = THERMAL_TREND_RAISING;
722 return 0;
723 }
722 724
723 /* 725 /*
724 * tz->temperature has already been updated by generic thermal layer, 726 * tz->temperature has already been updated by generic thermal layer,