aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-acpi.c')
-rw-r--r--drivers/pci/pci-acpi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 9d6fc8e6285d..f7904ff2ace0 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -315,6 +315,25 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev,
315 } 315 }
316 return PCI_POWER_ERROR; 316 return PCI_POWER_ERROR;
317} 317}
318
319static int acpi_platform_enable_wakeup(struct device *dev, int is_on)
320{
321 struct acpi_device *adev;
322 int status;
323
324 if (!device_can_wakeup(dev))
325 return -EINVAL;
326
327 if (is_on && !device_may_wakeup(dev))
328 return -EINVAL;
329
330 status = acpi_bus_get_device(DEVICE_ACPI_HANDLE(dev), &adev);
331 if (status < 0)
332 return status;
333
334 adev->wakeup.state.enabled = !!is_on;
335 return 0;
336}
318#endif 337#endif
319 338
320static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) 339static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
@@ -399,6 +418,7 @@ static int __init acpi_pci_init(void)
399 return 0; 418 return 0;
400#ifdef CONFIG_ACPI_SLEEP 419#ifdef CONFIG_ACPI_SLEEP
401 platform_pci_choose_state = acpi_pci_choose_state; 420 platform_pci_choose_state = acpi_pci_choose_state;
421 platform_enable_wakeup = acpi_platform_enable_wakeup;
402#endif 422#endif
403 platform_pci_set_power_state = acpi_pci_set_power_state; 423 platform_pci_set_power_state = acpi_pci_set_power_state;
404 return 0; 424 return 0;