diff options
| author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2010-10-08 10:57:45 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@redhat.com> | 2010-10-21 20:21:06 -0400 |
| commit | 606254e3c1faeb091203c58c2da8e3e4433aae6d (patch) | |
| tree | ab6a930a2bbafb4903d4cd931b0a2a43db568827 | |
| parent | c1ce90f25c52201469c71a2a91e2d9b27c3082f2 (diff) | |
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>
| -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 c39f213e1bbc..c2ed5868dda6 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, | |||
| 44 | ndelay(400); | 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 | * pdc202xx_configure_piomode - set chip PIO timing | 69 | * pdc202xx_configure_piomode - set chip PIO timing |
| 49 | * @ap: ATA interface | 70 | * @ap: ATA interface |
| @@ -282,6 +303,7 @@ static struct ata_port_operations pdc2024x_port_ops = { | |||
| 282 | .set_dmamode = pdc202xx_set_dmamode, | 303 | .set_dmamode = pdc202xx_set_dmamode, |
| 283 | 304 | ||
| 284 | .sff_exec_command = pdc202xx_exec_command, | 305 | .sff_exec_command = pdc202xx_exec_command, |
| 306 | .sff_irq_check = pdc202xx_irq_check, | ||
| 285 | }; | 307 | }; |
| 286 | 308 | ||
| 287 | static struct ata_port_operations pdc2026x_port_ops = { | 309 | static struct ata_port_operations pdc2026x_port_ops = { |
| @@ -297,6 +319,7 @@ static struct ata_port_operations pdc2026x_port_ops = { | |||
| 297 | .port_start = pdc2026x_port_start, | 319 | .port_start = pdc2026x_port_start, |
| 298 | 320 | ||
| 299 | .sff_exec_command = pdc202xx_exec_command, | 321 | .sff_exec_command = pdc202xx_exec_command, |
| 322 | .sff_irq_check = pdc202xx_irq_check, | ||
| 300 | }; | 323 | }; |
| 301 | 324 | ||
| 302 | static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 325 | static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
