Commit 606254e3c1faeb091203c58c2da8e3e4433aae6d
Committed by
Jeff Garzik
1 parent
c1ce90f25c
Exists in
master
and in
39 other branches
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>
Showing 1 changed file with 23 additions and 0 deletions Side-by-side Diff
drivers/ata/pata_pdc202xx_old.c
... | ... | @@ -44,6 +44,27 @@ |
44 | 44 | ndelay(400); |
45 | 45 | } |
46 | 46 | |
47 | +static bool pdc202xx_irq_check(struct ata_port *ap) | |
48 | +{ | |
49 | + struct pci_dev *pdev = to_pci_dev(ap->host->dev); | |
50 | + unsigned long master = pci_resource_start(pdev, 4); | |
51 | + u8 sc1d = inb(master + 0x1d); | |
52 | + | |
53 | + if (ap->port_no) { | |
54 | + /* | |
55 | + * bit 7: error, bit 6: interrupting, | |
56 | + * bit 5: FIFO full, bit 4: FIFO empty | |
57 | + */ | |
58 | + return sc1d & 0x40; | |
59 | + } else { | |
60 | + /* | |
61 | + * bit 3: error, bit 2: interrupting, | |
62 | + * bit 1: FIFO full, bit 0: FIFO empty | |
63 | + */ | |
64 | + return sc1d & 0x04; | |
65 | + } | |
66 | +} | |
67 | + | |
47 | 68 | /** |
48 | 69 | * pdc202xx_configure_piomode - set chip PIO timing |
49 | 70 | * @ap: ATA interface |
... | ... | @@ -282,6 +303,7 @@ |
282 | 303 | .set_dmamode = pdc202xx_set_dmamode, |
283 | 304 | |
284 | 305 | .sff_exec_command = pdc202xx_exec_command, |
306 | + .sff_irq_check = pdc202xx_irq_check, | |
285 | 307 | }; |
286 | 308 | |
287 | 309 | static struct ata_port_operations pdc2026x_port_ops = { |
... | ... | @@ -297,6 +319,7 @@ |
297 | 319 | .port_start = pdc2026x_port_start, |
298 | 320 | |
299 | 321 | .sff_exec_command = pdc202xx_exec_command, |
322 | + .sff_irq_check = pdc202xx_irq_check, | |
300 | 323 | }; |
301 | 324 | |
302 | 325 | static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) |