diff options
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-i2c.c')
-rw-r--r-- | drivers/media/video/bt8xx/bttv-i2c.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c index 0dfbcc85ebb9..70de6c96e201 100644 --- a/drivers/media/video/bt8xx/bttv-i2c.c +++ b/drivers/media/video/bt8xx/bttv-i2c.c | |||
@@ -8,6 +8,9 @@ | |||
8 | & Marcus Metzler (mocm@thp.uni-koeln.de) | 8 | & Marcus Metzler (mocm@thp.uni-koeln.de) |
9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> | 9 | (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org> |
10 | 10 | ||
11 | (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org> | ||
12 | - Multituner support and i2c address binding | ||
13 | |||
11 | This program is free software; you can redistribute it and/or modify | 14 | This program is free software; you can redistribute it and/or modify |
12 | it under the terms of the GNU General Public License as published by | 15 | it under the terms of the GNU General Public License as published by |
13 | the Free Software Foundation; either version 2 of the License, or | 16 | the Free Software Foundation; either version 2 of the License, or |
@@ -45,10 +48,18 @@ static int i2c_debug; | |||
45 | static int i2c_hw; | 48 | static int i2c_hw; |
46 | static int i2c_scan; | 49 | static int i2c_scan; |
47 | module_param(i2c_debug, int, 0644); | 50 | module_param(i2c_debug, int, 0644); |
51 | MODULE_PARM_DESC(i2c_hw,"configure i2c debug level"); | ||
48 | module_param(i2c_hw, int, 0444); | 52 | module_param(i2c_hw, int, 0444); |
53 | MODULE_PARM_DESC(i2c_hw,"force use of hardware i2c support, " | ||
54 | "instead of software bitbang"); | ||
49 | module_param(i2c_scan, int, 0444); | 55 | module_param(i2c_scan, int, 0444); |
50 | MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); | 56 | MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); |
51 | 57 | ||
58 | static unsigned int i2c_udelay = 5; | ||
59 | module_param(i2c_udelay, int, 0444); | ||
60 | MODULE_PARM_DESC(i2c_udelay,"soft i2c delay at insmod time, in usecs " | ||
61 | "(should be 5 or higher). Lower value means higher bus speed."); | ||
62 | |||
52 | /* ----------------------------------------------------------------------- */ | 63 | /* ----------------------------------------------------------------------- */ |
53 | /* I2C functions - bitbanging adapter (software i2c) */ | 64 | /* I2C functions - bitbanging adapter (software i2c) */ |
54 | 65 | ||
@@ -425,6 +436,11 @@ int __devinit init_bttv_i2c(struct bttv *btv) | |||
425 | sizeof(bttv_i2c_adap_hw_template)); | 436 | sizeof(bttv_i2c_adap_hw_template)); |
426 | } else { | 437 | } else { |
427 | /* bt848 */ | 438 | /* bt848 */ |
439 | /* Prevents usage of invalid delay values */ | ||
440 | if (i2c_udelay<5) | ||
441 | i2c_udelay=5; | ||
442 | bttv_i2c_algo_bit_template.udelay=i2c_udelay; | ||
443 | |||
428 | memcpy(&btv->c.i2c_adap, &bttv_i2c_adap_sw_template, | 444 | memcpy(&btv->c.i2c_adap, &bttv_i2c_adap_sw_template, |
429 | sizeof(bttv_i2c_adap_sw_template)); | 445 | sizeof(bttv_i2c_adap_sw_template)); |
430 | memcpy(&btv->i2c_algo, &bttv_i2c_algo_bit_template, | 446 | memcpy(&btv->i2c_algo, &bttv_i2c_algo_bit_template, |