diff options
Diffstat (limited to 'drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-i2c.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c index 7bea34714861..27b5dbb2ca1a 100644 --- a/drivers/media/video/cx88/cx88-i2c.c +++ b/drivers/media/video/cx88/cx88-i2c.c | |||
@@ -7,6 +7,9 @@ | |||
7 | (c) 2002 Yurij Sysoev <yurij@naturesoft.net> | 7 | (c) 2002 Yurij Sysoev <yurij@naturesoft.net> |
8 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 8 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
9 | 9 | ||
10 | (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | ||
11 | - Multituner support and i2c address binding | ||
12 | |||
10 | This program is free software; you can redistribute it and/or modify | 13 | This program is free software; you can redistribute it and/or modify |
11 | it under the terms of the GNU General Public License as published by | 14 | it under the terms of the GNU General Public License as published by |
12 | the Free Software Foundation; either version 2 of the License, or | 15 | the Free Software Foundation; either version 2 of the License, or |
@@ -40,6 +43,11 @@ static unsigned int i2c_scan = 0; | |||
40 | module_param(i2c_scan, int, 0444); | 43 | module_param(i2c_scan, int, 0444); |
41 | MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); | 44 | MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); |
42 | 45 | ||
46 | static unsigned int i2c_udelay = 5; | ||
47 | module_param(i2c_udelay, int, 0644); | ||
48 | MODULE_PARM_DESC(i2c_udelay,"i2c delay at insmod time, in usecs " | ||
49 | "(should be 5 or higher). Lower value means higher bus speed."); | ||
50 | |||
43 | #define dprintk(level,fmt, arg...) if (i2c_debug >= level) \ | 51 | #define dprintk(level,fmt, arg...) if (i2c_debug >= level) \ |
44 | printk(KERN_DEBUG "%s: " fmt, core->name , ## arg) | 52 | printk(KERN_DEBUG "%s: " fmt, core->name , ## arg) |
45 | 53 | ||
@@ -198,6 +206,11 @@ static void do_i2c_scan(char *name, struct i2c_client *c) | |||
198 | /* init + register i2c algo-bit adapter */ | 206 | /* init + register i2c algo-bit adapter */ |
199 | int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) | 207 | int cx88_i2c_init(struct cx88_core *core, struct pci_dev *pci) |
200 | { | 208 | { |
209 | /* Prevents usage of invalid delay values */ | ||
210 | if (i2c_udelay<5) | ||
211 | i2c_udelay=5; | ||
212 | cx8800_i2c_algo_template.udelay=i2c_udelay; | ||
213 | |||
201 | memcpy(&core->i2c_adap, &cx8800_i2c_adap_template, | 214 | memcpy(&core->i2c_adap, &cx8800_i2c_adap_template, |
202 | sizeof(core->i2c_adap)); | 215 | sizeof(core->i2c_adap)); |
203 | memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, | 216 | memcpy(&core->i2c_algo, &cx8800_i2c_algo_template, |