aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_pdc2027x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_pdc2027x.c')
-rw-r--r--drivers/ata/pata_pdc2027x.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/ata/pata_pdc2027x.c b/drivers/ata/pata_pdc2027x.c
index b1511f38b0e8..7d63f24179c7 100644
--- a/drivers/ata/pata_pdc2027x.c
+++ b/drivers/ata/pata_pdc2027x.c
@@ -63,6 +63,7 @@ enum {
63}; 63};
64 64
65static int pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent); 65static int pdc2027x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent);
66static int pdc2027x_reinit_one(struct pci_dev *pdev);
66static int pdc2027x_prereset(struct ata_link *link, unsigned long deadline); 67static int pdc2027x_prereset(struct ata_link *link, unsigned long deadline);
67static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev); 68static void pdc2027x_set_piomode(struct ata_port *ap, struct ata_device *adev);
68static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev); 69static void pdc2027x_set_dmamode(struct ata_port *ap, struct ata_device *adev);
@@ -126,6 +127,10 @@ static struct pci_driver pdc2027x_pci_driver = {
126 .id_table = pdc2027x_pci_tbl, 127 .id_table = pdc2027x_pci_tbl,
127 .probe = pdc2027x_init_one, 128 .probe = pdc2027x_init_one,
128 .remove = ata_pci_remove_one, 129 .remove = ata_pci_remove_one,
130#ifdef CONFIG_PM
131 .suspend = ata_pci_device_suspend,
132 .resume = pdc2027x_reinit_one,
133#endif
129}; 134};
130 135
131static struct scsi_host_template pdc2027x_sht = { 136static struct scsi_host_template pdc2027x_sht = {
@@ -754,6 +759,31 @@ static int __devinit pdc2027x_init_one(struct pci_dev *pdev, const struct pci_de
754 IRQF_SHARED, &pdc2027x_sht); 759 IRQF_SHARED, &pdc2027x_sht);
755} 760}
756 761
762#ifdef CONFIG_PM
763static int pdc2027x_reinit_one(struct pci_dev *pdev)
764{
765 struct ata_host *host = dev_get_drvdata(&pdev->dev);
766 unsigned int board_idx;
767 int rc;
768
769 rc = ata_pci_device_do_resume(pdev);
770 if (rc)
771 return rc;
772
773 if (pdev->device == PCI_DEVICE_ID_PROMISE_20268 ||
774 pdev->device == PCI_DEVICE_ID_PROMISE_20270)
775 board_idx = PDC_UDMA_100;
776 else
777 board_idx = PDC_UDMA_133;
778
779 if (pdc_hardware_init(host, board_idx))
780 return -EIO;
781
782 ata_host_resume(host);
783 return 0;
784}
785#endif
786
757/** 787/**
758 * pdc2027x_init - Called after this module is loaded into the kernel. 788 * pdc2027x_init - Called after this module is loaded into the kernel.
759 */ 789 */