diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 9657abc4a7fb..453451090502 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -364,6 +364,31 @@ int acpi_bus_set_power(acpi_handle handle, int state) | |||
364 | 364 | ||
365 | EXPORT_SYMBOL(acpi_bus_set_power); | 365 | EXPORT_SYMBOL(acpi_bus_set_power); |
366 | 366 | ||
367 | |||
368 | int acpi_bus_init_power(struct acpi_device *device) | ||
369 | { | ||
370 | int state; | ||
371 | int result; | ||
372 | |||
373 | if (!device) | ||
374 | return -EINVAL; | ||
375 | |||
376 | device->power.state = ACPI_STATE_UNKNOWN; | ||
377 | |||
378 | result = __acpi_bus_get_power(device, &state); | ||
379 | if (result) | ||
380 | return result; | ||
381 | |||
382 | if (device->power.flags.power_resources) | ||
383 | result = acpi_power_on_resources(device, state); | ||
384 | |||
385 | if (!result) | ||
386 | device->power.state = state; | ||
387 | |||
388 | return result; | ||
389 | } | ||
390 | |||
391 | |||
367 | bool acpi_bus_power_manageable(acpi_handle handle) | 392 | bool acpi_bus_power_manageable(acpi_handle handle) |
368 | { | 393 | { |
369 | struct acpi_device *device; | 394 | struct acpi_device *device; |