aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/setup-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/setup-pci.c')
-rw-r--r--drivers/ide/setup-pci.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index a8e9e8a69a52..9f1f9163a136 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -659,3 +659,36 @@ void ide_pci_remove(struct pci_dev *dev)
659 pci_disable_device(dev); 659 pci_disable_device(dev);
660} 660}
661EXPORT_SYMBOL_GPL(ide_pci_remove); 661EXPORT_SYMBOL_GPL(ide_pci_remove);
662
663#ifdef CONFIG_PM
664int ide_pci_suspend(struct pci_dev *dev, pm_message_t state)
665{
666 pci_save_state(dev);
667 pci_disable_device(dev);
668 pci_set_power_state(dev, pci_choose_state(dev, state));
669
670 return 0;
671}
672EXPORT_SYMBOL_GPL(ide_pci_suspend);
673
674int ide_pci_resume(struct pci_dev *dev)
675{
676 struct ide_host *host = pci_get_drvdata(dev);
677 int rc;
678
679 pci_set_power_state(dev, PCI_D0);
680
681 rc = pci_enable_device(dev);
682 if (rc)
683 return rc;
684
685 pci_restore_state(dev);
686 pci_set_master(dev);
687
688 if (host->init_chipset)
689 host->init_chipset(dev);
690
691 return 0;
692}
693EXPORT_SYMBOL_GPL(ide_pci_resume);
694#endif