aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-04-22 13:45:49 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:49 -0400
commitc0038ce025e1d70076894e6a206a73fd37ad493d (patch)
treed4a2556bacbc8637f789a54ed6972b8ec0c95138 /drivers/media/video
parent0358d7c580370c5eaf081ac42a41c6e347709051 (diff)
V4L/DVB (7338): ivtv: improve pal/secam module options, add tunerhz module option
Allow options like pal=bgh, improve description of those options. Add tunerhz option: 50=card has 50Hz tuner, 60=card has 60Hz tuner. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/ivtv/ivtv-driver.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index d0bb5b18797..baa3aeed8a2 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
@@ -132,6 +132,7 @@ static int ivtv_pci_latency = 1;
132 132
133int ivtv_debug; 133int ivtv_debug;
134 134
135static int tunerhz;
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(tunerhz, 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(tunerhz,
199 "Specify tuner type:\n"
200 "\t\t\t50 = 50 Hz tuner (PAL-B/G/H/D/K/I, SECAM-B/G/H/D/K/L/Lc)\n"
201 "\t\t\t60 = 60 Hz tuner (NTSC-M/J/K, PAL-M/N/Nc/60)\n"
202 "\t\t\t 0 = 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 tunerhz = 60;
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 tunerhz = 50;
509 return V4L2_STD_PAL_BG | V4L2_STD_PAL_H;
502 case 'n': 510 case 'n':
503 case 'N': 511 case 'N':
512 tunerhz = 60;
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 tunerhz = 50;
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 tunerhz = 50;
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 tunerhz = 60;
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 tunerhz = 50;
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 tunerhz = 50;
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 tunerhz = 50;
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 tunerhz = 60;
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 tunerhz = 60;
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 tunerhz = 60;
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 (tunerhz != 0 && tunerhz != 50 && tunerhz != 60) {
606 IVTV_WARN("Invalid tunerhz argument, will autodetect instead\n");
607 tunerhz = 0;
608 }
588 itv->std = ivtv_parse_std(itv); 609 itv->std = ivtv_parse_std(itv);
610 if (itv->std == 0 && tunerhz)
611 itv->std = (tunerhz == 60) ? V4L2_STD_525_60 : V4L2_STD_625_50;
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) {