diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2010-10-08 14:57:45 (GMT) |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2010-10-22 00:21:06 (GMT) |
commit | 606254e3c1faeb091203c58c2da8e3e4433aae6d (patch) | |
tree | ab6a930a2bbafb4903d4cd931b0a2a43db568827 /drivers/ata/pata_pdc202xx_old.c | |
parent | c1ce90f25c52201469c71a2a91e2d9b27c3082f2 (diff) | |
download | linux-fsl-qoriq-606254e3c1faeb091203c58c2da8e3e4433aae6d.tar.xz |
pata_pdc202xx_old: implement sff_irq_check() method
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_pdc202xx_old.c')
-rw-r--r-- | drivers/ata/pata_pdc202xx_old.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/ata/pata_pdc202xx_old.c b/drivers/ata/pata_pdc202xx_old.c index c39f213..c2ed586 100644 --- a/drivers/ata/pata_pdc202xx_old.c +++ b/drivers/ata/pata_pdc202xx_old.c @@ -44,6 +44,27 @@ static void pdc202xx_exec_command(struct ata_port *ap, ndelay(400); } +static bool pdc202xx_irq_check(struct ata_port *ap) +{ + struct pci_dev *pdev = to_pci_dev(ap->host->dev); + unsigned long master = pci_resource_start(pdev, 4); + u8 sc1d = inb(master + 0x1d); + + if (ap->port_no) { + /* + * bit 7: error, bit 6: interrupting, + * bit 5: FIFO full, bit 4: FIFO empty + */ + return sc1d & 0x40; + } else { + /* + * bit 3: error, bit 2: interrupting, + * bit 1: FIFO full, bit 0: FIFO empty + */ + return sc1d & 0x04; + } +} + /** * pdc202xx_configure_piomode - set chip PIO timing * @ap: ATA interface @@ -282,6 +303,7 @@ static struct ata_port_operations pdc2024x_port_ops = { .set_dmamode = pdc202xx_set_dmamode, .sff_exec_command = pdc202xx_exec_command, + .sff_irq_check = pdc202xx_irq_check, }; static struct ata_port_operations pdc2026x_port_ops = { @@ -297,6 +319,7 @@ static struct ata_port_operations pdc2026x_port_ops = { .port_start = pdc2026x_port_start, .sff_exec_command = pdc202xx_exec_command, + .sff_irq_check = pdc202xx_irq_check, }; static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) |