diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-10-14 17:24:13 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-10-15 16:25:15 -0400 |
commit | 761afb869f649ea23e2dea7bfe9b550d3a1b7631 (patch) | |
tree | 816a6eb04802b1befedaf07f9c1359dd4dc7a9f6 /include | |
parent | cd07202cc8262e1669edff0d97715f3dd9260917 (diff) |
ACPI / PM: Fix problems with acpi_pm_device_sleep_state()
There is a number of problems with acpi_pm_device_sleep_state() now.
First, if _S0W is not defined, it prevents devices from being put
into D3 by PCI runtime PM, which shouldn't happen. Second, it
shouldn't use adev->wakeup.state.enabled, because if it's set, it
only means that either the device is permanently enabled to wake up
the system, or that it has been enabled to do that through
/proc/acpi/wakeup. Finally, it should be compiled if CONFIG_PM_SLEEP
is not set, so that PCI runtime PM works correctly in that case.
Fix these problems.
Reported-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_bus.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 4de84ce3a927..8ef68a16aa03 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -389,21 +389,25 @@ struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); | |||
389 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); | 389 | int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); |
390 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); | 390 | int acpi_disable_wakeup_device_power(struct acpi_device *dev); |
391 | 391 | ||
392 | #ifdef CONFIG_PM_SLEEP | 392 | #ifdef CONFIG_PM_OPS |
393 | int acpi_pm_device_sleep_state(struct device *, int *); | 393 | int acpi_pm_device_sleep_state(struct device *, int *); |
394 | int acpi_pm_device_sleep_wake(struct device *, bool); | 394 | #else |
395 | #else /* !CONFIG_PM_SLEEP */ | ||
396 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p) | 395 | static inline int acpi_pm_device_sleep_state(struct device *d, int *p) |
397 | { | 396 | { |
398 | if (p) | 397 | if (p) |
399 | *p = ACPI_STATE_D0; | 398 | *p = ACPI_STATE_D0; |
400 | return ACPI_STATE_D3; | 399 | return ACPI_STATE_D3; |
401 | } | 400 | } |
401 | #endif | ||
402 | |||
403 | #ifdef CONFIG_PM_SLEEP | ||
404 | int acpi_pm_device_sleep_wake(struct device *, bool); | ||
405 | #else | ||
402 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | 406 | static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) |
403 | { | 407 | { |
404 | return -ENODEV; | 408 | return -ENODEV; |
405 | } | 409 | } |
406 | #endif /* !CONFIG_PM_SLEEP */ | 410 | #endif |
407 | 411 | ||
408 | #endif /* CONFIG_ACPI */ | 412 | #endif /* CONFIG_ACPI */ |
409 | 413 | ||