summaryrefslogtreecommitdiff
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2012-06-27 10:05:39 +0800
committerSimone Willett <swillett@nvidia.com>2012-11-05 10:10:06 -0800
commitfe4ebbdab1278f738052d88ab0d3dfd921d0a07d (patch)
tree4d981819e103eb60658edf564613aabe33c907e8 /drivers/acpi/thermal.c
parent125810fe4d547ec7904cb37b6e943a4ecce05ed6 (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. bug 1059470 Change-Id: I01a713e5fed43369f3d43d0ef4999e5d478bdfea 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> Reviewed-on: http://git-master/r/159969 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Joshua Primero <jprimero@nvidia.com> Tested-by: Joshua Primero <jprimero@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.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 0c755d2803fa..a0b1e88c9eb5 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -714,9 +714,11 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
if (thermal_get_trip_type(thermal, trip, &type))
return -EINVAL;
- /* Only PASSIVE trip points need TREND */
- if (type != THERMAL_TRIP_PASSIVE)
- return -EINVAL;
+ if (type == THERMAL_TRIP_ACTIVE) {
+ /* aggressive active cooling */
+ *trend = THERMAL_TREND_RAISING;
+ return 0;
+ }
/*
* tz->temperature has already been updated by generic thermal layer,