diff options
author | Len Brown <len.brown@intel.com> | 2007-02-17 04:11:50 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-17 04:11:50 +0100 |
commit | 08e4a10ec82faf5ba67c8d0115b7bc9e58071555 (patch) | |
tree | be31751f933ea26d8e7edb592a19584c3ff50679 /drivers/acpi/thermal.c | |
parent | Pull bugzilla-7200 into release branch (diff) | |
parent | ACPI: fix fan after resume from S3 (diff) | |
download | linux-08e4a10ec82faf5ba67c8d0115b7bc9e58071555.tar.xz linux-08e4a10ec82faf5ba67c8d0115b7bc9e58071555.zip |
Pull bugzilla-7570 into release branch
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 15022bc86336..0ae8b9310cbf 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -1356,28 +1356,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; } |