diff options
author | Konstantin Karasyov <konstantin.a.karasyov@intel.com> | 2007-02-16 08:23:07 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-16 08:23:07 +0100 |
commit | b1028c545ced13590dd9a9a8086543aef26c7187 (patch) | |
tree | c02123c234525697bae75e3817ca663ea787cbfb /drivers/acpi/thermal.c | |
parent | Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa (diff) | |
download | linux-b1028c545ced13590dd9a9a8086543aef26c7187.tar.xz linux-b1028c545ced13590dd9a9a8086543aef26c7187.zip |
ACPI: fix fan after resume from S3
http://bugzilla.kernel.org/show_bug.cgi?id=7570
Signed-off-by: Konstantin Karasyov <konstantin.a.karasyov@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 986afd470a14..7118ac67ef68 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1357,28 +1357,32 @@ static int acpi_thermal_remove(struct acpi_device *device, int type) static int acpi_thermal_resume(struct acpi_device *device) { struct acpi_thermal *tz = NULL; - int i; + int i, j, power_state, result; + if (!device || !acpi_driver_data(device)) return -EINVAL; tz = acpi_driver_data(device); - acpi_thermal_get_temperature(tz); - for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { - if (tz->trips.active[i].flags.valid) { - tz->temperature = tz->trips.active[i].temperature; - tz->trips.active[i].flags.enabled = 0; - - acpi_thermal_active(tz); - - tz->state.active |= tz->trips.active[i].flags.enabled; - tz->state.active_index = i; + if (!(&tz->trips.active[i])) + break; + if (!tz->trips.active[i].flags.valid) + break; + tz->trips.active[i].flags.enabled = 1; + for (j = 0; j < tz->trips.active[i].devices.count; j++) { + result = acpi_bus_get_power(tz->trips.active[i].devices. + handles[j], &power_state); + if (result || (power_state != ACPI_STATE_D0)) { + tz->trips.active[i].flags.enabled = 0; + break; + } } + tz->state.active |= tz->trips.active[i].flags.enabled; } - acpi_thermal_check(tz); + acpi_thermal_check(tz); return AE_OK; } |