28 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31 #include <linux/module.h>
34 #include <linux/pci.h>
39 #include <asm/unaligned.h>
48 static void boot_msp34xx(
struct bttv *btv,
int pin);
49 static void hauppauge_eeprom(
struct bttv *btv);
50 static void avermedia_eeprom(
struct bttv *btv);
51 static void osprey_eeprom(
struct bttv *btv,
const u8 ee[256]);
52 static void modtec_eeprom(
struct bttv *btv);
53 static void init_PXC200(
struct bttv *btv);
54 static void init_RTV24(
struct bttv *btv);
56 static void rv605_muxsel(
struct bttv *btv,
unsigned int input);
57 static void eagle_muxsel(
struct bttv *btv,
unsigned int input);
58 static void xguard_muxsel(
struct bttv *btv,
unsigned int input);
59 static void ivc120_muxsel(
struct bttv *btv,
unsigned int input);
60 static void gvc1100_muxsel(
struct bttv *btv,
unsigned int input);
62 static void PXC200_muxsel(
struct bttv *btv,
unsigned int input);
64 static void picolo_tetra_muxsel(
struct bttv *btv,
unsigned int input);
65 static void picolo_tetra_init(
struct bttv *btv);
67 static void tibetCS16_muxsel(
struct bttv *btv,
unsigned int input);
68 static void tibetCS16_init(
struct bttv *btv);
70 static void kodicom4400r_muxsel(
struct bttv *btv,
unsigned int input);
71 static void kodicom4400r_init(
struct bttv *btv);
73 static void sigmaSLC_muxsel(
struct bttv *btv,
unsigned int input);
74 static void sigmaSQ_muxsel(
struct bttv *btv,
unsigned int input);
76 static void geovision_muxsel(
struct bttv *btv,
unsigned int input);
78 static void phytec_muxsel(
struct bttv *btv,
unsigned int input);
80 static void gv800s_muxsel(
struct bttv *btv,
unsigned int input);
81 static void gv800s_init(
struct bttv *btv);
83 static void td3116_muxsel(
struct bttv *btv,
unsigned int input);
85 static int terratec_active_radio_upgrade(
struct bttv *btv);
86 static int tea5757_read(
struct bttv *btv);
87 static int tea5757_write(
struct bttv *btv,
int value);
88 static void identify_by_eeprom(
struct bttv *btv,
90 static int __devinit pvr_boot(
struct bttv *btv);
93 static unsigned int triton1;
94 static unsigned int vsfx;
98 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
UNSET };
99 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
UNSET };
100 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
UNSET };
101 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
UNSET };
102 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
UNSET };
103 static unsigned int audiodev[BTTV_MAX];
104 static unsigned int saa6588[BTTV_MAX];
105 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] =
NULL };
106 static unsigned int autoload =
UNSET;
107 static unsigned int gpiomask =
UNSET;
108 static unsigned int audioall =
UNSET;
109 static unsigned int audiomux[5] = { [ 0 ... 4 ] =
UNSET };
129 "[enable bug compatibility for triton1 + others]");
131 "[yet another chipset flaw workaround]");
134 MODULE_PARM_DESC(pll,
"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138 "\t\t-1 = no audio\n"
139 "\t\t 0 = autodetect (default)\n"
143 MODULE_PARM_DESC(saa6588,
"if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
145 " [some VIA/SIS chipsets are known to have problem with overlay]");
358 .name =
" *** UNKNOWN/GENERIC *** ",
361 .muxsel =
MUXSEL(2, 3, 1, 0),
363 .tuner_addr = ADDR_UNSET,
371 .muxsel =
MUXSEL(2, 3, 1, 1),
372 .gpiomux = { 2, 0, 0, 0 },
375 .tuner_addr = ADDR_UNSET,
378 .name =
"Hauppauge (bt848)",
383 .muxsel =
MUXSEL(2, 3, 1, 1),
384 .gpiomux = { 0, 1, 2, 3 },
387 .tuner_addr = ADDR_UNSET,
390 .name =
"STB, Gateway P/N 6000699 (bt848)",
395 .muxsel =
MUXSEL(2, 3, 1, 1),
396 .gpiomux = { 4, 0, 2, 3 },
399 .tuner_type = TUNER_PHILIPS_NTSC,
400 .tuner_addr = ADDR_UNSET,
407 .name =
"Intel Create and Share PCI/ Smart Video Recorder III",
412 .muxsel =
MUXSEL(2, 3, 1, 1),
414 .tuner_type = TUNER_ABSENT,
415 .tuner_addr = ADDR_UNSET,
418 .name =
"Diamond DTV2000",
423 .muxsel =
MUXSEL(2, 3, 1, 0),
424 .gpiomux = { 0, 1, 0, 1 },
427 .tuner_addr = ADDR_UNSET,
430 .name =
"AVerMedia TVPhone",
434 .muxsel =
MUXSEL(2, 3, 1, 1),
436 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
439 .tuner_addr = ADDR_UNSET,
444 .name =
"MATRIX-Vision MV-Delta",
449 .muxsel =
MUXSEL(2, 3, 1, 0, 0),
451 .tuner_type = TUNER_ABSENT,
452 .tuner_addr = ADDR_UNSET,
457 .name =
"Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
462 .muxsel =
MUXSEL(2, 3, 1, 1),
463 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
467 .tuner_addr = ADDR_UNSET,
470 .name =
"IMS/IXmicro TurboTV",
475 .muxsel =
MUXSEL(2, 3, 1, 1),
476 .gpiomux = { 1, 1, 2, 3 },
478 .tuner_type = TUNER_TEMIC_PAL,
479 .tuner_addr = ADDR_UNSET,
482 .name =
"Hauppauge (bt878)",
487 .muxsel =
MUXSEL(2, 0, 1, 1),
488 .gpiomux = { 0, 1, 2, 3 },
492 .tuner_addr = ADDR_UNSET,
495 .name =
"MIRO PCTV pro",
500 .muxsel =
MUXSEL(2, 3, 1, 1),
501 .gpiomux = { 0x20001,0x10001, 0, 0 },
504 .tuner_addr = ADDR_UNSET,
509 .name =
"ADS Technologies Channel Surfer TV (bt848)",
514 .muxsel =
MUXSEL(2, 3, 1, 1),
515 .gpiomux = { 13, 14, 11, 7 },
517 .tuner_addr = ADDR_UNSET,
520 .name =
"AVerMedia TVCapture 98",
525 .muxsel =
MUXSEL(2, 3, 1, 1),
526 .gpiomux = { 13, 14, 11, 7 },
529 .tuner_type = TUNER_PHILIPS_PAL,
530 .tuner_addr = ADDR_UNSET,
535 .name =
"Aimslab Video Highway Xtreme (VHX)",
540 .muxsel =
MUXSEL(2, 3, 1, 1),
541 .gpiomux = { 0, 2, 1, 3 },
545 .tuner_addr = ADDR_UNSET,
548 .name =
"Zoltrix TV-Max",
553 .muxsel =
MUXSEL(2, 3, 1, 1),
554 .gpiomux = { 0, 0, 1, 0 },
557 .tuner_addr = ADDR_UNSET,
562 .name =
"Prolink Pixelview PlayTV (bt878)",
566 .gpiomask = 0x01fe00,
567 .muxsel =
MUXSEL(2, 3, 1, 1),
569 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
570 .gpiomute = 0x002000,
573 .tuner_addr = ADDR_UNSET,
576 .name =
"Leadtek WinView 601",
580 .gpiomask = 0x8300f8,
581 .muxsel =
MUXSEL(2, 3, 1, 1, 0),
582 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
583 .gpiomute = 0xcfa007,
585 .tuner_addr = ADDR_UNSET,
590 .name =
"AVEC Intercapture",
595 .muxsel =
MUXSEL(2, 3, 1, 1),
596 .gpiomux = { 1, 0, 0, 0 },
598 .tuner_addr = ADDR_UNSET,
601 .name =
"Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
605 .gpiomask = 0x8dff00,
606 .muxsel =
MUXSEL(2, 3, 1, 1),
609 .tuner_type = TUNER_ABSENT,
610 .tuner_addr = ADDR_UNSET,
615 .name =
"CEI Raffles Card",
619 .muxsel =
MUXSEL(2, 3, 1, 1),
621 .tuner_addr = ADDR_UNSET,
624 .name =
"Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
629 .muxsel =
MUXSEL(2, 3, 1, 1),
630 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
633 .tuner_type = TUNER_PHILIPS_PAL_I,
634 .tuner_addr = ADDR_UNSET,
637 .name =
"Askey CPH050/ Phoebe Tv Master + FM",
642 .muxsel =
MUXSEL(2, 3, 1, 1),
643 .gpiomux = { 0, 1, 0x800, 0x400 },
647 .tuner_addr = ADDR_UNSET,
650 .name =
"Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
656 .muxsel =
MUXSEL(2, 3, 0),
658 .gpiomux = { 0, 0, 0, 0 },
661 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
662 .tuner_addr = ADDR_UNSET,
667 .name =
"Askey CPH05X/06X (bt878) [many vendors]",
672 .muxsel =
MUXSEL(2, 3, 1, 1),
673 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
677 .tuner_addr = ADDR_UNSET,
682 .name =
"Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
686 .gpiomask = 0x1f0fff,
687 .muxsel =
MUXSEL(2, 3, 1, 1),
688 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
690 .tuner_type = TUNER_PHILIPS_PAL,
691 .tuner_addr = ADDR_UNSET,
695 .name =
"Hauppauge WinCam newer (bt878)",
700 .muxsel =
MUXSEL(2, 0, 1, 1),
701 .gpiomux = { 0, 1, 2, 3 },
704 .tuner_addr = ADDR_UNSET,
707 .name =
"Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
712 .muxsel =
MUXSEL(2, 3, 1, 1),
713 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
716 .tuner_type = TUNER_PHILIPS_SECAM,
717 .tuner_addr = ADDR_UNSET,
722 .name =
"Terratec TerraTV+ Version 1.1 (bt878)",
726 .gpiomask = 0x1f0fff,
727 .muxsel =
MUXSEL(2, 3, 1, 1),
728 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
730 .tuner_type = TUNER_PHILIPS_PAL,
731 .tuner_addr = ADDR_UNSET,
767 .name =
"Imagenation PXC200",
772 .muxsel =
MUXSEL(2, 3, 1, 0, 0),
774 .tuner_type = TUNER_ABSENT,
775 .tuner_addr = ADDR_UNSET,
776 .muxsel_hook = PXC200_muxsel,
780 .name =
"Lifeview FlyVideo 98 LR50",
785 .muxsel =
MUXSEL(2, 3, 1, 1),
786 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
790 .tuner_addr = ADDR_UNSET,
793 .name =
"Formac iProTV, Formac ProTV I (bt848)",
798 .muxsel =
MUXSEL(2, 3, 1, 1),
799 .gpiomux = { 1, 0, 0, 0 },
801 .tuner_type = TUNER_PHILIPS_PAL,
802 .tuner_addr = ADDR_UNSET,
807 .name =
"Intel Create and Share PCI/ Smart Video Recorder III",
812 .muxsel =
MUXSEL(2, 3, 1, 1),
814 .tuner_type = TUNER_ABSENT,
815 .tuner_addr = ADDR_UNSET,
818 .name =
"Terratec TerraTValue Version Bt878",
822 .gpiomask = 0xffff00,
823 .muxsel =
MUXSEL(2, 3, 1, 1),
824 .gpiomux = { 0x500, 0, 0x300, 0x900 },
827 .tuner_type = TUNER_PHILIPS_PAL,
828 .tuner_addr = ADDR_UNSET,
831 .name =
"Leadtek WinFast 2000/ WinFast 2000 XP",
836 .muxsel =
MUXSEL(2, 3, 1, 1, 0),
838 .gpiomask = 0xb33000,
839 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
840 .gpiomute = 0x800000,
854 .tuner_type = TUNER_PHILIPS_PAL,
855 .tuner_addr = ADDR_UNSET,
860 .name =
"Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
865 .muxsel =
MUXSEL(2, 3, 1, 1),
866 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
870 .tuner_addr = ADDR_UNSET,
875 .name =
"Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
880 .muxsel =
MUXSEL(2, 3, 1, 1),
881 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
885 .tuner_addr = ADDR_UNSET,
889 .name =
"Prolink PixelView PlayTV pro",
894 .muxsel =
MUXSEL(2, 3, 1, 1),
895 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
900 .tuner_addr = ADDR_UNSET,
903 .name =
"Askey CPH06X TView99",
907 .gpiomask = 0x551e00,
908 .muxsel =
MUXSEL(2, 3, 1, 0),
909 .gpiomux = { 0x551400, 0x551200, 0, 0 },
910 .gpiomute = 0x551c00,
912 .tuner_type = TUNER_PHILIPS_PAL_I,
913 .tuner_addr = ADDR_UNSET,
917 .name =
"Pinnacle PCTV Studio/Rave",
921 .gpiomask = 0x03000F,
922 .muxsel =
MUXSEL(2, 3, 1, 1),
923 .gpiomux = { 2, 0xd0001, 0, 0 },
927 .tuner_addr = ADDR_UNSET,
932 .name =
"STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
937 .muxsel =
MUXSEL(2, 3, 1, 1),
938 .gpiomux = { 4, 0, 2, 3 },
941 .tuner_type = TUNER_PHILIPS_NTSC,
942 .tuner_addr = ADDR_UNSET,
947 .name =
"AVerMedia TVPhone 98",
952 .muxsel =
MUXSEL(2, 3, 1, 1),
953 .gpiomux = { 13, 4, 11, 7 },
956 .tuner_addr = ADDR_UNSET,
961 .name =
"ProVideo PV951",
966 .muxsel =
MUXSEL(2, 3, 1, 1),
967 .gpiomux = { 0, 0, 0, 0},
970 .tuner_type = TUNER_PHILIPS_PAL_I,
971 .tuner_addr = ADDR_UNSET,
974 .name =
"Little OnAir TV",
979 .muxsel =
MUXSEL(2, 3, 1, 1),
980 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
981 .gpiomute = 0xff3ffc,
984 .tuner_addr = ADDR_UNSET,
989 .name =
"Sigma TVII-FM",
994 .muxsel =
MUXSEL(2, 3, 1, 1),
995 .gpiomux = { 1, 1, 0, 2 },
1000 .tuner_addr = ADDR_UNSET,
1003 .name =
"MATRIX-Vision MV-Delta 2",
1008 .muxsel =
MUXSEL(2, 3, 1, 0, 0),
1012 .tuner_type = TUNER_ABSENT,
1013 .tuner_addr = ADDR_UNSET,
1016 .name =
"Zoltrix Genie TV/FM",
1020 .gpiomask = 0xbcf03f,
1021 .muxsel =
MUXSEL(2, 3, 1, 1),
1022 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1023 .gpiomute = 0xbcb03f,
1026 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1027 .tuner_addr = ADDR_UNSET,
1030 .name =
"Terratec TV/Radio+",
1034 .gpiomask = 0x70000,
1035 .muxsel =
MUXSEL(2, 3, 1, 1),
1036 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1037 .gpiomute = 0x40000,
1040 .tuner_type = TUNER_PHILIPS_PAL_I,
1041 .tuner_addr = ADDR_UNSET,
1047 .name =
"Askey CPH03x/ Dynalink Magic TView",
1052 .muxsel =
MUXSEL(2, 3, 1, 1),
1053 .gpiomux = {2,0,0,0 },
1056 .tuner_type =
UNSET,
1057 .tuner_addr = ADDR_UNSET,
1060 .name =
"IODATA GV-BCTV3/PCI",
1064 .gpiomask = 0x010f00,
1065 .muxsel =
MUXSEL(2, 3, 0, 0),
1066 .gpiomux = {0x10000, 0, 0x10000, 0 },
1069 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1070 .tuner_addr = ADDR_UNSET,
1074 .name =
"Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1079 .gpiomask = 0xAA0000,
1080 .muxsel =
MUXSEL(2, 3, 1, 1, 0),
1082 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1083 .gpiomute = 0xa8000,
1086 .tuner_type = TUNER_PHILIPS_PAL_I,
1087 .tuner_addr = ADDR_UNSET,
1100 .name =
"Eagle Wireless Capricorn2 (bt878A)",
1105 .muxsel =
MUXSEL(2, 0, 1, 1),
1106 .gpiomux = { 0, 1, 2, 3 },
1109 .tuner_type =
UNSET ,
1110 .tuner_addr = ADDR_UNSET,
1116 .name =
"Pinnacle PCTV Studio Pro",
1120 .gpiomask = 0x03000F,
1121 .muxsel =
MUXSEL(2, 3, 1, 1),
1122 .gpiomux = { 1, 0xd0001, 0, 0 },
1134 .tuner_type =
UNSET,
1135 .tuner_addr = ADDR_UNSET,
1140 .name =
"Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1145 .muxsel =
MUXSEL(2, 3, 1, 1),
1146 .gpiomux = { 0, 0, 0x10, 8 },
1149 .tuner_type = TUNER_PHILIPS_PAL,
1150 .tuner_addr = ADDR_UNSET,
1159 .name =
"Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1164 .muxsel =
MUXSEL(2, 3, 1, 1),
1165 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1172 .tuner_type =
UNSET,
1173 .tuner_addr = ADDR_UNSET,
1178 .name =
"Askey CPH031/ BESTBUY Easy TV",
1183 .muxsel =
MUXSEL(2, 3, 1, 0),
1184 .gpiomux = { 2, 0, 0, 0 },
1187 .tuner_type = TUNER_TEMIC_PAL,
1188 .tuner_addr = ADDR_UNSET,
1194 .name =
"Lifeview FlyVideo 98FM LR50",
1199 .muxsel =
MUXSEL(2, 3, 1, 1),
1200 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1203 .tuner_type = TUNER_PHILIPS_PAL,
1204 .tuner_addr = ADDR_UNSET,
1210 .name =
"GrandTec 'Grand Video Capture' (Bt848)",
1219 .tuner_type = TUNER_ABSENT,
1220 .tuner_addr = ADDR_UNSET,
1224 .name =
"Askey CPH060/ Phoebe TV Master Only (No FM)",
1229 .muxsel =
MUXSEL(2, 3, 1, 1),
1230 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1233 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1234 .tuner_addr = ADDR_UNSET,
1238 .name =
"Askey CPH03x TV Capturer",
1242 .gpiomask = 0x03000F,
1243 .muxsel =
MUXSEL(2, 3, 1, 0),
1244 .gpiomux = { 2, 0, 0, 0 },
1247 .tuner_type = TUNER_TEMIC_PAL,
1248 .tuner_addr = ADDR_UNSET,
1255 .name =
"Modular Technology MM100PCTV",
1260 .muxsel =
MUXSEL(2, 3, 1, 1),
1261 .gpiomux = { 2, 0, 0, 1 },
1264 .tuner_type = TUNER_TEMIC_PAL,
1265 .tuner_addr = ADDR_UNSET,
1269 .name =
"AG Electronics GMV1",
1278 .tuner_type = TUNER_ABSENT,
1279 .tuner_addr = ADDR_UNSET,
1285 .name =
"Askey CPH061/ BESTBUY Easy TV (bt878)",
1290 .muxsel =
MUXSEL(2, 3, 1, 0),
1291 .gpiomux = { 1, 0, 4, 4 },
1294 .tuner_type = TUNER_PHILIPS_PAL,
1295 .tuner_addr = ADDR_UNSET,
1299 .name =
"ATI TV-Wonder",
1304 .muxsel =
MUXSEL(2, 3, 1, 0),
1305 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1308 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1309 .tuner_addr = ADDR_UNSET,
1315 .name =
"ATI TV-Wonder VE",
1320 .muxsel =
MUXSEL(2, 3, 0, 1),
1321 .gpiomux = { 0, 0, 1, 0 },
1324 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1325 .tuner_addr = ADDR_UNSET,
1329 .name =
"Lifeview FlyVideo 2000S LR90",
1334 .muxsel =
MUXSEL(2, 3, 0, 1),
1338 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1343 .tuner_type = TUNER_PHILIPS_PAL,
1344 .tuner_addr = ADDR_UNSET,
1347 .name =
"Terratec TValueRadio",
1351 .gpiomask = 0xffff00,
1352 .muxsel =
MUXSEL(2, 3, 1, 1),
1353 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1356 .tuner_type = TUNER_PHILIPS_PAL,
1357 .tuner_addr = ADDR_UNSET,
1362 .name =
"IODATA GV-BCTV4/PCI",
1366 .gpiomask = 0x010f00,
1367 .muxsel =
MUXSEL(2, 3, 0, 0),
1368 .gpiomux = {0x10000, 0, 0x10000, 0 },
1371 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1372 .tuner_addr = ADDR_UNSET,
1378 .name =
"3Dfx VoodooTV FM (Euro)",
1384 .gpiomask = 0x4f8a00,
1387 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1388 .gpiomute = 0x947fff,
1391 .muxsel =
MUXSEL(2, 3, 0, 1),
1392 .tuner_type = TUNER_MT2032,
1393 .tuner_addr = ADDR_UNSET,
1398 .name =
"VoodooTV 200 (USA)",
1404 .gpiomask = 0x4f8a00,
1407 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1408 .gpiomute = 0x947fff,
1411 .muxsel =
MUXSEL(2, 3, 0, 1),
1412 .tuner_type = TUNER_MT2032,
1413 .tuner_addr = ADDR_UNSET,
1419 .name =
"Active Imaging AIMMS",
1422 .tuner_type = TUNER_ABSENT,
1423 .tuner_addr = ADDR_UNSET,
1430 .name =
"Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1435 .muxsel =
MUXSEL(2, 3, 1, 1),
1436 .gpiomux = { 0, 0, 11, 7 },
1439 .tuner_type = TUNER_LG_PAL_I_FM,
1440 .tuner_addr = ADDR_UNSET,
1451 .name =
"Lifeview FlyVideo 98EZ (capture only) LR51",
1456 .muxsel =
MUXSEL(2, 3, 1, 1),
1459 .tuner_type = TUNER_ABSENT,
1460 .tuner_addr = ADDR_UNSET,
1466 .name =
"Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1471 .muxsel =
MUXSEL(2, 3, 1, 1),
1472 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1476 .tuner_type = TUNER_PHILIPS_PAL,
1477 .tuner_addr = ADDR_UNSET,
1492 .name =
"Sensoray 311/611",
1497 .muxsel =
MUXSEL(2, 3, 1, 0, 0),
1499 .tuner_type = TUNER_ABSENT,
1500 .tuner_addr = ADDR_UNSET,
1504 .name =
"RemoteVision MX (RV605)",
1509 .gpiomask2 = 0x07ff,
1510 .muxsel =
MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
1512 .tuner_type = TUNER_ABSENT,
1513 .tuner_addr = ADDR_UNSET,
1514 .muxsel_hook = rv605_muxsel,
1517 .name =
"Powercolor MTV878/ MTV878R/ MTV878F",
1521 .gpiomask = 0x1C800F,
1522 .muxsel =
MUXSEL(2, 1, 1),
1523 .gpiomux = { 0, 1, 2, 2 },
1525 .tuner_type = TUNER_PHILIPS_PAL,
1526 .tuner_addr = ADDR_UNSET,
1534 .name =
"Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1538 .gpiomask = 0x140007,
1539 .muxsel =
MUXSEL(2, 3, 1, 1),
1540 .gpiomux = { 0, 1, 2, 3 },
1542 .tuner_type = TUNER_PHILIPS_NTSC,
1543 .tuner_addr = ADDR_UNSET,
1547 .name =
"GrandTec Multi Capture Card (Bt878)",
1552 .muxsel =
MUXSEL(2, 3, 1, 0),
1556 .tuner_type = TUNER_ABSENT,
1557 .tuner_addr = ADDR_UNSET,
1560 .name =
"Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1566 .muxsel =
MUXSEL(2, 3, 1, 1),
1567 .gpiomux = { 0, 0, 4, 4 },
1577 .tuner_type = TUNER_PHILIPS_PAL,
1578 .tuner_addr = ADDR_UNSET,
1594 .name =
"DSP Design TCVIDEO",
1597 .muxsel =
MUXSEL(2, 3, 1, 0),
1599 .tuner_type =
UNSET,
1600 .tuner_addr = ADDR_UNSET,
1605 .name =
"Hauppauge WinTV PVR",
1609 .muxsel =
MUXSEL(2, 0, 1, 1),
1611 .tuner_type =
UNSET,
1612 .tuner_addr = ADDR_UNSET,
1618 .name =
"IODATA GV-BCTV5/PCI",
1622 .gpiomask = 0x0f0f80,
1623 .muxsel =
MUXSEL(2, 3, 1, 0),
1624 .gpiomux = {0x030000, 0x010000, 0, 0 },
1625 .gpiomute = 0x020000,
1628 .tuner_type = TUNER_PHILIPS_NTSC_M,
1629 .tuner_addr = ADDR_UNSET,
1634 .name =
"Osprey 100/150 (878)",
1638 .muxsel =
MUXSEL(3, 2, 0, 1),
1640 .tuner_type = TUNER_ABSENT,
1641 .tuner_addr = ADDR_UNSET,
1646 .name =
"Osprey 100/150 (848)",
1650 .muxsel =
MUXSEL(2, 3, 1),
1652 .tuner_type = TUNER_ABSENT,
1653 .tuner_addr = ADDR_UNSET,
1660 .name =
"Osprey 101 (848)",
1666 .tuner_type = TUNER_ABSENT,
1667 .tuner_addr = ADDR_UNSET,
1672 .name =
"Osprey 101/151",
1678 .tuner_type = TUNER_ABSENT,
1679 .tuner_addr = ADDR_UNSET,
1684 .name =
"Osprey 101/151 w/ svid",
1690 .tuner_type = TUNER_ABSENT,
1691 .tuner_addr = ADDR_UNSET,
1696 .name =
"Osprey 200/201/250/251",
1702 .tuner_type = TUNER_ABSENT,
1703 .tuner_addr = ADDR_UNSET,
1710 .name =
"Osprey 200/250",
1716 .tuner_type = TUNER_ABSENT,
1717 .tuner_addr = ADDR_UNSET,
1722 .name =
"Osprey 210/220/230",
1728 .tuner_type = TUNER_ABSENT,
1729 .tuner_addr = ADDR_UNSET,
1734 .name =
"Osprey 500",
1740 .tuner_type = TUNER_ABSENT,
1741 .tuner_addr = ADDR_UNSET,
1746 .name =
"Osprey 540",
1750 .tuner_type = TUNER_ABSENT,
1751 .tuner_addr = ADDR_UNSET,
1758 .name =
"Osprey 2000",
1764 .tuner_type = TUNER_ABSENT,
1765 .tuner_addr = ADDR_UNSET,
1771 .name =
"IDS Eagle",
1774 .tuner_type = TUNER_ABSENT,
1775 .tuner_addr = ADDR_UNSET,
1778 .muxsel =
MUXSEL(2, 2, 2, 2),
1779 .muxsel_hook = eagle_muxsel,
1784 .name =
"Pinnacle PCTV Sat",
1788 .tuner_type = TUNER_ABSENT,
1789 .tuner_addr = ADDR_UNSET,
1798 .name =
"Formac ProTV II (bt878)",
1804 .muxsel =
MUXSEL(2, 3, 1, 1),
1805 .gpiomux = { 2, 2, 0, 0 },
1808 .tuner_type = TUNER_PHILIPS_PAL,
1809 .tuner_addr = ADDR_UNSET,
1826 .muxsel =
MUXSEL(2, 3, 1, 1),
1827 .gpiomux = { 0, 1, 2, 3},
1829 .tuner_type = TUNER_PHILIPS_PAL,
1830 .tuner_addr = ADDR_UNSET,
1834 .name =
"Euresys Picolo",
1841 .muxsel =
MUXSEL(2, 0, 1),
1843 .tuner_type = TUNER_ABSENT,
1844 .tuner_addr = ADDR_UNSET,
1848 .name =
"ProVideo PV150",
1857 .tuner_type = TUNER_ABSENT,
1858 .tuner_addr = ADDR_UNSET,
1863 .name =
"AD-TVK503",
1867 .gpiomask = 0x001e8007,
1868 .muxsel =
MUXSEL(2, 3, 1, 0),
1870 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1874 .tuner_type = TUNER_PHILIPS_NTSC,
1875 .tuner_addr = ADDR_UNSET,
1881 .name =
"Hercules Smart TV Stereo",
1886 .muxsel =
MUXSEL(2, 3, 1, 1),
1889 .tuner_type = TUNER_PHILIPS_PAL,
1890 .tuner_addr = ADDR_UNSET,
1902 .name =
"Pace TV & Radio Card",
1907 .muxsel =
MUXSEL(2, 3, 1, 1),
1910 .tuner_type = TUNER_PHILIPS_PAL_I,
1911 .tuner_addr = ADDR_UNSET,
1926 .tuner_type = TUNER_ABSENT,
1927 .tuner_addr = ADDR_UNSET,
1934 .name =
"IVCE-8784",
1937 .tuner_type = TUNER_ABSENT,
1938 .tuner_addr = ADDR_UNSET,
1945 .name =
"Grand X-Guard / Trust 814PCI",
1949 .tuner_type = TUNER_ABSENT,
1950 .tuner_addr = ADDR_UNSET,
1952 .muxsel =
MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
1953 .muxsel_hook = xguard_muxsel,
1961 .name =
"Nebula Electronics DigiTV",
1964 .muxsel =
MUXSEL(2, 3, 1, 0),
1968 .tuner_type = TUNER_ABSENT,
1969 .tuner_addr = ADDR_UNSET,
1977 .name =
"ProVideo PV143",
1982 .muxsel =
MUXSEL(2, 3, 1, 0),
1986 .tuner_type = TUNER_ABSENT,
1987 .tuner_addr = ADDR_UNSET,
1991 .name =
"PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
1996 .muxsel =
MUXSEL(2, 3, 1, 0),
1997 .gpiomux = { 0, 0, 0, 0 },
1999 .tuner_type = TUNER_ABSENT,
2000 .tuner_addr = ADDR_UNSET,
2003 .name =
"PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2008 .muxsel =
MUXSEL(2, 3, 1, 1),
2009 .gpiomux = { 0, 0, 0, 0 },
2011 .tuner_type = TUNER_ABSENT,
2012 .tuner_addr = ADDR_UNSET,
2017 .name =
"PHYTEC VD-009 MiniDIN (bt878)",
2023 .muxsel =
MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2024 .muxsel_hook = phytec_muxsel,
2025 .gpiomux = { 0, 0, 0, 0 },
2027 .tuner_type = TUNER_ABSENT,
2028 .tuner_addr = ADDR_UNSET,
2031 .name =
"PHYTEC VD-009 Combi (bt878)",
2037 .muxsel =
MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2038 .muxsel_hook = phytec_muxsel,
2039 .gpiomux = { 0, 0, 0, 0 },
2041 .tuner_type = TUNER_ABSENT,
2042 .tuner_addr = ADDR_UNSET,
2048 .tuner_type = TUNER_ABSENT,
2049 .tuner_addr = ADDR_UNSET,
2052 .muxsel =
MUXSEL(2, 3, 1, 0),
2060 .tuner_type = TUNER_ABSENT,
2061 .tuner_addr = ADDR_UNSET,
2066 .muxsel =
MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2067 .muxsel_hook = ivc120_muxsel,
2073 .name =
"pcHDTV HD-2000 TV",
2077 .muxsel =
MUXSEL(2, 3, 1, 0),
2078 .tuner_type = TUNER_PHILIPS_FCV1236D,
2079 .tuner_addr = ADDR_UNSET,
2083 .name =
"Twinhan DST + clones",
2086 .tuner_type = TUNER_ABSENT,
2087 .tuner_addr = ADDR_UNSET,
2092 .name =
"Winfast VC100",
2097 .muxsel =
MUXSEL(3, 1, 1, 3),
2100 .tuner_type = TUNER_ABSENT,
2101 .tuner_addr = ADDR_UNSET,
2105 .name =
"Teppro TEV-560/InterVision IV-560",
2110 .muxsel =
MUXSEL(2, 3, 1, 1),
2111 .gpiomux = { 1, 1, 1, 1 },
2112 .tuner_type = TUNER_PHILIPS_PAL,
2113 .tuner_addr = ADDR_UNSET,
2119 .name =
"SIMUS GVC1100",
2123 .tuner_type = TUNER_ABSENT,
2124 .tuner_addr = ADDR_UNSET,
2126 .muxsel =
MUXSEL(2, 2, 2, 2),
2128 .muxsel_hook = gvc1100_muxsel,
2132 .name =
"NGS NGSTV+",
2135 .gpiomask = 0x008007,
2136 .muxsel =
MUXSEL(2, 3, 0, 0),
2137 .gpiomux = { 0, 0, 0, 0 },
2138 .gpiomute = 0x000003,
2140 .tuner_type = TUNER_PHILIPS_PAL,
2141 .tuner_addr = ADDR_UNSET,
2150 .muxsel =
MUXSEL(2, 3, 1, 0),
2153 .tuner_type = TUNER_ABSENT,
2154 .tuner_addr = ADDR_UNSET,
2158 .name =
"Tekram M205 PRO",
2161 .tuner_type = TUNER_PHILIPS_PAL,
2162 .tuner_addr = ADDR_UNSET,
2165 .muxsel =
MUXSEL(2, 3, 1),
2166 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2174 .name =
"Conceptronic CONTVFMi",
2178 .gpiomask = 0x008007,
2179 .muxsel =
MUXSEL(2, 3, 1, 1),
2180 .gpiomux = { 0, 1, 2, 2 },
2183 .tuner_type = TUNER_PHILIPS_PAL,
2184 .tuner_addr = ADDR_UNSET,
2193 .name =
"Euresys Picolo Tetra",
2198 .gpiomask2 = 0x3C<<16,
2202 .muxsel =
MUXSEL(2, 2, 2, 2),
2203 .gpiomux = { 0, 0, 0, 0 },
2205 .muxsel_hook = picolo_tetra_muxsel,
2206 .tuner_type = TUNER_ABSENT,
2207 .tuner_addr = ADDR_UNSET,
2212 .name =
"Spirit TV Tuner",
2216 .gpiomask = 0x0000000f,
2217 .muxsel =
MUXSEL(2, 1, 1),
2218 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2219 .tuner_type = TUNER_TEMIC_PAL,
2220 .tuner_addr = ADDR_UNSET,
2225 .name =
"AVerMedia AVerTV DVB-T 771",
2228 .tuner_type = TUNER_ABSENT,
2229 .tuner_addr = ADDR_UNSET,
2242 .name =
"AverMedia AverTV DVB-T 761",
2245 .muxsel =
MUXSEL(3, 1, 2, 0),
2249 .tuner_type = TUNER_ABSENT,
2250 .tuner_addr = ADDR_UNSET,
2257 .name =
"MATRIX Vision Sigma-SQ",
2262 .muxsel =
MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
2263 .muxsel_hook = sigmaSQ_muxsel,
2267 .tuner_type = TUNER_ABSENT,
2268 .tuner_addr = ADDR_UNSET,
2272 .name =
"MATRIX Vision Sigma-SLC",
2277 .muxsel =
MUXSEL(2, 2, 2, 2),
2278 .muxsel_hook = sigmaSLC_muxsel,
2282 .tuner_type = TUNER_ABSENT,
2283 .tuner_addr = ADDR_UNSET,
2289 .name =
"APAC Viewcomp 878(AMAX)",
2294 .muxsel =
MUXSEL(2, 3, 1, 1),
2295 .gpiomux = { 2, 0, 0, 0 },
2298 .tuner_type = TUNER_PHILIPS_PAL,
2299 .tuner_addr = ADDR_UNSET,
2307 .name =
"DViCO FusionHDTV DVB-T Lite",
2313 .tuner_type = TUNER_ABSENT,
2314 .tuner_addr = ADDR_UNSET,
2318 .name =
"V-Gear MyVCD",
2323 .muxsel =
MUXSEL(2, 3, 1, 0),
2324 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2328 .tuner_type = TUNER_PHILIPS_NTSC_M,
2329 .tuner_addr = ADDR_UNSET,
2334 .name =
"Super TV Tuner",
2338 .muxsel =
MUXSEL(2, 3, 1, 0),
2339 .tuner_type = TUNER_PHILIPS_NTSC,
2340 .tuner_addr = ADDR_UNSET,
2341 .gpiomask = 0x008007,
2342 .gpiomux = { 0, 0x000001,0,0 },
2347 .name =
"Tibet Systems 'Progress DVR' CS16",
2351 .muxsel =
MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2355 .tuner_type = TUNER_ABSENT,
2356 .tuner_addr = ADDR_UNSET,
2357 .muxsel_hook = tibetCS16_muxsel,
2371 .name =
"Kodicom 4400R (master)",
2374 .tuner_type = TUNER_ABSENT,
2375 .tuner_addr = ADDR_UNSET,
2385 .gpiomask = 0x0003ff,
2387 .muxsel =
MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2391 .muxsel_hook = kodicom4400r_muxsel,
2400 .name =
"Kodicom 4400R (slave)",
2403 .tuner_type = TUNER_ABSENT,
2404 .tuner_addr = ADDR_UNSET,
2406 .gpiomask = 0x010000,
2408 .muxsel =
MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2412 .muxsel_hook = kodicom4400r_muxsel,
2418 .name =
"Adlink RTV24",
2422 .muxsel =
MUXSEL(2, 3, 1, 0),
2423 .tuner_type =
UNSET,
2424 .tuner_addr = ADDR_UNSET,
2430 .name =
"DViCO FusionHDTV 5 Lite",
2431 .tuner_type = TUNER_LG_TDVS_H06XF,
2432 .tuner_addr = ADDR_UNSET,
2436 .muxsel =
MUXSEL(2, 3, 1),
2437 .gpiomask = 0x00e00007,
2438 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2439 .gpiomute = 0x00c00007,
2447 .name =
"Acorp Y878F",
2451 .gpiomask = 0x01fe00,
2452 .muxsel =
MUXSEL(2, 3, 1, 1),
2453 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2454 .gpiomute = 0x002000,
2456 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2457 .tuner_addr = 0xc1 >>1,
2462 .name =
"Conceptronic CTVFMi v2",
2466 .gpiomask = 0x001c0007,
2467 .muxsel =
MUXSEL(2, 3, 1, 1),
2468 .gpiomux = { 0, 1, 2, 2 },
2471 .tuner_type = TUNER_TENA_9533_DI,
2472 .tuner_addr = ADDR_UNSET,
2478 .name =
"Prolink Pixelview PV-BT878P+ (Rev.2E)",
2483 .gpiomask = 0x01fe00,
2484 .muxsel =
MUXSEL(2, 3, 1, 1, 0),
2486 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2487 .gpiomute = 0x12400,
2490 .tuner_type = TUNER_LG_PAL_FM,
2491 .tuner_addr = ADDR_UNSET,
2497 .name =
"Prolink PixelView PlayTV MPEG2 PV-M4900",
2502 .muxsel =
MUXSEL(2, 3, 1, 1),
2503 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2507 .tuner_type = TUNER_YMEC_TVF_5533MF,
2508 .tuner_addr = ADDR_UNSET,
2526 .name =
"Osprey 440",
2530 .muxsel =
MUXSEL(2, 3, 0, 1),
2533 .gpiomux = { 0, 0, 0x000, 0x100},
2535 .tuner_type = TUNER_ABSENT,
2536 .tuner_addr = ADDR_UNSET,
2542 .name =
"Asound Skyeye PCTV",
2547 .muxsel =
MUXSEL(2, 3, 1, 1),
2548 .gpiomux = { 2, 0, 0, 0 },
2551 .tuner_type = TUNER_PHILIPS_NTSC,
2552 .tuner_addr = ADDR_UNSET,
2556 .name =
"Sabrent TV-FM (bttv version)",
2560 .gpiomask = 0x108007,
2561 .muxsel =
MUXSEL(2, 3, 1, 1),
2562 .gpiomux = { 100000, 100002, 100002, 100000 },
2566 .tuner_type = TUNER_TNF_5335MF,
2567 .tuner_addr = ADDR_UNSET,
2572 .name =
"Hauppauge ImpactVCB (bt878)",
2577 .muxsel =
MUXSEL(0, 1, 3, 2),
2580 .tuner_type = TUNER_ABSENT,
2581 .tuner_addr = ADDR_UNSET,
2596 .muxsel =
MUXSEL(2, 3, 1, 1),
2597 .gpiomux = { 0, 1, 2, 3 },
2599 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2600 .tuner_addr = ADDR_UNSET,
2606 .name =
"SSAI Security Video Interface",
2610 .muxsel =
MUXSEL(0, 1, 2, 3),
2611 .tuner_type = TUNER_ABSENT,
2612 .tuner_addr = ADDR_UNSET,
2615 .name =
"SSAI Ultrasound Video Interface",
2619 .muxsel =
MUXSEL(2, 0, 1, 3),
2620 .tuner_type = TUNER_ABSENT,
2621 .tuner_addr = ADDR_UNSET,
2625 .name =
"DViCO FusionHDTV 2",
2626 .tuner_type = TUNER_PHILIPS_FCV1236D,
2627 .tuner_addr = ADDR_UNSET,
2631 .muxsel =
MUXSEL(2, 3, 1),
2632 .gpiomask = 0x00e00007,
2633 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2634 .gpiomute = 0x00c00007,
2640 .name =
"Typhoon TV-Tuner PCI (50684)",
2644 .gpiomask = 0x3014f,
2645 .muxsel =
MUXSEL(2, 3, 1, 1),
2646 .gpiomux = { 0x20001,0x10001, 0, 0 },
2649 .tuner_type = TUNER_PHILIPS_PAL_I,
2650 .tuner_addr = ADDR_UNSET,
2654 .name =
"Geovision GV-600",
2659 .muxsel =
MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2660 .muxsel_hook = geovision_muxsel,
2664 .tuner_type = TUNER_ABSENT,
2665 .tuner_addr = ADDR_UNSET,
2671 .name =
"Kozumi KTV-01C",
2675 .gpiomask = 0x008007,
2676 .muxsel =
MUXSEL(2, 3, 1, 1),
2677 .gpiomux = { 0, 1, 2, 2 },
2679 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2680 .tuner_addr = ADDR_UNSET,
2688 .name =
"Encore ENL TV-FM-2",
2698 .gpiomask = 0x060040,
2699 .muxsel =
MUXSEL(2, 3, 3),
2700 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2702 .tuner_type = TUNER_TCL_MF02GIP_5N,
2703 .tuner_addr = ADDR_UNSET,
2710 .name =
"PHYTEC VD-012 (bt878)",
2715 .muxsel =
MUXSEL(0, 2, 3, 1),
2716 .gpiomux = { 0, 0, 0, 0 },
2718 .tuner_type = TUNER_ABSENT,
2719 .tuner_addr = ADDR_UNSET,
2723 .name =
"PHYTEC VD-012-X1 (bt878)",
2728 .muxsel =
MUXSEL(2, 3, 1),
2729 .gpiomux = { 0, 0, 0, 0 },
2731 .tuner_type = TUNER_ABSENT,
2732 .tuner_addr = ADDR_UNSET,
2736 .name =
"PHYTEC VD-012-X2 (bt878)",
2741 .muxsel =
MUXSEL(3, 2, 1),
2742 .gpiomux = { 0, 0, 0, 0 },
2744 .tuner_type = TUNER_ABSENT,
2745 .tuner_addr = ADDR_UNSET,
2760 .name =
"Geovision GV-800(S) (master)",
2763 .tuner_type = TUNER_ABSENT,
2764 .tuner_addr = ADDR_UNSET,
2766 .gpiomask = 0xf107f,
2768 .muxsel =
MUXSEL(2, 2, 2, 2),
2772 .muxsel_hook = gv800s_muxsel,
2784 .name =
"Geovision GV-800(S) (slave)",
2787 .tuner_type = TUNER_ABSENT,
2788 .tuner_addr = ADDR_UNSET,
2792 .muxsel =
MUXSEL(2, 2, 2, 2),
2796 .muxsel_hook = gv800s_muxsel,
2799 .name =
"ProVideo PV183",
2808 .tuner_type = TUNER_ABSENT,
2809 .tuner_addr = ADDR_UNSET,
2812 .name =
"Tongwei Video Technology TD-3116",
2814 .gpiomask = 0xc00ff,
2815 .muxsel =
MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2816 .muxsel_hook = td3116_muxsel,
2819 .tuner_type = TUNER_ABSENT,
2822 .name =
"Aposonic W-DVR",
2825 .muxsel =
MUXSEL(2, 3, 1, 0),
2826 .tuner_type = TUNER_ABSENT,
2831 static const unsigned int bttv_num_tvcards =
ARRAY_SIZE(bttv_tvcards);
2842 unsigned int gpiobits;
2846 btv->cardid = btv->c.pci->subsystem_device << 16;
2847 btv->cardid |= btv->c.pci->subsystem_vendor;
2849 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2851 for (type = -1, i = 0;
cards[
i].id != 0; i++)
2852 if (
cards[i].
id == btv->cardid)
2857 pr_info(
"%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2858 btv->c.nr,
cards[type].name,
cards[type].cardnr,
2859 btv->cardid & 0xffff,
2860 (btv->cardid >> 16) & 0xffff);
2864 pr_info(
"%d: subsystem: %04x:%04x (UNKNOWN)\n",
2865 btv->c.nr, btv->cardid & 0xffff,
2866 (btv->cardid >> 16) & 0xffff);
2872 if (
card[btv->c.nr] < bttv_num_tvcards)
2873 btv->c.type=
card[btv->c.nr];
2876 pr_info(
"%d: using: %s [card=%d,%s]\n",
2877 btv->c.nr, bttv_tvcards[btv->c.type].
name, btv->c.type,
2878 card[btv->c.nr] < bttv_num_tvcards
2879 ?
"insmod option" :
"autodetected");
2882 if (
UNSET == audioall &&
UNSET == audiomux[0])
2885 if (
UNSET != audiomux[0]) {
2888 bttv_tvcards[btv->c.type].
gpiomux[
i] = audiomux[
i];
2889 gpiobits |= audiomux[
i];
2892 gpiobits = audioall;
2894 bttv_tvcards[btv->c.type].
gpiomux[
i] = audioall;
2898 pr_info(
"%d: gpio config override: mask=0x%x, mux=",
2899 btv->c.nr, bttv_tvcards[btv->c.type].
gpiomask);
2902 i ?
"," :
"", bttv_tvcards[btv->c.type].
gpiomux[i]);
2912 static void identify_by_eeprom(
struct bttv *btv,
unsigned char eeprom_data[256])
2916 if (0 ==
strncmp(eeprom_data,
"GET MM20xPCTV",13))
2918 else if (0 ==
strncmp(eeprom_data+20,
"Picolo",7))
2920 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2925 pr_info(
"%d: detected by eeprom: %s [card=%d]\n",
2926 btv->c.nr, bttv_tvcards[btv->c.type].
name, btv->c.type);
2930 static void flyvideo_gpio(
struct bttv *btv)
2933 int is_lr90, has_tda9820_tda9821;
2952 ttype = (gpio & 0x0f0000) >> 16;
2970 pr_info(
"%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
2974 has_remote = gpio & 0x800000;
2975 has_radio = gpio & 0x400000;
2978 is_capture_only = !(gpio & 0x008000);
2979 has_tda9820_tda9821 = !(gpio & 0x004000);
2980 is_lr90 = !(gpio & 0x002000);
2984 if (is_capture_only)
2985 tuner_type = TUNER_ABSENT;
2987 pr_info(
"%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2988 btv->c.nr, has_radio ?
"yes" :
"no",
2989 has_remote ?
"yes" :
"no", tuner_type, gpio);
2990 pr_info(
"%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2991 btv->c.nr, is_lr90 ?
"yes" :
"no",
2992 has_tda9820_tda9821 ?
"yes" :
"no",
2993 is_capture_only ?
"yes" :
"no");
2995 if (tuner_type !=
UNSET)
3002 if (has_tda9820_tda9821)
3007 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3008 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3009 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3010 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3012 static void miro_pinnacle_gpio(
struct bttv *btv)
3019 id = ((gpio>>10) & 63) -1;
3022 btv->tuner_type = miro_tunermap[
id];
3023 if (0 == (gpio & 0x20)) {
3025 if (!miro_fmtuner[
id]) {
3026 btv->has_matchbox = 1;
3027 btv->mbox_we = (1<<6);
3028 btv->mbox_most = (1<<7);
3029 btv->mbox_clk = (1<<8);
3030 btv->mbox_data = (1<<9);
3031 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3042 pr_info(
"%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3043 btv->c.nr,
id+1, btv->tuner_type,
3044 !btv->has_radio ?
"no" :
3045 (btv->has_matchbox ?
"matchbox" :
"fmtuner"),
3046 (-1 == msp) ?
"no" :
"yes");
3053 info =
"PAL / mono";
3054 btv->tda9887_conf = TDA9887_INTERCARRIER;
3057 info =
"PAL+SECAM / stereo";
3059 btv->tda9887_conf = TDA9887_QSS;
3062 info =
"NTSC / stereo";
3064 btv->tda9887_conf = TDA9887_QSS;
3067 info =
"PAL+SECAM / mono";
3068 btv->tda9887_conf = TDA9887_QSS;
3071 info =
"NTSC / mono";
3072 btv->tda9887_conf = TDA9887_INTERCARRIER;
3075 info =
"NTSC / stereo";
3076 btv->tda9887_conf = TDA9887_INTERCARRIER;
3079 info =
"PAL / stereo";
3080 btv->tda9887_conf = TDA9887_INTERCARRIER;
3083 info =
"oops: unknown card";
3088 pr_info(
"%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3089 btv->c.nr,
id, info, btv->has_radio ?
"yes" :
"no");
3090 btv->tuner_type = TUNER_MT2032;
3095 #define LM1882_SYNC_DRIVE 0x200000L
3097 static void init_ids_eagle(
struct bttv *btv)
3115 static void eagle_muxsel(
struct bttv *btv,
unsigned int input)
3130 static void gvc1100_muxsel(
struct bttv *btv,
unsigned int input)
3132 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3149 static void init_lmlbt4x(
struct bttv *btv)
3157 static void sigmaSQ_muxsel(
struct bttv *btv,
unsigned int input)
3159 unsigned int inmux = input % 8;
3164 static void sigmaSLC_muxsel(
struct bttv *btv,
unsigned int input)
3166 unsigned int inmux = input % 4;
3171 static void geovision_muxsel(
struct bttv *btv,
unsigned int input)
3173 unsigned int inmux = input % 16;
3188 static void td3116_latch_value(
struct bttv *btv,
u32 value)
3191 gpio_bits((1<<18) | 0xff, (1<<18) | value);
3196 static void td3116_muxsel(
struct bttv *btv,
unsigned int input)
3201 highbit = (input & 0x8) >> 3 ;
3205 value |= ((input & 0x7) << 1) << (4 * highbit);
3206 td3116_latch_value(btv, value);
3210 value |= ((highbit ^ 0x1) << 4) | highbit;
3211 td3116_latch_value(btv, value);
3216 static void bttv_reset_audio(
struct bttv *btv)
3231 pr_debug(
"%d: BT878A ARESET\n", btv->c.nr);
3240 switch (btv->c.type) {
3243 boot_msp34xx(btv,5);
3247 boot_msp34xx(btv,20);
3250 boot_msp34xx(btv,11);
3258 btv->use_i2c_hw = 1;
3265 if (!bttv_tvcards[btv->c.type].
has_dvb)
3266 bttv_reset_audio(btv);
3272 btv->tuner_type =
UNSET;
3276 identify_by_eeprom(btv,eeprom_data);
3279 switch (btv->c.type) {
3285 miro_pinnacle_gpio(btv);
3305 hauppauge_eeprom(btv);
3310 avermedia_eeprom(btv);
3316 picolo_tetra_init(btv);
3320 btv->has_matchbox = 1;
3321 btv->mbox_we = 0x20;
3323 btv->mbox_clk = 0x08;
3324 btv->mbox_data = 0x10;
3325 btv->mbox_mask = 0x38;
3329 terratec_active_radio_upgrade(btv);
3332 if (btv->cardid == 0x3002144f) {
3334 pr_info(
"%d: radio detected by subsystem id (CPH05x)\n",
3339 if (btv->cardid == 0x3060121a) {
3343 btv->tuner_type=TUNER_TEMIC_NTSC;
3359 osprey_eeprom(btv, eeprom_data);
3362 init_ids_eagle(btv);
3372 tibetCS16_init(btv);
3375 kodicom4400r_init(btv);
3383 if (!(btv->id==848 && btv->revision==0x11)) {
3385 if (
PLL_28 == bttv_tvcards[btv->c.type].
pll) {
3386 btv->pll.pll_ifreq=28636363;
3389 if (
PLL_35 == bttv_tvcards[btv->c.type].
pll) {
3390 btv->pll.pll_ifreq=35468950;
3394 switch (pll[btv->c.nr]) {
3396 btv->pll.pll_crystal = 0;
3397 btv->pll.pll_ifreq = 0;
3398 btv->pll.pll_ofreq = 0;
3402 btv->pll.pll_ifreq = 28636363;
3403 btv->pll.pll_ofreq = 0;
3408 btv->pll.pll_ifreq = 35468950;
3409 btv->pll.pll_ofreq = 0;
3414 btv->pll.pll_current = -1;
3418 if (
UNSET == btv->tuner_type)
3419 btv->tuner_type = bttv_tvcards[btv->c.type].
tuner_type;
3420 if (
UNSET != tuner[btv->c.nr])
3421 btv->tuner_type = tuner[btv->c.nr];
3423 if (btv->tuner_type == TUNER_ABSENT)
3424 pr_info(
"%d: tuner absent\n", btv->c.nr);
3425 else if (btv->tuner_type ==
UNSET)
3426 pr_warn(
"%d: tuner type unset\n", btv->c.nr);
3428 pr_info(
"%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3430 if (autoload !=
UNSET) {
3431 pr_warn(
"%d: the autoload option is obsolete\n", btv->c.nr);
3432 pr_warn(
"%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3436 if (
UNSET == btv->tuner_type)
3437 btv->tuner_type = TUNER_ABSENT;
3439 btv->dig = bttv_tvcards[btv->c.type].
has_dig_in ?
3441 btv->svhs = bttv_tvcards[btv->c.type].
svhs ==
NO_SVHS ?
3443 if (svhs[btv->c.nr] !=
UNSET)
3444 btv->svhs = svhs[btv->c.nr];
3445 if (remote[btv->c.nr] !=
UNSET)
3446 btv->has_remote = remote[btv->c.nr];
3448 if (bttv_tvcards[btv->c.type].
has_radio)
3451 btv->has_remote = 1;
3455 btv->volume_gpio = bttv_tvcards[btv->c.type].
volume_gpio;
3459 if (btv->tuner_type == TUNER_ABSENT)
3462 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3464 static const unsigned short addrs[] = {
3472 &btv->c.i2c_adap,
"saa6588", 0, addrs);
3473 btv->has_saa6588 = (sd !=
NULL);
3481 switch (audiodev[btv->c.nr]) {
3490 static const unsigned short addrs[] = {
3497 &btv->c.i2c_adap,
"msp3400", 0, addrs);
3498 if (btv->sd_msp34xx)
3505 static const unsigned short addrs[] = {
3511 &btv->c.i2c_adap,
"tda7432", 0, addrs))
3519 &btv->c.i2c_adap,
"tvaudio", 0, tvaudio_addrs());
3520 if (btv->sd_tvaudio)
3526 pr_warn(
"%d: unknown audiodev value!\n", btv->c.nr);
3538 &btv->c.i2c_adap,
"msp3400",
3540 }
else if (bttv_tvcards[btv->c.type].
msp34xx_alt) {
3542 &btv->c.i2c_adap,
"msp3400",
3547 if (btv->sd_msp34xx)
3552 static const unsigned short addrs[] = {
3558 &btv->c.i2c_adap,
"tda7432", 0, addrs))
3564 &btv->c.i2c_adap,
"tvaudio", 0, tvaudio_addrs());
3565 if (btv->sd_tvaudio)
3569 pr_warn(
"%d: audio absent, no audio device found!\n", btv->c.nr);
3576 int addr = ADDR_UNSET;
3578 if (ADDR_UNSET != bttv_tvcards[btv->c.type].
tuner_addr)
3581 if (btv->tuner_type != TUNER_ABSENT) {
3582 struct tuner_setup tun_setup;
3587 &btv->c.i2c_adap,
"tuner",
3590 &btv->c.i2c_adap,
"tuner",
3593 &btv->c.i2c_adap,
"tuner",
3596 tun_setup.mode_mask = T_ANALOG_TV;
3597 tun_setup.type = btv->tuner_type;
3598 tun_setup.addr =
addr;
3601 tun_setup.mode_mask |= T_RADIO;
3606 if (btv->tda9887_conf) {
3609 tda9887_cfg.
tuner = TUNER_TDA9887;
3610 tda9887_cfg.
priv = &btv->tda9887_conf;
3618 static void modtec_eeprom(
struct bttv *btv)
3620 if(
strncmp(&(eeprom_data[0x1e]),
"Temic 4066 FY5",14) ==0) {
3621 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3622 pr_info(
"%d: Modtec: Tuner autodetected by eeprom: %s\n",
3623 btv->c.nr, &eeprom_data[0x1e]);
3624 }
else if (
strncmp(&(eeprom_data[0x1e]),
"Alps TSBB5",10) ==0) {
3625 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3626 pr_info(
"%d: Modtec: Tuner autodetected by eeprom: %s\n",
3627 btv->c.nr, &eeprom_data[0x1e]);
3628 }
else if (
strncmp(&(eeprom_data[0x1e]),
"Philips FM1246",14) ==0) {
3629 btv->tuner_type=TUNER_PHILIPS_NTSC;
3630 pr_info(
"%d: Modtec: Tuner autodetected by eeprom: %s\n",
3631 btv->c.nr, &eeprom_data[0x1e]);
3633 pr_info(
"%d: Modtec: Unknown TunerString: %s\n",
3634 btv->c.nr, &eeprom_data[0x1e]);
3638 static void __devinit hauppauge_eeprom(
struct bttv *btv)
3643 btv->tuner_type = tv.tuner_type;
3644 btv->has_radio = tv.has_radio;
3646 pr_info(
"%d: Hauppauge eeprom indicates model#%d\n",
3647 btv->c.nr, tv.model);
3653 if(tv.model == 64900) {
3654 pr_info(
"%d: Switching board type from %s to %s\n",
3656 bttv_tvcards[btv->c.type].
name,
3662 if (tv.model == 61334)
3663 btv->radio_uses_msp_demodulator = 1;
3666 static int terratec_active_radio_upgrade(
struct bttv *btv)
3671 btv->has_matchbox = 1;
3672 btv->mbox_we = 0x10;
3673 btv->mbox_most = 0x20;
3674 btv->mbox_clk = 0x08;
3675 btv->mbox_data = 0x04;
3676 btv->mbox_mask = 0x3c;
3678 btv->mbox_iow = 1 << 8;
3679 btv->mbox_ior = 1 << 9;
3680 btv->mbox_csel = 1 << 10;
3683 tea5757_write(btv, 5 * freq + 0x358);
3684 if (0x1ed8 == tea5757_read(btv)) {
3685 pr_info(
"%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3687 btv->has_saa6588 = 1;
3688 btv->has_matchbox = 1;
3691 btv->has_matchbox = 0;
3706 #define PVR_GPIO_DELAY 10
3708 #define BTTV_ALT_DATA 0x000001
3709 #define BTTV_ALT_DCLK 0x100000
3710 #define BTTV_ALT_NCONFIG 0x800000
3712 static int __devinit pvr_altera_load(
struct bttv *btv,
const u8 *micro,
3726 for (n = 0; n < microlen; n++) {
3728 for (i = 0 ; i < 8 ; i++) {
3742 for (i = 0 ; i < 30 ; i++) {
3750 static int __devinit pvr_boot(
struct bttv *btv)
3757 pr_warn(
"%d: no altera firmware [via hotplug]\n", btv->c.nr);
3760 rc = pvr_altera_load(btv, fw_entry->
data, fw_entry->
size);
3761 pr_info(
"%d: altera firmware upload %s\n",
3762 btv->c.nr, (rc < 0) ?
"failed" :
"ok");
3770 static void __devinit osprey_eeprom(
struct bttv *btv,
const u8 ee[256])
3779 if (!
strncmp(ee,
"MMAC", 4)) {
3781 for (i = 0; i < 21; i++)
3783 if (checksum != ee[21])
3786 for (i = 12; i < 21; i++)
3787 serial *= 10, serial += ee[i] -
'0';
3790 unsigned short type;
3792 for (i = 4*16; i < 8*16; i += 16) {
3795 if ((checksum&0xff) + (checksum>>8) == 0xff)
3803 type = get_unaligned_be16((
__be16 *)(ee+4));
3858 pr_info(
"%d: osprey eeprom: unknown card type 0x%04x\n",
3865 pr_info(
"%d: osprey eeprom: card=%d '%s' serial=%u\n",
3867 cardid > 0 ? bttv_tvcards[cardid].
name :
"Unknown", serial);
3869 if (cardid<0 || btv->
c.type == cardid)
3873 if (
card[btv->c.nr] < bttv_num_tvcards) {
3874 pr_warn(
"%d: osprey eeprom: Not overriding user specified card type\n",
3877 pr_info(
"%d: osprey eeprom: Changing card type from %d to %d\n",
3878 btv->c.nr, btv->c.type, cardid);
3879 btv->c.type = cardid;
3886 static int tuner_0_table[] = {
3887 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL ,
3888 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL ,
3889 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3890 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3891 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3892 TUNER_PHILIPS_FM1216ME_MK3 };
3894 static int tuner_1_table[] = {
3895 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3896 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3897 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5,
3899 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3901 static void __devinit avermedia_eeprom(
struct bttv *btv)
3903 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3905 tuner_make = (eeprom_data[0x41] & 0x7);
3906 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3907 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3908 btv->has_remote = (eeprom_data[0x42] & 0x01);
3910 if (tuner_make == 0 || tuner_make == 2)
3911 if (tuner_format <= 0x0a)
3912 tuner_type = tuner_0_table[tuner_format];
3913 if (tuner_make == 1)
3914 if (tuner_format <= 9)
3915 tuner_type = tuner_1_table[tuner_format];
3917 if (tuner_make == 4)
3918 if (tuner_format == 0x09)
3919 tuner_type = TUNER_LG_NTSC_NEW_TAPC;
3921 pr_info(
"%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3922 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3924 btv->tuner_type = tuner_type;
3928 pr_cont(
" radio:%s remote control:%s\n",
3929 tuner_tv_fm ?
"yes" :
"no",
3930 btv->has_remote ?
"yes" :
"no");
3946 gpiobits |= 0x10000;
3948 gpiobits &= ~0x10000;
3963 static void __devinit boot_msp34xx(
struct bttv *btv,
int pin)
3976 pr_info(
"%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
3986 static void __devinit init_PXC200(
struct bttv *btv)
3988 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3989 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
4017 pr_info(
"Setting DAC reference voltage level ...\n");
4026 pr_info(
"Initialising 12C508 PIC chip ...\n");
4045 pr_info(
"I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4050 pr_info(
"PXC200 Initialised\n");
4084 init_RTV24 (
struct bttv *btv)
4087 long watchdog_value = 0x0E;
4089 pr_info(
"%d: Adlink RTV-24 initialisation in progress ...\n",
4102 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4103 pr_info(
"%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4104 btv->c.nr, dataRead);
4115 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4116 pr_info(
"%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4117 btv->c.nr, dataRead);
4122 pr_info(
"%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4136 static void bus_low(
struct bttv *btv,
int bit)
4138 if (btv->mbox_ior) {
4139 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4140 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4147 if (btv->mbox_ior) {
4148 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4153 static void bus_high(
struct bttv *btv,
int bit)
4155 if (btv->mbox_ior) {
4156 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4157 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4164 if (btv->mbox_ior) {
4165 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4170 static int bus_in(
struct bttv *btv,
int bit)
4172 if (btv->mbox_ior) {
4173 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4174 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4177 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4184 #define TEA_FREQ 0:14
4185 #define TEA_BUFFER 15:15
4187 #define TEA_SIGNAL_STRENGTH 16:17
4189 #define TEA_PORT1 18:18
4190 #define TEA_PORT0 19:19
4192 #define TEA_BAND 20:21
4193 #define TEA_BAND_FM 0
4194 #define TEA_BAND_MW 1
4195 #define TEA_BAND_LW 2
4196 #define TEA_BAND_SW 3
4198 #define TEA_MONO 22:22
4199 #define TEA_ALLOW_STEREO 0
4200 #define TEA_FORCE_MONO 1
4202 #define TEA_SEARCH_DIRECTION 23:23
4203 #define TEA_SEARCH_DOWN 0
4204 #define TEA_SEARCH_UP 1
4206 #define TEA_STATUS 24:24
4207 #define TEA_STATUS_TUNED 0
4208 #define TEA_STATUS_SEARCHING 1
4211 static int tea5757_read(
struct bttv *btv)
4218 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4220 if (btv->mbox_ior) {
4221 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4222 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4229 bus_low(btv,btv->mbox_we);
4230 bus_low(btv,btv->mbox_clk);
4238 if (bus_in(btv,btv->mbox_data)) {
4239 pr_warn(
"%d: tea5757: read timeout\n", btv->c.nr);
4243 dprintk(
"%d: tea5757:", btv->c.nr);
4244 for (i = 0; i < 24; i++) {
4246 bus_high(btv,btv->mbox_clk);
4249 bus_in(btv, btv->mbox_most) == 0 ?
'T' :
'-');
4250 bus_low(btv,btv->mbox_clk);
4252 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1;
4254 bus_in(btv, btv->mbox_most) == 0 ?
'S' :
'M');
4257 dprintk(
"%d: tea5757: read 0x%X\n", btv->c.nr, value);
4261 static int tea5757_write(
struct bttv *btv,
int value)
4266 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4268 if (btv->mbox_ior) {
4269 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4270 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4276 dprintk(
"%d: tea5757: write 0x%X\n", btv->c.nr, value);
4277 bus_low(btv,btv->mbox_clk);
4278 bus_high(btv,btv->mbox_we);
4279 for (i = 0; i < 25; i++) {
4280 if (reg & 0x1000000)
4281 bus_high(btv,btv->mbox_data);
4283 bus_low(btv,btv->mbox_data);
4285 bus_high(btv,btv->mbox_clk);
4287 bus_low(btv,btv->mbox_clk);
4290 bus_low(btv,btv->mbox_we);
4296 dprintk(
"tea5757_set_freq %d\n",freq);
4297 tea5757_write(btv, 5 * freq + 0x358);
4324 static void rv605_muxsel(
struct bttv *btv,
unsigned int input)
4326 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4327 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4372 static void tibetCS16_muxsel(
struct bttv *btv,
unsigned int input)
4378 static void tibetCS16_init(
struct bttv *btv)
4414 static void kodicom4400r_write(
struct bttv *btv,
4415 unsigned char xaddr,
4416 unsigned char yaddr,
4417 unsigned char data) {
4420 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4434 static void kodicom4400r_muxsel(
struct bttv *btv,
unsigned int input)
4439 static unsigned char map[4] = {3, 0, 2, 1};
4441 mctlr = master[btv->c.nr];
4442 if (mctlr ==
NULL) {
4445 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3;
4447 sw_status = (
char *)(&mctlr->mbox_we);
4448 xaddr = input & 0xf;
4450 if (sw_status[yaddr] != xaddr)
4453 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4454 sw_status[yaddr] = xaddr;
4455 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4465 static void kodicom4400r_init(
struct bttv *btv)
4467 char *sw_status = (
char *)(&btv->mbox_we);
4474 for (ix = 0; ix < 4; ix++) {
4476 kodicom4400r_write(btv, ix, ix, 1);
4483 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4485 master[btv->c.nr-1] = btv;
4486 master[btv->c.nr] = btv;
4487 master[btv->c.nr+1] = btv;
4488 master[btv->c.nr+2] = btv;
4509 static void xguard_muxsel(
struct bttv *btv,
unsigned int input)
4511 static const int masks[] = {
4519 static void picolo_tetra_init(
struct bttv *btv)
4525 static void picolo_tetra_muxsel (
struct bttv* btv,
unsigned int input)
4528 dprintk(
"%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4559 #define I2C_TDA8540 0x90
4560 #define I2C_TDA8540_ALT1 0x92
4561 #define I2C_TDA8540_ALT2 0x94
4562 #define I2C_TDA8540_ALT3 0x96
4563 #define I2C_TDA8540_ALT4 0x98
4564 #define I2C_TDA8540_ALT5 0x9a
4565 #define I2C_TDA8540_ALT6 0x9c
4567 static void ivc120_muxsel(
struct bttv *btv,
unsigned int input)
4570 int key = input % 4;
4571 int matrix = input / 4;
4573 dprintk(
"%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4574 btv->c.nr, input, matrix, key);
4578 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4580 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4582 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4584 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4588 ((matrix == 3) ? 0x03 : 0x00), 1);
4590 ((matrix == 0) ? 0x03 : 0x00), 1);
4592 ((matrix == 1) ? 0x03 : 0x00), 1);
4594 ((matrix == 2) ? 0x03 : 0x00), 1);
4611 #define PX_CFG_PXC200F 0x01
4612 #define PX_FLAG_PXC200A 0x00001000
4613 #define PX_I2C_PIC 0x0f
4614 #define PX_PXC200A_CARDID 0x200a1295
4615 #define PX_I2C_CMD_CFG 0x00
4617 static void PXC200_muxsel(
struct bttv *btv,
unsigned int input)
4622 unsigned char buf[2];
4630 pr_debug(
"%d: PXC200_muxsel: pic cfg write failed:%d\n",
4638 pr_debug(
"%d: PXC200_muxsel: not PXC200F rc:%d\n",
4662 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4664 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4679 pr_debug(
"%d: setting input channel to:%d\n", btv->c.nr, (
int)mux);
4682 static void phytec_muxsel(
struct bttv *btv,
unsigned int input)
4684 unsigned int mux = input % 4;
4686 if (input == btv->svhs)
4707 static void gv800s_write(
struct bttv *btv,
4708 unsigned char xaddr,
4709 unsigned char yaddr,
4710 unsigned char data) {
4720 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4721 const u32 CSELECT = 1<<16;
4749 static void gv800s_muxsel(
struct bttv *btv,
unsigned int input)
4754 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4755 { 0x1, 0x5, 0xb, 0x7 },
4756 { 0x2, 0x8, 0xc, 0xe },
4757 { 0x3, 0x9, 0xd, 0xf } };
4759 mctlr = master[btv->c.nr];
4760 if (mctlr ==
NULL) {
4764 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4765 sw_status = (
char *)(&mctlr->mbox_we);
4766 xaddr = map[yaddr][
input] & 0xf;
4769 if (sw_status[yaddr] != xaddr) {
4771 gv800s_write(mctlr, sw_status[yaddr], yaddr, 0);
4772 sw_status[yaddr] = xaddr;
4773 gv800s_write(mctlr, xaddr, yaddr, 1);
4778 static void gv800s_init(
struct bttv *btv)
4780 char *sw_status = (
char *)(&btv->mbox_we);
4788 for (ix = 0; ix < 4; ix++) {
4790 gv800s_write(btv, ix, ix, 1);
4796 if (btv->c.nr > BTTV_MAX-4)
4802 master[btv->c.nr] = btv;
4803 master[btv->c.nr+1] = btv;
4804 master[btv->c.nr+2] = btv;
4805 master[btv->c.nr+3] = btv;
4813 int pcipci_fail = 0;
4822 #ifdef PCIPCI_ALIMAGIK
4830 pr_info(
"Host bridge needs ETBF enabled\n");
4832 pr_info(
"Host bridge needs VSFX enabled\n");
4834 pr_info(
"bttv and your chipset may not work together\n");
4836 pr_info(
"overlay will be disabled\n");
4839 pr_info(
"overlay forced. Use this option at your own risk.\n");
4847 pci_read_config_byte(dev, 0x53, &b);
4849 pr_info(
"Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4863 pr_info(
"%d: enabling ETBF (430FX/VP3 compatibility)\n",
4865 if (vsfx && btv->id >= 878)
4866 pr_info(
"%d: enabling VSFX\n", btv->c.nr);
4868 pr_info(
"%d: setting pci timer to %d\n",
4872 if (btv->id < 878) {