Skip to content

Commit

Permalink
pata_cmd640: implement sff_irq_check() method
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
  • Loading branch information
Sergei Shtylyov authored and Jeff Garzik committed Oct 22, 2010
1 parent 4bb969d commit c1ce90f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/ata/pata_cmd640.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand All @@ -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,
Expand Down

0 comments on commit c1ce90f

Please sign in to comment.