From patchwork Sun Feb 17 13:40:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Schaefer X-Patchwork-Id: 16897 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1U74Sp-0000kv-KP; Sun, 17 Feb 2013 14:39:31 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1U74Sp-0005qw-9t; Sun, 17 Feb 2013 14:39:31 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756194Ab3BQNj2 (ORCPT + 1 other); Sun, 17 Feb 2013 08:39:28 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:56778 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756156Ab3BQNj1 (ORCPT ); Sun, 17 Feb 2013 08:39:27 -0500 Received: by mail-ee0-f46.google.com with SMTP id e49so2354965eek.33 for ; Sun, 17 Feb 2013 05:39:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Qn3FR8KuoOhZO2sPpH4KABakVp47QUY0rJ0FlqTsnEg=; b=W9UCv994qM87Pt/TEx4ff/BfL2ozK5dQRWCKBRKwd9yt/jnV3Wg7An9iYvAQxZdNAr ff43s2Hr89V5W44lQE6oBZvA4RS6/uqAysAH8TJSUYS5ur5WeYpyYPbo2YtSFatfMvBQ Zjp6Tf8oCm+aN9czLBAznTN479XxjLq+aO3RTII+sLxrBewRe7N4ra95Cz4Ks40M8iCV 8laIHe3XLS5rBgGn+QCcfim3lUt96i97DvPnLvGIGYnalMCEX8fULvQJcujGhbox1GLG vObvz6zqJymW3xnSkGgFNrAf8CSRRmIzzQUgBv2CbrKDmMFVolExbW8gbrM0+gcQvNZE 0K3Q== X-Received: by 10.14.210.8 with SMTP id t8mr32672376eeo.35.1361108366174; Sun, 17 Feb 2013 05:39:26 -0800 (PST) Received: from Athlon64X2-5000.site (ip-109-91-212-198.unitymediagroup.de. [109.91.212.198]) by mx.google.com with ESMTPS id a1sm68071211eep.2.2013.02.17.05.39.24 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 Feb 2013 05:39:25 -0800 (PST) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: mchehab@redhat.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 1/2] bttv: make remote controls of devices with i2c ir decoder working Date: Sun, 17 Feb 2013 14:40:05 +0100 Message-Id: <1361108405-3583-1-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.17.133015 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1900_1999 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __YOUTUBE_RCVD 0' Request module ir-kbd-i2c if an i2c ir decoder is detected. Tested with device "Hauppauge WinTV Theatre" (model 37284 rev B421). Signed-off-by: Frank Schäfer --- drivers/media/pci/bt8xx/bttv-input.c | 22 +++++++++++++--------- 1 Datei geändert, 13 Zeilen hinzugefügt(+), 9 Zeilen entfernt(-) diff --git a/drivers/media/pci/bt8xx/bttv-input.c b/drivers/media/pci/bt8xx/bttv-input.c index 04207a7..01c7121 100644 --- a/drivers/media/pci/bt8xx/bttv-input.c +++ b/drivers/media/pci/bt8xx/bttv-input.c @@ -375,6 +375,7 @@ void init_bttv_i2c_ir(struct bttv *btv) I2C_CLIENT_END }; struct i2c_board_info info; + struct i2c_client *i2c_dev; if (0 != btv->i2c_rc) return; @@ -390,7 +391,12 @@ void init_bttv_i2c_ir(struct bttv *btv) btv->init_data.ir_codes = RC_MAP_PV951; info.addr = 0x4b; break; - default: + } + + if (btv->init_data.name) { + info.platform_data = &btv->init_data; + i2c_dev = i2c_new_device(&btv->c.i2c_adap, &info); + } else { /* * The external IR receiver is at i2c address 0x34 (0x35 for * reads). Future Hauppauge cards will have an internal @@ -399,16 +405,14 @@ void init_bttv_i2c_ir(struct bttv *btv) * internal. * That's why we probe 0x1a (~0x34) first. CB */ - - i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); - return; + i2c_dev = i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list, NULL); } + if (NULL == i2c_dev) + return; - if (btv->init_data.name) - info.platform_data = &btv->init_data; - i2c_new_device(&btv->c.i2c_adap, &info); - - return; +#if defined(CONFIG_MODULES) && defined(MODULE) + request_module("ir-kbd-i2c"); +#endif } int fini_bttv_i2c(struct bttv *btv)