On 三, 2012-07-25 at 22:31 +0200, Rafael J. Wysocki wrote: > On Wednesday, July 25, 2012, Zhang Rui wrote: > > 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@xxxxxxxxx> > > --- > > drivers/acpi/thermal.c | 7 +++- > > drivers/thermal/thermal_sys.c | 91 +++++++++++++++++++++++++++++------------ > > 2 files changed, 71 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c > > index 5417362..8f8e695 100644 > > --- a/drivers/acpi/thermal.c > > +++ b/drivers/acpi/thermal.c > > @@ -714,7 +714,12 @@ 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_ACTIVE) { > > + /* aggressive active cooling */ > > + *trend = THERMAL_TREND_RAISING; > > + return 0; > > + } > > + > > Do we still need the check below? > No. Although there are other trip types like HOT/CRIT, but only updating PASSIVE/ACTIVE points will invoke this thermal_get_trend callback. > > if (type != THERMAL_TRIP_PASSIVE) > > return -EINVAL; > > thanks, rui -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html