diff options
Diffstat (limited to 'drivers/media/video/zoran_card.c')
-rw-r--r-- | drivers/media/video/zoran_card.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index 0a85c9e7fb48..958c1e6fc852 100644 --- a/drivers/media/video/zoran_card.c +++ b/drivers/media/video/zoran_card.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 27 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <linux/delay.h> | ||
31 | |||
30 | #include <linux/config.h> | 32 | #include <linux/config.h> |
31 | #include <linux/types.h> | 33 | #include <linux/types.h> |
32 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
@@ -38,6 +40,7 @@ | |||
38 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
39 | #include <linux/i2c-algo-bit.h> | 41 | #include <linux/i2c-algo-bit.h> |
40 | #include <linux/videodev.h> | 42 | #include <linux/videodev.h> |
43 | #include <media/v4l2-common.h> | ||
41 | #include <linux/spinlock.h> | 44 | #include <linux/spinlock.h> |
42 | #include <linux/sem.h> | 45 | #include <linux/sem.h> |
43 | #include <linux/kmod.h> | 46 | #include <linux/kmod.h> |
@@ -93,6 +96,11 @@ module_param(default_input, int, 0); | |||
93 | MODULE_PARM_DESC(default_input, | 96 | MODULE_PARM_DESC(default_input, |
94 | "Default input (0=Composite, 1=S-Video, 2=Internal)"); | 97 | "Default input (0=Composite, 1=S-Video, 2=Internal)"); |
95 | 98 | ||
99 | static int default_mux = 1; /* 6 Eyes input selection */ | ||
100 | module_param(default_mux, int, 0); | ||
101 | MODULE_PARM_DESC(default_mux, | ||
102 | "Default 6 Eyes mux setting (Input selection)"); | ||
103 | |||
96 | static int default_norm = 0; /* 0=PAL, 1=NTSC 2=SECAM */ | 104 | static int default_norm = 0; /* 0=PAL, 1=NTSC 2=SECAM */ |
97 | module_param(default_norm, int, 0); | 105 | module_param(default_norm, int, 0); |
98 | MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)"); | 106 | MODULE_PARM_DESC(default_norm, "Default norm (0=PAL, 1=NTSC, 2=SECAM)"); |
@@ -301,6 +309,30 @@ lml33_init (struct zoran *zr) | |||
301 | GPIO(zr, 2, 1); // Set Composite input/output | 309 | GPIO(zr, 2, 1); // Set Composite input/output |
302 | } | 310 | } |
303 | 311 | ||
312 | static void | ||
313 | avs6eyes_init (struct zoran *zr) | ||
314 | { | ||
315 | // AverMedia 6-Eyes original driver by Christer Weinigel | ||
316 | |||
317 | // Lifted straight from Christer's old driver and | ||
318 | // modified slightly by Martin Samuelsson. | ||
319 | |||
320 | int mux = default_mux; /* 1 = BT866, 7 = VID1 */ | ||
321 | |||
322 | GPIO(zr, 4, 1); /* Bt866 SLEEP on */ | ||
323 | udelay(2); | ||
324 | |||
325 | GPIO(zr, 0, 1); /* ZR36060 /RESET on */ | ||
326 | GPIO(zr, 1, 0); /* ZR36060 /SLEEP on */ | ||
327 | GPIO(zr, 2, mux & 1); /* MUX S0 */ | ||
328 | GPIO(zr, 3, 0); /* /FRAME on */ | ||
329 | GPIO(zr, 4, 0); /* Bt866 SLEEP off */ | ||
330 | GPIO(zr, 5, mux & 2); /* MUX S1 */ | ||
331 | GPIO(zr, 6, 0); /* ? */ | ||
332 | GPIO(zr, 7, mux & 4); /* MUX S2 */ | ||
333 | |||
334 | } | ||
335 | |||
304 | static char * | 336 | static char * |
305 | i2cid_to_modulename (u16 i2c_id) | 337 | i2cid_to_modulename (u16 i2c_id) |
306 | { | 338 | { |
@@ -391,6 +423,14 @@ static struct tvnorm f60sqpixel_dc10 = { 780, 640, 0, 716, 525, 480, 12 }; | |||
391 | static struct tvnorm f50ccir601_lm33r10 = { 864, 720, 74+54, 804, 625, 576, 18 }; | 423 | static struct tvnorm f50ccir601_lm33r10 = { 864, 720, 74+54, 804, 625, 576, 18 }; |
392 | static struct tvnorm f60ccir601_lm33r10 = { 858, 720, 56+54, 788, 525, 480, 16 }; | 424 | static struct tvnorm f60ccir601_lm33r10 = { 858, 720, 56+54, 788, 525, 480, 16 }; |
393 | 425 | ||
426 | /* FIXME: The ks0127 seem incapable of swapping U and V, too, which is why I | ||
427 | * copy Maxim's left shift hack for the 6 Eyes. | ||
428 | * | ||
429 | * Christer's driver used the unshifted norms, though... | ||
430 | * /Sam */ | ||
431 | static struct tvnorm f50ccir601_avs6eyes = { 864, 720, 74, 804, 625, 576, 18 }; | ||
432 | static struct tvnorm f60ccir601_avs6eyes = { 858, 720, 56, 788, 525, 480, 16 }; | ||
433 | |||
394 | static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | 434 | static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { |
395 | { | 435 | { |
396 | .type = DC10_old, | 436 | .type = DC10_old, |
@@ -419,6 +459,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
419 | .gpcs = { -1, 0 }, | 459 | .gpcs = { -1, 0 }, |
420 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, | 460 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, |
421 | .gws_not_connected = 0, | 461 | .gws_not_connected = 0, |
462 | .input_mux = 0, | ||
422 | .init = &dc10_init, | 463 | .init = &dc10_init, |
423 | }, { | 464 | }, { |
424 | .type = DC10_new, | 465 | .type = DC10_new, |
@@ -445,6 +486,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
445 | .gpcs = { -1, 1}, | 486 | .gpcs = { -1, 1}, |
446 | .vfe_pol = { 1, 1, 1, 1, 0, 0, 0, 0 }, | 487 | .vfe_pol = { 1, 1, 1, 1, 0, 0, 0, 0 }, |
447 | .gws_not_connected = 0, | 488 | .gws_not_connected = 0, |
489 | .input_mux = 0, | ||
448 | .init = &dc10plus_init, | 490 | .init = &dc10plus_init, |
449 | }, { | 491 | }, { |
450 | .type = DC10plus, | 492 | .type = DC10plus, |
@@ -474,6 +516,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
474 | .gpcs = { -1, 1 }, | 516 | .gpcs = { -1, 1 }, |
475 | .vfe_pol = { 1, 1, 1, 1, 0, 0, 0, 0 }, | 517 | .vfe_pol = { 1, 1, 1, 1, 0, 0, 0, 0 }, |
476 | .gws_not_connected = 0, | 518 | .gws_not_connected = 0, |
519 | .input_mux = 0, | ||
477 | .init = &dc10plus_init, | 520 | .init = &dc10plus_init, |
478 | }, { | 521 | }, { |
479 | .type = DC30, | 522 | .type = DC30, |
@@ -502,6 +545,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
502 | .gpcs = { -1, 0 }, | 545 | .gpcs = { -1, 0 }, |
503 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, | 546 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, |
504 | .gws_not_connected = 0, | 547 | .gws_not_connected = 0, |
548 | .input_mux = 0, | ||
505 | .init = &dc10_init, | 549 | .init = &dc10_init, |
506 | }, { | 550 | }, { |
507 | .type = DC30plus, | 551 | .type = DC30plus, |
@@ -532,6 +576,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
532 | .gpcs = { -1, 0 }, | 576 | .gpcs = { -1, 0 }, |
533 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, | 577 | .vfe_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, |
534 | .gws_not_connected = 0, | 578 | .gws_not_connected = 0, |
579 | .input_mux = 0, | ||
535 | .init = &dc10_init, | 580 | .init = &dc10_init, |
536 | }, { | 581 | }, { |
537 | .type = LML33, | 582 | .type = LML33, |
@@ -558,6 +603,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
558 | .gpcs = { 3, 1 }, | 603 | .gpcs = { 3, 1 }, |
559 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, | 604 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, |
560 | .gws_not_connected = 1, | 605 | .gws_not_connected = 1, |
606 | .input_mux = 0, | ||
561 | .init = &lml33_init, | 607 | .init = &lml33_init, |
562 | }, { | 608 | }, { |
563 | .type = LML33R10, | 609 | .type = LML33R10, |
@@ -586,6 +632,7 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
586 | .gpcs = { 3, 1 }, | 632 | .gpcs = { 3, 1 }, |
587 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, | 633 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, |
588 | .gws_not_connected = 1, | 634 | .gws_not_connected = 1, |
635 | .input_mux = 0, | ||
589 | .init = &lml33_init, | 636 | .init = &lml33_init, |
590 | }, { | 637 | }, { |
591 | .type = BUZ, | 638 | .type = BUZ, |
@@ -614,8 +661,49 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = { | |||
614 | .gpcs = { 3, 1 }, | 661 | .gpcs = { 3, 1 }, |
615 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, | 662 | .vfe_pol = { 1, 1, 0, 0, 0, 1, 0, 0 }, |
616 | .gws_not_connected = 1, | 663 | .gws_not_connected = 1, |
664 | .input_mux = 0, | ||
617 | .init = &buz_init, | 665 | .init = &buz_init, |
666 | }, { | ||
667 | .type = AVS6EYES, | ||
668 | .name = "6-Eyes", | ||
669 | /* AverMedia chose not to brand the 6-Eyes. Thus it | ||
670 | can't be autodetected, and requires card=x. */ | ||
671 | .vendor_id = -1, | ||
672 | .device_id = -1, | ||
673 | .i2c_decoder = I2C_DRIVERID_KS0127, | ||
674 | .i2c_encoder = I2C_DRIVERID_BT866, | ||
675 | .video_codec = CODEC_TYPE_ZR36060, | ||
676 | |||
677 | .inputs = 10, | ||
678 | .input = { | ||
679 | { 0, "Composite 1" }, | ||
680 | { 1, "Composite 2" }, | ||
681 | { 2, "Composite 3" }, | ||
682 | { 4, "Composite 4" }, | ||
683 | { 5, "Composite 5" }, | ||
684 | { 6, "Composite 6" }, | ||
685 | { 8, "S-Video 1" }, | ||
686 | { 9, "S-Video 2" }, | ||
687 | {10, "S-Video 3" }, | ||
688 | {15, "YCbCr" } | ||
689 | }, | ||
690 | .norms = 2, | ||
691 | .tvn = { | ||
692 | &f50ccir601_avs6eyes, | ||
693 | &f60ccir601_avs6eyes, | ||
694 | NULL | ||
695 | }, | ||
696 | .jpeg_int = ZR36057_ISR_GIRQ1, | ||
697 | .vsync_int = ZR36057_ISR_GIRQ0, | ||
698 | .gpio = { 1, 0, 3, -1, -1, -1, -1, -1 },// Validity unknown /Sam | ||
699 | .gpio_pol = { 0, 0, 0, 0, 0, 0, 0, 0 }, // Validity unknown /Sam | ||
700 | .gpcs = { 3, 1 }, // Validity unknown /Sam | ||
701 | .vfe_pol = { 1, 0, 0, 0, 0, 1, 0, 0 }, // Validity unknown /Sam | ||
702 | .gws_not_connected = 1, | ||
703 | .input_mux = 1, | ||
704 | .init = &avs6eyes_init, | ||
618 | } | 705 | } |
706 | |||
619 | }; | 707 | }; |
620 | 708 | ||
621 | /* | 709 | /* |