aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ata_piix.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/ata_piix.c')
-rw-r--r--drivers/ata/ata_piix.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
index 6f3f2257d0f0..c33806654e46 100644
--- a/drivers/ata/ata_piix.c
+++ b/drivers/ata/ata_piix.c
@@ -173,6 +173,7 @@ static int piix_sidpr_scr_read(struct ata_link *link,
173 unsigned int reg, u32 *val); 173 unsigned int reg, u32 *val);
174static int piix_sidpr_scr_write(struct ata_link *link, 174static int piix_sidpr_scr_write(struct ata_link *link,
175 unsigned int reg, u32 val); 175 unsigned int reg, u32 val);
176static bool piix_irq_check(struct ata_port *ap);
176#ifdef CONFIG_PM 177#ifdef CONFIG_PM
177static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); 178static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
178static int piix_pci_device_resume(struct pci_dev *pdev); 179static int piix_pci_device_resume(struct pci_dev *pdev);
@@ -291,6 +292,14 @@ static const struct pci_device_id piix_pci_tbl[] = {
291 { 0x8086, 0x3b2d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, 292 { 0x8086, 0x3b2d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
292 /* SATA Controller IDE (PCH) */ 293 /* SATA Controller IDE (PCH) */
293 { 0x8086, 0x3b2e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, 294 { 0x8086, 0x3b2e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
295 /* SATA Controller IDE (CPT) */
296 { 0x8086, 0x1c00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
297 /* SATA Controller IDE (CPT) */
298 { 0x8086, 0x1c01, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata },
299 /* SATA Controller IDE (CPT) */
300 { 0x8086, 0x1c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
301 /* SATA Controller IDE (CPT) */
302 { 0x8086, 0x1c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata },
294 { } /* terminate list */ 303 { } /* terminate list */
295}; 304};
296 305
@@ -309,8 +318,13 @@ static struct scsi_host_template piix_sht = {
309 ATA_BMDMA_SHT(DRV_NAME), 318 ATA_BMDMA_SHT(DRV_NAME),
310}; 319};
311 320
312static struct ata_port_operations piix_pata_ops = { 321static struct ata_port_operations piix_sata_ops = {
313 .inherits = &ata_bmdma32_port_ops, 322 .inherits = &ata_bmdma32_port_ops,
323 .sff_irq_check = piix_irq_check,
324};
325
326static struct ata_port_operations piix_pata_ops = {
327 .inherits = &piix_sata_ops,
314 .cable_detect = ata_cable_40wire, 328 .cable_detect = ata_cable_40wire,
315 .set_piomode = piix_set_piomode, 329 .set_piomode = piix_set_piomode,
316 .set_dmamode = piix_set_dmamode, 330 .set_dmamode = piix_set_dmamode,
@@ -328,10 +342,6 @@ static struct ata_port_operations ich_pata_ops = {
328 .set_dmamode = ich_set_dmamode, 342 .set_dmamode = ich_set_dmamode,
329}; 343};
330 344
331static struct ata_port_operations piix_sata_ops = {
332 .inherits = &ata_bmdma32_port_ops,
333};
334
335static struct ata_port_operations piix_sidpr_sata_ops = { 345static struct ata_port_operations piix_sidpr_sata_ops = {
336 .inherits = &piix_sata_ops, 346 .inherits = &piix_sata_ops,
337 .hardreset = sata_std_hardreset, 347 .hardreset = sata_std_hardreset,
@@ -962,6 +972,14 @@ static int piix_sidpr_scr_write(struct ata_link *link,
962 return 0; 972 return 0;
963} 973}
964 974
975static bool piix_irq_check(struct ata_port *ap)
976{
977 if (unlikely(!ap->ioaddr.bmdma_addr))
978 return false;
979
980 return ap->ops->bmdma_status(ap) & ATA_DMA_INTR;
981}
982
965#ifdef CONFIG_PM 983#ifdef CONFIG_PM
966static int piix_broken_suspend(void) 984static int piix_broken_suspend(void)
967{ 985{