aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c28
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)
1357static int acpi_thermal_resume(struct acpi_device *device) 1357static 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}