From patchwork Thu Jul 18 01:33:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Alves X-Patchwork-Id: 2829365 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DEBF39F967 for ; Thu, 18 Jul 2013 01:33:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED701203E6 for ; Thu, 18 Jul 2013 01:33:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 157AF203DA for ; Thu, 18 Jul 2013 01:33:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964944Ab3GRBd2 (ORCPT ); Wed, 17 Jul 2013 21:33:28 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:60625 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964871Ab3GRBd2 (ORCPT ); Wed, 17 Jul 2013 21:33:28 -0400 Received: by mail-we0-f171.google.com with SMTP id m46so2397936wev.16 for ; Wed, 17 Jul 2013 18:33:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=zK9Q9quxntEK8X5emPBn977rcSg6B8N1wJ0TvM9arjA=; b=P9DcDl2A6joaCb5lhd269xOGulkgnW8iVZZydUuFFjHrbNf5AhvkVQOsndGJ7vovfb 8HgVoNKTsawxHMPawDvWTYL8+hCGBhmjC+NJsCwBv2YR0vbAtWLa7OK1gmzmfTpyVCAY Z31+aFOO8C046NLTt94adNvb8kUGLYCwCF3jI/IO46oQoZG30QGWcaJfYDJQcV7kXfn2 6KsSRdpnAbRDNPLhMrcSGhoTh2EbkM0Mh23/DTCw4IfKNSCgvgQrMhUZa8F10P/U566k 4u774+weraT5xybM+bAh/NXytXNQpJ346QO3Hxu2GEW2oLLmNY3bdfWkjFLiiNfBLtrY PWOA== X-Received: by 10.180.81.169 with SMTP id b9mr17533269wiy.40.1374111207065; Wed, 17 Jul 2013 18:33:27 -0700 (PDT) Received: from xsys-lnx.lan (a89-152-208-145.cpe.netcabo.pt. [89.152.208.145]) by mx.google.com with ESMTPSA id h8sm13301166wie.1.2013.07.17.18.33.25 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 17 Jul 2013 18:33:26 -0700 (PDT) From: Luis Alves To: linux-media@vger.kernel.org Cc: mchehab@infradead.org, crope@iki.fi, awalls@md.metrocast.net, Luis Alves Subject: [PATCH] cx23885: Fix interrupt storm that happens in some cards when IR is enabled. Date: Thu, 18 Jul 2013 02:33:22 +0100 Message-Id: <1374111202-23288-1-git-send-email-ljalvs@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This i2c init should stop the interrupt storm that happens in some cards when the IR receiver in enabled. It works perfectly in my TBS6981. It would be good to test in other problematic cards. In this patch I've added the IR init to the TeVii S470/S471 (and some others that fall in the same case statment). Other cards but these that suffer the same issue should also be tested. Give feedback! Regards, Luis Signed-off-by: Luis Alves --- drivers/media/pci/cx23885/cx23885-cards.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index 7e923f8..89ce132 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c @@ -1081,6 +1081,27 @@ int cx23885_tuner_callback(void *priv, int component, int command, int arg) return 0; } +void cx23885_ir_setup(struct cx23885_dev *dev) +{ + struct i2c_msg msg; + char buffer[2]; + + /* this should stop the IR interrupt + storm that happens in some cards */ + msg.addr = 0x4c; + msg.flags = 0; + msg.len = 2; + msg.buf = buffer; + + buffer[0] = 0x1f; + buffer[1] = 0x80; + i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg, 1); + + buffer[0] = 0x23; + buffer[1] = 0x80; + i2c_transfer(&dev->i2c_bus[2].i2c_adap, &msg, 1); +} + void cx23885_gpio_setup(struct cx23885_dev *dev) { switch (dev->board) { @@ -1664,6 +1685,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) ts1->gen_ctrl_val = 0x5; /* Parallel */ ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */ ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO; + cx23885_ir_setup(dev); break; case CX23885_BOARD_NETUP_DUAL_DVBS2_CI: case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF: