From patchwork Fri Oct 8 14:57:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 67229 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id A987CB70A5 for ; Sat, 9 Oct 2010 01:59:05 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758578Ab0JHO61 (ORCPT ); Fri, 8 Oct 2010 10:58:27 -0400 Received: from mail.dev.rtsoft.ru ([213.79.90.226]:51785 "HELO mail.dev.rtsoft.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1758566Ab0JHO6Z (ORCPT ); Fri, 8 Oct 2010 10:58:25 -0400 Received: (qmail 12177 invoked from network); 8 Oct 2010 14:58:34 -0000 Received: from unknown (HELO wasted.dev.rtsoft.ru) (192.168.1.70) by 0 with SMTP; 8 Oct 2010 14:58:34 -0000 To: jgarzik@pobox.com Subject: [PATCH 2/4] pata_pdc202xx_old: implement sff_irq_check() method Cc: linux-ide@vger.kernel.org Content-Disposition: inline From: Sergei Shtylyov Organization: MontaVista Software Inc. Date: Fri, 8 Oct 2010 18:57:45 +0400 MIME-Version: 1.0 Message-Id: <201010081857.45919.sshtylyov@ru.mvista.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Signed-off-by: Sergei Shtylyov --- The patch is against the recent Linus' tree. drivers/ata/pata_pdc202xx_old.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6/drivers/ata/pata_pdc202xx_old.c =================================================================== --- linux-2.6.orig/drivers/ata/pata_pdc202xx_old.c +++ linux-2.6/drivers/ata/pata_pdc202xx_old.c @@ -44,6 +44,27 @@ static void pdc202xx_exec_command(struct 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 pdc202 .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 pdc202 .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)