diff options
author | Alan <alan@lxorguk.ukuu.org.uk> | 2006-11-27 11:21:24 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-01 22:46:56 -0500 |
commit | c304193a005b5262671c1389b1cae96d7afc952a (patch) | |
tree | 7477058dbe52a631315ef62657bf0300772a49d1 /drivers | |
parent | f535d53f3f8bc8243ad2167d7127f6efba9b46cb (diff) |
[PATCH] pata_amd: suspend/resume
Early AMD chips require FIFO and/or simplex flag clearing work on resume
from RAM. Most devices need no help
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/pata_amd.c | 25 |
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 | ||
340 | static struct ata_port_operations amd33_port_ops = { | 342 | static 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 | ||
667 | static 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 | |||
665 | static const struct pci_device_id amd[] = { | 684 | static 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 | ||
695 | static int __init amd_init(void) | 716 | static int __init amd_init(void) |