diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index dbe9f39f4436..2797112c9400 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1127,6 +1127,27 @@ int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable) | |||
1127 | } | 1127 | } |
1128 | 1128 | ||
1129 | /** | 1129 | /** |
1130 | * pci_wake_from_d3 - enable/disable device to wake up from D3_hot or D3_cold | ||
1131 | * @dev: PCI device to prepare | ||
1132 | * @enable: True to enable wake-up event generation; false to disable | ||
1133 | * | ||
1134 | * Many drivers want the device to wake up the system from D3_hot or D3_cold | ||
1135 | * and this function allows them to set that up cleanly - pci_enable_wake() | ||
1136 | * should not be called twice in a row to enable wake-up due to PCI PM vs ACPI | ||
1137 | * ordering constraints. | ||
1138 | * | ||
1139 | * This function only returns error code if the device is not capable of | ||
1140 | * generating PME# from both D3_hot and D3_cold, and the platform is unable to | ||
1141 | * enable wake-up power for it. | ||
1142 | */ | ||
1143 | int pci_wake_from_d3(struct pci_dev *dev, bool enable) | ||
1144 | { | ||
1145 | return pci_pme_capable(dev, PCI_D3cold) ? | ||
1146 | pci_enable_wake(dev, PCI_D3cold, enable) : | ||
1147 | pci_enable_wake(dev, PCI_D3hot, enable); | ||
1148 | } | ||
1149 | |||
1150 | /** | ||
1130 | * pci_target_state - find an appropriate low power state for a given PCI dev | 1151 | * pci_target_state - find an appropriate low power state for a given PCI dev |
1131 | * @dev: PCI device | 1152 | * @dev: PCI device |
1132 | * | 1153 | * |
@@ -1942,6 +1963,7 @@ EXPORT_SYMBOL(pci_restore_state); | |||
1942 | EXPORT_SYMBOL(pci_pme_capable); | 1963 | EXPORT_SYMBOL(pci_pme_capable); |
1943 | EXPORT_SYMBOL(pci_pme_active); | 1964 | EXPORT_SYMBOL(pci_pme_active); |
1944 | EXPORT_SYMBOL(pci_enable_wake); | 1965 | EXPORT_SYMBOL(pci_enable_wake); |
1966 | EXPORT_SYMBOL(pci_wake_from_d3); | ||
1945 | EXPORT_SYMBOL(pci_target_state); | 1967 | EXPORT_SYMBOL(pci_target_state); |
1946 | EXPORT_SYMBOL(pci_prepare_to_sleep); | 1968 | EXPORT_SYMBOL(pci_prepare_to_sleep); |
1947 | EXPORT_SYMBOL(pci_back_from_sleep); | 1969 | EXPORT_SYMBOL(pci_back_from_sleep); |