diff options
author | Konstantin Karasyov <konstantin.a.karasyov@intel.com> | 2007-02-16 02:23:07 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-16 02:23:07 -0500 |
commit | b1028c545ced13590dd9a9a8086543aef26c7187 (patch) | |
tree | c02123c234525697bae75e3817ca663ea787cbfb /drivers/acpi/thermal.c | |
parent | 724339d76d9407cd1a8ad32a9c1fdf64840cc51b (diff) |
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) | |||
1357 | static int acpi_thermal_resume(struct acpi_device *device) | 1357 | static int acpi_thermal_resume(struct acpi_device *device) |
1358 | { | 1358 | { |
1359 | struct acpi_thermal *tz = NULL; | 1359 | struct acpi_thermal *tz = NULL; |
1360 | int i; | 1360 | int i, j, power_state, result; |
1361 | |||
1361 | 1362 | ||
1362 | if (!device || !acpi_driver_data(device)) | 1363 | if (!device || !acpi_driver_data(device)) |
1363 | return -EINVAL; | 1364 | return -EINVAL; |
1364 | 1365 | ||
1365 | tz = acpi_driver_data(device); | 1366 | tz = acpi_driver_data(device); |
1366 | 1367 | ||
1367 | acpi_thermal_get_temperature(tz); | ||
1368 | |||
1369 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { | 1368 | for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { |
1370 | if (tz->trips.active[i].flags.valid) { | 1369 | if (!(&tz->trips.active[i])) |
1371 | tz->temperature = tz->trips.active[i].temperature; | 1370 | break; |
1372 | tz->trips.active[i].flags.enabled = 0; | 1371 | if (!tz->trips.active[i].flags.valid) |
1373 | 1372 | break; | |
1374 | acpi_thermal_active(tz); | 1373 | tz->trips.active[i].flags.enabled = 1; |
1375 | 1374 | for (j = 0; j < tz->trips.active[i].devices.count; j++) { | |
1376 | tz->state.active |= tz->trips.active[i].flags.enabled; | 1375 | result = acpi_bus_get_power(tz->trips.active[i].devices. |
1377 | tz->state.active_index = i; | 1376 | handles[j], &power_state); |
1377 | if (result || (power_state != ACPI_STATE_D0)) { | ||
1378 | tz->trips.active[i].flags.enabled = 0; | ||
1379 | break; | ||
1380 | } | ||
1378 | } | 1381 | } |
1382 | tz->state.active |= tz->trips.active[i].flags.enabled; | ||
1379 | } | 1383 | } |
1380 | 1384 | ||
1381 | acpi_thermal_check(tz); | 1385 | acpi_thermal_check(tz); |
1382 | 1386 | ||
1383 | return AE_OK; | 1387 | return AE_OK; |
1384 | } | 1388 | } |