diff options
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-driver.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 7cdbc1a8f218..347c3344f56d 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -91,10 +91,15 @@ static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, | |||
91 | -1, -1, -1, -1, -1, -1, -1, -1, | 91 | -1, -1, -1, -1, -1, -1, -1, -1, |
92 | -1, -1, -1, -1, -1, -1, -1, -1, | 92 | -1, -1, -1, -1, -1, -1, -1, -1, |
93 | -1, -1, -1, -1, -1, -1, -1, -1 }; | 93 | -1, -1, -1, -1, -1, -1, -1, -1 }; |
94 | static int i2c_clock_period[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, | ||
95 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
96 | -1, -1, -1, -1, -1, -1, -1, -1, | ||
97 | -1, -1, -1, -1, -1, -1, -1, -1 }; | ||
94 | 98 | ||
95 | static unsigned int cardtype_c = 1; | 99 | static unsigned int cardtype_c = 1; |
96 | static unsigned int tuner_c = 1; | 100 | static unsigned int tuner_c = 1; |
97 | static unsigned int radio_c = 1; | 101 | static unsigned int radio_c = 1; |
102 | static unsigned int i2c_clock_period_c = 1; | ||
98 | static char pal[] = "---"; | 103 | static char pal[] = "---"; |
99 | static char secam[] = "--"; | 104 | static char secam[] = "--"; |
100 | static char ntsc[] = "-"; | 105 | static char ntsc[] = "-"; |
@@ -151,6 +156,7 @@ module_param(dec_vbi_buffers, int, 0644); | |||
151 | 156 | ||
152 | module_param(tunertype, int, 0644); | 157 | module_param(tunertype, int, 0644); |
153 | module_param(newi2c, int, 0644); | 158 | module_param(newi2c, int, 0644); |
159 | module_param_array(i2c_clock_period, int, &i2c_clock_period_c, 0644); | ||
154 | 160 | ||
155 | MODULE_PARM_DESC(tuner, "Tuner type selection,\n" | 161 | MODULE_PARM_DESC(tuner, "Tuner type selection,\n" |
156 | "\t\t\tsee tuner.h for values"); | 162 | "\t\t\tsee tuner.h for values"); |
@@ -245,6 +251,10 @@ MODULE_PARM_DESC(newi2c, | |||
245 | "Use new I2C implementation\n" | 251 | "Use new I2C implementation\n" |
246 | "\t\t\t-1 is autodetect, 0 is off, 1 is on\n" | 252 | "\t\t\t-1 is autodetect, 0 is off, 1 is on\n" |
247 | "\t\t\tDefault is autodetect"); | 253 | "\t\t\tDefault is autodetect"); |
254 | MODULE_PARM_DESC(i2c_clock_period, | ||
255 | "Period of SCL for the I2C bus controlled by the CX23415/6\n" | ||
256 | "\t\t\tMin: 10 usec (100 kHz), Max: 4500 usec (222 Hz)\n" | ||
257 | "\t\t\tDefault: " __stringify(IVTV_DEFAULT_I2C_CLOCK_PERIOD)); | ||
248 | 258 | ||
249 | MODULE_PARM_DESC(ivtv_first_minor, "Set device node number assigned to first card"); | 259 | MODULE_PARM_DESC(ivtv_first_minor, "Set device node number assigned to first card"); |
250 | 260 | ||
@@ -600,6 +610,15 @@ static void ivtv_process_options(struct ivtv *itv) | |||
600 | itv->options.cardtype = cardtype[itv->instance]; | 610 | itv->options.cardtype = cardtype[itv->instance]; |
601 | itv->options.tuner = tuner[itv->instance]; | 611 | itv->options.tuner = tuner[itv->instance]; |
602 | itv->options.radio = radio[itv->instance]; | 612 | itv->options.radio = radio[itv->instance]; |
613 | |||
614 | itv->options.i2c_clock_period = i2c_clock_period[itv->instance]; | ||
615 | if (itv->options.i2c_clock_period == -1) | ||
616 | itv->options.i2c_clock_period = IVTV_DEFAULT_I2C_CLOCK_PERIOD; | ||
617 | else if (itv->options.i2c_clock_period < 10) | ||
618 | itv->options.i2c_clock_period = 10; | ||
619 | else if (itv->options.i2c_clock_period > 4500) | ||
620 | itv->options.i2c_clock_period = 4500; | ||
621 | |||
603 | itv->options.newi2c = newi2c; | 622 | itv->options.newi2c = newi2c; |
604 | if (tunertype < -1 || tunertype > 1) { | 623 | if (tunertype < -1 || tunertype > 1) { |
605 | IVTV_WARN("Invalid tunertype argument, will autodetect instead\n"); | 624 | IVTV_WARN("Invalid tunertype argument, will autodetect instead\n"); |
@@ -865,6 +884,10 @@ static void ivtv_load_and_init_modules(struct ivtv *itv) | |||
865 | itv->hw_flags |= device; | 884 | itv->hw_flags |= device; |
866 | } | 885 | } |
867 | 886 | ||
887 | /* probe for legacy IR controllers that aren't in card definitions */ | ||
888 | if ((itv->hw_flags & IVTV_HW_IR_ANY) == 0) | ||
889 | ivtv_i2c_new_ir_legacy(itv); | ||
890 | |||
868 | if (itv->card->hw_all & IVTV_HW_CX25840) | 891 | if (itv->card->hw_all & IVTV_HW_CX25840) |
869 | itv->sd_video = ivtv_find_hw(itv, IVTV_HW_CX25840); | 892 | itv->sd_video = ivtv_find_hw(itv, IVTV_HW_CX25840); |
870 | else if (itv->card->hw_all & IVTV_HW_SAA717X) | 893 | else if (itv->card->hw_all & IVTV_HW_SAA717X) |