aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_amd.c')
-rw-r--r--drivers/ata/pata_amd.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
index 8be46a63af74..a6b330089f22 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
@@ -326,7 +326,6 @@ static struct scsi_host_template amd_sht = {
326 .can_queue = ATA_DEF_QUEUE, 326 .can_queue = ATA_DEF_QUEUE,
327 .this_id = ATA_SHT_THIS_ID, 327 .this_id = ATA_SHT_THIS_ID,
328 .sg_tablesize = LIBATA_MAX_PRD, 328 .sg_tablesize = LIBATA_MAX_PRD,
329 .max_sectors = ATA_MAX_SECTORS,
330 .cmd_per_lun = ATA_SHT_CMD_PER_LUN, 329 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
331 .emulated = ATA_SHT_EMULATED, 330 .emulated = ATA_SHT_EMULATED,
332 .use_clustering = ATA_SHT_USE_CLUSTERING, 331 .use_clustering = ATA_SHT_USE_CLUSTERING,
@@ -335,6 +334,8 @@ static struct scsi_host_template amd_sht = {
335 .slave_configure = ata_scsi_slave_config, 334 .slave_configure = ata_scsi_slave_config,
336 .slave_destroy = ata_scsi_slave_destroy, 335 .slave_destroy = ata_scsi_slave_destroy,
337 .bios_param = ata_std_bios_param, 336 .bios_param = ata_std_bios_param,
337 .resume = ata_scsi_device_resume,
338 .suspend = ata_scsi_device_suspend,
338}; 339};
339 340
340static struct ata_port_operations amd33_port_ops = { 341static struct ata_port_operations amd33_port_ops = {
@@ -662,6 +663,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); 663 return ata_pci_init_one(pdev, port_info, 2);
663} 664}
664 665
666static int amd_reinit_one(struct pci_dev *pdev)
667{
668 if (pdev->vendor == PCI_VENDOR_ID_AMD) {
669 u8 fifo;
670 pci_read_config_byte(pdev, 0x41, &fifo);
671 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7411)
672 /* FIFO is broken */
673 pci_write_config_byte(pdev, 0x41, fifo & 0x0F);
674 else
675 pci_write_config_byte(pdev, 0x41, fifo | 0xF0);
676 if (pdev->device == PCI_DEVICE_ID_AMD_VIPER_7409 ||
677 pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
678 ata_pci_clear_simplex(pdev);
679 }
680 return ata_pci_device_resume(pdev);
681}
682
665static const struct pci_device_id amd[] = { 683static const struct pci_device_id amd[] = {
666 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 }, 684 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_COBRA_7401), 0 },
667 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 }, 685 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_VIPER_7409), 1 },
@@ -689,7 +707,9 @@ static struct pci_driver amd_pci_driver = {
689 .name = DRV_NAME, 707 .name = DRV_NAME,
690 .id_table = amd, 708 .id_table = amd,
691 .probe = amd_init_one, 709 .probe = amd_init_one,
692 .remove = ata_pci_remove_one 710 .remove = ata_pci_remove_one,
711 .suspend = ata_pci_device_suspend,
712 .resume = amd_reinit_one,
693}; 713};
694 714
695static int __init amd_init(void) 715static int __init amd_init(void)