From patchwork Tue Feb 16 17:21:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 79754 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1GHM0Sm008650 for ; Tue, 16 Feb 2010 17:22:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932734Ab0BPRV4 (ORCPT ); Tue, 16 Feb 2010 12:21:56 -0500 Received: from bamako.nerim.net ([62.4.17.28]:51951 "EHLO bamako.nerim.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932161Ab0BPRVz (ORCPT ); Tue, 16 Feb 2010 12:21:55 -0500 Received: from localhost (localhost [127.0.0.1]) by bamako.nerim.net (Postfix) with ESMTP id 05B0B39DFA5 for ; Tue, 16 Feb 2010 18:21:52 +0100 (CET) X-Virus-Scanned: amavisd-new at nerim.net Received: from bamako.nerim.net ([127.0.0.1]) by localhost (bamako.nerim.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YhxBP0xfScPI for ; Tue, 16 Feb 2010 18:21:51 +0100 (CET) Received: from hyperion.delvare (jdelvare.pck.nerim.net [62.212.121.182]) by bamako.nerim.net (Postfix) with ESMTP id C264A39DF99 for ; Tue, 16 Feb 2010 18:21:50 +0100 (CET) Date: Tue, 16 Feb 2010 18:21:52 +0100 From: Jean Delvare To: LMML Subject: [PATCH 1/2] bttv: Move I2C IR initialization Message-ID: <20100216182152.44129e46@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 16 Feb 2010 17:22:00 +0000 (UTC) --- v4l-dvb.orig/linux/drivers/media/video/bt8xx/bttv-i2c.c 2009-12-11 09:47:47.000000000 +0100 +++ v4l-dvb/linux/drivers/media/video/bt8xx/bttv-i2c.c 2010-02-16 18:14:34.000000000 +0100 @@ -409,9 +409,14 @@ int __devinit init_bttv_i2c(struct bttv } if (0 == btv->i2c_rc && i2c_scan) do_i2c_scan(btv->c.v4l2_dev.name, &btv->i2c_client); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) - /* Instantiate the IR receiver device, if present */ + return btv->i2c_rc; +} + +/* Instantiate the I2C IR receiver device, if present */ +void __devinit init_bttv_i2c_ir(struct bttv *btv) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) if (0 == btv->i2c_rc) { struct i2c_board_info info; /* The external IR receiver is at i2c address 0x34 (0x35 for @@ -432,7 +437,6 @@ int __devinit init_bttv_i2c(struct bttv i2c_new_probed_device(&btv->c.i2c_adap, &info, addr_list); } #endif - return btv->i2c_rc; } int __devexit fini_bttv_i2c(struct bttv *btv) --- v4l-dvb.orig/linux/drivers/media/video/bt8xx/bttvp.h 2009-04-06 10:10:24.000000000 +0200 +++ v4l-dvb/linux/drivers/media/video/bt8xx/bttvp.h 2010-02-16 18:13:31.000000000 +0100 @@ -281,6 +281,7 @@ extern unsigned int bttv_debug; extern unsigned int bttv_gpio; extern void bttv_gpio_tracking(struct bttv *btv, char *comment); extern int init_bttv_i2c(struct bttv *btv); +extern void init_bttv_i2c_ir(struct bttv *btv); extern int fini_bttv_i2c(struct bttv *btv); #define bttv_printk if (bttv_verbose) printk --- v4l-dvb.orig/linux/drivers/media/video/bt8xx/bttv-driver.c 2009-12-11 09:47:47.000000000 +0100 +++ v4l-dvb/linux/drivers/media/video/bt8xx/bttv-driver.c 2010-02-16 18:13:31.000000000 +0100 @@ -4498,6 +4498,7 @@ static int __devinit bttv_probe(struct p request_modules(btv); } + init_bttv_i2c_ir(btv); bttv_input_init(btv); /* everything is fine */