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/delay.h>
29 #include <linux/module.h>
30 #include <linux/kmod.h>
31 #include <linux/init.h>
32 #include <linux/pci.h>
33 #include <linux/vmalloc.h>
34 #include <linux/firmware.h>
35 #include <net/checksum.h>
37 #include <asm/unaligned.h>
41 #include <media/v4l2-common.h>
42 #include <media/tvaudio.h>
43 #include "bttv-audio-hook.h"
46 static void boot_msp34xx(struct bttv *btv, int pin);
47 static void hauppauge_eeprom(struct bttv *btv);
48 static void avermedia_eeprom(struct bttv *btv);
49 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
50 static void modtec_eeprom(struct bttv *btv);
51 static void init_PXC200(struct bttv *btv);
52 static void init_RTV24(struct bttv *btv);
54 static void rv605_muxsel(struct bttv *btv, unsigned int input);
55 static void eagle_muxsel(struct bttv *btv, unsigned int input);
56 static void xguard_muxsel(struct bttv *btv, unsigned int input);
57 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
58 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
60 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
62 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
63 static void picolo_tetra_init(struct bttv *btv);
65 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
66 static void tibetCS16_init(struct bttv *btv);
68 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
69 static void kodicom4400r_init(struct bttv *btv);
71 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
72 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
74 static void geovision_muxsel(struct bttv *btv, unsigned int input);
76 static int terratec_active_radio_upgrade(struct bttv *btv);
77 static int tea5757_read(struct bttv *btv);
78 static int tea5757_write(struct bttv *btv, int value);
79 static void identify_by_eeprom(struct bttv *btv,
80 unsigned char eeprom_data[256]);
81 static int __devinit pvr_boot(struct bttv *btv);
83 /* config variables */
84 static unsigned int triton1;
85 static unsigned int vsfx;
86 static unsigned int latency = UNSET;
89 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
90 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
91 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
92 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
93 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
94 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
96 static unsigned int autoload = 1;
98 static unsigned int autoload;
100 static unsigned int gpiomask = UNSET;
101 static unsigned int audioall = UNSET;
102 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
105 module_param(triton1, int, 0444);
106 module_param(vsfx, int, 0444);
107 module_param(no_overlay, int, 0444);
108 module_param(latency, int, 0444);
109 module_param(gpiomask, int, 0444);
110 module_param(audioall, int, 0444);
111 module_param(autoload, int, 0444);
113 module_param_array(card, int, NULL, 0444);
114 module_param_array(pll, int, NULL, 0444);
115 module_param_array(tuner, int, NULL, 0444);
116 module_param_array(svhs, int, NULL, 0444);
117 module_param_array(remote, int, NULL, 0444);
118 module_param_array(audiomux, int, NULL, 0444);
120 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
121 "[enable bug compatibility for triton1 + others]");
122 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
123 "[yet another chipset flaw workaround]");
124 MODULE_PARM_DESC(latency,"pci latency timer");
125 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
126 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
127 MODULE_PARM_DESC(tuner,"specify installed tuner type");
128 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
129 MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
130 " [some VIA/SIS chipsets are known to have problem with overlay]");
132 /* ----------------------------------------------------------------------- */
133 /* list of card IDs for bt878+ cards */
139 } cards[] __devinitdata = {
140 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
141 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
142 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
143 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
144 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
145 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
146 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
147 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
148 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
150 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
151 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
153 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
154 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
155 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
156 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
157 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
158 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
159 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
160 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
161 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
163 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
164 /* some cards ship with byteswapped IDs ... */
165 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
166 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
167 /* this seems to happen as well ... */
168 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
170 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
171 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
172 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
174 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
175 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
176 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
177 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
178 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
179 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
180 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
182 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
183 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
184 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
185 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
186 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
188 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
189 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
190 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
191 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
193 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
194 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
195 /* clashes with FlyVideo
196 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
197 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
198 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
199 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
200 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
202 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
203 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
204 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
205 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
206 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
208 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
209 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
210 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
211 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
212 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
214 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
215 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
216 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
217 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
219 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
220 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
221 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
222 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
224 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
225 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
226 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
227 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
228 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
229 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
230 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
231 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
232 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
233 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
234 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
235 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
236 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
237 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
238 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
239 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
240 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
241 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
242 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
243 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
244 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
250 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
251 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
252 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
254 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
255 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
257 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
258 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
259 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
260 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
261 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
262 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
264 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
265 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
267 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
268 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
269 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
270 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
271 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
272 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
273 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
274 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
275 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
277 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
278 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
280 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
281 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
282 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
283 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
285 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
287 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
288 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
290 /* likely broken, vendor id doesn't match the other magic views ...
291 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
293 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
294 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
296 /* DVB cards (using pci function .1 for mpeg data xfer) */
297 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
298 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
299 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
300 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
301 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
302 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
303 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
304 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
305 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
306 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
307 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
308 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
309 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
310 { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
311 { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
315 /* ----------------------------------------------------------------------- */
316 /* array with description for bt848 / bt878 tv/grabber cards */
318 struct tvcard bttv_tvcards[] = {
319 /* ---- card 0x00 ---------------------------------- */
320 [BTTV_BOARD_UNKNOWN] = {
321 .name = " *** UNKNOWN/GENERIC *** ",
325 .muxsel = { 2, 3, 1, 0 },
327 .tuner_addr = ADDR_UNSET,
328 .radio_addr = ADDR_UNSET,
330 [BTTV_BOARD_MIRO] = {
336 .muxsel = { 2, 3, 1, 1 },
337 .gpiomux = { 2, 0, 0, 0 },
341 .tuner_addr = ADDR_UNSET,
342 .radio_addr = ADDR_UNSET,
344 [BTTV_BOARD_HAUPPAUGE] = {
345 .name = "Hauppauge (bt848)",
350 .muxsel = { 2, 3, 1, 1 },
351 .gpiomux = { 0, 1, 2, 3 },
355 .tuner_addr = ADDR_UNSET,
356 .radio_addr = ADDR_UNSET,
359 .name = "STB, Gateway P/N 6000699 (bt848)",
364 .muxsel = { 2, 3, 1, 1 },
365 .gpiomux = { 4, 0, 2, 3 },
369 .tuner_type = TUNER_PHILIPS_NTSC,
370 .tuner_addr = ADDR_UNSET,
371 .radio_addr = ADDR_UNSET,
376 /* ---- card 0x04 ---------------------------------- */
377 [BTTV_BOARD_INTEL] = {
378 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
383 .muxsel = { 2, 3, 1, 1 },
386 .tuner_type = TUNER_ABSENT,
387 .tuner_addr = ADDR_UNSET,
388 .radio_addr = ADDR_UNSET,
390 [BTTV_BOARD_DIAMOND] = {
391 .name = "Diamond DTV2000",
396 .muxsel = { 2, 3, 1, 0 },
397 .gpiomux = { 0, 1, 0, 1 },
401 .tuner_addr = ADDR_UNSET,
402 .radio_addr = ADDR_UNSET,
404 [BTTV_BOARD_AVERMEDIA] = {
405 .name = "AVerMedia TVPhone",
409 .muxsel = { 2, 3, 1, 1 },
411 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
412 /* 0x04 for some cards ?? */
415 .tuner_addr = ADDR_UNSET,
416 .radio_addr = ADDR_UNSET,
417 .audio_mode_gpio= avermedia_tvphone_audio,
420 [BTTV_BOARD_MATRIX_VISION] = {
421 .name = "MATRIX-Vision MV-Delta",
426 .muxsel = { 2, 3, 1, 0, 0 },
429 .tuner_type = TUNER_ABSENT,
430 .tuner_addr = ADDR_UNSET,
431 .radio_addr = ADDR_UNSET,
434 /* ---- card 0x08 ---------------------------------- */
435 [BTTV_BOARD_FLYVIDEO] = {
436 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
441 .muxsel = { 2, 3, 1, 1 },
442 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
447 .tuner_addr = ADDR_UNSET,
448 .radio_addr = ADDR_UNSET,
450 [BTTV_BOARD_TURBOTV] = {
451 .name = "IMS/IXmicro TurboTV",
456 .muxsel = { 2, 3, 1, 1 },
457 .gpiomux = { 1, 1, 2, 3 },
460 .tuner_type = TUNER_TEMIC_PAL,
461 .tuner_addr = ADDR_UNSET,
462 .radio_addr = ADDR_UNSET,
464 [BTTV_BOARD_HAUPPAUGE878] = {
465 .name = "Hauppauge (bt878)",
469 .gpiomask = 0x0f, /* old: 7 */
470 .muxsel = { 2, 0, 1, 1 },
471 .gpiomux = { 0, 1, 2, 3 },
476 .tuner_addr = ADDR_UNSET,
477 .radio_addr = ADDR_UNSET,
479 [BTTV_BOARD_MIROPRO] = {
480 .name = "MIRO PCTV pro",
485 .muxsel = { 2, 3, 1, 1 },
486 .gpiomux = { 0x20001,0x10001, 0, 0 },
490 .tuner_addr = ADDR_UNSET,
491 .radio_addr = ADDR_UNSET,
494 /* ---- card 0x0c ---------------------------------- */
495 [BTTV_BOARD_ADSTECH_TV] = {
496 .name = "ADS Technologies Channel Surfer TV (bt848)",
501 .muxsel = { 2, 3, 1, 1 },
502 .gpiomux = { 13, 14, 11, 7 },
505 .tuner_addr = ADDR_UNSET,
506 .radio_addr = ADDR_UNSET,
508 [BTTV_BOARD_AVERMEDIA98] = {
509 .name = "AVerMedia TVCapture 98",
514 .muxsel = { 2, 3, 1, 1 },
515 .gpiomux = { 13, 14, 11, 7 },
519 .tuner_type = TUNER_PHILIPS_PAL,
520 .tuner_addr = ADDR_UNSET,
521 .radio_addr = ADDR_UNSET,
522 .audio_mode_gpio= avermedia_tv_stereo_audio,
526 .name = "Aimslab Video Highway Xtreme (VHX)",
531 .muxsel = { 2, 3, 1, 1 },
532 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
537 .tuner_addr = ADDR_UNSET,
538 .radio_addr = ADDR_UNSET,
540 [BTTV_BOARD_ZOLTRIX] = {
541 .name = "Zoltrix TV-Max",
546 .muxsel = { 2, 3, 1, 1 },
547 .gpiomux = { 0, 0, 1, 0 },
551 .tuner_addr = ADDR_UNSET,
552 .radio_addr = ADDR_UNSET,
555 /* ---- card 0x10 ---------------------------------- */
556 [BTTV_BOARD_PIXVIEWPLAYTV] = {
557 .name = "Prolink Pixelview PlayTV (bt878)",
561 .gpiomask = 0x01fe00,
562 .muxsel = { 2, 3, 1, 1 },
563 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
564 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
565 .gpiomute = 0x002000,
569 .tuner_addr = ADDR_UNSET,
570 .radio_addr = ADDR_UNSET,
572 [BTTV_BOARD_WINVIEW_601] = {
573 .name = "Leadtek WinView 601",
577 .gpiomask = 0x8300f8,
578 .muxsel = { 2, 3, 1, 1,0 },
579 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
580 .gpiomute = 0xcfa007,
583 .tuner_addr = ADDR_UNSET,
584 .radio_addr = ADDR_UNSET,
585 .volume_gpio = winview_volume,
588 [BTTV_BOARD_AVEC_INTERCAP] = {
589 .name = "AVEC Intercapture",
594 .muxsel = { 2, 3, 1, 1 },
595 .gpiomux = { 1, 0, 0, 0 },
598 .tuner_addr = ADDR_UNSET,
599 .radio_addr = ADDR_UNSET,
601 [BTTV_BOARD_LIFE_FLYKIT] = {
602 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
606 .gpiomask = 0x8dff00,
607 .muxsel = { 2, 3, 1, 1 },
610 .tuner_type = TUNER_ABSENT,
611 .tuner_addr = ADDR_UNSET,
612 .radio_addr = ADDR_UNSET,
615 /* ---- card 0x14 ---------------------------------- */
616 [BTTV_BOARD_CEI_RAFFLES] = {
617 .name = "CEI Raffles Card",
621 .muxsel = { 2, 3, 1, 1 },
623 .tuner_addr = ADDR_UNSET,
624 .radio_addr = ADDR_UNSET,
626 [BTTV_BOARD_CONFERENCETV] = {
627 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
629 .audio_inputs = 2, /* tuner, line in */
632 .muxsel = { 2, 3, 1, 1 },
633 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
636 .tuner_type = TUNER_PHILIPS_PAL_I,
637 .tuner_addr = ADDR_UNSET,
638 .radio_addr = ADDR_UNSET,
640 [BTTV_BOARD_PHOEBE_TVMAS] = {
641 .name = "Askey CPH050/ Phoebe Tv Master + FM",
646 .muxsel = { 2, 3, 1, 1 },
647 .gpiomux = { 0, 1, 0x800, 0x400 },
652 .tuner_addr = ADDR_UNSET,
653 .radio_addr = ADDR_UNSET,
655 [BTTV_BOARD_MODTEC_205] = {
656 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
661 .muxsel = { 2, 3, -1 },
662 .digital_mode = DIGITAL_MODE_CAMERA,
663 .gpiomux = { 0, 0, 0, 0 },
666 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
667 .tuner_addr = ADDR_UNSET,
668 .radio_addr = ADDR_UNSET,
671 /* ---- card 0x18 ---------------------------------- */
672 [BTTV_BOARD_MAGICTVIEW061] = {
673 .name = "Askey CPH05X/06X (bt878) [many vendors]",
678 .muxsel = { 2, 3, 1, 1 },
679 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
684 .tuner_addr = ADDR_UNSET,
685 .radio_addr = ADDR_UNSET,
688 [BTTV_BOARD_VOBIS_BOOSTAR] = {
689 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
693 .gpiomask = 0x1f0fff,
694 .muxsel = { 2, 3, 1, 1 },
695 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
698 .tuner_type = TUNER_PHILIPS_PAL,
699 .tuner_addr = ADDR_UNSET,
700 .radio_addr = ADDR_UNSET,
701 .audio_mode_gpio= terratv_audio,
703 [BTTV_BOARD_HAUPPAUG_WCAM] = {
704 .name = "Hauppauge WinCam newer (bt878)",
709 .muxsel = { 2, 0, 1, 1 },
710 .gpiomux = { 0, 1, 2, 3 },
714 .tuner_addr = ADDR_UNSET,
715 .radio_addr = ADDR_UNSET,
717 [BTTV_BOARD_MAXI] = {
718 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
723 .muxsel = { 2, 3, 1, 1 },
724 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
727 .tuner_type = TUNER_PHILIPS_SECAM,
728 .tuner_addr = ADDR_UNSET,
729 .radio_addr = ADDR_UNSET,
732 /* ---- card 0x1c ---------------------------------- */
733 [BTTV_BOARD_TERRATV] = {
734 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
738 .gpiomask = 0x1f0fff,
739 .muxsel = { 2, 3, 1, 1 },
740 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
743 .tuner_type = TUNER_PHILIPS_PAL,
744 .tuner_addr = ADDR_UNSET,
745 .radio_addr = ADDR_UNSET,
746 .audio_mode_gpio= terratv_audio,
748 External 20 pin connector (for Active Radio Upgrade board)
754 gpio05: om5610-stereo
758 gpio09+10: nIOR, nSEL ?? (bt878)
762 gpio16: u2-A0 (1st 4052bt)
765 gpio19: u4-A0 (2nd 4052)
769 00000 : Cdrom (internal audio input)
770 10000 : ext. Video audio input
779 [BTTV_BOARD_PXC200] = {
780 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
781 .name = "Imagenation PXC200",
784 .svhs = 1, /* was: 4 */
786 .muxsel = { 2, 3, 1, 0, 0},
789 .tuner_type = TUNER_ABSENT,
790 .tuner_addr = ADDR_UNSET,
791 .radio_addr = ADDR_UNSET,
792 .muxsel_hook = PXC200_muxsel,
795 [BTTV_BOARD_FLYVIDEO_98] = {
796 .name = "Lifeview FlyVideo 98 LR50",
800 .gpiomask = 0x1800, /* 0x8dfe00 */
801 .muxsel = { 2, 3, 1, 1 },
802 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
806 .tuner_addr = ADDR_UNSET,
807 .radio_addr = ADDR_UNSET,
809 [BTTV_BOARD_IPROTV] = {
810 .name = "Formac iProTV, Formac ProTV I (bt848)",
815 .muxsel = { 2, 3, 1, 1 },
816 .gpiomux = { 1, 0, 0, 0 },
818 .tuner_type = TUNER_PHILIPS_PAL,
819 .tuner_addr = ADDR_UNSET,
820 .radio_addr = ADDR_UNSET,
823 /* ---- card 0x20 ---------------------------------- */
824 [BTTV_BOARD_INTEL_C_S_PCI] = {
825 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
830 .muxsel = { 2, 3, 1, 1 },
833 .tuner_type = TUNER_ABSENT,
834 .tuner_addr = ADDR_UNSET,
835 .radio_addr = ADDR_UNSET,
837 [BTTV_BOARD_TERRATVALUE] = {
838 .name = "Terratec TerraTValue Version Bt878",
842 .gpiomask = 0xffff00,
843 .muxsel = { 2, 3, 1, 1 },
844 .gpiomux = { 0x500, 0, 0x300, 0x900 },
848 .tuner_type = TUNER_PHILIPS_PAL,
849 .tuner_addr = ADDR_UNSET,
850 .radio_addr = ADDR_UNSET,
852 [BTTV_BOARD_WINFAST2000] = {
853 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
857 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
858 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
859 .gpiomask = 0xb33000,
860 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
861 .gpiomute = 0x800000,
862 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
863 gpio23 -- hef4052:nEnable (0x800000)
866 0x0000: external audio
870 Note: There exists another variant "Winfast 2000" with tv stereo !?
871 Note: eeprom only contains FF and pci subsystem id 107d:6606
876 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
877 .tuner_addr = ADDR_UNSET,
878 .radio_addr = ADDR_UNSET,
879 .audio_mode_gpio= winfast2000_audio,
882 [BTTV_BOARD_CHRONOS_VS2] = {
883 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
888 .muxsel = { 2, 3, 1, 1 },
889 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
893 .tuner_addr = ADDR_UNSET,
894 .radio_addr = ADDR_UNSET,
897 /* ---- card 0x24 ---------------------------------- */
898 [BTTV_BOARD_TYPHOON_TVIEW] = {
899 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
904 .muxsel = { 2, 3, 1, 1 },
905 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
909 .tuner_addr = ADDR_UNSET,
910 .radio_addr = ADDR_UNSET,
913 [BTTV_BOARD_PXELVWPLTVPRO] = {
914 .name = "Prolink PixelView PlayTV pro",
919 .muxsel = { 2, 3, 1, 1 },
920 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
925 .tuner_addr = ADDR_UNSET,
926 .radio_addr = ADDR_UNSET,
928 [BTTV_BOARD_MAGICTVIEW063] = {
929 .name = "Askey CPH06X TView99",
933 .gpiomask = 0x551e00,
934 .muxsel = { 2, 3, 1, 0 },
935 .gpiomux = { 0x551400, 0x551200, 0, 0 },
936 .gpiomute = 0x551c00,
939 .tuner_type = TUNER_PHILIPS_PAL_I,
940 .tuner_addr = ADDR_UNSET,
941 .radio_addr = ADDR_UNSET,
944 [BTTV_BOARD_PINNACLE] = {
945 .name = "Pinnacle PCTV Studio/Rave",
949 .gpiomask = 0x03000F,
950 .muxsel = { 2, 3, 1, 1 },
951 .gpiomux = { 2, 0xd0001, 0, 0 },
956 .tuner_addr = ADDR_UNSET,
957 .radio_addr = ADDR_UNSET,
960 /* ---- card 0x28 ---------------------------------- */
961 [BTTV_BOARD_STB2] = {
962 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
967 .muxsel = { 2, 3, 1, 1 },
968 .gpiomux = { 4, 0, 2, 3 },
972 .tuner_type = TUNER_PHILIPS_NTSC,
973 .tuner_addr = ADDR_UNSET,
974 .radio_addr = ADDR_UNSET,
978 [BTTV_BOARD_AVPHONE98] = {
979 .name = "AVerMedia TVPhone 98",
984 .muxsel = { 2, 3, 1, 1 },
985 .gpiomux = { 13, 4, 11, 7 },
989 .tuner_addr = ADDR_UNSET,
990 .radio_addr = ADDR_UNSET,
992 .audio_mode_gpio= avermedia_tvphone_audio,
994 [BTTV_BOARD_PV951] = {
995 .name = "ProVideo PV951", /* pic16c54 */
1000 .muxsel = { 2, 3, 1, 1},
1001 .gpiomux = { 0, 0, 0, 0},
1005 .tuner_type = TUNER_PHILIPS_PAL_I,
1006 .tuner_addr = ADDR_UNSET,
1007 .radio_addr = ADDR_UNSET,
1009 [BTTV_BOARD_ONAIR_TV] = {
1010 .name = "Little OnAir TV",
1015 .muxsel = { 2, 3, 1, 1 },
1016 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1017 .gpiomute = 0xff3ffc,
1019 .tuner_type = UNSET,
1020 .tuner_addr = ADDR_UNSET,
1021 .radio_addr = ADDR_UNSET,
1024 /* ---- card 0x2c ---------------------------------- */
1025 [BTTV_BOARD_SIGMA_TVII_FM] = {
1026 .name = "Sigma TVII-FM",
1031 .muxsel = { 2, 3, 1, 1 },
1032 .gpiomux = { 1, 1, 0, 2 },
1036 .tuner_type = UNSET,
1037 .tuner_addr = ADDR_UNSET,
1038 .radio_addr = ADDR_UNSET,
1040 [BTTV_BOARD_MATRIX_VISION2] = {
1041 .name = "MATRIX-Vision MV-Delta 2",
1046 .muxsel = { 2, 3, 1, 0, 0 },
1050 .tuner_type = TUNER_ABSENT,
1051 .tuner_addr = ADDR_UNSET,
1052 .radio_addr = ADDR_UNSET,
1054 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1055 .name = "Zoltrix Genie TV/FM",
1059 .gpiomask = 0xbcf03f,
1060 .muxsel = { 2, 3, 1, 1 },
1061 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1062 .gpiomute = 0xbcb03f,
1065 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1066 .tuner_addr = ADDR_UNSET,
1067 .radio_addr = ADDR_UNSET,
1069 [BTTV_BOARD_TERRATVRADIO] = {
1070 .name = "Terratec TV/Radio+",
1074 .gpiomask = 0x70000,
1075 .muxsel = { 2, 3, 1, 1 },
1076 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1077 .gpiomute = 0x40000,
1081 .tuner_type = TUNER_PHILIPS_PAL_I,
1082 .tuner_addr = ADDR_UNSET,
1083 .radio_addr = ADDR_UNSET,
1087 /* ---- card 0x30 ---------------------------------- */
1088 [BTTV_BOARD_DYNALINK] = {
1089 .name = "Askey CPH03x/ Dynalink Magic TView",
1094 .muxsel = { 2, 3, 1, 1 },
1095 .gpiomux = {2,0,0,0 },
1099 .tuner_type = UNSET,
1100 .tuner_addr = ADDR_UNSET,
1101 .radio_addr = ADDR_UNSET,
1103 [BTTV_BOARD_GVBCTV3PCI] = {
1104 .name = "IODATA GV-BCTV3/PCI",
1108 .gpiomask = 0x010f00,
1109 .muxsel = {2, 3, 0, 0 },
1110 .gpiomux = {0x10000, 0, 0x10000, 0 },
1113 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1114 .tuner_addr = ADDR_UNSET,
1115 .radio_addr = ADDR_UNSET,
1116 .audio_mode_gpio= gvbctv3pci_audio,
1118 [BTTV_BOARD_PXELVWPLTVPAK] = {
1119 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1123 .gpiomask = 0xAA0000,
1124 .muxsel = { 2,3,1,1,-1 },
1125 .digital_mode = DIGITAL_MODE_CAMERA,
1126 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1127 .gpiomute = 0xa8000,
1130 .tuner_type = TUNER_PHILIPS_PAL_I,
1131 .tuner_addr = ADDR_UNSET,
1132 .radio_addr = ADDR_UNSET,
1134 /* GPIO wiring: (different from Rev.4C !)
1135 GPIO17: U4.A0 (first hef4052bt)
1137 GPIO20: U5.A1 (second hef4052bt)
1139 GPIO22: BT832 Reset Line
1140 GPIO23: A5,A0, U5,nEN
1141 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1144 [BTTV_BOARD_EAGLE] = {
1145 .name = "Eagle Wireless Capricorn2 (bt878A)",
1150 .muxsel = { 2, 0, 1, 1 },
1151 .gpiomux = { 0, 1, 2, 3 },
1154 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1155 .tuner_addr = ADDR_UNSET,
1156 .radio_addr = ADDR_UNSET,
1159 /* ---- card 0x34 ---------------------------------- */
1160 [BTTV_BOARD_PINNACLEPRO] = {
1161 /* David Härdeman <david@2gen.com> */
1162 .name = "Pinnacle PCTV Studio Pro",
1166 .gpiomask = 0x03000F,
1167 .muxsel = { 2, 3, 1, 1 },
1168 .gpiomux = { 1, 0xd0001, 0, 0 },
1170 /* sound path (5 sources):
1171 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1174 2= Mono TV sound from Tuner
1176 MUX2 (mask 0x30000):
1178 1= FM stereo Radio from Tuner */
1181 .tuner_type = UNSET,
1182 .tuner_addr = ADDR_UNSET,
1183 .radio_addr = ADDR_UNSET,
1185 [BTTV_BOARD_TVIEW_RDS_FM] = {
1186 /* Claas Langbehn <claas@bigfoot.com>,
1187 Sven Grothklags <sven@upb.de> */
1188 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1193 .muxsel = { 2, 3, 1, 1 },
1194 .gpiomux = { 0, 0, 0x10, 8 },
1198 .tuner_type = TUNER_PHILIPS_PAL,
1199 .tuner_addr = ADDR_UNSET,
1200 .radio_addr = ADDR_UNSET,
1203 [BTTV_BOARD_LIFETEC_9415] = {
1204 /* Tim Röstermundt <rosterm@uni-muenster.de>
1205 in de.comp.os.unix.linux.hardware:
1206 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1207 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1208 options tuner type=5 */
1209 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1214 .muxsel = { 2, 3, 1, 1 },
1215 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1217 /* For cards with tda9820/tda9821:
1218 0x0000: Tuner normal stereo
1219 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1220 0x0880: Tuner A2 stereo */
1222 .tuner_type = UNSET,
1223 .tuner_addr = ADDR_UNSET,
1224 .radio_addr = ADDR_UNSET,
1226 [BTTV_BOARD_BESTBUY_EASYTV] = {
1227 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1228 old Easy TV BT848 version (model CPH031) */
1229 .name = "Askey CPH031/ BESTBUY Easy TV",
1234 .muxsel = { 2, 3, 1, 0 },
1235 .gpiomux = { 2, 0, 0, 0 },
1239 .tuner_type = TUNER_TEMIC_PAL,
1240 .tuner_addr = ADDR_UNSET,
1241 .radio_addr = ADDR_UNSET,
1244 /* ---- card 0x38 ---------------------------------- */
1245 [BTTV_BOARD_FLYVIDEO_98FM] = {
1246 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1247 .name = "Lifeview FlyVideo 98FM LR50",
1252 .muxsel = { 2, 3, 1, 1 },
1253 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1256 .tuner_type = TUNER_PHILIPS_PAL,
1257 .tuner_addr = ADDR_UNSET,
1258 .radio_addr = ADDR_UNSET,
1260 /* This is the ultimate cheapo capture card
1261 * just a BT848A on a small PCB!
1262 * Steve Hosgood <steve@equiinet.com> */
1263 [BTTV_BOARD_GRANDTEC] = {
1264 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1274 .tuner_type = TUNER_ABSENT,
1275 .tuner_addr = ADDR_UNSET,
1276 .radio_addr = ADDR_UNSET,
1278 [BTTV_BOARD_ASKEY_CPH060] = {
1279 /* Daniel Herrington <daniel.herrington@home.com> */
1280 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1285 .muxsel = { 2, 3, 1, 1},
1286 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1290 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1291 .tuner_addr = ADDR_UNSET,
1292 .radio_addr = ADDR_UNSET,
1294 [BTTV_BOARD_ASKEY_CPH03X] = {
1295 /* Matti Mottus <mottus@physic.ut.ee> */
1296 .name = "Askey CPH03x TV Capturer",
1300 .gpiomask = 0x03000F,
1301 .muxsel = { 2, 3, 1, 0 },
1302 .gpiomux = { 2, 0, 0, 0 },
1305 .tuner_type = TUNER_TEMIC_PAL,
1306 .tuner_addr = ADDR_UNSET,
1307 .radio_addr = ADDR_UNSET,
1310 /* ---- card 0x3c ---------------------------------- */
1311 [BTTV_BOARD_MM100PCTV] = {
1312 /* Philip Blundell <philb@gnu.org> */
1313 .name = "Modular Technology MM100PCTV",
1318 .muxsel = { 2, 3, 1, 1 },
1319 .gpiomux = { 2, 0, 0, 1 },
1322 .tuner_type = TUNER_TEMIC_PAL,
1323 .tuner_addr = ADDR_UNSET,
1324 .radio_addr = ADDR_UNSET,
1326 [BTTV_BOARD_GMV1] = {
1327 /* Adrian Cox <adrian@humboldt.co.uk */
1328 .name = "AG Electronics GMV1",
1338 .tuner_type = TUNER_ABSENT,
1339 .tuner_addr = ADDR_UNSET,
1340 .radio_addr = ADDR_UNSET,
1342 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1343 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1344 new Easy TV BT878 version (model CPH061)
1345 special thanks to Informatica Mieres for providing the card */
1346 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1351 .muxsel = { 2, 3, 1, 0 },
1352 .gpiomux = { 1, 0, 4, 4 },
1356 .tuner_type = TUNER_PHILIPS_PAL,
1357 .tuner_addr = ADDR_UNSET,
1358 .radio_addr = ADDR_UNSET,
1360 [BTTV_BOARD_ATI_TVWONDER] = {
1361 /* Lukas Gebauer <geby@volny.cz> */
1362 .name = "ATI TV-Wonder",
1367 .muxsel = { 2, 3, 1, 0 },
1368 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1371 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1372 .tuner_addr = ADDR_UNSET,
1373 .radio_addr = ADDR_UNSET,
1376 /* ---- card 0x40 ---------------------------------- */
1377 [BTTV_BOARD_ATI_TVWONDERVE] = {
1378 /* Lukas Gebauer <geby@volny.cz> */
1379 .name = "ATI TV-Wonder VE",
1384 .muxsel = { 2, 3, 0, 1 },
1385 .gpiomux = { 0, 0, 1, 0 },
1388 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1389 .tuner_addr = ADDR_UNSET,
1390 .radio_addr = ADDR_UNSET,
1392 [BTTV_BOARD_FLYVIDEO2000] = {
1393 /* DeeJay <deejay@westel900.net (2000S) */
1394 .name = "Lifeview FlyVideo 2000S LR90",
1399 .muxsel = { 2, 3, 0, 1 },
1400 /* Radio changed from 1e80 to 0x800 to make
1401 FlyVideo2000S in .hu happy (gm)*/
1402 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1403 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1405 .audio_mode_gpio= fv2000s_audio,
1410 .tuner_type = TUNER_PHILIPS_PAL,
1411 .tuner_addr = ADDR_UNSET,
1412 .radio_addr = ADDR_UNSET,
1414 [BTTV_BOARD_TERRATVALUER] = {
1415 .name = "Terratec TValueRadio",
1419 .gpiomask = 0xffff00,
1420 .muxsel = { 2, 3, 1, 1 },
1421 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1425 .tuner_type = TUNER_PHILIPS_PAL,
1426 .tuner_addr = ADDR_UNSET,
1427 .radio_addr = ADDR_UNSET,
1430 [BTTV_BOARD_GVBCTV4PCI] = {
1431 /* TANAKA Kei <peg00625@nifty.com> */
1432 .name = "IODATA GV-BCTV4/PCI",
1436 .gpiomask = 0x010f00,
1437 .muxsel = {2, 3, 0, 0 },
1438 .gpiomux = {0x10000, 0, 0x10000, 0 },
1441 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1442 .tuner_addr = ADDR_UNSET,
1443 .radio_addr = ADDR_UNSET,
1444 .audio_mode_gpio= gvbctv3pci_audio,
1447 /* ---- card 0x44 ---------------------------------- */
1448 [BTTV_BOARD_VOODOOTV_FM] = {
1449 .name = "3Dfx VoodooTV FM (Euro)",
1450 /* try "insmod msp3400 simple=0" if you have
1451 * sound problems with this card. */
1455 .gpiomask = 0x4f8a00,
1456 /* 0x100000: 1=MSP enabled (0=disable again)
1457 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1458 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1459 .gpiomute = 0x947fff,
1460 /* tvtuner, radio, external,internal, mute, stereo
1461 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1462 .muxsel = { 2, 3 ,0 ,1 },
1463 .tuner_type = TUNER_MT2032,
1464 .tuner_addr = ADDR_UNSET,
1465 .radio_addr = ADDR_UNSET,
1469 [BTTV_BOARD_VOODOOTV_200] = {
1470 .name = "VoodooTV 200 (USA)",
1471 /* try "insmod msp3400 simple=0" if you have
1472 * sound problems with this card. */
1476 .gpiomask = 0x4f8a00,
1477 /* 0x100000: 1=MSP enabled (0=disable again)
1478 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1479 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1480 .gpiomute = 0x947fff,
1481 /* tvtuner, radio, external,internal, mute, stereo
1482 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1483 .muxsel = { 2, 3 ,0 ,1 },
1484 .tuner_type = TUNER_MT2032,
1485 .tuner_addr = ADDR_UNSET,
1486 .radio_addr = ADDR_UNSET,
1490 [BTTV_BOARD_AIMMS] = {
1491 /* Philip Blundell <pb@nexus.co.uk> */
1492 .name = "Active Imaging AIMMS",
1495 .tuner_type = TUNER_ABSENT,
1496 .tuner_addr = ADDR_UNSET,
1497 .radio_addr = ADDR_UNSET,
1502 [BTTV_BOARD_PV_BT878P_PLUS] = {
1503 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1504 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1509 .muxsel = { 2, 3, 1, 1 },
1510 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1514 .tuner_type = TUNER_LG_PAL_I_FM,
1515 .tuner_addr = ADDR_UNSET,
1516 .radio_addr = ADDR_UNSET,
1519 GPIO0: U4.A0 (hef4052bt)
1521 GPIO2: U4.A1 (second hef4052bt)
1522 GPIO3: U4.nEN, U5.A0, A5.nEN
1526 [BTTV_BOARD_FLYVIDEO98EZ] = {
1527 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1531 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1534 .tuner_type = TUNER_ABSENT,
1535 .tuner_addr = ADDR_UNSET,
1536 .radio_addr = ADDR_UNSET,
1539 /* ---- card 0x48 ---------------------------------- */
1540 [BTTV_BOARD_PV_BT878P_9B] = {
1541 /* Dariusz Kowalewski <darekk@automex.pl> */
1542 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1547 .muxsel = { 2, 3, 1, 1 },
1548 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1554 .tuner_type = TUNER_PHILIPS_PAL,
1555 .tuner_addr = ADDR_UNSET,
1556 .radio_addr = ADDR_UNSET,
1557 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1558 .has_radio = 1, /* Note: not all cards have radio */
1565 GPIO20,22,23: R30,R29,R28
1568 [BTTV_BOARD_SENSORAY311] = {
1569 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1570 /* you must jumper JP5 for the card to work */
1571 .name = "Sensoray 311",
1576 .muxsel = { 2, 3, 1, 0, 0 },
1579 .tuner_type = TUNER_ABSENT,
1580 .tuner_addr = ADDR_UNSET,
1581 .radio_addr = ADDR_UNSET,
1583 [BTTV_BOARD_RV605] = {
1584 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1585 .name = "RemoteVision MX (RV605)",
1590 .gpiomask2 = 0x07ff,
1591 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1592 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1595 .tuner_type = TUNER_ABSENT,
1596 .tuner_addr = ADDR_UNSET,
1597 .radio_addr = ADDR_UNSET,
1598 .muxsel_hook = rv605_muxsel,
1600 [BTTV_BOARD_POWERCLR_MTV878] = {
1601 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1605 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1606 .muxsel = { 2, 1, 1, },
1607 .gpiomux = { 0, 1, 2, 2 },
1610 .tuner_type = TUNER_PHILIPS_PAL,
1611 .tuner_addr = ADDR_UNSET,
1612 .radio_addr = ADDR_UNSET,
1617 /* ---- card 0x4c ---------------------------------- */
1618 [BTTV_BOARD_WINDVR] = {
1619 /* Masaki Suzuki <masaki@btree.org> */
1620 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1624 .gpiomask = 0x140007,
1625 .muxsel = { 2, 3, 1, 1 },
1626 .gpiomux = { 0, 1, 2, 3 },
1628 .tuner_type = TUNER_PHILIPS_NTSC,
1629 .tuner_addr = ADDR_UNSET,
1630 .radio_addr = ADDR_UNSET,
1631 .audio_mode_gpio= windvr_audio,
1633 [BTTV_BOARD_GRANDTEC_MULTI] = {
1634 .name = "GrandTec Multi Capture Card (Bt878)",
1639 .muxsel = { 2, 3, 1, 0 },
1644 .tuner_type = TUNER_ABSENT,
1645 .tuner_addr = ADDR_UNSET,
1646 .radio_addr = ADDR_UNSET,
1648 [BTTV_BOARD_KWORLD] = {
1649 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1654 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1655 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1656 * This card lacks external Audio In, so we mute it on Ext. & Int.
1657 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1658 * This card lacks PCI subsystem ID, sigh.
1659 * gpiomux =1: lower volume, 2+3: mute
1660 * btwincap uses 0x80000/0x80003
1666 .tuner_type = TUNER_PHILIPS_PAL,
1667 .tuner_addr = ADDR_UNSET,
1668 .radio_addr = ADDR_UNSET,
1669 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1670 radio signal strength indicators work fine. */
1673 GPIO0,1: HEF4052 A0,A1
1674 GPIO2: HEF4052 nENABLE
1676 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1680 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1682 [BTTV_BOARD_DSP_TCVIDEO] = {
1683 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1684 .name = "DSP Design TCVIDEO",
1687 .muxsel = { 2, 3, 1, 0 },
1689 .tuner_type = UNSET,
1690 .tuner_addr = ADDR_UNSET,
1691 .radio_addr = ADDR_UNSET,
1694 /* ---- card 0x50 ---------------------------------- */
1695 [BTTV_BOARD_HAUPPAUGEPVR] = {
1696 .name = "Hauppauge WinTV PVR",
1700 .muxsel = { 2, 0, 1, 1 },
1703 .tuner_type = UNSET,
1704 .tuner_addr = ADDR_UNSET,
1705 .radio_addr = ADDR_UNSET,
1710 [BTTV_BOARD_GVBCTV5PCI] = {
1711 .name = "IODATA GV-BCTV5/PCI",
1715 .gpiomask = 0x0f0f80,
1716 .muxsel = {2, 3, 1, 0 },
1717 .gpiomux = {0x030000, 0x010000, 0, 0 },
1718 .gpiomute = 0x020000,
1721 .tuner_type = TUNER_PHILIPS_NTSC_M,
1722 .tuner_addr = ADDR_UNSET,
1723 .radio_addr = ADDR_UNSET,
1724 .audio_mode_gpio= gvbctv5pci_audio,
1727 [BTTV_BOARD_OSPREY1x0] = {
1728 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1729 .video_inputs = 4, /* id-inputs-clock */
1732 .muxsel = { 3, 2, 0, 1 },
1734 .tuner_type = TUNER_ABSENT,
1735 .tuner_addr = ADDR_UNSET,
1736 .radio_addr = ADDR_UNSET,
1741 [BTTV_BOARD_OSPREY1x0_848] = {
1742 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1746 .muxsel = { 2, 3, 1 },
1748 .tuner_type = TUNER_ABSENT,
1749 .tuner_addr = ADDR_UNSET,
1750 .radio_addr = ADDR_UNSET,
1756 /* ---- card 0x54 ---------------------------------- */
1757 [BTTV_BOARD_OSPREY101_848] = {
1758 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1764 .tuner_type = TUNER_ABSENT,
1765 .tuner_addr = ADDR_UNSET,
1766 .radio_addr = ADDR_UNSET,
1771 [BTTV_BOARD_OSPREY1x1] = {
1772 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1778 .tuner_type = TUNER_ABSENT,
1779 .tuner_addr = ADDR_UNSET,
1780 .radio_addr = ADDR_UNSET,
1785 [BTTV_BOARD_OSPREY1x1_SVID] = {
1786 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1792 .tuner_type = TUNER_ABSENT,
1793 .tuner_addr = ADDR_UNSET,
1794 .radio_addr = ADDR_UNSET,
1799 [BTTV_BOARD_OSPREY2xx] = {
1800 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1806 .tuner_type = TUNER_ABSENT,
1807 .tuner_addr = ADDR_UNSET,
1808 .radio_addr = ADDR_UNSET,
1814 /* ---- card 0x58 ---------------------------------- */
1815 [BTTV_BOARD_OSPREY2x0_SVID] = {
1816 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1822 .tuner_type = TUNER_ABSENT,
1823 .tuner_addr = ADDR_UNSET,
1824 .radio_addr = ADDR_UNSET,
1829 [BTTV_BOARD_OSPREY2x0] = {
1830 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1836 .tuner_type = TUNER_ABSENT,
1837 .tuner_addr = ADDR_UNSET,
1838 .radio_addr = ADDR_UNSET,
1843 [BTTV_BOARD_OSPREY500] = {
1844 .name = "Osprey 500", /* 500 */
1850 .tuner_type = TUNER_ABSENT,
1851 .tuner_addr = ADDR_UNSET,
1852 .radio_addr = ADDR_UNSET,
1857 [BTTV_BOARD_OSPREY540] = {
1858 .name = "Osprey 540", /* 540 */
1862 .tuner_type = TUNER_ABSENT,
1863 .tuner_addr = ADDR_UNSET,
1864 .radio_addr = ADDR_UNSET,
1870 /* ---- card 0x5C ---------------------------------- */
1871 [BTTV_BOARD_OSPREY2000] = {
1872 .name = "Osprey 2000", /* 2000 */
1878 .tuner_type = TUNER_ABSENT,
1879 .tuner_addr = ADDR_UNSET,
1880 .radio_addr = ADDR_UNSET,
1883 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1885 [BTTV_BOARD_IDS_EAGLE] = {
1886 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1887 .name = "IDS Eagle",
1890 .tuner_type = TUNER_ABSENT,
1891 .tuner_addr = ADDR_UNSET,
1892 .radio_addr = ADDR_UNSET,
1895 .muxsel = { 0, 1, 2, 3 },
1896 .muxsel_hook = eagle_muxsel,
1901 [BTTV_BOARD_PINNACLESAT] = {
1902 .name = "Pinnacle PCTV Sat",
1906 .tuner_type = TUNER_ABSENT,
1907 .tuner_addr = ADDR_UNSET,
1908 .radio_addr = ADDR_UNSET,
1917 [BTTV_BOARD_FORMAC_PROTV] = {
1918 .name = "Formac ProTV II (bt878)",
1923 /* TV, Comp1, Composite over SVID con, SVID */
1924 .muxsel = { 2, 3, 1, 1 },
1925 .gpiomux = { 2, 2, 0, 0 },
1928 .tuner_type = TUNER_PHILIPS_PAL,
1929 .tuner_addr = ADDR_UNSET,
1930 .radio_addr = ADDR_UNSET,
1932 GPIO=0x00,0x01,0x03: mute (?)
1933 0x02: both TV and radio (tuner: FM1216/I)
1934 The card has onboard audio connectors labeled "cdrom" and "board",
1935 not soldered here, though unknown wiring.
1936 Card lacks: external audio in, pci subsystem id.
1940 /* ---- card 0x60 ---------------------------------- */
1941 [BTTV_BOARD_MACHTV] = {
1947 .muxsel = { 2, 3, 1, 1},
1948 .gpiomux = { 0, 1, 2, 3},
1951 .tuner_type = TUNER_PHILIPS_PAL,
1952 .tuner_addr = ADDR_UNSET,
1953 .radio_addr = ADDR_UNSET,
1956 [BTTV_BOARD_EURESYS_PICOLO] = {
1957 .name = "Euresys Picolo",
1965 .muxsel = { 2, 0, 1},
1967 .tuner_type = TUNER_ABSENT,
1968 .tuner_addr = ADDR_UNSET,
1969 .radio_addr = ADDR_UNSET,
1971 [BTTV_BOARD_PV150] = {
1972 /* Luc Van Hoeylandt <luc@e-magic.be> */
1973 .name = "ProVideo PV150", /* 0x4f */
1983 .tuner_type = TUNER_ABSENT,
1984 .tuner_addr = ADDR_UNSET,
1985 .radio_addr = ADDR_UNSET,
1987 [BTTV_BOARD_AD_TVK503] = {
1988 /* Hiroshi Takekawa <sian@big.or.jp> */
1989 /* This card lacks subsystem ID */
1990 .name = "AD-TVK503", /* 0x63 */
1994 .gpiomask = 0x001e8007,
1995 .muxsel = { 2, 3, 1, 0 },
1996 /* Tuner, Radio, external, internal, off, on */
1997 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2002 .tuner_type = TUNER_PHILIPS_NTSC,
2003 .tuner_addr = ADDR_UNSET,
2004 .radio_addr = ADDR_UNSET,
2005 .audio_mode_gpio= adtvk503_audio,
2008 /* ---- card 0x64 ---------------------------------- */
2009 [BTTV_BOARD_HERCULES_SM_TV] = {
2010 .name = "Hercules Smart TV Stereo",
2015 .muxsel = { 2, 3, 1, 1 },
2019 .tuner_type = TUNER_PHILIPS_PAL,
2020 .tuner_addr = ADDR_UNSET,
2021 .radio_addr = ADDR_UNSET,
2023 - card lacks subsystem ID
2024 - stereo variant w/ daughter board with tda9874a @0xb0
2026 always from tda9874 independent of GPIO (?)
2027 external line in: unknown
2028 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2029 hef4053 (instead 4052) for unknown function
2032 [BTTV_BOARD_PACETV] = {
2033 .name = "Pace TV & Radio Card",
2037 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2041 .tuner_type = TUNER_PHILIPS_PAL_I,
2042 .tuner_addr = ADDR_UNSET,
2043 .radio_addr = ADDR_UNSET,
2046 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2047 only internal line out: (4pin header) RGGL
2048 Radio must be decoded by msp3410d (not routed through)*/
2050 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2053 [BTTV_BOARD_IVC200] = {
2054 /* Chris Willing <chris@vislab.usyd.edu.au> */
2058 .tuner_type = TUNER_ABSENT,
2059 .tuner_addr = ADDR_UNSET,
2060 .radio_addr = ADDR_UNSET,
2066 [BTTV_BOARD_IVCE8784] = {
2067 .name = "IVCE-8784",
2070 .tuner_type = TUNER_ABSENT,
2071 .tuner_addr = ADDR_UNSET,
2072 .radio_addr = ADDR_UNSET,
2078 [BTTV_BOARD_XGUARD] = {
2079 .name = "Grand X-Guard / Trust 814PCI",
2083 .tuner_type = TUNER_ABSENT,
2084 .tuner_addr = ADDR_UNSET,
2085 .radio_addr = ADDR_UNSET,
2087 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2088 .muxsel_hook = xguard_muxsel,
2095 /* ---- card 0x68 ---------------------------------- */
2096 [BTTV_BOARD_NEBULA_DIGITV] = {
2097 .name = "Nebula Electronics DigiTV",
2100 .muxsel = { 2, 3, 1, 0 },
2105 .tuner_type = TUNER_ABSENT,
2106 .tuner_addr = ADDR_UNSET,
2107 .radio_addr = ADDR_UNSET,
2113 [BTTV_BOARD_PV143] = {
2114 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2115 .name = "ProVideo PV143",
2120 .muxsel = { 2, 3, 1, 0 },
2125 .tuner_type = TUNER_ABSENT,
2126 .tuner_addr = ADDR_UNSET,
2127 .radio_addr = ADDR_UNSET,
2129 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
2130 /* M.Klahr@phytec.de */
2131 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
2136 .muxsel = { 2, 3, 1, 0 },
2137 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2140 .tuner_type = TUNER_ABSENT,
2141 .tuner_addr = ADDR_UNSET,
2142 .radio_addr = ADDR_UNSET,
2144 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2145 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2150 .muxsel = { 2, 3, 1, 1 },
2151 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2154 .tuner_type = TUNER_ABSENT,
2155 .tuner_addr = ADDR_UNSET,
2156 .radio_addr = ADDR_UNSET,
2159 /* ---- card 0x6c ---------------------------------- */
2160 [BTTV_BOARD_VD009_MINIDIN] = {
2161 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2166 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2167 via the upper nibble of muxsel. here: used for
2168 xternal video-mux */
2169 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2170 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2173 .tuner_type = TUNER_ABSENT,
2174 .tuner_addr = ADDR_UNSET,
2175 .radio_addr = ADDR_UNSET,
2177 [BTTV_BOARD_VD009_COMBI] = {
2178 .name = "PHYTEC VD-009 Combi (bt878)",
2183 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2184 via the upper nibble of muxsel. here: used for
2185 xternal video-mux */
2186 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2187 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2190 .tuner_type = TUNER_ABSENT,
2191 .tuner_addr = ADDR_UNSET,
2192 .radio_addr = ADDR_UNSET,
2194 [BTTV_BOARD_IVC100] = {
2198 .tuner_type = TUNER_ABSENT,
2199 .tuner_addr = ADDR_UNSET,
2200 .radio_addr = ADDR_UNSET,
2203 .muxsel = { 2, 3, 1, 0 },
2206 [BTTV_BOARD_IVC120] = {
2207 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2210 .audio_inputs = 0, /* card has no audio */
2211 .tuner_type = TUNER_ABSENT,
2212 .tuner_addr = ADDR_UNSET,
2213 .radio_addr = ADDR_UNSET,
2214 .svhs = UNSET, /* card has no svhs */
2220 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2221 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2222 .muxsel_hook = ivc120_muxsel,
2226 /* ---- card 0x70 ---------------------------------- */
2227 [BTTV_BOARD_PC_HDTV] = {
2228 .name = "pcHDTV HD-2000 TV",
2232 .muxsel = { 2, 3, 1, 0 },
2233 .tuner_type = TUNER_PHILIPS_FCV1236D,
2234 .tuner_addr = ADDR_UNSET,
2235 .radio_addr = ADDR_UNSET,
2238 [BTTV_BOARD_TWINHAN_DST] = {
2239 .name = "Twinhan DST + clones",
2243 .tuner_type = TUNER_ABSENT,
2244 .tuner_addr = ADDR_UNSET,
2245 .radio_addr = ADDR_UNSET,
2249 [BTTV_BOARD_WINFASTVC100] = {
2250 .name = "Winfast VC100",
2254 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2258 .tuner_type = TUNER_ABSENT,
2259 .tuner_addr = ADDR_UNSET,
2260 .radio_addr = ADDR_UNSET,
2263 [BTTV_BOARD_TEV560] = {
2264 .name = "Teppro TEV-560/InterVision IV-560",
2269 .muxsel = { 2, 3, 1, 1 },
2270 .gpiomux = { 1, 1, 1, 1 },
2272 .tuner_type = TUNER_PHILIPS_PAL,
2273 .tuner_addr = ADDR_UNSET,
2274 .radio_addr = ADDR_UNSET,
2278 /* ---- card 0x74 ---------------------------------- */
2279 [BTTV_BOARD_SIMUS_GVC1100] = {
2280 .name = "SIMUS GVC1100",
2284 .tuner_type = TUNER_ABSENT,
2285 .tuner_addr = ADDR_UNSET,
2286 .radio_addr = ADDR_UNSET,
2288 .muxsel = { 2, 2, 2, 2 },
2290 .muxsel_hook = gvc1100_muxsel,
2292 [BTTV_BOARD_NGSTV_PLUS] = {
2293 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2294 .name = "NGS NGSTV+",
2297 .gpiomask = 0x008007,
2298 .muxsel = { 2, 3, 0, 0 },
2299 .gpiomux = { 0, 0, 0, 0 },
2300 .gpiomute = 0x000003,
2302 .tuner_type = TUNER_PHILIPS_PAL,
2303 .tuner_addr = ADDR_UNSET,
2304 .radio_addr = ADDR_UNSET,
2307 [BTTV_BOARD_LMLBT4] = {
2308 /* http://linuxmedialabs.com */
2310 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2313 .muxsel = { 2, 3, 1, 0 },
2318 .tuner_type = TUNER_ABSENT,
2319 .tuner_addr = ADDR_UNSET,
2320 .radio_addr = ADDR_UNSET,
2322 [BTTV_BOARD_TEKRAM_M205] = {
2323 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2324 .name = "Tekram M205 PRO",
2327 .tuner_type = TUNER_PHILIPS_PAL,
2328 .tuner_addr = ADDR_UNSET,
2329 .radio_addr = ADDR_UNSET,
2333 .muxsel = { 2, 3, 1 },
2334 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2338 /* ---- card 0x78 ---------------------------------- */
2339 [BTTV_BOARD_CONTVFMI] = {
2340 /* Javier Cendan Ares <jcendan@lycos.es> */
2341 /* bt878 TV + FM without subsystem ID */
2342 .name = "Conceptronic CONTVFMi",
2346 .gpiomask = 0x008007,
2347 .muxsel = { 2, 3, 1, 1 },
2348 .gpiomux = { 0, 1, 2, 2 },
2352 .tuner_type = TUNER_PHILIPS_PAL,
2353 .tuner_addr = ADDR_UNSET,
2354 .radio_addr = ADDR_UNSET,
2358 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2359 /*Eric DEBIEF <debief@telemsa.com>*/
2360 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2361 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2363 .name = "Euresys Picolo Tetra",
2368 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2372 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2373 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2376 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2377 .tuner_type = TUNER_ABSENT,
2378 .tuner_addr = ADDR_UNSET,
2379 .radio_addr = ADDR_UNSET,
2381 [BTTV_BOARD_SPIRIT_TV] = {
2382 /* Spirit TV Tuner from http://spiritmodems.com.au */
2383 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2384 .name = "Spirit TV Tuner",
2388 .gpiomask = 0x0000000f,
2389 .muxsel = { 2, 1, 1 },
2390 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2391 .tuner_type = TUNER_TEMIC_PAL,
2392 .tuner_addr = ADDR_UNSET,
2393 .radio_addr = ADDR_UNSET,
2397 [BTTV_BOARD_AVDVBT_771] = {
2398 /* Wolfram Joost <wojo@frokaschwei.de> */
2399 .name = "AVerMedia AVerTV DVB-T 771",
2402 .tuner_type = TUNER_ABSENT,
2403 .tuner_addr = ADDR_UNSET,
2404 .radio_addr = ADDR_UNSET,
2405 .muxsel = { 3 , 3 },
2414 /* ---- card 0x7c ---------------------------------- */
2415 [BTTV_BOARD_AVDVBT_761] = {
2416 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2417 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2418 .name = "AverMedia AverTV DVB-T 761",
2421 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2426 .tuner_type = TUNER_ABSENT,
2427 .tuner_addr = ADDR_UNSET,
2428 .radio_addr = ADDR_UNSET,
2433 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2434 /* andre.schwarz@matrix-vision.de */
2435 .name = "MATRIX Vision Sigma-SQ",
2440 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2441 3, 3, 3, 3, 3, 3, 3, 3 },
2442 .muxsel_hook = sigmaSQ_muxsel,
2446 .tuner_type = TUNER_ABSENT,
2447 .tuner_addr = ADDR_UNSET,
2448 .radio_addr = ADDR_UNSET,
2450 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2451 /* andre.schwarz@matrix-vision.de */
2452 .name = "MATRIX Vision Sigma-SLC",
2457 .muxsel = { 2, 2, 2, 2 },
2458 .muxsel_hook = sigmaSLC_muxsel,
2462 .tuner_type = TUNER_ABSENT,
2463 .tuner_addr = ADDR_UNSET,
2464 .radio_addr = ADDR_UNSET,
2466 /* BTTV_BOARD_APAC_VIEWCOMP */
2467 [BTTV_BOARD_APAC_VIEWCOMP] = {
2468 /* Attila Kondoros <attila.kondoros@chello.hu> */
2469 /* bt878 TV + FM 0x00000000 subsystem ID */
2470 .name = "APAC Viewcomp 878(AMAX)",
2475 .muxsel = { 2, 3, 1, 1 },
2476 .gpiomux = { 2, 0, 0, 0 },
2480 .tuner_type = TUNER_PHILIPS_PAL,
2481 .tuner_addr = ADDR_UNSET,
2482 .radio_addr = ADDR_UNSET,
2483 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2484 .has_radio = 1, /* not every card has radio */
2487 /* ---- card 0x80 ---------------------------------- */
2488 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2489 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2490 .name = "DViCO FusionHDTV DVB-T Lite",
2497 .tuner_type = TUNER_ABSENT,
2498 .tuner_addr = ADDR_UNSET,
2499 .radio_addr = ADDR_UNSET,
2501 [BTTV_BOARD_VGEAR_MYVCD] = {
2502 /* Steven <photon38@pchome.com.tw> */
2503 .name = "V-Gear MyVCD",
2508 .muxsel = {2, 3, 1, 0 },
2509 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2513 .tuner_type = TUNER_PHILIPS_NTSC_M,
2514 .tuner_addr = ADDR_UNSET,
2515 .radio_addr = ADDR_UNSET,
2518 [BTTV_BOARD_SUPER_TV] = {
2519 /* Rick C <cryptdragoon@gmail.com> */
2520 .name = "Super TV Tuner",
2524 .muxsel = { 2, 3, 1, 0 },
2525 .tuner_type = TUNER_PHILIPS_NTSC,
2526 .tuner_addr = ADDR_UNSET,
2527 .radio_addr = ADDR_UNSET,
2528 .gpiomask = 0x008007,
2529 .gpiomux = { 0, 0x000001,0,0 },
2533 [BTTV_BOARD_TIBET_CS16] = {
2534 /* Chris Fanning <video4linux@haydon.net> */
2535 .name = "Tibet Systems 'Progress DVR' CS16",
2539 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2544 .tuner_type = TUNER_ABSENT,
2545 .tuner_addr = ADDR_UNSET,
2546 .radio_addr = ADDR_UNSET,
2547 .muxsel_hook = tibetCS16_muxsel,
2549 [BTTV_BOARD_KODICOM_4400R] = {
2550 /* Bill Brack <wbrack@mmm.com.hk> */
2552 * Note that, because of the card's wiring, the "master"
2553 * BT878A chip (i.e. the one which controls the analog switch
2554 * and must use this card type) is the 2nd one detected. The
2555 * other 3 chips should use card type 0x85, whose description
2556 * follows this one. There is a EEPROM on the card (which is
2557 * connected to the I2C of one of those other chips), but is
2558 * not currently handled. There is also a facility for a
2559 * "monitor", which is also not currently implemented.
2561 .name = "Kodicom 4400R (master)",
2564 .tuner_type = TUNER_ABSENT,
2565 .tuner_addr = ADDR_UNSET,
2566 .radio_addr = ADDR_UNSET,
2568 /* GPIO bits 0-9 used for analog switch:
2569 * 00 - 03: camera selector
2570 * 04 - 06: channel (controller) selector
2571 * 07: data (1->on, 0->off)
2574 * bit 16 is input from sync separator for the channel
2576 .gpiomask = 0x0003ff,
2578 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2583 .muxsel_hook = kodicom4400r_muxsel,
2585 [BTTV_BOARD_KODICOM_4400R_SL] = {
2586 /* Bill Brack <wbrack@mmm.com.hk> */
2587 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2588 * one which controls the analog switch, and must use the card type)
2589 * is the 2nd one detected. The other 3 chips should use this card
2592 .name = "Kodicom 4400R (slave)",
2595 .tuner_type = TUNER_ABSENT,
2596 .tuner_addr = ADDR_UNSET,
2597 .radio_addr = ADDR_UNSET,
2599 .gpiomask = 0x010000,
2601 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2606 .muxsel_hook = kodicom4400r_muxsel,
2608 /* ---- card 0x86---------------------------------- */
2609 [BTTV_BOARD_ADLINK_RTV24] = {
2610 /* Michael Henson <mhenson@clarityvi.com> */
2611 /* Adlink RTV24 with special unlock codes */
2612 .name = "Adlink RTV24",
2616 .muxsel = { 2, 3, 1, 0 },
2617 .tuner_type = UNSET,
2618 .tuner_addr = ADDR_UNSET,
2619 .radio_addr = ADDR_UNSET,
2622 /* ---- card 0x87---------------------------------- */
2623 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2624 /* Michael Krufky <mkrufky@m1k.net> */
2625 .name = "DViCO FusionHDTV 5 Lite",
2626 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2627 .tuner_addr = ADDR_UNSET,
2628 .radio_addr = ADDR_UNSET,
2632 .muxsel = { 2, 3, 1 },
2633 .gpiomask = 0x00e00007,
2634 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2635 .gpiomute = 0x00c00007,
2641 /* ---- card 0x88---------------------------------- */
2642 [BTTV_BOARD_ACORP_Y878F] = {
2643 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2644 .name = "Acorp Y878F",
2648 .gpiomask = 0x01fe00,
2649 .muxsel = { 2, 3, 1, 1 },
2650 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2651 .gpiomute = 0x002000,
2654 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2655 .tuner_addr = 0xc1 >>1,
2656 .radio_addr = 0xc1 >>1,
2659 /* ---- card 0x89 ---------------------------------- */
2660 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2661 .name = "Conceptronic CTVFMi v2",
2665 .gpiomask = 0x001c0007,
2666 .muxsel = { 2, 3, 1, 1 },
2667 .gpiomux = { 0, 1, 2, 2 },
2671 .tuner_type = TUNER_TENA_9533_DI,
2672 .tuner_addr = ADDR_UNSET,
2673 .radio_addr = ADDR_UNSET,
2677 /* ---- card 0x8a ---------------------------------- */
2678 [BTTV_BOARD_PV_BT878P_2E] = {
2679 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2683 .gpiomask = 0x01fe00,
2684 .muxsel = { 2,3,1,1,-1 },
2685 .digital_mode = DIGITAL_MODE_CAMERA,
2686 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2687 .gpiomute = 0x12400,
2690 .tuner_type = TUNER_LG_PAL_FM,
2691 .tuner_addr = ADDR_UNSET,
2692 .radio_addr = ADDR_UNSET,
2695 /* ---- card 0x8b ---------------------------------- */
2696 [BTTV_BOARD_PV_M4900] = {
2697 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2698 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2703 .muxsel = { 2, 3, 1, 1 },
2704 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2708 .tuner_type = TUNER_YMEC_TVF_5533MF,
2709 .tuner_addr = ADDR_UNSET,
2710 .radio_addr = ADDR_UNSET,
2714 /* ---- card 0x8c ---------------------------------- */
2715 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2716 one external BNC composite input (mux 2)
2717 three internal composite inputs (unknown muxes)
2718 an 18-bit stereo A/D (CS5331A), which has:
2719 one external stereo unblanced (RCA) audio connection
2720 one (or 3?) internal stereo balanced (XLR) audio connection
2721 input is selected via gpio to a 14052B mux
2722 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2723 gain is controlled via an X9221A chip on the I2C bus @0x28
2724 sample rate is controlled via gpio to an MK1413S
2725 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2726 There is neither a tuner nor an svideo input. */
2727 [BTTV_BOARD_OSPREY440] = {
2728 .name = "Osprey 440",
2730 .audio_inputs = 2, /* this is meaningless */
2732 .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */
2734 .gpiomute = 0x000, /* int + 32kHz */
2735 .gpiomux = { 0, 0, 0x000, 0x100},
2737 .tuner_type = TUNER_ABSENT,
2738 .tuner_addr = ADDR_UNSET,
2739 .radio_addr = ADDR_UNSET,
2744 /* ---- card 0x8d ---------------------------------- */
2745 [BTTV_BOARD_ASOUND_SKYEYE] = {
2746 .name = "Asound Skyeye PCTV",
2751 .muxsel = { 2, 3, 1, 1 },
2752 .gpiomux = { 2, 0, 0, 0 },
2756 .tuner_type = TUNER_PHILIPS_NTSC,
2757 .tuner_addr = ADDR_UNSET,
2758 .radio_addr = ADDR_UNSET,
2760 /* ---- card 0x8e ---------------------------------- */
2761 [BTTV_BOARD_SABRENT_TVFM] = {
2762 .name = "Sabrent TV-FM (bttv version)",
2766 .gpiomask = 0x108007,
2767 .muxsel = { 2, 3, 1, 1 },
2768 .gpiomux = { 100000, 100002, 100002, 100000 },
2773 .tuner_type = TUNER_TNF_5335MF,
2774 .tuner_addr = ADDR_UNSET,
2777 /* ---- card 0x8f ---------------------------------- */
2778 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2779 .name = "Hauppauge ImpactVCB (bt878)",
2783 .gpiomask = 0x0f, /* old: 7 */
2784 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2788 .tuner_type = TUNER_ABSENT,
2789 .tuner_addr = ADDR_UNSET,
2790 .radio_addr = ADDR_UNSET,
2792 [BTTV_BOARD_MACHTV_MAGICTV] = {
2793 /* Julian Calaby <julian.calaby@gmail.com>
2794 * Slightly different from original MachTV definition (0x60)
2796 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2797 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2798 * properly (methinks) causing no keyup bits being set */
2800 .name = "MagicTV", /* rebranded MachTV */
2805 .muxsel = { 2, 3, 1, 1 },
2806 .gpiomux = { 0, 1, 2, 3 },
2808 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2809 .tuner_addr = ADDR_UNSET,
2810 .radio_addr = ADDR_UNSET,
2815 [BTTV_BOARD_SSAI_SECURITY] = {
2816 .name = "SSAI Security Video Interface",
2820 .muxsel = { 0, 1, 2, 3 },
2821 .tuner_type = TUNER_ABSENT,
2822 .tuner_addr = ADDR_UNSET,
2823 .radio_addr = ADDR_UNSET,
2825 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2826 .name = "SSAI Ultrasound Video Interface",
2830 .muxsel = { 2, 0, 1, 3 },
2831 .tuner_type = TUNER_ABSENT,
2832 .tuner_addr = ADDR_UNSET,
2833 .radio_addr = ADDR_UNSET,
2835 /* ---- card 0x94---------------------------------- */
2836 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2837 .name = "DViCO FusionHDTV 2",
2838 .tuner_type = TUNER_PHILIPS_FCV1236D,
2839 .tuner_addr = ADDR_UNSET,
2840 .radio_addr = ADDR_UNSET,
2844 .muxsel = { 2, 3, 1 },
2845 .gpiomask = 0x00e00007,
2846 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2847 .gpiomute = 0x00c00007,
2852 /* ---- card 0x95---------------------------------- */
2853 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2854 .name = "Typhoon TV-Tuner PCI (50684)",
2858 .gpiomask = 0x3014f,
2859 .muxsel = { 2, 3, 1, 1 },
2860 .gpiomux = { 0x20001,0x10001, 0, 0 },
2864 .tuner_type = TUNER_PHILIPS_PAL_I,
2865 .tuner_addr = ADDR_UNSET,
2866 .radio_addr = ADDR_UNSET,
2868 [BTTV_BOARD_GEOVISION_GV600] = {
2870 .name = "Geovision GV-600",
2875 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2876 2, 2, 2, 2, 2, 2, 2, 2 },
2877 .muxsel_hook = geovision_muxsel,
2881 .tuner_type = TUNER_ABSENT,
2882 .tuner_addr = ADDR_UNSET,
2883 .radio_addr = ADDR_UNSET,
2885 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2886 /* Mauro Lacy <mauro@lacy.com.ar>
2887 * Based on MagicTV and Conceptronic CONTVFMi */
2889 .name = "Kozumi KTV-01C",
2893 .gpiomask = 0x008007,
2894 .muxsel = { 2, 3, 1, 1 },
2895 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2896 .gpiomute = 3, /* CONTVFMi */
2898 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2899 .tuner_addr = ADDR_UNSET,
2900 .radio_addr = ADDR_UNSET,
2905 [BTTV_BOARD_ENLTV_FM_2] = {
2906 /* Encore TV Tuner Pro ENL TV-FM-2
2907 Mauro Carvalho Chehab <mchehab@infradead.org */
2908 .name = "Encore ENL TV-FM-2",
2912 /* bit 6 -> IR disabled
2913 bit 18/17 = 00 -> mute
2914 01 -> enable external audio input
2915 10 -> internal audio input (mono?)
2916 11 -> internal audio input
2918 .gpiomask = 0x060040,
2919 .muxsel = { 2, 3, 3 },
2920 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2922 .tuner_type = TUNER_TCL_MF02GIP_5N,
2923 .tuner_addr = ADDR_UNSET,
2924 .radio_addr = ADDR_UNSET,
2929 [BTTV_BOARD_VD012] = {
2930 /* D.Heer@Phytec.de */
2931 .name = "PHYTEC VD-012 (bt878)",
2934 .svhs = UNSET, /* card has no s-video */
2936 .muxsel = { 0, 2, 3, 1 },
2937 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2940 .tuner_type = TUNER_ABSENT,
2941 .tuner_addr = ADDR_UNSET,
2942 .radio_addr = ADDR_UNSET,
2944 [BTTV_BOARD_VD012_X1] = {
2945 /* D.Heer@Phytec.de */
2946 .name = "PHYTEC VD-012-X1 (bt878)",
2951 .muxsel = { 2, 3, 1 },
2952 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2955 .tuner_type = TUNER_ABSENT,
2956 .tuner_addr = ADDR_UNSET,
2957 .radio_addr = ADDR_UNSET,
2959 [BTTV_BOARD_VD012_X2] = {
2960 /* D.Heer@Phytec.de */
2961 .name = "PHYTEC VD-012-X2 (bt878)",
2966 .muxsel = { 3, 2, 1 },
2967 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2970 .tuner_type = TUNER_ABSENT,
2971 .tuner_addr = ADDR_UNSET,
2972 .radio_addr = ADDR_UNSET,
2976 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2978 /* ----------------------------------------------------------------------- */
2980 static unsigned char eeprom_data[256];
2985 void __devinit bttv_idcard(struct bttv *btv)
2987 unsigned int gpiobits;
2991 /* read PCI subsystem ID */
2992 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2993 btv->cardid = tmp << 16;
2994 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2997 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2998 /* look for the card */
2999 for (type = -1, i = 0; cards[i].id != 0; i++)
3000 if (cards[i].id == btv->cardid)
3005 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
3006 "PCI subsystem ID is %04x:%04x\n",
3007 btv->c.nr,cards[type].name,cards[type].cardnr,
3008 btv->cardid & 0xffff,
3009 (btv->cardid >> 16) & 0xffff);
3010 btv->c.type = cards[type].cardnr;
3013 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
3014 btv->c.nr, btv->cardid & 0xffff,
3015 (btv->cardid >> 16) & 0xffff);
3016 printk(KERN_DEBUG "please mail id, board name and "
3017 "the correct card= insmod option to video4linux-list@redhat.com\n");
3021 /* let the user override the autodetected type */
3022 if (card[btv->c.nr] < bttv_num_tvcards)
3023 btv->c.type=card[btv->c.nr];
3025 /* print which card config we are using */
3026 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
3027 bttv_tvcards[btv->c.type].name, btv->c.type,
3028 card[btv->c.nr] < bttv_num_tvcards
3029 ? "insmod option" : "autodetected");
3031 /* overwrite gpio stuff ?? */
3032 if (UNSET == audioall && UNSET == audiomux[0])
3035 if (UNSET != audiomux[0]) {
3037 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3038 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
3039 gpiobits |= audiomux[i];
3042 gpiobits = audioall;
3043 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3044 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
3047 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3048 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3049 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
3050 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3051 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
3057 * (most) board specific initialisations goes here
3060 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
3061 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3065 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
3066 type = BTTV_BOARD_MODTEC_205;
3067 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
3068 type = BTTV_BOARD_EURESYS_PICOLO;
3069 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
3070 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
3074 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3075 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3079 static void flyvideo_gpio(struct bttv *btv)
3081 int gpio, has_remote, has_radio, is_capture_only;
3082 int is_lr90, has_tda9820_tda9821;
3083 int tuner_type = UNSET, ttype;
3085 gpio_inout(0xffffff, 0);
3086 udelay(8); /* without this we would see the 0x1800 mask */
3088 /* FIXME: must restore OUR_EN ??? */
3090 /* all cards provide GPIO info, some have an additional eeprom
3091 * LR50: GPIO coding can be found lower right CP1 .. CP9
3092 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3094 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3096 * lowest 3 bytes are remote control codes (no handshake needed)
3097 * xxxFFF: No remote control chip soldered
3098 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3099 * Note: Some bits are Audio_Mask !
3101 ttype = (gpio & 0x0f0000) >> 16;
3104 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3107 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3110 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3113 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3116 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3119 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3123 has_remote = gpio & 0x800000;
3124 has_radio = gpio & 0x400000;
3125 /* unknown 0x200000;
3126 * unknown2 0x100000; */
3127 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3128 has_tda9820_tda9821 = !(gpio & 0x004000);
3129 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3131 * gpio & 0x001000 output bit for audio routing */
3133 if (is_capture_only)
3134 tuner_type = TUNER_ABSENT; /* No tuner present */
3136 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3137 btv->c.nr, has_radio ? "yes" : "no ",
3138 has_remote ? "yes" : "no ", tuner_type, gpio);
3139 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3140 btv->c.nr, is_lr90 ? "yes" : "no ",
3141 has_tda9820_tda9821 ? "yes" : "no ",
3142 is_capture_only ? "yes" : "no ");
3144 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3145 btv->tuner_type = tuner_type;
3146 btv->has_radio = has_radio;
3148 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3149 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3150 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3151 if (has_tda9820_tda9821)
3152 btv->audio_mode_gpio = lt9415_audio;
3153 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3156 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3157 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3158 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3159 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3161 static void miro_pinnacle_gpio(struct bttv *btv)
3166 gpio_inout(0xffffff, 0);
3168 id = ((gpio>>10) & 63) -1;
3169 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3171 btv->tuner_type = miro_tunermap[id];
3172 if (0 == (gpio & 0x20)) {
3174 if (!miro_fmtuner[id]) {
3175 btv->has_matchbox = 1;
3176 btv->mbox_we = (1<<6);
3177 btv->mbox_most = (1<<7);
3178 btv->mbox_clk = (1<<8);
3179 btv->mbox_data = (1<<9);
3180 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3186 if (btv->c.type == BTTV_BOARD_MIRO)
3187 btv->c.type = BTTV_BOARD_MIROPRO;
3188 if (btv->c.type == BTTV_BOARD_PINNACLE)
3189 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3192 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3193 btv->c.nr, id+1, btv->tuner_type,
3194 !btv->has_radio ? "no" :
3195 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3196 (-1 == msp) ? "no" : "yes");
3198 /* new cards with microtune tuner */
3203 info = "PAL / mono";
3204 btv->tda9887_conf = TDA9887_INTERCARRIER;
3207 info = "PAL+SECAM / stereo";
3209 btv->tda9887_conf = TDA9887_QSS;
3212 info = "NTSC / stereo";
3214 btv->tda9887_conf = TDA9887_QSS;
3217 info = "PAL+SECAM / mono";
3218 btv->tda9887_conf = TDA9887_QSS;
3221 info = "NTSC / mono";
3222 btv->tda9887_conf = TDA9887_INTERCARRIER;
3225 info = "NTSC / stereo";
3226 btv->tda9887_conf = TDA9887_INTERCARRIER;
3229 info = "PAL / stereo";
3230 btv->tda9887_conf = TDA9887_INTERCARRIER;
3233 info = "oops: unknown card";
3237 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3239 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3240 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3241 btv->tuner_type = TUNER_MT2032;
3245 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3246 #define LM1882_SYNC_DRIVE 0x200000L
3248 static void init_ids_eagle(struct bttv *btv)
3250 gpio_inout(0xffffff,0xFFFF37);
3251 gpio_write(0x200020);
3253 /* flash strobe inverter ?! */
3254 gpio_write(0x200024);
3256 /* switch sync drive off */
3257 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3259 /* set BT848 muxel to 2 */
3260 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3263 /* Muxsel helper for the IDS Eagle.
3264 * the eagles does not use the standard muxsel-bits but
3265 * has its own multiplexer */
3266 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3268 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3269 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3272 /* set chroma ADC to sleep */
3273 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3274 /* set to composite video */
3275 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3276 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3278 /* switch sync drive off */
3279 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3282 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3284 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3285 gpio_write(masks[input%4]);
3288 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3291 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3292 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3294 IN - sensor inputs, INx - sensor inputs and TI XORed together
3295 O1,O2,O3 - alarm outputs (relays)
3297 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3301 static void init_lmlbt4x(struct bttv *btv)
3303 printk(KERN_DEBUG "LMLBT4x init\n");
3304 btwrite(0x000000, BT848_GPIO_REG_INP);
3305 gpio_inout(0xffffff, 0x0006C0);
3306 gpio_write(0x000000);
3309 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3311 unsigned int inmux = input % 8;
3312 gpio_inout( 0xf, 0xf );
3313 gpio_bits( 0xf, inmux );
3316 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3318 unsigned int inmux = input % 4;
3319 gpio_inout( 3<<9, 3<<9 );
3320 gpio_bits( 3<<9, inmux<<9 );
3323 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3325 unsigned int inmux = input % 16;
3326 gpio_inout(0xf, 0xf);
3327 gpio_bits(0xf, inmux);
3330 /* ----------------------------------------------------------------------- */
3332 static void bttv_reset_audio(struct bttv *btv)
3335 * BT878A has a audio-reset register.
3336 * 1. This register is an audio reset function but it is in
3337 * function-0 (video capture) address space.
3338 * 2. It is enough to do this once per power-up of the card.
3339 * 3. There is a typo in the Conexant doc -- it is not at
3340 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3341 * --//Shrikumar 030609
3347 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3348 btwrite((1<<7), 0x058);
3353 /* initialization part one -- before registering i2c bus */
3354 void __devinit bttv_init_card1(struct bttv *btv)
3356 switch (btv->c.type) {
3357 case BTTV_BOARD_HAUPPAUGE:
3358 case BTTV_BOARD_HAUPPAUGE878:
3359 boot_msp34xx(btv,5);
3361 case BTTV_BOARD_VOODOOTV_200:
3362 case BTTV_BOARD_VOODOOTV_FM:
3363 boot_msp34xx(btv,20);
3365 case BTTV_BOARD_AVERMEDIA98:
3366 boot_msp34xx(btv,11);
3368 case BTTV_BOARD_HAUPPAUGEPVR:
3371 case BTTV_BOARD_TWINHAN_DST:
3372 case BTTV_BOARD_AVDVBT_771:
3373 case BTTV_BOARD_PINNACLESAT:
3374 btv->use_i2c_hw = 1;
3376 case BTTV_BOARD_ADLINK_RTV24:
3381 if (!bttv_tvcards[btv->c.type].has_dvb)
3382 bttv_reset_audio(btv);
3385 /* initialization part two -- after registering i2c bus */
3386 void __devinit bttv_init_card2(struct bttv *btv)
3388 int addr=ADDR_UNSET;
3390 btv->tuner_type = UNSET;
3392 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3393 bttv_readee(btv,eeprom_data,0xa0);
3394 identify_by_eeprom(btv,eeprom_data);
3397 switch (btv->c.type) {
3398 case BTTV_BOARD_MIRO:
3399 case BTTV_BOARD_MIROPRO:
3400 case BTTV_BOARD_PINNACLE:
3401 case BTTV_BOARD_PINNACLEPRO:
3403 miro_pinnacle_gpio(btv);
3405 case BTTV_BOARD_FLYVIDEO_98:
3406 case BTTV_BOARD_MAXI:
3407 case BTTV_BOARD_LIFE_FLYKIT:
3408 case BTTV_BOARD_FLYVIDEO:
3409 case BTTV_BOARD_TYPHOON_TVIEW:
3410 case BTTV_BOARD_CHRONOS_VS2:
3411 case BTTV_BOARD_FLYVIDEO_98FM:
3412 case BTTV_BOARD_FLYVIDEO2000:
3413 case BTTV_BOARD_FLYVIDEO98EZ:
3414 case BTTV_BOARD_CONFERENCETV:
3415 case BTTV_BOARD_LIFETEC_9415:
3418 case BTTV_BOARD_HAUPPAUGE:
3419 case BTTV_BOARD_HAUPPAUGE878:
3420 case BTTV_BOARD_HAUPPAUGEPVR:
3421 /* pick up some config infos from the eeprom */
3422 bttv_readee(btv,eeprom_data,0xa0);
3423 hauppauge_eeprom(btv);
3425 case BTTV_BOARD_AVERMEDIA98:
3426 case BTTV_BOARD_AVPHONE98:
3427 bttv_readee(btv,eeprom_data,0xa0);
3428 avermedia_eeprom(btv);
3430 case BTTV_BOARD_PXC200:
3433 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3434 picolo_tetra_init(btv);
3436 case BTTV_BOARD_VHX:
3438 btv->has_matchbox = 1;
3439 btv->mbox_we = 0x20;
3441 btv->mbox_clk = 0x08;
3442 btv->mbox_data = 0x10;
3443 btv->mbox_mask = 0x38;
3445 case BTTV_BOARD_VOBIS_BOOSTAR:
3446 case BTTV_BOARD_TERRATV:
3447 terratec_active_radio_upgrade(btv);
3449 case BTTV_BOARD_MAGICTVIEW061:
3450 if (btv->cardid == 0x3002144f) {
3452 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3455 case BTTV_BOARD_STB2:
3456 if (btv->cardid == 0x3060121a) {
3457 /* Fix up entry for 3DFX VoodooTV 100,
3458 which is an OEM STB card variant. */
3460 btv->tuner_type=TUNER_TEMIC_NTSC;
3463 case BTTV_BOARD_OSPREY1x0:
3464 case BTTV_BOARD_OSPREY1x0_848:
3465 case BTTV_BOARD_OSPREY101_848:
3466 case BTTV_BOARD_OSPREY1x1:
3467 case BTTV_BOARD_OSPREY1x1_SVID:
3468 case BTTV_BOARD_OSPREY2xx:
3469 case BTTV_BOARD_OSPREY2x0_SVID:
3470 case BTTV_BOARD_OSPREY2x0:
3471 case BTTV_BOARD_OSPREY440:
3472 case BTTV_BOARD_OSPREY500:
3473 case BTTV_BOARD_OSPREY540:
3474 case BTTV_BOARD_OSPREY2000:
3475 bttv_readee(btv,eeprom_data,0xa0);
3476 osprey_eeprom(btv, eeprom_data);
3478 case BTTV_BOARD_IDS_EAGLE:
3479 init_ids_eagle(btv);
3481 case BTTV_BOARD_MODTEC_205:
3482 bttv_readee(btv,eeprom_data,0xa0);
3485 case BTTV_BOARD_LMLBT4:
3488 case BTTV_BOARD_TIBET_CS16:
3489 tibetCS16_init(btv);
3491 case BTTV_BOARD_KODICOM_4400R:
3492 kodicom4400r_init(btv);
3496 /* pll configuration */
3497 if (!(btv->id==848 && btv->revision==0x11)) {
3498 /* defaults from card list */
3499 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3500 btv->pll.pll_ifreq=28636363;
3501 btv->pll.pll_crystal=BT848_IFORM_XT0;
3503 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3504 btv->pll.pll_ifreq=35468950;
3505 btv->pll.pll_crystal=BT848_IFORM_XT1;
3507 /* insmod options can override */
3508 switch (pll[btv->c.nr]) {
3510 btv->pll.pll_crystal = 0;
3511 btv->pll.pll_ifreq = 0;
3512 btv->pll.pll_ofreq = 0;
3514 case 1: /* 28 MHz */
3516 btv->pll.pll_ifreq = 28636363;
3517 btv->pll.pll_ofreq = 0;
3518 btv->pll.pll_crystal = BT848_IFORM_XT0;
3520 case 2: /* 35 MHz */
3522 btv->pll.pll_ifreq = 35468950;
3523 btv->pll.pll_ofreq = 0;
3524 btv->pll.pll_crystal = BT848_IFORM_XT1;
3528 btv->pll.pll_current = -1;
3530 /* tuner configuration (from card list / autodetect / insmod option) */
3531 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3532 addr = bttv_tvcards[btv->c.type].tuner_addr;
3534 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3535 if (UNSET == btv->tuner_type)
3536 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3537 if (UNSET != tuner[btv->c.nr])
3538 btv->tuner_type = tuner[btv->c.nr];
3540 if (btv->tuner_type == TUNER_ABSENT)
3541 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3542 else if(btv->tuner_type == UNSET)
3543 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3545 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3548 if (UNSET == btv->tuner_type)
3549 btv->tuner_type = TUNER_ABSENT;
3551 if (btv->tuner_type != TUNER_ABSENT) {
3552 struct tuner_setup tun_setup;
3554 /* Load tuner module before issuing tuner config call! */
3556 request_module("tuner");
3558 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3559 tun_setup.type = btv->tuner_type;
3560 tun_setup.addr = addr;
3562 if (bttv_tvcards[btv->c.type].has_radio)
3563 tun_setup.mode_mask |= T_RADIO;
3565 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3568 if (btv->tda9887_conf) {
3569 struct v4l2_priv_tun_config tda9887_cfg;
3571 tda9887_cfg.tuner = TUNER_TDA9887;
3572 tda9887_cfg.priv = &btv->tda9887_conf;
3574 bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
3577 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3578 if (svhs[btv->c.nr] != UNSET)
3579 btv->svhs = svhs[btv->c.nr];
3580 if (remote[btv->c.nr] != UNSET)
3581 btv->has_remote = remote[btv->c.nr];
3583 if (bttv_tvcards[btv->c.type].has_radio)
3585 if (bttv_tvcards[btv->c.type].has_remote)
3587 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3589 if (bttv_tvcards[btv->c.type].volume_gpio)
3590 btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio;
3591 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3592 btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio;
3597 if (btv->tuner_type == TUNER_ABSENT)
3598 return; /* no tuner or related drivers to load */
3600 /* try to detect audio/fader chips */
3601 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3602 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3603 request_module("msp3400");
3605 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3606 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3607 request_module("msp3400");
3609 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3610 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3611 request_module("tda9875");
3613 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3614 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3615 request_module("tda7432");
3617 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3618 request_module("tvaudio");
3622 /* ----------------------------------------------------------------------- */
3624 static void modtec_eeprom(struct bttv *btv)
3626 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3627 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3628 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3629 btv->c.nr,&eeprom_data[0x1e]);
3630 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3631 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3632 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3633 btv->c.nr,&eeprom_data[0x1e]);
3634 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3635 btv->tuner_type=TUNER_PHILIPS_NTSC;
3636 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3637 btv->c.nr,&eeprom_data[0x1e]);
3639 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3640 btv->c.nr,&eeprom_data[0x1e]);
3644 static void __devinit hauppauge_eeprom(struct bttv *btv)
3648 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3649 btv->tuner_type = tv.tuner_type;
3650 btv->has_radio = tv.has_radio;
3652 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3653 btv->c.nr, tv.model);
3656 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3657 * type based on model #.
3659 if(tv.model == 64900) {
3660 printk("bttv%d: Switching board type from %s to %s\n",
3662 bttv_tvcards[btv->c.type].name,
3663 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3664 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3668 static int terratec_active_radio_upgrade(struct bttv *btv)
3673 btv->has_matchbox = 1;
3674 btv->mbox_we = 0x10;
3675 btv->mbox_most = 0x20;
3676 btv->mbox_clk = 0x08;
3677 btv->mbox_data = 0x04;
3678 btv->mbox_mask = 0x3c;
3680 btv->mbox_iow = 1 << 8;
3681 btv->mbox_ior = 1 << 9;
3682 btv->mbox_csel = 1 << 10;
3685 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3686 if (0x1ed8 == tea5757_read(btv)) {
3687 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3690 btv->has_matchbox = 1;
3693 btv->has_matchbox = 0;
3699 /* ----------------------------------------------------------------------- */
3702 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3704 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3705 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3706 * unpacked with unzip).
3708 #define PVR_GPIO_DELAY 10
3710 #define BTTV_ALT_DATA 0x000001
3711 #define BTTV_ALT_DCLK 0x100000
3712 #define BTTV_ALT_NCONFIG 0x800000
3714 static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3721 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3723 udelay(PVR_GPIO_DELAY);
3725 gpio_write(BTTV_ALT_NCONFIG);
3726 udelay(PVR_GPIO_DELAY);
3728 for (n = 0; n < microlen; n++) {
3730 for (i = 0 ; i < 8 ; i++) {
3731 gpio_bits(BTTV_ALT_DCLK,0);
3733 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3735 gpio_bits(BTTV_ALT_DATA,0);
3736 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3740 gpio_bits(BTTV_ALT_DCLK,0);
3741 udelay(PVR_GPIO_DELAY);
3743 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3744 for (i = 0 ; i < 30 ; i++) {
3745 gpio_bits(BTTV_ALT_DCLK,0);
3746 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3748 gpio_bits(BTTV_ALT_DCLK,0);
3752 static int __devinit pvr_boot(struct bttv *btv)
3754 const struct firmware *fw_entry;
3757 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3759 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3763 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3764 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3765 btv->c.nr, (rc < 0) ? "failed" : "ok");
3766 release_firmware(fw_entry);
3770 /* ----------------------------------------------------------------------- */
3771 /* some osprey specific stuff */
3773 static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3779 /* This code will nevery actually get called in this case.... */
3780 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3781 /* this might be an antique... check for MMAC label in eeprom */
3782 if (!strncmp(ee, "MMAC", 4)) {
3784 for (i = 0; i < 21; i++)
3786 if (checksum != ee[21])
3788 cardid = BTTV_BOARD_OSPREY1x0_848;
3789 for (i = 12; i < 21; i++)
3790 serial *= 10, serial += ee[i] - '0';
3793 unsigned short type;
3795 for (i = 4*16; i < 8*16; i += 16) {
3796 u16 checksum = ip_compute_csum(ee + i, 16);
3798 if ((checksum&0xff) + (checksum>>8) == 0xff)
3805 /* found a valid descriptor */
3806 type = get_unaligned_be16((__be16 *)(ee+4));
3811 cardid = BTTV_BOARD_OSPREY1x0_848;
3814 cardid = BTTV_BOARD_OSPREY101_848;
3820 cardid = BTTV_BOARD_OSPREY1x0;
3824 cardid = BTTV_BOARD_OSPREY1x1;
3829 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3835 cardid = BTTV_BOARD_OSPREY2xx;
3839 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3842 cardid = BTTV_BOARD_OSPREY500;
3846 cardid = BTTV_BOARD_OSPREY540;
3847 /* bttv_osprey_540_init(btv); */
3852 cardid = BTTV_BOARD_OSPREY2x0;
3853 /* enable output on select control lines */
3854 gpio_inout(0xffffff,0x000303);
3857 cardid = BTTV_BOARD_OSPREY440;
3860 /* unknown...leave generic, but get serial # */
3861 printk(KERN_INFO "bttv%d: "
3862 "osprey eeprom: unknown card type 0x%04x\n",
3866 serial = get_unaligned_be32((__be32 *)(ee+6));
3869 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
3871 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3873 if (cardid<0 || btv->c.type == cardid)
3876 /* card type isn't set correctly */
3877 if (card[btv->c.nr] < bttv_num_tvcards) {
3878 printk(KERN_WARNING "bttv%d: osprey eeprom: "
3879 "Not overriding user specified card type\n", btv->c.nr);
3881 printk(KERN_INFO "bttv%d: osprey eeprom: "
3882 "Changing card type from %d to %d\n", btv->c.nr,
3883 btv->c.type, cardid);
3884 btv->c.type = cardid;
3888 /* ----------------------------------------------------------------------- */
3889 /* AVermedia specific stuff, from bktr_card.c */
3891 static int tuner_0_table[] = {
3892 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3893 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3894 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3895 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3896 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3897 TUNER_PHILIPS_FM1216ME_MK3 };
3899 static int tuner_1_table[] = {
3900 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3901 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3902 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3903 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3904 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3906 static void __devinit avermedia_eeprom(struct bttv *btv)
3908 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3910 tuner_make = (eeprom_data[0x41] & 0x7);
3911 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3912 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3913 btv->has_remote = (eeprom_data[0x42] & 0x01);
3915 if (tuner_make == 0 || tuner_make == 2)
3916 if (tuner_format <= 0x0a)
3917 tuner_type = tuner_0_table[tuner_format];
3918 if (tuner_make == 1)
3919 if (tuner_format <= 9)
3920 tuner_type = tuner_1_table[tuner_format];
3922 if (tuner_make == 4)
3923 if (tuner_format == 0x09)
3924 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3926 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3927 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3929 btv->tuner_type = tuner_type;
3930 printk(KERN_CONT "%d", tuner_type);
3932 printk(KERN_CONT "Unknown type");
3933 printk(KERN_CONT " radio:%s remote control:%s\n",
3934 tuner_tv_fm ? "yes" : "no",
3935 btv->has_remote ? "yes" : "no");
3939 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
3940 * analog demod, which is not I2C controlled like the newer and more common
3941 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
3942 * that control the IF for the video and audio. Apparently, bttv GPIO
3943 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
3944 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
3946 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
3949 if (btv->audio == TVAUDIO_INPUT_TUNER) {
3950 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
3951 gpiobits |= 0x10000;
3953 gpiobits &= ~0x10000;
3956 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
3962 * reset/enable the MSP on some Hauppauge cards
3963 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3968 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3970 int mask = (1 << pin);
3972 gpio_inout(mask,mask);
3976 gpio_bits(mask,mask);
3979 bttv_gpio_tracking(btv,"msp34xx");
3981 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3982 "init [%d]\n", btv->c.nr, pin);
3985 /* ----------------------------------------------------------------------- */
3986 /* Imagenation L-Model PXC200 Framegrabber */
3987 /* This is basically the same procedure as
3988 * used by Alessandro Rubini in his pxc200
3989 * driver, but using BTTV functions */
3991 static void __devinit init_PXC200(struct bttv *btv)
3993 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3994 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
4000 /* Initialise GPIO-connevted stuff */
4001 gpio_inout(0xffffff, (1<<13));
4005 /* GPIO inputs are pulled up, so no need to drive
4006 * reset pin any longer */
4007 gpio_bits(0xffffff, 0);
4009 bttv_gpio_tracking(btv,"pxc200");
4011 /* we could/should try and reset/control the AD pots? but
4012 right now we simply turned off the crushing. Without
4013 this the AGC drifts drifts
4014 remember the EN is reverse logic -->
4015 setting BT848_ADC_AGC_EN disable the AGC
4016 tboult@eecs.lehigh.edu
4019 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4021 /* Initialise MAX517 DAC */
4022 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
4023 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4025 /* Initialise 12C508 PIC */
4026 /* The I2CWrite and I2CRead commmands are actually to the
4027 * same chips - but the R/W bit is included in the address
4028 * argument so the numbers are different */
4031 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
4033 /* First of all, enable the clock line. This is used in the PXC200-F */
4034 val = btread(BT848_GPIO_DMA_CTL);
4035 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4036 btwrite(val, BT848_GPIO_DMA_CTL);
4038 /* Then, push to 0 the reset pin long enough to reset the *
4039 * device same as above for the reset line, but not the same
4040 * value sent to the GPIO-connected stuff
4041 * which one is the good one? */
4042 gpio_inout(0xffffff,(1<<2));
4047 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4048 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4051 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4052 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4056 printk(KERN_INFO "PXC200 Initialised.\n");
4061 /* ----------------------------------------------------------------------- */
4063 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4064 * it. This apparently involves the following procedure for each 878 chip:
4066 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4068 * 2) write to GPIO_DATA
4074 * read from GPIO_DATA into buf (uint_32)
4075 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4076 * error. ERROR_CPLD_Check_Failed stop.
4078 * 3) write to GPIO_DATA
4079 * - write 0x4400 + 0x0E
4081 * - write 0x4410 + 0x0E
4084 * read from GPIO_DATA into buf (uint_32)
4085 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4086 * error. ERROR_CPLD_Check_Failed.
4088 /* ----------------------------------------------------------------------- */
4090 init_RTV24 (struct bttv *btv)
4092 uint32_t dataRead = 0;
4093 long watchdog_value = 0x0E;
4096 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
4099 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4101 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4103 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4105 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4107 dataRead = btread (BT848_GPIO_DATA);
4109 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4111 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4112 btv->c.nr, dataRead);
4115 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4117 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4119 btwrite (watchdog_value, BT848_GPIO_DATA);
4121 dataRead = btread (BT848_GPIO_DATA);
4123 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4125 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4126 btv->c.nr, dataRead);
4132 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4137 /* ----------------------------------------------------------------------- */
4138 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4140 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4141 * This code is placed under the terms of the GNU General Public License
4143 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4146 static void bus_low(struct bttv *btv, int bit)
4148 if (btv->mbox_ior) {
4149 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4150 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4157 if (btv->mbox_ior) {
4158 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4163 static void bus_high(struct bttv *btv, int bit)
4165 if (btv->mbox_ior) {
4166 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4167 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4174 if (btv->mbox_ior) {
4175 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4180 static int bus_in(struct bttv *btv, int bit)
4182 if (btv->mbox_ior) {
4183 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4184 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4187 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4190 return gpio_read() & (bit);
4193 /* TEA5757 register bits */
4194 #define TEA_FREQ 0:14
4195 #define TEA_BUFFER 15:15
4197 #define TEA_SIGNAL_STRENGTH 16:17
4199 #define TEA_PORT1 18:18
4200 #define TEA_PORT0 19:19
4202 #define TEA_BAND 20:21
4203 #define TEA_BAND_FM 0
4204 #define TEA_BAND_MW 1
4205 #define TEA_BAND_LW 2
4206 #define TEA_BAND_SW 3
4208 #define TEA_MONO 22:22
4209 #define TEA_ALLOW_STEREO 0
4210 #define TEA_FORCE_MONO 1
4212 #define TEA_SEARCH_DIRECTION 23:23
4213 #define TEA_SEARCH_DOWN 0
4214 #define TEA_SEARCH_UP 1
4216 #define TEA_STATUS 24:24
4217 #define TEA_STATUS_TUNED 0
4218 #define TEA_STATUS_SEARCHING 1
4220 /* Low-level stuff */
4221 static int tea5757_read(struct bttv *btv)
4223 unsigned long timeout;
4227 /* better safe than sorry */
4228 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4230 if (btv->mbox_ior) {
4231 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4232 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4237 bttv_gpio_tracking(btv,"tea5757 read");
4239 bus_low(btv,btv->mbox_we);
4240 bus_low(btv,btv->mbox_clk);
4243 timeout= jiffies + msecs_to_jiffies(1000);
4245 /* wait for DATA line to go low; error if it doesn't */
4246 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4248 if (bus_in(btv,btv->mbox_data)) {
4249 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4253 dprintk("bttv%d: tea5757:",btv->c.nr);
4254 for (i = 0; i < 24; i++) {
4256 bus_high(btv,btv->mbox_clk);
4258 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4259 bus_low(btv,btv->mbox_clk);
4261 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4262 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4264 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4268 static int tea5757_write(struct bttv *btv, int value)
4273 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4275 if (btv->mbox_ior) {
4276 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4277 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4281 bttv_gpio_tracking(btv,"tea5757 write");
4283 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4284 bus_low(btv,btv->mbox_clk);
4285 bus_high(btv,btv->mbox_we);
4286 for (i = 0; i < 25; i++) {
4287 if (reg & 0x1000000)
4288 bus_high(btv,btv->mbox_data);
4290 bus_low(btv,btv->mbox_data);
4292 bus_high(btv,btv->mbox_clk);
4294 bus_low(btv,btv->mbox_clk);
4297 bus_low(btv,btv->mbox_we); /* unmute !!! */
4301 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4303 dprintk("tea5757_set_freq %d\n",freq);
4304 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4307 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4309 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4310 * switch instead (CD22M3494E). This IC can have multiple active connections
4311 * between Xn (input) and Yn (output) pins. We need to clear any existing
4312 * connection prior to establish a new one, pulsing the STROBE pin.
4314 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4315 * GPIO pins are wired as:
4316 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4317 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4318 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4319 * GPIO[8] - - P3[5] (microcontroller)
4320 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4321 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4322 * GPINTR - - P3[4] (microcontroller)
4324 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4325 * configuration either directly (as we are doing) or using the microcontroller
4326 * which is also wired to I2C interface. I have no further info on the
4327 * microcontroller features, one would need to disassembly the firmware.
4328 * note: the vendor refused to give any information on this product, all
4329 * that stuff was found using a multimeter! :)
4331 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4333 /* reset all conections */
4334 gpio_bits(0x200,0x200);
4336 gpio_bits(0x200,0x000);
4339 /* create a new connection */
4340 gpio_bits(0x480,0x080);
4341 gpio_bits(0x480,0x480);
4343 gpio_bits(0x480,0x080);
4347 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4349 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4350 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4351 * chips, ten eight input analog multiplexors, a not chip and a few
4354 * 16 inputs on a secondary bracket are provided and can be selected
4355 * from each of the four capture chips. Two of the eight input
4356 * multiplexors are used to select from any of the 16 input signals.
4358 * Unsupported hardware capabilities:
4359 * . A video output monitor on the secondary bracket can be selected from
4360 * one of the 878A chips.
4361 * . Another passthrough but I haven't spent any time investigating it.
4362 * . Digital I/O (logic level connected to GPIO) is available from an
4365 * The on chip input mux should always be set to 2.
4366 * GPIO[16:19] - Video input selection
4367 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4368 * GPIO[?:?] - Digital I/O.
4370 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4371 * determined what function (if any) it provides. With the microcontroller
4372 * and sync seperator chips a guess is that it might have to do with video
4373 * switching and maybe some digital I/O.
4375 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4378 gpio_bits(0x0f0000, input << 16);
4381 static void tibetCS16_init(struct bttv *btv)
4383 /* enable gpio bits, mask obtained via btSpy */
4384 gpio_inout(0xffffff, 0x0f7fff);
4385 gpio_write(0x0f7fff);
4389 * The following routines for the Kodicom-4400r get a little mind-twisting.
4390 * There is a "master" controller and three "slave" controllers, together
4391 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4392 * The analog switch is controlled by the "master", but the detection order
4393 * of the four BT878A chips is in an order which I just don't understand.
4394 * The "master" is actually the second controller to be detected. The
4395 * logic on the board uses logical numbers for the 4 controllers, but
4396 * those numbers are different from the detection sequence. When working
4397 * with the analog switch, we need to "map" from the detection sequence
4398 * over to the board's logical controller number. This mapping sequence
4399 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4400 * unit 3, the second (which is the master) is logical unit 0, etc.
4401 * We need to maintain the status of the analog switch (which of the 16
4402 * cameras is connected to which of the 4 controllers). Rather than
4403 * add to the bttv structure for this, we use the data reserved for
4404 * the mbox (unused for this card type).
4408 * First a routine to set the analog switch, which controls which camera
4409 * is routed to which controller. The switch comprises an X-address
4410 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4411 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4412 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4413 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4414 * specified address. The idea is to set the address and data, then bring
4415 * STROBE high, and finally bring STROBE back to low.
4417 static void kodicom4400r_write(struct bttv *btv,
4418 unsigned char xaddr,
4419 unsigned char yaddr,
4420 unsigned char data) {
4423 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4424 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4425 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4426 gpio_bits(0x1ff, udata); /* strobe low */
4430 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4431 * use this routine. The routine finds the "master" for the card, maps
4432 * the controller number from the detected position over to the logical
4433 * number, writes the appropriate data to the analog switch, and housekeeps
4434 * the local copy of the switch information. The parameter 'input' is the
4435 * requested camera number (0 - 15).
4437 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4442 static unsigned char map[4] = {3, 0, 2, 1};
4444 mctlr = master[btv->c.nr];
4445 if (mctlr == NULL) { /* ignore if master not yet detected */
4448 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4450 sw_status = (char *)(&mctlr->mbox_we);
4451 xaddr = input & 0xf;
4452 /* Check if the controller/camera pair has changed, else ignore */
4453 if (sw_status[yaddr] != xaddr)
4455 /* "open" the old switch, "close" the new one, save the new */
4456 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4457 sw_status[yaddr] = xaddr;
4458 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4463 * During initialisation, we need to reset the analog switch. We
4464 * also preset the switch to map the 4 connectors on the card to the
4465 * *user's* (see above description of kodicom4400r_muxsel) channels
4468 static void kodicom4400r_init(struct bttv *btv)
4470 char *sw_status = (char *)(&btv->mbox_we);
4473 gpio_inout(0x0003ff, 0x0003ff);
4474 gpio_write(1 << 9); /* reset MUX */
4476 /* Preset camera 0 to the 4 controllers */
4477 for (ix = 0; ix < 4; ix++) {
4479 kodicom4400r_write(btv, ix, ix, 1);
4482 * Since this is the "master", we need to set up the
4483 * other three controller chips' pointers to this structure
4484 * for later use in the muxsel routine.
4486 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4488 master[btv->c.nr-1] = btv;
4489 master[btv->c.nr] = btv;
4490 master[btv->c.nr+1] = btv;
4491 master[btv->c.nr+2] = btv;
4494 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4495 * video multiplexers to provide up to 16 video inputs. These
4496 * multiplexers are controlled by the lower 8 GPIO pins of the
4497 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4499 * xxx0 is pin xxx of multiplexer U5,
4500 * yyy1 is pin yyy of multiplexer U2
4512 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4514 static const int masks[] = {
4515 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4516 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4517 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4518 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4520 gpio_write(masks[input%16]);
4522 static void picolo_tetra_init(struct bttv *btv)
4524 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4525 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4526 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4528 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4531 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4532 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4533 /*GPIO[20]&GPIO[21] used to choose the right input*/
4534 btwrite (input<<20,BT848_GPIO_DATA);
4539 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4541 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4542 * swichers to provide 16 channels to MUX0. The TDA8540's have
4543 * 4 independent outputs and as such the IVC120G also has the
4544 * optional "Monitor Out" bus. This allows the card to be looking
4545 * at one input while the monitor is looking at another.
4547 * Since I've couldn't be bothered figuring out how to add an
4548 * independant muxsel for the monitor bus, I've just set it to
4549 * whatever the card is looking at.
4551 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4552 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4554 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4555 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4556 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4557 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4561 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4562 #define I2C_TDA8540 0x90
4563 #define I2C_TDA8540_ALT1 0x92
4564 #define I2C_TDA8540_ALT2 0x94
4565 #define I2C_TDA8540_ALT3 0x96
4566 #define I2C_TDA8540_ALT4 0x98
4567 #define I2C_TDA8540_ALT5 0x9a
4568 #define I2C_TDA8540_ALT6 0x9c
4570 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4573 int key = input % 4;
4574 int matrix = input / 4;
4576 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4577 btv->c.nr, input, matrix, key);
4579 /* Handles the input selection on the TDA8540's */
4580 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4581 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4582 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4583 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4584 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4585 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4586 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4587 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4589 /* Handles the output enables on the TDA8540's */
4590 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4591 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4592 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4593 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4594 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4595 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4596 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4597 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4599 /* Selects MUX0 for input on the 878 */
4600 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4604 /* PXC200 muxsel helper
4605 * luke@syseng.anu.edu.au
4606 * another transplant
4607 * from Alessandro Rubini (rubini@linux.it)
4609 * There are 4 kinds of cards:
4610 * PXC200L which is bt848
4611 * PXC200F which is bt848 with PIC controlling mux
4612 * PXC200AL which is bt878
4613 * PXC200AF which is bt878 with PIC controlling mux
4615 #define PX_CFG_PXC200F 0x01
4616 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4617 #define PX_I2C_PIC 0x0f
4618 #define PX_PXC200A_CARDID 0x200a1295
4619 #define PX_I2C_CMD_CFG 0x00
4621 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4626 unsigned char buf[2];
4628 /* Read PIC config to determine if this is a PXC200F */
4632 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4634 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4635 /* not PXC ? do nothing */
4639 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4640 if (!(rc & PX_CFG_PXC200F)) {
4641 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4646 /* The multiplexer in the 200F is handled by the GPIO port */
4647 /* get correct mapping between inputs */
4648 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4649 /* ** not needed!? */
4652 /* make sure output pins are enabled */
4653 /* bitmask=0x30f; */
4655 /* check whether we have a PXC200A */
4656 if (btv->cardid == PX_PXC200A_CARDID) {
4657 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4658 bitmask |= 7<<4; /* the DAC */
4660 btwrite(bitmask, BT848_GPIO_OUT_EN);
4662 bitmask = btread(BT848_GPIO_DATA);
4663 if (btv->cardid == PX_PXC200A_CARDID)
4664 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4665 else /* older device */
4666 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4667 btwrite(bitmask,BT848_GPIO_DATA);
4670 * Was "to be safe, set the bt848 to input 0"
4671 * Actually, since it's ok at load time, better not messing
4672 * with these bits (on PXC200AF you need to set mux 2 here)
4674 * needed because bttv-driver sets mux before calling this function
4676 if (btv->cardid == PX_PXC200A_CARDID)
4677 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4678 else /* older device */
4679 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4681 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4684 /* ----------------------------------------------------------------------- */
4685 /* motherboard chipset specific stuff */
4687 void __init bttv_check_chipset(void)
4689 int pcipci_fail = 0;
4690 struct pci_dev *dev = NULL;
4692 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4694 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4696 if (pci_pci_problems & PCIPCI_VSFX)
4698 #ifdef PCIPCI_ALIMAGIK
4699 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4704 /* print warnings about any quirks found */
4706 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4708 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4710 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4713 printk(KERN_INFO "bttv: overlay will be disabled.\n");
4716 printk(KERN_INFO "bttv: overlay forced. Use this "
4717 "option at your own risk.\n");
4720 if (UNSET != latency)
4721 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4722 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4723 PCI_DEVICE_ID_INTEL_82441, dev))) {
4725 pci_read_config_byte(dev, 0x53, &b);
4727 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4728 "bufcon=0x%02x\n",b);
4732 int __devinit bttv_handle_chipset(struct bttv *btv)
4734 unsigned char command;
4736 if (!triton1 && !vsfx && UNSET == latency)
4741 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4742 if (vsfx && btv->id >= 878)
4743 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4744 if (UNSET != latency)
4745 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4749 if (btv->id < 878) {
4750 /* bt848 (mis)uses a bit in the irq mask for etbf */
4752 btv->triton1 = BT848_INT_ETBF;
4754 /* bt878 has a bit in the pci config space for it */
4755 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4757 command |= BT878_EN_TBFX;
4759 command |= BT878_EN_VSFX;
4760 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4762 if (UNSET != latency)
4763 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);