aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_amd.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 8be46a63af74..d9571206e580 100644
--- a/drivers/ata/pata_amd.c
+++ b/drivers/ata/pata_amd.c
@@ -25,7 +25,7 @@
25#include <linux/libata.h> 25#include <linux/libata.h>
26 26
27#define DRV_NAME "pata_amd" 27#define DRV_NAME "pata_amd"
28#define DRV_VERSION "0.2.4" 28#define DRV_VERSION "0.2.7"
29 29
30/** 30/**
31 * timing_setup - shared timing computation and load 31 * timing_setup - shared timing computation and load
@@ -335,6 +335,8 @@ static struct scsi_host_template amd_sht = {
335 .slave_configure = ata_scsi_slave_config, 335 .slave_configure = ata_scsi_slave_config,
336 .slave_destroy = ata_scsi_slave_destroy, 336 .slave_destroy = ata_scsi_slave_destroy,
337 .bios_param = ata_std_bios_param, 337 .bios_param = ata_std_bios_param,
338 .resume = ata_scsi_device_resume,
339 .suspend = ata_scsi_device_suspend,
338}; 340};
339 341
340static struct ata_port_operations amd33_port_ops = { 342static struct ata_port_operations amd33_port_ops = {
@@ -662,6 +664,23 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
662 return ata_pci_init_one(pdev, port_info, 2); 664 return ata_pci_init_one(pdev, port_info, 2);
663} 665}
664 666
667static int amd_reinit_one(struct pci_dev *pdev)
668{
669 if (pdev->vendor == PCI_VENDOR_ID_AMD) {
670 u8 fifo;
671 pci_read_config_byte(pdev, 0x41, &fifo);
672 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
673 /* FIFO is broken */
674 pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
675 else
676 pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
677 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
678 pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
679 ata_pci_clear_simplex(pdev);
680 }
681 return ata_pci_device_resume(pdev);
682}
683
665static const struct pci_device_id amd[] = { 684static const struct pci_device_id amd[] = {
666 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, 685 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
667 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 }, 686 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
@@ -689,7 +708,9 @@ static struct pci_driver amd_pci_driver = {
689 .name = DRV_NAME, 708 .name = DRV_NAME,
690 .id_table = amd, 709 .id_table = amd,
691 .probe = amd_init_one, 710 .probe = amd_init_one,
692 .remove = ata_pci_remove_one 711 .remove = ata_pci_remove_one,
712 .suspend = ata_pci_device_suspend,
713 .resume = amd_reinit_one,
693}; 714};
694 715
695static int __init amd_init(void) 716static int __init amd_init(void)