aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/device_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/device_pm.c')
-rw-r--r--drivers/acpi/device_pm.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 43116cdbabf..c87853f583d 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -330,13 +330,23 @@ int acpi_bus_init_power(struct acpi_device *device)
if (result)
return result;
- if (device->power.flags.power_resources)
+ if (state < ACPI_STATE_D3_COLD && device->power.flags.power_resources) {
result = acpi_power_on_resources(device, state);
+ if (result)
+ return result;
- if (!result)
- device->power.state = state;
+ if (device->power.states[state].flags.explicit_set) {
+ char method[5] = { '_', 'P', 'S', '0' + state, '\0' };
+ acpi_status status;
- return result;
+ status = acpi_evaluate_object(device->handle, method,
+ NULL, NULL);
+ if (ACPI_FAILURE(status))
+ return -ENODEV;
+ }
+ }
+ device->power.state = state;
+ return 0;
}
int acpi_bus_update_power(acpi_handle handle, int *state_p)