diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-11-24 18:06:55 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 04:48:44 -0500 |
commit | 30d3df41b32b1ea63d3ebc52ef5644cbe41520f4 (patch) | |
tree | 8daf2d042493644776179dc75170c34dca68f743 /drivers/acpi/power.c | |
parent | d2ef555b57292cd818934636ac8e3414cc2a6762 (diff) |
ACPI / PM: Introduce function for refcounting device power resources
Introduce function acpi_power_on_resources() that reference counts
and possibly turns on ACPI power resources for a given device and
a given power state of it.
This function will be used for reference counting device power
resources during initialization.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r-- | drivers/acpi/power.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 95fedbdf4fb8..0cb4eab50d73 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
@@ -485,6 +485,14 @@ int acpi_power_get_inferred_state(struct acpi_device *device, int *state) | |||
485 | return 0; | 485 | return 0; |
486 | } | 486 | } |
487 | 487 | ||
488 | int acpi_power_on_resources(struct acpi_device *device, int state) | ||
489 | { | ||
490 | if (!device || state < ACPI_STATE_D0 || state > ACPI_STATE_D3) | ||
491 | return -EINVAL; | ||
492 | |||
493 | return acpi_power_on_list(&device->power.states[state].resources); | ||
494 | } | ||
495 | |||
488 | int acpi_power_transition(struct acpi_device *device, int state) | 496 | int acpi_power_transition(struct acpi_device *device, int state) |
489 | { | 497 | { |
490 | int result; | 498 | int result; |