aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/pci.c20
-rw-r--r--drivers/pci/pci.h1
-rw-r--r--drivers/pci/probe.c1
3 files changed, 22 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7e9c0f3936dd..1b807330e500 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1286,6 +1286,26 @@ void pci_pm_init(struct pci_dev *dev)
1286} 1286}
1287 1287
1288/** 1288/**
1289 * platform_pci_wakeup_init - init platform wakeup if present
1290 * @dev: PCI device
1291 *
1292 * Some devices don't have PCI PM caps but can still generate wakeup
1293 * events through platform methods (like ACPI events). If @dev supports
1294 * platform wakeup events, set the device flag to indicate as much. This
1295 * may be redundant if the device also supports PCI PM caps, but double
1296 * initialization should be safe in that case.
1297 */
1298void platform_pci_wakeup_init(struct pci_dev *dev)
1299{
1300 if (!platform_pci_can_wakeup(dev))
1301 return;
1302
1303 device_set_wakeup_capable(&dev->dev, true);
1304 device_set_wakeup_enable(&dev->dev, false);
1305 platform_pci_sleep_wake(dev, false);
1306}
1307
1308/**
1289 * pci_add_save_buffer - allocate buffer for saving given capability registers 1309 * pci_add_save_buffer - allocate buffer for saving given capability registers
1290 * @dev: the PCI device 1310 * @dev: the PCI device
1291 * @cap: the capability to allocate the buffer for 1311 * @cap: the capability to allocate the buffer for
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index d1e92d83aa06..65deed8bfc06 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -45,6 +45,7 @@ struct pci_platform_pm_ops {
45 45
46extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops); 46extern int pci_set_platform_pm(struct pci_platform_pm_ops *ops);
47extern void pci_pm_init(struct pci_dev *dev); 47extern void pci_pm_init(struct pci_dev *dev);
48extern void platform_pci_wakeup_init(struct pci_dev *dev);
48extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); 49extern void pci_allocate_cap_save_buffers(struct pci_dev *dev);
49 50
50extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val); 51extern int pci_user_read_config_byte(struct pci_dev *dev, int where, u8 *val);
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2ee00962734b..303644614eea 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -965,6 +965,7 @@ static void pci_init_capabilities(struct pci_dev *dev)
965 965
966 /* Power Management */ 966 /* Power Management */
967 pci_pm_init(dev); 967 pci_pm_init(dev);
968 platform_pci_wakeup_init(dev);
968 969
969 /* Vital Product Data */ 970 /* Vital Product Data */
970 pci_vpd_pci22_init(dev); 971 pci_vpd_pci22_init(dev);