aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-driver.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c46
1 files changed, 36 insertions, 10 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 948ca35e7ee8..065df53f80fd 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -101,7 +101,7 @@ static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
101static unsigned int cardtype_c = 1; 101static unsigned int cardtype_c = 1;
102static unsigned int tuner_c = 1; 102static unsigned int tuner_c = 1;
103static unsigned int radio_c = 1; 103static unsigned int radio_c = 1;
104static char pal[] = "--"; 104static char pal[] = "---";
105static char secam[] = "--"; 105static char secam[] = "--";
106static char ntsc[] = "-"; 106static char ntsc[] = "-";
107 107
@@ -126,12 +126,13 @@ static int dec_mpg_buffers = IVTV_DEFAULT_DEC_MPG_BUFFERS;
126static int dec_yuv_buffers = IVTV_DEFAULT_DEC_YUV_BUFFERS; 126static int dec_yuv_buffers = IVTV_DEFAULT_DEC_YUV_BUFFERS;
127static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS; 127static int dec_vbi_buffers = IVTV_DEFAULT_DEC_VBI_BUFFERS;
128 128
129static int ivtv_yuv_mode = 0; 129static int ivtv_yuv_mode;
130static int ivtv_yuv_threshold=-1; 130static int ivtv_yuv_threshold = -1;
131static int ivtv_pci_latency = 1; 131static int ivtv_pci_latency = 1;
132 132
133int ivtv_debug = 0; 133int ivtv_debug;
134 134
135static int tunertype = -1;
135static int newi2c = -1; 136static int newi2c = -1;
136 137
137module_param_array(tuner, int, &tuner_c, 0644); 138module_param_array(tuner, int, &tuner_c, 0644);
@@ -154,6 +155,7 @@ module_param(dec_mpg_buffers, int, 0644);
154module_param(dec_yuv_buffers, int, 0644); 155module_param(dec_yuv_buffers, int, 0644);
155module_param(dec_vbi_buffers, int, 0644); 156module_param(dec_vbi_buffers, int, 0644);
156 157
158module_param(tunertype, int, 0644);
157module_param(newi2c, int, 0644); 159module_param(newi2c, int, 0644);
158 160
159MODULE_PARM_DESC(tuner, "Tuner type selection,\n" 161MODULE_PARM_DESC(tuner, "Tuner type selection,\n"
@@ -190,9 +192,14 @@ MODULE_PARM_DESC(cardtype,
190 "\t\t\t24 = AverMedia EZMaker PCI Deluxe\n" 192 "\t\t\t24 = AverMedia EZMaker PCI Deluxe\n"
191 "\t\t\t 0 = Autodetect (default)\n" 193 "\t\t\t 0 = Autodetect (default)\n"
192 "\t\t\t-1 = Ignore this card\n\t\t"); 194 "\t\t\t-1 = Ignore this card\n\t\t");
193MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60"); 195MODULE_PARM_DESC(pal, "Set PAL standard: BGH, DK, I, M, N, Nc, 60");
194MODULE_PARM_DESC(secam, "Set SECAM standard: B, G, H, D, K, L, LC"); 196MODULE_PARM_DESC(secam, "Set SECAM standard: BGH, DK, L, LC");
195MODULE_PARM_DESC(ntsc, "Set NTSC standard: M, J, K"); 197MODULE_PARM_DESC(ntsc, "Set NTSC standard: M, J (Japan), K (South Korea)");
198MODULE_PARM_DESC(tunertype,
199 "Specify tuner type:\n"
200 "\t\t\t 0 = tuner for PAL-B/G/H/D/K/I, SECAM-B/G/H/D/K/L/Lc\n"
201 "\t\t\t 1 = tuner for NTSC-M/J/K, PAL-M/N/Nc\n"
202 "\t\t\t-1 = Autodetect (default)\n");
196MODULE_PARM_DESC(debug, 203MODULE_PARM_DESC(debug,
197 "Debug level (bitmask). Default: 0\n" 204 "Debug level (bitmask). Default: 0\n"
198 "\t\t\t 1/0x0001: warning\n" 205 "\t\t\t 1/0x0001: warning\n"
@@ -490,30 +497,35 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv)
490{ 497{
491 switch (pal[0]) { 498 switch (pal[0]) {
492 case '6': 499 case '6':
500 tunertype = 0;
493 return V4L2_STD_PAL_60; 501 return V4L2_STD_PAL_60;
494 case 'b': 502 case 'b':
495 case 'B': 503 case 'B':
496 case 'g': 504 case 'g':
497 case 'G': 505 case 'G':
498 return V4L2_STD_PAL_BG;
499 case 'h': 506 case 'h':
500 case 'H': 507 case 'H':
501 return V4L2_STD_PAL_H; 508 tunertype = 0;
509 return V4L2_STD_PAL_BG | V4L2_STD_PAL_H;
502 case 'n': 510 case 'n':
503 case 'N': 511 case 'N':
512 tunertype = 1;
504 if (pal[1] == 'c' || pal[1] == 'C') 513 if (pal[1] == 'c' || pal[1] == 'C')
505 return V4L2_STD_PAL_Nc; 514 return V4L2_STD_PAL_Nc;
506 return V4L2_STD_PAL_N; 515 return V4L2_STD_PAL_N;
507 case 'i': 516 case 'i':
508 case 'I': 517 case 'I':
518 tunertype = 0;
509 return V4L2_STD_PAL_I; 519 return V4L2_STD_PAL_I;
510 case 'd': 520 case 'd':
511 case 'D': 521 case 'D':
512 case 'k': 522 case 'k':
513 case 'K': 523 case 'K':
524 tunertype = 0;
514 return V4L2_STD_PAL_DK; 525 return V4L2_STD_PAL_DK;
515 case 'M': 526 case 'M':
516 case 'm': 527 case 'm':
528 tunertype = 1;
517 return V4L2_STD_PAL_M; 529 return V4L2_STD_PAL_M;
518 case '-': 530 case '-':
519 break; 531 break;
@@ -529,14 +541,17 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv)
529 case 'G': 541 case 'G':
530 case 'h': 542 case 'h':
531 case 'H': 543 case 'H':
544 tunertype = 0;
532 return V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H; 545 return V4L2_STD_SECAM_B | V4L2_STD_SECAM_G | V4L2_STD_SECAM_H;
533 case 'd': 546 case 'd':
534 case 'D': 547 case 'D':
535 case 'k': 548 case 'k':
536 case 'K': 549 case 'K':
550 tunertype = 0;
537 return V4L2_STD_SECAM_DK; 551 return V4L2_STD_SECAM_DK;
538 case 'l': 552 case 'l':
539 case 'L': 553 case 'L':
554 tunertype = 0;
540 if (secam[1] == 'C' || secam[1] == 'c') 555 if (secam[1] == 'C' || secam[1] == 'c')
541 return V4L2_STD_SECAM_LC; 556 return V4L2_STD_SECAM_LC;
542 return V4L2_STD_SECAM_L; 557 return V4L2_STD_SECAM_L;
@@ -550,12 +565,15 @@ static v4l2_std_id ivtv_parse_std(struct ivtv *itv)
550 switch (ntsc[0]) { 565 switch (ntsc[0]) {
551 case 'm': 566 case 'm':
552 case 'M': 567 case 'M':
568 tunertype = 1;
553 return V4L2_STD_NTSC_M; 569 return V4L2_STD_NTSC_M;
554 case 'j': 570 case 'j':
555 case 'J': 571 case 'J':
572 tunertype = 1;
556 return V4L2_STD_NTSC_M_JP; 573 return V4L2_STD_NTSC_M_JP;
557 case 'k': 574 case 'k':
558 case 'K': 575 case 'K':
576 tunertype = 1;
559 return V4L2_STD_NTSC_M_KR; 577 return V4L2_STD_NTSC_M_KR;
560 case '-': 578 case '-':
561 break; 579 break;
@@ -584,8 +602,13 @@ static void ivtv_process_options(struct ivtv *itv)
584 itv->options.tuner = tuner[itv->num]; 602 itv->options.tuner = tuner[itv->num];
585 itv->options.radio = radio[itv->num]; 603 itv->options.radio = radio[itv->num];
586 itv->options.newi2c = newi2c; 604 itv->options.newi2c = newi2c;
587 605 if (tunertype < -1 || tunertype > 1) {
606 IVTV_WARN("Invalid tunertype argument, will autodetect instead\n");
607 tunertype = -1;
608 }
588 itv->std = ivtv_parse_std(itv); 609 itv->std = ivtv_parse_std(itv);
610 if (itv->std == 0 && tunertype >= 0)
611 itv->std = tunertype ? V4L2_STD_MN : (V4L2_STD_ALL & ~V4L2_STD_MN);
589 itv->has_cx23415 = (itv->dev->device == PCI_DEVICE_ID_IVTV15); 612 itv->has_cx23415 = (itv->dev->device == PCI_DEVICE_ID_IVTV15);
590 chipname = itv->has_cx23415 ? "cx23415" : "cx23416"; 613 chipname = itv->has_cx23415 ? "cx23415" : "cx23416";
591 if (itv->options.cardtype == -1) { 614 if (itv->options.cardtype == -1) {
@@ -711,6 +734,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
711 itv->yuv_info.lace_mode = ivtv_yuv_mode; 734 itv->yuv_info.lace_mode = ivtv_yuv_mode;
712 itv->yuv_info.lace_threshold = ivtv_yuv_threshold; 735 itv->yuv_info.lace_threshold = ivtv_yuv_threshold;
713 itv->yuv_info.max_frames_buffered = 3; 736 itv->yuv_info.max_frames_buffered = 3;
737 itv->yuv_info.track_osd = 1;
714 return 0; 738 return 0;
715} 739}
716 740
@@ -859,7 +883,9 @@ static void ivtv_load_and_init_modules(struct ivtv *itv)
859#ifndef CONFIG_VIDEO_SAA7127 883#ifndef CONFIG_VIDEO_SAA7127
860 hw = ivtv_request_module(itv, hw, "saa7127", IVTV_HW_SAA7127); 884 hw = ivtv_request_module(itv, hw, "saa7127", IVTV_HW_SAA7127);
861#endif 885#endif
886#ifndef CONFIG_VIDEO_SAA717X
862 hw = ivtv_request_module(itv, hw, "saa717x", IVTV_HW_SAA717X); 887 hw = ivtv_request_module(itv, hw, "saa717x", IVTV_HW_SAA717X);
888#endif
863#ifndef CONFIG_VIDEO_UPD64031A 889#ifndef CONFIG_VIDEO_UPD64031A
864 hw = ivtv_request_module(itv, hw, "upd64031a", IVTV_HW_UPD64031A); 890 hw = ivtv_request_module(itv, hw, "upd64031a", IVTV_HW_UPD64031A);
865#endif 891#endif