From patchwork Tue May 8 21:20:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Love X-Patchwork-Id: 10387537 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1E3ED6037F for ; Tue, 8 May 2018 21:21:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4D628E7F for ; Tue, 8 May 2018 21:21:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1346B28EA4; Tue, 8 May 2018 21:21:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A04C428E7D for ; Tue, 8 May 2018 21:21:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755620AbeEHVVN (ORCPT ); Tue, 8 May 2018 17:21:13 -0400 Received: from sub5.mail.dreamhost.com ([208.113.200.129]:44807 "EHLO homiemail-a116.g.dreamhost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755941AbeEHVU0 (ORCPT ); Tue, 8 May 2018 17:20:26 -0400 Received: from homiemail-a116.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a116.g.dreamhost.com (Postfix) with ESMTP id 1DA226000794C; Tue, 8 May 2018 14:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nextdimension.cc; h=from :to:cc:subject:date:message-id:in-reply-to:references; s= nextdimension.cc; bh=coeGHPmWurPLjGUDcLBl2XJuw0Y=; b=T9iWKgE93ul 4jdlqyzoGkg0xR29/Bc/bXQP43mH5ekOmZtx/u7ycvcgy298IEl6nlI5cAjdgirN AVquGR9CLo/4J5iY2WCEOTdfur9eBlwvt8KFBTxdfevkrfDOHO5Vnxbb/8mWMgb6 ni7lENrsNPWPQ0AdRO8NF4ZTOdvlf+cI= Received: from localhost.localdomain (66-90-189-166.dyn.grandenetworks.net [66.90.189.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: brad@nextdimension.ws) by homiemail-a116.g.dreamhost.com (Postfix) with ESMTPSA id C5C376000794D; Tue, 8 May 2018 14:20:25 -0700 (PDT) From: Brad Love To: linux-media@vger.kernel.org, mchehab@kernel.org, mspieth@digivation.com.au Cc: Brad Love Subject: [PATCH 2/5] cx23885: Use PCI and TS masks in irq functions Date: Tue, 8 May 2018 16:20:17 -0500 Message-Id: <1525814420-25243-3-git-send-email-brad@nextdimension.cc> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525814420-25243-1-git-send-email-brad@nextdimension.cc> References: <1525814420-25243-1-git-send-email-brad@nextdimension.cc> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently mask is read for pci_status/ts1_status/ts2_status, but otherwise ignored. The masks are now used to determine whether action is warranted. Signed-off-by: Brad Love --- drivers/media/pci/cx23885/cx23885-core.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/cx23885/cx23885-core.c b/drivers/media/pci/cx23885/cx23885-core.c index b279758..3f55319 100644 --- a/drivers/media/pci/cx23885/cx23885-core.c +++ b/drivers/media/pci/cx23885/cx23885-core.c @@ -1704,6 +1704,12 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id) pci_status = cx_read(PCI_INT_STAT); pci_mask = cx23885_irq_get_mask(dev); + if ((pci_status & pci_mask) == 0) { + dprintk(7, "pci_status: 0x%08x pci_mask: 0x%08x\n", + pci_status, pci_mask); + goto out; + } + vida_status = cx_read(VID_A_INT_STAT); vida_mask = cx_read(VID_A_INT_MSK); audint_status = cx_read(AUDIO_INT_INT_STAT); @@ -1713,7 +1719,9 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id) ts2_status = cx_read(VID_C_INT_STAT); ts2_mask = cx_read(VID_C_INT_MSK); - if ((pci_status == 0) && (ts2_status == 0) && (ts1_status == 0)) + if (((pci_status & pci_mask) == 0) && + ((ts2_status & ts2_mask) == 0) && + ((ts1_status & ts1_mask) == 0)) goto out; vida_count = cx_read(VID_A_GPCNT); @@ -1840,7 +1848,7 @@ static irqreturn_t cx23885_irq(int irq, void *dev_id) } if (handled) - cx_write(PCI_INT_STAT, pci_status); + cx_write(PCI_INT_STAT, pci_status & pci_mask); out: return IRQ_RETVAL(handled); }