[PATCH] v4l: 794: added asound skyeye bttv card
[linux-2.6.git] / drivers / media / video / bttv-cards.c
blob8544a8fa2a5cfff752158c5775899688db42fd32
1 /*
3 bttv-cards.c
5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/config.h>
29 #include <linux/delay.h>
30 #include <linux/module.h>
31 #include <linux/moduleparam.h>
32 #include <linux/kmod.h>
33 #include <linux/init.h>
34 #include <linux/pci.h>
35 #include <linux/vmalloc.h>
36 #include <linux/firmware.h>
38 #include <asm/io.h>
40 #include "bttvp.h"
42 /* fwd decl */
43 static void boot_msp34xx(struct bttv *btv, int pin);
44 static void boot_bt832(struct bttv *btv);
45 static void hauppauge_eeprom(struct bttv *btv);
46 static void avermedia_eeprom(struct bttv *btv);
47 static void osprey_eeprom(struct bttv *btv);
48 static void modtec_eeprom(struct bttv *btv);
49 static void init_PXC200(struct bttv *btv);
50 static void init_RTV24(struct bttv *btv);
52 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
53 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
54 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
55 int set);
56 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
57 int set);
58 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
59 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
60 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void rv605_muxsel(struct bttv *btv, unsigned int input);
67 static void eagle_muxsel(struct bttv *btv, unsigned int input);
68 static void xguard_muxsel(struct bttv *btv, unsigned int input);
69 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
70 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
72 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
74 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
75 static void picolo_tetra_init(struct bttv *btv);
77 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
78 static void tibetCS16_init(struct bttv *btv);
80 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
81 static void kodicom4400r_init(struct bttv *btv);
83 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
84 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
86 static int terratec_active_radio_upgrade(struct bttv *btv);
87 static int tea5757_read(struct bttv *btv);
88 static int tea5757_write(struct bttv *btv, int value);
89 static void identify_by_eeprom(struct bttv *btv,
90 unsigned char eeprom_data[256]);
91 static int __devinit pvr_boot(struct bttv *btv);
93 /* config variables */
94 static unsigned int triton1=0;
95 static unsigned int vsfx=0;
96 static unsigned int latency = UNSET;
97 int no_overlay=-1;
99 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
105 #ifdef MODULE
106 static unsigned int autoload = 1;
107 #else
108 static unsigned int autoload = 0;
109 #endif
110 static unsigned int gpiomask = UNSET;
111 static unsigned int audioall = UNSET;
112 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
114 /* insmod options */
115 module_param(triton1, int, 0444);
116 module_param(vsfx, int, 0444);
117 module_param(no_overlay, int, 0444);
118 module_param(latency, int, 0444);
119 module_param(gpiomask, int, 0444);
120 module_param(audioall, int, 0444);
121 module_param(autoload, int, 0444);
123 module_param_array(card, int, NULL, 0444);
124 module_param_array(pll, int, NULL, 0444);
125 module_param_array(tuner, int, NULL, 0444);
126 module_param_array(svhs, int, NULL, 0444);
127 module_param_array(remote, int, NULL, 0444);
128 module_param_array(audiomux, int, NULL, 0444);
130 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
131 "[enable bug compatibility for triton1 + others]");
132 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
133 "[yet another chipset flaw workaround]");
134 MODULE_PARM_DESC(latency,"pci latency timer");
135 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
136 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
137 MODULE_PARM_DESC(tuner,"specify installed tuner type");
138 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
140 /* ----------------------------------------------------------------------- */
141 /* list of card IDs for bt878+ cards */
143 static struct CARD {
144 unsigned id;
145 int cardnr;
146 char *name;
147 } cards[] __devinitdata = {
148 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
149 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
150 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
151 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
152 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
153 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
154 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
155 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
156 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
158 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
159 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
161 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
162 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
172 /* some cards ship with byteswapped IDs ... */
173 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
174 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
175 /* this seems to happen as well ... */
176 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
178 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
180 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
182 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
183 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
184 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
185 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
186 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
187 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
188 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
190 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
191 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
192 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
194 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
196 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
197 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
198 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
199 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
201 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
202 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
203 /* clashes with FlyVideo
204 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
205 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
206 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
207 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
208 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
210 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
212 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
217 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
218 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
219 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
220 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
222 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
223 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
224 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
225 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
227 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
228 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
229 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
230 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
232 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
233 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
234 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
235 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
236 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
238 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
239 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
240 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
242 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
243 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
244 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
259 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
261 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
263 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
264 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
265 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
266 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
268 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
269 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
271 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
272 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
274 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
275 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
276 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
285 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
286 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
287 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
288 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
290 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
292 /* likely broken, vendor id doesn't match the other magic views ...
293 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
295 /* DVB cards (using pci function .1 for mpeg data xfer) */
296 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
297 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
298 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
299 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
300 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
301 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
302 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
303 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
304 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
306 { 0, -1, NULL }
309 /* ----------------------------------------------------------------------- */
310 /* array with description for bt848 / bt878 tv/grabber cards */
312 struct tvcard bttv_tvcards[] = {
313 /* ---- card 0x00 ---------------------------------- */
314 [BTTV_BOARD_UNKNOWN] = {
315 .name = " *** UNKNOWN/GENERIC *** ",
316 .video_inputs = 4,
317 .audio_inputs = 1,
318 .tuner = 0,
319 .svhs = 2,
320 .muxsel = { 2, 3, 1, 0},
321 .tuner_type = -1,
322 .tuner_addr = ADDR_UNSET,
323 .radio_addr = ADDR_UNSET,
325 [BTTV_BOARD_MIRO] = {
326 .name = "MIRO PCTV",
327 .video_inputs = 4,
328 .audio_inputs = 1,
329 .tuner = 0,
330 .svhs = 2,
331 .gpiomask = 15,
332 .muxsel = { 2, 3, 1, 1},
333 .audiomux = { 2, 0, 0, 0, 10},
334 .needs_tvaudio = 1,
335 .tuner_type = -1,
336 .tuner_addr = ADDR_UNSET,
337 .radio_addr = ADDR_UNSET,
339 [BTTV_BOARD_HAUPPAUGE] = {
340 .name = "Hauppauge (bt848)",
341 .video_inputs = 4,
342 .audio_inputs = 1,
343 .tuner = 0,
344 .svhs = 2,
345 .gpiomask = 7,
346 .muxsel = { 2, 3, 1, 1},
347 .audiomux = { 0, 1, 2, 3, 4},
348 .needs_tvaudio = 1,
349 .tuner_type = -1,
350 .tuner_addr = ADDR_UNSET,
351 .radio_addr = ADDR_UNSET,
353 [BTTV_BOARD_STB] = {
354 .name = "STB, Gateway P/N 6000699 (bt848)",
355 .video_inputs = 3,
356 .audio_inputs = 1,
357 .tuner = 0,
358 .svhs = 2,
359 .gpiomask = 7,
360 .muxsel = { 2, 3, 1, 1},
361 .audiomux = { 4, 0, 2, 3, 1},
362 .no_msp34xx = 1,
363 .needs_tvaudio = 1,
364 .tuner_type = TUNER_PHILIPS_NTSC,
365 .tuner_addr = ADDR_UNSET,
366 .radio_addr = ADDR_UNSET,
367 .pll = PLL_28,
368 .has_radio = 1,
371 /* ---- card 0x04 ---------------------------------- */
372 [BTTV_BOARD_INTEL] = {
373 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
374 .video_inputs = 4,
375 .audio_inputs = 0,
376 .tuner = -1,
377 .svhs = 2,
378 .gpiomask = 0,
379 .muxsel = { 2, 3, 1, 1},
380 .audiomux = { 0 },
381 .needs_tvaudio = 0,
382 .tuner_type = 4,
383 .tuner_addr = ADDR_UNSET,
384 .radio_addr = ADDR_UNSET,
386 [BTTV_BOARD_DIAMOND] = {
387 .name = "Diamond DTV2000",
388 .video_inputs = 4,
389 .audio_inputs = 1,
390 .tuner = 0,
391 .svhs = 2,
392 .gpiomask = 3,
393 .muxsel = { 2, 3, 1, 0},
394 .audiomux = { 0, 1, 0, 1, 3},
395 .needs_tvaudio = 1,
396 .tuner_type = -1,
397 .tuner_addr = ADDR_UNSET,
398 .radio_addr = ADDR_UNSET,
400 [BTTV_BOARD_AVERMEDIA] = {
401 .name = "AVerMedia TVPhone",
402 .video_inputs = 3,
403 .audio_inputs = 1,
404 .tuner = 0,
405 .svhs = 3,
406 .muxsel = { 2, 3, 1, 1},
407 .gpiomask = 0x0f,
408 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
409 /* 0x04 for some cards ?? */
410 .needs_tvaudio = 1,
411 .tuner_type = -1,
412 .tuner_addr = ADDR_UNSET,
413 .radio_addr = ADDR_UNSET,
414 .audio_hook = avermedia_tvphone_audio,
415 .has_remote = 1,
417 [BTTV_BOARD_MATRIX_VISION] = {
418 .name = "MATRIX-Vision MV-Delta",
419 .video_inputs = 5,
420 .audio_inputs = 1,
421 .tuner = -1,
422 .svhs = 3,
423 .gpiomask = 0,
424 .muxsel = { 2, 3, 1, 0, 0},
425 .audiomux = {0 },
426 .needs_tvaudio = 1,
427 .tuner_type = -1,
428 .tuner_addr = ADDR_UNSET,
429 .radio_addr = ADDR_UNSET,
432 /* ---- card 0x08 ---------------------------------- */
433 [BTTV_BOARD_FLYVIDEO] = {
434 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
435 .video_inputs = 4,
436 .audio_inputs = 1,
437 .tuner = 0,
438 .svhs = 2,
439 .gpiomask = 0xc00,
440 .muxsel = { 2, 3, 1, 1},
441 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
442 .needs_tvaudio = 1,
443 .pll = PLL_28,
444 .tuner_type = -1,
445 .tuner_addr = ADDR_UNSET,
446 .radio_addr = ADDR_UNSET,
448 [BTTV_BOARD_TURBOTV] = {
449 .name = "IMS/IXmicro TurboTV",
450 .video_inputs = 3,
451 .audio_inputs = 1,
452 .tuner = 0,
453 .svhs = 2,
454 .gpiomask = 3,
455 .muxsel = { 2, 3, 1, 1},
456 .audiomux = { 1, 1, 2, 3, 0},
457 .needs_tvaudio = 0,
458 .pll = PLL_28,
459 .tuner_type = TUNER_TEMIC_PAL,
460 .tuner_addr = ADDR_UNSET,
461 .radio_addr = ADDR_UNSET,
463 [BTTV_BOARD_HAUPPAUGE878] = {
464 .name = "Hauppauge (bt878)",
465 .video_inputs = 4,
466 .audio_inputs = 1,
467 .tuner = 0,
468 .svhs = 2,
469 .gpiomask = 0x0f, /* old: 7 */
470 .muxsel = { 2, 0, 1, 1},
471 .audiomux = { 0, 1, 2, 3, 4},
472 .needs_tvaudio = 1,
473 .pll = PLL_28,
474 .tuner_type = -1,
475 .tuner_addr = ADDR_UNSET,
476 .radio_addr = ADDR_UNSET,
478 [BTTV_BOARD_MIROPRO] = {
479 .name = "MIRO PCTV pro",
480 .video_inputs = 3,
481 .audio_inputs = 1,
482 .tuner = 0,
483 .svhs = 2,
484 .gpiomask = 0x3014f,
485 .muxsel = { 2, 3, 1, 1},
486 .audiomux = { 0x20001,0x10001, 0, 0,10},
487 .needs_tvaudio = 1,
488 .tuner_type = -1,
489 .tuner_addr = ADDR_UNSET,
490 .radio_addr = ADDR_UNSET,
493 /* ---- card 0x0c ---------------------------------- */
494 [BTTV_BOARD_ADSTECH_TV] = {
495 .name = "ADS Technologies Channel Surfer TV (bt848)",
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 = { 13, 14, 11, 7, 0, 0},
503 .needs_tvaudio = 1,
504 .tuner_type = -1,
505 .tuner_addr = ADDR_UNSET,
506 .radio_addr = ADDR_UNSET,
508 [BTTV_BOARD_AVERMEDIA98] = {
509 .name = "AVerMedia TVCapture 98",
510 .video_inputs = 3,
511 .audio_inputs = 4,
512 .tuner = 0,
513 .svhs = 2,
514 .gpiomask = 15,
515 .muxsel = { 2, 3, 1, 1},
516 .audiomux = { 13, 14, 11, 7, 0, 0},
517 .needs_tvaudio = 1,
518 .msp34xx_alt = 1,
519 .pll = PLL_28,
520 .tuner_type = TUNER_PHILIPS_PAL,
521 .tuner_addr = ADDR_UNSET,
522 .radio_addr = ADDR_UNSET,
523 .audio_hook = avermedia_tv_stereo_audio,
525 [BTTV_BOARD_VHX] = {
526 .name = "Aimslab Video Highway Xtreme (VHX)",
527 .video_inputs = 3,
528 .audio_inputs = 1,
529 .tuner = 0,
530 .svhs = 2,
531 .gpiomask = 7,
532 .muxsel = { 2, 3, 1, 1},
533 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
534 .needs_tvaudio = 1,
535 .pll = PLL_28,
536 .tuner_type = -1,
537 .tuner_addr = ADDR_UNSET,
538 .radio_addr = ADDR_UNSET,
540 [BTTV_BOARD_ZOLTRIX] = {
541 .name = "Zoltrix TV-Max",
542 .video_inputs = 3,
543 .audio_inputs = 1,
544 .tuner = 0,
545 .svhs = 2,
546 .gpiomask = 15,
547 .muxsel = { 2, 3, 1, 1},
548 .audiomux = {0 , 0, 1 , 0, 10},
549 .needs_tvaudio = 1,
550 .tuner_type = -1,
551 .tuner_addr = ADDR_UNSET,
552 .radio_addr = ADDR_UNSET,
555 /* ---- card 0x10 ---------------------------------- */
556 [BTTV_BOARD_PIXVIEWPLAYTV] = {
557 .name = "Prolink Pixelview PlayTV (bt878)",
558 .video_inputs = 3,
559 .audio_inputs = 1,
560 .tuner = 0,
561 .svhs = 2,
562 .gpiomask = 0x01fe00,
563 .muxsel = { 2, 3, 1, 1},
564 #if 0
565 /* old */
566 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
567 #else
568 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
569 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
570 #endif
571 .needs_tvaudio = 1,
572 .pll = PLL_28,
573 .tuner_type = -1,
575 [BTTV_BOARD_WINVIEW_601] = {
576 .name = "Leadtek WinView 601",
577 .video_inputs = 3,
578 .audio_inputs = 1,
579 .tuner = 0,
580 .svhs = 2,
581 .gpiomask = 0x8300f8,
582 .muxsel = { 2, 3, 1, 1,0},
583 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
584 .needs_tvaudio = 1,
585 .tuner_type = -1,
586 .tuner_addr = ADDR_UNSET,
587 .radio_addr = ADDR_UNSET,
588 .audio_hook = winview_audio,
589 .has_radio = 1,
591 [BTTV_BOARD_AVEC_INTERCAP] = {
592 .name = "AVEC Intercapture",
593 .video_inputs = 3,
594 .audio_inputs = 2,
595 .tuner = 0,
596 .svhs = 2,
597 .gpiomask = 0,
598 .muxsel = {2, 3, 1, 1},
599 .audiomux = {1, 0, 0, 0, 0},
600 .needs_tvaudio = 1,
601 .tuner_type = -1,
602 .tuner_addr = ADDR_UNSET,
603 .radio_addr = ADDR_UNSET,
605 [BTTV_BOARD_LIFE_FLYKIT] = {
606 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
607 .video_inputs = 4,
608 .audio_inputs = 1,
609 .tuner = -1,
610 .svhs = -1,
611 .gpiomask = 0x8dff00,
612 .muxsel = { 2, 3, 1, 1},
613 .audiomux = { 0 },
614 .no_msp34xx = 1,
615 .tuner_type = -1,
616 .tuner_addr = ADDR_UNSET,
617 .radio_addr = ADDR_UNSET,
620 /* ---- card 0x14 ---------------------------------- */
621 [BTTV_BOARD_CEI_RAFFLES] = {
622 .name = "CEI Raffles Card",
623 .video_inputs = 3,
624 .audio_inputs = 3,
625 .tuner = 0,
626 .svhs = 2,
627 .muxsel = {2, 3, 1, 1},
628 .tuner_type = -1,
629 .tuner_addr = ADDR_UNSET,
630 .radio_addr = ADDR_UNSET,
632 [BTTV_BOARD_CONFERENCETV] = {
633 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
634 .video_inputs = 4,
635 .audio_inputs = 2, /* tuner, line in */
636 .tuner = 0,
637 .svhs = 2,
638 .gpiomask = 0x1800,
639 .muxsel = { 2, 3, 1, 1},
640 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
641 .pll = PLL_28,
642 .tuner_type = TUNER_PHILIPS_PAL_I,
643 .tuner_addr = ADDR_UNSET,
644 .radio_addr = ADDR_UNSET,
646 [BTTV_BOARD_PHOEBE_TVMAS] = {
647 .name = "Askey CPH050/ Phoebe Tv Master + FM",
648 .video_inputs = 3,
649 .audio_inputs = 1,
650 .tuner = 0,
651 .svhs = 2,
652 .gpiomask = 0xc00,
653 .muxsel = { 2, 3, 1, 1},
654 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
655 .needs_tvaudio = 1,
656 .pll = PLL_28,
657 .tuner_type = -1,
658 .tuner_addr = ADDR_UNSET,
659 .radio_addr = ADDR_UNSET,
661 [BTTV_BOARD_MODTEC_205] = {
662 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
663 .video_inputs = 3,
664 .audio_inputs = 1,
665 .tuner = 0,
666 .svhs = -1,
667 .gpiomask = 7,
668 .muxsel = { 2, 3, -1 },
669 .digital_mode = DIGITAL_MODE_CAMERA,
670 .audiomux = { 0, 0, 0, 0, 0 },
671 .no_msp34xx = 1,
672 .pll = PLL_28,
673 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
674 .tuner_addr = ADDR_UNSET,
675 .radio_addr = ADDR_UNSET,
678 /* ---- card 0x18 ---------------------------------- */
679 [BTTV_BOARD_MAGICTVIEW061] = {
680 .name = "Askey CPH05X/06X (bt878) [many vendors]",
681 .video_inputs = 3,
682 .audio_inputs = 1,
683 .tuner = 0,
684 .svhs = 2,
685 .gpiomask = 0xe00,
686 .muxsel = { 2, 3, 1, 1},
687 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
688 .needs_tvaudio = 1,
689 .pll = PLL_28,
690 .tuner_type = -1,
691 .tuner_addr = ADDR_UNSET,
692 .radio_addr = ADDR_UNSET,
693 .has_remote = 1,
695 [BTTV_BOARD_VOBIS_BOOSTAR] = {
696 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
697 .video_inputs = 3,
698 .audio_inputs = 1,
699 .tuner = 0,
700 .svhs = 2,
701 .gpiomask = 0x1f0fff,
702 .muxsel = { 2, 3, 1, 1},
703 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
704 .needs_tvaudio = 0,
705 .tuner_type = TUNER_PHILIPS_PAL,
706 .tuner_addr = ADDR_UNSET,
707 .radio_addr = ADDR_UNSET,
708 .audio_hook = terratv_audio,
710 [BTTV_BOARD_HAUPPAUG_WCAM] = {
711 .name = "Hauppauge WinCam newer (bt878)",
712 .video_inputs = 4,
713 .audio_inputs = 1,
714 .tuner = 0,
715 .svhs = 3,
716 .gpiomask = 7,
717 .muxsel = { 2, 0, 1, 1},
718 .audiomux = { 0, 1, 2, 3, 4},
719 .needs_tvaudio = 1,
720 .tuner_type = -1,
721 .tuner_addr = ADDR_UNSET,
722 .radio_addr = ADDR_UNSET,
724 [BTTV_BOARD_MAXI] = {
725 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
726 .video_inputs = 4,
727 .audio_inputs = 2,
728 .tuner = 0,
729 .svhs = 2,
730 .gpiomask = 0x1800,
731 .muxsel = { 2, 3, 1, 1},
732 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
733 .pll = PLL_28,
734 .tuner_type = TUNER_PHILIPS_SECAM,
735 .tuner_addr = ADDR_UNSET,
736 .radio_addr = ADDR_UNSET,
739 /* ---- card 0x1c ---------------------------------- */
740 [BTTV_BOARD_TERRATV] = {
741 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
742 .video_inputs = 3,
743 .audio_inputs = 1,
744 .tuner = 0,
745 .svhs = 2,
746 .gpiomask = 0x1f0fff,
747 .muxsel = { 2, 3, 1, 1},
748 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
749 .needs_tvaudio = 0,
750 .tuner_type = TUNER_PHILIPS_PAL,
751 .tuner_addr = ADDR_UNSET,
752 .radio_addr = ADDR_UNSET,
753 .audio_hook = terratv_audio,
754 /* GPIO wiring:
755 External 20 pin connector (for Active Radio Upgrade board)
756 gpio00: i2c-sda
757 gpio01: i2c-scl
758 gpio02: om5610-data
759 gpio03: om5610-clk
760 gpio04: om5610-wre
761 gpio05: om5610-stereo
762 gpio06: rds6588-davn
763 gpio07: Pin 7 n.c.
764 gpio08: nIOW
765 gpio09+10: nIOR, nSEL ?? (bt878)
766 gpio09: nIOR (bt848)
767 gpio10: nSEL (bt848)
768 Sound Routing:
769 gpio16: u2-A0 (1st 4052bt)
770 gpio17: u2-A1
771 gpio18: u2-nEN
772 gpio19: u4-A0 (2nd 4052)
773 gpio20: u4-A1
774 u4-nEN - GND
775 Btspy:
776 00000 : Cdrom (internal audio input)
777 10000 : ext. Video audio input
778 20000 : TV Mono
779 a0000 : TV Mono/2
780 1a0000 : TV Stereo
781 30000 : Radio
782 40000 : Mute
786 [BTTV_BOARD_PXC200] = {
787 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
788 .name = "Imagenation PXC200",
789 .video_inputs = 5,
790 .audio_inputs = 1,
791 .tuner = -1,
792 .svhs = 1, /* was: 4 */
793 .gpiomask = 0,
794 .muxsel = { 2, 3, 1, 0, 0},
795 .audiomux = { 0 },
796 .needs_tvaudio = 1,
797 .tuner_type = -1,
798 .tuner_addr = ADDR_UNSET,
799 .radio_addr = ADDR_UNSET,
800 .muxsel_hook = PXC200_muxsel,
803 [BTTV_BOARD_FLYVIDEO_98] = {
804 .name = "Lifeview FlyVideo 98 LR50",
805 .video_inputs = 4,
806 .audio_inputs = 1,
807 .tuner = 0,
808 .svhs = 2,
809 .gpiomask = 0x1800, /* 0x8dfe00 */
810 .muxsel = { 2, 3, 1, 1},
811 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
812 .pll = PLL_28,
813 .tuner_type = -1,
814 .tuner_addr = ADDR_UNSET,
815 .radio_addr = ADDR_UNSET,
817 [BTTV_BOARD_IPROTV] = {
818 .name = "Formac iProTV, Formac ProTV I (bt848)",
819 .video_inputs = 4,
820 .audio_inputs = 1,
821 .tuner = 0,
822 .svhs = 3,
823 .gpiomask = 1,
824 .muxsel = { 2, 3, 1, 1},
825 .audiomux = { 1, 0, 0, 0, 0 },
826 .pll = PLL_28,
827 .tuner_type = TUNER_PHILIPS_PAL,
828 .tuner_addr = ADDR_UNSET,
829 .radio_addr = ADDR_UNSET,
832 /* ---- card 0x20 ---------------------------------- */
833 [BTTV_BOARD_INTEL_C_S_PCI] = {
834 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
835 .video_inputs = 4,
836 .audio_inputs = 0,
837 .tuner = -1,
838 .svhs = 2,
839 .gpiomask = 0,
840 .muxsel = { 2, 3, 1, 1},
841 .audiomux = { 0 },
842 .needs_tvaudio = 0,
843 .tuner_type = 4,
844 .tuner_addr = ADDR_UNSET,
845 .radio_addr = ADDR_UNSET,
847 [BTTV_BOARD_TERRATVALUE] = {
848 .name = "Terratec TerraTValue Version Bt878",
849 .video_inputs = 3,
850 .audio_inputs = 1,
851 .tuner = 0,
852 .svhs = 2,
853 .gpiomask = 0xffff00,
854 .muxsel = { 2, 3, 1, 1},
855 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
856 .needs_tvaudio = 1,
857 .pll = PLL_28,
858 .tuner_type = TUNER_PHILIPS_PAL,
859 .tuner_addr = ADDR_UNSET,
860 .radio_addr = ADDR_UNSET,
862 [BTTV_BOARD_WINFAST2000] = {
863 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
864 .video_inputs = 4,
865 .audio_inputs = 1,
866 .tuner = 0,
867 .svhs = 2,
868 .muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
869 #if 0
870 .gpiomask = 0xc33000,
871 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
872 #else
873 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
874 .gpiomask = 0xb33000,
875 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
876 #endif
877 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
878 gpio23 -- hef4052:nEnable (0x800000)
879 gpio12 -- hef4052:A1
880 gpio13 -- hef4052:A0
881 0x0000: external audio
882 0x1000: FM
883 0x2000: TV
884 0x3000: n.c.
885 Note: There exists another variant "Winfast 2000" with tv stereo !?
886 Note: eeprom only contains FF and pci subsystem id 107d:6606
888 .needs_tvaudio = 0,
889 .pll = PLL_28,
890 .has_radio = 1,
891 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
892 .tuner_addr = ADDR_UNSET,
893 .radio_addr = ADDR_UNSET,
894 .audio_hook = winfast2000_audio,
895 .has_remote = 1,
897 [BTTV_BOARD_CHRONOS_VS2] = {
898 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
899 .video_inputs = 4,
900 .audio_inputs = 3,
901 .tuner = 0,
902 .svhs = 2,
903 .gpiomask = 0x1800,
904 .muxsel = { 2, 3, 1, 1},
905 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
906 .pll = PLL_28,
907 .tuner_type = -1,
908 .tuner_addr = ADDR_UNSET,
909 .radio_addr = ADDR_UNSET,
912 /* ---- card 0x24 ---------------------------------- */
913 [BTTV_BOARD_TYPHOON_TVIEW] = {
914 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
915 .video_inputs = 4,
916 .audio_inputs = 3,
917 .tuner = 0,
918 .svhs = 2,
919 .gpiomask = 0x1800,
920 .muxsel = { 2, 3, 1, 1},
921 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
922 .pll = PLL_28,
923 .tuner_type = -1,
924 .tuner_addr = ADDR_UNSET,
925 .radio_addr = ADDR_UNSET,
926 .has_radio = 1,
928 [BTTV_BOARD_PXELVWPLTVPRO] = {
929 .name = "Prolink PixelView PlayTV pro",
930 .video_inputs = 3,
931 .audio_inputs = 1,
932 .tuner = 0,
933 .svhs = 2,
934 .gpiomask = 0xff,
935 .muxsel = { 2, 3, 1, 1 },
936 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
937 .no_msp34xx = 1,
938 .pll = PLL_28,
939 .tuner_type = -1,
940 .tuner_addr = ADDR_UNSET,
941 .radio_addr = ADDR_UNSET,
943 [BTTV_BOARD_MAGICTVIEW063] = {
944 .name = "Askey CPH06X TView99",
945 .video_inputs = 4,
946 .audio_inputs = 1,
947 .tuner = 0,
948 .svhs = 2,
949 .gpiomask = 0x551e00,
950 .muxsel = { 2, 3, 1, 0},
951 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
952 .needs_tvaudio = 1,
953 .pll = PLL_28,
954 .tuner_type = 1,
955 .tuner_addr = ADDR_UNSET,
956 .radio_addr = ADDR_UNSET,
957 .has_remote = 1,
959 [BTTV_BOARD_PINNACLE] = {
960 .name = "Pinnacle PCTV Studio/Rave",
961 .video_inputs = 3,
962 .audio_inputs = 1,
963 .tuner = 0,
964 .svhs = 2,
965 .gpiomask = 0x03000F,
966 .muxsel = { 2, 3, 1, 1},
967 .audiomux = { 2, 0xd0001, 0, 0, 1},
968 .needs_tvaudio = 0,
969 .pll = PLL_28,
970 .tuner_type = -1,
971 .tuner_addr = ADDR_UNSET,
972 .radio_addr = ADDR_UNSET,
975 /* ---- card 0x28 ---------------------------------- */
976 [BTTV_BOARD_STB2] = {
977 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
978 .video_inputs = 3,
979 .audio_inputs = 1,
980 .tuner = 0,
981 .svhs = 2,
982 .gpiomask = 7,
983 .muxsel = { 2, 3, 1, 1},
984 .audiomux = { 4, 0, 2, 3, 1},
985 .no_msp34xx = 1,
986 .needs_tvaudio = 1,
987 .tuner_type = TUNER_PHILIPS_NTSC,
988 .tuner_addr = ADDR_UNSET,
989 .radio_addr = ADDR_UNSET,
990 .pll = PLL_28,
991 .has_radio = 1,
993 [BTTV_BOARD_AVPHONE98] = {
994 .name = "AVerMedia TVPhone 98",
995 .video_inputs = 3,
996 .audio_inputs = 4,
997 .tuner = 0,
998 .svhs = 2,
999 .gpiomask = 15,
1000 .muxsel = { 2, 3, 1, 1},
1001 .audiomux = { 13, 4, 11, 7, 0, 0},
1002 .needs_tvaudio = 1,
1003 .pll = PLL_28,
1004 .tuner_type = -1,
1005 .tuner_addr = ADDR_UNSET,
1006 .radio_addr = ADDR_UNSET,
1007 .has_radio = 1,
1008 .audio_hook = avermedia_tvphone_audio,
1010 [BTTV_BOARD_PV951] = {
1011 .name = "ProVideo PV951", /* pic16c54 */
1012 .video_inputs = 3,
1013 .audio_inputs = 1,
1014 .tuner = 0,
1015 .svhs = 2,
1016 .gpiomask = 0,
1017 .muxsel = { 2, 3, 1, 1},
1018 .audiomux = { 0, 0, 0, 0, 0},
1019 .needs_tvaudio = 1,
1020 .no_msp34xx = 1,
1021 .pll = PLL_28,
1022 .tuner_type = 1,
1023 .tuner_addr = ADDR_UNSET,
1024 .radio_addr = ADDR_UNSET,
1026 [BTTV_BOARD_ONAIR_TV] = {
1027 .name = "Little OnAir TV",
1028 .video_inputs = 3,
1029 .audio_inputs = 1,
1030 .tuner = 0,
1031 .svhs = 2,
1032 .gpiomask = 0xe00b,
1033 .muxsel = {2, 3, 1, 1},
1034 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
1035 .no_msp34xx = 1,
1036 .tuner_type = -1,
1037 .tuner_addr = ADDR_UNSET,
1038 .radio_addr = ADDR_UNSET,
1041 /* ---- card 0x2c ---------------------------------- */
1042 [BTTV_BOARD_SIGMA_TVII_FM] = {
1043 .name = "Sigma TVII-FM",
1044 .video_inputs = 2,
1045 .audio_inputs = 1,
1046 .tuner = 0,
1047 .svhs = -1,
1048 .gpiomask = 3,
1049 .muxsel = {2, 3, 1, 1},
1050 .audiomux = {1, 1, 0, 2, 3},
1051 .no_msp34xx = 1,
1052 .pll = PLL_NONE,
1053 .tuner_type = -1,
1054 .tuner_addr = ADDR_UNSET,
1055 .radio_addr = ADDR_UNSET,
1057 [BTTV_BOARD_MATRIX_VISION2] = {
1058 .name = "MATRIX-Vision MV-Delta 2",
1059 .video_inputs = 5,
1060 .audio_inputs = 1,
1061 .tuner = -1,
1062 .svhs = 3,
1063 .gpiomask = 0,
1064 .muxsel = { 2, 3, 1, 0, 0},
1065 .audiomux = {0 },
1066 .no_msp34xx = 1,
1067 .pll = PLL_28,
1068 .tuner_type = -1,
1069 .tuner_addr = ADDR_UNSET,
1070 .radio_addr = ADDR_UNSET,
1072 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1073 .name = "Zoltrix Genie TV/FM",
1074 .video_inputs = 3,
1075 .audio_inputs = 1,
1076 .tuner = 0,
1077 .svhs = 2,
1078 .gpiomask = 0xbcf03f,
1079 .muxsel = { 2, 3, 1, 1},
1080 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
1081 .no_msp34xx = 1,
1082 .pll = PLL_28,
1083 .tuner_type = 21,
1084 .tuner_addr = ADDR_UNSET,
1085 .radio_addr = ADDR_UNSET,
1087 [BTTV_BOARD_TERRATVRADIO] = {
1088 .name = "Terratec TV/Radio+",
1089 .video_inputs = 3,
1090 .audio_inputs = 1,
1091 .tuner = 0,
1092 .svhs = 2,
1093 .gpiomask = 0x70000,
1094 .muxsel = { 2, 3, 1, 1},
1095 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1096 .needs_tvaudio = 1,
1097 .no_msp34xx = 1,
1098 .pll = PLL_35,
1099 .tuner_type = 1,
1100 .tuner_addr = ADDR_UNSET,
1101 .radio_addr = ADDR_UNSET,
1102 .has_radio = 1,
1105 /* ---- card 0x30 ---------------------------------- */
1106 [BTTV_BOARD_DYNALINK] = {
1107 .name = "Askey CPH03x/ Dynalink Magic TView",
1108 .video_inputs = 3,
1109 .audio_inputs = 1,
1110 .tuner = 0,
1111 .svhs = 2,
1112 .gpiomask = 15,
1113 .muxsel = { 2, 3, 1, 1},
1114 .audiomux = {2,0,0,0,1},
1115 .needs_tvaudio = 1,
1116 .pll = PLL_28,
1117 .tuner_type = -1,
1118 .tuner_addr = ADDR_UNSET,
1119 .radio_addr = ADDR_UNSET,
1121 [BTTV_BOARD_GVBCTV3PCI] = {
1122 .name = "IODATA GV-BCTV3/PCI",
1123 .video_inputs = 3,
1124 .audio_inputs = 1,
1125 .tuner = 0,
1126 .svhs = 2,
1127 .gpiomask = 0x010f00,
1128 .muxsel = {2, 3, 0, 0},
1129 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1130 .no_msp34xx = 1,
1131 .pll = PLL_28,
1132 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1133 .tuner_addr = ADDR_UNSET,
1134 .radio_addr = ADDR_UNSET,
1135 .audio_hook = gvbctv3pci_audio,
1137 [BTTV_BOARD_PXELVWPLTVPAK] = {
1138 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1139 .video_inputs = 5,
1140 .audio_inputs = 1,
1141 .tuner = 0,
1142 .svhs = 3,
1143 .gpiomask = 0xAA0000,
1144 .muxsel = { 2,3,1,1,-1 },
1145 .digital_mode = DIGITAL_MODE_CAMERA,
1146 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1147 .no_msp34xx = 1,
1148 .pll = PLL_28,
1149 .tuner_type = TUNER_PHILIPS_PAL_I,
1150 .tuner_addr = ADDR_UNSET,
1151 .radio_addr = ADDR_UNSET,
1152 .has_remote = 1,
1153 /* GPIO wiring: (different from Rev.4C !)
1154 GPIO17: U4.A0 (first hef4052bt)
1155 GPIO19: U4.A1
1156 GPIO20: U5.A1 (second hef4052bt)
1157 GPIO21: U4.nEN
1158 GPIO22: BT832 Reset Line
1159 GPIO23: A5,A0, U5,nEN
1160 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1163 [BTTV_BOARD_EAGLE] = {
1164 .name = "Eagle Wireless Capricorn2 (bt878A)",
1165 .video_inputs = 4,
1166 .audio_inputs = 1,
1167 .tuner = 0,
1168 .svhs = 2,
1169 .gpiomask = 7,
1170 .muxsel = { 2, 0, 1, 1},
1171 .audiomux = { 0, 1, 2, 3, 4},
1172 .pll = PLL_28,
1173 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1174 .tuner_addr = ADDR_UNSET,
1175 .radio_addr = ADDR_UNSET,
1178 /* ---- card 0x34 ---------------------------------- */
1179 [BTTV_BOARD_PINNACLEPRO] = {
1180 /* David Härdeman <david@2gen.com> */
1181 .name = "Pinnacle PCTV Studio Pro",
1182 .video_inputs = 4,
1183 .audio_inputs = 1,
1184 .tuner = 0,
1185 .svhs = 3,
1186 .gpiomask = 0x03000F,
1187 .muxsel = { 2, 3, 1, 1},
1188 .audiomux = { 1, 0xd0001, 0, 0, 10},
1189 /* sound path (5 sources):
1190 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1191 0= ext. Audio IN
1192 1= from MUX2
1193 2= Mono TV sound from Tuner
1194 3= not connected
1195 MUX2 (mask 0x30000):
1196 0,2,3= from MSP34xx
1197 1= FM stereo Radio from Tuner */
1198 .needs_tvaudio = 0,
1199 .pll = PLL_28,
1200 .tuner_type = -1,
1201 .tuner_addr = ADDR_UNSET,
1202 .radio_addr = ADDR_UNSET,
1204 [BTTV_BOARD_TVIEW_RDS_FM] = {
1205 /* Claas Langbehn <claas@bigfoot.com>,
1206 Sven Grothklags <sven@upb.de> */
1207 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1208 .video_inputs = 4,
1209 .audio_inputs = 3,
1210 .tuner = 0,
1211 .svhs = 2,
1212 .gpiomask = 0x1c,
1213 .muxsel = { 2, 3, 1, 1},
1214 .audiomux = { 0, 0, 0x10, 8, 4 },
1215 .needs_tvaudio = 1,
1216 .pll = PLL_28,
1217 .tuner_type = TUNER_PHILIPS_PAL,
1218 .tuner_addr = ADDR_UNSET,
1219 .radio_addr = ADDR_UNSET,
1220 .has_radio = 1,
1222 [BTTV_BOARD_LIFETEC_9415] = {
1223 /* Tim Röstermundt <rosterm@uni-muenster.de>
1224 in de.comp.os.unix.linux.hardware:
1225 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1226 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1227 options tuner type=5 */
1228 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1229 .video_inputs = 4,
1230 .audio_inputs = 1,
1231 .tuner = 0,
1232 .svhs = 2,
1233 .gpiomask = 0x18e0,
1234 .muxsel = { 2, 3, 1, 1},
1235 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1236 /* For cards with tda9820/tda9821:
1237 0x0000: Tuner normal stereo
1238 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1239 0x0880: Tuner A2 stereo */
1240 .pll = PLL_28,
1241 .tuner_type = -1,
1242 .tuner_addr = ADDR_UNSET,
1243 .radio_addr = ADDR_UNSET,
1245 [BTTV_BOARD_BESTBUY_EASYTV] = {
1246 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1247 old Easy TV BT848 version (model CPH031) */
1248 .name = "Askey CPH031/ BESTBUY Easy TV",
1249 .video_inputs = 4,
1250 .audio_inputs = 1,
1251 .tuner = 0,
1252 .svhs = 2,
1253 .gpiomask = 0xF,
1254 .muxsel = { 2, 3, 1, 0},
1255 .audiomux = { 2, 0, 0, 0, 10},
1256 .needs_tvaudio = 0,
1257 .pll = PLL_28,
1258 .tuner_type = TUNER_TEMIC_PAL,
1259 .tuner_addr = ADDR_UNSET,
1260 .radio_addr = ADDR_UNSET,
1263 /* ---- card 0x38 ---------------------------------- */
1264 [BTTV_BOARD_FLYVIDEO_98FM] = {
1265 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1266 .name = "Lifeview FlyVideo 98FM LR50",
1267 .video_inputs = 4,
1268 .audio_inputs = 3,
1269 .tuner = 0,
1270 .svhs = 2,
1271 .gpiomask = 0x1800,
1272 .muxsel = { 2, 3, 1, 1},
1273 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1274 .pll = PLL_28,
1275 .tuner_type = 5,
1276 .tuner_addr = ADDR_UNSET,
1277 .radio_addr = ADDR_UNSET,
1279 /* This is the ultimate cheapo capture card
1280 * just a BT848A on a small PCB!
1281 * Steve Hosgood <steve@equiinet.com> */
1282 [BTTV_BOARD_GRANDTEC] = {
1283 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1284 .video_inputs = 2,
1285 .audio_inputs = 0,
1286 .tuner = -1,
1287 .svhs = 1,
1288 .gpiomask = 0,
1289 .muxsel = { 3, 1 },
1290 .audiomux = { 0 },
1291 .needs_tvaudio = 0,
1292 .no_msp34xx = 1,
1293 .pll = PLL_35,
1294 .tuner_type = -1,
1295 .tuner_addr = ADDR_UNSET,
1296 .radio_addr = ADDR_UNSET,
1298 [BTTV_BOARD_ASKEY_CPH060] = {
1299 /* Daniel Herrington <daniel.herrington@home.com> */
1300 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1301 .video_inputs = 3,
1302 .audio_inputs = 1,
1303 .tuner = 0,
1304 .svhs = 2,
1305 .gpiomask = 0xe00,
1306 .muxsel = { 2, 3, 1, 1},
1307 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1308 .needs_tvaudio = 1,
1309 .pll = PLL_28,
1310 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1311 .tuner_addr = ADDR_UNSET,
1312 .radio_addr = ADDR_UNSET,
1314 [BTTV_BOARD_ASKEY_CPH03X] = {
1315 /* Matti Mottus <mottus@physic.ut.ee> */
1316 .name = "Askey CPH03x TV Capturer",
1317 .video_inputs = 4,
1318 .audio_inputs = 1,
1319 .tuner = 0,
1320 .svhs = 2,
1321 .gpiomask = 0x03000F,
1322 .muxsel = { 2, 3, 1, 0},
1323 .audiomux = { 2,0,0,0,1 },
1324 .pll = PLL_28,
1325 .tuner_type = 0,
1326 .tuner_addr = ADDR_UNSET,
1327 .radio_addr = ADDR_UNSET,
1330 /* ---- card 0x3c ---------------------------------- */
1331 [BTTV_BOARD_MM100PCTV] = {
1332 /* Philip Blundell <philb@gnu.org> */
1333 .name = "Modular Technology MM100PCTV",
1334 .video_inputs = 2,
1335 .audio_inputs = 2,
1336 .tuner = 0,
1337 .svhs = -1,
1338 .gpiomask = 11,
1339 .muxsel = { 2, 3, 1, 1},
1340 .audiomux = { 2, 0, 0, 1, 8},
1341 .pll = PLL_35,
1342 .tuner_type = TUNER_TEMIC_PAL,
1343 .tuner_addr = ADDR_UNSET,
1344 .radio_addr = ADDR_UNSET,
1346 [BTTV_BOARD_GMV1] = {
1347 /* Adrian Cox <adrian@humboldt.co.uk */
1348 .name = "AG Electronics GMV1",
1349 .video_inputs = 2,
1350 .audio_inputs = 0,
1351 .tuner = -1,
1352 .svhs = 1,
1353 .gpiomask = 0xF,
1354 .muxsel = { 2, 2},
1355 .audiomux = { },
1356 .no_msp34xx = 1,
1357 .needs_tvaudio = 0,
1358 .pll = PLL_28,
1359 .tuner_type = -1,
1360 .tuner_addr = ADDR_UNSET,
1361 .radio_addr = ADDR_UNSET,
1363 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1364 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1365 new Easy TV BT878 version (model CPH061)
1366 special thanks to Informatica Mieres for providing the card */
1367 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1368 .video_inputs = 3,
1369 .audio_inputs = 2,
1370 .tuner = 0,
1371 .svhs = 2,
1372 .gpiomask = 0xFF,
1373 .muxsel = { 2, 3, 1, 0},
1374 .audiomux = { 1, 0, 4, 4, 9},
1375 .needs_tvaudio = 0,
1376 .pll = PLL_28,
1377 .tuner_type = TUNER_PHILIPS_PAL,
1378 .tuner_addr = ADDR_UNSET,
1379 .radio_addr = ADDR_UNSET,
1381 [BTTV_BOARD_ATI_TVWONDER] = {
1382 /* Lukas Gebauer <geby@volny.cz> */
1383 .name = "ATI TV-Wonder",
1384 .video_inputs = 3,
1385 .audio_inputs = 1,
1386 .tuner = 0,
1387 .svhs = 2,
1388 .gpiomask = 0xf03f,
1389 .muxsel = { 2, 3, 1, 0 },
1390 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1391 .pll = PLL_28,
1392 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1393 .tuner_addr = ADDR_UNSET,
1394 .radio_addr = ADDR_UNSET,
1397 /* ---- card 0x40 ---------------------------------- */
1398 [BTTV_BOARD_ATI_TVWONDERVE] = {
1399 /* Lukas Gebauer <geby@volny.cz> */
1400 .name = "ATI TV-Wonder VE",
1401 .video_inputs = 2,
1402 .audio_inputs = 1,
1403 .tuner = 0,
1404 .svhs = -1,
1405 .gpiomask = 1,
1406 .muxsel = { 2, 3, 0, 1},
1407 .audiomux = { 0, 0, 1, 0, 0},
1408 .no_msp34xx = 1,
1409 .pll = PLL_28,
1410 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1411 .tuner_addr = ADDR_UNSET,
1412 .radio_addr = ADDR_UNSET,
1414 [BTTV_BOARD_FLYVIDEO2000] = {
1415 /* DeeJay <deejay@westel900.net (2000S) */
1416 .name = "Lifeview FlyVideo 2000S LR90",
1417 .video_inputs = 3,
1418 .audio_inputs = 3,
1419 .tuner = 0,
1420 .svhs = 2,
1421 .gpiomask = 0x18e0,
1422 .muxsel = { 2, 3, 0, 1},
1423 /* Radio changed from 1e80 to 0x800 to make
1424 FlyVideo2000S in .hu happy (gm)*/
1425 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1426 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1427 .audio_hook = fv2000s_audio,
1428 .no_msp34xx = 1,
1429 .no_tda9875 = 1,
1430 .needs_tvaudio = 1,
1431 .pll = PLL_28,
1432 .tuner_type = 5,
1433 .tuner_addr = ADDR_UNSET,
1434 .radio_addr = ADDR_UNSET,
1436 [BTTV_BOARD_TERRATVALUER] = {
1437 .name = "Terratec TValueRadio",
1438 .video_inputs = 3,
1439 .audio_inputs = 1,
1440 .tuner = 0,
1441 .svhs = 2,
1442 .gpiomask = 0xffff00,
1443 .muxsel = { 2, 3, 1, 1},
1444 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1445 .needs_tvaudio = 1,
1446 .pll = PLL_28,
1447 .tuner_type = TUNER_PHILIPS_PAL,
1448 .tuner_addr = ADDR_UNSET,
1449 .radio_addr = ADDR_UNSET,
1450 .has_radio = 1,
1452 [BTTV_BOARD_GVBCTV4PCI] = {
1453 /* TANAKA Kei <peg00625@nifty.com> */
1454 .name = "IODATA GV-BCTV4/PCI",
1455 .video_inputs = 3,
1456 .audio_inputs = 1,
1457 .tuner = 0,
1458 .svhs = 2,
1459 .gpiomask = 0x010f00,
1460 .muxsel = {2, 3, 0, 0},
1461 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1462 .no_msp34xx = 1,
1463 .pll = PLL_28,
1464 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1465 .tuner_addr = ADDR_UNSET,
1466 .radio_addr = ADDR_UNSET,
1467 .audio_hook = gvbctv3pci_audio,
1470 /* ---- card 0x44 ---------------------------------- */
1471 [BTTV_BOARD_VOODOOTV_FM] = {
1472 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1473 /* try "insmod msp3400 simple=0" if you have
1474 * sound problems with this card. */
1475 .video_inputs = 4,
1476 .audio_inputs = 1,
1477 .tuner = 0,
1478 .svhs = -1,
1479 .gpiomask = 0x4f8a00,
1480 /* 0x100000: 1=MSP enabled (0=disable again)
1481 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1482 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1483 /* tvtuner, radio, external,internal, mute, stereo
1484 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1485 .muxsel = { 2, 3 ,0 ,1},
1486 .tuner_type = TUNER_MT2032,
1487 .tuner_addr = ADDR_UNSET,
1488 .radio_addr = ADDR_UNSET,
1489 .pll = PLL_28,
1490 .has_radio = 1,
1492 [BTTV_BOARD_AIMMS] = {
1493 /* Philip Blundell <pb@nexus.co.uk> */
1494 .name = "Active Imaging AIMMS",
1495 .video_inputs = 1,
1496 .audio_inputs = 0,
1497 .tuner = -1,
1498 .tuner_type = -1,
1499 .tuner_addr = ADDR_UNSET,
1500 .radio_addr = ADDR_UNSET,
1501 .pll = PLL_28,
1502 .muxsel = { 2 },
1503 .gpiomask = 0
1505 [BTTV_BOARD_PV_BT878P_PLUS] = {
1506 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1507 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1508 .video_inputs = 3,
1509 .audio_inputs = 4,
1510 .tuner = 0,
1511 .svhs = 2,
1512 .gpiomask = 15,
1513 .muxsel = { 2, 3, 1, 1},
1514 .audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
1515 .needs_tvaudio = 1,
1516 .pll = PLL_28,
1517 .tuner_type = 25,
1518 .tuner_addr = ADDR_UNSET,
1519 .radio_addr = ADDR_UNSET,
1520 .has_remote = 1,
1521 /* GPIO wiring:
1522 GPIO0: U4.A0 (hef4052bt)
1523 GPIO1: U4.A1
1524 GPIO2: U4.A1 (second hef4052bt)
1525 GPIO3: U4.nEN, U5.A0, A5.nEN
1526 GPIO8-15: vrd866b ?
1529 [BTTV_BOARD_FLYVIDEO98EZ] = {
1530 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1531 .video_inputs = 4,
1532 .audio_inputs = 0,
1533 .tuner = -1,
1534 .svhs = 2,
1535 .muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1536 .pll = PLL_28,
1537 .no_msp34xx = 1,
1538 .tuner_type = UNSET,
1539 .tuner_addr = ADDR_UNSET,
1540 .radio_addr = ADDR_UNSET,
1543 /* ---- card 0x48 ---------------------------------- */
1544 [BTTV_BOARD_PV_BT878P_9B] = {
1545 /* Dariusz Kowalewski <darekk@automex.pl> */
1546 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1547 .video_inputs = 4,
1548 .audio_inputs = 1,
1549 .tuner = 0,
1550 .svhs = 2,
1551 .gpiomask = 0x3f,
1552 .muxsel = { 2, 3, 1, 1 },
1553 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1554 .needs_tvaudio = 1,
1555 .no_msp34xx = 1,
1556 .no_tda9875 = 1,
1557 .pll = PLL_28,
1558 .tuner_type = 5,
1559 .tuner_addr = ADDR_UNSET,
1560 .radio_addr = ADDR_UNSET,
1561 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1562 .has_radio = 1, /* Note: not all cards have radio */
1563 .has_remote = 1,
1564 /* GPIO wiring:
1565 GPIO0: A0 hef4052
1566 GPIO1: A1 hef4052
1567 GPIO3: nEN hef4052
1568 GPIO8-15: vrd866b
1569 GPIO20,22,23: R30,R29,R28
1572 [BTTV_BOARD_SENSORAY311] = {
1573 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1574 /* you must jumper JP5 for the card to work */
1575 .name = "Sensoray 311",
1576 .video_inputs = 5,
1577 .audio_inputs = 0,
1578 .tuner = -1,
1579 .svhs = 4,
1580 .gpiomask = 0,
1581 .muxsel = { 2, 3, 1, 0, 0},
1582 .audiomux = { 0 },
1583 .needs_tvaudio = 0,
1584 .tuner_type = -1,
1585 .tuner_addr = ADDR_UNSET,
1586 .radio_addr = ADDR_UNSET,
1588 [BTTV_BOARD_RV605] = {
1589 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1590 .name = "RemoteVision MX (RV605)",
1591 .video_inputs = 16,
1592 .audio_inputs = 0,
1593 .tuner = -1,
1594 .svhs = -1,
1595 .gpiomask = 0x00,
1596 .gpiomask2 = 0x07ff,
1597 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1598 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1599 .no_msp34xx = 1,
1600 .no_tda9875 = 1,
1601 .tuner_type = -1,
1602 .tuner_addr = ADDR_UNSET,
1603 .radio_addr = ADDR_UNSET,
1604 .muxsel_hook = rv605_muxsel,
1606 [BTTV_BOARD_POWERCLR_MTV878] = {
1607 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1608 .video_inputs = 3,
1609 .audio_inputs = 2,
1610 .tuner = 0,
1611 .svhs = 2,
1612 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1613 .muxsel = { 2, 1, 1, },
1614 .audiomux = { 0, 1, 2, 2, 4 },
1615 .needs_tvaudio = 0,
1616 .tuner_type = TUNER_PHILIPS_PAL,
1617 .tuner_addr = ADDR_UNSET,
1618 .radio_addr = ADDR_UNSET,
1619 .pll = PLL_28,
1620 .has_radio = 1,
1623 /* ---- card 0x4c ---------------------------------- */
1624 [BTTV_BOARD_WINDVR] = {
1625 /* Masaki Suzuki <masaki@btree.org> */
1626 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1627 .video_inputs = 3,
1628 .audio_inputs = 1,
1629 .tuner = 0,
1630 .svhs = 2,
1631 .gpiomask = 0x140007,
1632 .muxsel = { 2, 3, 1, 1 },
1633 .audiomux = { 0, 1, 2, 3, 4, 0 },
1634 .tuner_type = TUNER_PHILIPS_NTSC,
1635 .tuner_addr = ADDR_UNSET,
1636 .radio_addr = ADDR_UNSET,
1637 .audio_hook = windvr_audio,
1639 [BTTV_BOARD_GRANDTEC_MULTI] = {
1640 .name = "GrandTec Multi Capture Card (Bt878)",
1641 .video_inputs = 4,
1642 .audio_inputs = 0,
1643 .tuner = -1,
1644 .svhs = -1,
1645 .gpiomask = 0,
1646 .muxsel = { 2, 3, 1, 0 },
1647 .audiomux = { 0 },
1648 .needs_tvaudio = 0,
1649 .no_msp34xx = 1,
1650 .pll = PLL_28,
1651 .tuner_type = -1,
1652 .tuner_addr = ADDR_UNSET,
1653 .radio_addr = ADDR_UNSET,
1655 [BTTV_BOARD_KWORLD] = {
1656 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1657 .video_inputs = 4,
1658 .audio_inputs = 3,
1659 .tuner = 0,
1660 .svhs = 2,
1661 .gpiomask = 7,
1662 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1663 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1664 * This card lacks external Audio In, so we mute it on Ext. & Int.
1665 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1666 * This card lacks PCI subsystem ID, sigh.
1667 * audiomux=1: lower volume, 2+3: mute
1668 * btwincap uses 0x80000/0x80003
1670 .needs_tvaudio = 0,
1671 .no_msp34xx = 1,
1672 .pll = PLL_28,
1673 .tuner_type = 5,
1674 .tuner_addr = ADDR_UNSET,
1675 .radio_addr = ADDR_UNSET,
1676 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1677 radio signal strength indicators work fine. */
1678 .has_radio = 1,
1679 /* GPIO Info:
1680 GPIO0,1: HEF4052 A0,A1
1681 GPIO2: HEF4052 nENABLE
1682 GPIO3-7: n.c.
1683 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1684 GPIO14,15: ??
1685 GPIO16-21: n.c.
1686 GPIO22,23: ??
1687 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1689 [BTTV_BOARD_DSP_TCVIDEO] = {
1690 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1691 .name = "DSP Design TCVIDEO",
1692 .video_inputs = 4,
1693 .svhs = -1,
1694 .muxsel = { 2, 3, 1, 0},
1695 .pll = PLL_28,
1696 .tuner_type = -1,
1697 .tuner_addr = ADDR_UNSET,
1698 .radio_addr = ADDR_UNSET,
1701 /* ---- card 0x50 ---------------------------------- */
1702 [BTTV_BOARD_HAUPPAUGEPVR] = {
1703 .name = "Hauppauge WinTV PVR",
1704 .video_inputs = 4,
1705 .audio_inputs = 1,
1706 .tuner = 0,
1707 .svhs = 2,
1708 .muxsel = { 2, 0, 1, 1},
1709 .needs_tvaudio = 1,
1710 .pll = PLL_28,
1711 .tuner_type = -1,
1712 .tuner_addr = ADDR_UNSET,
1713 .radio_addr = ADDR_UNSET,
1715 .gpiomask = 7,
1716 .audiomux = {7},
1718 [BTTV_BOARD_GVBCTV5PCI] = {
1719 .name = "IODATA GV-BCTV5/PCI",
1720 .video_inputs = 3,
1721 .audio_inputs = 1,
1722 .tuner = 0,
1723 .svhs = 2,
1724 .gpiomask = 0x0f0f80,
1725 .muxsel = {2, 3, 1, 0},
1726 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1727 .no_msp34xx = 1,
1728 .pll = PLL_28,
1729 .tuner_type = TUNER_PHILIPS_NTSC_M,
1730 .tuner_addr = ADDR_UNSET,
1731 .radio_addr = ADDR_UNSET,
1732 .audio_hook = gvbctv5pci_audio,
1733 .has_radio = 1,
1735 [BTTV_BOARD_OSPREY1x0] = {
1736 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1737 .video_inputs = 4, /* id-inputs-clock */
1738 .audio_inputs = 0,
1739 .tuner = -1,
1740 .svhs = 3,
1741 .muxsel = { 3, 2, 0, 1 },
1742 .pll = PLL_28,
1743 .tuner_type = -1,
1744 .tuner_addr = ADDR_UNSET,
1745 .radio_addr = ADDR_UNSET,
1746 .no_msp34xx = 1,
1747 .no_tda9875 = 1,
1748 .no_tda7432 = 1,
1750 [BTTV_BOARD_OSPREY1x0_848] = {
1751 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1752 .video_inputs = 3,
1753 .audio_inputs = 0,
1754 .tuner = -1,
1755 .svhs = 2,
1756 .muxsel = { 2, 3, 1 },
1757 .pll = PLL_28,
1758 .tuner_type = -1,
1759 .tuner_addr = ADDR_UNSET,
1760 .radio_addr = ADDR_UNSET,
1761 .no_msp34xx = 1,
1762 .no_tda9875 = 1,
1763 .no_tda7432 = 1,
1766 /* ---- card 0x54 ---------------------------------- */
1767 [BTTV_BOARD_OSPREY101_848] = {
1768 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1769 .video_inputs = 2,
1770 .audio_inputs = 0,
1771 .tuner = -1,
1772 .svhs = 1,
1773 .muxsel = { 3, 1 },
1774 .pll = PLL_28,
1775 .tuner_type = -1,
1776 .tuner_addr = ADDR_UNSET,
1777 .radio_addr = ADDR_UNSET,
1778 .no_msp34xx = 1,
1779 .no_tda9875 = 1,
1780 .no_tda7432 = 1,
1782 [BTTV_BOARD_OSPREY1x1] = {
1783 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1784 .video_inputs = 1,
1785 .audio_inputs = 0,
1786 .tuner = -1,
1787 .svhs = -1,
1788 .muxsel = { 0 },
1789 .pll = PLL_28,
1790 .tuner_type = -1,
1791 .tuner_addr = ADDR_UNSET,
1792 .radio_addr = ADDR_UNSET,
1793 .no_msp34xx = 1,
1794 .no_tda9875 = 1,
1795 .no_tda7432 = 1,
1797 [BTTV_BOARD_OSPREY1x1_SVID] = {
1798 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1799 .video_inputs = 2,
1800 .audio_inputs = 0,
1801 .tuner = -1,
1802 .svhs = 1,
1803 .muxsel = { 0, 1 },
1804 .pll = PLL_28,
1805 .tuner_type = -1,
1806 .tuner_addr = ADDR_UNSET,
1807 .radio_addr = ADDR_UNSET,
1808 .no_msp34xx = 1,
1809 .no_tda9875 = 1,
1810 .no_tda7432 = 1,
1812 [BTTV_BOARD_OSPREY2xx] = {
1813 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1814 .video_inputs = 1,
1815 .audio_inputs = 1,
1816 .tuner = -1,
1817 .svhs = -1,
1818 .muxsel = { 0 },
1819 .pll = PLL_28,
1820 .tuner_type = UNSET,
1821 .tuner_addr = ADDR_UNSET,
1822 .radio_addr = ADDR_UNSET,
1823 .no_msp34xx = 1,
1824 .no_tda9875 = 1,
1825 .no_tda7432 = 1,
1828 /* ---- card 0x58 ---------------------------------- */
1829 [BTTV_BOARD_OSPREY2x0_SVID] = {
1830 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1831 .video_inputs = 2,
1832 .audio_inputs = 1,
1833 .tuner = -1,
1834 .svhs = 1,
1835 .muxsel = { 0, 1 },
1836 .pll = PLL_28,
1837 .tuner_type = UNSET,
1838 .tuner_addr = ADDR_UNSET,
1839 .radio_addr = ADDR_UNSET,
1840 .no_msp34xx = 1,
1841 .no_tda9875 = 1,
1842 .no_tda7432 = 1,
1844 [BTTV_BOARD_OSPREY2x0] = {
1845 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1846 .video_inputs = 2,
1847 .audio_inputs = 1,
1848 .tuner = -1,
1849 .svhs = 1,
1850 .muxsel = { 2, 3 },
1851 .pll = PLL_28,
1852 .tuner_type = UNSET,
1853 .tuner_addr = ADDR_UNSET,
1854 .radio_addr = ADDR_UNSET,
1855 .no_msp34xx = 1,
1856 .no_tda9875 = 1,
1857 .no_tda7432 = 1,
1859 [BTTV_BOARD_OSPREY500] = {
1860 .name = "Osprey 500", /* 500 */
1861 .video_inputs = 2,
1862 .audio_inputs = 1,
1863 .tuner = -1,
1864 .svhs = 1,
1865 .muxsel = { 2, 3 },
1866 .pll = PLL_28,
1867 .tuner_type = -1,
1868 .tuner_addr = ADDR_UNSET,
1869 .radio_addr = ADDR_UNSET,
1870 .no_msp34xx = 1,
1871 .no_tda9875 = 1,
1872 .no_tda7432 = 1,
1874 [BTTV_BOARD_OSPREY540] = {
1875 .name = "Osprey 540", /* 540 */
1876 .video_inputs = 4,
1877 .audio_inputs = 1,
1878 .tuner = -1,
1879 #if 0 /* TODO ... */
1880 .svhs = OSPREY540_SVID_ANALOG,
1881 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1882 [OSPREY540_SVID_ANALOG] = 3, },
1883 #endif
1884 .pll = PLL_28,
1885 .tuner_type = -1,
1886 .tuner_addr = ADDR_UNSET,
1887 .radio_addr = ADDR_UNSET,
1888 .no_msp34xx = 1,
1889 .no_tda9875 = 1,
1890 .no_tda7432 = 1,
1891 #if 0 /* TODO ... */
1892 .muxsel_hook = osprey_540_muxsel,
1893 .picture_hook = osprey_540_set_picture,
1894 #endif
1897 /* ---- card 0x5C ---------------------------------- */
1898 [BTTV_BOARD_OSPREY2000] = {
1899 .name = "Osprey 2000", /* 2000 */
1900 .video_inputs = 2,
1901 .audio_inputs = 1,
1902 .tuner = -1,
1903 .svhs = 1,
1904 .muxsel = { 2, 3 },
1905 .pll = PLL_28,
1906 .tuner_type = UNSET,
1907 .tuner_addr = ADDR_UNSET,
1908 .radio_addr = ADDR_UNSET,
1909 .no_msp34xx = 1,
1910 .no_tda9875 = 1,
1911 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1913 [BTTV_BOARD_IDS_EAGLE] = {
1914 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1915 .name = "IDS Eagle",
1916 .video_inputs = 4,
1917 .audio_inputs = 0,
1918 .tuner = -1,
1919 .tuner_type = -1,
1920 .tuner_addr = ADDR_UNSET,
1921 .radio_addr = ADDR_UNSET,
1922 .svhs = -1,
1923 .gpiomask = 0,
1924 .muxsel = { 0, 1, 2, 3 },
1925 .muxsel_hook = eagle_muxsel,
1926 .no_msp34xx = 1,
1927 .no_tda9875 = 1,
1928 .pll = PLL_28,
1930 [BTTV_BOARD_PINNACLESAT] = {
1931 .name = "Pinnacle PCTV Sat",
1932 .video_inputs = 2,
1933 .audio_inputs = 0,
1934 .svhs = 1,
1935 .tuner = -1,
1936 .tuner_type = -1,
1937 .tuner_addr = ADDR_UNSET,
1938 .radio_addr = ADDR_UNSET,
1939 .no_msp34xx = 1,
1940 .no_tda9875 = 1,
1941 .no_tda7432 = 1,
1942 .muxsel = { 3, 0, 1, 2},
1943 .pll = PLL_28,
1944 .no_gpioirq = 1,
1945 .has_dvb = 1,
1947 [BTTV_BOARD_FORMAC_PROTV] = {
1948 .name = "Formac ProTV II (bt878)",
1949 .video_inputs = 4,
1950 .audio_inputs = 1,
1951 .tuner = 0,
1952 .svhs = 3,
1953 .gpiomask = 2,
1954 /* TV, Comp1, Composite over SVID con, SVID */
1955 .muxsel = { 2, 3, 1, 1},
1956 .audiomux = { 2, 2, 0, 0, 0 },
1957 .pll = PLL_28,
1958 .has_radio = 1,
1959 .tuner_type = TUNER_PHILIPS_PAL,
1960 .tuner_addr = ADDR_UNSET,
1961 .radio_addr = ADDR_UNSET,
1962 /* sound routing:
1963 GPIO=0x00,0x01,0x03: mute (?)
1964 0x02: both TV and radio (tuner: FM1216/I)
1965 The card has onboard audio connectors labeled "cdrom" and "board",
1966 not soldered here, though unknown wiring.
1967 Card lacks: external audio in, pci subsystem id.
1971 /* ---- card 0x60 ---------------------------------- */
1972 [BTTV_BOARD_MACHTV] = {
1973 .name = "MachTV",
1974 .video_inputs = 3,
1975 .audio_inputs = 1,
1976 .tuner = 0,
1977 .svhs = -1,
1978 .gpiomask = 7,
1979 .muxsel = { 2, 3, 1, 1},
1980 .audiomux = { 0, 1, 2, 3, 4},
1981 .needs_tvaudio = 1,
1982 .tuner_type = 5,
1983 .tuner_addr = ADDR_UNSET,
1984 .radio_addr = ADDR_UNSET,
1985 .pll = PLL_28,
1987 [BTTV_BOARD_EURESYS_PICOLO] = {
1988 .name = "Euresys Picolo",
1989 .video_inputs = 3,
1990 .audio_inputs = 0,
1991 .tuner = -1,
1992 .svhs = 2,
1993 .gpiomask = 0,
1994 .no_msp34xx = 1,
1995 .no_tda9875 = 1,
1996 .no_tda7432 = 1,
1997 .muxsel = { 2, 0, 1},
1998 .pll = PLL_28,
1999 .tuner_type = UNSET,
2000 .tuner_addr = ADDR_UNSET,
2001 .radio_addr = ADDR_UNSET,
2003 [BTTV_BOARD_PV150] = {
2004 /* Luc Van Hoeylandt <luc@e-magic.be> */
2005 .name = "ProVideo PV150", /* 0x4f */
2006 .video_inputs = 2,
2007 .audio_inputs = 0,
2008 .tuner = -1,
2009 .svhs = -1,
2010 .gpiomask = 0,
2011 .muxsel = { 2, 3 },
2012 .audiomux = { 0 },
2013 .needs_tvaudio = 0,
2014 .no_msp34xx = 1,
2015 .pll = PLL_28,
2016 .tuner_type = UNSET,
2017 .tuner_addr = ADDR_UNSET,
2018 .radio_addr = ADDR_UNSET,
2020 [BTTV_BOARD_AD_TVK503] = {
2021 /* Hiroshi Takekawa <sian@big.or.jp> */
2022 /* This card lacks subsystem ID */
2023 .name = "AD-TVK503", /* 0x63 */
2024 .video_inputs = 4,
2025 .audio_inputs = 1,
2026 .tuner = 0,
2027 .svhs = 2,
2028 .gpiomask = 0x001e8007,
2029 .muxsel = { 2, 3, 1, 0 },
2030 /* Tuner, Radio, external, internal, off, on */
2031 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2032 .needs_tvaudio = 0,
2033 .no_msp34xx = 1,
2034 .pll = PLL_28,
2035 .tuner_type = 2,
2036 .tuner_addr = ADDR_UNSET,
2037 .radio_addr = ADDR_UNSET,
2038 .audio_hook = adtvk503_audio,
2041 /* ---- card 0x64 ---------------------------------- */
2042 [BTTV_BOARD_HERCULES_SM_TV] = {
2043 .name = "Hercules Smart TV Stereo",
2044 .video_inputs = 4,
2045 .audio_inputs = 1,
2046 .tuner = 0,
2047 .svhs = 2,
2048 .gpiomask = 0x00,
2049 .muxsel = { 2, 3, 1, 1 },
2050 .needs_tvaudio = 1,
2051 .no_msp34xx = 1,
2052 .pll = PLL_28,
2053 .tuner_type = 5,
2054 .tuner_addr = ADDR_UNSET,
2055 .radio_addr = ADDR_UNSET,
2056 /* Notes:
2057 - card lacks subsystem ID
2058 - stereo variant w/ daughter board with tda9874a @0xb0
2059 - Audio Routing:
2060 always from tda9874 independent of GPIO (?)
2061 external line in: unknown
2062 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2063 hef4053 (instead 4052) for unknown function
2066 [BTTV_BOARD_PACETV] = {
2067 .name = "Pace TV & Radio Card",
2068 .video_inputs = 4,
2069 .audio_inputs = 1,
2070 .tuner = 0,
2071 .svhs = 2,
2072 .muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
2073 .gpiomask = 0,
2074 .no_tda9875 = 1,
2075 .no_tda7432 = 1,
2076 .tuner_type = 1,
2077 .tuner_addr = ADDR_UNSET,
2078 .radio_addr = ADDR_UNSET,
2079 .has_radio = 1,
2080 .pll = PLL_28,
2081 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2082 only internal line out: (4pin header) RGGL
2083 Radio must be decoded by msp3410d (not routed through)*/
2085 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2088 [BTTV_BOARD_IVC200] = {
2089 /* Chris Willing <chris@vislab.usyd.edu.au> */
2090 .name = "IVC-200",
2091 .video_inputs = 1,
2092 .audio_inputs = 0,
2093 .tuner = -1,
2094 .tuner_type = -1,
2095 .tuner_addr = ADDR_UNSET,
2096 .radio_addr = ADDR_UNSET,
2097 .svhs = -1,
2098 .gpiomask = 0xdf,
2099 .muxsel = { 2 },
2100 .pll = PLL_28,
2102 [BTTV_BOARD_XGUARD] = {
2103 .name = "Grand X-Guard / Trust 814PCI",
2104 .video_inputs = 16,
2105 .audio_inputs = 0,
2106 .tuner = -1,
2107 .svhs = -1,
2108 .tuner_type = 4,
2109 .tuner_addr = ADDR_UNSET,
2110 .radio_addr = ADDR_UNSET,
2111 .gpiomask2 = 0xff,
2112 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2113 .muxsel_hook = xguard_muxsel,
2114 .no_msp34xx = 1,
2115 .no_tda9875 = 1,
2116 .no_tda7432 = 1,
2117 .pll = PLL_28,
2120 /* ---- card 0x68 ---------------------------------- */
2121 [BTTV_BOARD_NEBULA_DIGITV] = {
2122 .name = "Nebula Electronics DigiTV",
2123 .video_inputs = 1,
2124 .tuner = -1,
2125 .svhs = -1,
2126 .muxsel = { 2, 3, 1, 0},
2127 .no_msp34xx = 1,
2128 .no_tda9875 = 1,
2129 .no_tda7432 = 1,
2130 .pll = PLL_28,
2131 .tuner_type = -1,
2132 .tuner_addr = ADDR_UNSET,
2133 .radio_addr = ADDR_UNSET,
2134 .has_dvb = 1,
2135 .no_gpioirq = 1,
2137 [BTTV_BOARD_PV143] = {
2138 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2139 .name = "ProVideo PV143",
2140 .video_inputs = 4,
2141 .audio_inputs = 0,
2142 .tuner = -1,
2143 .svhs = -1,
2144 .gpiomask = 0,
2145 .muxsel = { 2, 3, 1, 0 },
2146 .audiomux = { 0 },
2147 .needs_tvaudio = 0,
2148 .no_msp34xx = 1,
2149 .pll = PLL_28,
2150 .tuner_type = -1,
2151 .tuner_addr = ADDR_UNSET,
2152 .radio_addr = ADDR_UNSET,
2154 [BTTV_BOARD_VD009X1_MINIDIN] = {
2155 /* M.Klahr@phytec.de */
2156 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2157 .video_inputs = 4,
2158 .audio_inputs = 0,
2159 .tuner = -1, /* card has no tuner */
2160 .svhs = 3,
2161 .gpiomask = 0x00,
2162 .muxsel = { 2, 3, 1, 0},
2163 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2164 .needs_tvaudio = 1,
2165 .pll = PLL_28,
2166 .tuner_type = -1,
2167 .tuner_addr = ADDR_UNSET,
2168 .radio_addr = ADDR_UNSET,
2170 [BTTV_BOARD_VD009X1_COMBI] = {
2171 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2172 .video_inputs = 4,
2173 .audio_inputs = 0,
2174 .tuner = -1, /* card has no tuner */
2175 .svhs = 3,
2176 .gpiomask = 0x00,
2177 .muxsel = { 2, 3, 1, 1},
2178 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2179 .needs_tvaudio = 1,
2180 .pll = PLL_28,
2181 .tuner_type = -1,
2182 .tuner_addr = ADDR_UNSET,
2183 .radio_addr = ADDR_UNSET,
2186 /* ---- card 0x6c ---------------------------------- */
2187 [BTTV_BOARD_VD009_MINIDIN] = {
2188 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2189 .video_inputs = 10,
2190 .audio_inputs = 0,
2191 .tuner = -1, /* card has no tuner */
2192 .svhs = 9,
2193 .gpiomask = 0x00,
2194 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2195 via the upper nibble of muxsel. here: used for
2196 xternal video-mux */
2197 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2198 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2199 .needs_tvaudio = 1,
2200 .pll = PLL_28,
2201 .tuner_type = -1,
2202 .tuner_addr = ADDR_UNSET,
2203 .radio_addr = ADDR_UNSET,
2205 [BTTV_BOARD_VD009_COMBI] = {
2206 .name = "PHYTEC VD-009 Combi (bt878)",
2207 .video_inputs = 10,
2208 .audio_inputs = 0,
2209 .tuner = -1, /* card has no tuner */
2210 .svhs = 9,
2211 .gpiomask = 0x00,
2212 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2213 via the upper nibble of muxsel. here: used for
2214 xternal video-mux */
2215 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2216 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2217 .needs_tvaudio = 1,
2218 .pll = PLL_28,
2219 .tuner_type = -1,
2220 .tuner_addr = ADDR_UNSET,
2221 .radio_addr = ADDR_UNSET,
2223 [BTTV_BOARD_IVC100] = {
2224 .name = "IVC-100",
2225 .video_inputs = 4,
2226 .audio_inputs = 0,
2227 .tuner = -1,
2228 .tuner_type = -1,
2229 .tuner_addr = ADDR_UNSET,
2230 .radio_addr = ADDR_UNSET,
2231 .svhs = -1,
2232 .gpiomask = 0xdf,
2233 .muxsel = { 2, 3, 1, 0 },
2234 .pll = PLL_28,
2236 [BTTV_BOARD_IVC120] = {
2237 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2238 .name = "IVC-120G",
2239 .video_inputs = 16,
2240 .audio_inputs = 0, /* card has no audio */
2241 .tuner = -1, /* card has no tuner */
2242 .tuner_type = -1,
2243 .tuner_addr = ADDR_UNSET,
2244 .radio_addr = ADDR_UNSET,
2245 .svhs = -1, /* card has no svhs */
2246 .needs_tvaudio = 0,
2247 .no_msp34xx = 1,
2248 .no_tda9875 = 1,
2249 .no_tda7432 = 1,
2250 .gpiomask = 0x00,
2251 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2252 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2253 .muxsel_hook = ivc120_muxsel,
2254 .pll = PLL_28,
2257 /* ---- card 0x70 ---------------------------------- */
2258 [BTTV_BOARD_PC_HDTV] = {
2259 .name = "pcHDTV HD-2000 TV",
2260 .video_inputs = 4,
2261 .audio_inputs = 1,
2262 .tuner = 0,
2263 .svhs = 2,
2264 .muxsel = { 2, 3, 1, 0},
2265 .tuner_type = TUNER_PHILIPS_ATSC,
2266 .tuner_addr = ADDR_UNSET,
2267 .radio_addr = ADDR_UNSET,
2268 .has_dvb = 1,
2270 [BTTV_BOARD_TWINHAN_DST] = {
2271 .name = "Twinhan DST + clones",
2272 .no_msp34xx = 1,
2273 .no_tda9875 = 1,
2274 .no_tda7432 = 1,
2275 .tuner_type = TUNER_ABSENT,
2276 .tuner_addr = ADDR_UNSET,
2277 .radio_addr = ADDR_UNSET,
2278 .no_video = 1,
2279 .has_dvb = 1,
2281 [BTTV_BOARD_WINFASTVC100] = {
2282 .name = "Winfast VC100",
2283 .video_inputs = 3,
2284 .audio_inputs = 0,
2285 .svhs = 1,
2286 .tuner = -1,
2287 .muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
2288 .no_msp34xx = 1,
2289 .no_tda9875 = 1,
2290 .no_tda7432 = 1,
2291 .tuner_type = TUNER_ABSENT,
2292 .tuner_addr = ADDR_UNSET,
2293 .radio_addr = ADDR_UNSET,
2294 .pll = PLL_28,
2296 [BTTV_BOARD_TEV560] = {
2297 .name = "Teppro TEV-560/InterVision IV-560",
2298 .video_inputs = 3,
2299 .audio_inputs = 1,
2300 .tuner = 0,
2301 .svhs = 2,
2302 .gpiomask = 3,
2303 .muxsel = { 2, 3, 1, 1},
2304 .audiomux = { 1, 1, 1, 1, 0},
2305 .needs_tvaudio = 1,
2306 .tuner_type = TUNER_PHILIPS_PAL,
2307 .tuner_addr = ADDR_UNSET,
2308 .radio_addr = ADDR_UNSET,
2309 .pll = PLL_35,
2312 /* ---- card 0x74 ---------------------------------- */
2313 [BTTV_BOARD_SIMUS_GVC1100] = {
2314 .name = "SIMUS GVC1100",
2315 .video_inputs = 4,
2316 .audio_inputs = 0,
2317 .tuner = -1,
2318 .svhs = -1,
2319 .tuner_type = -1,
2320 .tuner_addr = ADDR_UNSET,
2321 .radio_addr = ADDR_UNSET,
2322 .pll = PLL_28,
2323 .muxsel = { 2, 2, 2, 2},
2324 .gpiomask = 0x3F,
2325 .muxsel_hook = gvc1100_muxsel,
2327 [BTTV_BOARD_NGSTV_PLUS] = {
2328 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2329 .name = "NGS NGSTV+",
2330 .video_inputs = 3,
2331 .tuner = 0,
2332 .svhs = 2,
2333 .gpiomask = 0x008007,
2334 .muxsel = {2, 3, 0, 0},
2335 .audiomux = {0, 0, 0, 0, 0x000003, 0},
2336 .pll = PLL_28,
2337 .tuner_type = TUNER_PHILIPS_PAL,
2338 .tuner_addr = ADDR_UNSET,
2339 .radio_addr = ADDR_UNSET,
2340 .has_remote = 1,
2342 [BTTV_BOARD_LMLBT4] = {
2343 /* http://linuxmedialabs.com */
2344 .name = "LMLBT4",
2345 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2346 .audio_inputs = 0,
2347 .tuner = -1,
2348 .svhs = -1,
2349 .muxsel = { 2, 3, 1, 0 },
2350 .no_msp34xx = 1,
2351 .no_tda9875 = 1,
2352 .no_tda7432 = 1,
2353 .needs_tvaudio = 0,
2354 .tuner_type = -1,
2355 .tuner_addr = ADDR_UNSET,
2356 .radio_addr = ADDR_UNSET,
2358 [BTTV_BOARD_TEKRAM_M205] = {
2359 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2360 .name = "Tekram M205 PRO",
2361 .video_inputs = 3,
2362 .audio_inputs = 1,
2363 .tuner = 0,
2364 .tuner_type = TUNER_PHILIPS_PAL,
2365 .tuner_addr = ADDR_UNSET,
2366 .radio_addr = ADDR_UNSET,
2367 .svhs = 2,
2368 .needs_tvaudio = 0,
2369 .gpiomask = 0x68,
2370 .muxsel = { 2, 3, 1},
2371 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2372 .pll = PLL_28,
2375 /* ---- card 0x78 ---------------------------------- */
2376 [BTTV_BOARD_CONTVFMI] = {
2377 /* Javier Cendan Ares <jcendan@lycos.es> */
2378 /* bt878 TV + FM without subsystem ID */
2379 .name = "Conceptronic CONTVFMi",
2380 .video_inputs = 3,
2381 .audio_inputs = 1,
2382 .tuner = 0,
2383 .svhs = 2,
2384 .gpiomask = 0x008007,
2385 .muxsel = { 2, 3, 1, 1 },
2386 .audiomux = { 0, 1, 2, 2, 3 },
2387 .needs_tvaudio = 0,
2388 .pll = PLL_28,
2389 .tuner_type = TUNER_PHILIPS_PAL,
2390 .tuner_addr = ADDR_UNSET,
2391 .radio_addr = ADDR_UNSET,
2392 .has_remote = 1,
2393 .has_radio = 1,
2395 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2396 /*Eric DEBIEF <debief@telemsa.com>*/
2397 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2398 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2399 /*0x79 in bttv.h*/
2400 .name = "Euresys Picolo Tetra",
2401 .video_inputs = 4,
2402 .audio_inputs = 0,
2403 .tuner = -1,
2404 .svhs = -1,
2405 .gpiomask = 0,
2406 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2407 .no_msp34xx = 1,
2408 .no_tda9875 = 1,
2409 .no_tda7432 = 1,
2410 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2411 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2412 .pll = PLL_28,
2413 .needs_tvaudio = 0,
2414 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2415 .tuner_type = -1,
2416 .tuner_addr = ADDR_UNSET,
2417 .radio_addr = ADDR_UNSET,
2419 [BTTV_BOARD_SPIRIT_TV] = {
2420 /* Spirit TV Tuner from http://spiritmodems.com.au */
2421 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2422 .name = "Spirit TV Tuner",
2423 .video_inputs = 3,
2424 .audio_inputs = 1,
2425 .tuner = 0,
2426 .svhs = 2,
2427 .gpiomask = 0x0000000f,
2428 .muxsel = { 2, 1, 1 },
2429 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2430 .tuner_type = TUNER_TEMIC_PAL,
2431 .tuner_addr = ADDR_UNSET,
2432 .radio_addr = ADDR_UNSET,
2433 .no_msp34xx = 1,
2434 .no_tda9875 = 1,
2436 [BTTV_BOARD_AVDVBT_771] = {
2437 /* Wolfram Joost <wojo@frokaschwei.de> */
2438 .name = "AVerMedia AVerTV DVB-T 771",
2439 .video_inputs = 2,
2440 .svhs = 1,
2441 .tuner = -1,
2442 .tuner_type = TUNER_ABSENT,
2443 .tuner_addr = ADDR_UNSET,
2444 .radio_addr = ADDR_UNSET,
2445 .muxsel = { 3 , 3 },
2446 .no_msp34xx = 1,
2447 .no_tda9875 = 1,
2448 .no_tda7432 = 1,
2449 .pll = PLL_28,
2450 .has_dvb = 1,
2451 .no_gpioirq = 1,
2452 .has_remote = 1,
2454 /* ---- card 0x7c ---------------------------------- */
2455 [BTTV_BOARD_AVDVBT_761] = {
2456 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2457 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2458 .name = "AverMedia AverTV DVB-T 761",
2459 .video_inputs = 2,
2460 .tuner = -1,
2461 .svhs = 1,
2462 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2463 .no_msp34xx = 1,
2464 .no_tda9875 = 1,
2465 .no_tda7432 = 1,
2466 .pll = PLL_28,
2467 .tuner_type = -1,
2468 .tuner_addr = ADDR_UNSET,
2469 .radio_addr = ADDR_UNSET,
2470 .has_dvb = 1,
2471 .no_gpioirq = 1,
2472 .has_remote = 1,
2474 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2475 /* andre.schwarz@matrix-vision.de */
2476 .name = "MATRIX Vision Sigma-SQ",
2477 .video_inputs = 16,
2478 .audio_inputs = 0,
2479 .tuner = -1,
2480 .svhs = -1,
2481 .gpiomask = 0x0,
2482 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2483 3, 3, 3, 3, 3, 3, 3, 3 },
2484 .muxsel_hook = sigmaSQ_muxsel,
2485 .audiomux = { 0 },
2486 .no_msp34xx = 1,
2487 .pll = PLL_28,
2488 .tuner_type = -1,
2489 .tuner_addr = ADDR_UNSET,
2490 .radio_addr = ADDR_UNSET,
2492 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2493 /* andre.schwarz@matrix-vision.de */
2494 .name = "MATRIX Vision Sigma-SLC",
2495 .video_inputs = 4,
2496 .audio_inputs = 0,
2497 .tuner = -1,
2498 .svhs = -1,
2499 .gpiomask = 0x0,
2500 .muxsel = { 2, 2, 2, 2 },
2501 .muxsel_hook = sigmaSLC_muxsel,
2502 .audiomux = { 0 },
2503 .no_msp34xx = 1,
2504 .pll = PLL_28,
2505 .tuner_type = -1,
2506 .tuner_addr = ADDR_UNSET,
2507 .radio_addr = ADDR_UNSET,
2509 /* BTTV_BOARD_APAC_VIEWCOMP */
2510 [BTTV_BOARD_APAC_VIEWCOMP] = {
2511 /* Attila Kondoros <attila.kondoros@chello.hu> */
2512 /* bt878 TV + FM 0x00000000 subsystem ID */
2513 .name = "APAC Viewcomp 878(AMAX)",
2514 .video_inputs = 2,
2515 .audio_inputs = 1,
2516 .tuner = 0,
2517 .svhs = -1,
2518 .gpiomask = 0xFF,
2519 .muxsel = { 2, 3, 1, 1},
2520 .audiomux = { 2, 0, 0, 0, 10},
2521 .needs_tvaudio = 0,
2522 .pll = PLL_28,
2523 .tuner_type = TUNER_PHILIPS_PAL,
2524 .tuner_addr = ADDR_UNSET,
2525 .radio_addr = ADDR_UNSET,
2526 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2527 .has_radio = 1, /* not every card has radio */
2530 /* ---- card 0x80 ---------------------------------- */
2531 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2532 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2533 .name = "DViCO FusionHDTV DVB-T Lite",
2534 .tuner = -1,
2535 .no_msp34xx = 1,
2536 .no_tda9875 = 1,
2537 .no_tda7432 = 1,
2538 .pll = PLL_28,
2539 .no_video = 1,
2540 .has_dvb = 1,
2541 .tuner_type = -1,
2542 .tuner_addr = ADDR_UNSET,
2543 .radio_addr = ADDR_UNSET,
2545 [BTTV_BOARD_VGEAR_MYVCD] = {
2546 /* Steven <photon38@pchome.com.tw> */
2547 .name = "V-Gear MyVCD",
2548 .video_inputs = 3,
2549 .audio_inputs = 1,
2550 .tuner = 0,
2551 .svhs = 2,
2552 .gpiomask = 0x3f,
2553 .muxsel = {2, 3, 1, 0},
2554 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2555 .no_msp34xx = 1,
2556 .pll = PLL_28,
2557 .tuner_type = TUNER_PHILIPS_NTSC_M,
2558 .tuner_addr = ADDR_UNSET,
2559 .radio_addr = ADDR_UNSET,
2560 .has_radio = 0,
2561 #if 0
2562 .has_remote = 1,
2563 #endif
2565 [BTTV_BOARD_SUPER_TV] = {
2566 /* Rick C <cryptdragoon@gmail.com> */
2567 .name = "Super TV Tuner",
2568 .video_inputs = 4,
2569 .audio_inputs = 1,
2570 .tuner = 0,
2571 .svhs = 2,
2572 .muxsel = { 2, 3, 1, 0},
2573 .tuner_type = TUNER_PHILIPS_NTSC,
2574 .tuner_addr = ADDR_UNSET,
2575 .radio_addr = ADDR_UNSET,
2576 .gpiomask = 0x008007,
2577 .audiomux = { 0, 0x000001,0,0, 0},
2578 .needs_tvaudio = 1,
2579 .has_radio = 1,
2581 [BTTV_BOARD_TIBET_CS16] = {
2582 /* Chris Fanning <video4linux@haydon.net> */
2583 .name = "Tibet Systems 'Progress DVR' CS16",
2584 .video_inputs = 16,
2585 .audio_inputs = 0,
2586 .tuner = -1,
2587 .svhs = -1,
2588 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2589 .pll = PLL_28,
2590 .no_msp34xx = 1,
2591 .no_tda9875 = 1,
2592 .no_tda7432 = 1,
2593 .tuner_type = -1,
2594 .tuner_addr = ADDR_UNSET,
2595 .radio_addr = ADDR_UNSET,
2596 .muxsel_hook = tibetCS16_muxsel,
2598 [BTTV_BOARD_KODICOM_4400R] = {
2599 /* Bill Brack <wbrack@mmm.com.hk> */
2601 * Note that, because of the card's wiring, the "master"
2602 * BT878A chip (i.e. the one which controls the analog switch
2603 * and must use this card type) is the 2nd one detected. The
2604 * other 3 chips should use card type 0x85, whose description
2605 * follows this one. There is a EEPROM on the card (which is
2606 * connected to the I2C of one of those other chips), but is
2607 * not currently handled. There is also a facility for a
2608 * "monitor", which is also not currently implemented.
2610 .name = "Kodicom 4400R (master)",
2611 .video_inputs = 16,
2612 .audio_inputs = 0,
2613 .tuner = -1,
2614 .tuner_type = -1,
2615 .tuner_addr = ADDR_UNSET,
2616 .radio_addr = ADDR_UNSET,
2617 .svhs = -1,
2618 /* GPIO bits 0-9 used for analog switch:
2619 * 00 - 03: camera selector
2620 * 04 - 06: channel (controller) selector
2621 * 07: data (1->on, 0->off)
2622 * 08: strobe
2623 * 09: reset
2624 * bit 16 is input from sync separator for the channel
2626 .gpiomask = 0x0003ff,
2627 .no_gpioirq = 1,
2628 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2629 .pll = PLL_28,
2630 .no_msp34xx = 1,
2631 .no_tda7432 = 1,
2632 .no_tda9875 = 1,
2633 .muxsel_hook = kodicom4400r_muxsel,
2635 [BTTV_BOARD_KODICOM_4400R_SL] = {
2636 /* Bill Brack <wbrack@mmm.com.hk> */
2637 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2638 * one which controls the analog switch, and must use the card type)
2639 * is the 2nd one detected. The other 3 chips should use this card
2640 * type
2642 .name = "Kodicom 4400R (slave)",
2643 .video_inputs = 16,
2644 .audio_inputs = 0,
2645 .tuner = -1,
2646 .tuner_type = -1,
2647 .tuner_addr = ADDR_UNSET,
2648 .radio_addr = ADDR_UNSET,
2649 .svhs = -1,
2650 .gpiomask = 0x010000,
2651 .no_gpioirq = 1,
2652 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2653 .pll = PLL_28,
2654 .no_msp34xx = 1,
2655 .no_tda7432 = 1,
2656 .no_tda9875 = 1,
2657 .muxsel_hook = kodicom4400r_muxsel,
2659 /* ---- card 0x86---------------------------------- */
2660 [BTTV_BOARD_ADLINK_RTV24] = {
2661 /* Michael Henson <mhenson@clarityvi.com> */
2662 /* Adlink RTV24 with special unlock codes */
2663 .name = "Adlink RTV24",
2664 .video_inputs = 4,
2665 .audio_inputs = 1,
2666 .tuner = 0,
2667 .svhs = 2,
2668 .muxsel = { 2, 3, 1, 0},
2669 .tuner_type = -1,
2670 .tuner_addr = ADDR_UNSET,
2671 .radio_addr = ADDR_UNSET,
2672 .pll = PLL_28,
2674 /* ---- card 0x87---------------------------------- */
2675 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2676 /* Michael Krufky <mkrufky@m1k.net> */
2677 .name = "DViCO FusionHDTV 5 Lite",
2678 .tuner = 0,
2679 .tuner_type = TUNER_LG_TDVS_H062F,
2680 .tuner_addr = ADDR_UNSET,
2681 .radio_addr = ADDR_UNSET,
2682 .video_inputs = 3,
2683 .audio_inputs = 1,
2684 .svhs = 2,
2685 .muxsel = { 2, 3, 1 },
2686 .gpiomask = 0x00e00007,
2687 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2688 .no_msp34xx = 1,
2689 .no_tda9875 = 1,
2690 .no_tda7432 = 1,
2691 .has_dvb = 1,
2693 /* ---- card 0x88---------------------------------- */
2694 [BTTV_BOARD_ACORP_Y878F] = {
2695 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2696 .name = "Acorp Y878F",
2697 .video_inputs = 3,
2698 .audio_inputs = 1,
2699 .tuner = 0,
2700 .svhs = 2,
2701 .gpiomask = 0x01fe00,
2702 .muxsel = { 2, 3, 1, 1},
2703 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2704 .needs_tvaudio = 1,
2705 .pll = PLL_28,
2706 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2707 .tuner_addr = 0xc1 >>1,
2708 .radio_addr = 0xc1 >>1,
2709 .has_radio = 1,
2711 /* ---- card 0x89 ---------------------------------- */
2712 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2713 .name = "Conceptronic CTVFMi v2",
2714 .video_inputs = 3,
2715 .audio_inputs = 1,
2716 .tuner = 0,
2717 .svhs = 2,
2718 .gpiomask = 0x001c0007,
2719 .muxsel = { 2, 3, 1, 1 },
2720 .audiomux = { 0, 1, 2, 2, 3 },
2721 .needs_tvaudio = 0,
2722 .pll = PLL_28,
2723 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2724 .tuner_addr = ADDR_UNSET,
2725 .radio_addr = ADDR_UNSET,
2726 .has_remote = 1,
2727 #if 0
2728 .has_radio = 1,
2729 #endif
2731 /* ---- card 0x8a ---------------------------------- */
2732 [BTTV_BOARD_PV_BT878P_2E] = {
2733 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2734 .video_inputs = 5,
2735 .audio_inputs = 1,
2736 .tuner = 0,
2737 .svhs = 3,
2738 .gpiomask = 0x01fe00,
2739 .muxsel = { 2,3,1,1,-1 },
2740 .digital_mode = DIGITAL_MODE_CAMERA,
2741 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2742 .no_msp34xx = 1,
2743 .pll = PLL_28,
2744 .tuner_type = TUNER_LG_PAL_FM,
2745 .tuner_addr = ADDR_UNSET,
2746 .radio_addr = ADDR_UNSET,
2747 .has_remote = 1,
2749 /* ---- card 0x8b ---------------------------------- */
2750 [BTTV_BOARD_PV_M4900] = {
2751 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2752 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2753 .video_inputs = 3,
2754 .audio_inputs = 1,
2755 .tuner = 0,
2756 .svhs = 2,
2757 .gpiomask = 0x3f,
2758 .muxsel = { 2, 3, 1, 1 },
2759 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2760 .no_msp34xx = 1,
2761 .pll = PLL_28,
2762 .tuner_type = TUNER_YMEC_TVF_5533MF,
2763 .tuner_addr = ADDR_UNSET,
2764 .radio_addr = ADDR_UNSET,
2765 .has_radio = 1,
2766 .has_remote = 1,
2768 /* ---- card 0x8c ---------------------------------- */
2769 [BTTV_BOARD_OSPREY440] = {
2770 .name = "Osprey 440",
2771 .video_inputs = 1,
2772 .audio_inputs = 1,
2773 .tuner = -1,
2774 .svhs = 1,
2775 .muxsel = { 2 },
2776 .pll = PLL_28,
2777 .tuner_type = UNSET,
2778 .tuner_addr = ADDR_UNSET,
2779 .radio_addr = ADDR_UNSET,
2780 .no_msp34xx = 1,
2781 .no_tda9875 = 1,
2782 .no_tda7432 = 1,
2784 /* ---- card 0x8d ---------------------------------- */
2785 [BTTV_BOARD_ASOUND_SKYEYE] = {
2786 .name = "Asound Skyeye PCTV",
2787 .video_inputs = 3,
2788 .audio_inputs = 1,
2789 .tuner = 0,
2790 .svhs = 2,
2791 .gpiomask = 15,
2792 .muxsel = { 2, 3, 1, 1},
2793 .audiomux = {2,0,0,0,1},
2794 .needs_tvaudio = 1,
2795 .pll = PLL_28,
2796 .tuner_type = 2,
2797 .tuner_addr = ADDR_UNSET,
2798 .radio_addr = ADDR_UNSET,
2803 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2805 /* ----------------------------------------------------------------------- */
2807 static unsigned char eeprom_data[256];
2810 * identify card
2812 void __devinit bttv_idcard(struct bttv *btv)
2814 unsigned int gpiobits;
2815 int i,type;
2816 unsigned short tmp;
2818 /* read PCI subsystem ID */
2819 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2820 btv->cardid = tmp << 16;
2821 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2822 btv->cardid |= tmp;
2824 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2825 /* look for the card */
2826 for (type = -1, i = 0; cards[i].id != 0; i++)
2827 if (cards[i].id == btv->cardid)
2828 type = i;
2830 if (type != -1) {
2831 /* found it */
2832 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2833 "PCI subsystem ID is %04x:%04x\n",
2834 btv->c.nr,cards[type].name,cards[type].cardnr,
2835 btv->cardid & 0xffff,
2836 (btv->cardid >> 16) & 0xffff);
2837 btv->c.type = cards[type].cardnr;
2838 } else {
2839 /* 404 */
2840 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2841 btv->c.nr, btv->cardid & 0xffff,
2842 (btv->cardid >> 16) & 0xffff);
2843 printk(KERN_DEBUG "please mail id, board name and "
2844 "the correct card= insmod option to video4linux-list@redhat.com\n");
2848 /* let the user override the autodetected type */
2849 if (card[btv->c.nr] < bttv_num_tvcards)
2850 btv->c.type=card[btv->c.nr];
2852 /* print which card config we are using */
2853 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2854 bttv_tvcards[btv->c.type].name, btv->c.type,
2855 card[btv->c.nr] < bttv_num_tvcards
2856 ? "insmod option" : "autodetected");
2858 /* overwrite gpio stuff ?? */
2859 if (UNSET == audioall && UNSET == audiomux[0])
2860 return;
2862 if (UNSET != audiomux[0]) {
2863 gpiobits = 0;
2864 for (i = 0; i < 5; i++) {
2865 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2866 gpiobits |= audiomux[i];
2868 } else {
2869 gpiobits = audioall;
2870 for (i = 0; i < 5; i++) {
2871 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2874 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2875 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2876 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2877 for (i = 0; i < 5; i++) {
2878 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2880 printk("\n");
2884 * (most) board specific initialisations goes here
2887 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2888 void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2890 int type = -1;
2892 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2893 type = BTTV_BOARD_MODTEC_205;
2894 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2895 type = BTTV_BOARD_EURESYS_PICOLO;
2896 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2897 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2899 if (-1 != type) {
2900 btv->c.type = type;
2901 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2902 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2906 static void flyvideo_gpio(struct bttv *btv)
2908 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2909 int tuner=-1,ttype;
2911 gpio_inout(0xffffff, 0);
2912 udelay(8); /* without this we would see the 0x1800 mask */
2913 gpio = gpio_read();
2914 /* FIXME: must restore OUR_EN ??? */
2916 /* all cards provide GPIO info, some have an additional eeprom
2917 * LR50: GPIO coding can be found lower right CP1 .. CP9
2918 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2919 * GPIO14-12: n.c.
2920 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
2922 * lowest 3 bytes are remote control codes (no handshake needed)
2923 * xxxFFF: No remote control chip soldered
2924 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2925 * Note: Some bits are Audio_Mask !
2927 ttype=(gpio&0x0f0000)>>16;
2928 switch(ttype) {
2929 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
2930 break;
2931 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
2932 break;
2933 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
2934 break;
2935 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
2936 break;
2937 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
2938 break;
2939 default:
2940 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2943 has_remote = gpio & 0x800000;
2944 has_radio = gpio & 0x400000;
2945 /* unknown 0x200000;
2946 * unknown2 0x100000; */
2947 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
2948 has_tda9820_tda9821 = !(gpio & 0x004000);
2949 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2951 * gpio & 0x001000 output bit for audio routing */
2953 if(is_capture_only)
2954 tuner=4; /* No tuner present */
2956 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2957 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2958 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2959 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2960 is_capture_only?"yes":"no ");
2962 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
2963 btv->tuner_type = tuner;
2964 btv->has_radio = has_radio;
2966 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2967 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2968 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
2969 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
2970 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
2973 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2974 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2975 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2976 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2978 static void miro_pinnacle_gpio(struct bttv *btv)
2980 int id,msp,gpio;
2981 char *info;
2983 gpio_inout(0xffffff, 0);
2984 gpio = gpio_read();
2985 id = ((gpio>>10) & 63) -1;
2986 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2987 if (id < 32) {
2988 btv->tuner_type = miro_tunermap[id];
2989 if (0 == (gpio & 0x20)) {
2990 btv->has_radio = 1;
2991 if (!miro_fmtuner[id]) {
2992 btv->has_matchbox = 1;
2993 btv->mbox_we = (1<<6);
2994 btv->mbox_most = (1<<7);
2995 btv->mbox_clk = (1<<8);
2996 btv->mbox_data = (1<<9);
2997 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
2999 } else {
3000 btv->has_radio = 0;
3002 if (-1 != msp) {
3003 if (btv->c.type == BTTV_BOARD_MIRO)
3004 btv->c.type = BTTV_BOARD_MIROPRO;
3005 if (btv->c.type == BTTV_BOARD_PINNACLE)
3006 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3008 printk(KERN_INFO
3009 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3010 btv->c.nr, id+1, btv->tuner_type,
3011 !btv->has_radio ? "no" :
3012 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3013 (-1 == msp) ? "no" : "yes");
3014 } else {
3015 /* new cards with microtune tuner */
3016 id = 63 - id;
3017 btv->has_radio = 0;
3018 switch (id) {
3019 case 1:
3020 info = "PAL / mono";
3021 break;
3022 case 2:
3023 info = "PAL+SECAM / stereo";
3024 btv->has_radio = 1;
3025 break;
3026 case 3:
3027 info = "NTSC / stereo";
3028 btv->has_radio = 1;
3029 break;
3030 case 4:
3031 info = "PAL+SECAM / mono";
3032 break;
3033 case 5:
3034 info = "NTSC / mono";
3035 break;
3036 case 6:
3037 info = "NTSC / stereo";
3038 break;
3039 case 7:
3040 info = "PAL / stereo";
3041 break;
3042 default:
3043 info = "oops: unknown card";
3044 break;
3046 if (-1 != msp)
3047 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3048 printk(KERN_INFO
3049 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3050 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3051 btv->tuner_type = 33;
3052 btv->pinnacle_id = id;
3056 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3057 #define LM1882_SYNC_DRIVE 0x200000L
3059 static void init_ids_eagle(struct bttv *btv)
3061 gpio_inout(0xffffff,0xFFFF37);
3062 gpio_write(0x200020);
3064 /* flash strobe inverter ?! */
3065 gpio_write(0x200024);
3067 /* switch sync drive off */
3068 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3070 /* set BT848 muxel to 2 */
3071 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3074 /* Muxsel helper for the IDS Eagle.
3075 * the eagles does not use the standard muxsel-bits but
3076 * has its own multiplexer */
3077 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3079 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3080 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3082 /* composite */
3083 /* set chroma ADC to sleep */
3084 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3085 /* set to composite video */
3086 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3087 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3089 /* switch sync drive off */
3090 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3093 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3095 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3096 gpio_write(masks[input%4]);
3099 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3100 alarms output
3102 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3103 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3105 IN - sensor inputs, INx - sensor inputs and TI XORed together
3106 O1,O2,O3 - alarm outputs (relays)
3108 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3112 static void init_lmlbt4x(struct bttv *btv)
3114 printk(KERN_DEBUG "LMLBT4x init\n");
3115 btwrite(0x000000, BT848_GPIO_REG_INP);
3116 gpio_inout(0xffffff, 0x0006C0);
3117 gpio_write(0x000000);
3120 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3122 unsigned int inmux = input % 8;
3123 gpio_inout( 0xf, 0xf );
3124 gpio_bits( 0xf, inmux );
3127 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3129 unsigned int inmux = input % 4;
3130 gpio_inout( 3<<9, 3<<9 );
3131 gpio_bits( 3<<9, inmux<<9 );
3134 /* ----------------------------------------------------------------------- */
3136 static void bttv_reset_audio(struct bttv *btv)
3139 * BT878A has a audio-reset register.
3140 * 1. This register is an audio reset function but it is in
3141 * function-0 (video capture) address space.
3142 * 2. It is enough to do this once per power-up of the card.
3143 * 3. There is a typo in the Conexant doc -- it is not at
3144 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3145 * --//Shrikumar 030609
3147 if (btv->id != 878)
3148 return;
3150 if (bttv_debug)
3151 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3152 btwrite((1<<7), 0x058);
3153 udelay(10);
3154 btwrite( 0, 0x058);
3157 /* initialization part one -- before registering i2c bus */
3158 void __devinit bttv_init_card1(struct bttv *btv)
3160 switch (btv->c.type) {
3161 case BTTV_BOARD_HAUPPAUGE:
3162 case BTTV_BOARD_HAUPPAUGE878:
3163 boot_msp34xx(btv,5);
3164 break;
3165 case BTTV_BOARD_VOODOOTV_FM:
3166 boot_msp34xx(btv,20);
3167 break;
3168 case BTTV_BOARD_AVERMEDIA98:
3169 boot_msp34xx(btv,11);
3170 break;
3171 case BTTV_BOARD_HAUPPAUGEPVR:
3172 pvr_boot(btv);
3173 break;
3174 case BTTV_BOARD_TWINHAN_DST:
3175 case BTTV_BOARD_AVDVBT_771:
3176 case BTTV_BOARD_PINNACLESAT:
3177 btv->use_i2c_hw = 1;
3178 break;
3179 case BTTV_BOARD_ADLINK_RTV24:
3180 init_RTV24( btv );
3181 break;
3184 if (!bttv_tvcards[btv->c.type].has_dvb)
3185 bttv_reset_audio(btv);
3188 /* initialization part two -- after registering i2c bus */
3189 void __devinit bttv_init_card2(struct bttv *btv)
3191 int tda9887;
3192 int addr=ADDR_UNSET, radio_addr=ADDR_UNSET;
3194 btv->tuner_type = -1;
3196 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3197 bttv_readee(btv,eeprom_data,0xa0);
3198 identify_by_eeprom(btv,eeprom_data);
3201 switch (btv->c.type) {
3202 case BTTV_BOARD_MIRO:
3203 case BTTV_BOARD_MIROPRO:
3204 case BTTV_BOARD_PINNACLE:
3205 case BTTV_BOARD_PINNACLEPRO:
3206 /* miro/pinnacle */
3207 miro_pinnacle_gpio(btv);
3208 break;
3209 case BTTV_BOARD_FLYVIDEO_98:
3210 case BTTV_BOARD_MAXI:
3211 case BTTV_BOARD_LIFE_FLYKIT:
3212 case BTTV_BOARD_FLYVIDEO:
3213 case BTTV_BOARD_TYPHOON_TVIEW:
3214 case BTTV_BOARD_CHRONOS_VS2:
3215 case BTTV_BOARD_FLYVIDEO_98FM:
3216 case BTTV_BOARD_FLYVIDEO2000:
3217 case BTTV_BOARD_FLYVIDEO98EZ:
3218 case BTTV_BOARD_CONFERENCETV:
3219 case BTTV_BOARD_LIFETEC_9415:
3220 flyvideo_gpio(btv);
3221 break;
3222 case BTTV_BOARD_HAUPPAUGE:
3223 case BTTV_BOARD_HAUPPAUGE878:
3224 case BTTV_BOARD_HAUPPAUGEPVR:
3225 /* pick up some config infos from the eeprom */
3226 bttv_readee(btv,eeprom_data,0xa0);
3227 hauppauge_eeprom(btv);
3228 break;
3229 case BTTV_BOARD_AVERMEDIA98:
3230 case BTTV_BOARD_AVPHONE98:
3231 bttv_readee(btv,eeprom_data,0xa0);
3232 avermedia_eeprom(btv);
3233 break;
3234 case BTTV_BOARD_PXC200:
3235 init_PXC200(btv);
3236 break;
3237 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3238 picolo_tetra_init(btv);
3239 break;
3240 case BTTV_BOARD_VHX:
3241 btv->has_radio = 1;
3242 btv->has_matchbox = 1;
3243 btv->mbox_we = 0x20;
3244 btv->mbox_most = 0;
3245 btv->mbox_clk = 0x08;
3246 btv->mbox_data = 0x10;
3247 btv->mbox_mask = 0x38;
3248 break;
3249 case BTTV_BOARD_VOBIS_BOOSTAR:
3250 case BTTV_BOARD_TERRATV:
3251 terratec_active_radio_upgrade(btv);
3252 break;
3253 case BTTV_BOARD_MAGICTVIEW061:
3254 if (btv->cardid == 0x3002144f) {
3255 btv->has_radio=1;
3256 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3258 break;
3259 case BTTV_BOARD_STB2:
3260 if (btv->cardid == 0x3060121a) {
3261 /* Fix up entry for 3DFX VoodooTV 100,
3262 which is an OEM STB card variant. */
3263 btv->has_radio=0;
3264 btv->tuner_type=TUNER_TEMIC_NTSC;
3266 break;
3267 case BTTV_BOARD_OSPREY1x0:
3268 case BTTV_BOARD_OSPREY1x0_848:
3269 case BTTV_BOARD_OSPREY101_848:
3270 case BTTV_BOARD_OSPREY1x1:
3271 case BTTV_BOARD_OSPREY1x1_SVID:
3272 case BTTV_BOARD_OSPREY2xx:
3273 case BTTV_BOARD_OSPREY2x0_SVID:
3274 case BTTV_BOARD_OSPREY2x0:
3275 case BTTV_BOARD_OSPREY500:
3276 case BTTV_BOARD_OSPREY540:
3277 case BTTV_BOARD_OSPREY2000:
3278 bttv_readee(btv,eeprom_data,0xa0);
3279 osprey_eeprom(btv);
3280 break;
3281 case BTTV_BOARD_IDS_EAGLE:
3282 init_ids_eagle(btv);
3283 break;
3284 case BTTV_BOARD_MODTEC_205:
3285 bttv_readee(btv,eeprom_data,0xa0);
3286 modtec_eeprom(btv);
3287 break;
3288 case BTTV_BOARD_LMLBT4:
3289 init_lmlbt4x(btv);
3290 break;
3291 case BTTV_BOARD_TIBET_CS16:
3292 tibetCS16_init(btv);
3293 break;
3294 case BTTV_BOARD_KODICOM_4400R:
3295 kodicom4400r_init(btv);
3296 break;
3299 /* pll configuration */
3300 if (!(btv->id==848 && btv->revision==0x11)) {
3301 /* defaults from card list */
3302 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3303 btv->pll.pll_ifreq=28636363;
3304 btv->pll.pll_crystal=BT848_IFORM_XT0;
3306 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3307 btv->pll.pll_ifreq=35468950;
3308 btv->pll.pll_crystal=BT848_IFORM_XT1;
3310 /* insmod options can override */
3311 switch (pll[btv->c.nr]) {
3312 case 0: /* none */
3313 btv->pll.pll_crystal = 0;
3314 btv->pll.pll_ifreq = 0;
3315 btv->pll.pll_ofreq = 0;
3316 break;
3317 case 1: /* 28 MHz */
3318 case 28:
3319 btv->pll.pll_ifreq = 28636363;
3320 btv->pll.pll_ofreq = 0;
3321 btv->pll.pll_crystal = BT848_IFORM_XT0;
3322 break;
3323 case 2: /* 35 MHz */
3324 case 35:
3325 btv->pll.pll_ifreq = 35468950;
3326 btv->pll.pll_ofreq = 0;
3327 btv->pll.pll_crystal = BT848_IFORM_XT1;
3328 break;
3331 btv->pll.pll_current = -1;
3333 /* tuner configuration (from card list / autodetect / insmod option) */
3334 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3335 addr = bttv_tvcards[btv->c.type].tuner_addr;
3337 if (ADDR_UNSET != bttv_tvcards[btv->c.type].radio_addr)
3338 radio_addr = bttv_tvcards[btv->c.type].radio_addr;
3340 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3341 if(UNSET == btv->tuner_type)
3342 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3343 if (UNSET != tuner[btv->c.nr])
3344 btv->tuner_type = tuner[btv->c.nr];
3345 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
3346 if (btv->pinnacle_id != UNSET)
3347 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
3348 &btv->pinnacle_id);
3349 if (btv->tuner_type != UNSET) {
3350 struct tuner_setup tun_setup;
3352 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3353 tun_setup.type = btv->tuner_type;
3354 tun_setup.addr = addr;
3356 if (addr == radio_addr)
3357 tun_setup.mode_mask = T_RADIO;
3359 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3362 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3363 if (svhs[btv->c.nr] != UNSET)
3364 btv->svhs = svhs[btv->c.nr];
3365 if (remote[btv->c.nr] != UNSET)
3366 btv->has_remote = remote[btv->c.nr];
3368 if (bttv_tvcards[btv->c.type].has_radio)
3369 btv->has_radio=1;
3370 if (bttv_tvcards[btv->c.type].has_remote)
3371 btv->has_remote=1;
3372 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3373 btv->gpioirq=1;
3374 if (bttv_tvcards[btv->c.type].audio_hook)
3375 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3377 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3378 /* detect Bt832 chip for quartzsight digital camera */
3379 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
3380 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
3381 boot_bt832(btv);
3384 if (!autoload)
3385 return;
3387 /* try to detect audio/fader chips */
3388 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3389 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
3390 request_module("msp3400");
3392 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3393 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3394 request_module("msp3400");
3396 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3397 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
3398 request_module("tda9875");
3400 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3401 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
3402 request_module("tda7432");
3404 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3405 request_module("tvaudio");
3407 /* tuner modules */
3408 tda9887 = 0;
3409 if (btv->pinnacle_id != UNSET)
3410 tda9887 = 1;
3411 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3412 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
3413 tda9887 = 1;
3414 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3415 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3416 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3417 tda9887)
3418 request_module("tda9887");
3419 if (btv->tuner_type != UNSET)
3420 request_module("tuner");
3424 /* ----------------------------------------------------------------------- */
3426 static void modtec_eeprom(struct bttv *btv)
3428 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3429 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3430 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3431 btv->c.nr,&eeprom_data[0x1e]);
3432 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3433 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3434 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3435 btv->c.nr,&eeprom_data[0x1e]);
3436 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3437 btv->tuner_type=TUNER_PHILIPS_NTSC;
3438 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3439 btv->c.nr,&eeprom_data[0x1e]);
3440 } else {
3441 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3442 btv->c.nr,&eeprom_data[0x1e]);
3446 static void __devinit hauppauge_eeprom(struct bttv *btv)
3448 struct tveeprom tv;
3450 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3451 btv->tuner_type = tv.tuner_type;
3452 btv->has_radio = tv.has_radio;
3455 static int terratec_active_radio_upgrade(struct bttv *btv)
3457 int freq;
3459 btv->has_radio = 1;
3460 btv->has_matchbox = 1;
3461 btv->mbox_we = 0x10;
3462 btv->mbox_most = 0x20;
3463 btv->mbox_clk = 0x08;
3464 btv->mbox_data = 0x04;
3465 btv->mbox_mask = 0x3c;
3467 btv->mbox_iow = 1 << 8;
3468 btv->mbox_ior = 1 << 9;
3469 btv->mbox_csel = 1 << 10;
3471 freq=88000/62.5;
3472 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3473 if (0x1ed8 == tea5757_read(btv)) {
3474 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3475 btv->c.nr);
3476 btv->has_radio = 1;
3477 btv->has_matchbox = 1;
3478 } else {
3479 btv->has_radio = 0;
3480 btv->has_matchbox = 0;
3482 return 0;
3486 /* ----------------------------------------------------------------------- */
3489 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3491 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3492 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3493 * unpacked with unzip).
3495 #define PVR_GPIO_DELAY 10
3497 #define BTTV_ALT_DATA 0x000001
3498 #define BTTV_ALT_DCLK 0x100000
3499 #define BTTV_ALT_NCONFIG 0x800000
3501 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3503 u32 n;
3504 u8 bits;
3505 int i;
3507 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3508 gpio_write(0);
3509 udelay(PVR_GPIO_DELAY);
3511 gpio_write(BTTV_ALT_NCONFIG);
3512 udelay(PVR_GPIO_DELAY);
3514 for (n = 0; n < microlen; n++) {
3515 bits = micro[n];
3516 for ( i = 0 ; i < 8 ; i++ ) {
3517 gpio_bits(BTTV_ALT_DCLK,0);
3518 if (bits & 0x01)
3519 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3520 else
3521 gpio_bits(BTTV_ALT_DATA,0);
3522 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3523 bits >>= 1;
3526 gpio_bits(BTTV_ALT_DCLK,0);
3527 udelay(PVR_GPIO_DELAY);
3529 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3530 for (i = 0 ; i < 30 ; i++) {
3531 gpio_bits(BTTV_ALT_DCLK,0);
3532 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3534 gpio_bits(BTTV_ALT_DCLK,0);
3535 return 0;
3538 static int __devinit pvr_boot(struct bttv *btv)
3540 const struct firmware *fw_entry;
3541 int rc;
3543 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3544 if (rc != 0) {
3545 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3546 btv->c.nr);
3547 return rc;
3549 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3550 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3551 btv->c.nr, (rc < 0) ? "failed" : "ok");
3552 release_firmware(fw_entry);
3553 return rc;
3556 /* ----------------------------------------------------------------------- */
3557 /* some osprey specific stuff */
3559 static void __devinit osprey_eeprom(struct bttv *btv)
3561 int i = 0;
3562 unsigned char *ee = eeprom_data;
3563 unsigned long serial = 0;
3565 if (btv->c.type == 0) {
3566 /* this might be an antique... check for MMAC label in eeprom */
3567 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3568 unsigned char checksum = 0;
3569 for (i =0; i<21; i++)
3570 checksum += ee[i];
3571 if (checksum != ee[21])
3572 return;
3573 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3574 for (i = 12; i < 21; i++)
3575 serial *= 10, serial += ee[i] - '0';
3577 } else {
3578 unsigned short type;
3579 int offset = 4*16;
3581 for(; offset < 8*16; offset += 16) {
3582 unsigned short checksum = 0;
3583 /* verify the checksum */
3584 for(i = 0; i<14; i++) checksum += ee[i+offset];
3585 checksum = ~checksum; /* no idea why */
3586 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3587 ((checksum & 0x0FF) == ee[offset+15])) {
3588 break;
3592 if (offset >= 8*16)
3593 return;
3595 /* found a valid descriptor */
3596 type = (ee[offset+4]<<8) | (ee[offset+5]);
3598 switch(type) {
3600 /* 848 based */
3601 case 0x0004:
3602 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3603 break;
3604 case 0x0005:
3605 btv->c.type = BTTV_BOARD_OSPREY101_848;
3606 break;
3608 /* 878 based */
3609 case 0x0012:
3610 case 0x0013:
3611 btv->c.type = BTTV_BOARD_OSPREY1x0;
3612 break;
3613 case 0x0014:
3614 case 0x0015:
3615 btv->c.type = BTTV_BOARD_OSPREY1x1;
3616 break;
3617 case 0x0016:
3618 case 0x0017:
3619 case 0x0020:
3620 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
3621 break;
3622 case 0x0018:
3623 case 0x0019:
3624 case 0x001E:
3625 case 0x001F:
3626 btv->c.type = BTTV_BOARD_OSPREY2xx;
3627 break;
3628 case 0x001A:
3629 case 0x001B:
3630 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
3631 break;
3632 case 0x0040:
3633 btv->c.type = BTTV_BOARD_OSPREY500;
3634 break;
3635 case 0x0050:
3636 case 0x0056:
3637 btv->c.type = BTTV_BOARD_OSPREY540;
3638 /* bttv_osprey_540_init(btv); */
3639 break;
3640 case 0x0060:
3641 case 0x0070:
3642 btv->c.type = BTTV_BOARD_OSPREY2x0;
3643 /* enable output on select control lines */
3644 gpio_inout(0xffffff,0x000303);
3645 break;
3646 default:
3647 /* unknown...leave generic, but get serial # */
3648 break;
3650 serial = (ee[offset+6] << 24)
3651 | (ee[offset+7] << 16)
3652 | (ee[offset+8] << 8)
3653 | (ee[offset+9]);
3656 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3657 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3660 /* ----------------------------------------------------------------------- */
3661 /* AVermedia specific stuff, from bktr_card.c */
3663 static int tuner_0_table[] = {
3664 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3665 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3666 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3667 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3668 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3669 TUNER_PHILIPS_FM1216ME_MK3 };
3671 static int tuner_1_table[] = {
3672 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3673 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3674 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3675 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3676 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3678 static void __devinit avermedia_eeprom(struct bttv *btv)
3680 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3682 tuner_make = (eeprom_data[0x41] & 0x7);
3683 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3684 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3685 btv->has_remote = (eeprom_data[0x42] & 0x01);
3687 if (tuner_make == 0 || tuner_make == 2)
3688 if(tuner_format <=0x0a)
3689 tuner = tuner_0_table[tuner_format];
3690 if (tuner_make == 1)
3691 if(tuner_format <=9)
3692 tuner = tuner_1_table[tuner_format];
3694 if (tuner_make == 4)
3695 if(tuner_format == 0x09)
3696 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3698 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3699 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3700 if(tuner) {
3701 btv->tuner_type=tuner;
3702 printk("%d",tuner);
3703 } else
3704 printk("Unknown type");
3705 printk(" radio:%s remote control:%s\n",
3706 tuner_tv_fm ? "yes" : "no",
3707 btv->has_remote ? "yes" : "no");
3710 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3711 void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3713 /* fix up our card entry */
3714 if(norm==VIDEO_MODE_NTSC) {
3715 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff;
3716 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff;
3717 dprintk("bttv_tda9880_setnorm to NTSC\n");
3719 else {
3720 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3721 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
3722 dprintk("bttv_tda9880_setnorm to PAL\n");
3724 /* set GPIO according */
3725 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3726 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3731 * reset/enable the MSP on some Hauppauge cards
3732 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3734 * Hauppauge: pin 5
3735 * Voodoo: pin 20
3737 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3739 int mask = (1 << pin);
3741 gpio_inout(mask,mask);
3742 gpio_bits(mask,0);
3743 udelay(2500);
3744 gpio_bits(mask,mask);
3746 if (bttv_gpio)
3747 bttv_gpio_tracking(btv,"msp34xx");
3748 if (bttv_verbose)
3749 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3750 "init [%d]\n", btv->c.nr, pin);
3753 static void __devinit boot_bt832(struct bttv *btv)
3757 /* ----------------------------------------------------------------------- */
3758 /* Imagenation L-Model PXC200 Framegrabber */
3759 /* This is basically the same procedure as
3760 * used by Alessandro Rubini in his pxc200
3761 * driver, but using BTTV functions */
3763 static void __devinit init_PXC200(struct bttv *btv)
3765 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3766 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3767 0x00 };
3768 unsigned int i;
3769 int tmp;
3770 u32 val;
3772 /* Initialise GPIO-connevted stuff */
3773 gpio_inout(0xffffff, (1<<13));
3774 gpio_write(0);
3775 udelay(3);
3776 gpio_write(1<<13);
3777 /* GPIO inputs are pulled up, so no need to drive
3778 * reset pin any longer */
3779 gpio_bits(0xffffff, 0);
3780 if (bttv_gpio)
3781 bttv_gpio_tracking(btv,"pxc200");
3783 /* we could/should try and reset/control the AD pots? but
3784 right now we simply turned off the crushing. Without
3785 this the AGC drifts drifts
3786 remember the EN is reverse logic -->
3787 setting BT848_ADC_AGC_EN disable the AGC
3788 tboult@eecs.lehigh.edu
3791 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3793 /* Initialise MAX517 DAC */
3794 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3795 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3797 /* Initialise 12C508 PIC */
3798 /* The I2CWrite and I2CRead commmands are actually to the
3799 * same chips - but the R/W bit is included in the address
3800 * argument so the numbers are different */
3803 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3805 /* First of all, enable the clock line. This is used in the PXC200-F */
3806 val = btread(BT848_GPIO_DMA_CTL);
3807 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3808 btwrite(val, BT848_GPIO_DMA_CTL);
3810 /* Then, push to 0 the reset pin long enough to reset the *
3811 * device same as above for the reset line, but not the same
3812 * value sent to the GPIO-connected stuff
3813 * which one is the good one? */
3814 gpio_inout(0xffffff,(1<<2));
3815 gpio_write(0);
3816 udelay(10);
3817 gpio_write(1<<2);
3819 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3820 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3821 if (tmp != -1) {
3822 printk(KERN_INFO
3823 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3824 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3828 printk(KERN_INFO "PXC200 Initialised.\n");
3833 /* ----------------------------------------------------------------------- */
3835 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3836 * it. This apparently involves the following procedure for each 878 chip:
3838 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3840 * 2) write to GPIO_DATA
3841 * - 0x0E
3842 * - sleep 1ms
3843 * - 0x10 + 0x0E
3844 * - sleep 10ms
3845 * - 0x0E
3846 * read from GPIO_DATA into buf (uint_32)
3847 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3848 * error. ERROR_CPLD_Check_Failed stop.
3850 * 3) write to GPIO_DATA
3851 * - write 0x4400 + 0x0E
3852 * - sleep 10ms
3853 * - write 0x4410 + 0x0E
3854 * - sleep 1ms
3855 * - write 0x0E
3856 * read from GPIO_DATA into buf (uint_32)
3857 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3858 * error. ERROR_CPLD_Check_Failed.
3860 /* ----------------------------------------------------------------------- */
3861 void
3862 init_RTV24 (struct bttv *btv)
3864 uint32_t dataRead = 0;
3865 long watchdog_value = 0x0E;
3867 printk (KERN_INFO
3868 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3869 btv->c.nr);
3871 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
3873 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3874 msleep (1);
3875 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3876 msleep (10);
3877 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3879 dataRead = btread (BT848_GPIO_DATA);
3881 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3882 printk (KERN_INFO
3883 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3884 btv->c.nr, dataRead);
3887 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3888 msleep (10);
3889 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3890 msleep (1);
3891 btwrite (watchdog_value, BT848_GPIO_DATA);
3892 msleep (1);
3893 dataRead = btread (BT848_GPIO_DATA);
3895 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3896 printk (KERN_INFO
3897 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3898 btv->c.nr, dataRead);
3900 return;
3903 printk (KERN_INFO
3904 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
3909 /* ----------------------------------------------------------------------- */
3910 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3912 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3913 * This code is placed under the terms of the GNU General Public License
3915 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3918 static void bus_low(struct bttv *btv, int bit)
3920 if (btv->mbox_ior) {
3921 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3922 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3923 udelay(5);
3926 gpio_bits(bit,0);
3927 udelay(5);
3929 if (btv->mbox_ior) {
3930 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3931 udelay(5);
3935 static void bus_high(struct bttv *btv, int bit)
3937 if (btv->mbox_ior) {
3938 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3939 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3940 udelay(5);
3943 gpio_bits(bit,bit);
3944 udelay(5);
3946 if (btv->mbox_ior) {
3947 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3948 udelay(5);
3952 static int bus_in(struct bttv *btv, int bit)
3954 if (btv->mbox_ior) {
3955 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3956 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3957 udelay(5);
3959 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3960 udelay(5);
3962 return gpio_read() & (bit);
3965 /* TEA5757 register bits */
3966 #define TEA_FREQ 0:14
3967 #define TEA_BUFFER 15:15
3969 #define TEA_SIGNAL_STRENGTH 16:17
3971 #define TEA_PORT1 18:18
3972 #define TEA_PORT0 19:19
3974 #define TEA_BAND 20:21
3975 #define TEA_BAND_FM 0
3976 #define TEA_BAND_MW 1
3977 #define TEA_BAND_LW 2
3978 #define TEA_BAND_SW 3
3980 #define TEA_MONO 22:22
3981 #define TEA_ALLOW_STEREO 0
3982 #define TEA_FORCE_MONO 1
3984 #define TEA_SEARCH_DIRECTION 23:23
3985 #define TEA_SEARCH_DOWN 0
3986 #define TEA_SEARCH_UP 1
3988 #define TEA_STATUS 24:24
3989 #define TEA_STATUS_TUNED 0
3990 #define TEA_STATUS_SEARCHING 1
3992 /* Low-level stuff */
3993 static int tea5757_read(struct bttv *btv)
3995 unsigned long timeout;
3996 int value = 0;
3997 int i;
3999 /* better safe than sorry */
4000 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4002 if (btv->mbox_ior) {
4003 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4004 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4005 udelay(5);
4008 if (bttv_gpio)
4009 bttv_gpio_tracking(btv,"tea5757 read");
4011 bus_low(btv,btv->mbox_we);
4012 bus_low(btv,btv->mbox_clk);
4014 udelay(10);
4015 timeout= jiffies + HZ;
4017 /* wait for DATA line to go low; error if it doesn't */
4018 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4019 schedule();
4020 if (bus_in(btv,btv->mbox_data)) {
4021 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4022 return -1;
4025 dprintk("bttv%d: tea5757:",btv->c.nr);
4026 for(i = 0; i < 24; i++)
4028 udelay(5);
4029 bus_high(btv,btv->mbox_clk);
4030 udelay(5);
4031 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4032 bus_low(btv,btv->mbox_clk);
4033 value <<= 1;
4034 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4035 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4037 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4038 return value;
4041 static int tea5757_write(struct bttv *btv, int value)
4043 int i;
4044 int reg = value;
4046 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4048 if (btv->mbox_ior) {
4049 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4050 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4051 udelay(5);
4053 if (bttv_gpio)
4054 bttv_gpio_tracking(btv,"tea5757 write");
4056 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4057 bus_low(btv,btv->mbox_clk);
4058 bus_high(btv,btv->mbox_we);
4059 for(i = 0; i < 25; i++)
4061 if (reg & 0x1000000)
4062 bus_high(btv,btv->mbox_data);
4063 else
4064 bus_low(btv,btv->mbox_data);
4065 reg <<= 1;
4066 bus_high(btv,btv->mbox_clk);
4067 udelay(10);
4068 bus_low(btv,btv->mbox_clk);
4069 udelay(10);
4071 bus_low(btv,btv->mbox_we); /* unmute !!! */
4072 return 0;
4075 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4077 dprintk("tea5757_set_freq %d\n",freq);
4078 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4082 /* ----------------------------------------------------------------------- */
4083 /* winview */
4085 void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4087 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4088 int bits_out, loops, vol, data;
4090 if (!set) {
4091 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4092 v->flags |= VIDEO_AUDIO_VOLUME;
4093 return;
4096 /* 32 levels logarithmic */
4097 vol = 32 - ((v->volume>>11));
4098 /* units */
4099 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4100 /* tens */
4101 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4102 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4103 data = gpio_read();
4104 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4105 WINVIEW_PT2254_STROBE);
4106 for (loops = 17; loops >= 0 ; loops--) {
4107 if (bits_out & (1<<loops))
4108 data |= WINVIEW_PT2254_DATA;
4109 else
4110 data &= ~WINVIEW_PT2254_DATA;
4111 gpio_write(data);
4112 udelay(5);
4113 data |= WINVIEW_PT2254_CLK;
4114 gpio_write(data);
4115 udelay(5);
4116 data &= ~WINVIEW_PT2254_CLK;
4117 gpio_write(data);
4119 data |= WINVIEW_PT2254_STROBE;
4120 data &= ~WINVIEW_PT2254_DATA;
4121 gpio_write(data);
4122 udelay(10);
4123 data &= ~WINVIEW_PT2254_STROBE;
4124 gpio_write(data);
4127 /* ----------------------------------------------------------------------- */
4128 /* mono/stereo control for various cards (which don't use i2c chips but */
4129 /* connect something to the GPIO pins */
4131 static void
4132 gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4134 unsigned int con = 0;
4136 if (set) {
4137 gpio_inout(0x300, 0x300);
4138 if (v->mode & VIDEO_SOUND_LANG1)
4139 con = 0x000;
4140 if (v->mode & VIDEO_SOUND_LANG2)
4141 con = 0x300;
4142 if (v->mode & VIDEO_SOUND_STEREO)
4143 con = 0x200;
4144 /* if (v->mode & VIDEO_SOUND_MONO)
4145 * con = 0x100; */
4146 gpio_bits(0x300, con);
4147 } else {
4148 v->mode = VIDEO_SOUND_STEREO |
4149 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4153 static void
4154 gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4156 unsigned int val, con;
4158 if (btv->radio_user)
4159 return;
4161 val = gpio_read();
4162 if (set) {
4163 con = 0x000;
4164 if (v->mode & VIDEO_SOUND_LANG2) {
4165 if (v->mode & VIDEO_SOUND_LANG1) {
4166 /* LANG1 + LANG2 */
4167 con = 0x100;
4169 else {
4170 /* LANG2 */
4171 con = 0x300;
4174 if (con != (val & 0x300)) {
4175 gpio_bits(0x300, con);
4176 if (bttv_gpio)
4177 bttv_gpio_tracking(btv,"gvbctv5pci");
4179 } else {
4180 switch (val & 0x70) {
4181 case 0x10:
4182 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4183 break;
4184 case 0x30:
4185 v->mode = VIDEO_SOUND_LANG2;
4186 break;
4187 case 0x50:
4188 v->mode = VIDEO_SOUND_LANG1;
4189 break;
4190 case 0x60:
4191 v->mode = VIDEO_SOUND_STEREO;
4192 break;
4193 case 0x70:
4194 v->mode = VIDEO_SOUND_MONO;
4195 break;
4196 default:
4197 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4198 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4204 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4205 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4206 * 0xdde enables mono and 0xccd enables sap
4208 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4209 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4210 * input/output sound connection, so both must be set for output mode.
4212 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4213 * handles this with a tda9840
4216 static void
4217 avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4219 int val = 0;
4221 if (set) {
4222 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4223 val = 0x02;
4224 if (v->mode & VIDEO_SOUND_STEREO)
4225 val = 0x01;
4226 if (val) {
4227 gpio_bits(0x03,val);
4228 if (bttv_gpio)
4229 bttv_gpio_tracking(btv,"avermedia");
4231 } else {
4232 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4233 VIDEO_SOUND_LANG1;
4234 return;
4238 static void
4239 avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4241 int val = 0;
4243 if (set) {
4244 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4245 val = 0x01;
4246 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4247 val = 0x02;
4248 btaor(val, ~0x03, BT848_GPIO_DATA);
4249 if (bttv_gpio)
4250 bttv_gpio_tracking(btv,"avermedia");
4251 } else {
4252 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4253 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4254 return;
4258 /* Lifetec 9415 handling */
4259 static void
4260 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4262 int val = 0;
4264 if (gpio_read() & 0x4000) {
4265 v->mode = VIDEO_SOUND_MONO;
4266 return;
4269 if (set) {
4270 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4271 val = 0x0080;
4272 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4273 val = 0x0880;
4274 if ((v->mode & VIDEO_SOUND_LANG1) ||
4275 (v->mode & VIDEO_SOUND_MONO))
4276 val = 0;
4277 gpio_bits(0x0880, val);
4278 if (bttv_gpio)
4279 bttv_gpio_tracking(btv,"lt9415");
4280 } else {
4281 /* autodetect doesn't work with this card :-( */
4282 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4283 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4284 return;
4288 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4289 static void
4290 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4292 unsigned int con = 0;
4294 if (set) {
4295 gpio_inout(0x180000,0x180000);
4296 if (v->mode & VIDEO_SOUND_LANG2)
4297 con = 0x080000;
4298 if (v->mode & VIDEO_SOUND_STEREO)
4299 con = 0x180000;
4300 gpio_bits(0x180000, con);
4301 if (bttv_gpio)
4302 bttv_gpio_tracking(btv,"terratv");
4303 } else {
4304 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4305 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4309 static void
4310 winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4312 unsigned long val = 0;
4314 if (set) {
4315 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4316 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4317 val = 0x420000;
4318 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4319 val = 0x420000;
4320 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4321 val = 0x410000;
4322 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4323 val = 0x020000;
4324 if (val) {
4325 gpio_bits(0x430000, val);
4326 if (bttv_gpio)
4327 bttv_gpio_tracking(btv,"winfast2000");
4329 } else {
4330 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4331 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4336 * Dariusz Kowalewski <darekk@automex.pl>
4337 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4338 * revision 9B has on-board TDA9874A sound decoder).
4340 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4341 * will mute this cards.
4343 static void
4344 pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4346 unsigned int val = 0;
4348 if (btv->radio_user)
4349 return;
4351 if (set) {
4352 if (v->mode & VIDEO_SOUND_MONO) {
4353 val = 0x01;
4355 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4356 || (v->mode & VIDEO_SOUND_STEREO)) {
4357 val = 0x02;
4359 if (val) {
4360 gpio_bits(0x03,val);
4361 if (bttv_gpio)
4362 bttv_gpio_tracking(btv,"pvbt878p9b");
4364 } else {
4365 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4366 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4371 * Dariusz Kowalewski <darekk@automex.pl>
4372 * sound control for FlyVideo 2000S (with tda9874 decoder)
4373 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4375 static void
4376 fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4378 unsigned int val = 0xffff;
4380 if (btv->radio_user)
4381 return;
4382 if (set) {
4383 if (v->mode & VIDEO_SOUND_MONO) {
4384 val = 0x0000;
4386 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4387 || (v->mode & VIDEO_SOUND_STEREO)) {
4388 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4390 if (val != 0xffff) {
4391 gpio_bits(0x1800, val);
4392 if (bttv_gpio)
4393 bttv_gpio_tracking(btv,"fv2000s");
4395 } else {
4396 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4397 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4402 * sound control for Canopus WinDVR PCI
4403 * Masaki Suzuki <masaki@btree.org>
4405 static void
4406 windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4408 unsigned long val = 0;
4410 if (set) {
4411 if (v->mode & VIDEO_SOUND_MONO)
4412 val = 0x040000;
4413 if (v->mode & VIDEO_SOUND_LANG1)
4414 val = 0;
4415 if (v->mode & VIDEO_SOUND_LANG2)
4416 val = 0x100000;
4417 if (v->mode & VIDEO_SOUND_STEREO)
4418 val = 0;
4419 if (val) {
4420 gpio_bits(0x140000, val);
4421 if (bttv_gpio)
4422 bttv_gpio_tracking(btv,"windvr");
4424 } else {
4425 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4426 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4431 * sound control for AD-TVK503
4432 * Hiroshi Takekawa <sian@big.or.jp>
4434 static void
4435 adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4437 unsigned int con = 0xffffff;
4439 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4441 if (set) {
4442 /* btor(***, BT848_GPIO_OUT_EN); */
4443 if (v->mode & VIDEO_SOUND_LANG1)
4444 con = 0x00000000;
4445 if (v->mode & VIDEO_SOUND_LANG2)
4446 con = 0x00180000;
4447 if (v->mode & VIDEO_SOUND_STEREO)
4448 con = 0x00000000;
4449 if (v->mode & VIDEO_SOUND_MONO)
4450 con = 0x00060000;
4451 if (con != 0xffffff) {
4452 gpio_bits(0x1e0000,con);
4453 if (bttv_gpio)
4454 bttv_gpio_tracking(btv, "adtvk503");
4456 } else {
4457 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4458 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4462 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4464 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4465 * switch instead (CD22M3494E). This IC can have multiple active connections
4466 * between Xn (input) and Yn (output) pins. We need to clear any existing
4467 * connection prior to establish a new one, pulsing the STROBE pin.
4469 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4470 * GPIO pins are wired as:
4471 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4472 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4473 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4474 * GPIO[8] - - P3[5] (microcontroler)
4475 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4476 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4477 * GPINTR - - P3[4] (microcontroler)
4479 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4480 * configuration either directly (as we are doing) or using the microcontroler
4481 * which is also wired to I2C interface. I have no further info on the
4482 * microcontroler features, one would need to disassembly the firmware.
4483 * note: the vendor refused to give any information on this product, all
4484 * that stuff was found using a multimeter! :)
4486 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4488 /* reset all conections */
4489 gpio_bits(0x200,0x200);
4490 mdelay(1);
4491 gpio_bits(0x200,0x000);
4492 mdelay(1);
4494 /* create a new conection */
4495 gpio_bits(0x480,0x080);
4496 gpio_bits(0x480,0x480);
4497 mdelay(1);
4498 gpio_bits(0x480,0x080);
4499 mdelay(1);
4502 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4504 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4505 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4506 * chips, ten eight input analog multiplexors, a not chip and a few
4507 * other components.
4509 * 16 inputs on a secondary bracket are provided and can be selected
4510 * from each of the four capture chips. Two of the eight input
4511 * multiplexors are used to select from any of the 16 input signals.
4513 * Unsupported hardware capabilities:
4514 * . A video output monitor on the secondary bracket can be selected from
4515 * one of the 878A chips.
4516 * . Another passthrough but I haven't spent any time investigating it.
4517 * . Digital I/O (logic level connected to GPIO) is available from an
4518 * onboard header.
4520 * The on chip input mux should always be set to 2.
4521 * GPIO[16:19] - Video input selection
4522 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4523 * GPIO[?:?] - Digital I/O.
4525 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4526 * determined what function (if any) it provides. With the microcontroller
4527 * and sync seperator chips a guess is that it might have to do with video
4528 * switching and maybe some digital I/O.
4530 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4532 /* video mux */
4533 gpio_bits(0x0f0000, input << 16);
4536 static void tibetCS16_init(struct bttv *btv)
4538 /* enable gpio bits, mask obtained via btSpy */
4539 gpio_inout(0xffffff, 0x0f7fff);
4540 gpio_write(0x0f7fff);
4544 * The following routines for the Kodicom-4400r get a little mind-twisting.
4545 * There is a "master" controller and three "slave" controllers, together
4546 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4547 * The analog switch is controlled by the "master", but the detection order
4548 * of the four BT878A chips is in an order which I just don't understand.
4549 * The "master" is actually the second controller to be detected. The
4550 * logic on the board uses logical numbers for the 4 controlers, but
4551 * those numbers are different from the detection sequence. When working
4552 * with the analog switch, we need to "map" from the detection sequence
4553 * over to the board's logical controller number. This mapping sequence
4554 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4555 * unit 3, the second (which is the master) is logical unit 0, etc.
4556 * We need to maintain the status of the analog switch (which of the 16
4557 * cameras is connected to which of the 4 controllers). Rather than
4558 * add to the bttv structure for this, we use the data reserved for
4559 * the mbox (unused for this card type).
4563 * First a routine to set the analog switch, which controls which camera
4564 * is routed to which controller. The switch comprises an X-address
4565 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4566 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4567 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4568 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4569 * specified address. The idea is to set the address and data, then bring
4570 * STROBE high, and finally bring STROBE back to low.
4572 static void kodicom4400r_write(struct bttv *btv,
4573 unsigned char xaddr,
4574 unsigned char yaddr,
4575 unsigned char data) {
4576 unsigned int udata;
4578 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4579 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4580 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4581 gpio_bits(0x1ff, udata); /* strobe low */
4585 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4586 * use this routine. The routine finds the "master" for the card, maps
4587 * the controller number from the detected position over to the logical
4588 * number, writes the appropriate data to the analog switch, and housekeeps
4589 * the local copy of the switch information. The parameter 'input' is the
4590 * requested camera number (0 - 15).
4592 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4594 char *sw_status;
4595 int xaddr, yaddr;
4596 struct bttv *mctlr;
4597 static unsigned char map[4] = {3, 0, 2, 1};
4599 mctlr = master[btv->c.nr];
4600 if (mctlr == NULL) { /* ignore if master not yet detected */
4601 return;
4603 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4604 yaddr = map[yaddr];
4605 sw_status = (char *)(&mctlr->mbox_we);
4606 xaddr = input & 0xf;
4607 /* Check if the controller/camera pair has changed, else ignore */
4608 if (sw_status[yaddr] != xaddr)
4610 /* "open" the old switch, "close" the new one, save the new */
4611 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4612 sw_status[yaddr] = xaddr;
4613 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4618 * During initialisation, we need to reset the analog switch. We
4619 * also preset the switch to map the 4 connectors on the card to the
4620 * *user's* (see above description of kodicom4400r_muxsel) channels
4621 * 0 through 3
4623 static void kodicom4400r_init(struct bttv *btv)
4625 char *sw_status = (char *)(&btv->mbox_we);
4626 int ix;
4628 gpio_inout(0x0003ff, 0x0003ff);
4629 gpio_write(1 << 9); /* reset MUX */
4630 gpio_write(0);
4631 /* Preset camera 0 to the 4 controllers */
4632 for (ix=0; ix<4; ix++) {
4633 sw_status[ix] = ix;
4634 kodicom4400r_write(btv, ix, ix, 1);
4637 * Since this is the "master", we need to set up the
4638 * other three controller chips' pointers to this structure
4639 * for later use in the muxsel routine.
4641 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4642 return;
4643 master[btv->c.nr-1] = btv;
4644 master[btv->c.nr] = btv;
4645 master[btv->c.nr+1] = btv;
4646 master[btv->c.nr+2] = btv;
4649 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4650 * video multiplexers to provide up to 16 video inputs. These
4651 * multiplexers are controlled by the lower 8 GPIO pins of the
4652 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4654 * xxx0 is pin xxx of multiplexer U5,
4655 * yyy1 is pin yyy of multiplexer U2
4657 #define ENA0 0x01
4658 #define ENB0 0x02
4659 #define ENA1 0x04
4660 #define ENB1 0x08
4662 #define IN10 0x10
4663 #define IN00 0x20
4664 #define IN11 0x40
4665 #define IN01 0x80
4667 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4669 static const int masks[] = {
4670 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4671 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4672 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4673 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4675 gpio_write(masks[input%16]);
4677 static void picolo_tetra_init(struct bttv *btv)
4679 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4680 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4681 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4683 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4686 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4687 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4688 /*GPIO[20]&GPIO[21] used to choose the right input*/
4689 btwrite (input<<20,BT848_GPIO_DATA);
4694 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4696 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4697 * swichers to provide 16 channels to MUX0. The TDA8540's have
4698 * 4 indepedant outputs and as such the IVC120G also has the
4699 * optional "Monitor Out" bus. This allows the card to be looking
4700 * at one input while the monitor is looking at another.
4702 * Since I've couldn't be bothered figuring out how to add an
4703 * independant muxsel for the monitor bus, I've just set it to
4704 * whatever the card is looking at.
4706 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4707 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4709 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4710 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4711 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4712 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4716 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4717 #define I2C_TDA8540 0x90
4718 #define I2C_TDA8540_ALT1 0x92
4719 #define I2C_TDA8540_ALT2 0x94
4720 #define I2C_TDA8540_ALT3 0x96
4721 #define I2C_TDA8540_ALT4 0x98
4722 #define I2C_TDA8540_ALT5 0x9a
4723 #define I2C_TDA8540_ALT6 0x9c
4725 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4727 /* Simple maths */
4728 int key = input % 4;
4729 int matrix = input / 4;
4731 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4732 btv->c.nr, input, matrix, key);
4734 /* Handles the input selection on the TDA8540's */
4735 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4736 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4737 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4738 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4739 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4740 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4741 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4742 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4744 /* Handles the output enables on the TDA8540's */
4745 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4746 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4747 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4748 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4749 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4750 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4751 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4752 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4754 /* Selects MUX0 for input on the 878 */
4755 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4759 /* PXC200 muxsel helper
4760 * luke@syseng.anu.edu.au
4761 * another transplant
4762 * from Alessandro Rubini (rubini@linux.it)
4764 * There are 4 kinds of cards:
4765 * PXC200L which is bt848
4766 * PXC200F which is bt848 with PIC controlling mux
4767 * PXC200AL which is bt878
4768 * PXC200AF which is bt878 with PIC controlling mux
4770 #define PX_CFG_PXC200F 0x01
4771 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4772 #define PX_I2C_PIC 0x0f
4773 #define PX_PXC200A_CARDID 0x200a1295
4774 #define PX_I2C_CMD_CFG 0x00
4776 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4778 int rc;
4779 long mux;
4780 int bitmask;
4781 unsigned char buf[2];
4783 /* Read PIC config to determine if this is a PXC200F */
4784 /* PX_I2C_CMD_CFG*/
4785 buf[0]=0;
4786 buf[1]=0;
4787 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4788 if (rc) {
4789 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4790 /* not PXC ? do nothing */
4791 return;
4794 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4795 if (!(rc & PX_CFG_PXC200F)) {
4796 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4797 return;
4801 /* The multiplexer in the 200F is handled by the GPIO port */
4802 /* get correct mapping between inputs */
4803 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4804 /* ** not needed!? */
4805 mux = input;
4807 /* make sure output pins are enabled */
4808 /* bitmask=0x30f; */
4809 bitmask=0x302;
4810 /* check whether we have a PXC200A */
4811 if (btv->cardid == PX_PXC200A_CARDID) {
4812 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4813 bitmask |= 7<<4; /* the DAC */
4815 btwrite(bitmask, BT848_GPIO_OUT_EN);
4817 bitmask = btread(BT848_GPIO_DATA);
4818 if (btv->cardid == PX_PXC200A_CARDID)
4819 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4820 else /* older device */
4821 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4822 btwrite(bitmask,BT848_GPIO_DATA);
4825 * Was "to be safe, set the bt848 to input 0"
4826 * Actually, since it's ok at load time, better not messing
4827 * with these bits (on PXC200AF you need to set mux 2 here)
4829 * needed because bttv-driver sets mux before calling this function
4831 if (btv->cardid == PX_PXC200A_CARDID)
4832 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4833 else /* older device */
4834 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4836 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4839 /* ----------------------------------------------------------------------- */
4840 /* motherboard chipset specific stuff */
4842 void __devinit bttv_check_chipset(void)
4844 int pcipci_fail = 0;
4845 struct pci_dev *dev = NULL;
4847 if (pci_pci_problems & PCIPCI_FAIL)
4848 pcipci_fail = 1;
4849 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4850 triton1 = 1;
4851 if (pci_pci_problems & PCIPCI_VSFX)
4852 vsfx = 1;
4853 #ifdef PCIPCI_ALIMAGIK
4854 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4855 latency = 0x0A;
4856 #endif
4859 /* print warnings about any quirks found */
4860 if (triton1)
4861 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4862 if (vsfx)
4863 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4864 if (pcipci_fail) {
4865 printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
4866 if (!no_overlay) {
4867 printk(KERN_WARNING "bttv: overlay will be disabled.\n");
4868 no_overlay = 1;
4869 } else {
4870 printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n");
4873 if (UNSET != latency)
4874 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4875 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4876 PCI_DEVICE_ID_INTEL_82441, dev))) {
4877 unsigned char b;
4878 pci_read_config_byte(dev, 0x53, &b);
4879 if (bttv_debug)
4880 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4881 "bufcon=0x%02x\n",b);
4885 int __devinit bttv_handle_chipset(struct bttv *btv)
4887 unsigned char command;
4889 if (!triton1 && !vsfx && UNSET == latency)
4890 return 0;
4892 if (bttv_verbose) {
4893 if (triton1)
4894 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4895 if (vsfx && btv->id >= 878)
4896 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4897 if (UNSET != latency)
4898 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4899 btv->c.nr,latency);
4902 if (btv->id < 878) {
4903 /* bt848 (mis)uses a bit in the irq mask for etbf */
4904 if (triton1)
4905 btv->triton1 = BT848_INT_ETBF;
4906 } else {
4907 /* bt878 has a bit in the pci config space for it */
4908 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4909 if (triton1)
4910 command |= BT878_EN_TBFX;
4911 if (vsfx)
4912 command |= BT878_EN_VSFX;
4913 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4915 if (UNSET != latency)
4916 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4917 return 0;
4922 * Local variables:
4923 * c-basic-offset: 8
4924 * End: