aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-02-16 22:11:50 -0500
committerLen Brown <len.brown@intel.com>2007-02-16 22:11:50 -0500
commit08e4a10ec82faf5ba67c8d0115b7bc9e58071555 (patch)
treebe31751f933ea26d8e7edb592a19584c3ff50679 /drivers
parent4559b438225b01942e1661759db0df55883b1bc0 (diff)
parentb1028c545ced13590dd9a9a8086543aef26c7187 (diff)
Pull bugzilla-7570 into release branch
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/bus.c15
-rw-r--r--drivers/acpi/power.c4
-rw-r--r--drivers/acpi/thermal.c28
3 files changed, 27 insertions, 20 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index fd37e19360d0..0c93cd400ddb 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -199,15 +199,14 @@ int acpi_bus_set_power(acpi_handle handle, int state)
199 * Get device's current power state if it's unknown 199 * Get device's current power state if it's unknown
200 * This means device power state isn't initialized or previous setting failed 200 * This means device power state isn't initialized or previous setting failed
201 */ 201 */
202 if (!device->flags.force_power_state) { 202 if ((device->power.state == ACPI_STATE_UNKNOWN) || device->flags.force_power_state)
203 if (device->power.state == ACPI_STATE_UNKNOWN) 203 acpi_bus_get_power(device->handle, &device->power.state);
204 acpi_bus_get_power(device->handle, &device->power.state); 204 if ((state == device->power.state) && !device->flags.force_power_state) {
205 if (state == device->power.state) { 205 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
206 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", 206 state));
207 state)); 207 return 0;
208 return 0;
209 }
210 } 208 }
209
211 if (!device->power.states[state].flags.valid) { 210 if (!device->power.states[state].flags.valid) {
212 printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); 211 printk(KERN_WARNING PREFIX "Device does not support D%d\n", state);
213 return -ENODEV; 212 return -ENODEV;
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 00d6118ff1ef..1ef338545dfe 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -455,6 +455,10 @@ int acpi_power_transition(struct acpi_device *device, int state)
455 goto end; 455 goto end;
456 } 456 }
457 457
458 if (device->power.state == state) {
459 goto end;
460 }
461
458 /* 462 /*
459 * Then we dereference all power resources used in the current list. 463 * Then we dereference all power resources used in the current list.
460 */ 464 */
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)
1356static int acpi_thermal_resume(struct acpi_device *device) 1356static int acpi_thermal_resume(struct acpi_device *device)
1357{ 1357{
1358 struct acpi_thermal *tz = NULL; 1358 struct acpi_thermal *tz = NULL;
1359 int i; 1359 int i, j, power_state, result;
1360
1360 1361
1361 if (!device || !acpi_driver_data(device)) 1362 if (!device || !acpi_driver_data(device))
1362 return -EINVAL; 1363 return -EINVAL;
1363 1364
1364 tz = acpi_driver_data(device); 1365 tz = acpi_driver_data(device);
1365 1366
1366 acpi_thermal_get_temperature(tz);
1367
1368 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) { 1367 for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++) {
1369 if (tz->trips.active[i].flags.valid) { 1368 if (!(&tz->trips.active[i]))
1370 tz->temperature = tz->trips.active[i].temperature; 1369 break;
1371 tz->trips.active[i].flags.enabled = 0; 1370 if (!tz->trips.active[i].flags.valid)
1372 1371 break;
1373 acpi_thermal_active(tz); 1372 tz->trips.active[i].flags.enabled = 1;
1374 1373 for (j = 0; j < tz->trips.active[i].devices.count; j++) {
1375 tz->state.active |= tz->trips.active[i].flags.enabled; 1374 result = acpi_bus_get_power(tz->trips.active[i].devices.
1376 tz->state.active_index = i; 1375 handles[j], &power_state);
1376 if (result || (power_state != ACPI_STATE_D0)) {
1377 tz->trips.active[i].flags.enabled = 0;
1378 break;
1379 }
1377 } 1380 }
1381 tz->state.active |= tz->trips.active[i].flags.enabled;
1378 } 1382 }
1379 1383
1380 acpi_thermal_check(tz); 1384 acpi_thermal_check(tz);
1381 1385
1382 return AE_OK; 1386 return AE_OK;
1383} 1387}