aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/bt8xx/bt832.c1
-rw-r--r--drivers/media/video/bt8xx/bttv-cards.c299
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c91
-rw-r--r--drivers/media/video/bt8xx/bttv-i2c.c4
-rw-r--r--drivers/media/video/bt8xx/bttv.h3
-rw-r--r--drivers/media/video/bt8xx/bttvp.h4
-rw-r--r--drivers/media/video/cs53l32a.c5
-rw-r--r--drivers/media/video/cx25840/cx25840-audio.c1
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c11
-rw-r--r--drivers/media/video/cx88/cx88.h1
-rw-r--r--drivers/media/video/msp3400-driver.c104
-rw-r--r--drivers/media/video/msp3400-kthreads.c1
-rw-r--r--drivers/media/video/saa7115.c1
-rw-r--r--drivers/media/video/saa7134/saa7134.h1
-rw-r--r--drivers/media/video/tda7432.c1
-rw-r--r--drivers/media/video/tda9875.c3
-rw-r--r--drivers/media/video/tuner-core.c1
-rw-r--r--drivers/media/video/tvaudio.c67
-rw-r--r--drivers/media/video/tveeprom.c30
-rw-r--r--drivers/media/video/v4l2-common.c2
-rw-r--r--drivers/media/video/wm8775.c5
21 files changed, 316 insertions, 320 deletions
diff --git a/drivers/media/video/bt8xx/bt832.c b/drivers/media/video/bt8xx/bt832.c
index f1309d94e96e..a51876137880 100644
--- a/drivers/media/video/bt8xx/bt832.c
+++ b/drivers/media/video/bt8xx/bt832.c
@@ -30,7 +30,6 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/errno.h> 31#include <linux/errno.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <media/audiochip.h>
34#include <media/v4l2-common.h> 33#include <media/v4l2-common.h>
35 34
36#include "bttv.h" 35#include "bttv.h"
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index e869bfbab378..f209a7492051 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -39,6 +39,7 @@
39 39
40#include "bttvp.h" 40#include "bttvp.h"
41#include <media/v4l2-common.h> 41#include <media/v4l2-common.h>
42#include <media/tvaudio.h>
42 43
43/* fwd decl */ 44/* fwd decl */
44static void boot_msp34xx(struct bttv *btv, int pin); 45static void boot_msp34xx(struct bttv *btv, int pin);
@@ -336,7 +337,8 @@ struct tvcard bttv_tvcards[] = {
336 .svhs = 2, 337 .svhs = 2,
337 .gpiomask = 15, 338 .gpiomask = 15,
338 .muxsel = { 2, 3, 1, 1 }, 339 .muxsel = { 2, 3, 1, 1 },
339 .audiomux = { 2, 0, 0, 0, 10 }, 340 .gpiomux = { 2, 0, 0, 0 },
341 .gpiomute = 10,
340 .needs_tvaudio = 1, 342 .needs_tvaudio = 1,
341 .tuner_type = -1, 343 .tuner_type = -1,
342 .tuner_addr = ADDR_UNSET, 344 .tuner_addr = ADDR_UNSET,
@@ -350,7 +352,8 @@ struct tvcard bttv_tvcards[] = {
350 .svhs = 2, 352 .svhs = 2,
351 .gpiomask = 7, 353 .gpiomask = 7,
352 .muxsel = { 2, 3, 1, 1 }, 354 .muxsel = { 2, 3, 1, 1 },
353 .audiomux = { 0, 1, 2, 3, 4 }, 355 .gpiomux = { 0, 1, 2, 3 },
356 .gpiomute = 4,
354 .needs_tvaudio = 1, 357 .needs_tvaudio = 1,
355 .tuner_type = -1, 358 .tuner_type = -1,
356 .tuner_addr = ADDR_UNSET, 359 .tuner_addr = ADDR_UNSET,
@@ -364,7 +367,8 @@ struct tvcard bttv_tvcards[] = {
364 .svhs = 2, 367 .svhs = 2,
365 .gpiomask = 7, 368 .gpiomask = 7,
366 .muxsel = { 2, 3, 1, 1 }, 369 .muxsel = { 2, 3, 1, 1 },
367 .audiomux = { 4, 0, 2, 3, 1 }, 370 .gpiomux = { 4, 0, 2, 3 },
371 .gpiomute = 1,
368 .no_msp34xx = 1, 372 .no_msp34xx = 1,
369 .needs_tvaudio = 1, 373 .needs_tvaudio = 1,
370 .tuner_type = TUNER_PHILIPS_NTSC, 374 .tuner_type = TUNER_PHILIPS_NTSC,
@@ -383,7 +387,7 @@ struct tvcard bttv_tvcards[] = {
383 .svhs = 2, 387 .svhs = 2,
384 .gpiomask = 0, 388 .gpiomask = 0,
385 .muxsel = { 2, 3, 1, 1 }, 389 .muxsel = { 2, 3, 1, 1 },
386 .audiomux = { 0 }, 390 .gpiomux = { 0 },
387 .needs_tvaudio = 0, 391 .needs_tvaudio = 0,
388 .tuner_type = 4, 392 .tuner_type = 4,
389 .tuner_addr = ADDR_UNSET, 393 .tuner_addr = ADDR_UNSET,
@@ -397,7 +401,8 @@ struct tvcard bttv_tvcards[] = {
397 .svhs = 2, 401 .svhs = 2,
398 .gpiomask = 3, 402 .gpiomask = 3,
399 .muxsel = { 2, 3, 1, 0 }, 403 .muxsel = { 2, 3, 1, 0 },
400 .audiomux = { 0, 1, 0, 1, 3 }, 404 .gpiomux = { 0, 1, 0, 1 },
405 .gpiomute = 3,
401 .needs_tvaudio = 1, 406 .needs_tvaudio = 1,
402 .tuner_type = -1, 407 .tuner_type = -1,
403 .tuner_addr = ADDR_UNSET, 408 .tuner_addr = ADDR_UNSET,
@@ -411,7 +416,7 @@ struct tvcard bttv_tvcards[] = {
411 .svhs = 3, 416 .svhs = 3,
412 .muxsel = { 2, 3, 1, 1 }, 417 .muxsel = { 2, 3, 1, 1 },
413 .gpiomask = 0x0f, 418 .gpiomask = 0x0f,
414 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0 }, 419 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
415 /* 0x04 for some cards ?? */ 420 /* 0x04 for some cards ?? */
416 .needs_tvaudio = 1, 421 .needs_tvaudio = 1,
417 .tuner_type = -1, 422 .tuner_type = -1,
@@ -428,7 +433,7 @@ struct tvcard bttv_tvcards[] = {
428 .svhs = 3, 433 .svhs = 3,
429 .gpiomask = 0, 434 .gpiomask = 0,
430 .muxsel = { 2, 3, 1, 0, 0 }, 435 .muxsel = { 2, 3, 1, 0, 0 },
431 .audiomux = { 0 }, 436 .gpiomux = { 0 },
432 .needs_tvaudio = 1, 437 .needs_tvaudio = 1,
433 .tuner_type = -1, 438 .tuner_type = -1,
434 .tuner_addr = ADDR_UNSET, 439 .tuner_addr = ADDR_UNSET,
@@ -444,7 +449,8 @@ struct tvcard bttv_tvcards[] = {
444 .svhs = 2, 449 .svhs = 2,
445 .gpiomask = 0xc00, 450 .gpiomask = 0xc00,
446 .muxsel = { 2, 3, 1, 1 }, 451 .muxsel = { 2, 3, 1, 1 },
447 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0 }, 452 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
453 .gpiomute = 0xc00,
448 .needs_tvaudio = 1, 454 .needs_tvaudio = 1,
449 .pll = PLL_28, 455 .pll = PLL_28,
450 .tuner_type = -1, 456 .tuner_type = -1,
@@ -459,7 +465,7 @@ struct tvcard bttv_tvcards[] = {
459 .svhs = 2, 465 .svhs = 2,
460 .gpiomask = 3, 466 .gpiomask = 3,
461 .muxsel = { 2, 3, 1, 1 }, 467 .muxsel = { 2, 3, 1, 1 },
462 .audiomux = { 1, 1, 2, 3, 0 }, 468 .gpiomux = { 1, 1, 2, 3 },
463 .needs_tvaudio = 0, 469 .needs_tvaudio = 0,
464 .pll = PLL_28, 470 .pll = PLL_28,
465 .tuner_type = TUNER_TEMIC_PAL, 471 .tuner_type = TUNER_TEMIC_PAL,
@@ -474,7 +480,8 @@ struct tvcard bttv_tvcards[] = {
474 .svhs = 2, 480 .svhs = 2,
475 .gpiomask = 0x0f, /* old: 7 */ 481 .gpiomask = 0x0f, /* old: 7 */
476 .muxsel = { 2, 0, 1, 1 }, 482 .muxsel = { 2, 0, 1, 1 },
477 .audiomux = { 0, 1, 2, 3, 4 }, 483 .gpiomux = { 0, 1, 2, 3 },
484 .gpiomute = 4,
478 .needs_tvaudio = 1, 485 .needs_tvaudio = 1,
479 .pll = PLL_28, 486 .pll = PLL_28,
480 .tuner_type = -1, 487 .tuner_type = -1,
@@ -489,7 +496,8 @@ struct tvcard bttv_tvcards[] = {
489 .svhs = 2, 496 .svhs = 2,
490 .gpiomask = 0x3014f, 497 .gpiomask = 0x3014f,
491 .muxsel = { 2, 3, 1, 1 }, 498 .muxsel = { 2, 3, 1, 1 },
492 .audiomux = { 0x20001,0x10001, 0, 0,10 }, 499 .gpiomux = { 0x20001,0x10001, 0, 0 },
500 .gpiomute = 10,
493 .needs_tvaudio = 1, 501 .needs_tvaudio = 1,
494 .tuner_type = -1, 502 .tuner_type = -1,
495 .tuner_addr = ADDR_UNSET, 503 .tuner_addr = ADDR_UNSET,
@@ -505,7 +513,7 @@ struct tvcard bttv_tvcards[] = {
505 .svhs = 2, 513 .svhs = 2,
506 .gpiomask = 15, 514 .gpiomask = 15,
507 .muxsel = { 2, 3, 1, 1 }, 515 .muxsel = { 2, 3, 1, 1 },
508 .audiomux = { 13, 14, 11, 7, 0, 0 }, 516 .gpiomux = { 13, 14, 11, 7 },
509 .needs_tvaudio = 1, 517 .needs_tvaudio = 1,
510 .tuner_type = -1, 518 .tuner_type = -1,
511 .tuner_addr = ADDR_UNSET, 519 .tuner_addr = ADDR_UNSET,
@@ -519,7 +527,7 @@ struct tvcard bttv_tvcards[] = {
519 .svhs = 2, 527 .svhs = 2,
520 .gpiomask = 15, 528 .gpiomask = 15,
521 .muxsel = { 2, 3, 1, 1 }, 529 .muxsel = { 2, 3, 1, 1 },
522 .audiomux = { 13, 14, 11, 7, 0, 0 }, 530 .gpiomux = { 13, 14, 11, 7 },
523 .needs_tvaudio = 1, 531 .needs_tvaudio = 1,
524 .msp34xx_alt = 1, 532 .msp34xx_alt = 1,
525 .pll = PLL_28, 533 .pll = PLL_28,
@@ -537,7 +545,8 @@ struct tvcard bttv_tvcards[] = {
537 .svhs = 2, 545 .svhs = 2,
538 .gpiomask = 7, 546 .gpiomask = 7,
539 .muxsel = { 2, 3, 1, 1 }, 547 .muxsel = { 2, 3, 1, 1 },
540 .audiomux = { 0, 2, 1, 3, 4 }, /* old: {0, 1, 2, 3, 4} */ 548 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
549 .gpiomute = 4,
541 .needs_tvaudio = 1, 550 .needs_tvaudio = 1,
542 .pll = PLL_28, 551 .pll = PLL_28,
543 .tuner_type = -1, 552 .tuner_type = -1,
@@ -552,7 +561,8 @@ struct tvcard bttv_tvcards[] = {
552 .svhs = 2, 561 .svhs = 2,
553 .gpiomask = 15, 562 .gpiomask = 15,
554 .muxsel = { 2, 3, 1, 1 }, 563 .muxsel = { 2, 3, 1, 1 },
555 .audiomux = { 0 , 0, 1 , 0, 10 }, 564 .gpiomux = { 0, 0, 1, 0 },
565 .gpiomute = 10,
556 .needs_tvaudio = 1, 566 .needs_tvaudio = 1,
557 .tuner_type = -1, 567 .tuner_type = -1,
558 .tuner_addr = ADDR_UNSET, 568 .tuner_addr = ADDR_UNSET,
@@ -570,10 +580,11 @@ struct tvcard bttv_tvcards[] = {
570 .muxsel = { 2, 3, 1, 1 }, 580 .muxsel = { 2, 3, 1, 1 },
571 #if 0 581 #if 0
572 /* old */ 582 /* old */
573 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 }, 583 .gpiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000 },
574 #else 584 #else
575 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */ 585 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
576 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 }, 586 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
587 .gpiomute = 0x002000,
577 #endif 588 #endif
578 .needs_tvaudio = 1, 589 .needs_tvaudio = 1,
579 .pll = PLL_28, 590 .pll = PLL_28,
@@ -587,7 +598,8 @@ struct tvcard bttv_tvcards[] = {
587 .svhs = 2, 598 .svhs = 2,
588 .gpiomask = 0x8300f8, 599 .gpiomask = 0x8300f8,
589 .muxsel = { 2, 3, 1, 1,0 }, 600 .muxsel = { 2, 3, 1, 1,0 },
590 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007 }, 601 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
602 .gpiomute = 0xcfa007,
591 .needs_tvaudio = 1, 603 .needs_tvaudio = 1,
592 .tuner_type = -1, 604 .tuner_type = -1,
593 .tuner_addr = ADDR_UNSET, 605 .tuner_addr = ADDR_UNSET,
@@ -603,7 +615,7 @@ struct tvcard bttv_tvcards[] = {
603 .svhs = 2, 615 .svhs = 2,
604 .gpiomask = 0, 616 .gpiomask = 0,
605 .muxsel = { 2, 3, 1, 1 }, 617 .muxsel = { 2, 3, 1, 1 },
606 .audiomux = { 1, 0, 0, 0, 0 }, 618 .gpiomux = { 1, 0, 0, 0 },
607 .needs_tvaudio = 1, 619 .needs_tvaudio = 1,
608 .tuner_type = -1, 620 .tuner_type = -1,
609 .tuner_addr = ADDR_UNSET, 621 .tuner_addr = ADDR_UNSET,
@@ -617,7 +629,7 @@ struct tvcard bttv_tvcards[] = {
617 .svhs = -1, 629 .svhs = -1,
618 .gpiomask = 0x8dff00, 630 .gpiomask = 0x8dff00,
619 .muxsel = { 2, 3, 1, 1 }, 631 .muxsel = { 2, 3, 1, 1 },
620 .audiomux = { 0 }, 632 .gpiomux = { 0 },
621 .no_msp34xx = 1, 633 .no_msp34xx = 1,
622 .tuner_type = -1, 634 .tuner_type = -1,
623 .tuner_addr = ADDR_UNSET, 635 .tuner_addr = ADDR_UNSET,
@@ -644,7 +656,8 @@ struct tvcard bttv_tvcards[] = {
644 .svhs = 2, 656 .svhs = 2,
645 .gpiomask = 0x1800, 657 .gpiomask = 0x1800,
646 .muxsel = { 2, 3, 1, 1 }, 658 .muxsel = { 2, 3, 1, 1 },
647 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 }, 659 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
660 .gpiomute = 0x1800,
648 .pll = PLL_28, 661 .pll = PLL_28,
649 .tuner_type = TUNER_PHILIPS_PAL_I, 662 .tuner_type = TUNER_PHILIPS_PAL_I,
650 .tuner_addr = ADDR_UNSET, 663 .tuner_addr = ADDR_UNSET,
@@ -658,7 +671,8 @@ struct tvcard bttv_tvcards[] = {
658 .svhs = 2, 671 .svhs = 2,
659 .gpiomask = 0xc00, 672 .gpiomask = 0xc00,
660 .muxsel = { 2, 3, 1, 1 }, 673 .muxsel = { 2, 3, 1, 1 },
661 .audiomux = { 0, 1, 0x800, 0x400, 0xc00, 0 }, 674 .gpiomux = { 0, 1, 0x800, 0x400 },
675 .gpiomute = 0xc00,
662 .needs_tvaudio = 1, 676 .needs_tvaudio = 1,
663 .pll = PLL_28, 677 .pll = PLL_28,
664 .tuner_type = -1, 678 .tuner_type = -1,
@@ -674,7 +688,7 @@ struct tvcard bttv_tvcards[] = {
674 .gpiomask = 7, 688 .gpiomask = 7,
675 .muxsel = { 2, 3, -1 }, 689 .muxsel = { 2, 3, -1 },
676 .digital_mode = DIGITAL_MODE_CAMERA, 690 .digital_mode = DIGITAL_MODE_CAMERA,
677 .audiomux = { 0, 0, 0, 0, 0 }, 691 .gpiomux = { 0, 0, 0, 0 },
678 .no_msp34xx = 1, 692 .no_msp34xx = 1,
679 .pll = PLL_28, 693 .pll = PLL_28,
680 .tuner_type = TUNER_ALPS_TSBB5_PAL_I, 694 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
@@ -691,7 +705,8 @@ struct tvcard bttv_tvcards[] = {
691 .svhs = 2, 705 .svhs = 2,
692 .gpiomask = 0xe00, 706 .gpiomask = 0xe00,
693 .muxsel = { 2, 3, 1, 1 }, 707 .muxsel = { 2, 3, 1, 1 },
694 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00 }, 708 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
709 .gpiomute = 0xc00,
695 .needs_tvaudio = 1, 710 .needs_tvaudio = 1,
696 .pll = PLL_28, 711 .pll = PLL_28,
697 .tuner_type = -1, 712 .tuner_type = -1,
@@ -707,7 +722,8 @@ struct tvcard bttv_tvcards[] = {
707 .svhs = 2, 722 .svhs = 2,
708 .gpiomask = 0x1f0fff, 723 .gpiomask = 0x1f0fff,
709 .muxsel = { 2, 3, 1, 1 }, 724 .muxsel = { 2, 3, 1, 1 },
710 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000 }, 725 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
726 .gpiomute = 0x40000,
711 .needs_tvaudio = 0, 727 .needs_tvaudio = 0,
712 .tuner_type = TUNER_PHILIPS_PAL, 728 .tuner_type = TUNER_PHILIPS_PAL,
713 .tuner_addr = ADDR_UNSET, 729 .tuner_addr = ADDR_UNSET,
@@ -722,7 +738,8 @@ struct tvcard bttv_tvcards[] = {
722 .svhs = 3, 738 .svhs = 3,
723 .gpiomask = 7, 739 .gpiomask = 7,
724 .muxsel = { 2, 0, 1, 1 }, 740 .muxsel = { 2, 0, 1, 1 },
725 .audiomux = { 0, 1, 2, 3, 4 }, 741 .gpiomux = { 0, 1, 2, 3 },
742 .gpiomute = 4,
726 .needs_tvaudio = 1, 743 .needs_tvaudio = 1,
727 .tuner_type = -1, 744 .tuner_type = -1,
728 .tuner_addr = ADDR_UNSET, 745 .tuner_addr = ADDR_UNSET,
@@ -736,7 +753,8 @@ struct tvcard bttv_tvcards[] = {
736 .svhs = 2, 753 .svhs = 2,
737 .gpiomask = 0x1800, 754 .gpiomask = 0x1800,
738 .muxsel = { 2, 3, 1, 1 }, 755 .muxsel = { 2, 3, 1, 1 },
739 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 }, 756 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
757 .gpiomute = 0x1800,
740 .pll = PLL_28, 758 .pll = PLL_28,
741 .tuner_type = TUNER_PHILIPS_SECAM, 759 .tuner_type = TUNER_PHILIPS_SECAM,
742 .tuner_addr = ADDR_UNSET, 760 .tuner_addr = ADDR_UNSET,
@@ -752,7 +770,8 @@ struct tvcard bttv_tvcards[] = {
752 .svhs = 2, 770 .svhs = 2,
753 .gpiomask = 0x1f0fff, 771 .gpiomask = 0x1f0fff,
754 .muxsel = { 2, 3, 1, 1 }, 772 .muxsel = { 2, 3, 1, 1 },
755 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000 }, 773 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
774 .gpiomute = 0x40000,
756 .needs_tvaudio = 0, 775 .needs_tvaudio = 0,
757 .tuner_type = TUNER_PHILIPS_PAL, 776 .tuner_type = TUNER_PHILIPS_PAL,
758 .tuner_addr = ADDR_UNSET, 777 .tuner_addr = ADDR_UNSET,
@@ -799,7 +818,7 @@ struct tvcard bttv_tvcards[] = {
799 .svhs = 1, /* was: 4 */ 818 .svhs = 1, /* was: 4 */
800 .gpiomask = 0, 819 .gpiomask = 0,
801 .muxsel = { 2, 3, 1, 0, 0}, 820 .muxsel = { 2, 3, 1, 0, 0},
802 .audiomux = { 0 }, 821 .gpiomux = { 0 },
803 .needs_tvaudio = 1, 822 .needs_tvaudio = 1,
804 .tuner_type = -1, 823 .tuner_type = -1,
805 .tuner_addr = ADDR_UNSET, 824 .tuner_addr = ADDR_UNSET,
@@ -815,7 +834,8 @@ struct tvcard bttv_tvcards[] = {
815 .svhs = 2, 834 .svhs = 2,
816 .gpiomask = 0x1800, /* 0x8dfe00 */ 835 .gpiomask = 0x1800, /* 0x8dfe00 */
817 .muxsel = { 2, 3, 1, 1 }, 836 .muxsel = { 2, 3, 1, 1 },
818 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 }, 837 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
838 .gpiomute = 0x1800,
819 .pll = PLL_28, 839 .pll = PLL_28,
820 .tuner_type = -1, 840 .tuner_type = -1,
821 .tuner_addr = ADDR_UNSET, 841 .tuner_addr = ADDR_UNSET,
@@ -829,7 +849,7 @@ struct tvcard bttv_tvcards[] = {
829 .svhs = 3, 849 .svhs = 3,
830 .gpiomask = 1, 850 .gpiomask = 1,
831 .muxsel = { 2, 3, 1, 1 }, 851 .muxsel = { 2, 3, 1, 1 },
832 .audiomux = { 1, 0, 0, 0, 0 }, 852 .gpiomux = { 1, 0, 0, 0 },
833 .pll = PLL_28, 853 .pll = PLL_28,
834 .tuner_type = TUNER_PHILIPS_PAL, 854 .tuner_type = TUNER_PHILIPS_PAL,
835 .tuner_addr = ADDR_UNSET, 855 .tuner_addr = ADDR_UNSET,
@@ -845,7 +865,7 @@ struct tvcard bttv_tvcards[] = {
845 .svhs = 2, 865 .svhs = 2,
846 .gpiomask = 0, 866 .gpiomask = 0,
847 .muxsel = { 2, 3, 1, 1 }, 867 .muxsel = { 2, 3, 1, 1 },
848 .audiomux = { 0 }, 868 .gpiomux = { 0 },
849 .needs_tvaudio = 0, 869 .needs_tvaudio = 0,
850 .tuner_type = 4, 870 .tuner_type = 4,
851 .tuner_addr = ADDR_UNSET, 871 .tuner_addr = ADDR_UNSET,
@@ -859,7 +879,8 @@ struct tvcard bttv_tvcards[] = {
859 .svhs = 2, 879 .svhs = 2,
860 .gpiomask = 0xffff00, 880 .gpiomask = 0xffff00,
861 .muxsel = { 2, 3, 1, 1 }, 881 .muxsel = { 2, 3, 1, 1 },
862 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900 }, 882 .gpiomux = { 0x500, 0, 0x300, 0x900 },
883 .gpiomute = 0x900,
863 .needs_tvaudio = 1, 884 .needs_tvaudio = 1,
864 .pll = PLL_28, 885 .pll = PLL_28,
865 .tuner_type = TUNER_PHILIPS_PAL, 886 .tuner_type = TUNER_PHILIPS_PAL,
@@ -875,11 +896,12 @@ struct tvcard bttv_tvcards[] = {
875 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */ 896 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
876 #if 0 897 #if 0
877 .gpiomask = 0xc33000, 898 .gpiomask = 0xc33000,
878 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 }, 899 .gpiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
879 #else 900 #else
880 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */ 901 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
881 .gpiomask = 0xb33000, 902 .gpiomask = 0xb33000,
882 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 }, 903 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
904 .gpiomute = 0x800000,
883 #endif 905 #endif
884 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !) 906 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
885 gpio23 -- hef4052:nEnable (0x800000) 907 gpio23 -- hef4052:nEnable (0x800000)
@@ -909,7 +931,8 @@ struct tvcard bttv_tvcards[] = {
909 .svhs = 2, 931 .svhs = 2,
910 .gpiomask = 0x1800, 932 .gpiomask = 0x1800,
911 .muxsel = { 2, 3, 1, 1 }, 933 .muxsel = { 2, 3, 1, 1 },
912 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 }, 934 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
935 .gpiomute = 0x1800,
913 .pll = PLL_28, 936 .pll = PLL_28,
914 .tuner_type = -1, 937 .tuner_type = -1,
915 .tuner_addr = ADDR_UNSET, 938 .tuner_addr = ADDR_UNSET,
@@ -925,7 +948,8 @@ struct tvcard bttv_tvcards[] = {
925 .svhs = 2, 948 .svhs = 2,
926 .gpiomask = 0x1800, 949 .gpiomask = 0x1800,
927 .muxsel = { 2, 3, 1, 1 }, 950 .muxsel = { 2, 3, 1, 1 },
928 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 }, 951 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
952 .gpiomute = 0x1800,
929 .pll = PLL_28, 953 .pll = PLL_28,
930 .tuner_type = -1, 954 .tuner_type = -1,
931 .tuner_addr = ADDR_UNSET, 955 .tuner_addr = ADDR_UNSET,
@@ -940,7 +964,8 @@ struct tvcard bttv_tvcards[] = {
940 .svhs = 2, 964 .svhs = 2,
941 .gpiomask = 0xff, 965 .gpiomask = 0xff,
942 .muxsel = { 2, 3, 1, 1 }, 966 .muxsel = { 2, 3, 1, 1 },
943 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 }, 967 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
968 .gpiomute = 0x29,
944 .no_msp34xx = 1, 969 .no_msp34xx = 1,
945 .pll = PLL_28, 970 .pll = PLL_28,
946 .tuner_type = -1, 971 .tuner_type = -1,
@@ -955,7 +980,8 @@ struct tvcard bttv_tvcards[] = {
955 .svhs = 2, 980 .svhs = 2,
956 .gpiomask = 0x551e00, 981 .gpiomask = 0x551e00,
957 .muxsel = { 2, 3, 1, 0 }, 982 .muxsel = { 2, 3, 1, 0 },
958 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 }, 983 .gpiomux = { 0x551400, 0x551200, 0, 0 },
984 .gpiomute = 0x551c00,
959 .needs_tvaudio = 1, 985 .needs_tvaudio = 1,
960 .pll = PLL_28, 986 .pll = PLL_28,
961 .tuner_type = 1, 987 .tuner_type = 1,
@@ -971,7 +997,8 @@ struct tvcard bttv_tvcards[] = {
971 .svhs = 2, 997 .svhs = 2,
972 .gpiomask = 0x03000F, 998 .gpiomask = 0x03000F,
973 .muxsel = { 2, 3, 1, 1 }, 999 .muxsel = { 2, 3, 1, 1 },
974 .audiomux = { 2, 0xd0001, 0, 0, 1 }, 1000 .gpiomux = { 2, 0xd0001, 0, 0 },
1001 .gpiomute = 1,
975 .needs_tvaudio = 0, 1002 .needs_tvaudio = 0,
976 .pll = PLL_28, 1003 .pll = PLL_28,
977 .tuner_type = -1, 1004 .tuner_type = -1,
@@ -988,7 +1015,8 @@ struct tvcard bttv_tvcards[] = {
988 .svhs = 2, 1015 .svhs = 2,
989 .gpiomask = 7, 1016 .gpiomask = 7,
990 .muxsel = { 2, 3, 1, 1 }, 1017 .muxsel = { 2, 3, 1, 1 },
991 .audiomux = { 4, 0, 2, 3, 1 }, 1018 .gpiomux = { 4, 0, 2, 3 },
1019 .gpiomute = 1,
992 .no_msp34xx = 1, 1020 .no_msp34xx = 1,
993 .needs_tvaudio = 1, 1021 .needs_tvaudio = 1,
994 .tuner_type = TUNER_PHILIPS_NTSC, 1022 .tuner_type = TUNER_PHILIPS_NTSC,
@@ -1005,7 +1033,7 @@ struct tvcard bttv_tvcards[] = {
1005 .svhs = 2, 1033 .svhs = 2,
1006 .gpiomask = 15, 1034 .gpiomask = 15,
1007 .muxsel = { 2, 3, 1, 1 }, 1035 .muxsel = { 2, 3, 1, 1 },
1008 .audiomux = { 13, 4, 11, 7, 0, 0 }, 1036 .gpiomux = { 13, 4, 11, 7 },
1009 .needs_tvaudio = 1, 1037 .needs_tvaudio = 1,
1010 .pll = PLL_28, 1038 .pll = PLL_28,
1011 .tuner_type = -1, 1039 .tuner_type = -1,
@@ -1022,7 +1050,7 @@ struct tvcard bttv_tvcards[] = {
1022 .svhs = 2, 1050 .svhs = 2,
1023 .gpiomask = 0, 1051 .gpiomask = 0,
1024 .muxsel = { 2, 3, 1, 1}, 1052 .muxsel = { 2, 3, 1, 1},
1025 .audiomux = { 0, 0, 0, 0, 0}, 1053 .gpiomux = { 0, 0, 0, 0},
1026 .needs_tvaudio = 1, 1054 .needs_tvaudio = 1,
1027 .no_msp34xx = 1, 1055 .no_msp34xx = 1,
1028 .pll = PLL_28, 1056 .pll = PLL_28,
@@ -1038,7 +1066,8 @@ struct tvcard bttv_tvcards[] = {
1038 .svhs = 2, 1066 .svhs = 2,
1039 .gpiomask = 0xe00b, 1067 .gpiomask = 0xe00b,
1040 .muxsel = { 2, 3, 1, 1 }, 1068 .muxsel = { 2, 3, 1, 1 },
1041 .audiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc }, 1069 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1070 .gpiomute = 0xff3ffc,
1042 .no_msp34xx = 1, 1071 .no_msp34xx = 1,
1043 .tuner_type = -1, 1072 .tuner_type = -1,
1044 .tuner_addr = ADDR_UNSET, 1073 .tuner_addr = ADDR_UNSET,
@@ -1054,7 +1083,8 @@ struct tvcard bttv_tvcards[] = {
1054 .svhs = -1, 1083 .svhs = -1,
1055 .gpiomask = 3, 1084 .gpiomask = 3,
1056 .muxsel = { 2, 3, 1, 1 }, 1085 .muxsel = { 2, 3, 1, 1 },
1057 .audiomux = { 1, 1, 0, 2, 3 }, 1086 .gpiomux = { 1, 1, 0, 2 },
1087 .gpiomute = 3,
1058 .no_msp34xx = 1, 1088 .no_msp34xx = 1,
1059 .pll = PLL_NONE, 1089 .pll = PLL_NONE,
1060 .tuner_type = -1, 1090 .tuner_type = -1,
@@ -1069,7 +1099,7 @@ struct tvcard bttv_tvcards[] = {
1069 .svhs = 3, 1099 .svhs = 3,
1070 .gpiomask = 0, 1100 .gpiomask = 0,
1071 .muxsel = { 2, 3, 1, 0, 0 }, 1101 .muxsel = { 2, 3, 1, 0, 0 },
1072 .audiomux = { 0 }, 1102 .gpiomux = { 0 },
1073 .no_msp34xx = 1, 1103 .no_msp34xx = 1,
1074 .pll = PLL_28, 1104 .pll = PLL_28,
1075 .tuner_type = -1, 1105 .tuner_type = -1,
@@ -1084,7 +1114,8 @@ struct tvcard bttv_tvcards[] = {
1084 .svhs = 2, 1114 .svhs = 2,
1085 .gpiomask = 0xbcf03f, 1115 .gpiomask = 0xbcf03f,
1086 .muxsel = { 2, 3, 1, 1 }, 1116 .muxsel = { 2, 3, 1, 1 },
1087 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f }, 1117 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1118 .gpiomute = 0xbcb03f,
1088 .no_msp34xx = 1, 1119 .no_msp34xx = 1,
1089 .pll = PLL_28, 1120 .pll = PLL_28,
1090 .tuner_type = 21, 1121 .tuner_type = 21,
@@ -1099,7 +1130,8 @@ struct tvcard bttv_tvcards[] = {
1099 .svhs = 2, 1130 .svhs = 2,
1100 .gpiomask = 0x70000, 1131 .gpiomask = 0x70000,
1101 .muxsel = { 2, 3, 1, 1 }, 1132 .muxsel = { 2, 3, 1, 1 },
1102 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 }, 1133 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1134 .gpiomute = 0x40000,
1103 .needs_tvaudio = 1, 1135 .needs_tvaudio = 1,
1104 .no_msp34xx = 1, 1136 .no_msp34xx = 1,
1105 .pll = PLL_35, 1137 .pll = PLL_35,
@@ -1118,7 +1150,8 @@ struct tvcard bttv_tvcards[] = {
1118 .svhs = 2, 1150 .svhs = 2,
1119 .gpiomask = 15, 1151 .gpiomask = 15,
1120 .muxsel = { 2, 3, 1, 1 }, 1152 .muxsel = { 2, 3, 1, 1 },
1121 .audiomux = {2,0,0,0,1 }, 1153 .gpiomux = {2,0,0,0 },
1154 .gpiomute = 1,
1122 .needs_tvaudio = 1, 1155 .needs_tvaudio = 1,
1123 .pll = PLL_28, 1156 .pll = PLL_28,
1124 .tuner_type = -1, 1157 .tuner_type = -1,
@@ -1133,7 +1166,7 @@ struct tvcard bttv_tvcards[] = {
1133 .svhs = 2, 1166 .svhs = 2,
1134 .gpiomask = 0x010f00, 1167 .gpiomask = 0x010f00,
1135 .muxsel = {2, 3, 0, 0 }, 1168 .muxsel = {2, 3, 0, 0 },
1136 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0 }, 1169 .gpiomux = {0x10000, 0, 0x10000, 0 },
1137 .no_msp34xx = 1, 1170 .no_msp34xx = 1,
1138 .pll = PLL_28, 1171 .pll = PLL_28,
1139 .tuner_type = TUNER_ALPS_TSHC6_NTSC, 1172 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
@@ -1150,7 +1183,8 @@ struct tvcard bttv_tvcards[] = {
1150 .gpiomask = 0xAA0000, 1183 .gpiomask = 0xAA0000,
1151 .muxsel = { 2,3,1,1,-1 }, 1184 .muxsel = { 2,3,1,1,-1 },
1152 .digital_mode = DIGITAL_MODE_CAMERA, 1185 .digital_mode = DIGITAL_MODE_CAMERA,
1153 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 }, 1186 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1187 .gpiomute = 0xa8000,
1154 .no_msp34xx = 1, 1188 .no_msp34xx = 1,
1155 .pll = PLL_28, 1189 .pll = PLL_28,
1156 .tuner_type = TUNER_PHILIPS_PAL_I, 1190 .tuner_type = TUNER_PHILIPS_PAL_I,
@@ -1175,7 +1209,8 @@ struct tvcard bttv_tvcards[] = {
1175 .svhs = 2, 1209 .svhs = 2,
1176 .gpiomask = 7, 1210 .gpiomask = 7,
1177 .muxsel = { 2, 0, 1, 1 }, 1211 .muxsel = { 2, 0, 1, 1 },
1178 .audiomux = { 0, 1, 2, 3, 4 }, 1212 .gpiomux = { 0, 1, 2, 3 },
1213 .gpiomute = 4,
1179 .pll = PLL_28, 1214 .pll = PLL_28,
1180 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */, 1215 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1181 .tuner_addr = ADDR_UNSET, 1216 .tuner_addr = ADDR_UNSET,
@@ -1192,7 +1227,8 @@ struct tvcard bttv_tvcards[] = {
1192 .svhs = 3, 1227 .svhs = 3,
1193 .gpiomask = 0x03000F, 1228 .gpiomask = 0x03000F,
1194 .muxsel = { 2, 3, 1, 1 }, 1229 .muxsel = { 2, 3, 1, 1 },
1195 .audiomux = { 1, 0xd0001, 0, 0, 10 }, 1230 .gpiomux = { 1, 0xd0001, 0, 0 },
1231 .gpiomute = 10,
1196 /* sound path (5 sources): 1232 /* sound path (5 sources):
1197 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable) 1233 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1198 0= ext. Audio IN 1234 0= ext. Audio IN
@@ -1218,7 +1254,8 @@ struct tvcard bttv_tvcards[] = {
1218 .svhs = 2, 1254 .svhs = 2,
1219 .gpiomask = 0x1c, 1255 .gpiomask = 0x1c,
1220 .muxsel = { 2, 3, 1, 1 }, 1256 .muxsel = { 2, 3, 1, 1 },
1221 .audiomux = { 0, 0, 0x10, 8, 4 }, 1257 .gpiomux = { 0, 0, 0x10, 8 },
1258 .gpiomute = 4,
1222 .needs_tvaudio = 1, 1259 .needs_tvaudio = 1,
1223 .pll = PLL_28, 1260 .pll = PLL_28,
1224 .tuner_type = TUNER_PHILIPS_PAL, 1261 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1230,7 +1267,7 @@ struct tvcard bttv_tvcards[] = {
1230 /* Tim Röstermundt <rosterm@uni-muenster.de> 1267 /* Tim Röstermundt <rosterm@uni-muenster.de>
1231 in de.comp.os.unix.linux.hardware: 1268 in de.comp.os.unix.linux.hardware:
1232 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0 1269 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1233 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff 1270 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1234 options tuner type=5 */ 1271 options tuner type=5 */
1235 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]", 1272 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1236 .video_inputs = 4, 1273 .video_inputs = 4,
@@ -1239,7 +1276,8 @@ struct tvcard bttv_tvcards[] = {
1239 .svhs = 2, 1276 .svhs = 2,
1240 .gpiomask = 0x18e0, 1277 .gpiomask = 0x18e0,
1241 .muxsel = { 2, 3, 1, 1 }, 1278 .muxsel = { 2, 3, 1, 1 },
1242 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 }, 1279 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1280 .gpiomute = 0x18e0,
1243 /* For cards with tda9820/tda9821: 1281 /* For cards with tda9820/tda9821:
1244 0x0000: Tuner normal stereo 1282 0x0000: Tuner normal stereo
1245 0x0080: Tuner A2 SAP (second audio program = Zweikanalton) 1283 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
@@ -1259,7 +1297,8 @@ struct tvcard bttv_tvcards[] = {
1259 .svhs = 2, 1297 .svhs = 2,
1260 .gpiomask = 0xF, 1298 .gpiomask = 0xF,
1261 .muxsel = { 2, 3, 1, 0 }, 1299 .muxsel = { 2, 3, 1, 0 },
1262 .audiomux = { 2, 0, 0, 0, 10 }, 1300 .gpiomux = { 2, 0, 0, 0 },
1301 .gpiomute = 10,
1263 .needs_tvaudio = 0, 1302 .needs_tvaudio = 0,
1264 .pll = PLL_28, 1303 .pll = PLL_28,
1265 .tuner_type = TUNER_TEMIC_PAL, 1304 .tuner_type = TUNER_TEMIC_PAL,
@@ -1277,7 +1316,8 @@ struct tvcard bttv_tvcards[] = {
1277 .svhs = 2, 1316 .svhs = 2,
1278 .gpiomask = 0x1800, 1317 .gpiomask = 0x1800,
1279 .muxsel = { 2, 3, 1, 1 }, 1318 .muxsel = { 2, 3, 1, 1 },
1280 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 }, 1319 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1320 .gpiomute = 0x1800,
1281 .pll = PLL_28, 1321 .pll = PLL_28,
1282 .tuner_type = 5, 1322 .tuner_type = 5,
1283 .tuner_addr = ADDR_UNSET, 1323 .tuner_addr = ADDR_UNSET,
@@ -1294,7 +1334,7 @@ struct tvcard bttv_tvcards[] = {
1294 .svhs = 1, 1334 .svhs = 1,
1295 .gpiomask = 0, 1335 .gpiomask = 0,
1296 .muxsel = { 3, 1 }, 1336 .muxsel = { 3, 1 },
1297 .audiomux = { 0 }, 1337 .gpiomux = { 0 },
1298 .needs_tvaudio = 0, 1338 .needs_tvaudio = 0,
1299 .no_msp34xx = 1, 1339 .no_msp34xx = 1,
1300 .pll = PLL_35, 1340 .pll = PLL_35,
@@ -1311,7 +1351,8 @@ struct tvcard bttv_tvcards[] = {
1311 .svhs = 2, 1351 .svhs = 2,
1312 .gpiomask = 0xe00, 1352 .gpiomask = 0xe00,
1313 .muxsel = { 2, 3, 1, 1}, 1353 .muxsel = { 2, 3, 1, 1},
1314 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 }, 1354 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1355 .gpiomute = 0x800,
1315 .needs_tvaudio = 1, 1356 .needs_tvaudio = 1,
1316 .pll = PLL_28, 1357 .pll = PLL_28,
1317 .tuner_type = TUNER_TEMIC_4036FY5_NTSC, 1358 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
@@ -1327,7 +1368,8 @@ struct tvcard bttv_tvcards[] = {
1327 .svhs = 2, 1368 .svhs = 2,
1328 .gpiomask = 0x03000F, 1369 .gpiomask = 0x03000F,
1329 .muxsel = { 2, 3, 1, 0 }, 1370 .muxsel = { 2, 3, 1, 0 },
1330 .audiomux = { 2, 0, 0, 0, 1 }, 1371 .gpiomux = { 2, 0, 0, 0 },
1372 .gpiomute = 1,
1331 .pll = PLL_28, 1373 .pll = PLL_28,
1332 .tuner_type = 0, 1374 .tuner_type = 0,
1333 .tuner_addr = ADDR_UNSET, 1375 .tuner_addr = ADDR_UNSET,
@@ -1344,7 +1386,8 @@ struct tvcard bttv_tvcards[] = {
1344 .svhs = -1, 1386 .svhs = -1,
1345 .gpiomask = 11, 1387 .gpiomask = 11,
1346 .muxsel = { 2, 3, 1, 1 }, 1388 .muxsel = { 2, 3, 1, 1 },
1347 .audiomux = { 2, 0, 0, 1, 8 }, 1389 .gpiomux = { 2, 0, 0, 1 },
1390 .gpiomute = 8,
1348 .pll = PLL_35, 1391 .pll = PLL_35,
1349 .tuner_type = TUNER_TEMIC_PAL, 1392 .tuner_type = TUNER_TEMIC_PAL,
1350 .tuner_addr = ADDR_UNSET, 1393 .tuner_addr = ADDR_UNSET,
@@ -1359,7 +1402,7 @@ struct tvcard bttv_tvcards[] = {
1359 .svhs = 1, 1402 .svhs = 1,
1360 .gpiomask = 0xF, 1403 .gpiomask = 0xF,
1361 .muxsel = { 2, 2 }, 1404 .muxsel = { 2, 2 },
1362 .audiomux = { }, 1405 .gpiomux = { },
1363 .no_msp34xx = 1, 1406 .no_msp34xx = 1,
1364 .needs_tvaudio = 0, 1407 .needs_tvaudio = 0,
1365 .pll = PLL_28, 1408 .pll = PLL_28,
@@ -1378,7 +1421,8 @@ struct tvcard bttv_tvcards[] = {
1378 .svhs = 2, 1421 .svhs = 2,
1379 .gpiomask = 0xFF, 1422 .gpiomask = 0xFF,
1380 .muxsel = { 2, 3, 1, 0 }, 1423 .muxsel = { 2, 3, 1, 0 },
1381 .audiomux = { 1, 0, 4, 4, 9 }, 1424 .gpiomux = { 1, 0, 4, 4 },
1425 .gpiomute = 9,
1382 .needs_tvaudio = 0, 1426 .needs_tvaudio = 0,
1383 .pll = PLL_28, 1427 .pll = PLL_28,
1384 .tuner_type = TUNER_PHILIPS_PAL, 1428 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1394,7 +1438,8 @@ struct tvcard bttv_tvcards[] = {
1394 .svhs = 2, 1438 .svhs = 2,
1395 .gpiomask = 0xf03f, 1439 .gpiomask = 0xf03f,
1396 .muxsel = { 2, 3, 1, 0 }, 1440 .muxsel = { 2, 3, 1, 0 },
1397 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe }, 1441 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1442 .gpiomute = 0xbffe,
1398 .pll = PLL_28, 1443 .pll = PLL_28,
1399 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL, 1444 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1400 .tuner_addr = ADDR_UNSET, 1445 .tuner_addr = ADDR_UNSET,
@@ -1411,7 +1456,7 @@ struct tvcard bttv_tvcards[] = {
1411 .svhs = -1, 1456 .svhs = -1,
1412 .gpiomask = 1, 1457 .gpiomask = 1,
1413 .muxsel = { 2, 3, 0, 1 }, 1458 .muxsel = { 2, 3, 0, 1 },
1414 .audiomux = { 0, 0, 1, 0, 0 }, 1459 .gpiomux = { 0, 0, 1, 0 },
1415 .no_msp34xx = 1, 1460 .no_msp34xx = 1,
1416 .pll = PLL_28, 1461 .pll = PLL_28,
1417 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL, 1462 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
@@ -1430,7 +1475,8 @@ struct tvcard bttv_tvcards[] = {
1430 /* Radio changed from 1e80 to 0x800 to make 1475 /* Radio changed from 1e80 to 0x800 to make
1431 FlyVideo2000S in .hu happy (gm)*/ 1476 FlyVideo2000S in .hu happy (gm)*/
1432 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */ 1477 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1433 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 }, 1478 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1479 .gpiomute = 0x1800,
1434 .audio_hook = fv2000s_audio, 1480 .audio_hook = fv2000s_audio,
1435 .no_msp34xx = 1, 1481 .no_msp34xx = 1,
1436 .no_tda9875 = 1, 1482 .no_tda9875 = 1,
@@ -1448,7 +1494,8 @@ struct tvcard bttv_tvcards[] = {
1448 .svhs = 2, 1494 .svhs = 2,
1449 .gpiomask = 0xffff00, 1495 .gpiomask = 0xffff00,
1450 .muxsel = { 2, 3, 1, 1 }, 1496 .muxsel = { 2, 3, 1, 1 },
1451 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900 }, 1497 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1498 .gpiomute = 0x900,
1452 .needs_tvaudio = 1, 1499 .needs_tvaudio = 1,
1453 .pll = PLL_28, 1500 .pll = PLL_28,
1454 .tuner_type = TUNER_PHILIPS_PAL, 1501 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1465,7 +1512,7 @@ struct tvcard bttv_tvcards[] = {
1465 .svhs = 2, 1512 .svhs = 2,
1466 .gpiomask = 0x010f00, 1513 .gpiomask = 0x010f00,
1467 .muxsel = {2, 3, 0, 0 }, 1514 .muxsel = {2, 3, 0, 0 },
1468 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0 }, 1515 .gpiomux = {0x10000, 0, 0x10000, 0 },
1469 .no_msp34xx = 1, 1516 .no_msp34xx = 1,
1470 .pll = PLL_28, 1517 .pll = PLL_28,
1471 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC, 1518 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
@@ -1486,7 +1533,8 @@ struct tvcard bttv_tvcards[] = {
1486 .gpiomask = 0x4f8a00, 1533 .gpiomask = 0x4f8a00,
1487 /* 0x100000: 1=MSP enabled (0=disable again) 1534 /* 0x100000: 1=MSP enabled (0=disable again)
1488 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */ 1535 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1489 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff}, 1536 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1537 .gpiomute = 0x947fff,
1490 /* tvtuner, radio, external,internal, mute, stereo 1538 /* tvtuner, radio, external,internal, mute, stereo
1491 * tuner, Composit, SVid, Composit-on-Svid-adapter */ 1539 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1492 .muxsel = { 2, 3 ,0 ,1 }, 1540 .muxsel = { 2, 3 ,0 ,1 },
@@ -1518,7 +1566,8 @@ struct tvcard bttv_tvcards[] = {
1518 .svhs = 2, 1566 .svhs = 2,
1519 .gpiomask = 15, 1567 .gpiomask = 15,
1520 .muxsel = { 2, 3, 1, 1 }, 1568 .muxsel = { 2, 3, 1, 1 },
1521 .audiomux = { 0, 0, 11, 7, 13, 0 }, /* TV and Radio with same GPIO ! */ 1569 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1570 .gpiomute = 13,
1522 .needs_tvaudio = 1, 1571 .needs_tvaudio = 1,
1523 .pll = PLL_28, 1572 .pll = PLL_28,
1524 .tuner_type = 25, 1573 .tuner_type = 25,
@@ -1557,7 +1606,8 @@ struct tvcard bttv_tvcards[] = {
1557 .svhs = 2, 1606 .svhs = 2,
1558 .gpiomask = 0x3f, 1607 .gpiomask = 0x3f,
1559 .muxsel = { 2, 3, 1, 1 }, 1608 .muxsel = { 2, 3, 1, 1 },
1560 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 }, 1609 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1610 .gpiomute = 0x09,
1561 .needs_tvaudio = 1, 1611 .needs_tvaudio = 1,
1562 .no_msp34xx = 1, 1612 .no_msp34xx = 1,
1563 .no_tda9875 = 1, 1613 .no_tda9875 = 1,
@@ -1586,7 +1636,7 @@ struct tvcard bttv_tvcards[] = {
1586 .svhs = 4, 1636 .svhs = 4,
1587 .gpiomask = 0, 1637 .gpiomask = 0,
1588 .muxsel = { 2, 3, 1, 0, 0 }, 1638 .muxsel = { 2, 3, 1, 0, 0 },
1589 .audiomux = { 0 }, 1639 .gpiomux = { 0 },
1590 .needs_tvaudio = 0, 1640 .needs_tvaudio = 0,
1591 .tuner_type = -1, 1641 .tuner_type = -1,
1592 .tuner_addr = ADDR_UNSET, 1642 .tuner_addr = ADDR_UNSET,
@@ -1618,7 +1668,8 @@ struct tvcard bttv_tvcards[] = {
1618 .svhs = 2, 1668 .svhs = 2,
1619 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */ 1669 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1620 .muxsel = { 2, 1, 1, }, 1670 .muxsel = { 2, 1, 1, },
1621 .audiomux = { 0, 1, 2, 2, 4 }, 1671 .gpiomux = { 0, 1, 2, 2 },
1672 .gpiomute = 4,
1622 .needs_tvaudio = 0, 1673 .needs_tvaudio = 0,
1623 .tuner_type = TUNER_PHILIPS_PAL, 1674 .tuner_type = TUNER_PHILIPS_PAL,
1624 .tuner_addr = ADDR_UNSET, 1675 .tuner_addr = ADDR_UNSET,
@@ -1637,7 +1688,8 @@ struct tvcard bttv_tvcards[] = {
1637 .svhs = 2, 1688 .svhs = 2,
1638 .gpiomask = 0x140007, 1689 .gpiomask = 0x140007,
1639 .muxsel = { 2, 3, 1, 1 }, 1690 .muxsel = { 2, 3, 1, 1 },
1640 .audiomux = { 0, 1, 2, 3, 4, 0 }, 1691 .gpiomux = { 0, 1, 2, 3 },
1692 .gpiomute = 4,
1641 .tuner_type = TUNER_PHILIPS_NTSC, 1693 .tuner_type = TUNER_PHILIPS_NTSC,
1642 .tuner_addr = ADDR_UNSET, 1694 .tuner_addr = ADDR_UNSET,
1643 .radio_addr = ADDR_UNSET, 1695 .radio_addr = ADDR_UNSET,
@@ -1651,7 +1703,7 @@ struct tvcard bttv_tvcards[] = {
1651 .svhs = -1, 1703 .svhs = -1,
1652 .gpiomask = 0, 1704 .gpiomask = 0,
1653 .muxsel = { 2, 3, 1, 0 }, 1705 .muxsel = { 2, 3, 1, 0 },
1654 .audiomux = { 0 }, 1706 .gpiomux = { 0 },
1655 .needs_tvaudio = 0, 1707 .needs_tvaudio = 0,
1656 .no_msp34xx = 1, 1708 .no_msp34xx = 1,
1657 .pll = PLL_28, 1709 .pll = PLL_28,
@@ -1667,13 +1719,14 @@ struct tvcard bttv_tvcards[] = {
1667 .svhs = 2, 1719 .svhs = 2,
1668 .gpiomask = 7, 1720 .gpiomask = 7,
1669 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */ 1721 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1670 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio! 1722 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1671 * This card lacks external Audio In, so we mute it on Ext. & Int. 1723 * This card lacks external Audio In, so we mute it on Ext. & Int.
1672 * The PCB can take a sbx1637/sbx1673, wiring unknown. 1724 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1673 * This card lacks PCI subsystem ID, sigh. 1725 * This card lacks PCI subsystem ID, sigh.
1674 * audiomux=1: lower volume, 2+3: mute 1726 * gpiomux =1: lower volume, 2+3: mute
1675 * btwincap uses 0x80000/0x80003 1727 * btwincap uses 0x80000/0x80003
1676 */ 1728 */
1729 .gpiomute = 4,
1677 .needs_tvaudio = 0, 1730 .needs_tvaudio = 0,
1678 .no_msp34xx = 1, 1731 .no_msp34xx = 1,
1679 .pll = PLL_28, 1732 .pll = PLL_28,
@@ -1720,7 +1773,7 @@ struct tvcard bttv_tvcards[] = {
1720 .radio_addr = ADDR_UNSET, 1773 .radio_addr = ADDR_UNSET,
1721 1774
1722 .gpiomask = 7, 1775 .gpiomask = 7,
1723 .audiomux = {7}, 1776 .gpiomux = {7},
1724 }, 1777 },
1725 [BTTV_BOARD_GVBCTV5PCI] = { 1778 [BTTV_BOARD_GVBCTV5PCI] = {
1726 .name = "IODATA GV-BCTV5/PCI", 1779 .name = "IODATA GV-BCTV5/PCI",
@@ -1730,7 +1783,8 @@ struct tvcard bttv_tvcards[] = {
1730 .svhs = 2, 1783 .svhs = 2,
1731 .gpiomask = 0x0f0f80, 1784 .gpiomask = 0x0f0f80,
1732 .muxsel = {2, 3, 1, 0 }, 1785 .muxsel = {2, 3, 1, 0 },
1733 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0}, 1786 .gpiomux = {0x030000, 0x010000, 0, 0 },
1787 .gpiomute = 0x020000,
1734 .no_msp34xx = 1, 1788 .no_msp34xx = 1,
1735 .pll = PLL_28, 1789 .pll = PLL_28,
1736 .tuner_type = TUNER_PHILIPS_NTSC_M, 1790 .tuner_type = TUNER_PHILIPS_NTSC_M,
@@ -1960,7 +2014,7 @@ struct tvcard bttv_tvcards[] = {
1960 .gpiomask = 2, 2014 .gpiomask = 2,
1961 /* TV, Comp1, Composite over SVID con, SVID */ 2015 /* TV, Comp1, Composite over SVID con, SVID */
1962 .muxsel = { 2, 3, 1, 1 }, 2016 .muxsel = { 2, 3, 1, 1 },
1963 .audiomux = { 2, 2, 0, 0, 0 }, 2017 .gpiomux = { 2, 2, 0, 0 },
1964 .pll = PLL_28, 2018 .pll = PLL_28,
1965 .has_radio = 1, 2019 .has_radio = 1,
1966 .tuner_type = TUNER_PHILIPS_PAL, 2020 .tuner_type = TUNER_PHILIPS_PAL,
@@ -1984,7 +2038,8 @@ struct tvcard bttv_tvcards[] = {
1984 .svhs = -1, 2038 .svhs = -1,
1985 .gpiomask = 7, 2039 .gpiomask = 7,
1986 .muxsel = { 2, 3, 1, 1}, 2040 .muxsel = { 2, 3, 1, 1},
1987 .audiomux = { 0, 1, 2, 3, 4}, 2041 .gpiomux = { 0, 1, 2, 3},
2042 .gpiomute = 4,
1988 .needs_tvaudio = 1, 2043 .needs_tvaudio = 1,
1989 .tuner_type = 5, 2044 .tuner_type = 5,
1990 .tuner_addr = ADDR_UNSET, 2045 .tuner_addr = ADDR_UNSET,
@@ -2016,7 +2071,7 @@ struct tvcard bttv_tvcards[] = {
2016 .svhs = -1, 2071 .svhs = -1,
2017 .gpiomask = 0, 2072 .gpiomask = 0,
2018 .muxsel = { 2, 3 }, 2073 .muxsel = { 2, 3 },
2019 .audiomux = { 0 }, 2074 .gpiomux = { 0 },
2020 .needs_tvaudio = 0, 2075 .needs_tvaudio = 0,
2021 .no_msp34xx = 1, 2076 .no_msp34xx = 1,
2022 .pll = PLL_28, 2077 .pll = PLL_28,
@@ -2035,7 +2090,8 @@ struct tvcard bttv_tvcards[] = {
2035 .gpiomask = 0x001e8007, 2090 .gpiomask = 0x001e8007,
2036 .muxsel = { 2, 3, 1, 0 }, 2091 .muxsel = { 2, 3, 1, 0 },
2037 /* Tuner, Radio, external, internal, off, on */ 2092 /* Tuner, Radio, external, internal, off, on */
2038 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 }, 2093 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2094 .gpiomute = 0x0f,
2039 .needs_tvaudio = 0, 2095 .needs_tvaudio = 0,
2040 .no_msp34xx = 1, 2096 .no_msp34xx = 1,
2041 .pll = PLL_28, 2097 .pll = PLL_28,
@@ -2152,7 +2208,7 @@ struct tvcard bttv_tvcards[] = {
2152 .svhs = -1, 2208 .svhs = -1,
2153 .gpiomask = 0, 2209 .gpiomask = 0,
2154 .muxsel = { 2, 3, 1, 0 }, 2210 .muxsel = { 2, 3, 1, 0 },
2155 .audiomux = { 0 }, 2211 .gpiomux = { 0 },
2156 .needs_tvaudio = 0, 2212 .needs_tvaudio = 0,
2157 .no_msp34xx = 1, 2213 .no_msp34xx = 1,
2158 .pll = PLL_28, 2214 .pll = PLL_28,
@@ -2169,7 +2225,7 @@ struct tvcard bttv_tvcards[] = {
2169 .svhs = 3, 2225 .svhs = 3,
2170 .gpiomask = 0x00, 2226 .gpiomask = 0x00,
2171 .muxsel = { 2, 3, 1, 0 }, 2227 .muxsel = { 2, 3, 1, 0 },
2172 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ 2228 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2173 .needs_tvaudio = 1, 2229 .needs_tvaudio = 1,
2174 .pll = PLL_28, 2230 .pll = PLL_28,
2175 .tuner_type = -1, 2231 .tuner_type = -1,
@@ -2184,7 +2240,7 @@ struct tvcard bttv_tvcards[] = {
2184 .svhs = 3, 2240 .svhs = 3,
2185 .gpiomask = 0x00, 2241 .gpiomask = 0x00,
2186 .muxsel = { 2, 3, 1, 1 }, 2242 .muxsel = { 2, 3, 1, 1 },
2187 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ 2243 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2188 .needs_tvaudio = 1, 2244 .needs_tvaudio = 1,
2189 .pll = PLL_28, 2245 .pll = PLL_28,
2190 .tuner_type = -1, 2246 .tuner_type = -1,
@@ -2204,7 +2260,7 @@ struct tvcard bttv_tvcards[] = {
2204 via the upper nibble of muxsel. here: used for 2260 via the upper nibble of muxsel. here: used for
2205 xternal video-mux */ 2261 xternal video-mux */
2206 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 }, 2262 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2207 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ 2263 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2208 .needs_tvaudio = 1, 2264 .needs_tvaudio = 1,
2209 .pll = PLL_28, 2265 .pll = PLL_28,
2210 .tuner_type = -1, 2266 .tuner_type = -1,
@@ -2222,7 +2278,7 @@ struct tvcard bttv_tvcards[] = {
2222 via the upper nibble of muxsel. here: used for 2278 via the upper nibble of muxsel. here: used for
2223 xternal video-mux */ 2279 xternal video-mux */
2224 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 }, 2280 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2225 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ 2281 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2226 .needs_tvaudio = 1, 2282 .needs_tvaudio = 1,
2227 .pll = PLL_28, 2283 .pll = PLL_28,
2228 .tuner_type = -1, 2284 .tuner_type = -1,
@@ -2310,7 +2366,7 @@ struct tvcard bttv_tvcards[] = {
2310 .svhs = 2, 2366 .svhs = 2,
2311 .gpiomask = 3, 2367 .gpiomask = 3,
2312 .muxsel = { 2, 3, 1, 1 }, 2368 .muxsel = { 2, 3, 1, 1 },
2313 .audiomux = { 1, 1, 1, 1, 0 }, 2369 .gpiomux = { 1, 1, 1, 1 },
2314 .needs_tvaudio = 1, 2370 .needs_tvaudio = 1,
2315 .tuner_type = TUNER_PHILIPS_PAL, 2371 .tuner_type = TUNER_PHILIPS_PAL,
2316 .tuner_addr = ADDR_UNSET, 2372 .tuner_addr = ADDR_UNSET,
@@ -2341,7 +2397,8 @@ struct tvcard bttv_tvcards[] = {
2341 .svhs = 2, 2397 .svhs = 2,
2342 .gpiomask = 0x008007, 2398 .gpiomask = 0x008007,
2343 .muxsel = { 2, 3, 0, 0 }, 2399 .muxsel = { 2, 3, 0, 0 },
2344 .audiomux = { 0, 0, 0, 0, 0x000003, 0 }, 2400 .gpiomux = { 0, 0, 0, 0 },
2401 .gpiomute = 0x000003,
2345 .pll = PLL_28, 2402 .pll = PLL_28,
2346 .tuner_type = TUNER_PHILIPS_PAL, 2403 .tuner_type = TUNER_PHILIPS_PAL,
2347 .tuner_addr = ADDR_UNSET, 2404 .tuner_addr = ADDR_UNSET,
@@ -2377,7 +2434,7 @@ struct tvcard bttv_tvcards[] = {
2377 .needs_tvaudio = 0, 2434 .needs_tvaudio = 0,
2378 .gpiomask = 0x68, 2435 .gpiomask = 0x68,
2379 .muxsel = { 2, 3, 1 }, 2436 .muxsel = { 2, 3, 1 },
2380 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 }, 2437 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2381 .pll = PLL_28, 2438 .pll = PLL_28,
2382 }, 2439 },
2383 2440
@@ -2392,7 +2449,8 @@ struct tvcard bttv_tvcards[] = {
2392 .svhs = 2, 2449 .svhs = 2,
2393 .gpiomask = 0x008007, 2450 .gpiomask = 0x008007,
2394 .muxsel = { 2, 3, 1, 1 }, 2451 .muxsel = { 2, 3, 1, 1 },
2395 .audiomux = { 0, 1, 2, 2, 3 }, 2452 .gpiomux = { 0, 1, 2, 2 },
2453 .gpiomute = 3,
2396 .needs_tvaudio = 0, 2454 .needs_tvaudio = 0,
2397 .pll = PLL_28, 2455 .pll = PLL_28,
2398 .tuner_type = TUNER_PHILIPS_PAL, 2456 .tuner_type = TUNER_PHILIPS_PAL,
@@ -2417,7 +2475,7 @@ struct tvcard bttv_tvcards[] = {
2417 .no_tda9875 = 1, 2475 .no_tda9875 = 1,
2418 .no_tda7432 = 1, 2476 .no_tda7432 = 1,
2419 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/ 2477 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2420 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */ 2478 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2421 .pll = PLL_28, 2479 .pll = PLL_28,
2422 .needs_tvaudio = 0, 2480 .needs_tvaudio = 0,
2423 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/ 2481 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
@@ -2435,7 +2493,7 @@ struct tvcard bttv_tvcards[] = {
2435 .svhs = 2, 2493 .svhs = 2,
2436 .gpiomask = 0x0000000f, 2494 .gpiomask = 0x0000000f,
2437 .muxsel = { 2, 1, 1 }, 2495 .muxsel = { 2, 1, 1 },
2438 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00 }, 2496 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2439 .tuner_type = TUNER_TEMIC_PAL, 2497 .tuner_type = TUNER_TEMIC_PAL,
2440 .tuner_addr = ADDR_UNSET, 2498 .tuner_addr = ADDR_UNSET,
2441 .radio_addr = ADDR_UNSET, 2499 .radio_addr = ADDR_UNSET,
@@ -2491,7 +2549,7 @@ struct tvcard bttv_tvcards[] = {
2491 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2549 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2492 3, 3, 3, 3, 3, 3, 3, 3 }, 2550 3, 3, 3, 3, 3, 3, 3, 3 },
2493 .muxsel_hook = sigmaSQ_muxsel, 2551 .muxsel_hook = sigmaSQ_muxsel,
2494 .audiomux = { 0 }, 2552 .gpiomux = { 0 },
2495 .no_msp34xx = 1, 2553 .no_msp34xx = 1,
2496 .pll = PLL_28, 2554 .pll = PLL_28,
2497 .tuner_type = -1, 2555 .tuner_type = -1,
@@ -2508,7 +2566,7 @@ struct tvcard bttv_tvcards[] = {
2508 .gpiomask = 0x0, 2566 .gpiomask = 0x0,
2509 .muxsel = { 2, 2, 2, 2 }, 2567 .muxsel = { 2, 2, 2, 2 },
2510 .muxsel_hook = sigmaSLC_muxsel, 2568 .muxsel_hook = sigmaSLC_muxsel,
2511 .audiomux = { 0 }, 2569 .gpiomux = { 0 },
2512 .no_msp34xx = 1, 2570 .no_msp34xx = 1,
2513 .pll = PLL_28, 2571 .pll = PLL_28,
2514 .tuner_type = -1, 2572 .tuner_type = -1,
@@ -2526,7 +2584,8 @@ struct tvcard bttv_tvcards[] = {
2526 .svhs = -1, 2584 .svhs = -1,
2527 .gpiomask = 0xFF, 2585 .gpiomask = 0xFF,
2528 .muxsel = { 2, 3, 1, 1 }, 2586 .muxsel = { 2, 3, 1, 1 },
2529 .audiomux = { 2, 0, 0, 0, 10 }, 2587 .gpiomux = { 2, 0, 0, 0 },
2588 .gpiomute = 10,
2530 .needs_tvaudio = 0, 2589 .needs_tvaudio = 0,
2531 .pll = PLL_28, 2590 .pll = PLL_28,
2532 .tuner_type = TUNER_PHILIPS_PAL, 2591 .tuner_type = TUNER_PHILIPS_PAL,
@@ -2560,7 +2619,8 @@ struct tvcard bttv_tvcards[] = {
2560 .svhs = 2, 2619 .svhs = 2,
2561 .gpiomask = 0x3f, 2620 .gpiomask = 0x3f,
2562 .muxsel = {2, 3, 1, 0 }, 2621 .muxsel = {2, 3, 1, 0 },
2563 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31 }, 2622 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2623 .gpiomute = 0x31,
2564 .no_msp34xx = 1, 2624 .no_msp34xx = 1,
2565 .pll = PLL_28, 2625 .pll = PLL_28,
2566 .tuner_type = TUNER_PHILIPS_NTSC_M, 2626 .tuner_type = TUNER_PHILIPS_NTSC_M,
@@ -2583,7 +2643,7 @@ struct tvcard bttv_tvcards[] = {
2583 .tuner_addr = ADDR_UNSET, 2643 .tuner_addr = ADDR_UNSET,
2584 .radio_addr = ADDR_UNSET, 2644 .radio_addr = ADDR_UNSET,
2585 .gpiomask = 0x008007, 2645 .gpiomask = 0x008007,
2586 .audiomux = { 0, 0x000001,0,0, 0 }, 2646 .gpiomux = { 0, 0x000001,0,0 },
2587 .needs_tvaudio = 1, 2647 .needs_tvaudio = 1,
2588 .has_radio = 1, 2648 .has_radio = 1,
2589 }, 2649 },
@@ -2693,7 +2753,8 @@ struct tvcard bttv_tvcards[] = {
2693 .svhs = 2, 2753 .svhs = 2,
2694 .muxsel = { 2, 3, 1 }, 2754 .muxsel = { 2, 3, 1 },
2695 .gpiomask = 0x00e00007, 2755 .gpiomask = 0x00e00007,
2696 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 }, 2756 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2757 .gpiomute = 0x00c00007,
2697 .no_msp34xx = 1, 2758 .no_msp34xx = 1,
2698 .no_tda9875 = 1, 2759 .no_tda9875 = 1,
2699 .no_tda7432 = 1, 2760 .no_tda7432 = 1,
@@ -2709,7 +2770,8 @@ struct tvcard bttv_tvcards[] = {
2709 .svhs = 2, 2770 .svhs = 2,
2710 .gpiomask = 0x01fe00, 2771 .gpiomask = 0x01fe00,
2711 .muxsel = { 2, 3, 1, 1 }, 2772 .muxsel = { 2, 3, 1, 1 },
2712 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 }, 2773 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2774 .gpiomute = 0x002000,
2713 .needs_tvaudio = 1, 2775 .needs_tvaudio = 1,
2714 .pll = PLL_28, 2776 .pll = PLL_28,
2715 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF, 2777 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
@@ -2726,7 +2788,8 @@ struct tvcard bttv_tvcards[] = {
2726 .svhs = 2, 2788 .svhs = 2,
2727 .gpiomask = 0x001c0007, 2789 .gpiomask = 0x001c0007,
2728 .muxsel = { 2, 3, 1, 1 }, 2790 .muxsel = { 2, 3, 1, 1 },
2729 .audiomux = { 0, 1, 2, 2, 3 }, 2791 .gpiomux = { 0, 1, 2, 2 },
2792 .gpiomute = 3,
2730 .needs_tvaudio = 0, 2793 .needs_tvaudio = 0,
2731 .pll = PLL_28, 2794 .pll = PLL_28,
2732 .tuner_type = TUNER_TENA_9533_DI, 2795 .tuner_type = TUNER_TENA_9533_DI,
@@ -2745,7 +2808,8 @@ struct tvcard bttv_tvcards[] = {
2745 .gpiomask = 0x01fe00, 2808 .gpiomask = 0x01fe00,
2746 .muxsel = { 2,3,1,1,-1 }, 2809 .muxsel = { 2,3,1,1,-1 },
2747 .digital_mode = DIGITAL_MODE_CAMERA, 2810 .digital_mode = DIGITAL_MODE_CAMERA,
2748 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 }, 2811 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2812 .gpiomute = 0x12400,
2749 .no_msp34xx = 1, 2813 .no_msp34xx = 1,
2750 .pll = PLL_28, 2814 .pll = PLL_28,
2751 .tuner_type = TUNER_LG_PAL_FM, 2815 .tuner_type = TUNER_LG_PAL_FM,
@@ -2763,7 +2827,8 @@ struct tvcard bttv_tvcards[] = {
2763 .svhs = 2, 2827 .svhs = 2,
2764 .gpiomask = 0x3f, 2828 .gpiomask = 0x3f,
2765 .muxsel = { 2, 3, 1, 1 }, 2829 .muxsel = { 2, 3, 1, 1 },
2766 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 }, 2830 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2831 .gpiomute = 0x29,
2767 .no_msp34xx = 1, 2832 .no_msp34xx = 1,
2768 .pll = PLL_28, 2833 .pll = PLL_28,
2769 .tuner_type = TUNER_YMEC_TVF_5533MF, 2834 .tuner_type = TUNER_YMEC_TVF_5533MF,
@@ -2797,7 +2862,8 @@ struct tvcard bttv_tvcards[] = {
2797 .svhs = 2, 2862 .svhs = 2,
2798 .gpiomask = 15, 2863 .gpiomask = 15,
2799 .muxsel = { 2, 3, 1, 1 }, 2864 .muxsel = { 2, 3, 1, 1 },
2800 .audiomux = { 2, 0, 0, 0, 1 }, 2865 .gpiomux = { 2, 0, 0, 0 },
2866 .gpiomute = 1,
2801 .needs_tvaudio = 1, 2867 .needs_tvaudio = 1,
2802 .pll = PLL_28, 2868 .pll = PLL_28,
2803 .tuner_type = 2, 2869 .tuner_type = 2,
@@ -2813,7 +2879,7 @@ struct tvcard bttv_tvcards[] = {
2813 .svhs = 2, 2879 .svhs = 2,
2814 .gpiomask = 0x108007, 2880 .gpiomask = 0x108007,
2815 .muxsel = { 2, 3, 1, 1 }, 2881 .muxsel = { 2, 3, 1, 1 },
2816 .audiomux = { 100000, 100002, 100002, 100000 }, 2882 .gpiomux = { 100000, 100002, 100002, 100000 },
2817 .no_msp34xx = 1, 2883 .no_msp34xx = 1,
2818 .no_tda9875 = 1, 2884 .no_tda9875 = 1,
2819 .no_tda7432 = 1, 2885 .no_tda7432 = 1,
@@ -2853,7 +2919,8 @@ struct tvcard bttv_tvcards[] = {
2853 .svhs = 2, 2919 .svhs = 2,
2854 .gpiomask = 7, 2920 .gpiomask = 7,
2855 .muxsel = { 2, 3, 1, 1 }, 2921 .muxsel = { 2, 3, 1, 1 },
2856 .audiomux = { 0, 1, 2, 3, 4 }, 2922 .gpiomux = { 0, 1, 2, 3 },
2923 .gpiomute = 4,
2857 .tuner_type = TUNER_TEMIC_4009FR5_PAL, 2924 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2858 .tuner_addr = ADDR_UNSET, 2925 .tuner_addr = ADDR_UNSET,
2859 .radio_addr = ADDR_UNSET, 2926 .radio_addr = ADDR_UNSET,
@@ -2925,20 +2992,20 @@ void __devinit bttv_idcard(struct bttv *btv)
2925 if (UNSET != audiomux[0]) { 2992 if (UNSET != audiomux[0]) {
2926 gpiobits = 0; 2993 gpiobits = 0;
2927 for (i = 0; i < 5; i++) { 2994 for (i = 0; i < 5; i++) {
2928 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i]; 2995 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2929 gpiobits |= audiomux[i]; 2996 gpiobits |= audiomux[i];
2930 } 2997 }
2931 } else { 2998 } else {
2932 gpiobits = audioall; 2999 gpiobits = audioall;
2933 for (i = 0; i < 5; i++) { 3000 for (i = 0; i < 5; i++) {
2934 bttv_tvcards[btv->c.type].audiomux[i] = audioall; 3001 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2935 } 3002 }
2936 } 3003 }
2937 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits; 3004 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2938 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=", 3005 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2939 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask); 3006 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2940 for (i = 0; i < 5; i++) { 3007 for (i = 0; i < 5; i++) {
2941 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]); 3008 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2942 } 3009 }
2943 printk("\n"); 3010 printk("\n");
2944} 3011}
@@ -3796,18 +3863,18 @@ void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3796{ 3863{
3797 /* fix up our card entry */ 3864 /* fix up our card entry */
3798 if(norm==VIDEO_MODE_NTSC) { 3865 if(norm==VIDEO_MODE_NTSC) {
3799 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff; 3866 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3800 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff; 3867 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
3801 dprintk("bttv_tda9880_setnorm to NTSC\n"); 3868 dprintk("bttv_tda9880_setnorm to NTSC\n");
3802 } 3869 }
3803 else { 3870 else {
3804 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff; 3871 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3805 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff; 3872 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
3806 dprintk("bttv_tda9880_setnorm to PAL\n"); 3873 dprintk("bttv_tda9880_setnorm to PAL\n");
3807 } 3874 }
3808 /* set GPIO according */ 3875 /* set GPIO according */
3809 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, 3876 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3810 bttv_tvcards[btv->c.type].audiomux[btv->audio]); 3877 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
3811} 3878}
3812 3879
3813 3880
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 71535775f2e8..be567ec9e145 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -36,6 +36,7 @@
36#include <linux/kdev_t.h> 36#include <linux/kdev_t.h>
37#include "bttvp.h" 37#include "bttvp.h"
38#include <media/v4l2-common.h> 38#include <media/v4l2-common.h>
39#include <media/tvaudio.h>
39 40
40#include <linux/dma-mapping.h> 41#include <linux/dma-mapping.h>
41 42
@@ -926,45 +927,65 @@ video_mux(struct bttv *btv, unsigned int input)
926 927
927static char *audio_modes[] = { 928static char *audio_modes[] = {
928 "audio: tuner", "audio: radio", "audio: extern", 929 "audio: tuner", "audio: radio", "audio: extern",
929 "audio: intern", "audio: off" 930 "audio: intern", "audio: mute"
930}; 931};
931 932
932static int 933static int
933audio_mux(struct bttv *btv, int mode) 934audio_mux(struct bttv *btv, int input, int mute)
934{ 935{
935 int val,mux,i2c_mux,signal; 936 int gpio_val, signal;
937 struct v4l2_audio aud_input;
938 struct v4l2_control ctrl;
939 struct i2c_client *c;
936 940
941 memset(&aud_input, 0, sizeof(aud_input));
937 gpio_inout(bttv_tvcards[btv->c.type].gpiomask, 942 gpio_inout(bttv_tvcards[btv->c.type].gpiomask,
938 bttv_tvcards[btv->c.type].gpiomask); 943 bttv_tvcards[btv->c.type].gpiomask);
939 signal = btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC; 944 signal = btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC;
940 945
941 switch (mode) { 946 btv->mute = mute;
942 case AUDIO_MUTE: 947 btv->audio = input;
943 btv->audio |= AUDIO_MUTE; 948
944 break; 949 /* automute */
945 case AUDIO_UNMUTE: 950 mute = mute || (btv->opt_automute && !signal && !btv->radio_user);
946 btv->audio &= ~AUDIO_MUTE; 951
947 break; 952 if (mute)
948 case AUDIO_TUNER: 953 gpio_val = bttv_tvcards[btv->c.type].gpiomute;
949 case AUDIO_RADIO: 954 else
950 case AUDIO_EXTERN: 955 gpio_val = bttv_tvcards[btv->c.type].gpiomux[input];
951 case AUDIO_INTERN: 956 aud_input.index = btv->audio;
952 btv->audio &= AUDIO_MUTE; 957
953 btv->audio |= mode; 958 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpio_val);
954 }
955 i2c_mux = mux = (btv->audio & AUDIO_MUTE) ? AUDIO_OFF : btv->audio;
956 if (btv->opt_automute && !signal && !btv->radio_user)
957 mux = AUDIO_OFF;
958
959 val = bttv_tvcards[btv->c.type].audiomux[mux];
960 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,val);
961 if (bttv_gpio) 959 if (bttv_gpio)
962 bttv_gpio_tracking(btv,audio_modes[mux]); 960 bttv_gpio_tracking(btv, audio_modes[mute ? 4 : input]);
963 if (!in_interrupt()) 961 if (in_interrupt())
964 bttv_call_i2c_clients(btv,AUDC_SET_INPUT,&(i2c_mux)); 962 return 0;
963
964 ctrl.id = V4L2_CID_AUDIO_MUTE;
965 /* take automute into account, just btv->mute is not enough */
966 ctrl.value = mute;
967 bttv_call_i2c_clients(btv, VIDIOC_S_CTRL, &ctrl);
968 c = btv->i2c_msp34xx_client;
969 if (c)
970 c->driver->command(c, VIDIOC_S_AUDIO, &aud_input);
971 c = btv->i2c_tvaudio_client;
972 if (c)
973 c->driver->command(c, VIDIOC_S_AUDIO, &aud_input);
965 return 0; 974 return 0;
966} 975}
967 976
977static inline int
978audio_mute(struct bttv *btv, int mute)
979{
980 return audio_mux(btv, btv->audio, mute);
981}
982
983static inline int
984audio_input(struct bttv *btv, int input)
985{
986 return audio_mux(btv, input, btv->mute);
987}
988
968static void 989static void
969i2c_vidiocschan(struct bttv *btv) 990i2c_vidiocschan(struct bttv *btv)
970{ 991{
@@ -1023,8 +1044,8 @@ set_input(struct bttv *btv, unsigned int input)
1023 } else { 1044 } else {
1024 video_mux(btv,input); 1045 video_mux(btv,input);
1025 } 1046 }
1026 audio_mux(btv,(input == bttv_tvcards[btv->c.type].tuner ? 1047 audio_input(btv,(input == bttv_tvcards[btv->c.type].tuner ?
1027 AUDIO_TUNER : AUDIO_EXTERN)); 1048 TVAUDIO_INPUT_TUNER : TVAUDIO_INPUT_EXTERN));
1028 set_tvnorm(btv,btv->tvnorm); 1049 set_tvnorm(btv,btv->tvnorm);
1029 i2c_vidiocschan(btv); 1050 i2c_vidiocschan(btv);
1030} 1051}
@@ -1236,10 +1257,10 @@ static int set_control(struct bttv *btv, struct v4l2_control *c)
1236 case V4L2_CID_AUDIO_MUTE: 1257 case V4L2_CID_AUDIO_MUTE:
1237 if (c->value) { 1258 if (c->value) {
1238 va.flags |= VIDEO_AUDIO_MUTE; 1259 va.flags |= VIDEO_AUDIO_MUTE;
1239 audio_mux(btv, AUDIO_MUTE); 1260 audio_mute(btv, 1);
1240 } else { 1261 } else {
1241 va.flags &= ~VIDEO_AUDIO_MUTE; 1262 va.flags &= ~VIDEO_AUDIO_MUTE;
1242 audio_mux(btv, AUDIO_UNMUTE); 1263 audio_mute(btv, 0);
1243 } 1264 }
1244 break; 1265 break;
1245 1266
@@ -1654,7 +1675,7 @@ static int bttv_common_ioctls(struct bttv *btv, unsigned int cmd, void *arg)
1654 return -EINVAL; 1675 return -EINVAL;
1655 1676
1656 mutex_lock(&btv->lock); 1677 mutex_lock(&btv->lock);
1657 audio_mux(btv, (v->flags&VIDEO_AUDIO_MUTE) ? AUDIO_MUTE : AUDIO_UNMUTE); 1678 audio_mute(btv, (v->flags&VIDEO_AUDIO_MUTE) ? 1 : 0);
1658 bttv_call_i2c_clients(btv,cmd,v); 1679 bttv_call_i2c_clients(btv,cmd,v);
1659 1680
1660 /* card specific hooks */ 1681 /* card specific hooks */
@@ -3163,8 +3184,8 @@ static int radio_open(struct inode *inode, struct file *file)
3163 3184
3164 file->private_data = btv; 3185 file->private_data = btv;
3165 3186
3166 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,&btv->tuner_type); 3187 bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL);
3167 audio_mux(btv,AUDIO_RADIO); 3188 audio_input(btv,TVAUDIO_INPUT_RADIO);
3168 3189
3169 mutex_unlock(&btv->lock); 3190 mutex_unlock(&btv->lock);
3170 return 0; 3191 return 0;
@@ -3750,7 +3771,7 @@ static irqreturn_t bttv_irq(int irq, void *dev_id, struct pt_regs * regs)
3750 bttv_irq_switch_video(btv); 3771 bttv_irq_switch_video(btv);
3751 3772
3752 if ((astat & BT848_INT_HLOCK) && btv->opt_automute) 3773 if ((astat & BT848_INT_HLOCK) && btv->opt_automute)
3753 audio_mux(btv, -1); 3774 audio_mute(btv, btv->mute); /* trigger automute */
3754 3775
3755 if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) { 3776 if (astat & (BT848_INT_SCERR|BT848_INT_OCERR)) {
3756 printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->c.nr, 3777 printk(KERN_INFO "bttv%d: %s%s @ %08x,",btv->c.nr,
@@ -4051,7 +4072,7 @@ static int __devinit bttv_probe(struct pci_dev *dev,
4051 bt848_contrast(btv,32768); 4072 bt848_contrast(btv,32768);
4052 bt848_hue(btv,32768); 4073 bt848_hue(btv,32768);
4053 bt848_sat(btv,32768); 4074 bt848_sat(btv,32768);
4054 audio_mux(btv,AUDIO_MUTE); 4075 audio_mute(btv, 1);
4055 set_input(btv,0); 4076 set_input(btv,0);
4056 } 4077 }
4057 4078
diff --git a/drivers/media/video/bt8xx/bttv-i2c.c b/drivers/media/video/bt8xx/bttv-i2c.c
index 614c12018557..4b562b386fcf 100644
--- a/drivers/media/video/bt8xx/bttv-i2c.c
+++ b/drivers/media/video/bt8xx/bttv-i2c.c
@@ -302,6 +302,10 @@ static int attach_inform(struct i2c_client *client)
302 if (!client->driver->command) 302 if (!client->driver->command)
303 return 0; 303 return 0;
304 304
305 if (client->driver->id == I2C_DRIVERID_MSP3400)
306 btv->i2c_msp34xx_client = client;
307 if (client->driver->id == I2C_DRIVERID_TVAUDIO)
308 btv->i2c_tvaudio_client = client;
305 if (btv->tuner_type != UNSET) { 309 if (btv->tuner_type != UNSET) {
306 struct tuner_setup tun_setup; 310 struct tuner_setup tun_setup;
307 311
diff --git a/drivers/media/video/bt8xx/bttv.h b/drivers/media/video/bt8xx/bttv.h
index ebde3e8219cf..3a23265c1538 100644
--- a/drivers/media/video/bt8xx/bttv.h
+++ b/drivers/media/video/bt8xx/bttv.h
@@ -234,7 +234,8 @@ struct tvcard
234 unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO 234 unsigned int digital_mode; // DIGITAL_MODE_CAMERA or DIGITAL_MODE_VIDEO
235 u32 gpiomask; 235 u32 gpiomask;
236 u32 muxsel[16]; 236 u32 muxsel[16];
237 u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ 237 u32 gpiomux[4]; /* Tuner, Radio, external, internal */
238 u32 gpiomute; /* GPIO mute setting */
238 u32 gpiomask2; /* GPIO MUX mask */ 239 u32 gpiomask2; /* GPIO MUX mask */
239 240
240 /* i2c audio flags */ 241 /* i2c audio flags */
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 12223a203960..ee989d2e15d9 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -41,7 +41,6 @@
41 41
42#include <linux/device.h> 42#include <linux/device.h>
43#include <media/video-buf.h> 43#include <media/video-buf.h>
44#include <media/audiochip.h>
45#include <media/tuner.h> 44#include <media/tuner.h>
46#include <media/tveeprom.h> 45#include <media/tveeprom.h>
47#include <media/ir-common.h> 46#include <media/ir-common.h>
@@ -299,6 +298,8 @@ struct bttv {
299 int i2c_state, i2c_rc; 298 int i2c_state, i2c_rc;
300 int i2c_done; 299 int i2c_done;
301 wait_queue_head_t i2c_queue; 300 wait_queue_head_t i2c_queue;
301 struct i2c_client *i2c_msp34xx_client;
302 struct i2c_client *i2c_tvaudio_client;
302 303
303 /* video4linux (1) */ 304 /* video4linux (1) */
304 struct video_device *video_dev; 305 struct video_device *video_dev;
@@ -321,6 +322,7 @@ struct bttv {
321 /* video state */ 322 /* video state */
322 unsigned int input; 323 unsigned int input;
323 unsigned int audio; 324 unsigned int audio;
325 unsigned int mute;
324 unsigned long freq; 326 unsigned long freq;
325 int tvnorm,hue,contrast,bright,saturation; 327 int tvnorm,hue,contrast,bright,saturation;
326 struct v4l2_framebuffer fbuf; 328 struct v4l2_framebuffer fbuf;
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c
index 8739c64785ef..bc3331870240 100644
--- a/drivers/media/video/cs53l32a.c
+++ b/drivers/media/video/cs53l32a.c
@@ -75,11 +75,6 @@ static int cs53l32a_command(struct i2c_client *client, unsigned int cmd,
75 cs53l32a_write(client, 0x01, 0x01 + (input->index << 4)); 75 cs53l32a_write(client, 0x01, 0x01 + (input->index << 4));
76 break; 76 break;
77 77
78 case VIDIOC_G_AUDIO:
79 memset(input, 0, sizeof(*input));
80 input->index = (cs53l32a_read(client, 0x01) >> 4) & 3;
81 break;
82
83 case VIDIOC_G_CTRL: 78 case VIDIOC_G_CTRL:
84 if (ctrl->id == V4L2_CID_AUDIO_MUTE) { 79 if (ctrl->id == V4L2_CID_AUDIO_MUTE) {
85 ctrl->value = (cs53l32a_read(client, 0x03) & 0xc0) != 0; 80 ctrl->value = (cs53l32a_read(client, 0x03) & 0xc0) != 0;
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c
index cb9a7981e408..a4540e858f21 100644
--- a/drivers/media/video/cx25840/cx25840-audio.c
+++ b/drivers/media/video/cx25840/cx25840-audio.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/videodev2.h> 19#include <linux/videodev2.h>
20#include <linux/i2c.h> 20#include <linux/i2c.h>
21#include <media/audiochip.h>
22#include <media/v4l2-common.h> 21#include <media/v4l2-common.h>
23 22
24#include "cx25840.h" 23#include "cx25840.h"
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index bcb7ef85eb23..7aee37645d63 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -31,7 +31,6 @@
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/videodev2.h> 32#include <linux/videodev2.h>
33#include <linux/i2c.h> 33#include <linux/i2c.h>
34#include <media/audiochip.h>
35#include <media/v4l2-common.h> 34#include <media/v4l2-common.h>
36 35
37#include "cx25840.h" 36#include "cx25840.h"
@@ -764,16 +763,6 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
764 return set_input(client, state->vid_input, input->index); 763 return set_input(client, state->vid_input, input->index);
765 } 764 }
766 765
767 case VIDIOC_G_AUDIO:
768 {
769 struct v4l2_audio *input = arg;
770
771 memset(input, 0, sizeof(*input));
772 input->index = state->aud_input;
773 input->capability = V4L2_AUDCAP_STEREO;
774 break;
775 }
776
777 case VIDIOC_S_FREQUENCY: 766 case VIDIOC_S_FREQUENCY:
778 input_change(client); 767 input_change(client);
779 break; 768 break;
diff --git a/drivers/media/video/cx88/cx88.h b/drivers/media/video/cx88/cx88.h
index 5b2e499eab22..326a25f147f6 100644
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@ -27,7 +27,6 @@
27 27
28#include <media/tuner.h> 28#include <media/tuner.h>
29#include <media/tveeprom.h> 29#include <media/tveeprom.h>
30#include <media/audiochip.h>
31#include <media/video-buf.h> 30#include <media/video-buf.h>
32#include <media/video-buf-dvb.h> 31#include <media/video-buf-dvb.h>
33 32
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index 11ea9765769c..bd0b036c5cab 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -53,7 +53,7 @@
53#include <linux/videodev.h> 53#include <linux/videodev.h>
54#include <linux/videodev2.h> 54#include <linux/videodev2.h>
55#include <media/v4l2-common.h> 55#include <media/v4l2-common.h>
56#include <media/audiochip.h> 56#include <media/tvaudio.h>
57#include <linux/kthread.h> 57#include <linux/kthread.h>
58#include <linux/suspend.h> 58#include <linux/suspend.h>
59#include "msp3400.h" 59#include "msp3400.h"
@@ -585,51 +585,12 @@ static int msp_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl)
585static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) 585static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
586{ 586{
587 struct msp_state *state = i2c_get_clientdata(client); 587 struct msp_state *state = i2c_get_clientdata(client);
588 u16 *sarg = arg;
589 int scart = 0; 588 int scart = 0;
590 589
591 if (msp_debug >= 2) 590 if (msp_debug >= 2)
592 v4l_i2c_print_ioctl(client, cmd); 591 v4l_i2c_print_ioctl(client, cmd);
593 592
594 switch (cmd) { 593 switch (cmd) {
595 case AUDC_SET_INPUT:
596 if (*sarg == state->input)
597 break;
598 state->input = *sarg;
599 switch (*sarg) {
600 case AUDIO_RADIO:
601 /* Hauppauge uses IN2 for the radio */
602 state->mode = MSP_MODE_FM_RADIO;
603 scart = SCART_IN2;
604 break;
605 case AUDIO_EXTERN_1:
606 /* IN1 is often used for external input ... */
607 state->mode = MSP_MODE_EXTERN;
608 scart = SCART_IN1;
609 break;
610 case AUDIO_EXTERN_2:
611 /* ... sometimes it is IN2 through ;) */
612 state->mode = MSP_MODE_EXTERN;
613 scart = SCART_IN2;
614 break;
615 case AUDIO_TUNER:
616 state->mode = -1;
617 break;
618 default:
619 if (*sarg & AUDIO_MUTE)
620 msp_set_scart(client, SCART_MUTE, 0);
621 break;
622 }
623 if (scart) {
624 state->rxsubchans = V4L2_TUNER_SUB_STEREO;
625 msp_set_scart(client, scart, 0);
626 msp_write_dsp(client, 0x000d, 0x1900);
627 if (state->opmode != OPMODE_AUTOSELECT)
628 msp_set_audmode(client);
629 }
630 msp_wake_thread(client);
631 break;
632
633 case AUDC_SET_RADIO: 594 case AUDC_SET_RADIO:
634 if (state->radio) 595 if (state->radio)
635 return 0; 596 return 0;
@@ -750,82 +711,27 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
750 return 0; 711 return 0;
751 } 712 }
752 713
753 case VIDIOC_ENUMINPUT:
754 {
755 struct v4l2_input *i = arg;
756
757 if (i->index != 0)
758 return -EINVAL;
759
760 i->type = V4L2_INPUT_TYPE_TUNER;
761 switch (i->index) {
762 case AUDIO_RADIO:
763 strcpy(i->name, "Radio");
764 break;
765 case AUDIO_EXTERN_1:
766 strcpy(i->name, "Extern 1");
767 break;
768 case AUDIO_EXTERN_2:
769 strcpy(i->name, "Extern 2");
770 break;
771 case AUDIO_TUNER:
772 strcpy(i->name, "Television");
773 break;
774 default:
775 return -EINVAL;
776 }
777 return 0;
778 }
779
780 case VIDIOC_G_AUDIO:
781 {
782 struct v4l2_audio *a = arg;
783
784 memset(a, 0, sizeof(*a));
785
786 switch (a->index) {
787 case AUDIO_RADIO:
788 strcpy(a->name, "Radio");
789 break;
790 case AUDIO_EXTERN_1:
791 strcpy(a->name, "Extern 1");
792 break;
793 case AUDIO_EXTERN_2:
794 strcpy(a->name, "Extern 2");
795 break;
796 case AUDIO_TUNER:
797 strcpy(a->name, "Television");
798 break;
799 default:
800 return -EINVAL;
801 }
802
803 a->capability = V4L2_AUDCAP_STEREO;
804 a->mode = 0; /* TODO: add support for AVL */
805 break;
806 }
807
808 case VIDIOC_S_AUDIO: 714 case VIDIOC_S_AUDIO:
809 { 715 {
810 struct v4l2_audio *sarg = arg; 716 struct v4l2_audio *sarg = arg;
811 717
812 switch (sarg->index) { 718 switch (sarg->index) {
813 case AUDIO_RADIO: 719 case TVAUDIO_INPUT_RADIO:
814 /* Hauppauge uses IN2 for the radio */ 720 /* Hauppauge uses IN2 for the radio */
815 state->mode = MSP_MODE_FM_RADIO; 721 state->mode = MSP_MODE_FM_RADIO;
816 scart = SCART_IN2; 722 scart = SCART_IN2;
817 break; 723 break;
818 case AUDIO_EXTERN_1: 724 case TVAUDIO_INPUT_EXTERN:
819 /* IN1 is often used for external input ... */ 725 /* IN1 is often used for external input ... */
820 state->mode = MSP_MODE_EXTERN; 726 state->mode = MSP_MODE_EXTERN;
821 scart = SCART_IN1; 727 scart = SCART_IN1;
822 break; 728 break;
823 case AUDIO_EXTERN_2: 729 case TVAUDIO_INPUT_INTERN:
824 /* ... sometimes it is IN2 through ;) */ 730 /* ... sometimes it is IN2 through ;) */
825 state->mode = MSP_MODE_EXTERN; 731 state->mode = MSP_MODE_EXTERN;
826 scart = SCART_IN2; 732 scart = SCART_IN2;
827 break; 733 break;
828 case AUDIO_TUNER: 734 case TVAUDIO_INPUT_TUNER:
829 state->mode = -1; 735 state->mode = -1;
830 break; 736 break;
831 } 737 }
diff --git a/drivers/media/video/msp3400-kthreads.c b/drivers/media/video/msp3400-kthreads.c
index 852ab6a115fa..71a944b447e2 100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
@@ -26,7 +26,6 @@
26#include <linux/videodev.h> 26#include <linux/videodev.h>
27#include <linux/videodev2.h> 27#include <linux/videodev2.h>
28#include <media/v4l2-common.h> 28#include <media/v4l2-common.h>
29#include <media/audiochip.h>
30#include <linux/kthread.h> 29#include <linux/kthread.h>
31#include <linux/suspend.h> 30#include <linux/suspend.h>
32#include "msp3400.h" 31#include "msp3400.h"
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index b184fd00b4e7..b05015282601 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -40,7 +40,6 @@
40#include <linux/i2c.h> 40#include <linux/i2c.h>
41#include <linux/videodev2.h> 41#include <linux/videodev2.h>
42#include <media/v4l2-common.h> 42#include <media/v4l2-common.h>
43#include <media/audiochip.h>
44#include <asm/div64.h> 43#include <asm/div64.h>
45 44
46MODULE_DESCRIPTION("Philips SAA7113/SAA7114/SAA7115 video decoder driver"); 45MODULE_DESCRIPTION("Philips SAA7113/SAA7114/SAA7115 video decoder driver");
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 104bd2e054e5..31ba293854c1 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -34,7 +34,6 @@
34#include <asm/io.h> 34#include <asm/io.h>
35 35
36#include <media/tuner.h> 36#include <media/tuner.h>
37#include <media/audiochip.h>
38#include <media/ir-common.h> 37#include <media/ir-common.h>
39#include <media/ir-kbd-i2c.h> 38#include <media/ir-kbd-i2c.h>
40#include <media/video-buf.h> 39#include <media/video-buf.h>
diff --git a/drivers/media/video/tda7432.c b/drivers/media/video/tda7432.c
index 12b8981efd13..78e043ac9ea0 100644
--- a/drivers/media/video/tda7432.c
+++ b/drivers/media/video/tda7432.c
@@ -48,7 +48,6 @@
48#include <linux/i2c.h> 48#include <linux/i2c.h>
49#include <linux/i2c-algo-bit.h> 49#include <linux/i2c-algo-bit.h>
50 50
51#include <media/audiochip.h>
52#include <media/v4l2-common.h> 51#include <media/v4l2-common.h>
53#include <media/i2c-addr.h> 52#include <media/i2c-addr.h>
54 53
diff --git a/drivers/media/video/tda9875.c b/drivers/media/video/tda9875.c
index ccfd3b90ea9f..103ccb919292 100644
--- a/drivers/media/video/tda9875.c
+++ b/drivers/media/video/tda9875.c
@@ -30,7 +30,6 @@
30#include <linux/i2c-algo-bit.h> 30#include <linux/i2c-algo-bit.h>
31#include <linux/init.h> 31#include <linux/init.h>
32 32
33#include <media/audiochip.h>
34 33
35#include <media/i2c-addr.h> 34#include <media/i2c-addr.h>
36 35
@@ -47,7 +46,6 @@ I2C_CLIENT_INSMOD;
47 46
48/* This is a superset of the TDA9875 */ 47/* This is a superset of the TDA9875 */
49struct tda9875 { 48struct tda9875 {
50 int mode;
51 int rvol, lvol; 49 int rvol, lvol;
52 int bass, treble; 50 int bass, treble;
53 struct i2c_client c; 51 struct i2c_client c;
@@ -197,7 +195,6 @@ static void do_tda9875_init(struct i2c_client *client)
197 195
198 tda9875_write(client, TDA9875_MUT, 0xcc ); /* General mute */ 196 tda9875_write(client, TDA9875_MUT, 0xcc ); /* General mute */
199 197
200 t->mode=AUDIO_UNMUTE;
201 t->lvol=t->rvol =0; /* 0dB */ 198 t->lvol=t->rvol =0; /* 0dB */
202 t->bass=0; /* 0dB */ 199 t->bass=0; /* 0dB */
203 t->treble=0; /* 0dB */ 200 t->treble=0; /* 0dB */
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 32e1849441fb..df195c905366 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -21,7 +21,6 @@
21 21
22#include <media/tuner.h> 22#include <media/tuner.h>
23#include <media/v4l2-common.h> 23#include <media/v4l2-common.h>
24#include <media/audiochip.h>
25 24
26#define UNSET (-1U) 25#define UNSET (-1U)
27 26
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 4cc0497dcbde..15fd55ff69ca 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -30,7 +30,7 @@
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/smp_lock.h> 31#include <linux/smp_lock.h>
32 32
33#include <media/audiochip.h> 33#include <media/tvaudio.h>
34#include <media/v4l2-common.h> 34#include <media/v4l2-common.h>
35 35
36#include <media/i2c-addr.h> 36#include <media/i2c-addr.h>
@@ -102,7 +102,7 @@ struct CHIPDESC {
102 102
103 /* input switch register + values for v4l inputs */ 103 /* input switch register + values for v4l inputs */
104 int inputreg; 104 int inputreg;
105 int inputmap[8]; 105 int inputmap[4];
106 int inputmute; 106 int inputmute;
107 int inputmask; 107 int inputmask;
108}; 108};
@@ -119,9 +119,10 @@ struct CHIPSTATE {
119 audiocmd shadow; 119 audiocmd shadow;
120 120
121 /* current settings */ 121 /* current settings */
122 __u16 left,right,treble,bass,mode; 122 __u16 left,right,treble,bass,muted,mode;
123 int prevmode; 123 int prevmode;
124 int radio; 124 int radio;
125 int input;
125 126
126 /* thread */ 127 /* thread */
127 pid_t tpid; 128 pid_t tpid;
@@ -1101,9 +1102,8 @@ static int tda8425_shift12(int val) { return (val >> 12) | 0xf0; }
1101static int tda8425_initialize(struct CHIPSTATE *chip) 1102static int tda8425_initialize(struct CHIPSTATE *chip)
1102{ 1103{
1103 struct CHIPDESC *desc = chiplist + chip->type; 1104 struct CHIPDESC *desc = chiplist + chip->type;
1104 int inputmap[8] = { /* tuner */ TDA8425_S1_CH2, /* radio */ TDA8425_S1_CH1, 1105 int inputmap[4] = { /* tuner */ TDA8425_S1_CH2, /* radio */ TDA8425_S1_CH1,
1105 /* extern */ TDA8425_S1_CH1, /* intern */ TDA8425_S1_OFF, 1106 /* extern */ TDA8425_S1_CH1, /* intern */ TDA8425_S1_OFF};
1106 /* off */ TDA8425_S1_OFF, /* on */ TDA8425_S1_CH2};
1107 1107
1108 if (chip->c.adapter->id == I2C_HW_B_RIVA) { 1108 if (chip->c.adapter->id == I2C_HW_B_RIVA) {
1109 memcpy (desc->inputmap, inputmap, sizeof (inputmap)); 1109 memcpy (desc->inputmap, inputmap, sizeof (inputmap));
@@ -1298,7 +1298,7 @@ static struct CHIPDESC chiplist[] = {
1298 .init = { 4, { TDA9873_SW, 0xa4, 0x06, 0x03 } }, 1298 .init = { 4, { TDA9873_SW, 0xa4, 0x06, 0x03 } },
1299 .inputreg = TDA9873_SW, 1299 .inputreg = TDA9873_SW,
1300 .inputmute = TDA9873_MUTE | TDA9873_AUTOMUTE, 1300 .inputmute = TDA9873_MUTE | TDA9873_AUTOMUTE,
1301 .inputmap = {0xa0, 0xa2, 0xa0, 0xa0, 0xc0}, 1301 .inputmap = {0xa0, 0xa2, 0xa0, 0xa0},
1302 .inputmask = TDA9873_INP_MASK|TDA9873_MUTE|TDA9873_AUTOMUTE, 1302 .inputmask = TDA9873_INP_MASK|TDA9873_MUTE|TDA9873_AUTOMUTE,
1303 1303
1304 }, 1304 },
@@ -1446,8 +1446,7 @@ static struct CHIPDESC chiplist[] = {
1446 .inputmap = {PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_TUNER, 1446 .inputmap = {PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_TUNER,
1447 PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_LINE, 1447 PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_LINE,
1448 PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_LINE, 1448 PIC16C54_MISC_SND_NOTMUTE|PIC16C54_MISC_SWITCH_LINE,
1449 PIC16C54_MISC_SND_MUTE,PIC16C54_MISC_SND_MUTE, 1449 PIC16C54_MISC_SND_MUTE},
1450 PIC16C54_MISC_SND_NOTMUTE},
1451 .inputmute = PIC16C54_MISC_SND_MUTE, 1450 .inputmute = PIC16C54_MISC_SND_MUTE,
1452 }, 1451 },
1453 { 1452 {
@@ -1583,28 +1582,40 @@ static int chip_detach(struct i2c_client *client)
1583 return 0; 1582 return 0;
1584} 1583}
1585 1584
1585static int tvaudio_set_ctrl(struct CHIPSTATE *chip, struct v4l2_control *ctrl)
1586{
1587 struct CHIPDESC *desc = chiplist + chip->type;
1588
1589 switch (ctrl->id) {
1590 case V4L2_CID_AUDIO_MUTE:
1591 if (ctrl->value < 0 || ctrl->value >= 2)
1592 return -ERANGE;
1593 chip->muted = ctrl->value;
1594 if (chip->muted)
1595 chip_write_masked(chip,desc->inputreg,desc->inputmute,desc->inputmask);
1596 else
1597 chip_write_masked(chip,desc->inputreg,
1598 desc->inputmap[chip->input],desc->inputmask);
1599 break;
1600 default:
1601 return -EINVAL;
1602 }
1603 return 0;
1604}
1605
1606
1586/* ---------------------------------------------------------------------- */ 1607/* ---------------------------------------------------------------------- */
1587/* video4linux interface */ 1608/* video4linux interface */
1588 1609
1589static int chip_command(struct i2c_client *client, 1610static int chip_command(struct i2c_client *client,
1590 unsigned int cmd, void *arg) 1611 unsigned int cmd, void *arg)
1591{ 1612{
1592 __u16 *sarg = arg;
1593 struct CHIPSTATE *chip = i2c_get_clientdata(client); 1613 struct CHIPSTATE *chip = i2c_get_clientdata(client);
1594 struct CHIPDESC *desc = chiplist + chip->type; 1614 struct CHIPDESC *desc = chiplist + chip->type;
1595 1615
1596 v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd); 1616 v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd);
1597 1617
1598 switch (cmd) { 1618 switch (cmd) {
1599 case AUDC_SET_INPUT:
1600 if (desc->flags & CHIP_HAS_INPUTSEL) {
1601 if (*sarg & 0x80)
1602 chip_write_masked(chip,desc->inputreg,desc->inputmute,desc->inputmask);
1603 else
1604 chip_write_masked(chip,desc->inputreg,desc->inputmap[*sarg],desc->inputmask);
1605 }
1606 break;
1607
1608 case AUDC_SET_RADIO: 1619 case AUDC_SET_RADIO:
1609 chip->radio = 1; 1620 chip->radio = 1;
1610 chip->watch_stereo = 0; 1621 chip->watch_stereo = 0;
@@ -1668,6 +1679,24 @@ static int chip_command(struct i2c_client *client,
1668 break; 1679 break;
1669 } 1680 }
1670 1681
1682 case VIDIOC_S_CTRL:
1683 return tvaudio_set_ctrl(chip, arg);
1684
1685 case VIDIOC_S_AUDIO:
1686 {
1687 struct v4l2_audio *sarg = arg;
1688
1689 if (!(desc->flags & CHIP_HAS_INPUTSEL) || sarg->index >= 4)
1690 return -EINVAL;
1691 /* There are four inputs: tuner, radio, extern and intern. */
1692 chip->input = sarg->index;
1693 if (chip->muted)
1694 break;
1695 chip_write_masked(chip, desc->inputreg,
1696 desc->inputmap[chip->input], desc->inputmask);
1697 break;
1698 }
1699
1671 case VIDIOC_S_TUNER: 1700 case VIDIOC_S_TUNER:
1672 { 1701 {
1673 struct v4l2_tuner *vt = arg; 1702 struct v4l2_tuner *vt = arg;
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index 582551b0969b..e0d2ff83fc91 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -248,32 +248,32 @@ audioIC[] =
248 {AUDIO_CHIP_MSP34XX, "MSP3410D"}, 248 {AUDIO_CHIP_MSP34XX, "MSP3410D"},
249 {AUDIO_CHIP_MSP34XX, "MSP3415"}, 249 {AUDIO_CHIP_MSP34XX, "MSP3415"},
250 {AUDIO_CHIP_MSP34XX, "MSP3430"}, 250 {AUDIO_CHIP_MSP34XX, "MSP3430"},
251 {AUDIO_CHIP_UNKNOWN, "MSP3438"}, 251 {AUDIO_CHIP_MSP34XX, "MSP3438"},
252 {AUDIO_CHIP_UNKNOWN, "CS5331"}, 252 {AUDIO_CHIP_UNKNOWN, "CS5331"},
253 /* 10-14 */ 253 /* 10-14 */
254 {AUDIO_CHIP_MSP34XX, "MSP3435"}, 254 {AUDIO_CHIP_MSP34XX, "MSP3435"},
255 {AUDIO_CHIP_MSP34XX, "MSP3440"}, 255 {AUDIO_CHIP_MSP34XX, "MSP3440"},
256 {AUDIO_CHIP_MSP34XX, "MSP3445"}, 256 {AUDIO_CHIP_MSP34XX, "MSP3445"},
257 {AUDIO_CHIP_UNKNOWN, "MSP3411"}, 257 {AUDIO_CHIP_MSP34XX, "MSP3411"},
258 {AUDIO_CHIP_UNKNOWN, "MSP3416"}, 258 {AUDIO_CHIP_MSP34XX, "MSP3416"},
259 /* 15-19 */ 259 /* 15-19 */
260 {AUDIO_CHIP_MSP34XX, "MSP3425"}, 260 {AUDIO_CHIP_MSP34XX, "MSP3425"},
261 {AUDIO_CHIP_UNKNOWN, "MSP3451"}, 261 {AUDIO_CHIP_MSP34XX, "MSP3451"},
262 {AUDIO_CHIP_UNKNOWN, "MSP3418"}, 262 {AUDIO_CHIP_MSP34XX, "MSP3418"},
263 {AUDIO_CHIP_UNKNOWN, "Type 0x12"}, 263 {AUDIO_CHIP_UNKNOWN, "Type 0x12"},
264 {AUDIO_CHIP_UNKNOWN, "OKI7716"}, 264 {AUDIO_CHIP_UNKNOWN, "OKI7716"},
265 /* 20-24 */ 265 /* 20-24 */
266 {AUDIO_CHIP_UNKNOWN, "MSP4410"}, 266 {AUDIO_CHIP_MSP34XX, "MSP4410"},
267 {AUDIO_CHIP_UNKNOWN, "MSP4420"}, 267 {AUDIO_CHIP_MSP34XX, "MSP4420"},
268 {AUDIO_CHIP_UNKNOWN, "MSP4440"}, 268 {AUDIO_CHIP_MSP34XX, "MSP4440"},
269 {AUDIO_CHIP_UNKNOWN, "MSP4450"}, 269 {AUDIO_CHIP_MSP34XX, "MSP4450"},
270 {AUDIO_CHIP_UNKNOWN, "MSP4408"}, 270 {AUDIO_CHIP_MSP34XX, "MSP4408"},
271 /* 25-29 */ 271 /* 25-29 */
272 {AUDIO_CHIP_UNKNOWN, "MSP4418"}, 272 {AUDIO_CHIP_MSP34XX, "MSP4418"},
273 {AUDIO_CHIP_UNKNOWN, "MSP4428"}, 273 {AUDIO_CHIP_MSP34XX, "MSP4428"},
274 {AUDIO_CHIP_UNKNOWN, "MSP4448"}, 274 {AUDIO_CHIP_MSP34XX, "MSP4448"},
275 {AUDIO_CHIP_UNKNOWN, "MSP4458"}, 275 {AUDIO_CHIP_MSP34XX, "MSP4458"},
276 {AUDIO_CHIP_UNKNOWN, "Type 0x1d"}, 276 {AUDIO_CHIP_MSP34XX, "Type 0x1d"},
277 /* 30-34 */ 277 /* 30-34 */
278 {AUDIO_CHIP_INTERNAL, "CX880"}, 278 {AUDIO_CHIP_INTERNAL, "CX880"},
279 {AUDIO_CHIP_INTERNAL, "CX881"}, 279 {AUDIO_CHIP_INTERNAL, "CX881"},
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 1717663d3e51..d1234d781e16 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -312,7 +312,6 @@ static const char *v4l2_int_ioctls[] = {
312 [_IOC_NR(DECODER_DUMP)] = "DECODER_DUMP", 312 [_IOC_NR(DECODER_DUMP)] = "DECODER_DUMP",
313#endif 313#endif
314 [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO", 314 [_IOC_NR(AUDC_SET_RADIO)] = "AUDC_SET_RADIO",
315 [_IOC_NR(AUDC_SET_INPUT)] = "AUDC_SET_INPUT",
316 [_IOC_NR(MSP_SET_MATRIX)] = "MSP_SET_MATRIX", 315 [_IOC_NR(MSP_SET_MATRIX)] = "MSP_SET_MATRIX",
317 316
318 [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR", 317 [_IOC_NR(TUNER_SET_TYPE_ADDR)] = "TUNER_SET_TYPE_ADDR",
@@ -419,7 +418,6 @@ void v4l_printk_ioctl_arg(char *s,unsigned int cmd, void *arg)
419 case TUNER_SET_TYPE_ADDR: 418 case TUNER_SET_TYPE_ADDR:
420 case TUNER_SET_STANDBY: 419 case TUNER_SET_STANDBY:
421 case TDA9887_SET_CONFIG: 420 case TDA9887_SET_CONFIG:
422 case AUDC_SET_INPUT:
423 case VIDIOC_OVERLAY_OLD: 421 case VIDIOC_OVERLAY_OLD:
424 case VIDIOC_STREAMOFF: 422 case VIDIOC_STREAMOFF:
425 case VIDIOC_G_OUTPUT: 423 case VIDIOC_G_OUTPUT:
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c
index 8cb64f8a8a91..9b90225226e6 100644
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@ -102,11 +102,6 @@ static int wm8775_command(struct i2c_client *client, unsigned int cmd,
102 wm8775_write(client, R21, 0x100 + state->input); 102 wm8775_write(client, R21, 0x100 + state->input);
103 break; 103 break;
104 104
105 case VIDIOC_G_AUDIO:
106 memset(input, 0, sizeof(*input));
107 input->index = state->input;
108 break;
109
110 case VIDIOC_G_CTRL: 105 case VIDIOC_G_CTRL:
111 if (ctrl->id != V4L2_CID_AUDIO_MUTE) 106 if (ctrl->id != V4L2_CID_AUDIO_MUTE)
112 return -EINVAL; 107 return -EINVAL;