From patchwork Fri Dec 31 05:04:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor M. Liplianin" X-Patchwork-Id: 5374 Return-path: Envelope-to: mchehab@gaivota Delivery-date: Fri, 31 Dec 2010 08:14:44 -0200 Received: from mchehab by gaivota with local (Exim 4.72) (envelope-from ) id 1PYc0S-0002Ok-3k for mchehab@gaivota; Fri, 31 Dec 2010 08:14:44 -0200 Received: from casper.infradead.org [85.118.1.10] by gaivota with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 31 Dec 2010 08:14:44 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PYXCT-0000me-9r; Fri, 31 Dec 2010 05:06:49 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750917Ab0LaFGJ (ORCPT + 1 other); Fri, 31 Dec 2010 00:06:09 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:42161 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750766Ab0LaFGH (ORCPT ); Fri, 31 Dec 2010 00:06:07 -0500 Received: by ewy5 with SMTP id 5so5308113ewy.19 for ; Thu, 30 Dec 2010 21:06:06 -0800 (PST) Received: by 10.14.48.6 with SMTP id u6mr1279675eeb.4.1293771965998; Thu, 30 Dec 2010 21:06:05 -0800 (PST) Received: from useri.localnet ([93.125.74.3]) by mx.google.com with ESMTPS id t5sm11982189eeh.14.2010.12.30.21.06.04 (version=SSLv3 cipher=RC4-MD5); Thu, 30 Dec 2010 21:06:05 -0800 (PST) Subject: [PATCH] cx23885, cimax2.c: Fix case of two CAM insertion irq. From: "Igor M. Liplianin" To: Mauro Chehab , linux-media@vger.kernel.org, Abylai Ospan , Linux Kernel Mailing List Date: Fri, 31 Dec 2010 07:04:38 +0200 MIME-Version: 1.0 Message-Id: <201012310704.38591.liplianin@me.by> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: Mauro Carvalho Chehab For example boot up with two CAM inserted. Signed-off-by: Abylay Ospan --- drivers/media/video/cx23885/cimax2.c | 24 ++++++++++++++++-------- 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/cx23885/cimax2.c b/drivers/media/video/cx23885/cimax2.c index c95e7bc..209b971 100644 --- a/drivers/media/video/cx23885/cimax2.c +++ b/drivers/media/video/cx23885/cimax2.c @@ -368,7 +368,7 @@ static void netup_read_ci_status(struct work_struct *work) DVB_CA_EN50221_POLL_CAM_READY; else state->status = 0; - }; + } } /* CI irq handler */ @@ -377,16 +377,24 @@ int netup_ci_slot_status(struct cx23885_dev *dev, u32 pci_status) struct cx23885_tsport *port = NULL; struct netup_ci_state *state = NULL; - if (pci_status & PCI_MSK_GPIO0) - port = &dev->ts1; - else if (pci_status & PCI_MSK_GPIO1) - port = &dev->ts2; - else /* who calls ? */ + ci_dbg_print("%s:\n", __func__); + + if (0 == (pci_status & (PCI_MSK_GPIO0 | PCI_MSK_GPIO1))) return 0; - state = port->port_priv; + if (pci_status & PCI_MSK_GPIO0) { + port = &dev->ts1; + state = port->port_priv; + schedule_work(&state->work); + ci_dbg_print("%s: Wakeup CI0\n", __func__); + } - schedule_work(&state->work); + if (pci_status & PCI_MSK_GPIO1) { + port = &dev->ts2; + state = port->port_priv; + schedule_work(&state->work); + ci_dbg_print("%s: Wakeup CI1\n", __func__); + } return 1; }