diff options
Diffstat (limited to 'drivers/acpi/device_pm.c')
-rw-r--r-- | drivers/acpi/device_pm.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 318fa32a141e..31c217a42839 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -290,6 +290,26 @@ int acpi_bus_init_power(struct acpi_device *device) | |||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | /** | ||
294 | * acpi_device_fix_up_power - Force device with missing _PSC into D0. | ||
295 | * @device: Device object whose power state is to be fixed up. | ||
296 | * | ||
297 | * Devices without power resources and _PSC, but having _PS0 and _PS3 defined, | ||
298 | * are assumed to be put into D0 by the BIOS. However, in some cases that may | ||
299 | * not be the case and this function should be used then. | ||
300 | */ | ||
301 | int acpi_device_fix_up_power(struct acpi_device *device) | ||
302 | { | ||
303 | int ret = 0; | ||
304 | |||
305 | if (!device->power.flags.power_resources | ||
306 | && !device->power.flags.explicit_get | ||
307 | && device->power.state == ACPI_STATE_D0) | ||
308 | ret = acpi_dev_pm_explicit_set(device, ACPI_STATE_D0); | ||
309 | |||
310 | return ret; | ||
311 | } | ||
312 | |||
293 | int acpi_bus_update_power(acpi_handle handle, int *state_p) | 313 | int acpi_bus_update_power(acpi_handle handle, int *state_p) |
294 | { | 314 | { |
295 | struct acpi_device *device; | 315 | struct acpi_device *device; |