aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma/host_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bcma/host_pci.c')
-rw-r--r--drivers/bcma/host_pci.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index b0994c0e05dc..443b83a2fd7a 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -234,6 +234,41 @@ static void bcma_host_pci_remove(struct pci_dev *dev)
234 pci_set_drvdata(dev, NULL); 234 pci_set_drvdata(dev, NULL);
235} 235}
236 236
237#ifdef CONFIG_PM
238static int bcma_host_pci_suspend(struct pci_dev *dev, pm_message_t state)
239{
240 /* Host specific */
241 pci_save_state(dev);
242 pci_disable_device(dev);
243 pci_set_power_state(dev, pci_choose_state(dev, state));
244
245 return 0;
246}
247
248static int bcma_host_pci_resume(struct pci_dev *dev)
249{
250 struct bcma_bus *bus = pci_get_drvdata(dev);
251 int err;
252
253 /* Host specific */
254 pci_set_power_state(dev, 0);
255 err = pci_enable_device(dev);
256 if (err)
257 return err;
258 pci_restore_state(dev);
259
260 /* Bus specific */
261 err = bcma_bus_resume(bus);
262 if (err)
263 return err;
264
265 return 0;
266}
267#else /* CONFIG_PM */
268# define bcma_host_pci_suspend NULL
269# define bcma_host_pci_resume NULL
270#endif /* CONFIG_PM */
271
237static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = { 272static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
238 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) }, 273 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
239 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) }, 274 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4331) },
@@ -249,6 +284,8 @@ static struct pci_driver bcma_pci_bridge_driver = {
249 .id_table = bcma_pci_bridge_tbl, 284 .id_table = bcma_pci_bridge_tbl,
250 .probe = bcma_host_pci_probe, 285 .probe = bcma_host_pci_probe,
251 .remove = bcma_host_pci_remove, 286 .remove = bcma_host_pci_remove,
287 .suspend = bcma_host_pci_suspend,
288 .resume = bcma_host_pci_resume,
252}; 289};
253 290
254int __init bcma_host_pci_init(void) 291int __init bcma_host_pci_init(void)