pata_cmd640: implement sff_irq_check() method
authorSergei Shtylyov <sshtylyov@ru.mvista.com>
Fri, 8 Oct 2010 14:56:39 +0000 (18:56 +0400)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 22 Oct 2010 00:21:05 +0000 (20:21 -0400)
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/pata_cmd640.c

index e5f289f59ca3203cc1d2ef7938925e60ef727159..549d28dbf90dd89db7b26e8f0e4f335616a64541 100644 (file)
@@ -161,6 +161,17 @@ static int cmd640_port_start(struct ata_port *ap)
        return 0;
 }
 
+static bool cmd640_sff_irq_check(struct ata_port *ap)
+{
+       struct pci_dev *pdev    = to_pci_dev(ap->host->dev);
+       int irq_reg             = ap->port_no ? ARTIM23 : CFR;
+       u8  irq_stat, irq_mask  = ap->port_no ? 0x10 : 0x04;
+
+       pci_read_config_byte(pdev, irq_reg, &irq_stat);
+
+       return irq_stat & irq_mask;
+}
+
 static struct scsi_host_template cmd640_sht = {
        ATA_PIO_SHT(DRV_NAME),
 };
@@ -169,6 +180,7 @@ static struct ata_port_operations cmd640_port_ops = {
        .inherits       = &ata_sff_port_ops,
        /* In theory xfer_noirq is not needed once we kill the prefetcher */
        .sff_data_xfer  = ata_sff_data_xfer_noirq,
+       .sff_irq_check  = cmd640_sff_irq_check,
        .qc_issue       = cmd640_qc_issue,
        .cable_detect   = ata_cable_40wire,
        .set_piomode    = cmd640_set_piomode,