]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/media/video/bttv-cards.c
Linux-2.6.12-rc2
[net-next-2.6.git] / drivers / media / video / bttv-cards.c
CommitLineData
1da177e4
LT
1/*
2 $Id: bttv-cards.c,v 1.47 2005/02/22 14:06:32 kraxel Exp $
3
4 bttv-cards.c
5
6 this file has configuration informations - card-specific stuff
7 like the big tvcards array for the most part
8
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>
12
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.
17
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.
22
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.
26
27*/
28
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>
38
39#include <asm/io.h>
40
41#include "bttvp.h"
42#if 0 /* not working yet */
43#include "bt832.h"
44#endif
45
46/* fwd decl */
47static void boot_msp34xx(struct bttv *btv, int pin);
48static void boot_bt832(struct bttv *btv);
49static void hauppauge_eeprom(struct bttv *btv);
50static void avermedia_eeprom(struct bttv *btv);
51static void osprey_eeprom(struct bttv *btv);
52static void modtec_eeprom(struct bttv *btv);
53static void init_PXC200(struct bttv *btv);
54
55static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
56static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
57static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
58 int set);
59static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
60 int set);
61static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
62static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
63static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
64static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
65static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
66static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
67static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
68static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
69static void rv605_muxsel(struct bttv *btv, unsigned int input);
70static void eagle_muxsel(struct bttv *btv, unsigned int input);
71static void xguard_muxsel(struct bttv *btv, unsigned int input);
72static void ivc120_muxsel(struct bttv *btv, unsigned int input);
73static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
74
75static void PXC200_muxsel(struct bttv *btv, unsigned int input);
76
77static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
78static void picolo_tetra_init(struct bttv *btv);
79
80static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
81static void tibetCS16_init(struct bttv *btv);
82
83static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
84static void kodicom4400r_init(struct bttv *btv);
85
86static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
87static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
88
89static int terratec_active_radio_upgrade(struct bttv *btv);
90static int tea5757_read(struct bttv *btv);
91static int tea5757_write(struct bttv *btv, int value);
92static void identify_by_eeprom(struct bttv *btv,
93 unsigned char eeprom_data[256]);
94static int __devinit pvr_boot(struct bttv *btv);
95
96/* config variables */
97static unsigned int triton1=0;
98static unsigned int vsfx=0;
99static unsigned int latency = UNSET;
100static unsigned int no_overlay=-1;
101
102static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
106static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
107static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
108#ifdef MODULE
109static unsigned int autoload = 1;
110#else
111static unsigned int autoload = 0;
112#endif
113static unsigned int gpiomask = UNSET;
114static unsigned int audioall = UNSET;
115static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
116
117/* insmod options */
118module_param(triton1, int, 0444);
119module_param(vsfx, int, 0444);
120module_param(no_overlay, int, 0444);
121module_param(latency, int, 0444);
122module_param(gpiomask, int, 0444);
123module_param(audioall, int, 0444);
124module_param(autoload, int, 0444);
125
126module_param_array(card, int, NULL, 0444);
127module_param_array(pll, int, NULL, 0444);
128module_param_array(tuner, int, NULL, 0444);
129module_param_array(svhs, int, NULL, 0444);
130module_param_array(remote, int, NULL, 0444);
131module_param_array(audiomux, int, NULL, 0444);
132
133MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
134 "[enable bug compatibility for triton1 + others]");
135MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
136 "[yet another chipset flaw workaround]");
137MODULE_PARM_DESC(latency,"pci latency timer");
138MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
139MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
140MODULE_PARM_DESC(tuner,"specify installed tuner type");
141MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
142
143/* ----------------------------------------------------------------------- */
144/* list of card IDs for bt878+ cards */
145
146static struct CARD {
147 unsigned id;
148 int cardnr;
149 char *name;
150} cards[] __devinitdata = {
151 { 0x13eb0070, BTTV_HAUPPAUGE878, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_HAUPPAUGE878, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_OSPREY1x0, "Osprey-100" },
155 { 0xff010070, BTTV_OSPREY2x0_SVID,"Osprey-200" },
156 { 0xff020070, BTTV_OSPREY500, "Osprey-500" },
157 { 0xff030070, BTTV_OSPREY2000, "Osprey-2000" },
158 { 0xff040070, BTTV_OSPREY540, "Osprey-540" },
159
160 { 0x00011002, BTTV_ATI_TVWONDER, "ATI TV Wonder" },
161 { 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
162
163 { 0x6606107d, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
164 { 0x6607107d, BTTV_WINFASTVC100, "Leadtek WinFast VC 100" },
165 { 0x6609107d, BTTV_WINFAST2000, "Leadtek TV 2000 XP" },
166 { 0x263610b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
167 { 0x264510b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x402010fc, BTTV_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
169 { 0x405010fc, BTTV_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
170 { 0x407010fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
171 { 0xd01810fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
172
173 { 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
174 // some cards ship with byteswapped IDs ...
175 { 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
176 { 0xff00bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
177 // this seems to happen as well ...
178 { 0xff1211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
179
180 { 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
181 { 0x263710b4, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
182 { 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" },
183
184 { 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
185 { 0xa005144f, BTTV_MAGICTVIEW063, "CPH06X TView99-Card" },
186 { 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
187 { 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
188 { 0x5000144f, BTTV_MAGICTVIEW061, "Askey CPH050" },
189 { 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
190 { 0x300214ff, BTTV_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
191
192 { 0x00011461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00021461, BTTV_AVERMEDIA98, "AVermedia TVCapture 98" },
194 { 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00041461, BTTV_AVERMEDIA98, "AVerMedia TVCapture 98" },
196 { 0x03001461, BTTV_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
197
198 { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
199 { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
200 { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
201 { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
202
203 { 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" },
204 { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" },
205 // clashes with FlyVideo
206 //{ 0x18521852, BTTV_TERRATV, "Terratec TV+ (V1.10)" },
207 { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue (LR102)" },
208 { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // LR102
209 { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" }, // ??
210 { 0xff3b153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, // ??
211
212 { 0x400015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
213 { 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
214 { 0x400d15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
215 { 0x401015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x401615b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217
218 { 0x1430aa00, BTTV_PV143, "Provideo PV143A" },
219 { 0x1431aa00, BTTV_PV143, "Provideo PV143B" },
220 { 0x1432aa00, BTTV_PV143, "Provideo PV143C" },
221 { 0x1433aa00, BTTV_PV143, "Provideo PV143D" },
222 { 0x1433aa03, BTTV_PV143, "Security Eyes" },
223
224 { 0x1460aa00, BTTV_PV150, "Provideo PV150A-1" },
225 { 0x1461aa01, BTTV_PV150, "Provideo PV150A-2" },
226 { 0x1462aa02, BTTV_PV150, "Provideo PV150A-3" },
227 { 0x1463aa03, BTTV_PV150, "Provideo PV150A-4" },
228
229 { 0x1464aa04, BTTV_PV150, "Provideo PV150B-1" },
230 { 0x1465aa05, BTTV_PV150, "Provideo PV150B-2" },
231 { 0x1466aa06, BTTV_PV150, "Provideo PV150B-3" },
232 { 0x1467aa07, BTTV_PV150, "Provideo PV150B-4" },
233
234 { 0xa132ff00, BTTV_IVC100, "IVC-100" },
235 { 0xa1550000, BTTV_IVC200, "IVC-200" },
236 { 0xa1550001, BTTV_IVC200, "IVC-200" },
237 { 0xa1550002, BTTV_IVC200, "IVC-200" },
238 { 0xa1550003, BTTV_IVC200, "IVC-200" },
239 { 0xa1550100, BTTV_IVC200, "IVC-200G" },
240 { 0xa1550101, BTTV_IVC200, "IVC-200G" },
241 { 0xa1550102, BTTV_IVC200, "IVC-200G" },
242 { 0xa1550103, BTTV_IVC200, "IVC-200G" },
243 { 0xa182ff00, BTTV_IVC120, "IVC-120G" },
244 { 0xa182ff01, BTTV_IVC120, "IVC-120G" },
245 { 0xa182ff02, BTTV_IVC120, "IVC-120G" },
246 { 0xa182ff03, BTTV_IVC120, "IVC-120G" },
247 { 0xa182ff04, BTTV_IVC120, "IVC-120G" },
248 { 0xa182ff05, BTTV_IVC120, "IVC-120G" },
249 { 0xa182ff06, BTTV_IVC120, "IVC-120G" },
250 { 0xa182ff07, BTTV_IVC120, "IVC-120G" },
251 { 0xa182ff08, BTTV_IVC120, "IVC-120G" },
252 { 0xa182ff09, BTTV_IVC120, "IVC-120G" },
253 { 0xa182ff0a, BTTV_IVC120, "IVC-120G" },
254 { 0xa182ff0b, BTTV_IVC120, "IVC-120G" },
255 { 0xa182ff0c, BTTV_IVC120, "IVC-120G" },
256 { 0xa182ff0d, BTTV_IVC120, "IVC-120G" },
257 { 0xa182ff0e, BTTV_IVC120, "IVC-120G" },
258 { 0xa182ff0f, BTTV_IVC120, "IVC-120G" },
259
260 { 0x41424344, BTTV_GRANDTEC, "GrandTec Multi Capture" },
261 { 0x01020304, BTTV_XGUARD, "Grandtec Grand X-Guard" },
262
263 { 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
264 { 0xa0501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
265 { 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
266 { 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
267 { 0x41a0a051, BTTV_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
268 { 0x18501f7f, BTTV_FLYVIDEO_98, "Lifeview Flyvideo 98" },
269
270 { 0x010115cb, BTTV_GMV1, "AG GMV1" },
271 { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
272
273 { 0x10b42636, BTTV_HAUPPAUGE878, "STB ???" },
274 { 0x217d6606, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
275 { 0xfff6f6ff, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
276 { 0x03116000, BTTV_SENSORAY311, "Sensoray 311" },
277 { 0x00790e11, BTTV_WINDVR, "Canopus WinDVR PCI" },
278 { 0xa0fca1a0, BTTV_ZOLTRIX, "Face to Face Tvmax" },
279 { 0x20007063, BTTV_PC_HDTV, "pcHDTV HD-2000 TV"},
280 { 0x82b2aa6a, BTTV_SIMUS_GVC1100, "SIMUS GVC1100" },
281 { 0x146caa0c, BTTV_PV951, "ituner spectra8" },
282 { 0x200a1295, BTTV_PXC200, "ImageNation PXC200A" },
283
284 { 0x40111554, BTTV_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
285 { 0x17de0a01, BTTV_KWORLD, "Mecer TV/FM/Video Tuner" },
286
287 { 0x01051805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
288 { 0x01061805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
289 { 0x01071805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
290 { 0x01081805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
291
292 // likely broken, vendor id doesn't match the other magic views ...
293 //{ 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" },
294
295 // DVB cards (using pci function .1 for mpeg data xfer)
296 { 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
297 { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
298 { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
299 { 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
300 { 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB" },
301 { 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
302 { 0x07711461, BTTV_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
303 { 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DVICO FusionHDTV DVB-T Lite" },
304
305 { 0, -1, NULL }
306};
307
308/* ----------------------------------------------------------------------- */
309/* array with description for bt848 / bt878 tv/grabber cards */
310
311struct tvcard bttv_tvcards[] = {
312{
313/* ---- card 0x00 ---------------------------------- */
314 .name = " *** UNKNOWN/GENERIC *** ",
315 .video_inputs = 4,
316 .audio_inputs = 1,
317 .tuner = 0,
318 .svhs = 2,
319 .muxsel = { 2, 3, 1, 0},
320 .tuner_type = -1,
321},{
322 .name = "MIRO PCTV",
323 .video_inputs = 4,
324 .audio_inputs = 1,
325 .tuner = 0,
326 .svhs = 2,
327 .gpiomask = 15,
328 .muxsel = { 2, 3, 1, 1},
329 .audiomux = { 2, 0, 0, 0, 10},
330 .needs_tvaudio = 1,
331 .tuner_type = -1,
332},{
333 .name = "Hauppauge (bt848)",
334 .video_inputs = 4,
335 .audio_inputs = 1,
336 .tuner = 0,
337 .svhs = 2,
338 .gpiomask = 7,
339 .muxsel = { 2, 3, 1, 1},
340 .audiomux = { 0, 1, 2, 3, 4},
341 .needs_tvaudio = 1,
342 .tuner_type = -1,
343},{
344 .name = "STB, Gateway P/N 6000699 (bt848)",
345 .video_inputs = 3,
346 .audio_inputs = 1,
347 .tuner = 0,
348 .svhs = 2,
349 .gpiomask = 7,
350 .muxsel = { 2, 3, 1, 1},
351 .audiomux = { 4, 0, 2, 3, 1},
352 .no_msp34xx = 1,
353 .needs_tvaudio = 1,
354 .tuner_type = TUNER_PHILIPS_NTSC,
355 .pll = PLL_28,
356 .has_radio = 1,
357},{
358
359/* ---- card 0x04 ---------------------------------- */
360 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
361 .video_inputs = 4,
362 .audio_inputs = 0,
363 .tuner = -1,
364 .svhs = 2,
365 .gpiomask = 0,
366 .muxsel = { 2, 3, 1, 1},
367 .audiomux = { 0 },
368 .needs_tvaudio = 0,
369 .tuner_type = 4,
370},{
371 .name = "Diamond DTV2000",
372 .video_inputs = 4,
373 .audio_inputs = 1,
374 .tuner = 0,
375 .svhs = 2,
376 .gpiomask = 3,
377 .muxsel = { 2, 3, 1, 0},
378 .audiomux = { 0, 1, 0, 1, 3},
379 .needs_tvaudio = 1,
380 .tuner_type = -1,
381},{
382 .name = "AVerMedia TVPhone",
383 .video_inputs = 3,
384 .audio_inputs = 1,
385 .tuner = 0,
386 .svhs = 3,
387 .muxsel = { 2, 3, 1, 1},
388 .gpiomask = 0x0f,
389 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
390 /* 0x04 for some cards ?? */
391 .needs_tvaudio = 1,
392 .tuner_type = -1,
393 .audio_hook = avermedia_tvphone_audio,
394 .has_remote = 1,
395},{
396 .name = "MATRIX-Vision MV-Delta",
397 .video_inputs = 5,
398 .audio_inputs = 1,
399 .tuner = -1,
400 .svhs = 3,
401 .gpiomask = 0,
402 .muxsel = { 2, 3, 1, 0, 0},
403 .audiomux = {0 },
404 .needs_tvaudio = 1,
405 .tuner_type = -1,
406},{
407
408/* ---- card 0x08 ---------------------------------- */
409 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
410 .video_inputs = 4,
411 .audio_inputs = 1,
412 .tuner = 0,
413 .svhs = 2,
414 .gpiomask = 0xc00,
415 .muxsel = { 2, 3, 1, 1},
416 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
417 .needs_tvaudio = 1,
418 .pll = PLL_28,
419 .tuner_type = -1,
420},{
421 .name = "IMS/IXmicro TurboTV",
422 .video_inputs = 3,
423 .audio_inputs = 1,
424 .tuner = 0,
425 .svhs = 2,
426 .gpiomask = 3,
427 .muxsel = { 2, 3, 1, 1},
428 .audiomux = { 1, 1, 2, 3, 0},
429 .needs_tvaudio = 0,
430 .pll = PLL_28,
431 .tuner_type = TUNER_TEMIC_PAL,
432},{
433 .name = "Hauppauge (bt878)",
434 .video_inputs = 4,
435 .audio_inputs = 1,
436 .tuner = 0,
437 .svhs = 2,
438 .gpiomask = 0x0f, /* old: 7 */
439 .muxsel = { 2, 0, 1, 1},
440 .audiomux = { 0, 1, 2, 3, 4},
441 .needs_tvaudio = 1,
442 .pll = PLL_28,
443 .tuner_type = -1,
444},{
445 .name = "MIRO PCTV pro",
446 .video_inputs = 3,
447 .audio_inputs = 1,
448 .tuner = 0,
449 .svhs = 2,
450 .gpiomask = 0x3014f,
451 .muxsel = { 2, 3, 1, 1},
452 .audiomux = { 0x20001,0x10001, 0, 0,10},
453 .needs_tvaudio = 1,
454 .tuner_type = -1,
455},{
456
457/* ---- card 0x0c ---------------------------------- */
458 .name = "ADS Technologies Channel Surfer TV (bt848)",
459 .video_inputs = 3,
460 .audio_inputs = 1,
461 .tuner = 0,
462 .svhs = 2,
463 .gpiomask = 15,
464 .muxsel = { 2, 3, 1, 1},
465 .audiomux = { 13, 14, 11, 7, 0, 0},
466 .needs_tvaudio = 1,
467 .tuner_type = -1,
468},{
469 .name = "AVerMedia TVCapture 98",
470 .video_inputs = 3,
471 .audio_inputs = 4,
472 .tuner = 0,
473 .svhs = 2,
474 .gpiomask = 15,
475 .muxsel = { 2, 3, 1, 1},
476 .audiomux = { 13, 14, 11, 7, 0, 0},
477 .needs_tvaudio = 1,
478 .msp34xx_alt = 1,
479 .pll = PLL_28,
480 .tuner_type = TUNER_PHILIPS_PAL,
481 .audio_hook = avermedia_tv_stereo_audio,
482},{
483 .name = "Aimslab Video Highway Xtreme (VHX)",
484 .video_inputs = 3,
485 .audio_inputs = 1,
486 .tuner = 0,
487 .svhs = 2,
488 .gpiomask = 7,
489 .muxsel = { 2, 3, 1, 1},
490 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
491 .needs_tvaudio = 1,
492 .pll = PLL_28,
493 .tuner_type = -1,
494},{
495 .name = "Zoltrix TV-Max",
496 .video_inputs = 3,
497 .audio_inputs = 1,
498 .tuner = 0,
499 .svhs = 2,
500 .gpiomask = 15,
501 .muxsel = { 2, 3, 1, 1},
502 .audiomux = {0 , 0, 1 , 0, 10},
503 .needs_tvaudio = 1,
504 .tuner_type = -1,
505},{
506
507/* ---- card 0x10 ---------------------------------- */
508 .name = "Prolink Pixelview PlayTV (bt878)",
509 .video_inputs = 3,
510 .audio_inputs = 1,
511 .tuner = 0,
512 .svhs = 2,
513 .gpiomask = 0x01fe00,
514 .muxsel = { 2, 3, 1, 1},
515#if 0
516 // old
517 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
518#else
519 // 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru>
520 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
521#endif
522 .needs_tvaudio = 1,
523 .pll = PLL_28,
524 .tuner_type = -1,
525},{
526 .name = "Leadtek WinView 601",
527 .video_inputs = 3,
528 .audio_inputs = 1,
529 .tuner = 0,
530 .svhs = 2,
531 .gpiomask = 0x8300f8,
532 .muxsel = { 2, 3, 1, 1,0},
533 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
534 .needs_tvaudio = 1,
535 .tuner_type = -1,
536 .audio_hook = winview_audio,
537 .has_radio = 1,
538},{
539 .name = "AVEC Intercapture",
540 .video_inputs = 3,
541 .audio_inputs = 2,
542 .tuner = 0,
543 .svhs = 2,
544 .gpiomask = 0,
545 .muxsel = {2, 3, 1, 1},
546 .audiomux = {1, 0, 0, 0, 0},
547 .needs_tvaudio = 1,
548 .tuner_type = -1,
549},{
550 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
551 .video_inputs = 4,
552 .audio_inputs = 1,
553 .tuner = -1,
554 .svhs = -1,
555 .gpiomask = 0x8dff00,
556 .muxsel = { 2, 3, 1, 1},
557 .audiomux = { 0 },
558 .no_msp34xx = 1,
559 .tuner_type = -1,
560},{
561
562/* ---- card 0x14 ---------------------------------- */
563 .name = "CEI Raffles Card",
564 .video_inputs = 3,
565 .audio_inputs = 3,
566 .tuner = 0,
567 .svhs = 2,
568 .muxsel = {2, 3, 1, 1},
569 .tuner_type = -1,
570},{
571 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
572 .video_inputs = 4,
573 .audio_inputs = 2, // tuner, line in
574 .tuner = 0,
575 .svhs = 2,
576 .gpiomask = 0x1800,
577 .muxsel = { 2, 3, 1, 1},
578 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
579 .pll = PLL_28,
580 .tuner_type = TUNER_PHILIPS_PAL_I,
581},{
582 .name = "Askey CPH050/ Phoebe Tv Master + FM",
583 .video_inputs = 3,
584 .audio_inputs = 1,
585 .tuner = 0,
586 .svhs = 2,
587 .gpiomask = 0xc00,
588 .muxsel = { 2, 3, 1, 1},
589 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
590 .needs_tvaudio = 1,
591 .pll = PLL_28,
592 .tuner_type = -1,
593},{
594 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
595 .video_inputs = 3,
596 .audio_inputs = 1,
597 .tuner = 0,
598 .svhs = -1,
599 .gpiomask = 7,
600 .muxsel = { 2, 3, -1 },
601 .digital_mode = DIGITAL_MODE_CAMERA,
602 .audiomux = { 0, 0, 0, 0, 0 },
603 .no_msp34xx = 1,
604 .pll = PLL_28,
605 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
606},{
607
608/* ---- card 0x18 ---------------------------------- */
609 .name = "Askey CPH05X/06X (bt878) [many vendors]",
610 .video_inputs = 3,
611 .audio_inputs = 1,
612 .tuner = 0,
613 .svhs = 2,
614 .gpiomask = 0xe00,
615 .muxsel = { 2, 3, 1, 1},
616 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
617 .needs_tvaudio = 1,
618 .pll = PLL_28,
619 .tuner_type = -1,
620 .has_remote = 1,
621},{
622 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
623 .video_inputs = 3,
624 .audio_inputs = 1,
625 .tuner = 0,
626 .svhs = 2,
627 .gpiomask = 0x1f0fff,
628 .muxsel = { 2, 3, 1, 1},
629 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
630 .needs_tvaudio = 0,
631 .tuner_type = TUNER_PHILIPS_PAL,
632 .audio_hook = terratv_audio,
633},{
634 .name = "Hauppauge WinCam newer (bt878)",
635 .video_inputs = 4,
636 .audio_inputs = 1,
637 .tuner = 0,
638 .svhs = 3,
639 .gpiomask = 7,
640 .muxsel = { 2, 0, 1, 1},
641 .audiomux = { 0, 1, 2, 3, 4},
642 .needs_tvaudio = 1,
643 .tuner_type = -1,
644},{
645 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
646 .video_inputs = 4,
647 .audio_inputs = 2,
648 .tuner = 0,
649 .svhs = 2,
650 .gpiomask = 0x1800,
651 .muxsel = { 2, 3, 1, 1},
652 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
653 .pll = PLL_28,
654 .tuner_type = TUNER_PHILIPS_SECAM,
655},{
656
657/* ---- card 0x1c ---------------------------------- */
658 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
659 .video_inputs = 3,
660 .audio_inputs = 1,
661 .tuner = 0,
662 .svhs = 2,
663 .gpiomask = 0x1f0fff,
664 .muxsel = { 2, 3, 1, 1},
665 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
666 .needs_tvaudio = 0,
667 .tuner_type = TUNER_PHILIPS_PAL,
668 .audio_hook = terratv_audio,
669 /* GPIO wiring:
670 External 20 pin connector (for Active Radio Upgrade board)
671 gpio00: i2c-sda
672 gpio01: i2c-scl
673 gpio02: om5610-data
674 gpio03: om5610-clk
675 gpio04: om5610-wre
676 gpio05: om5610-stereo
677 gpio06: rds6588-davn
678 gpio07: Pin 7 n.c.
679 gpio08: nIOW
680 gpio09+10: nIOR, nSEL ?? (bt878)
681 gpio09: nIOR (bt848)
682 gpio10: nSEL (bt848)
683 Sound Routing:
684 gpio16: u2-A0 (1st 4052bt)
685 gpio17: u2-A1
686 gpio18: u2-nEN
687 gpio19: u4-A0 (2nd 4052)
688 gpio20: u4-A1
689 u4-nEN - GND
690 Btspy:
691 00000 : Cdrom (internal audio input)
692 10000 : ext. Video audio input
693 20000 : TV Mono
694 a0000 : TV Mono/2
695 1a0000 : TV Stereo
696 30000 : Radio
697 40000 : Mute
698 */
699
700},{
701 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
702 .name = "Imagenation PXC200",
703 .video_inputs = 5,
704 .audio_inputs = 1,
705 .tuner = -1,
706 .svhs = 1, /* was: 4 */
707 .gpiomask = 0,
708 .muxsel = { 2, 3, 1, 0, 0},
709 .audiomux = { 0 },
710 .needs_tvaudio = 1,
711 .tuner_type = -1,
712 .muxsel_hook = PXC200_muxsel,
713
714},{
715 .name = "Lifeview FlyVideo 98 LR50",
716 .video_inputs = 4,
717 .audio_inputs = 1,
718 .tuner = 0,
719 .svhs = 2,
720 .gpiomask = 0x1800, //0x8dfe00
721 .muxsel = { 2, 3, 1, 1},
722 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
723 .pll = PLL_28,
724 .tuner_type = -1,
725},{
726 .name = "Formac iProTV, Formac ProTV I (bt848)",
727 .video_inputs = 4,
728 .audio_inputs = 1,
729 .tuner = 0,
730 .svhs = 3,
731 .gpiomask = 1,
732 .muxsel = { 2, 3, 1, 1},
733 .audiomux = { 1, 0, 0, 0, 0 },
734 .pll = PLL_28,
735 .tuner_type = TUNER_PHILIPS_PAL,
736},{
737
738/* ---- card 0x20 ---------------------------------- */
739 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
740 .video_inputs = 4,
741 .audio_inputs = 0,
742 .tuner = -1,
743 .svhs = 2,
744 .gpiomask = 0,
745 .muxsel = { 2, 3, 1, 1},
746 .audiomux = { 0 },
747 .needs_tvaudio = 0,
748 .tuner_type = 4,
749},{
750 .name = "Terratec TerraTValue Version Bt878",
751 .video_inputs = 3,
752 .audio_inputs = 1,
753 .tuner = 0,
754 .svhs = 2,
755 .gpiomask = 0xffff00,
756 .muxsel = { 2, 3, 1, 1},
757 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
758 .needs_tvaudio = 1,
759 .pll = PLL_28,
760 .tuner_type = TUNER_PHILIPS_PAL,
761},{
762 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
763 .video_inputs = 4,
764 .audio_inputs = 1,
765 .tuner = 0,
766 .svhs = 2,
767 .muxsel = { 2, 3, 1, 1, 0}, // TV, CVid, SVid, CVid over SVid connector
768#if 0
769 .gpiomask = 0xc33000,
770 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
771#else
772 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
773 .gpiomask = 0xb33000,
774 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
775#endif
776 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
777 gpio23 -- hef4052:nEnable (0x800000)
778 gpio12 -- hef4052:A1
779 gpio13 -- hef4052:A0
780 0x0000: external audio
781 0x1000: FM
782 0x2000: TV
783 0x3000: n.c.
784 Note: There exists another variant "Winfast 2000" with tv stereo !?
785 Note: eeprom only contains FF and pci subsystem id 107d:6606
786 */
787 .needs_tvaudio = 0,
788 .pll = PLL_28,
789 .has_radio = 1,
790 .tuner_type = 5, // default for now, gpio reads BFFF06 for Pal bg+dk
791 .audio_hook = winfast2000_audio,
792 .has_remote = 1,
793},{
794 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
795 .video_inputs = 4,
796 .audio_inputs = 3,
797 .tuner = 0,
798 .svhs = 2,
799 .gpiomask = 0x1800,
800 .muxsel = { 2, 3, 1, 1},
801 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
802 .pll = PLL_28,
803 .tuner_type = -1,
804},{
805
806/* ---- card 0x24 ---------------------------------- */
807 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
808 .video_inputs = 4,
809 .audio_inputs = 3,
810 .tuner = 0,
811 .svhs = 2,
812 .gpiomask = 0x1800,
813 .muxsel = { 2, 3, 1, 1},
814 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
815 .pll = PLL_28,
816 .tuner_type = -1,
817 .has_radio = 1,
818},{
819 .name = "Prolink PixelView PlayTV pro",
820 .video_inputs = 3,
821 .audio_inputs = 1,
822 .tuner = 0,
823 .svhs = 2,
824 .gpiomask = 0xff,
825 .muxsel = { 2, 3, 1, 1 },
826 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
827 .no_msp34xx = 1,
828 .pll = PLL_28,
829 .tuner_type = -1,
830},{
831 .name = "Askey CPH06X TView99",
832 .video_inputs = 4,
833 .audio_inputs = 1,
834 .tuner = 0,
835 .svhs = 2,
836 .gpiomask = 0x551e00,
837 .muxsel = { 2, 3, 1, 0},
838 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
839 .needs_tvaudio = 1,
840 .pll = PLL_28,
841 .tuner_type = 1,
842 .has_remote = 1,
843},{
844 .name = "Pinnacle PCTV Studio/Rave",
845 .video_inputs = 3,
846 .audio_inputs = 1,
847 .tuner = 0,
848 .svhs = 2,
849 .gpiomask = 0x03000F,
850 .muxsel = { 2, 3, 1, 1},
851 .audiomux = { 2, 0xd0001, 0, 0, 1},
852 .needs_tvaudio = 0,
853 .pll = PLL_28,
854 .tuner_type = -1,
855},{
856
857/* ---- card 0x28 ---------------------------------- */
858 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
859 .video_inputs = 3,
860 .audio_inputs = 1,
861 .tuner = 0,
862 .svhs = 2,
863 .gpiomask = 7,
864 .muxsel = { 2, 3, 1, 1},
865 .audiomux = { 4, 0, 2, 3, 1},
866 .no_msp34xx = 1,
867 .needs_tvaudio = 1,
868 .tuner_type = TUNER_PHILIPS_NTSC,
869 .pll = PLL_28,
870 .has_radio = 1,
871},{
872 .name = "AVerMedia TVPhone 98",
873 .video_inputs = 3,
874 .audio_inputs = 4,
875 .tuner = 0,
876 .svhs = 2,
877 .gpiomask = 15,
878 .muxsel = { 2, 3, 1, 1},
879 .audiomux = { 13, 4, 11, 7, 0, 0},
880 .needs_tvaudio = 1,
881 .pll = PLL_28,
882 .tuner_type = -1,
883 .has_radio = 1,
884 .audio_hook = avermedia_tvphone_audio,
885},{
886 .name = "ProVideo PV951", /* pic16c54 */
887 .video_inputs = 3,
888 .audio_inputs = 1,
889 .tuner = 0,
890 .svhs = 2,
891 .gpiomask = 0,
892 .muxsel = { 2, 3, 1, 1},
893 .audiomux = { 0, 0, 0, 0, 0},
894 .needs_tvaudio = 1,
895 .no_msp34xx = 1,
896 .pll = PLL_28,
897 .tuner_type = 1,
898},{
899 .name = "Little OnAir TV",
900 .video_inputs = 3,
901 .audio_inputs = 1,
902 .tuner = 0,
903 .svhs = 2,
904 .gpiomask = 0xe00b,
905 .muxsel = {2, 3, 1, 1},
906 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
907 .no_msp34xx = 1,
908 .tuner_type = -1,
909},{
910
911/* ---- card 0x2c ---------------------------------- */
912 .name = "Sigma TVII-FM",
913 .video_inputs = 2,
914 .audio_inputs = 1,
915 .tuner = 0,
916 .svhs = -1,
917 .gpiomask = 3,
918 .muxsel = {2, 3, 1, 1},
919 .audiomux = {1, 1, 0, 2, 3},
920 .no_msp34xx = 1,
921 .pll = PLL_NONE,
922 .tuner_type = -1,
923},{
924 .name = "MATRIX-Vision MV-Delta 2",
925 .video_inputs = 5,
926 .audio_inputs = 1,
927 .tuner = -1,
928 .svhs = 3,
929 .gpiomask = 0,
930 .muxsel = { 2, 3, 1, 0, 0},
931 .audiomux = {0 },
932 .no_msp34xx = 1,
933 .pll = PLL_28,
934 .tuner_type = -1,
935},{
936 .name = "Zoltrix Genie TV/FM",
937 .video_inputs = 3,
938 .audio_inputs = 1,
939 .tuner = 0,
940 .svhs = 2,
941 .gpiomask = 0xbcf03f,
942 .muxsel = { 2, 3, 1, 1},
943 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
944 .no_msp34xx = 1,
945 .pll = PLL_28,
946 .tuner_type = 21,
947},{
948 .name = "Terratec TV/Radio+",
949 .video_inputs = 3,
950 .audio_inputs = 1,
951 .tuner = 0,
952 .svhs = 2,
953 .gpiomask = 0x70000,
954 .muxsel = { 2, 3, 1, 1},
955 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
956 .needs_tvaudio = 1,
957 .no_msp34xx = 1,
958 .pll = PLL_35,
959 .tuner_type = 1,
960 .has_radio = 1,
961},{
962
963/* ---- card 0x30 ---------------------------------- */
964 .name = "Askey CPH03x/ Dynalink Magic TView",
965 .video_inputs = 3,
966 .audio_inputs = 1,
967 .tuner = 0,
968 .svhs = 2,
969 .gpiomask = 15,
970 .muxsel = { 2, 3, 1, 1},
971 .audiomux = {2,0,0,0,1},
972 .needs_tvaudio = 1,
973 .pll = PLL_28,
974 .tuner_type = -1,
975},{
976 .name = "IODATA GV-BCTV3/PCI",
977 .video_inputs = 3,
978 .audio_inputs = 1,
979 .tuner = 0,
980 .svhs = 2,
981 .gpiomask = 0x010f00,
982 .muxsel = {2, 3, 0, 0},
983 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
984 .no_msp34xx = 1,
985 .pll = PLL_28,
986 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
987 .audio_hook = gvbctv3pci_audio,
988},{
989 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
990 .video_inputs = 5,
991 .audio_inputs = 1,
992 .tuner = 0,
993 .svhs = 3,
994 .gpiomask = 0xAA0000,
995 .muxsel = { 2,3,1,1,-1 },
996 .digital_mode = DIGITAL_MODE_CAMERA,
997 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
998 .no_msp34xx = 1,
999 .pll = PLL_28,
1000 .tuner_type = TUNER_PHILIPS_PAL_I,
1001 .has_remote = 1,
1002 /* GPIO wiring: (different from Rev.4C !)
1003 GPIO17: U4.A0 (first hef4052bt)
1004 GPIO19: U4.A1
1005 GPIO20: U5.A1 (second hef4052bt)
1006 GPIO21: U4.nEN
1007 GPIO22: BT832 Reset Line
1008 GPIO23: A5,A0, U5,nEN
1009 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1010 */
1011},{
1012 .name = "Eagle Wireless Capricorn2 (bt878A)",
1013 .video_inputs = 4,
1014 .audio_inputs = 1,
1015 .tuner = 0,
1016 .svhs = 2,
1017 .gpiomask = 7,
1018 .muxsel = { 2, 0, 1, 1},
1019 .audiomux = { 0, 1, 2, 3, 4},
1020 .pll = PLL_28,
1021 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1022},{
1023
1024/* ---- card 0x34 ---------------------------------- */
1025