summaryrefslogtreecommitdiff
path: root/drivers/ata/pata_pdc202xx_old.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 02:03:38 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-22 02:03:38 (GMT)
commite10117d36ef758da0690c95ecffc09d5dd7da479 (patch)
treef2bb867cfc33f24d9c6bbb36dd189869e62ecce2 /drivers/ata/pata_pdc202xx_old.c
parentf3270b16e00f0614fa418dcc50883da5949375b4 (diff)
parent89692c03226a066a017048cf7fbacbaa645f0e79 (diff)
downloadlinux-fsl-qoriq-e10117d36ef758da0690c95ecffc09d5dd7da479.tar.xz
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (26 commits) include/linux/libata.h: fix typo pata_bf54x: fix return type of bfin_set_devctl Drivers: ata: Makefile: replace the use of <module>-objs with <module>-y libahci: fix result_tf handling after an ATA PIO data-in command pata_sl82c105: implement sff_irq_check() method pata_sil680: implement sff_irq_check() method pata_pdc202xx_old: implement sff_irq_check() method pata_cmd640: implement sff_irq_check() method ata_piix: Add device ID for ICH4-L pata_sil680: make sil680_sff_exec_command() 'static' ata: Intel IDE-R support libata: reorder ata_queued_cmd to remove alignment padding on 64 bit builds libata: Signal that our SATL supports WRITE SAME(16) with UNMAP ata_piix: remove SIDPR locking libata: implement cross-port EH exclusion libata: add @ap to ata_wait_register() and introduce ata_msleep() ata_piix: implement LPM support libata: implement LPM support for port multipliers libata: reimplement link power management libata: implement sata_link_scr_lpm() and make ata_dev_set_feature() global ...
Diffstat (limited to 'drivers/ata/pata_pdc202xx_old.c')
-rw-r--r--drivers/ata/pata_pdc202xx_old.c23
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)