2 $Id: bttv-cards.c,v 1.54 2005/07/19 18:26:46 mkrufky Exp $
6 this file has configuration informations - card-specific stuff
7 like the big tvcards array for the most part
9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
10 & Marcus Metzler (mocm@thp.uni-koeln.de)
11 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <linux/config.h>
30 #include <linux/delay.h>
31 #include <linux/module.h>
32 #include <linux/moduleparam.h>
33 #include <linux/kmod.h>
34 #include <linux/init.h>
35 #include <linux/pci.h>
36 #include <linux/vmalloc.h>
37 #include <linux/firmware.h>
44 static void boot_msp34xx(struct bttv *btv, int pin);
45 static void boot_bt832(struct bttv *btv);
46 static void hauppauge_eeprom(struct bttv *btv);
47 static void avermedia_eeprom(struct bttv *btv);
48 static void osprey_eeprom(struct bttv *btv);
49 static void modtec_eeprom(struct bttv *btv);
50 static void init_PXC200(struct bttv *btv);
51 static void init_RTV24(struct bttv *btv);
53 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
54 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
55 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
57 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
59 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
60 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
67 static void rv605_muxsel(struct bttv *btv, unsigned int input);
68 static void eagle_muxsel(struct bttv *btv, unsigned int input);
69 static void xguard_muxsel(struct bttv *btv, unsigned int input);
70 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
71 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
73 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
75 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
76 static void picolo_tetra_init(struct bttv *btv);
78 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
79 static void tibetCS16_init(struct bttv *btv);
81 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
82 static void kodicom4400r_init(struct bttv *btv);
84 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
85 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
87 static int terratec_active_radio_upgrade(struct bttv *btv);
88 static int tea5757_read(struct bttv *btv);
89 static int tea5757_write(struct bttv *btv, int value);
90 static void identify_by_eeprom(struct bttv *btv,
91 unsigned char eeprom_data[256]);
92 static int __devinit pvr_boot(struct bttv *btv);
94 /* config variables */
95 static unsigned int triton1=0;
96 static unsigned int vsfx=0;
97 static unsigned int latency = UNSET;
100 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
107 static unsigned int autoload = 1;
109 static unsigned int autoload = 0;
111 static unsigned int gpiomask = UNSET;
112 static unsigned int audioall = UNSET;
113 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
116 module_param(triton1, int, 0444);
117 module_param(vsfx, int, 0444);
118 module_param(no_overlay, int, 0444);
119 module_param(latency, int, 0444);
120 module_param(gpiomask, int, 0444);
121 module_param(audioall, int, 0444);
122 module_param(autoload, int, 0444);
124 module_param_array(card, int, NULL, 0444);
125 module_param_array(pll, int, NULL, 0444);
126 module_param_array(tuner, int, NULL, 0444);
127 module_param_array(svhs, int, NULL, 0444);
128 module_param_array(remote, int, NULL, 0444);
129 module_param_array(audiomux, int, NULL, 0444);
131 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
132 "[enable bug compatibility for triton1 + others]");
133 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
134 "[yet another chipset flaw workaround]");
135 MODULE_PARM_DESC(latency,"pci latency timer");
136 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
137 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138 MODULE_PARM_DESC(tuner,"specify installed tuner type");
139 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
141 /* ----------------------------------------------------------------------- */
142 /* list of card IDs for bt878+ cards */
148 } cards[] __devinitdata = {
149 { 0x13eb0070, BTTV_HAUPPAUGE878, "Hauppauge WinTV" },
150 { 0x39000070, BTTV_HAUPPAUGE878, "Hauppauge WinTV-D" },
151 { 0x45000070, BTTV_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
152 { 0xff000070, BTTV_OSPREY1x0, "Osprey-100" },
153 { 0xff010070, BTTV_OSPREY2x0_SVID,"Osprey-200" },
154 { 0xff020070, BTTV_OSPREY500, "Osprey-500" },
155 { 0xff030070, BTTV_OSPREY2000, "Osprey-2000" },
156 { 0xff040070, BTTV_OSPREY540, "Osprey-540" },
158 { 0x00011002, BTTV_ATI_TVWONDER, "ATI TV Wonder" },
159 { 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
161 { 0x6606107d, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
162 { 0x6607107d, BTTV_WINFASTVC100, "Leadtek WinFast VC 100" },
163 { 0x6609107d, BTTV_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
166 { 0x402010fc, BTTV_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
167 { 0x405010fc, BTTV_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169 { 0xd01810fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
171 { 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
172 // some cards ship with byteswapped IDs ...
173 { 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
174 { 0xff00bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
175 // this seems to happen as well ...
176 { 0xff1211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
178 { 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x263710b4, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
180 { 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" },
182 { 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
183 { 0xa005144f, BTTV_MAGICTVIEW063, "CPH06X TView99-Card" },
184 { 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
185 { 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
186 { 0x5000144f, BTTV_MAGICTVIEW061, "Askey CPH050" },
187 { 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
188 { 0x300214ff, BTTV_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
190 { 0x00011461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
191 { 0x00021461, BTTV_AVERMEDIA98, "AVermedia TVCapture 98" },
192 { 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00041461, BTTV_AVERMEDIA98, "AVerMedia TVCapture 98" },
194 { 0x03001461, BTTV_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
196 { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
197 { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
198 { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
199 { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
201 { 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" },
202 { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" },
203 // clashes with FlyVideo
204 //{ 0x18521852, BTTV_TERRATV, "Terratec TV+ (V1.10)" },
205 { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue (LR102)" },
206 { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // LR102
207 { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" }, // ??
208 { 0xff3b153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // ??
210 { 0x400015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
212 { 0x400d15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214 { 0x401615b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x1430aa00, BTTV_PV143, "Provideo PV143A" },
217 { 0x1431aa00, BTTV_PV143, "Provideo PV143B" },
218 { 0x1432aa00, BTTV_PV143, "Provideo PV143C" },
219 { 0x1433aa00, BTTV_PV143, "Provideo PV143D" },
220 { 0x1433aa03, BTTV_PV143, "Security Eyes" },
222 { 0x1460aa00, BTTV_PV150, "Provideo PV150A-1" },
223 { 0x1461aa01, BTTV_PV150, "Provideo PV150A-2" },
224 { 0x1462aa02, BTTV_PV150, "Provideo PV150A-3" },
225 { 0x1463aa03, BTTV_PV150, "Provideo PV150A-4" },
227 { 0x1464aa04, BTTV_PV150, "Provideo PV150B-1" },
228 { 0x1465aa05, BTTV_PV150, "Provideo PV150B-2" },
229 { 0x1466aa06, BTTV_PV150, "Provideo PV150B-3" },
230 { 0x1467aa07, BTTV_PV150, "Provideo PV150B-4" },
232 { 0xa132ff00, BTTV_IVC100, "IVC-100" },
233 { 0xa1550000, BTTV_IVC200, "IVC-200" },
234 { 0xa1550001, BTTV_IVC200, "IVC-200" },
235 { 0xa1550002, BTTV_IVC200, "IVC-200" },
236 { 0xa1550003, BTTV_IVC200, "IVC-200" },
237 { 0xa1550100, BTTV_IVC200, "IVC-200G" },
238 { 0xa1550101, BTTV_IVC200, "IVC-200G" },
239 { 0xa1550102, BTTV_IVC200, "IVC-200G" },
240 { 0xa1550103, BTTV_IVC200, "IVC-200G" },
241 { 0xa182ff00, BTTV_IVC120, "IVC-120G" },
242 { 0xa182ff01, BTTV_IVC120, "IVC-120G" },
243 { 0xa182ff02, BTTV_IVC120, "IVC-120G" },
244 { 0xa182ff03, BTTV_IVC120, "IVC-120G" },
245 { 0xa182ff04, BTTV_IVC120, "IVC-120G" },
246 { 0xa182ff05, BTTV_IVC120, "IVC-120G" },
247 { 0xa182ff06, BTTV_IVC120, "IVC-120G" },
248 { 0xa182ff07, BTTV_IVC120, "IVC-120G" },
249 { 0xa182ff08, BTTV_IVC120, "IVC-120G" },
250 { 0xa182ff09, BTTV_IVC120, "IVC-120G" },
251 { 0xa182ff0a, BTTV_IVC120, "IVC-120G" },
252 { 0xa182ff0b, BTTV_IVC120, "IVC-120G" },
253 { 0xa182ff0c, BTTV_IVC120, "IVC-120G" },
254 { 0xa182ff0d, BTTV_IVC120, "IVC-120G" },
255 { 0xa182ff0e, BTTV_IVC120, "IVC-120G" },
256 { 0xa182ff0f, BTTV_IVC120, "IVC-120G" },
258 { 0x41424344, BTTV_GRANDTEC, "GrandTec Multi Capture" },
259 { 0x01020304, BTTV_XGUARD, "Grandtec Grand X-Guard" },
261 { 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0xa0501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
263 { 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
264 { 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
265 { 0x41a0a051, BTTV_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
266 { 0x18501f7f, BTTV_FLYVIDEO_98, "Lifeview Flyvideo 98" },
268 { 0x010115cb, BTTV_GMV1, "AG GMV1" },
269 { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
271 { 0x10b42636, BTTV_HAUPPAUGE878, "STB ???" },
272 { 0x217d6606, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0xfff6f6ff, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
274 { 0x03116000, BTTV_SENSORAY311, "Sensoray 311" },
275 { 0x00790e11, BTTV_WINDVR, "Canopus WinDVR PCI" },
276 { 0xa0fca1a0, BTTV_ZOLTRIX, "Face to Face Tvmax" },
277 { 0x20007063, BTTV_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_PV951, "ituner spectra8" },
280 { 0x200a1295, BTTV_PXC200, "ImageNation PXC200A" },
282 { 0x40111554, BTTV_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_KWORLD, "Mecer TV/FM/Video Tuner" },
285 { 0x01051805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
286 { 0x01061805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
287 { 0x01071805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
288 { 0x01081805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
290 // likely broken, vendor id doesn't match the other magic views ...
291 //{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" },
293 // DVB cards (using pci function .1 for mpeg data xfer)
294 { 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
295 { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
296 { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
297 { 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
298 { 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB" },
299 { 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
300 { 0x07711461, BTTV_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
301 { 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DVICO FusionHDTV DVB-T Lite" },
306 /* ----------------------------------------------------------------------- */
307 /* array with description for bt848 / bt878 tv/grabber cards */
309 struct tvcard bttv_tvcards[] = {
311 /* ---- card 0x00 ---------------------------------- */
312 .name = " *** UNKNOWN/GENERIC *** ",
317 .muxsel = { 2, 3, 1, 0},
326 .muxsel = { 2, 3, 1, 1},
327 .audiomux = { 2, 0, 0, 0, 10},
331 .name = "Hauppauge (bt848)",
337 .muxsel = { 2, 3, 1, 1},
338 .audiomux = { 0, 1, 2, 3, 4},
342 .name = "STB, Gateway P/N 6000699 (bt848)",
348 .muxsel = { 2, 3, 1, 1},
349 .audiomux = { 4, 0, 2, 3, 1},
352 .tuner_type = TUNER_PHILIPS_NTSC,
357 /* ---- card 0x04 ---------------------------------- */
358 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
364 .muxsel = { 2, 3, 1, 1},
369 .name = "Diamond DTV2000",
375 .muxsel = { 2, 3, 1, 0},
376 .audiomux = { 0, 1, 0, 1, 3},
380 .name = "AVerMedia TVPhone",
385 .muxsel = { 2, 3, 1, 1},
387 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
388 /* 0x04 for some cards ?? */
391 .audio_hook = avermedia_tvphone_audio,
394 .name = "MATRIX-Vision MV-Delta",
400 .muxsel = { 2, 3, 1, 0, 0},
406 /* ---- card 0x08 ---------------------------------- */
407 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
413 .muxsel = { 2, 3, 1, 1},
414 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
419 .name = "IMS/IXmicro TurboTV",
425 .muxsel = { 2, 3, 1, 1},
426 .audiomux = { 1, 1, 2, 3, 0},
429 .tuner_type = TUNER_TEMIC_PAL,
431 .name = "Hauppauge (bt878)",
436 .gpiomask = 0x0f, /* old: 7 */
437 .muxsel = { 2, 0, 1, 1},
438 .audiomux = { 0, 1, 2, 3, 4},
443 .name = "MIRO PCTV pro",
449 .muxsel = { 2, 3, 1, 1},
450 .audiomux = { 0x20001,0x10001, 0, 0,10},
455 /* ---- card 0x0c ---------------------------------- */
456 .name = "ADS Technologies Channel Surfer TV (bt848)",
462 .muxsel = { 2, 3, 1, 1},
463 .audiomux = { 13, 14, 11, 7, 0, 0},
467 .name = "AVerMedia TVCapture 98",
473 .muxsel = { 2, 3, 1, 1},
474 .audiomux = { 13, 14, 11, 7, 0, 0},
478 .tuner_type = TUNER_PHILIPS_PAL,
479 .audio_hook = avermedia_tv_stereo_audio,
481 .name = "Aimslab Video Highway Xtreme (VHX)",
487 .muxsel = { 2, 3, 1, 1},
488 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
493 .name = "Zoltrix TV-Max",
499 .muxsel = { 2, 3, 1, 1},
500 .audiomux = {0 , 0, 1 , 0, 10},
505 /* ---- card 0x10 ---------------------------------- */
506 .name = "Prolink Pixelview PlayTV (bt878)",
511 .gpiomask = 0x01fe00,
512 .muxsel = { 2, 3, 1, 1},
513 // 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru>
514 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
519 .name = "Leadtek WinView 601",
524 .gpiomask = 0x8300f8,
525 .muxsel = { 2, 3, 1, 1,0},
526 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
529 .audio_hook = winview_audio,
532 .name = "AVEC Intercapture",
538 .muxsel = {2, 3, 1, 1},
539 .audiomux = {1, 0, 0, 0, 0},
543 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
548 .gpiomask = 0x8dff00,
549 .muxsel = { 2, 3, 1, 1},
555 /* ---- card 0x14 ---------------------------------- */
556 .name = "CEI Raffles Card",
561 .muxsel = {2, 3, 1, 1},
564 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
566 .audio_inputs = 2, // tuner, line in
570 .muxsel = { 2, 3, 1, 1},
571 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
573 .tuner_type = TUNER_PHILIPS_PAL_I,
575 .name = "Askey CPH050/ Phoebe Tv Master + FM",
581 .muxsel = { 2, 3, 1, 1},
582 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
587 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
593 .muxsel = { 2, 3, -1 },
594 .digital_mode = DIGITAL_MODE_CAMERA,
595 .audiomux = { 0, 0, 0, 0, 0 },
598 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
601 /* ---- card 0x18 ---------------------------------- */
602 .name = "Askey CPH05X/06X (bt878) [many vendors]",
608 .muxsel = { 2, 3, 1, 1},
609 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
615 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
620 .gpiomask = 0x1f0fff,
621 .muxsel = { 2, 3, 1, 1},
622 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
624 .tuner_type = TUNER_PHILIPS_PAL,
625 .audio_hook = terratv_audio,
627 .name = "Hauppauge WinCam newer (bt878)",
633 .muxsel = { 2, 0, 1, 1},
634 .audiomux = { 0, 1, 2, 3, 4},
638 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
644 .muxsel = { 2, 3, 1, 1},
645 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
647 .tuner_type = TUNER_PHILIPS_SECAM,
650 /* ---- card 0x1c ---------------------------------- */
651 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
656 .gpiomask = 0x1f0fff,
657 .muxsel = { 2, 3, 1, 1},
658 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
660 .tuner_type = TUNER_PHILIPS_PAL,
661 .audio_hook = terratv_audio,
663 External 20 pin connector (for Active Radio Upgrade board)
669 gpio05: om5610-stereo
673 gpio09+10: nIOR, nSEL ?? (bt878)
677 gpio16: u2-A0 (1st 4052bt)
680 gpio19: u4-A0 (2nd 4052)
684 00000 : Cdrom (internal audio input)
685 10000 : ext. Video audio input
694 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
695 .name = "Imagenation PXC200",
699 .svhs = 1, /* was: 4 */
701 .muxsel = { 2, 3, 1, 0, 0},
705 .muxsel_hook = PXC200_muxsel,
708 .name = "Lifeview FlyVideo 98 LR50",
713 .gpiomask = 0x1800, //0x8dfe00
714 .muxsel = { 2, 3, 1, 1},
715 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
719 .name = "Formac iProTV, Formac ProTV I (bt848)",
725 .muxsel = { 2, 3, 1, 1},
726 .audiomux = { 1, 0, 0, 0, 0 },
728 .tuner_type = TUNER_PHILIPS_PAL,
731 /* ---- card 0x20 ---------------------------------- */
732 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
738 .muxsel = { 2, 3, 1, 1},
743 .name = "Terratec TerraTValue Version Bt878",
748 .gpiomask = 0xffff00,
749 .muxsel = { 2, 3, 1, 1},
750 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
753 .tuner_type = TUNER_PHILIPS_PAL,
755 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
760 .muxsel = { 2, 3, 1, 1, 0}, // TV, CVid, SVid, CVid over SVid connector
761 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
762 .gpiomask = 0xb33000,
763 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
764 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
765 gpio23 -- hef4052:nEnable (0x800000)
768 0x0000: external audio
772 Note: There exists another variant "Winfast 2000" with tv stereo !?
773 Note: eeprom only contains FF and pci subsystem id 107d:6606
778 .tuner_type = 5, // default for now, gpio reads BFFF06 for Pal bg+dk
779 .audio_hook = winfast2000_audio,
782 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
788 .muxsel = { 2, 3, 1, 1},
789 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
794 /* ---- card 0x24 ---------------------------------- */
795 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
801 .muxsel = { 2, 3, 1, 1},
802 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
807 .name = "Prolink PixelView PlayTV pro",
813 .muxsel = { 2, 3, 1, 1 },
814 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
819 .name = "Askey CPH06X TView99",
824 .gpiomask = 0x551e00,
825 .muxsel = { 2, 3, 1, 0},
826 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
832 .name = "Pinnacle PCTV Studio/Rave",
837 .gpiomask = 0x03000F,
838 .muxsel = { 2, 3, 1, 1},
839 .audiomux = { 2, 0xd0001, 0, 0, 1},
845 /* ---- card 0x28 ---------------------------------- */
846 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
852 .muxsel = { 2, 3, 1, 1},
853 .audiomux = { 4, 0, 2, 3, 1},
856 .tuner_type = TUNER_PHILIPS_NTSC,
860 .name = "AVerMedia TVPhone 98",
866 .muxsel = { 2, 3, 1, 1},
867 .audiomux = { 13, 4, 11, 7, 0, 0},
872 .audio_hook = avermedia_tvphone_audio,
874 .name = "ProVideo PV951", /* pic16c54 */
880 .muxsel = { 2, 3, 1, 1},
881 .audiomux = { 0, 0, 0, 0, 0},
887 .name = "Little OnAir TV",
893 .muxsel = {2, 3, 1, 1},
894 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
899 /* ---- card 0x2c ---------------------------------- */
900 .name = "Sigma TVII-FM",
906 .muxsel = {2, 3, 1, 1},
907 .audiomux = {1, 1, 0, 2, 3},
912 .name = "MATRIX-Vision MV-Delta 2",
918 .muxsel = { 2, 3, 1, 0, 0},
924 .name = "Zoltrix Genie TV/FM",
929 .gpiomask = 0xbcf03f,
930 .muxsel = { 2, 3, 1, 1},
931 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
936 .name = "Terratec TV/Radio+",
942 .muxsel = { 2, 3, 1, 1},
943 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
951 /* ---- card 0x30 ---------------------------------- */
952 .name = "Askey CPH03x/ Dynalink Magic TView",
958 .muxsel = { 2, 3, 1, 1},
959 .audiomux = {2,0,0,0,1},
964 .name = "IODATA GV-BCTV3/PCI",
969 .gpiomask = 0x010f00,
970 .muxsel = {2, 3, 0, 0},
971 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
974 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
975 .audio_hook = gvbctv3pci_audio,
977 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
982 .gpiomask = 0xAA0000,
983 .muxsel = { 2,3,1,1,-1 },
984 .digital_mode = DIGITAL_MODE_CAMERA,
985 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
988 .tuner_type = TUNER_PHILIPS_PAL_I,
990 /* GPIO wiring: (different from Rev.4C !)
991 GPIO17: U4.A0 (first hef4052bt)
993 GPIO20: U5.A1 (second hef4052bt)
995 GPIO22: BT832 Reset Line
996 GPIO23: A5,A0, U5,nEN
997 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1000 .name = "Eagle Wireless Capricorn2 (bt878A)",
1006 .muxsel = { 2, 0, 1, 1},
1007 .audiomux = { 0, 1, 2, 3, 4},
1009 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1012 /* ---- card 0x34 ---------------------------------- */
1013 /* David Härdeman <david@2gen.com> */
1014 .name = "Pinnacle PCTV Studio Pro",
1019 .gpiomask = 0x03000F,
1020 .muxsel = { 2, 3, 1, 1},
1021 .audiomux = { 1, 0xd0001, 0, 0, 10},
1022 /* sound path (5 sources):
1023 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1026 2= Mono TV sound from Tuner
1028 MUX2 (mask 0x30000):
1030 1= FM stereo Radio from Tuner */
1035 /* Claas Langbehn <claas@bigfoot.com>,
1036 Sven Grothklags <sven@upb.de> */
1037 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1043 .muxsel = { 2, 3, 1, 1},
1044 .audiomux = { 0, 0, 0x10, 8, 4 },
1047 .tuner_type = TUNER_PHILIPS_PAL,
1050 /* Tim Röstermundt <rosterm@uni-muenster.de>
1051 in de.comp.os.unix.linux.hardware:
1052 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1053 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1054 options tuner type=5 */
1055 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1061 .muxsel = { 2, 3, 1, 1},
1062 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1063 /* For cards with tda9820/tda9821:
1064 0x0000: Tuner normal stereo
1065 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1066 0x0880: Tuner A2 stereo */
1070 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1071 old Easy TV BT848 version (model CPH031) */
1072 .name = "Askey CPH031/ BESTBUY Easy TV",
1078 .muxsel = { 2, 3, 1, 0},
1079 .audiomux = { 2, 0, 0, 0, 10},
1082 .tuner_type = TUNER_TEMIC_PAL,
1085 /* ---- card 0x38 ---------------------------------- */
1086 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1087 .name = "Lifeview FlyVideo 98FM LR50",
1093 .muxsel = { 2, 3, 1, 1},
1094 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1098 /* This is the ultimate cheapo capture card
1099 * just a BT848A on a small PCB!
1100 * Steve Hosgood <steve@equiinet.com> */
1101 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1114 /* Daniel Herrington <daniel.herrington@home.com> */
1115 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1121 .muxsel = { 2, 3, 1, 1},
1122 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1125 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1127 /* Matti Mottus <mottus@physic.ut.ee> */
1128 .name = "Askey CPH03x TV Capturer",
1133 .gpiomask = 0x03000F,
1134 .muxsel = { 2, 3, 1, 0},
1135 .audiomux = { 2,0,0,0,1 },
1140 /* ---- card 0x3c ---------------------------------- */
1141 /* Philip Blundell <philb@gnu.org> */
1142 .name = "Modular Technology MM100PCTV",
1148 .muxsel = { 2, 3, 1, 1},
1149 .audiomux = { 2, 0, 0, 1, 8},
1151 .tuner_type = TUNER_TEMIC_PAL,
1154 /* Adrian Cox <adrian@humboldt.co.uk */
1155 .name = "AG Electronics GMV1",
1168 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1169 new Easy TV BT878 version (model CPH061)
1170 special thanks to Informatica Mieres for providing the card */
1171 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1177 .muxsel = { 2, 3, 1, 0},
1178 .audiomux = { 1, 0, 4, 4, 9},
1181 .tuner_type = TUNER_PHILIPS_PAL,
1183 /* Lukas Gebauer <geby@volny.cz> */
1184 .name = "ATI TV-Wonder",
1190 .muxsel = { 2, 3, 1, 0 },
1191 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1193 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1196 /* ---- card 0x40 ---------------------------------- */
1197 /* Lukas Gebauer <geby@volny.cz> */
1198 .name = "ATI TV-Wonder VE",
1204 .muxsel = { 2, 3, 0, 1},
1205 .audiomux = { 0, 0, 1, 0, 0},
1208 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1210 /* DeeJay <deejay@westel900.net (2000S) */
1211 .name = "Lifeview FlyVideo 2000S LR90",
1217 .muxsel = { 2, 3, 0, 1},
1218 /* Radio changed from 1e80 to 0x800 to make
1219 FlyVideo2000S in .hu happy (gm)*/
1220 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1221 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1222 .audio_hook = fv2000s_audio,
1229 .name = "Terratec TValueRadio",
1234 .gpiomask = 0xffff00,
1235 .muxsel = { 2, 3, 1, 1},
1236 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1239 .tuner_type = TUNER_PHILIPS_PAL,
1242 /* TANAKA Kei <peg00625@nifty.com> */
1243 .name = "IODATA GV-BCTV4/PCI",
1248 .gpiomask = 0x010f00,
1249 .muxsel = {2, 3, 0, 0},
1250 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1253 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1254 .audio_hook = gvbctv3pci_audio,
1257 /* ---- card 0x44 ---------------------------------- */
1258 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1259 // try "insmod msp3400 simple=0" if you have
1260 // sound problems with this card.
1265 .gpiomask = 0x4f8a00,
1266 // 0x100000: 1=MSP enabled (0=disable again)
1267 // 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC)
1268 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1269 // tvtuner, radio, external,internal, mute, stereo
1270 /* tuner, Composit, SVid, Composit-on-Svid-adapter*/
1271 .muxsel = { 2, 3 ,0 ,1},
1272 .tuner_type = TUNER_MT2032,
1276 /* Philip Blundell <pb@nexus.co.uk> */
1277 .name = "Active Imaging AIMMS",
1286 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1287 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1293 .muxsel = { 2, 3, 1, 1},
1294 .audiomux = { 0, 0, 11, 7, 13, 0}, // TV and Radio with same GPIO !
1300 GPIO0: U4.A0 (hef4052bt)
1302 GPIO2: U4.A1 (second hef4052bt)
1303 GPIO3: U4.nEN, U5.A0, A5.nEN
1307 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1312 .muxsel = { 2, 3, 1, 1}, // AV1, AV2, SVHS, CVid adapter on SVHS
1317 /* ---- card 0x48 ---------------------------------- */
1318 /* Dariusz Kowalewski <darekk@automex.pl> */
1319 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1325 .muxsel = { 2, 3, 1, 1 },
1326 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1332 .audio_hook = pvbt878p9b_audio, // Note: not all cards have stereo
1333 .has_radio = 1, // Note: not all cards have radio
1340 GPIO20,22,23: R30,R29,R28
1343 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1344 /* you must jumper JP5 for the card to work */
1345 .name = "Sensoray 311",
1351 .muxsel = { 2, 3, 1, 0, 0},
1356 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1357 .name = "RemoteVision MX (RV605)",
1363 .gpiomask2 = 0x07ff,
1364 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1365 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1369 .muxsel_hook = rv605_muxsel,
1371 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1376 .gpiomask = 0x1C800F, // Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset
1377 .muxsel = { 2, 1, 1, },
1378 .audiomux = { 0, 1, 2, 2, 4 },
1380 .tuner_type = TUNER_PHILIPS_PAL,
1385 /* ---- card 0x4c ---------------------------------- */
1386 /* Masaki Suzuki <masaki@btree.org> */
1387 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1392 .gpiomask = 0x140007,
1393 .muxsel = { 2, 3, 1, 1 },
1394 .audiomux = { 0, 1, 2, 3, 4, 0 },
1395 .tuner_type = TUNER_PHILIPS_NTSC,
1396 .audio_hook = windvr_audio,
1398 .name = "GrandTec Multi Capture Card (Bt878)",
1404 .muxsel = { 2, 3, 1, 0 },
1411 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1417 .muxsel = { 2, 3, 1, 1 }, // Tuner, SVid, SVHS, SVid to SVHS connector
1418 .audiomux = { 0 ,0 ,4, 4,4,4},// Yes, this tuner uses the same audio output for TV and FM radio!
1419 // This card lacks external Audio In, so we mute it on Ext. & Int.
1420 // The PCB can take a sbx1637/sbx1673, wiring unknown.
1421 // This card lacks PCI subsystem ID, sigh.
1422 // audiomux=1: lower volume, 2+3: mute
1423 // btwincap uses 0x80000/0x80003
1427 .tuner_type = 5, // Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1428 // radio signal strength indicators work fine.
1431 GPIO0,1: HEF4052 A0,A1
1432 GPIO2: HEF4052 nENABLE
1434 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1438 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1440 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1441 .name = "DSP Design TCVIDEO",
1444 .muxsel = { 2, 3, 1, 0},
1449 /* ---- card 0x50 ---------------------------------- */
1450 .name = "Hauppauge WinTV PVR",
1455 .muxsel = { 2, 0, 1, 1},
1463 .name = "IODATA GV-BCTV5/PCI",
1468 .gpiomask = 0x0f0f80,
1469 .muxsel = {2, 3, 1, 0},
1470 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1473 .tuner_type = TUNER_PHILIPS_NTSC_M,
1474 .audio_hook = gvbctv5pci_audio,
1477 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1478 .video_inputs = 4, /* id-inputs-clock */
1482 .muxsel = { 3, 2, 0, 1 },
1489 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1494 .muxsel = { 2, 3, 1 },
1502 /* ---- card 0x54 ---------------------------------- */
1503 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1515 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1527 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1539 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1552 /* ---- card 0x58 ---------------------------------- */
1553 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1565 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1577 .name = "Osprey 500", /* 500 */
1589 .name = "Osprey 540", /* 540 */
1600 /* ---- card 0x5C ---------------------------------- */
1601 .name = "Osprey 2000", /* 2000 */
1611 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1613 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1614 .name = "IDS Eagle",
1621 .muxsel = { 0, 1, 2, 3 },
1622 .muxsel_hook = eagle_muxsel,
1627 .name = "Pinnacle PCTV Sat",
1637 .audiomux = { 0, 0, 0, 0, 1 },
1638 .muxsel = { 3, 0, 1, 2},
1644 .name = "Formac ProTV II (bt878)",
1650 // TV, Comp1, Composite over SVID con, SVID
1651 .muxsel = { 2, 3, 1, 1},
1652 .audiomux = { 2, 2, 0, 0, 0 },
1655 .tuner_type = TUNER_PHILIPS_PAL,
1657 GPIO=0x00,0x01,0x03: mute (?)
1658 0x02: both TV and radio (tuner: FM1216/I)
1659 The card has onboard audio connectors labeled "cdrom" and "board",
1660 not soldered here, though unknown wiring.
1661 Card lacks: external audio in, pci subsystem id.
1665 /* ---- card 0x60 ---------------------------------- */
1672 .muxsel = { 2, 3, 1, 1},
1673 .audiomux = { 0, 1, 2, 3, 4},
1678 .name = "Euresys Picolo",
1687 .muxsel = { 2, 0, 1},
1690 /* Luc Van Hoeylandt <luc@e-magic.be> */
1691 .name = "ProVideo PV150", /* 0x4f */
1704 /* Hiroshi Takekawa <sian@big.or.jp> */
1705 /* This card lacks subsystem ID */
1706 .name = "AD-TVK503", /* 0x63 */
1711 .gpiomask = 0x001e8007,
1712 .muxsel = { 2, 3, 1, 0 },
1713 /* Tuner, Radio, external, internal, off, on */
1714 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
1719 .audio_hook = adtvk503_audio,
1722 /* ---- card 0x64 ---------------------------------- */
1723 .name = "Hercules Smart TV Stereo",
1729 .muxsel = { 2, 3, 1, 1 },
1735 - card lacks subsystem ID
1736 - stereo variant w/ daughter board with tda9874a @0xb0
1738 always from tda9874 independent of GPIO (?)
1739 external line in: unknown
1740 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1741 hef4053 (instead 4052) for unknown function
1744 .name = "Pace TV & Radio Card",
1749 .muxsel = { 2, 3, 1, 1}, // Tuner, CVid, SVid, CVid over SVid connector
1756 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1757 only internal line out: (4pin header) RGGL
1758 Radio must be decoded by msp3410d (not routed through)*/
1759 // .digital_mode = DIGITAL_MODE_CAMERA, // todo!
1761 /* Chris Willing <chris@vislab.usyd.edu.au> */
1772 .name = "Grand X-Guard / Trust 814PCI",
1779 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
1780 .muxsel_hook = xguard_muxsel,
1787 /* ---- card 0x68 ---------------------------------- */
1788 .name = "Nebula Electronics DigiTV",
1792 .muxsel = { 2, 3, 1, 0},
1801 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
1802 .name = "ProVideo PV143",
1808 .muxsel = { 2, 3, 1, 0 },
1815 /* M.Klahr@phytec.de */
1816 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
1819 .tuner = -1, /* card has no tuner */
1822 .muxsel = { 2, 3, 1, 0},
1823 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1828 .name = "PHYTEC VD-009-X1 Combi (bt878)",
1831 .tuner = -1, /* card has no tuner */
1834 .muxsel = { 2, 3, 1, 1},
1835 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1841 /* ---- card 0x6c ---------------------------------- */
1842 .name = "PHYTEC VD-009 MiniDIN (bt878)",
1845 .tuner = -1, /* card has no tuner */
1848 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
1849 via the upper nibble of muxsel. here: used for
1850 xternal video-mux */
1851 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
1852 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1857 .name = "PHYTEC VD-009 Combi (bt878)",
1860 .tuner = -1, /* card has no tuner */
1863 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
1864 via the upper nibble of muxsel. here: used for
1865 xternal video-mux */
1866 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
1867 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1879 .muxsel = { 2, 3, 1, 0 },
1882 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
1885 .audio_inputs = 0, /* card has no audio */
1886 .tuner = -1, /* card has no tuner */
1888 .svhs = -1, /* card has no svhs */
1894 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
1895 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
1896 .muxsel_hook = ivc120_muxsel,
1900 /* ---- card 0x70 ---------------------------------- */
1901 .name = "pcHDTV HD-2000 TV",
1906 .muxsel = { 2, 3, 1, 0},
1907 .tuner_type = TUNER_PHILIPS_ATSC,
1910 .name = "Twinhan DST + clones",
1914 .tuner_type = TUNER_ABSENT,
1918 .name = "Winfast VC100",
1922 .tuner = -1, // no tuner
1923 .muxsel = { 3, 1, 1, 3}, // Vid In, SVid In, Vid over SVid in connector
1927 .tuner_type = TUNER_ABSENT,
1930 .name = "Teppro TEV-560/InterVision IV-560",
1936 .muxsel = { 2, 3, 1, 1},
1937 .audiomux = { 1, 1, 1, 1, 0},
1939 .tuner_type = TUNER_PHILIPS_PAL,
1943 /* ---- card 0x74 ---------------------------------- */
1944 .name = "SIMUS GVC1100",
1951 .muxsel = { 2, 2, 2, 2},
1953 .muxsel_hook = gvc1100_muxsel,
1955 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
1956 .name = "NGS NGSTV+",
1960 .gpiomask = 0x008007,
1961 .muxsel = {2, 3, 0, 0},
1962 .audiomux = {0, 0, 0, 0, 0x000003, 0},
1964 .tuner_type = TUNER_PHILIPS_PAL,
1967 /* http://linuxmedialabs.com */
1969 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
1973 .muxsel = { 2, 3, 1, 0 },
1979 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
1980 .name = "Tekram M205 PRO",
1984 .tuner_type = TUNER_PHILIPS_PAL,
1988 .muxsel = { 2, 3, 1},
1989 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
1993 /* ---- card 0x78 ---------------------------------- */
1994 /* Javier Cendan Ares <jcendan@lycos.es> */
1995 /* bt878 TV + FM without subsystem ID */
1996 .name = "Conceptronic CONTVFMi",
2001 .gpiomask = 0x008007,
2002 .muxsel = { 2, 3, 1, 1 },
2003 .audiomux = { 0, 1, 2, 2, 3 },
2006 .tuner_type = TUNER_PHILIPS_PAL,
2010 /*Eric DEBIEF <debief@telemsa.com>*/
2011 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2012 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_PICOLO_TETRA_CHIP*/
2014 .name = "Euresys Picolo Tetra",
2020 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2024 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2025 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2028 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2030 /* Spirit TV Tuner from http://spiritmodems.com.au */
2031 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2032 .name = "Spirit TV Tuner",
2037 .gpiomask = 0x0000000f,
2038 .muxsel = { 2, 1, 1 },
2039 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2040 .tuner_type = TUNER_TEMIC_PAL,
2044 /* Wolfram Joost <wojo@frokaschwei.de> */
2045 .name = "AVerMedia AVerTV DVB-T 771",
2049 .tuner_type = TUNER_ABSENT,
2050 .muxsel = { 3 , 3 },
2059 /* ---- card 0x7c ---------------------------------- */
2060 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2061 /* Based on the Nebula card data - added remote and new card number - BTTV_AVDVBT_761, see also ir-kbd-gpio.c */
2062 .name = "AverMedia AverTV DVB-T 761",
2066 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2076 /* andre.schwarz@matrix-vision.de */
2077 .name = "MATRIX Vision Sigma-SQ",
2083 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2084 3, 3, 3, 3, 3, 3, 3, 3 },
2085 .muxsel_hook = sigmaSQ_muxsel,
2091 /* andre.schwarz@matrix-vision.de */
2092 .name = "MATRIX Vision Sigma-SLC",
2098 .muxsel = { 2, 2, 2, 2 },
2099 .muxsel_hook = sigmaSLC_muxsel,
2105 /* BTTV_APAC_VIEWCOMP */
2106 /* Attila Kondoros <attila.kondoros@chello.hu> */
2107 /* bt878 TV + FM 0x00000000 subsystem ID */
2108 .name = "APAC Viewcomp 878(AMAX)",
2114 .muxsel = { 2, 3, 1, 1},
2115 .audiomux = { 2, 0, 0, 0, 10},
2118 .tuner_type = TUNER_PHILIPS_PAL,
2119 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2120 .has_radio = 1, /* not every card has radio */
2123 /* ---- card 0x80 ---------------------------------- */
2124 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2125 .name = "DVICO FusionHDTV DVB-T Lite",
2135 /* Steven <photon38@pchome.com.tw> */
2136 .name = "V-Gear MyVCD",
2142 .muxsel = {2, 3, 1, 0},
2143 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2146 .tuner_type = TUNER_PHILIPS_NTSC_M,
2150 /* Rick C <cryptdragoon@gmail.com> */
2151 .name = "Super TV Tuner",
2156 .muxsel = { 2, 3, 1, 0},
2157 .tuner_type = TUNER_PHILIPS_NTSC,
2158 .gpiomask = 0x008007,
2159 .audiomux = { 0, 0x000001,0,0, 0},
2163 /* Chris Fanning <video4linux@haydon.net> */
2164 .name = "Tibet Systems 'Progress DVR' CS16",
2169 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2175 .muxsel_hook = tibetCS16_muxsel,
2178 /* Bill Brack <wbrack@mmm.com.hk> */
2180 * Note that, because of the card's wiring, the "master"
2181 * BT878A chip (i.e. the one which controls the analog switch
2182 * and must use this card type) is the 2nd one detected. The
2183 * other 3 chips should use card type 0x85, whose description
2184 * follows this one. There is a EEPROM on the card (which is
2185 * connected to the I2C of one of those other chips), but is
2186 * not currently handled. There is also a facility for a
2187 * "monitor", which is also not currently implemented.
2189 .name = "Kodicom 4400R (master)",
2195 /* GPIO bits 0-9 used for analog switch:
2196 * 00 - 03: camera selector
2197 * 04 - 06: channel (controller) selector
2198 * 07: data (1->on, 0->off)
2201 * bit 16 is input from sync separator for the channel
2203 .gpiomask = 0x0003ff,
2205 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2210 .muxsel_hook = kodicom4400r_muxsel,
2213 /* Bill Brack <wbrack@mmm.com.hk> */
2214 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2215 * one which controls the analog switch, and must use the card type)
2216 * is the 2nd one detected. The other 3 chips should use this card
2219 .name = "Kodicom 4400R (slave)",
2225 .gpiomask = 0x010000,
2227 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2232 .muxsel_hook = kodicom4400r_muxsel,
2235 /* ---- card 0x85---------------------------------- */
2236 /* Michael Henson <mhenson@clarityvi.com> */
2237 /* Adlink RTV24 with special unlock codes */
2238 .name = "Adlink RTV24",
2243 .muxsel = { 2, 3, 1, 0},
2249 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2251 /* ----------------------------------------------------------------------- */
2253 static unsigned char eeprom_data[256];
2258 void __devinit bttv_idcard(struct bttv *btv)
2260 unsigned int gpiobits;
2264 /* read PCI subsystem ID */
2265 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2266 btv->cardid = tmp << 16;
2267 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2270 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2271 /* look for the card */
2272 for (type = -1, i = 0; cards[i].id != 0; i++)
2273 if (cards[i].id == btv->cardid)
2278 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2279 "PCI subsystem ID is %04x:%04x\n",
2280 btv->c.nr,cards[type].name,cards[type].cardnr,
2281 btv->cardid & 0xffff,
2282 (btv->cardid >> 16) & 0xffff);
2283 btv->c.type = cards[type].cardnr;
2286 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2287 btv->c.nr, btv->cardid & 0xffff,
2288 (btv->cardid >> 16) & 0xffff);
2289 printk(KERN_DEBUG "please mail id, board name and "
2290 "the correct card= insmod option to kraxel@bytesex.org\n");
2294 /* let the user override the autodetected type */
2295 if (card[btv->c.nr] < bttv_num_tvcards)
2296 btv->c.type=card[btv->c.nr];
2298 /* print which card config we are using */
2299 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2300 bttv_tvcards[btv->c.type].name, btv->c.type,
2301 card[btv->c.nr] < bttv_num_tvcards
2302 ? "insmod option" : "autodetected");
2304 /* overwrite gpio stuff ?? */
2305 if (UNSET == audioall && UNSET == audiomux[0])
2308 if (UNSET != audiomux[0]) {
2310 for (i = 0; i < 5; i++) {
2311 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2312 gpiobits |= audiomux[i];
2315 gpiobits = audioall;
2316 for (i = 0; i < 5; i++) {
2317 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2320 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2321 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2322 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2323 for (i = 0; i < 5; i++) {
2324 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2330 * (most) board specific initialisations goes here
2333 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2334 void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2338 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2339 type = BTTV_MODTEC_205;
2340 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2341 type = BTTV_EURESYS_PICOLO;
2342 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2343 type = BTTV_HAUPPAUGE; /* old bt848 */
2347 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2348 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2352 static void flyvideo_gpio(struct bttv *btv)
2354 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2357 gpio_inout(0xffffff, 0);
2358 udelay(8); // without this we would see the 0x1800 mask
2360 /* FIXME: must restore OUR_EN ??? */
2362 // all cards provide GPIO info, some have an additional eeprom
2363 // LR50: GPIO coding can be found lower right CP1 .. CP9
2364 // CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2366 // LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
2368 // lowest 3 bytes are remote control codes (no handshake needed)
2369 // xxxFFF: No remote control chip soldered
2370 // xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2371 // Note: Some bits are Audio_Mask !
2373 ttype=(gpio&0x0f0000)>>16;
2375 case 0x0: tuner=2; // NTSC, e.g. TPI8NSR11P
2377 case 0x2: tuner=39;// LG NTSC (newer TAPC series) TAPC-H701P
2379 case 0x4: tuner=5; // Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216
2381 case 0x6: tuner=37; // LG PAL (newer TAPC series) TAPC-G702P
2383 case 0xC: tuner=3; // Philips SECAM(+PAL) FQ1216ME or FI1216MF
2386 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2389 has_remote = gpio & 0x800000;
2390 has_radio = gpio & 0x400000;
2391 // unknown 0x200000;
2392 // unknown2 0x100000;
2393 is_capture_only = !(gpio & 0x008000); //GPIO15
2394 has_tda9820_tda9821 = !(gpio & 0x004000);
2395 is_lr90 = !(gpio & 0x002000); // else LR26/LR50 (LR38/LR51 f. capture only)
2396 // gpio & 0x001000 // output bit for audio routing
2399 tuner=4; // No tuner present
2401 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2402 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2403 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2404 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2405 is_capture_only?"yes":"no ");
2407 if(tuner!= -1) // only set if known tuner autodetected, else let insmod option through
2408 btv->tuner_type = tuner;
2409 btv->has_radio = has_radio;
2411 // LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2412 // LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2413 // Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute
2414 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
2415 //todo: if(has_tda9874) btv->audio_hook = fv2000s_audio;
2418 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2419 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2420 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2421 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2423 static void miro_pinnacle_gpio(struct bttv *btv)
2428 gpio_inout(0xffffff, 0);
2430 id = ((gpio>>10) & 63) -1;
2431 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2433 btv->tuner_type = miro_tunermap[id];
2434 if (0 == (gpio & 0x20)) {
2436 if (!miro_fmtuner[id]) {
2437 btv->has_matchbox = 1;
2438 btv->mbox_we = (1<<6);
2439 btv->mbox_most = (1<<7);
2440 btv->mbox_clk = (1<<8);
2441 btv->mbox_data = (1<<9);
2442 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
2448 if (btv->c.type == BTTV_MIRO)
2449 btv->c.type = BTTV_MIROPRO;
2450 if (btv->c.type == BTTV_PINNACLE)
2451 btv->c.type = BTTV_PINNACLEPRO;
2454 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
2455 btv->c.nr, id+1, btv->tuner_type,
2456 !btv->has_radio ? "no" :
2457 (btv->has_matchbox ? "matchbox" : "fmtuner"),
2458 (-1 == msp) ? "no" : "yes");
2460 /* new cards with microtune tuner */
2465 info = "PAL / mono";
2468 info = "PAL+SECAM / stereo";
2472 info = "NTSC / stereo";
2476 info = "PAL+SECAM / mono";
2479 info = "NTSC / mono";
2482 info = "NTSC / stereo";
2485 info = "PAL / stereo";
2488 info = "oops: unknown card";
2492 btv->c.type = BTTV_PINNACLEPRO;
2494 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
2495 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
2496 btv->tuner_type = 33;
2497 btv->pinnacle_id = id;
2501 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
2502 #define LM1882_SYNC_DRIVE 0x200000L
2504 static void init_ids_eagle(struct bttv *btv)
2506 gpio_inout(0xffffff,0xFFFF37);
2507 gpio_write(0x200020);
2509 /* flash strobe inverter ?! */
2510 gpio_write(0x200024);
2512 /* switch sync drive off */
2513 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
2515 /* set BT848 muxel to 2 */
2516 btaor((2)<<5, ~(2<<5), BT848_IFORM);
2519 /* Muxsel helper for the IDS Eagle.
2520 * the eagles does not use the standard muxsel-bits but
2521 * has its own multiplexer */
2522 static void eagle_muxsel(struct bttv *btv, unsigned int input)
2524 btaor((2)<<5, ~(3<<5), BT848_IFORM);
2525 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
2528 /* set chroma ADC to sleep */
2529 btor(BT848_ADC_C_SLEEP, BT848_ADC);
2530 /* set to composite video */
2531 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
2532 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
2534 /* switch sync drive off */
2535 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
2538 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
2540 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
2541 gpio_write(masks[input%4]);
2544 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
2547 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
2548 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
2550 IN - sensor inputs, INx - sensor inputs and TI XORed together
2551 O1,O2,O3 - alarm outputs (relays)
2553 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
2557 static void init_lmlbt4x(struct bttv *btv)
2559 printk(KERN_DEBUG "LMLBT4x init\n");
2560 btwrite(0x000000, BT848_GPIO_REG_INP);
2561 gpio_inout(0xffffff, 0x0006C0);
2562 gpio_write(0x000000);
2565 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
2567 unsigned int inmux = input % 8;
2568 gpio_inout( 0xf, 0xf );
2569 gpio_bits( 0xf, inmux );
2572 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
2574 unsigned int inmux = input % 4;
2575 gpio_inout( 3<<9, 3<<9 );
2576 gpio_bits( 3<<9, inmux<<9 );
2579 /* ----------------------------------------------------------------------- */
2581 static void bttv_reset_audio(struct bttv *btv)
2584 * BT878A has a audio-reset register.
2585 * 1. This register is an audio reset function but it is in
2586 * function-0 (video capture) address space.
2587 * 2. It is enough to do this once per power-up of the card.
2588 * 3. There is a typo in the Conexant doc -- it is not at
2589 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
2590 * --//Shrikumar 030609
2596 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
2597 btwrite((1<<7), 0x058);
2602 /* initialization part one -- before registering i2c bus */
2603 void __devinit bttv_init_card1(struct bttv *btv)
2605 switch (btv->c.type) {
2606 case BTTV_HAUPPAUGE:
2607 case BTTV_HAUPPAUGE878:
2608 boot_msp34xx(btv,5);
2610 case BTTV_VOODOOTV_FM:
2611 boot_msp34xx(btv,20);
2613 case BTTV_AVERMEDIA98:
2614 boot_msp34xx(btv,11);
2616 case BTTV_HAUPPAUGEPVR:
2619 case BTTV_TWINHAN_DST:
2620 case BTTV_AVDVBT_771:
2621 btv->use_i2c_hw = 1;
2623 case BTTV_ADLINK_RTV24:
2628 if (!bttv_tvcards[btv->c.type].has_dvb)
2629 bttv_reset_audio(btv);
2632 /* initialization part two -- after registering i2c bus */
2633 void __devinit bttv_init_card2(struct bttv *btv)
2636 btv->tuner_type = -1;
2638 if (BTTV_UNKNOWN == btv->c.type) {
2639 bttv_readee(btv,eeprom_data,0xa0);
2640 identify_by_eeprom(btv,eeprom_data);
2643 switch (btv->c.type) {
2647 case BTTV_PINNACLEPRO:
2649 miro_pinnacle_gpio(btv);
2651 case BTTV_FLYVIDEO_98:
2653 case BTTV_LIFE_FLYKIT:
2655 case BTTV_TYPHOON_TVIEW:
2656 case BTTV_CHRONOS_VS2:
2657 case BTTV_FLYVIDEO_98FM:
2658 case BTTV_FLYVIDEO2000:
2659 case BTTV_FLYVIDEO98EZ:
2660 case BTTV_CONFERENCETV:
2661 case BTTV_LIFETEC_9415:
2664 case BTTV_HAUPPAUGE:
2665 case BTTV_HAUPPAUGE878:
2666 case BTTV_HAUPPAUGEPVR:
2667 /* pick up some config infos from the eeprom */
2668 bttv_readee(btv,eeprom_data,0xa0);
2669 hauppauge_eeprom(btv);
2671 case BTTV_AVERMEDIA98:
2672 case BTTV_AVPHONE98:
2673 bttv_readee(btv,eeprom_data,0xa0);
2674 avermedia_eeprom(btv);
2679 case BTTV_PICOLO_TETRA_CHIP:
2680 picolo_tetra_init(btv);
2684 btv->has_matchbox = 1;
2685 btv->mbox_we = 0x20;
2687 btv->mbox_clk = 0x08;
2688 btv->mbox_data = 0x10;
2689 btv->mbox_mask = 0x38;
2691 case BTTV_VOBIS_BOOSTAR:
2693 terratec_active_radio_upgrade(btv);
2695 case BTTV_MAGICTVIEW061:
2696 if (btv->cardid == 0x3002144f) {
2698 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
2702 if (btv->cardid == 0x3060121a) {
2703 /* Fix up entry for 3DFX VoodooTV 100,
2704 which is an OEM STB card variant. */
2706 btv->tuner_type=TUNER_TEMIC_NTSC;
2709 case BTTV_OSPREY1x0:
2710 case BTTV_OSPREY1x0_848:
2711 case BTTV_OSPREY101_848:
2712 case BTTV_OSPREY1x1:
2713 case BTTV_OSPREY1x1_SVID:
2714 case BTTV_OSPREY2xx:
2715 case BTTV_OSPREY2x0_SVID:
2716 case BTTV_OSPREY2x0:
2717 case BTTV_OSPREY500:
2718 case BTTV_OSPREY540:
2719 case BTTV_OSPREY2000:
2720 bttv_readee(btv,eeprom_data,0xa0);
2723 case BTTV_IDS_EAGLE:
2724 init_ids_eagle(btv);
2726 case BTTV_MODTEC_205:
2727 bttv_readee(btv,eeprom_data,0xa0);
2733 case BTTV_TIBET_CS16:
2734 tibetCS16_init(btv);
2736 case BTTV_KODICOM_4400R:
2737 kodicom4400r_init(btv);
2741 /* pll configuration */
2742 if (!(btv->id==848 && btv->revision==0x11)) {
2743 /* defaults from card list */
2744 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
2745 btv->pll.pll_ifreq=28636363;
2746 btv->pll.pll_crystal=BT848_IFORM_XT0;
2748 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
2749 btv->pll.pll_ifreq=35468950;
2750 btv->pll.pll_crystal=BT848_IFORM_XT1;
2752 /* insmod options can override */
2753 switch (pll[btv->c.nr]) {
2755 btv->pll.pll_crystal = 0;
2756 btv->pll.pll_ifreq = 0;
2757 btv->pll.pll_ofreq = 0;
2759 case 1: /* 28 MHz */
2761 btv->pll.pll_ifreq = 28636363;
2762 btv->pll.pll_ofreq = 0;
2763 btv->pll.pll_crystal = BT848_IFORM_XT0;
2765 case 2: /* 35 MHz */
2767 btv->pll.pll_ifreq = 35468950;
2768 btv->pll.pll_ofreq = 0;
2769 btv->pll.pll_crystal = BT848_IFORM_XT1;
2773 btv->pll.pll_current = -1;
2775 /* tuner configuration (from card list / autodetect / insmod option) */
2776 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
2777 if(UNSET == btv->tuner_type)
2778 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
2779 if (UNSET != tuner[btv->c.nr])
2780 btv->tuner_type = tuner[btv->c.nr];
2781 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
2782 if (btv->pinnacle_id != UNSET)
2783 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
2785 if (btv->tuner_type != UNSET) {
2786 struct tuner_setup tun_setup;
2788 tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
2789 tun_setup.type = btv->tuner_type;
2790 tun_setup.addr = ADDR_UNSET;
2792 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
2795 btv->svhs = bttv_tvcards[btv->c.type].svhs;
2796 if (svhs[btv->c.nr] != UNSET)
2797 btv->svhs = svhs[btv->c.nr];
2798 if (remote[btv->c.nr] != UNSET)
2799 btv->has_remote = remote[btv->c.nr];
2801 if (bttv_tvcards[btv->c.type].has_radio)
2803 if (bttv_tvcards[btv->c.type].has_remote)
2805 if (bttv_tvcards[btv->c.type].no_gpioirq)
2807 if (bttv_tvcards[btv->c.type].audio_hook)
2808 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
2810 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
2811 /* detect Bt832 chip for quartzsight digital camera */
2812 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
2813 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
2820 /* try to detect audio/fader chips */
2821 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
2822 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
2823 request_module("msp3400");
2825 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
2826 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
2827 request_module("msp3400");
2829 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
2830 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
2831 request_module("tda9875");
2833 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
2834 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
2835 request_module("tda7432");
2837 if (bttv_tvcards[btv->c.type].needs_tvaudio)
2838 request_module("tvaudio");
2842 if (btv->pinnacle_id != UNSET)
2844 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
2845 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
2847 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
2848 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
2849 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
2851 request_module("tda9887");
2852 if (btv->tuner_type != UNSET)
2853 request_module("tuner");
2857 /* ----------------------------------------------------------------------- */
2859 static void modtec_eeprom(struct bttv *btv)
2861 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
2862 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
2863 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
2864 btv->c.nr,&eeprom_data[0x1e]);
2865 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
2866 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
2867 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
2868 btv->c.nr,&eeprom_data[0x1e]);
2869 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
2870 btv->tuner_type=TUNER_PHILIPS_NTSC;
2871 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
2872 btv->c.nr,&eeprom_data[0x1e]);
2874 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
2875 btv->c.nr,&eeprom_data[0x1e]);
2879 static void __devinit hauppauge_eeprom(struct bttv *btv)
2883 tveeprom_hauppauge_analog(&tv, eeprom_data);
2884 btv->tuner_type = tv.tuner_type;
2885 btv->has_radio = tv.has_radio;
2888 static int terratec_active_radio_upgrade(struct bttv *btv)
2893 btv->has_matchbox = 1;
2894 btv->mbox_we = 0x10;
2895 btv->mbox_most = 0x20;
2896 btv->mbox_clk = 0x08;
2897 btv->mbox_data = 0x04;
2898 btv->mbox_mask = 0x3c;
2900 btv->mbox_iow = 1 << 8;
2901 btv->mbox_ior = 1 << 9;
2902 btv->mbox_csel = 1 << 10;
2905 tea5757_write(btv, 5 * freq + 0x358); // write 0x1ed8
2906 if (0x1ed8 == tea5757_read(btv)) {
2907 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
2910 btv->has_matchbox = 1;
2913 btv->has_matchbox = 0;
2919 /* ----------------------------------------------------------------------- */
2922 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
2924 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
2925 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
2926 * unpacked with unzip).
2928 #define PVR_GPIO_DELAY 10
2930 #define BTTV_ALT_DATA 0x000001
2931 #define BTTV_ALT_DCLK 0x100000
2932 #define BTTV_ALT_NCONFIG 0x800000
2934 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
2940 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
2942 udelay(PVR_GPIO_DELAY);
2944 gpio_write(BTTV_ALT_NCONFIG);
2945 udelay(PVR_GPIO_DELAY);
2947 for (n = 0; n < microlen; n++) {
2949 for ( i = 0 ; i < 8 ; i++ ) {
2950 gpio_bits(BTTV_ALT_DCLK,0);
2952 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
2954 gpio_bits(BTTV_ALT_DATA,0);
2955 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
2959 gpio_bits(BTTV_ALT_DCLK,0);
2960 udelay(PVR_GPIO_DELAY);
2962 /* begin Altera init loop (Not necessary,but doesn't hurt) */
2963 for (i = 0 ; i < 30 ; i++) {
2964 gpio_bits(BTTV_ALT_DCLK,0);
2965 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
2967 gpio_bits(BTTV_ALT_DCLK,0);
2971 static int __devinit pvr_boot(struct bttv *btv)
2973 const struct firmware *fw_entry;
2976 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
2978 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
2982 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
2983 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
2984 btv->c.nr, (rc < 0) ? "failed" : "ok");
2985 release_firmware(fw_entry);
2989 /* ----------------------------------------------------------------------- */
2990 /* some osprey specific stuff */
2992 static void __devinit osprey_eeprom(struct bttv *btv)
2995 unsigned char *ee = eeprom_data;
2996 unsigned long serial = 0;
2998 if (btv->c.type == 0) {
2999 /* this might be an antique... check for MMAC label in eeprom */
3000 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3001 unsigned char checksum = 0;
3002 for (i =0; i<21; i++)
3004 if (checksum != ee[21])
3006 btv->c.type = BTTV_OSPREY1x0_848;
3007 for (i = 12; i < 21; i++)
3008 serial *= 10, serial += ee[i] - '0';
3011 unsigned short type;
3014 for(; offset < 8*16; offset += 16) {
3015 unsigned short checksum = 0;
3016 /* verify the checksum */
3017 for(i = 0; i<14; i++) checksum += ee[i+offset];
3018 checksum = ~checksum; /* no idea why */
3019 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3020 ((checksum & 0x0FF) == ee[offset+15])) {
3028 /* found a valid descriptor */
3029 type = (ee[offset+4]<<8) | (ee[offset+5]);
3035 btv->c.type = BTTV_OSPREY1x0_848;
3038 btv->c.type = BTTV_OSPREY101_848;
3044 btv->c.type = BTTV_OSPREY1x0;
3048 btv->c.type = BTTV_OSPREY1x1;