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 *** ",
326 .muxsel = { 2, 3, 1, 0 },
328 .tuner_addr = ADDR_UNSET,
329 .radio_addr = ADDR_UNSET,
331 [BTTV_BOARD_MIRO] = {
338 .muxsel = { 2, 3, 1, 1 },
339 .gpiomux = { 2, 0, 0, 0 },
343 .tuner_addr = ADDR_UNSET,
344 .radio_addr = ADDR_UNSET,
346 [BTTV_BOARD_HAUPPAUGE] = {
347 .name = "Hauppauge (bt848)",
353 .muxsel = { 2, 3, 1, 1 },
354 .gpiomux = { 0, 1, 2, 3 },
358 .tuner_addr = ADDR_UNSET,
359 .radio_addr = ADDR_UNSET,
362 .name = "STB, Gateway P/N 6000699 (bt848)",
368 .muxsel = { 2, 3, 1, 1 },
369 .gpiomux = { 4, 0, 2, 3 },
373 .tuner_type = TUNER_PHILIPS_NTSC,
374 .tuner_addr = ADDR_UNSET,
375 .radio_addr = ADDR_UNSET,
380 /* ---- card 0x04 ---------------------------------- */
381 [BTTV_BOARD_INTEL] = {
382 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
388 .muxsel = { 2, 3, 1, 1 },
391 .tuner_type = TUNER_ABSENT,
392 .tuner_addr = ADDR_UNSET,
393 .radio_addr = ADDR_UNSET,
395 [BTTV_BOARD_DIAMOND] = {
396 .name = "Diamond DTV2000",
402 .muxsel = { 2, 3, 1, 0 },
403 .gpiomux = { 0, 1, 0, 1 },
407 .tuner_addr = ADDR_UNSET,
408 .radio_addr = ADDR_UNSET,
410 [BTTV_BOARD_AVERMEDIA] = {
411 .name = "AVerMedia TVPhone",
416 .muxsel = { 2, 3, 1, 1 },
418 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
419 /* 0x04 for some cards ?? */
422 .tuner_addr = ADDR_UNSET,
423 .radio_addr = ADDR_UNSET,
424 .audio_mode_gpio= avermedia_tvphone_audio,
427 [BTTV_BOARD_MATRIX_VISION] = {
428 .name = "MATRIX-Vision MV-Delta",
434 .muxsel = { 2, 3, 1, 0, 0 },
438 .tuner_addr = ADDR_UNSET,
439 .radio_addr = ADDR_UNSET,
442 /* ---- card 0x08 ---------------------------------- */
443 [BTTV_BOARD_FLYVIDEO] = {
444 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
450 .muxsel = { 2, 3, 1, 1 },
451 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
456 .tuner_addr = ADDR_UNSET,
457 .radio_addr = ADDR_UNSET,
459 [BTTV_BOARD_TURBOTV] = {
460 .name = "IMS/IXmicro TurboTV",
466 .muxsel = { 2, 3, 1, 1 },
467 .gpiomux = { 1, 1, 2, 3 },
470 .tuner_type = TUNER_TEMIC_PAL,
471 .tuner_addr = ADDR_UNSET,
472 .radio_addr = ADDR_UNSET,
474 [BTTV_BOARD_HAUPPAUGE878] = {
475 .name = "Hauppauge (bt878)",
480 .gpiomask = 0x0f, /* old: 7 */
481 .muxsel = { 2, 0, 1, 1 },
482 .gpiomux = { 0, 1, 2, 3 },
487 .tuner_addr = ADDR_UNSET,
488 .radio_addr = ADDR_UNSET,
490 [BTTV_BOARD_MIROPRO] = {
491 .name = "MIRO PCTV pro",
497 .muxsel = { 2, 3, 1, 1 },
498 .gpiomux = { 0x20001,0x10001, 0, 0 },
502 .tuner_addr = ADDR_UNSET,
503 .radio_addr = ADDR_UNSET,
506 /* ---- card 0x0c ---------------------------------- */
507 [BTTV_BOARD_ADSTECH_TV] = {
508 .name = "ADS Technologies Channel Surfer TV (bt848)",
514 .muxsel = { 2, 3, 1, 1 },
515 .gpiomux = { 13, 14, 11, 7 },
518 .tuner_addr = ADDR_UNSET,
519 .radio_addr = ADDR_UNSET,
521 [BTTV_BOARD_AVERMEDIA98] = {
522 .name = "AVerMedia TVCapture 98",
528 .muxsel = { 2, 3, 1, 1 },
529 .gpiomux = { 13, 14, 11, 7 },
533 .tuner_type = TUNER_PHILIPS_PAL,
534 .tuner_addr = ADDR_UNSET,
535 .radio_addr = ADDR_UNSET,
536 .audio_mode_gpio= avermedia_tv_stereo_audio,
540 .name = "Aimslab Video Highway Xtreme (VHX)",
546 .muxsel = { 2, 3, 1, 1 },
547 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
552 .tuner_addr = ADDR_UNSET,
553 .radio_addr = ADDR_UNSET,
555 [BTTV_BOARD_ZOLTRIX] = {
556 .name = "Zoltrix TV-Max",
562 .muxsel = { 2, 3, 1, 1 },
563 .gpiomux = { 0, 0, 1, 0 },
567 .tuner_addr = ADDR_UNSET,
568 .radio_addr = ADDR_UNSET,
571 /* ---- card 0x10 ---------------------------------- */
572 [BTTV_BOARD_PIXVIEWPLAYTV] = {
573 .name = "Prolink Pixelview PlayTV (bt878)",
578 .gpiomask = 0x01fe00,
579 .muxsel = { 2, 3, 1, 1 },
580 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
581 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
582 .gpiomute = 0x002000,
586 .tuner_addr = ADDR_UNSET,
587 .radio_addr = ADDR_UNSET,
589 [BTTV_BOARD_WINVIEW_601] = {
590 .name = "Leadtek WinView 601",
595 .gpiomask = 0x8300f8,
596 .muxsel = { 2, 3, 1, 1,0 },
597 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
598 .gpiomute = 0xcfa007,
601 .tuner_addr = ADDR_UNSET,
602 .radio_addr = ADDR_UNSET,
603 .volume_gpio = winview_volume,
606 [BTTV_BOARD_AVEC_INTERCAP] = {
607 .name = "AVEC Intercapture",
613 .muxsel = { 2, 3, 1, 1 },
614 .gpiomux = { 1, 0, 0, 0 },
617 .tuner_addr = ADDR_UNSET,
618 .radio_addr = ADDR_UNSET,
620 [BTTV_BOARD_LIFE_FLYKIT] = {
621 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
626 .gpiomask = 0x8dff00,
627 .muxsel = { 2, 3, 1, 1 },
631 .tuner_addr = ADDR_UNSET,
632 .radio_addr = ADDR_UNSET,
635 /* ---- card 0x14 ---------------------------------- */
636 [BTTV_BOARD_CEI_RAFFLES] = {
637 .name = "CEI Raffles Card",
642 .muxsel = { 2, 3, 1, 1 },
644 .tuner_addr = ADDR_UNSET,
645 .radio_addr = ADDR_UNSET,
647 [BTTV_BOARD_CONFERENCETV] = {
648 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
650 .audio_inputs = 2, /* tuner, line in */
654 .muxsel = { 2, 3, 1, 1 },
655 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
658 .tuner_type = TUNER_PHILIPS_PAL_I,
659 .tuner_addr = ADDR_UNSET,
660 .radio_addr = ADDR_UNSET,
662 [BTTV_BOARD_PHOEBE_TVMAS] = {
663 .name = "Askey CPH050/ Phoebe Tv Master + FM",
669 .muxsel = { 2, 3, 1, 1 },
670 .gpiomux = { 0, 1, 0x800, 0x400 },
675 .tuner_addr = ADDR_UNSET,
676 .radio_addr = ADDR_UNSET,
678 [BTTV_BOARD_MODTEC_205] = {
679 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
685 .muxsel = { 2, 3, -1 },
686 .digital_mode = DIGITAL_MODE_CAMERA,
687 .gpiomux = { 0, 0, 0, 0 },
690 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
691 .tuner_addr = ADDR_UNSET,
692 .radio_addr = ADDR_UNSET,
695 /* ---- card 0x18 ---------------------------------- */
696 [BTTV_BOARD_MAGICTVIEW061] = {
697 .name = "Askey CPH05X/06X (bt878) [many vendors]",
703 .muxsel = { 2, 3, 1, 1 },
704 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
709 .tuner_addr = ADDR_UNSET,
710 .radio_addr = ADDR_UNSET,
713 [BTTV_BOARD_VOBIS_BOOSTAR] = {
714 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
719 .gpiomask = 0x1f0fff,
720 .muxsel = { 2, 3, 1, 1 },
721 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
724 .tuner_type = TUNER_PHILIPS_PAL,
725 .tuner_addr = ADDR_UNSET,
726 .radio_addr = ADDR_UNSET,
727 .audio_mode_gpio= terratv_audio,
729 [BTTV_BOARD_HAUPPAUG_WCAM] = {
730 .name = "Hauppauge WinCam newer (bt878)",
736 .muxsel = { 2, 0, 1, 1 },
737 .gpiomux = { 0, 1, 2, 3 },
741 .tuner_addr = ADDR_UNSET,
742 .radio_addr = ADDR_UNSET,
744 [BTTV_BOARD_MAXI] = {
745 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
751 .muxsel = { 2, 3, 1, 1 },
752 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
755 .tuner_type = TUNER_PHILIPS_SECAM,
756 .tuner_addr = ADDR_UNSET,
757 .radio_addr = ADDR_UNSET,
760 /* ---- card 0x1c ---------------------------------- */
761 [BTTV_BOARD_TERRATV] = {
762 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
767 .gpiomask = 0x1f0fff,
768 .muxsel = { 2, 3, 1, 1 },
769 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
772 .tuner_type = TUNER_PHILIPS_PAL,
773 .tuner_addr = ADDR_UNSET,
774 .radio_addr = ADDR_UNSET,
775 .audio_mode_gpio= terratv_audio,
777 External 20 pin connector (for Active Radio Upgrade board)
783 gpio05: om5610-stereo
787 gpio09+10: nIOR, nSEL ?? (bt878)
791 gpio16: u2-A0 (1st 4052bt)
794 gpio19: u4-A0 (2nd 4052)
798 00000 : Cdrom (internal audio input)
799 10000 : ext. Video audio input
808 [BTTV_BOARD_PXC200] = {
809 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
810 .name = "Imagenation PXC200",
814 .svhs = 1, /* was: 4 */
816 .muxsel = { 2, 3, 1, 0, 0},
820 .tuner_addr = ADDR_UNSET,
821 .radio_addr = ADDR_UNSET,
822 .muxsel_hook = PXC200_muxsel,
825 [BTTV_BOARD_FLYVIDEO_98] = {
826 .name = "Lifeview FlyVideo 98 LR50",
831 .gpiomask = 0x1800, /* 0x8dfe00 */
832 .muxsel = { 2, 3, 1, 1 },
833 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
837 .tuner_addr = ADDR_UNSET,
838 .radio_addr = ADDR_UNSET,
840 [BTTV_BOARD_IPROTV] = {
841 .name = "Formac iProTV, Formac ProTV I (bt848)",
847 .muxsel = { 2, 3, 1, 1 },
848 .gpiomux = { 1, 0, 0, 0 },
850 .tuner_type = TUNER_PHILIPS_PAL,
851 .tuner_addr = ADDR_UNSET,
852 .radio_addr = ADDR_UNSET,
855 /* ---- card 0x20 ---------------------------------- */
856 [BTTV_BOARD_INTEL_C_S_PCI] = {
857 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
863 .muxsel = { 2, 3, 1, 1 },
866 .tuner_type = TUNER_ABSENT,
867 .tuner_addr = ADDR_UNSET,
868 .radio_addr = ADDR_UNSET,
870 [BTTV_BOARD_TERRATVALUE] = {
871 .name = "Terratec TerraTValue Version Bt878",
876 .gpiomask = 0xffff00,
877 .muxsel = { 2, 3, 1, 1 },
878 .gpiomux = { 0x500, 0, 0x300, 0x900 },
882 .tuner_type = TUNER_PHILIPS_PAL,
883 .tuner_addr = ADDR_UNSET,
884 .radio_addr = ADDR_UNSET,
886 [BTTV_BOARD_WINFAST2000] = {
887 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
892 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
893 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
894 .gpiomask = 0xb33000,
895 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
896 .gpiomute = 0x800000,
897 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
898 gpio23 -- hef4052:nEnable (0x800000)
901 0x0000: external audio
905 Note: There exists another variant "Winfast 2000" with tv stereo !?
906 Note: eeprom only contains FF and pci subsystem id 107d:6606
911 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
912 .tuner_addr = ADDR_UNSET,
913 .radio_addr = ADDR_UNSET,
914 .audio_mode_gpio= winfast2000_audio,
917 [BTTV_BOARD_CHRONOS_VS2] = {
918 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
924 .muxsel = { 2, 3, 1, 1 },
925 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
929 .tuner_addr = ADDR_UNSET,
930 .radio_addr = ADDR_UNSET,
933 /* ---- card 0x24 ---------------------------------- */
934 [BTTV_BOARD_TYPHOON_TVIEW] = {
935 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
941 .muxsel = { 2, 3, 1, 1 },
942 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
946 .tuner_addr = ADDR_UNSET,
947 .radio_addr = ADDR_UNSET,
950 [BTTV_BOARD_PXELVWPLTVPRO] = {
951 .name = "Prolink PixelView PlayTV pro",
957 .muxsel = { 2, 3, 1, 1 },
958 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
963 .tuner_addr = ADDR_UNSET,
964 .radio_addr = ADDR_UNSET,
966 [BTTV_BOARD_MAGICTVIEW063] = {
967 .name = "Askey CPH06X TView99",
972 .gpiomask = 0x551e00,
973 .muxsel = { 2, 3, 1, 0 },
974 .gpiomux = { 0x551400, 0x551200, 0, 0 },
975 .gpiomute = 0x551c00,
978 .tuner_type = TUNER_PHILIPS_PAL_I,
979 .tuner_addr = ADDR_UNSET,
980 .radio_addr = ADDR_UNSET,
983 [BTTV_BOARD_PINNACLE] = {
984 .name = "Pinnacle PCTV Studio/Rave",
989 .gpiomask = 0x03000F,
990 .muxsel = { 2, 3, 1, 1 },
991 .gpiomux = { 2, 0xd0001, 0, 0 },
996 .tuner_addr = ADDR_UNSET,
997 .radio_addr = ADDR_UNSET,
1000 /* ---- card 0x28 ---------------------------------- */
1001 [BTTV_BOARD_STB2] = {
1002 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1008 .muxsel = { 2, 3, 1, 1 },
1009 .gpiomux = { 4, 0, 2, 3 },
1013 .tuner_type = TUNER_PHILIPS_NTSC,
1014 .tuner_addr = ADDR_UNSET,
1015 .radio_addr = ADDR_UNSET,
1019 [BTTV_BOARD_AVPHONE98] = {
1020 .name = "AVerMedia TVPhone 98",
1026 .muxsel = { 2, 3, 1, 1 },
1027 .gpiomux = { 13, 4, 11, 7 },
1030 .tuner_type = UNSET,
1031 .tuner_addr = ADDR_UNSET,
1032 .radio_addr = ADDR_UNSET,
1034 .audio_mode_gpio= avermedia_tvphone_audio,
1036 [BTTV_BOARD_PV951] = {
1037 .name = "ProVideo PV951", /* pic16c54 */
1043 .muxsel = { 2, 3, 1, 1},
1044 .gpiomux = { 0, 0, 0, 0},
1048 .tuner_type = TUNER_PHILIPS_PAL_I,
1049 .tuner_addr = ADDR_UNSET,
1050 .radio_addr = ADDR_UNSET,
1052 [BTTV_BOARD_ONAIR_TV] = {
1053 .name = "Little OnAir TV",
1059 .muxsel = { 2, 3, 1, 1 },
1060 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1061 .gpiomute = 0xff3ffc,
1063 .tuner_type = UNSET,
1064 .tuner_addr = ADDR_UNSET,
1065 .radio_addr = ADDR_UNSET,
1068 /* ---- card 0x2c ---------------------------------- */
1069 [BTTV_BOARD_SIGMA_TVII_FM] = {
1070 .name = "Sigma TVII-FM",
1076 .muxsel = { 2, 3, 1, 1 },
1077 .gpiomux = { 1, 1, 0, 2 },
1081 .tuner_type = UNSET,
1082 .tuner_addr = ADDR_UNSET,
1083 .radio_addr = ADDR_UNSET,
1085 [BTTV_BOARD_MATRIX_VISION2] = {
1086 .name = "MATRIX-Vision MV-Delta 2",
1092 .muxsel = { 2, 3, 1, 0, 0 },
1096 .tuner_type = UNSET,
1097 .tuner_addr = ADDR_UNSET,
1098 .radio_addr = ADDR_UNSET,
1100 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1101 .name = "Zoltrix Genie TV/FM",
1106 .gpiomask = 0xbcf03f,
1107 .muxsel = { 2, 3, 1, 1 },
1108 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1109 .gpiomute = 0xbcb03f,
1112 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1113 .tuner_addr = ADDR_UNSET,
1114 .radio_addr = ADDR_UNSET,
1116 [BTTV_BOARD_TERRATVRADIO] = {
1117 .name = "Terratec TV/Radio+",
1122 .gpiomask = 0x70000,
1123 .muxsel = { 2, 3, 1, 1 },
1124 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1125 .gpiomute = 0x40000,
1129 .tuner_type = TUNER_PHILIPS_PAL_I,
1130 .tuner_addr = ADDR_UNSET,
1131 .radio_addr = ADDR_UNSET,
1135 /* ---- card 0x30 ---------------------------------- */
1136 [BTTV_BOARD_DYNALINK] = {
1137 .name = "Askey CPH03x/ Dynalink Magic TView",
1143 .muxsel = { 2, 3, 1, 1 },
1144 .gpiomux = {2,0,0,0 },
1148 .tuner_type = UNSET,
1149 .tuner_addr = ADDR_UNSET,
1150 .radio_addr = ADDR_UNSET,
1152 [BTTV_BOARD_GVBCTV3PCI] = {
1153 .name = "IODATA GV-BCTV3/PCI",
1158 .gpiomask = 0x010f00,
1159 .muxsel = {2, 3, 0, 0 },
1160 .gpiomux = {0x10000, 0, 0x10000, 0 },
1163 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1164 .tuner_addr = ADDR_UNSET,
1165 .radio_addr = ADDR_UNSET,
1166 .audio_mode_gpio= gvbctv3pci_audio,
1168 [BTTV_BOARD_PXELVWPLTVPAK] = {
1169 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1174 .gpiomask = 0xAA0000,
1175 .muxsel = { 2,3,1,1,-1 },
1176 .digital_mode = DIGITAL_MODE_CAMERA,
1177 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1178 .gpiomute = 0xa8000,
1181 .tuner_type = TUNER_PHILIPS_PAL_I,
1182 .tuner_addr = ADDR_UNSET,
1183 .radio_addr = ADDR_UNSET,
1185 /* GPIO wiring: (different from Rev.4C !)
1186 GPIO17: U4.A0 (first hef4052bt)
1188 GPIO20: U5.A1 (second hef4052bt)
1190 GPIO22: BT832 Reset Line
1191 GPIO23: A5,A0, U5,nEN
1192 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1195 [BTTV_BOARD_EAGLE] = {
1196 .name = "Eagle Wireless Capricorn2 (bt878A)",
1202 .muxsel = { 2, 0, 1, 1 },
1203 .gpiomux = { 0, 1, 2, 3 },
1206 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1207 .tuner_addr = ADDR_UNSET,
1208 .radio_addr = ADDR_UNSET,
1211 /* ---- card 0x34 ---------------------------------- */
1212 [BTTV_BOARD_PINNACLEPRO] = {
1213 /* David Härdeman <david@2gen.com> */
1214 .name = "Pinnacle PCTV Studio Pro",
1219 .gpiomask = 0x03000F,
1220 .muxsel = { 2, 3, 1, 1 },
1221 .gpiomux = { 1, 0xd0001, 0, 0 },
1223 /* sound path (5 sources):
1224 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1227 2= Mono TV sound from Tuner
1229 MUX2 (mask 0x30000):
1231 1= FM stereo Radio from Tuner */
1234 .tuner_type = UNSET,
1235 .tuner_addr = ADDR_UNSET,
1236 .radio_addr = ADDR_UNSET,
1238 [BTTV_BOARD_TVIEW_RDS_FM] = {
1239 /* Claas Langbehn <claas@bigfoot.com>,
1240 Sven Grothklags <sven@upb.de> */
1241 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1247 .muxsel = { 2, 3, 1, 1 },
1248 .gpiomux = { 0, 0, 0x10, 8 },
1252 .tuner_type = TUNER_PHILIPS_PAL,
1253 .tuner_addr = ADDR_UNSET,
1254 .radio_addr = ADDR_UNSET,
1257 [BTTV_BOARD_LIFETEC_9415] = {
1258 /* Tim Röstermundt <rosterm@uni-muenster.de>
1259 in de.comp.os.unix.linux.hardware:
1260 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1261 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1262 options tuner type=5 */
1263 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1269 .muxsel = { 2, 3, 1, 1 },
1270 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1272 /* For cards with tda9820/tda9821:
1273 0x0000: Tuner normal stereo
1274 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1275 0x0880: Tuner A2 stereo */
1277 .tuner_type = UNSET,
1278 .tuner_addr = ADDR_UNSET,
1279 .radio_addr = ADDR_UNSET,
1281 [BTTV_BOARD_BESTBUY_EASYTV] = {
1282 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1283 old Easy TV BT848 version (model CPH031) */
1284 .name = "Askey CPH031/ BESTBUY Easy TV",
1290 .muxsel = { 2, 3, 1, 0 },
1291 .gpiomux = { 2, 0, 0, 0 },
1295 .tuner_type = TUNER_TEMIC_PAL,
1296 .tuner_addr = ADDR_UNSET,
1297 .radio_addr = ADDR_UNSET,
1300 /* ---- card 0x38 ---------------------------------- */
1301 [BTTV_BOARD_FLYVIDEO_98FM] = {
1302 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1303 .name = "Lifeview FlyVideo 98FM LR50",
1309 .muxsel = { 2, 3, 1, 1 },
1310 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1313 .tuner_type = TUNER_PHILIPS_PAL,
1314 .tuner_addr = ADDR_UNSET,
1315 .radio_addr = ADDR_UNSET,
1317 /* This is the ultimate cheapo capture card
1318 * just a BT848A on a small PCB!
1319 * Steve Hosgood <steve@equiinet.com> */
1320 [BTTV_BOARD_GRANDTEC] = {
1321 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1332 .tuner_type = UNSET,
1333 .tuner_addr = ADDR_UNSET,
1334 .radio_addr = ADDR_UNSET,
1336 [BTTV_BOARD_ASKEY_CPH060] = {
1337 /* Daniel Herrington <daniel.herrington@home.com> */
1338 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1344 .muxsel = { 2, 3, 1, 1},
1345 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1349 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1350 .tuner_addr = ADDR_UNSET,
1351 .radio_addr = ADDR_UNSET,
1353 [BTTV_BOARD_ASKEY_CPH03X] = {
1354 /* Matti Mottus <mottus@physic.ut.ee> */
1355 .name = "Askey CPH03x TV Capturer",
1360 .gpiomask = 0x03000F,
1361 .muxsel = { 2, 3, 1, 0 },
1362 .gpiomux = { 2, 0, 0, 0 },
1365 .tuner_type = TUNER_TEMIC_PAL,
1366 .tuner_addr = ADDR_UNSET,
1367 .radio_addr = ADDR_UNSET,
1370 /* ---- card 0x3c ---------------------------------- */
1371 [BTTV_BOARD_MM100PCTV] = {
1372 /* Philip Blundell <philb@gnu.org> */
1373 .name = "Modular Technology MM100PCTV",
1379 .muxsel = { 2, 3, 1, 1 },
1380 .gpiomux = { 2, 0, 0, 1 },
1383 .tuner_type = TUNER_TEMIC_PAL,
1384 .tuner_addr = ADDR_UNSET,
1385 .radio_addr = ADDR_UNSET,
1387 [BTTV_BOARD_GMV1] = {
1388 /* Adrian Cox <adrian@humboldt.co.uk */
1389 .name = "AG Electronics GMV1",
1400 .tuner_type = UNSET,
1401 .tuner_addr = ADDR_UNSET,
1402 .radio_addr = ADDR_UNSET,
1404 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1405 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1406 new Easy TV BT878 version (model CPH061)
1407 special thanks to Informatica Mieres for providing the card */
1408 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1414 .muxsel = { 2, 3, 1, 0 },
1415 .gpiomux = { 1, 0, 4, 4 },
1419 .tuner_type = TUNER_PHILIPS_PAL,
1420 .tuner_addr = ADDR_UNSET,
1421 .radio_addr = ADDR_UNSET,
1423 [BTTV_BOARD_ATI_TVWONDER] = {
1424 /* Lukas Gebauer <geby@volny.cz> */
1425 .name = "ATI TV-Wonder",
1431 .muxsel = { 2, 3, 1, 0 },
1432 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1435 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1436 .tuner_addr = ADDR_UNSET,
1437 .radio_addr = ADDR_UNSET,
1440 /* ---- card 0x40 ---------------------------------- */
1441 [BTTV_BOARD_ATI_TVWONDERVE] = {
1442 /* Lukas Gebauer <geby@volny.cz> */
1443 .name = "ATI TV-Wonder VE",
1449 .muxsel = { 2, 3, 0, 1 },
1450 .gpiomux = { 0, 0, 1, 0 },
1453 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1454 .tuner_addr = ADDR_UNSET,
1455 .radio_addr = ADDR_UNSET,
1457 [BTTV_BOARD_FLYVIDEO2000] = {
1458 /* DeeJay <deejay@westel900.net (2000S) */
1459 .name = "Lifeview FlyVideo 2000S LR90",
1465 .muxsel = { 2, 3, 0, 1 },
1466 /* Radio changed from 1e80 to 0x800 to make
1467 FlyVideo2000S in .hu happy (gm)*/
1468 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1469 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1471 .audio_mode_gpio= fv2000s_audio,
1476 .tuner_type = TUNER_PHILIPS_PAL,
1477 .tuner_addr = ADDR_UNSET,
1478 .radio_addr = ADDR_UNSET,
1480 [BTTV_BOARD_TERRATVALUER] = {
1481 .name = "Terratec TValueRadio",
1486 .gpiomask = 0xffff00,
1487 .muxsel = { 2, 3, 1, 1 },
1488 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1492 .tuner_type = TUNER_PHILIPS_PAL,
1493 .tuner_addr = ADDR_UNSET,
1494 .radio_addr = ADDR_UNSET,
1497 [BTTV_BOARD_GVBCTV4PCI] = {
1498 /* TANAKA Kei <peg00625@nifty.com> */
1499 .name = "IODATA GV-BCTV4/PCI",
1504 .gpiomask = 0x010f00,
1505 .muxsel = {2, 3, 0, 0 },
1506 .gpiomux = {0x10000, 0, 0x10000, 0 },
1509 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1510 .tuner_addr = ADDR_UNSET,
1511 .radio_addr = ADDR_UNSET,
1512 .audio_mode_gpio= gvbctv3pci_audio,
1515 /* ---- card 0x44 ---------------------------------- */
1516 [BTTV_BOARD_VOODOOTV_FM] = {
1517 .name = "3Dfx VoodooTV FM (Euro)",
1518 /* try "insmod msp3400 simple=0" if you have
1519 * sound problems with this card. */
1524 .gpiomask = 0x4f8a00,
1525 /* 0x100000: 1=MSP enabled (0=disable again)
1526 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1527 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1528 .gpiomute = 0x947fff,
1529 /* tvtuner, radio, external,internal, mute, stereo
1530 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1531 .muxsel = { 2, 3 ,0 ,1 },
1532 .tuner_type = TUNER_MT2032,
1533 .tuner_addr = ADDR_UNSET,
1534 .radio_addr = ADDR_UNSET,
1538 [BTTV_BOARD_VOODOOTV_200] = {
1539 .name = "VoodooTV 200 (USA)",
1540 /* try "insmod msp3400 simple=0" if you have
1541 * sound problems with this card. */
1546 .gpiomask = 0x4f8a00,
1547 /* 0x100000: 1=MSP enabled (0=disable again)
1548 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1549 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1550 .gpiomute = 0x947fff,
1551 /* tvtuner, radio, external,internal, mute, stereo
1552 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1553 .muxsel = { 2, 3 ,0 ,1 },
1554 .tuner_type = TUNER_MT2032,
1555 .tuner_addr = ADDR_UNSET,
1556 .radio_addr = ADDR_UNSET,
1560 [BTTV_BOARD_AIMMS] = {
1561 /* Philip Blundell <pb@nexus.co.uk> */
1562 .name = "Active Imaging AIMMS",
1566 .tuner_type = UNSET,
1567 .tuner_addr = ADDR_UNSET,
1568 .radio_addr = ADDR_UNSET,
1573 [BTTV_BOARD_PV_BT878P_PLUS] = {
1574 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1575 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1581 .muxsel = { 2, 3, 1, 1 },
1582 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1586 .tuner_type = TUNER_LG_PAL_I_FM,
1587 .tuner_addr = ADDR_UNSET,
1588 .radio_addr = ADDR_UNSET,
1591 GPIO0: U4.A0 (hef4052bt)
1593 GPIO2: U4.A1 (second hef4052bt)
1594 GPIO3: U4.nEN, U5.A0, A5.nEN
1598 [BTTV_BOARD_FLYVIDEO98EZ] = {
1599 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1604 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1607 .tuner_type = UNSET,
1608 .tuner_addr = ADDR_UNSET,
1609 .radio_addr = ADDR_UNSET,
1612 /* ---- card 0x48 ---------------------------------- */
1613 [BTTV_BOARD_PV_BT878P_9B] = {
1614 /* Dariusz Kowalewski <darekk@automex.pl> */
1615 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1621 .muxsel = { 2, 3, 1, 1 },
1622 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1628 .tuner_type = TUNER_PHILIPS_PAL,
1629 .tuner_addr = ADDR_UNSET,
1630 .radio_addr = ADDR_UNSET,
1631 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1632 .has_radio = 1, /* Note: not all cards have radio */
1639 GPIO20,22,23: R30,R29,R28
1642 [BTTV_BOARD_SENSORAY311] = {
1643 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1644 /* you must jumper JP5 for the card to work */
1645 .name = "Sensoray 311",
1651 .muxsel = { 2, 3, 1, 0, 0 },
1654 .tuner_type = UNSET,
1655 .tuner_addr = ADDR_UNSET,
1656 .radio_addr = ADDR_UNSET,
1658 [BTTV_BOARD_RV605] = {
1659 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1660 .name = "RemoteVision MX (RV605)",
1666 .gpiomask2 = 0x07ff,
1667 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1668 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1671 .tuner_type = UNSET,
1672 .tuner_addr = ADDR_UNSET,
1673 .radio_addr = ADDR_UNSET,
1674 .muxsel_hook = rv605_muxsel,
1676 [BTTV_BOARD_POWERCLR_MTV878] = {
1677 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1682 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1683 .muxsel = { 2, 1, 1, },
1684 .gpiomux = { 0, 1, 2, 2 },
1687 .tuner_type = TUNER_PHILIPS_PAL,
1688 .tuner_addr = ADDR_UNSET,
1689 .radio_addr = ADDR_UNSET,
1694 /* ---- card 0x4c ---------------------------------- */
1695 [BTTV_BOARD_WINDVR] = {
1696 /* Masaki Suzuki <masaki@btree.org> */
1697 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1702 .gpiomask = 0x140007,
1703 .muxsel = { 2, 3, 1, 1 },
1704 .gpiomux = { 0, 1, 2, 3 },
1706 .tuner_type = TUNER_PHILIPS_NTSC,
1707 .tuner_addr = ADDR_UNSET,
1708 .radio_addr = ADDR_UNSET,
1709 .audio_mode_gpio= windvr_audio,
1711 [BTTV_BOARD_GRANDTEC_MULTI] = {
1712 .name = "GrandTec Multi Capture Card (Bt878)",
1718 .muxsel = { 2, 3, 1, 0 },
1723 .tuner_type = UNSET,
1724 .tuner_addr = ADDR_UNSET,
1725 .radio_addr = ADDR_UNSET,
1727 [BTTV_BOARD_KWORLD] = {
1728 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1734 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1735 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1736 * This card lacks external Audio In, so we mute it on Ext. & Int.
1737 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1738 * This card lacks PCI subsystem ID, sigh.
1739 * gpiomux =1: lower volume, 2+3: mute
1740 * btwincap uses 0x80000/0x80003
1746 .tuner_type = TUNER_PHILIPS_PAL,
1747 .tuner_addr = ADDR_UNSET,
1748 .radio_addr = ADDR_UNSET,
1749 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1750 radio signal strength indicators work fine. */
1753 GPIO0,1: HEF4052 A0,A1
1754 GPIO2: HEF4052 nENABLE
1756 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1760 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1762 [BTTV_BOARD_DSP_TCVIDEO] = {
1763 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1764 .name = "DSP Design TCVIDEO",
1767 .muxsel = { 2, 3, 1, 0 },
1769 .tuner_type = UNSET,
1770 .tuner_addr = ADDR_UNSET,
1771 .radio_addr = ADDR_UNSET,
1774 /* ---- card 0x50 ---------------------------------- */
1775 [BTTV_BOARD_HAUPPAUGEPVR] = {
1776 .name = "Hauppauge WinTV PVR",
1781 .muxsel = { 2, 0, 1, 1 },
1784 .tuner_type = UNSET,
1785 .tuner_addr = ADDR_UNSET,
1786 .radio_addr = ADDR_UNSET,
1791 [BTTV_BOARD_GVBCTV5PCI] = {
1792 .name = "IODATA GV-BCTV5/PCI",
1797 .gpiomask = 0x0f0f80,
1798 .muxsel = {2, 3, 1, 0 },
1799 .gpiomux = {0x030000, 0x010000, 0, 0 },
1800 .gpiomute = 0x020000,
1803 .tuner_type = TUNER_PHILIPS_NTSC_M,
1804 .tuner_addr = ADDR_UNSET,
1805 .radio_addr = ADDR_UNSET,
1806 .audio_mode_gpio= gvbctv5pci_audio,
1809 [BTTV_BOARD_OSPREY1x0] = {
1810 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1811 .video_inputs = 4, /* id-inputs-clock */
1815 .muxsel = { 3, 2, 0, 1 },
1817 .tuner_type = UNSET,
1818 .tuner_addr = ADDR_UNSET,
1819 .radio_addr = ADDR_UNSET,
1824 [BTTV_BOARD_OSPREY1x0_848] = {
1825 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1830 .muxsel = { 2, 3, 1 },
1832 .tuner_type = UNSET,
1833 .tuner_addr = ADDR_UNSET,
1834 .radio_addr = ADDR_UNSET,
1840 /* ---- card 0x54 ---------------------------------- */
1841 [BTTV_BOARD_OSPREY101_848] = {
1842 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1849 .tuner_type = UNSET,
1850 .tuner_addr = ADDR_UNSET,
1851 .radio_addr = ADDR_UNSET,
1856 [BTTV_BOARD_OSPREY1x1] = {
1857 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1864 .tuner_type = UNSET,
1865 .tuner_addr = ADDR_UNSET,
1866 .radio_addr = ADDR_UNSET,
1871 [BTTV_BOARD_OSPREY1x1_SVID] = {
1872 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1879 .tuner_type = UNSET,
1880 .tuner_addr = ADDR_UNSET,
1881 .radio_addr = ADDR_UNSET,
1886 [BTTV_BOARD_OSPREY2xx] = {
1887 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1894 .tuner_type = UNSET,
1895 .tuner_addr = ADDR_UNSET,
1896 .radio_addr = ADDR_UNSET,
1902 /* ---- card 0x58 ---------------------------------- */
1903 [BTTV_BOARD_OSPREY2x0_SVID] = {
1904 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1911 .tuner_type = UNSET,
1912 .tuner_addr = ADDR_UNSET,
1913 .radio_addr = ADDR_UNSET,
1918 [BTTV_BOARD_OSPREY2x0] = {
1919 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1926 .tuner_type = UNSET,
1927 .tuner_addr = ADDR_UNSET,
1928 .radio_addr = ADDR_UNSET,
1933 [BTTV_BOARD_OSPREY500] = {
1934 .name = "Osprey 500", /* 500 */
1941 .tuner_type = UNSET,
1942 .tuner_addr = ADDR_UNSET,
1943 .radio_addr = ADDR_UNSET,
1948 [BTTV_BOARD_OSPREY540] = {
1949 .name = "Osprey 540", /* 540 */
1954 .tuner_type = UNSET,
1955 .tuner_addr = ADDR_UNSET,
1956 .radio_addr = ADDR_UNSET,
1962 /* ---- card 0x5C ---------------------------------- */
1963 [BTTV_BOARD_OSPREY2000] = {
1964 .name = "Osprey 2000", /* 2000 */
1971 .tuner_type = UNSET,
1972 .tuner_addr = ADDR_UNSET,
1973 .radio_addr = ADDR_UNSET,
1976 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1978 [BTTV_BOARD_IDS_EAGLE] = {
1979 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1980 .name = "IDS Eagle",
1984 .tuner_type = UNSET,
1985 .tuner_addr = ADDR_UNSET,
1986 .radio_addr = ADDR_UNSET,
1989 .muxsel = { 0, 1, 2, 3 },
1990 .muxsel_hook = eagle_muxsel,
1995 [BTTV_BOARD_PINNACLESAT] = {
1996 .name = "Pinnacle PCTV Sat",
2001 .tuner_type = UNSET,
2002 .tuner_addr = ADDR_UNSET,
2003 .radio_addr = ADDR_UNSET,
2012 [BTTV_BOARD_FORMAC_PROTV] = {
2013 .name = "Formac ProTV II (bt878)",
2019 /* TV, Comp1, Composite over SVID con, SVID */
2020 .muxsel = { 2, 3, 1, 1 },
2021 .gpiomux = { 2, 2, 0, 0 },
2024 .tuner_type = TUNER_PHILIPS_PAL,
2025 .tuner_addr = ADDR_UNSET,
2026 .radio_addr = ADDR_UNSET,
2028 GPIO=0x00,0x01,0x03: mute (?)
2029 0x02: both TV and radio (tuner: FM1216/I)
2030 The card has onboard audio connectors labeled "cdrom" and "board",
2031 not soldered here, though unknown wiring.
2032 Card lacks: external audio in, pci subsystem id.
2036 /* ---- card 0x60 ---------------------------------- */
2037 [BTTV_BOARD_MACHTV] = {
2044 .muxsel = { 2, 3, 1, 1},
2045 .gpiomux = { 0, 1, 2, 3},
2048 .tuner_type = TUNER_PHILIPS_PAL,
2049 .tuner_addr = ADDR_UNSET,
2050 .radio_addr = ADDR_UNSET,
2053 [BTTV_BOARD_EURESYS_PICOLO] = {
2054 .name = "Euresys Picolo",
2063 .muxsel = { 2, 0, 1},
2065 .tuner_type = UNSET,
2066 .tuner_addr = ADDR_UNSET,
2067 .radio_addr = ADDR_UNSET,
2069 [BTTV_BOARD_PV150] = {
2070 /* Luc Van Hoeylandt <luc@e-magic.be> */
2071 .name = "ProVideo PV150", /* 0x4f */
2082 .tuner_type = UNSET,
2083 .tuner_addr = ADDR_UNSET,
2084 .radio_addr = ADDR_UNSET,
2086 [BTTV_BOARD_AD_TVK503] = {
2087 /* Hiroshi Takekawa <sian@big.or.jp> */
2088 /* This card lacks subsystem ID */
2089 .name = "AD-TVK503", /* 0x63 */
2094 .gpiomask = 0x001e8007,
2095 .muxsel = { 2, 3, 1, 0 },
2096 /* Tuner, Radio, external, internal, off, on */
2097 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2102 .tuner_type = TUNER_PHILIPS_NTSC,
2103 .tuner_addr = ADDR_UNSET,
2104 .radio_addr = ADDR_UNSET,
2105 .audio_mode_gpio= adtvk503_audio,
2108 /* ---- card 0x64 ---------------------------------- */
2109 [BTTV_BOARD_HERCULES_SM_TV] = {
2110 .name = "Hercules Smart TV Stereo",
2116 .muxsel = { 2, 3, 1, 1 },
2120 .tuner_type = TUNER_PHILIPS_PAL,
2121 .tuner_addr = ADDR_UNSET,
2122 .radio_addr = ADDR_UNSET,
2124 - card lacks subsystem ID
2125 - stereo variant w/ daughter board with tda9874a @0xb0
2127 always from tda9874 independent of GPIO (?)
2128 external line in: unknown
2129 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2130 hef4053 (instead 4052) for unknown function
2133 [BTTV_BOARD_PACETV] = {
2134 .name = "Pace TV & Radio Card",
2139 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2143 .tuner_type = TUNER_PHILIPS_PAL_I,
2144 .tuner_addr = ADDR_UNSET,
2145 .radio_addr = ADDR_UNSET,
2148 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2149 only internal line out: (4pin header) RGGL
2150 Radio must be decoded by msp3410d (not routed through)*/
2152 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2155 [BTTV_BOARD_IVC200] = {
2156 /* Chris Willing <chris@vislab.usyd.edu.au> */
2161 .tuner_type = UNSET,
2162 .tuner_addr = ADDR_UNSET,
2163 .radio_addr = ADDR_UNSET,
2169 [BTTV_BOARD_IVCE8784] = {
2170 .name = "IVCE-8784",
2174 .tuner_type = UNSET,
2175 .tuner_addr = ADDR_UNSET,
2176 .radio_addr = ADDR_UNSET,
2182 [BTTV_BOARD_XGUARD] = {
2183 .name = "Grand X-Guard / Trust 814PCI",
2188 .tuner_type = TUNER_ABSENT,
2189 .tuner_addr = ADDR_UNSET,
2190 .radio_addr = ADDR_UNSET,
2192 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2193 .muxsel_hook = xguard_muxsel,
2200 /* ---- card 0x68 ---------------------------------- */
2201 [BTTV_BOARD_NEBULA_DIGITV] = {
2202 .name = "Nebula Electronics DigiTV",
2206 .muxsel = { 2, 3, 1, 0 },
2211 .tuner_type = UNSET,
2212 .tuner_addr = ADDR_UNSET,
2213 .radio_addr = ADDR_UNSET,
2219 [BTTV_BOARD_PV143] = {
2220 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2221 .name = "ProVideo PV143",
2227 .muxsel = { 2, 3, 1, 0 },
2232 .tuner_type = UNSET,
2233 .tuner_addr = ADDR_UNSET,
2234 .radio_addr = ADDR_UNSET,
2236 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
2237 /* M.Klahr@phytec.de */
2238 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
2241 .tuner = UNSET, /* card has no tuner */
2244 .muxsel = { 2, 3, 1, 0 },
2245 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2248 .tuner_type = UNSET,
2249 .tuner_addr = ADDR_UNSET,
2250 .radio_addr = ADDR_UNSET,
2252 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2253 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2256 .tuner = UNSET, /* card has no tuner */
2259 .muxsel = { 2, 3, 1, 1 },
2260 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2263 .tuner_type = UNSET,
2264 .tuner_addr = ADDR_UNSET,
2265 .radio_addr = ADDR_UNSET,
2268 /* ---- card 0x6c ---------------------------------- */
2269 [BTTV_BOARD_VD009_MINIDIN] = {
2270 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2273 .tuner = UNSET, /* card has no tuner */
2276 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2277 via the upper nibble of muxsel. here: used for
2278 xternal video-mux */
2279 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2280 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2283 .tuner_type = UNSET,
2284 .tuner_addr = ADDR_UNSET,
2285 .radio_addr = ADDR_UNSET,
2287 [BTTV_BOARD_VD009_COMBI] = {
2288 .name = "PHYTEC VD-009 Combi (bt878)",
2291 .tuner = UNSET, /* card has no tuner */
2294 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2295 via the upper nibble of muxsel. here: used for
2296 xternal video-mux */
2297 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2298 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2301 .tuner_type = UNSET,
2302 .tuner_addr = ADDR_UNSET,
2303 .radio_addr = ADDR_UNSET,
2305 [BTTV_BOARD_IVC100] = {
2310 .tuner_type = UNSET,
2311 .tuner_addr = ADDR_UNSET,
2312 .radio_addr = ADDR_UNSET,
2315 .muxsel = { 2, 3, 1, 0 },
2318 [BTTV_BOARD_IVC120] = {
2319 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2322 .audio_inputs = 0, /* card has no audio */
2323 .tuner = UNSET, /* card has no tuner */
2324 .tuner_type = UNSET,
2325 .tuner_addr = ADDR_UNSET,
2326 .radio_addr = ADDR_UNSET,
2327 .svhs = UNSET, /* card has no svhs */
2333 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2334 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2335 .muxsel_hook = ivc120_muxsel,
2339 /* ---- card 0x70 ---------------------------------- */
2340 [BTTV_BOARD_PC_HDTV] = {
2341 .name = "pcHDTV HD-2000 TV",
2346 .muxsel = { 2, 3, 1, 0 },
2347 .tuner_type = TUNER_PHILIPS_FCV1236D,
2348 .tuner_addr = ADDR_UNSET,
2349 .radio_addr = ADDR_UNSET,
2352 [BTTV_BOARD_TWINHAN_DST] = {
2353 .name = "Twinhan DST + clones",
2357 .tuner_type = TUNER_ABSENT,
2358 .tuner_addr = ADDR_UNSET,
2359 .radio_addr = ADDR_UNSET,
2363 [BTTV_BOARD_WINFASTVC100] = {
2364 .name = "Winfast VC100",
2369 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2373 .tuner_type = TUNER_ABSENT,
2374 .tuner_addr = ADDR_UNSET,
2375 .radio_addr = ADDR_UNSET,
2378 [BTTV_BOARD_TEV560] = {
2379 .name = "Teppro TEV-560/InterVision IV-560",
2385 .muxsel = { 2, 3, 1, 1 },
2386 .gpiomux = { 1, 1, 1, 1 },
2388 .tuner_type = TUNER_PHILIPS_PAL,
2389 .tuner_addr = ADDR_UNSET,
2390 .radio_addr = ADDR_UNSET,
2394 /* ---- card 0x74 ---------------------------------- */
2395 [BTTV_BOARD_SIMUS_GVC1100] = {
2396 .name = "SIMUS GVC1100",
2401 .tuner_type = UNSET,
2402 .tuner_addr = ADDR_UNSET,
2403 .radio_addr = ADDR_UNSET,
2405 .muxsel = { 2, 2, 2, 2 },
2407 .muxsel_hook = gvc1100_muxsel,
2409 [BTTV_BOARD_NGSTV_PLUS] = {
2410 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2411 .name = "NGS NGSTV+",
2415 .gpiomask = 0x008007,
2416 .muxsel = { 2, 3, 0, 0 },
2417 .gpiomux = { 0, 0, 0, 0 },
2418 .gpiomute = 0x000003,
2420 .tuner_type = TUNER_PHILIPS_PAL,
2421 .tuner_addr = ADDR_UNSET,
2422 .radio_addr = ADDR_UNSET,
2425 [BTTV_BOARD_LMLBT4] = {
2426 /* http://linuxmedialabs.com */
2428 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2432 .muxsel = { 2, 3, 1, 0 },
2437 .tuner_type = UNSET,
2438 .tuner_addr = ADDR_UNSET,
2439 .radio_addr = ADDR_UNSET,
2441 [BTTV_BOARD_TEKRAM_M205] = {
2442 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2443 .name = "Tekram M205 PRO",
2447 .tuner_type = TUNER_PHILIPS_PAL,
2448 .tuner_addr = ADDR_UNSET,
2449 .radio_addr = ADDR_UNSET,
2453 .muxsel = { 2, 3, 1 },
2454 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2458 /* ---- card 0x78 ---------------------------------- */
2459 [BTTV_BOARD_CONTVFMI] = {
2460 /* Javier Cendan Ares <jcendan@lycos.es> */
2461 /* bt878 TV + FM without subsystem ID */
2462 .name = "Conceptronic CONTVFMi",
2467 .gpiomask = 0x008007,
2468 .muxsel = { 2, 3, 1, 1 },
2469 .gpiomux = { 0, 1, 2, 2 },
2473 .tuner_type = TUNER_PHILIPS_PAL,
2474 .tuner_addr = ADDR_UNSET,
2475 .radio_addr = ADDR_UNSET,
2479 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2480 /*Eric DEBIEF <debief@telemsa.com>*/
2481 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2482 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2484 .name = "Euresys Picolo Tetra",
2490 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2494 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2495 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2498 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2499 .tuner_type = UNSET,
2500 .tuner_addr = ADDR_UNSET,
2501 .radio_addr = ADDR_UNSET,
2503 [BTTV_BOARD_SPIRIT_TV] = {
2504 /* Spirit TV Tuner from http://spiritmodems.com.au */
2505 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2506 .name = "Spirit TV Tuner",
2511 .gpiomask = 0x0000000f,
2512 .muxsel = { 2, 1, 1 },
2513 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2514 .tuner_type = TUNER_TEMIC_PAL,
2515 .tuner_addr = ADDR_UNSET,
2516 .radio_addr = ADDR_UNSET,
2520 [BTTV_BOARD_AVDVBT_771] = {
2521 /* Wolfram Joost <wojo@frokaschwei.de> */
2522 .name = "AVerMedia AVerTV DVB-T 771",
2526 .tuner_type = TUNER_ABSENT,
2527 .tuner_addr = ADDR_UNSET,
2528 .radio_addr = ADDR_UNSET,
2529 .muxsel = { 3 , 3 },
2538 /* ---- card 0x7c ---------------------------------- */
2539 [BTTV_BOARD_AVDVBT_761] = {
2540 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2541 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2542 .name = "AverMedia AverTV DVB-T 761",
2546 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2551 .tuner_type = UNSET,
2552 .tuner_addr = ADDR_UNSET,
2553 .radio_addr = ADDR_UNSET,
2558 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2559 /* andre.schwarz@matrix-vision.de */
2560 .name = "MATRIX Vision Sigma-SQ",
2566 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2567 3, 3, 3, 3, 3, 3, 3, 3 },
2568 .muxsel_hook = sigmaSQ_muxsel,
2572 .tuner_type = UNSET,
2573 .tuner_addr = ADDR_UNSET,
2574 .radio_addr = ADDR_UNSET,
2576 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2577 /* andre.schwarz@matrix-vision.de */
2578 .name = "MATRIX Vision Sigma-SLC",
2584 .muxsel = { 2, 2, 2, 2 },
2585 .muxsel_hook = sigmaSLC_muxsel,
2589 .tuner_type = UNSET,
2590 .tuner_addr = ADDR_UNSET,
2591 .radio_addr = ADDR_UNSET,
2593 /* BTTV_BOARD_APAC_VIEWCOMP */
2594 [BTTV_BOARD_APAC_VIEWCOMP] = {
2595 /* Attila Kondoros <attila.kondoros@chello.hu> */
2596 /* bt878 TV + FM 0x00000000 subsystem ID */
2597 .name = "APAC Viewcomp 878(AMAX)",
2603 .muxsel = { 2, 3, 1, 1 },
2604 .gpiomux = { 2, 0, 0, 0 },
2608 .tuner_type = TUNER_PHILIPS_PAL,
2609 .tuner_addr = ADDR_UNSET,
2610 .radio_addr = ADDR_UNSET,
2611 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2612 .has_radio = 1, /* not every card has radio */
2615 /* ---- card 0x80 ---------------------------------- */
2616 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2617 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2618 .name = "DViCO FusionHDTV DVB-T Lite",
2626 .tuner_type = UNSET,
2627 .tuner_addr = ADDR_UNSET,
2628 .radio_addr = ADDR_UNSET,
2630 [BTTV_BOARD_VGEAR_MYVCD] = {
2631 /* Steven <photon38@pchome.com.tw> */
2632 .name = "V-Gear MyVCD",
2638 .muxsel = {2, 3, 1, 0 },
2639 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2643 .tuner_type = TUNER_PHILIPS_NTSC_M,
2644 .tuner_addr = ADDR_UNSET,
2645 .radio_addr = ADDR_UNSET,
2648 [BTTV_BOARD_SUPER_TV] = {
2649 /* Rick C <cryptdragoon@gmail.com> */
2650 .name = "Super TV Tuner",
2655 .muxsel = { 2, 3, 1, 0 },
2656 .tuner_type = TUNER_PHILIPS_NTSC,
2657 .tuner_addr = ADDR_UNSET,
2658 .radio_addr = ADDR_UNSET,
2659 .gpiomask = 0x008007,
2660 .gpiomux = { 0, 0x000001,0,0 },
2664 [BTTV_BOARD_TIBET_CS16] = {
2665 /* Chris Fanning <video4linux@haydon.net> */
2666 .name = "Tibet Systems 'Progress DVR' CS16",
2671 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2676 .tuner_type = UNSET,
2677 .tuner_addr = ADDR_UNSET,
2678 .radio_addr = ADDR_UNSET,
2679 .muxsel_hook = tibetCS16_muxsel,
2681 [BTTV_BOARD_KODICOM_4400R] = {
2682 /* Bill Brack <wbrack@mmm.com.hk> */
2684 * Note that, because of the card's wiring, the "master"
2685 * BT878A chip (i.e. the one which controls the analog switch
2686 * and must use this card type) is the 2nd one detected. The
2687 * other 3 chips should use card type 0x85, whose description
2688 * follows this one. There is a EEPROM on the card (which is
2689 * connected to the I2C of one of those other chips), but is
2690 * not currently handled. There is also a facility for a
2691 * "monitor", which is also not currently implemented.
2693 .name = "Kodicom 4400R (master)",
2697 .tuner_type = UNSET,
2698 .tuner_addr = ADDR_UNSET,
2699 .radio_addr = ADDR_UNSET,
2701 /* GPIO bits 0-9 used for analog switch:
2702 * 00 - 03: camera selector
2703 * 04 - 06: channel (controller) selector
2704 * 07: data (1->on, 0->off)
2707 * bit 16 is input from sync separator for the channel
2709 .gpiomask = 0x0003ff,
2711 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2716 .muxsel_hook = kodicom4400r_muxsel,
2718 [BTTV_BOARD_KODICOM_4400R_SL] = {
2719 /* Bill Brack <wbrack@mmm.com.hk> */
2720 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2721 * one which controls the analog switch, and must use the card type)
2722 * is the 2nd one detected. The other 3 chips should use this card
2725 .name = "Kodicom 4400R (slave)",
2729 .tuner_type = UNSET,
2730 .tuner_addr = ADDR_UNSET,
2731 .radio_addr = ADDR_UNSET,
2733 .gpiomask = 0x010000,
2735 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2740 .muxsel_hook = kodicom4400r_muxsel,
2742 /* ---- card 0x86---------------------------------- */
2743 [BTTV_BOARD_ADLINK_RTV24] = {
2744 /* Michael Henson <mhenson@clarityvi.com> */
2745 /* Adlink RTV24 with special unlock codes */
2746 .name = "Adlink RTV24",
2751 .muxsel = { 2, 3, 1, 0 },
2752 .tuner_type = UNSET,
2753 .tuner_addr = ADDR_UNSET,
2754 .radio_addr = ADDR_UNSET,
2757 /* ---- card 0x87---------------------------------- */
2758 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2759 /* Michael Krufky <mkrufky@m1k.net> */
2760 .name = "DViCO FusionHDTV 5 Lite",
2762 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2763 .tuner_addr = ADDR_UNSET,
2764 .radio_addr = ADDR_UNSET,
2768 .muxsel = { 2, 3, 1 },
2769 .gpiomask = 0x00e00007,
2770 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2771 .gpiomute = 0x00c00007,
2777 /* ---- card 0x88---------------------------------- */
2778 [BTTV_BOARD_ACORP_Y878F] = {
2779 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2780 .name = "Acorp Y878F",
2785 .gpiomask = 0x01fe00,
2786 .muxsel = { 2, 3, 1, 1 },
2787 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2788 .gpiomute = 0x002000,
2791 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2792 .tuner_addr = 0xc1 >>1,
2793 .radio_addr = 0xc1 >>1,
2796 /* ---- card 0x89 ---------------------------------- */
2797 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2798 .name = "Conceptronic CTVFMi v2",
2803 .gpiomask = 0x001c0007,
2804 .muxsel = { 2, 3, 1, 1 },
2805 .gpiomux = { 0, 1, 2, 2 },
2809 .tuner_type = TUNER_TENA_9533_DI,
2810 .tuner_addr = ADDR_UNSET,
2811 .radio_addr = ADDR_UNSET,
2815 /* ---- card 0x8a ---------------------------------- */
2816 [BTTV_BOARD_PV_BT878P_2E] = {
2817 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2822 .gpiomask = 0x01fe00,
2823 .muxsel = { 2,3,1,1,-1 },
2824 .digital_mode = DIGITAL_MODE_CAMERA,
2825 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2826 .gpiomute = 0x12400,
2829 .tuner_type = TUNER_LG_PAL_FM,
2830 .tuner_addr = ADDR_UNSET,
2831 .radio_addr = ADDR_UNSET,
2834 /* ---- card 0x8b ---------------------------------- */
2835 [BTTV_BOARD_PV_M4900] = {
2836 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2837 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2843 .muxsel = { 2, 3, 1, 1 },
2844 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2848 .tuner_type = TUNER_YMEC_TVF_5533MF,
2849 .tuner_addr = ADDR_UNSET,
2850 .radio_addr = ADDR_UNSET,
2854 /* ---- card 0x8c ---------------------------------- */
2855 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2856 one external BNC composite input (mux 2)
2857 three internal composite inputs (unknown muxes)
2858 an 18-bit stereo A/D (CS5331A), which has:
2859 one external stereo unblanced (RCA) audio connection
2860 one (or 3?) internal stereo balanced (XLR) audio connection
2861 input is selected via gpio to a 14052B mux
2862 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2863 gain is controlled via an X9221A chip on the I2C bus @0x28
2864 sample rate is controlled via gpio to an MK1413S
2865 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2866 There is neither a tuner nor an svideo input. */
2867 [BTTV_BOARD_OSPREY440] = {
2868 .name = "Osprey 440",
2870 .audio_inputs = 2, /* this is meaningless */
2873 .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */
2875 .gpiomute = 0x000, /* int + 32kHz */
2876 .gpiomux = { 0, 0, 0x000, 0x100},
2878 .tuner_type = UNSET,
2879 .tuner_addr = ADDR_UNSET,
2880 .radio_addr = ADDR_UNSET,
2885 /* ---- card 0x8d ---------------------------------- */
2886 [BTTV_BOARD_ASOUND_SKYEYE] = {
2887 .name = "Asound Skyeye PCTV",
2893 .muxsel = { 2, 3, 1, 1 },
2894 .gpiomux = { 2, 0, 0, 0 },
2898 .tuner_type = TUNER_PHILIPS_NTSC,
2899 .tuner_addr = ADDR_UNSET,
2900 .radio_addr = ADDR_UNSET,
2902 /* ---- card 0x8e ---------------------------------- */
2903 [BTTV_BOARD_SABRENT_TVFM] = {
2904 .name = "Sabrent TV-FM (bttv version)",
2909 .gpiomask = 0x108007,
2910 .muxsel = { 2, 3, 1, 1 },
2911 .gpiomux = { 100000, 100002, 100002, 100000 },
2916 .tuner_type = TUNER_TNF_5335MF,
2917 .tuner_addr = ADDR_UNSET,
2920 /* ---- card 0x8f ---------------------------------- */
2921 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2922 .name = "Hauppauge ImpactVCB (bt878)",
2927 .gpiomask = 0x0f, /* old: 7 */
2928 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2932 .tuner_type = UNSET,
2933 .tuner_addr = ADDR_UNSET,
2934 .radio_addr = ADDR_UNSET,
2936 [BTTV_BOARD_MACHTV_MAGICTV] = {
2937 /* Julian Calaby <julian.calaby@gmail.com>
2938 * Slightly different from original MachTV definition (0x60)
2940 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2941 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2942 * properly (methinks) causing no keyup bits being set */
2944 .name = "MagicTV", /* rebranded MachTV */
2950 .muxsel = { 2, 3, 1, 1 },
2951 .gpiomux = { 0, 1, 2, 3 },
2953 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2954 .tuner_addr = ADDR_UNSET,
2955 .radio_addr = ADDR_UNSET,
2960 [BTTV_BOARD_SSAI_SECURITY] = {
2961 .name = "SSAI Security Video Interface",
2966 .muxsel = { 0, 1, 2, 3 },
2967 .tuner_type = UNSET,
2968 .tuner_addr = ADDR_UNSET,
2969 .radio_addr = ADDR_UNSET,
2971 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2972 .name = "SSAI Ultrasound Video Interface",
2977 .muxsel = { 2, 0, 1, 3 },
2978 .tuner_type = UNSET,
2979 .tuner_addr = ADDR_UNSET,
2980 .radio_addr = ADDR_UNSET,
2982 /* ---- card 0x94---------------------------------- */
2983 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2984 .name = "DViCO FusionHDTV 2",
2986 .tuner_type = TUNER_PHILIPS_FCV1236D,
2987 .tuner_addr = ADDR_UNSET,
2988 .radio_addr = ADDR_UNSET,
2992 .muxsel = { 2, 3, 1 },
2993 .gpiomask = 0x00e00007,
2994 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2995 .gpiomute = 0x00c00007,
3000 /* ---- card 0x95---------------------------------- */
3001 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
3002 .name = "Typhoon TV-Tuner PCI (50684)",
3007 .gpiomask = 0x3014f,
3008 .muxsel = { 2, 3, 1, 1 },
3009 .gpiomux = { 0x20001,0x10001, 0, 0 },
3013 .tuner_type = TUNER_PHILIPS_PAL_I,
3014 .tuner_addr = ADDR_UNSET,
3015 .radio_addr = ADDR_UNSET,
3017 [BTTV_BOARD_GEOVISION_GV600] = {
3019 .name = "Geovision GV-600",
3025 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
3026 2, 2, 2, 2, 2, 2, 2, 2 },
3027 .muxsel_hook = geovision_muxsel,
3031 .tuner_type = UNSET,
3032 .tuner_addr = ADDR_UNSET,
3033 .radio_addr = ADDR_UNSET,
3035 [BTTV_BOARD_KOZUMI_KTV_01C] = {
3036 /* Mauro Lacy <mauro@lacy.com.ar>
3037 * Based on MagicTV and Conceptronic CONTVFMi */
3039 .name = "Kozumi KTV-01C",
3044 .gpiomask = 0x008007,
3045 .muxsel = { 2, 3, 1, 1 },
3046 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
3047 .gpiomute = 3, /* CONTVFMi */
3049 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
3050 .tuner_addr = ADDR_UNSET,
3051 .radio_addr = ADDR_UNSET,
3056 [BTTV_BOARD_ENLTV_FM_2] = {
3057 /* Encore TV Tuner Pro ENL TV-FM-2
3058 Mauro Carvalho Chehab <mchehab@infradead.org */
3059 .name = "Encore ENL TV-FM-2",
3064 /* bit 6 -> IR disabled
3065 bit 18/17 = 00 -> mute
3066 01 -> enable external audio input
3067 10 -> internal audio input (mono?)
3068 11 -> internal audio input
3070 .gpiomask = 0x060040,
3071 .muxsel = { 2, 3, 3 },
3072 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
3074 .tuner_type = TUNER_TCL_MF02GIP_5N,
3075 .tuner_addr = ADDR_UNSET,
3076 .radio_addr = ADDR_UNSET,
3081 [BTTV_BOARD_VD012] = {
3082 /* D.Heer@Phytec.de */
3083 .name = "PHYTEC VD-012 (bt878)",
3086 .tuner = UNSET, /* card has no tuner */
3087 .svhs = UNSET, /* card has no s-video */
3089 .muxsel = { 0, 2, 3, 1 },
3090 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
3093 .tuner_type = UNSET,
3094 .tuner_addr = ADDR_UNSET,
3095 .radio_addr = ADDR_UNSET,
3097 [BTTV_BOARD_VD012_X1] = {
3098 /* D.Heer@Phytec.de */
3099 .name = "PHYTEC VD-012-X1 (bt878)",
3102 .tuner = UNSET, /* card has no tuner */
3105 .muxsel = { 2, 3, 1 },
3106 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
3109 .tuner_type = UNSET,
3110 .tuner_addr = ADDR_UNSET,
3111 .radio_addr = ADDR_UNSET,
3113 [BTTV_BOARD_VD012_X2] = {
3114 /* D.Heer@Phytec.de */
3115 .name = "PHYTEC VD-012-X2 (bt878)",
3118 .tuner = UNSET, /* card has no tuner */
3121 .muxsel = { 3, 2, 1 },
3122 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
3125 .tuner_type = UNSET,
3126 .tuner_addr = ADDR_UNSET,
3127 .radio_addr = ADDR_UNSET,
3131 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
3133 /* ----------------------------------------------------------------------- */
3135 static unsigned char eeprom_data[256];
3140 void __devinit bttv_idcard(struct bttv *btv)
3142 unsigned int gpiobits;
3146 /* read PCI subsystem ID */
3147 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
3148 btv->cardid = tmp << 16;
3149 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
3152 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
3153 /* look for the card */
3154 for (type = -1, i = 0; cards[i].id != 0; i++)
3155 if (cards[i].id == btv->cardid)
3160 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
3161 "PCI subsystem ID is %04x:%04x\n",
3162 btv->c.nr,cards[type].name,cards[type].cardnr,
3163 btv->cardid & 0xffff,
3164 (btv->cardid >> 16) & 0xffff);
3165 btv->c.type = cards[type].cardnr;
3168 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
3169 btv->c.nr, btv->cardid & 0xffff,
3170 (btv->cardid >> 16) & 0xffff);
3171 printk(KERN_DEBUG "please mail id, board name and "
3172 "the correct card= insmod option to video4linux-list@redhat.com\n");
3176 /* let the user override the autodetected type */
3177 if (card[btv->c.nr] < bttv_num_tvcards)
3178 btv->c.type=card[btv->c.nr];
3180 /* print which card config we are using */
3181 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
3182 bttv_tvcards[btv->c.type].name, btv->c.type,
3183 card[btv->c.nr] < bttv_num_tvcards
3184 ? "insmod option" : "autodetected");
3186 /* overwrite gpio stuff ?? */
3187 if (UNSET == audioall && UNSET == audiomux[0])
3190 if (UNSET != audiomux[0]) {
3192 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3193 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
3194 gpiobits |= audiomux[i];
3197 gpiobits = audioall;
3198 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3199 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
3202 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3203 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3204 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
3205 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3206 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
3212 * (most) board specific initialisations goes here
3215 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
3216 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3220 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
3221 type = BTTV_BOARD_MODTEC_205;
3222 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
3223 type = BTTV_BOARD_EURESYS_PICOLO;
3224 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
3225 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
3229 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3230 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3234 static void flyvideo_gpio(struct bttv *btv)
3236 int gpio, has_remote, has_radio, is_capture_only;
3237 int is_lr90, has_tda9820_tda9821;
3238 int tuner_type = UNSET, ttype;
3240 gpio_inout(0xffffff, 0);
3241 udelay(8); /* without this we would see the 0x1800 mask */
3243 /* FIXME: must restore OUR_EN ??? */
3245 /* all cards provide GPIO info, some have an additional eeprom
3246 * LR50: GPIO coding can be found lower right CP1 .. CP9
3247 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3249 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3251 * lowest 3 bytes are remote control codes (no handshake needed)
3252 * xxxFFF: No remote control chip soldered
3253 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3254 * Note: Some bits are Audio_Mask !
3256 ttype = (gpio & 0x0f0000) >> 16;
3259 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3262 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3265 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3268 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3271 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3274 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3278 has_remote = gpio & 0x800000;
3279 has_radio = gpio & 0x400000;
3280 /* unknown 0x200000;
3281 * unknown2 0x100000; */
3282 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3283 has_tda9820_tda9821 = !(gpio & 0x004000);
3284 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3286 * gpio & 0x001000 output bit for audio routing */
3288 if (is_capture_only)
3289 tuner_type = TUNER_ABSENT; /* No tuner present */
3291 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3292 btv->c.nr, has_radio ? "yes" : "no ",
3293 has_remote ? "yes" : "no ", tuner_type, gpio);
3294 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3295 btv->c.nr, is_lr90 ? "yes" : "no ",
3296 has_tda9820_tda9821 ? "yes" : "no ",
3297 is_capture_only ? "yes" : "no ");
3299 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3300 btv->tuner_type = tuner_type;
3301 btv->has_radio = has_radio;
3303 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3304 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3305 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3306 if (has_tda9820_tda9821)
3307 btv->audio_mode_gpio = lt9415_audio;
3308 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3311 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3312 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3313 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3314 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3316 static void miro_pinnacle_gpio(struct bttv *btv)
3321 gpio_inout(0xffffff, 0);
3323 id = ((gpio>>10) & 63) -1;
3324 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3326 btv->tuner_type = miro_tunermap[id];
3327 if (0 == (gpio & 0x20)) {
3329 if (!miro_fmtuner[id]) {
3330 btv->has_matchbox = 1;
3331 btv->mbox_we = (1<<6);
3332 btv->mbox_most = (1<<7);
3333 btv->mbox_clk = (1<<8);
3334 btv->mbox_data = (1<<9);
3335 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3341 if (btv->c.type == BTTV_BOARD_MIRO)
3342 btv->c.type = BTTV_BOARD_MIROPRO;
3343 if (btv->c.type == BTTV_BOARD_PINNACLE)
3344 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3347 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3348 btv->c.nr, id+1, btv->tuner_type,
3349 !btv->has_radio ? "no" :
3350 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3351 (-1 == msp) ? "no" : "yes");
3353 /* new cards with microtune tuner */
3358 info = "PAL / mono";
3359 btv->tda9887_conf = TDA9887_INTERCARRIER;
3362 info = "PAL+SECAM / stereo";
3364 btv->tda9887_conf = TDA9887_QSS;
3367 info = "NTSC / stereo";
3369 btv->tda9887_conf = TDA9887_QSS;
3372 info = "PAL+SECAM / mono";
3373 btv->tda9887_conf = TDA9887_QSS;
3376 info = "NTSC / mono";
3377 btv->tda9887_conf = TDA9887_INTERCARRIER;
3380 info = "NTSC / stereo";
3381 btv->tda9887_conf = TDA9887_INTERCARRIER;
3384 info = "PAL / stereo";
3385 btv->tda9887_conf = TDA9887_INTERCARRIER;
3388 info = "oops: unknown card";
3392 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3394 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3395 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3396 btv->tuner_type = TUNER_MT2032;
3400 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3401 #define LM1882_SYNC_DRIVE 0x200000L
3403 static void init_ids_eagle(struct bttv *btv)
3405 gpio_inout(0xffffff,0xFFFF37);
3406 gpio_write(0x200020);
3408 /* flash strobe inverter ?! */
3409 gpio_write(0x200024);
3411 /* switch sync drive off */
3412 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3414 /* set BT848 muxel to 2 */
3415 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3418 /* Muxsel helper for the IDS Eagle.
3419 * the eagles does not use the standard muxsel-bits but
3420 * has its own multiplexer */
3421 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3423 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3424 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3427 /* set chroma ADC to sleep */
3428 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3429 /* set to composite video */
3430 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3431 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3433 /* switch sync drive off */
3434 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3437 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3439 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3440 gpio_write(masks[input%4]);
3443 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3446 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3447 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3449 IN - sensor inputs, INx - sensor inputs and TI XORed together
3450 O1,O2,O3 - alarm outputs (relays)
3452 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3456 static void init_lmlbt4x(struct bttv *btv)
3458 printk(KERN_DEBUG "LMLBT4x init\n");
3459 btwrite(0x000000, BT848_GPIO_REG_INP);
3460 gpio_inout(0xffffff, 0x0006C0);
3461 gpio_write(0x000000);
3464 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3466 unsigned int inmux = input % 8;
3467 gpio_inout( 0xf, 0xf );
3468 gpio_bits( 0xf, inmux );
3471 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3473 unsigned int inmux = input % 4;
3474 gpio_inout( 3<<9, 3<<9 );
3475 gpio_bits( 3<<9, inmux<<9 );
3478 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3480 unsigned int inmux = input % 16;
3481 gpio_inout(0xf, 0xf);
3482 gpio_bits(0xf, inmux);
3485 /* ----------------------------------------------------------------------- */
3487 static void bttv_reset_audio(struct bttv *btv)
3490 * BT878A has a audio-reset register.
3491 * 1. This register is an audio reset function but it is in
3492 * function-0 (video capture) address space.
3493 * 2. It is enough to do this once per power-up of the card.
3494 * 3. There is a typo in the Conexant doc -- it is not at
3495 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3496 * --//Shrikumar 030609
3502 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3503 btwrite((1<<7), 0x058);
3508 /* initialization part one -- before registering i2c bus */
3509 void __devinit bttv_init_card1(struct bttv *btv)
3511 switch (btv->c.type) {
3512 case BTTV_BOARD_HAUPPAUGE:
3513 case BTTV_BOARD_HAUPPAUGE878:
3514 boot_msp34xx(btv,5);
3516 case BTTV_BOARD_VOODOOTV_200:
3517 case BTTV_BOARD_VOODOOTV_FM:
3518 boot_msp34xx(btv,20);
3520 case BTTV_BOARD_AVERMEDIA98:
3521 boot_msp34xx(btv,11);
3523 case BTTV_BOARD_HAUPPAUGEPVR:
3526 case BTTV_BOARD_TWINHAN_DST:
3527 case BTTV_BOARD_AVDVBT_771:
3528 case BTTV_BOARD_PINNACLESAT:
3529 btv->use_i2c_hw = 1;
3531 case BTTV_BOARD_ADLINK_RTV24:
3536 if (!bttv_tvcards[btv->c.type].has_dvb)
3537 bttv_reset_audio(btv);
3540 /* initialization part two -- after registering i2c bus */
3541 void __devinit bttv_init_card2(struct bttv *btv)
3543 int addr=ADDR_UNSET;
3545 btv->tuner_type = UNSET;
3547 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3548 bttv_readee(btv,eeprom_data,0xa0);
3549 identify_by_eeprom(btv,eeprom_data);
3552 switch (btv->c.type) {
3553 case BTTV_BOARD_MIRO:
3554 case BTTV_BOARD_MIROPRO:
3555 case BTTV_BOARD_PINNACLE:
3556 case BTTV_BOARD_PINNACLEPRO:
3558 miro_pinnacle_gpio(btv);
3560 case BTTV_BOARD_FLYVIDEO_98:
3561 case BTTV_BOARD_MAXI:
3562 case BTTV_BOARD_LIFE_FLYKIT:
3563 case BTTV_BOARD_FLYVIDEO:
3564 case BTTV_BOARD_TYPHOON_TVIEW:
3565 case BTTV_BOARD_CHRONOS_VS2:
3566 case BTTV_BOARD_FLYVIDEO_98FM:
3567 case BTTV_BOARD_FLYVIDEO2000:
3568 case BTTV_BOARD_FLYVIDEO98EZ:
3569 case BTTV_BOARD_CONFERENCETV:
3570 case BTTV_BOARD_LIFETEC_9415:
3573 case BTTV_BOARD_HAUPPAUGE:
3574 case BTTV_BOARD_HAUPPAUGE878:
3575 case BTTV_BOARD_HAUPPAUGEPVR:
3576 /* pick up some config infos from the eeprom */
3577 bttv_readee(btv,eeprom_data,0xa0);
3578 hauppauge_eeprom(btv);
3580 case BTTV_BOARD_AVERMEDIA98:
3581 case BTTV_BOARD_AVPHONE98:
3582 bttv_readee(btv,eeprom_data,0xa0);
3583 avermedia_eeprom(btv);
3585 case BTTV_BOARD_PXC200:
3588 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3589 picolo_tetra_init(btv);
3591 case BTTV_BOARD_VHX:
3593 btv->has_matchbox = 1;
3594 btv->mbox_we = 0x20;
3596 btv->mbox_clk = 0x08;
3597 btv->mbox_data = 0x10;
3598 btv->mbox_mask = 0x38;
3600 case BTTV_BOARD_VOBIS_BOOSTAR:
3601 case BTTV_BOARD_TERRATV:
3602 terratec_active_radio_upgrade(btv);
3604 case BTTV_BOARD_MAGICTVIEW061:
3605 if (btv->cardid == 0x3002144f) {
3607 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3610 case BTTV_BOARD_STB2:
3611 if (btv->cardid == 0x3060121a) {
3612 /* Fix up entry for 3DFX VoodooTV 100,
3613 which is an OEM STB card variant. */
3615 btv->tuner_type=TUNER_TEMIC_NTSC;
3618 case BTTV_BOARD_OSPREY1x0:
3619 case BTTV_BOARD_OSPREY1x0_848:
3620 case BTTV_BOARD_OSPREY101_848:
3621 case BTTV_BOARD_OSPREY1x1:
3622 case BTTV_BOARD_OSPREY1x1_SVID:
3623 case BTTV_BOARD_OSPREY2xx:
3624 case BTTV_BOARD_OSPREY2x0_SVID:
3625 case BTTV_BOARD_OSPREY2x0:
3626 case BTTV_BOARD_OSPREY440:
3627 case BTTV_BOARD_OSPREY500:
3628 case BTTV_BOARD_OSPREY540:
3629 case BTTV_BOARD_OSPREY2000:
3630 bttv_readee(btv,eeprom_data,0xa0);
3631 osprey_eeprom(btv, eeprom_data);
3633 case BTTV_BOARD_IDS_EAGLE:
3634 init_ids_eagle(btv);
3636 case BTTV_BOARD_MODTEC_205:
3637 bttv_readee(btv,eeprom_data,0xa0);
3640 case BTTV_BOARD_LMLBT4:
3643 case BTTV_BOARD_TIBET_CS16:
3644 tibetCS16_init(btv);
3646 case BTTV_BOARD_KODICOM_4400R:
3647 kodicom4400r_init(btv);
3651 /* pll configuration */
3652 if (!(btv->id==848 && btv->revision==0x11)) {
3653 /* defaults from card list */
3654 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3655 btv->pll.pll_ifreq=28636363;
3656 btv->pll.pll_crystal=BT848_IFORM_XT0;
3658 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3659 btv->pll.pll_ifreq=35468950;
3660 btv->pll.pll_crystal=BT848_IFORM_XT1;
3662 /* insmod options can override */
3663 switch (pll[btv->c.nr]) {
3665 btv->pll.pll_crystal = 0;
3666 btv->pll.pll_ifreq = 0;
3667 btv->pll.pll_ofreq = 0;
3669 case 1: /* 28 MHz */
3671 btv->pll.pll_ifreq = 28636363;
3672 btv->pll.pll_ofreq = 0;
3673 btv->pll.pll_crystal = BT848_IFORM_XT0;
3675 case 2: /* 35 MHz */
3677 btv->pll.pll_ifreq = 35468950;
3678 btv->pll.pll_ofreq = 0;
3679 btv->pll.pll_crystal = BT848_IFORM_XT1;
3683 btv->pll.pll_current = -1;
3685 /* tuner configuration (from card list / autodetect / insmod option) */
3686 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3687 addr = bttv_tvcards[btv->c.type].tuner_addr;
3689 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3690 if(UNSET == btv->tuner_type)
3691 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3692 if (UNSET != tuner[btv->c.nr])
3693 btv->tuner_type = tuner[btv->c.nr];
3695 if (btv->tuner_type == TUNER_ABSENT ||
3696 bttv_tvcards[btv->c.type].tuner == UNSET)
3697 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3698 else if(btv->tuner_type == UNSET)
3699 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3701 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3704 if (btv->tuner_type != UNSET) {
3705 struct tuner_setup tun_setup;
3707 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3708 tun_setup.type = btv->tuner_type;
3709 tun_setup.addr = addr;
3711 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3714 if (btv->tda9887_conf) {
3715 struct v4l2_priv_tun_config tda9887_cfg;
3717 tda9887_cfg.tuner = TUNER_TDA9887;
3718 tda9887_cfg.priv = &btv->tda9887_conf;
3720 bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
3723 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3724 if (svhs[btv->c.nr] != UNSET)
3725 btv->svhs = svhs[btv->c.nr];
3726 if (remote[btv->c.nr] != UNSET)
3727 btv->has_remote = remote[btv->c.nr];
3729 if (bttv_tvcards[btv->c.type].has_radio)
3731 if (bttv_tvcards[btv->c.type].has_remote)
3733 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3735 if (bttv_tvcards[btv->c.type].volume_gpio)
3736 btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio;
3737 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3738 btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio;
3743 if (bttv_tvcards[btv->c.type].tuner == UNSET)
3744 return; /* no tuner or related drivers to load */
3746 /* try to detect audio/fader chips */
3747 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3748 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3749 request_module("msp3400");
3751 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3752 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3753 request_module("msp3400");
3755 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3756 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3757 request_module("tda9875");
3759 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3760 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3761 request_module("tda7432");
3763 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3764 request_module("tvaudio");
3766 if (btv->tuner_type != UNSET && btv->tuner_type != TUNER_ABSENT)
3767 request_module("tuner");
3771 /* ----------------------------------------------------------------------- */
3773 static void modtec_eeprom(struct bttv *btv)
3775 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3776 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3777 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3778 btv->c.nr,&eeprom_data[0x1e]);
3779 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3780 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3781 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3782 btv->c.nr,&eeprom_data[0x1e]);
3783 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3784 btv->tuner_type=TUNER_PHILIPS_NTSC;
3785 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3786 btv->c.nr,&eeprom_data[0x1e]);
3788 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3789 btv->c.nr,&eeprom_data[0x1e]);
3793 static void __devinit hauppauge_eeprom(struct bttv *btv)
3797 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3798 btv->tuner_type = tv.tuner_type;
3799 btv->has_radio = tv.has_radio;
3801 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3802 btv->c.nr, tv.model);
3805 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3806 * type based on model #.
3808 if(tv.model == 64900) {
3809 printk("bttv%d: Switching board type from %s to %s\n",
3811 bttv_tvcards[btv->c.type].name,
3812 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3813 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3817 static int terratec_active_radio_upgrade(struct bttv *btv)
3822 btv->has_matchbox = 1;
3823 btv->mbox_we = 0x10;
3824 btv->mbox_most = 0x20;
3825 btv->mbox_clk = 0x08;
3826 btv->mbox_data = 0x04;
3827 btv->mbox_mask = 0x3c;
3829 btv->mbox_iow = 1 << 8;
3830 btv->mbox_ior = 1 << 9;
3831 btv->mbox_csel = 1 << 10;
3834 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3835 if (0x1ed8 == tea5757_read(btv)) {
3836 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3839 btv->has_matchbox = 1;
3842 btv->has_matchbox = 0;
3848 /* ----------------------------------------------------------------------- */
3851 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3853 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3854 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3855 * unpacked with unzip).
3857 #define PVR_GPIO_DELAY 10
3859 #define BTTV_ALT_DATA 0x000001
3860 #define BTTV_ALT_DCLK 0x100000
3861 #define BTTV_ALT_NCONFIG 0x800000
3863 static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3870 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3872 udelay(PVR_GPIO_DELAY);
3874 gpio_write(BTTV_ALT_NCONFIG);
3875 udelay(PVR_GPIO_DELAY);
3877 for (n = 0; n < microlen; n++) {
3879 for (i = 0 ; i < 8 ; i++) {
3880 gpio_bits(BTTV_ALT_DCLK,0);
3882 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3884 gpio_bits(BTTV_ALT_DATA,0);
3885 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3889 gpio_bits(BTTV_ALT_DCLK,0);
3890 udelay(PVR_GPIO_DELAY);
3892 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3893 for (i = 0 ; i < 30 ; i++) {
3894 gpio_bits(BTTV_ALT_DCLK,0);
3895 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3897 gpio_bits(BTTV_ALT_DCLK,0);
3901 static int __devinit pvr_boot(struct bttv *btv)
3903 const struct firmware *fw_entry;
3906 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3908 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3912 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3913 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3914 btv->c.nr, (rc < 0) ? "failed" : "ok");
3915 release_firmware(fw_entry);
3919 /* ----------------------------------------------------------------------- */
3920 /* some osprey specific stuff */
3922 static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3928 /* This code will nevery actually get called in this case.... */
3929 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3930 /* this might be an antique... check for MMAC label in eeprom */
3931 if (!strncmp(ee, "MMAC", 4)) {
3933 for (i = 0; i < 21; i++)
3935 if (checksum != ee[21])
3937 cardid = BTTV_BOARD_OSPREY1x0_848;
3938 for (i = 12; i < 21; i++)
3939 serial *= 10, serial += ee[i] - '0';
3942 unsigned short type;
3944 for (i = 4*16; i < 8*16; i += 16) {
3945 u16 checksum = ip_compute_csum(ee + i, 16);
3947 if ((checksum&0xff) + (checksum>>8) == 0xff)
3954 /* found a valid descriptor */
3955 type = get_unaligned_be16((__be16 *)(ee+4));
3960 cardid = BTTV_BOARD_OSPREY1x0_848;
3963 cardid = BTTV_BOARD_OSPREY101_848;
3969 cardid = BTTV_BOARD_OSPREY1x0;
3973 cardid = BTTV_BOARD_OSPREY1x1;
3978 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3984 cardid = BTTV_BOARD_OSPREY2xx;
3988 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3991 cardid = BTTV_BOARD_OSPREY500;
3995 cardid = BTTV_BOARD_OSPREY540;
3996 /* bttv_osprey_540_init(btv); */
4001 cardid = BTTV_BOARD_OSPREY2x0;
4002 /* enable output on select control lines */
4003 gpio_inout(0xffffff,0x000303);
4006 cardid = BTTV_BOARD_OSPREY440;
4009 /* unknown...leave generic, but get serial # */
4010 printk(KERN_INFO "bttv%d: "
4011 "osprey eeprom: unknown card type 0x%04x\n",
4015 serial = get_unaligned_be32((__be32 *)(ee+6));
4018 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
4020 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
4022 if (cardid<0 || btv->c.type == cardid)
4025 /* card type isn't set correctly */
4026 if (card[btv->c.nr] < bttv_num_tvcards) {
4027 printk(KERN_WARNING "bttv%d: osprey eeprom: "
4028 "Not overriding user specified card type\n", btv->c.nr);
4030 printk(KERN_INFO "bttv%d: osprey eeprom: "
4031 "Changing card type from %d to %d\n", btv->c.nr,
4032 btv->c.type, cardid);
4033 btv->c.type = cardid;
4037 /* ----------------------------------------------------------------------- */
4038 /* AVermedia specific stuff, from bktr_card.c */
4040 static int tuner_0_table[] = {
4041 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
4042 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
4043 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
4044 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
4045 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
4046 TUNER_PHILIPS_FM1216ME_MK3 };
4048 static int tuner_1_table[] = {
4049 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
4050 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4051 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4052 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
4053 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
4055 static void __devinit avermedia_eeprom(struct bttv *btv)
4057 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
4059 tuner_make = (eeprom_data[0x41] & 0x7);
4060 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
4061 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
4062 btv->has_remote = (eeprom_data[0x42] & 0x01);
4064 if (tuner_make == 0 || tuner_make == 2)
4065 if (tuner_format <= 0x0a)
4066 tuner_type = tuner_0_table[tuner_format];
4067 if (tuner_make == 1)
4068 if (tuner_format <= 9)
4069 tuner_type = tuner_1_table[tuner_format];
4071 if (tuner_make == 4)
4072 if (tuner_format == 0x09)
4073 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
4075 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
4076 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
4078 btv->tuner_type = tuner_type;
4079 printk(KERN_CONT "%d", tuner_type);
4081 printk(KERN_CONT "Unknown type");
4082 printk(KERN_CONT " radio:%s remote control:%s\n",
4083 tuner_tv_fm ? "yes" : "no",
4084 btv->has_remote ? "yes" : "no");
4088 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
4089 * analog demod, which is not I2C controlled like the newer and more common
4090 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
4091 * that control the IF for the video and audio. Apparently, bttv GPIO
4092 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
4093 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
4095 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
4098 if (btv->audio == TVAUDIO_INPUT_TUNER) {
4099 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
4100 gpiobits |= 0x10000;
4102 gpiobits &= ~0x10000;
4105 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
4111 * reset/enable the MSP on some Hauppauge cards
4112 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
4117 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
4119 int mask = (1 << pin);
4121 gpio_inout(mask,mask);
4125 gpio_bits(mask,mask);
4128 bttv_gpio_tracking(btv,"msp34xx");
4130 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
4131 "init [%d]\n", btv->c.nr, pin);
4134 /* ----------------------------------------------------------------------- */
4135 /* Imagenation L-Model PXC200 Framegrabber */
4136 /* This is basically the same procedure as
4137 * used by Alessandro Rubini in his pxc200
4138 * driver, but using BTTV functions */
4140 static void __devinit init_PXC200(struct bttv *btv)
4142 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
4143 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
4149 /* Initialise GPIO-connevted stuff */
4150 gpio_inout(0xffffff, (1<<13));
4154 /* GPIO inputs are pulled up, so no need to drive
4155 * reset pin any longer */
4156 gpio_bits(0xffffff, 0);
4158 bttv_gpio_tracking(btv,"pxc200");
4160 /* we could/should try and reset/control the AD pots? but
4161 right now we simply turned off the crushing. Without
4162 this the AGC drifts drifts
4163 remember the EN is reverse logic -->
4164 setting BT848_ADC_AGC_EN disable the AGC
4165 tboult@eecs.lehigh.edu
4168 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4170 /* Initialise MAX517 DAC */
4171 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
4172 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4174 /* Initialise 12C508 PIC */
4175 /* The I2CWrite and I2CRead commmands are actually to the
4176 * same chips - but the R/W bit is included in the address
4177 * argument so the numbers are different */
4180 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
4182 /* First of all, enable the clock line. This is used in the PXC200-F */
4183 val = btread(BT848_GPIO_DMA_CTL);
4184 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4185 btwrite(val, BT848_GPIO_DMA_CTL);
4187 /* Then, push to 0 the reset pin long enough to reset the *
4188 * device same as above for the reset line, but not the same
4189 * value sent to the GPIO-connected stuff
4190 * which one is the good one? */
4191 gpio_inout(0xffffff,(1<<2));
4196 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4197 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4200 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4201 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4205 printk(KERN_INFO "PXC200 Initialised.\n");
4210 /* ----------------------------------------------------------------------- */
4212 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4213 * it. This apparently involves the following procedure for each 878 chip:
4215 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4217 * 2) write to GPIO_DATA
4223 * read from GPIO_DATA into buf (uint_32)
4224 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4225 * error. ERROR_CPLD_Check_Failed stop.
4227 * 3) write to GPIO_DATA
4228 * - write 0x4400 + 0x0E
4230 * - write 0x4410 + 0x0E
4233 * read from GPIO_DATA into buf (uint_32)
4234 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4235 * error. ERROR_CPLD_Check_Failed.
4237 /* ----------------------------------------------------------------------- */
4239 init_RTV24 (struct bttv *btv)
4241 uint32_t dataRead = 0;
4242 long watchdog_value = 0x0E;
4245 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
4248 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4250 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4252 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4254 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4256 dataRead = btread (BT848_GPIO_DATA);
4258 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4260 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4261 btv->c.nr, dataRead);
4264 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4266 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4268 btwrite (watchdog_value, BT848_GPIO_DATA);
4270 dataRead = btread (BT848_GPIO_DATA);
4272 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4274 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4275 btv->c.nr, dataRead);
4281 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4286 /* ----------------------------------------------------------------------- */
4287 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4289 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4290 * This code is placed under the terms of the GNU General Public License
4292 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4295 static void bus_low(struct bttv *btv, int bit)
4297 if (btv->mbox_ior) {
4298 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4299 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4306 if (btv->mbox_ior) {
4307 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4312 static void bus_high(struct bttv *btv, int bit)
4314 if (btv->mbox_ior) {
4315 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4316 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4323 if (btv->mbox_ior) {
4324 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4329 static int bus_in(struct bttv *btv, int bit)
4331 if (btv->mbox_ior) {
4332 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4333 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4336 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4339 return gpio_read() & (bit);
4342 /* TEA5757 register bits */
4343 #define TEA_FREQ 0:14
4344 #define TEA_BUFFER 15:15
4346 #define TEA_SIGNAL_STRENGTH 16:17
4348 #define TEA_PORT1 18:18
4349 #define TEA_PORT0 19:19
4351 #define TEA_BAND 20:21
4352 #define TEA_BAND_FM 0
4353 #define TEA_BAND_MW 1
4354 #define TEA_BAND_LW 2
4355 #define TEA_BAND_SW 3
4357 #define TEA_MONO 22:22
4358 #define TEA_ALLOW_STEREO 0
4359 #define TEA_FORCE_MONO 1
4361 #define TEA_SEARCH_DIRECTION 23:23
4362 #define TEA_SEARCH_DOWN 0
4363 #define TEA_SEARCH_UP 1
4365 #define TEA_STATUS 24:24
4366 #define TEA_STATUS_TUNED 0
4367 #define TEA_STATUS_SEARCHING 1
4369 /* Low-level stuff */
4370 static int tea5757_read(struct bttv *btv)
4372 unsigned long timeout;
4376 /* better safe than sorry */
4377 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4379 if (btv->mbox_ior) {
4380 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4381 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4386 bttv_gpio_tracking(btv,"tea5757 read");
4388 bus_low(btv,btv->mbox_we);
4389 bus_low(btv,btv->mbox_clk);
4392 timeout= jiffies + msecs_to_jiffies(1000);
4394 /* wait for DATA line to go low; error if it doesn't */
4395 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4397 if (bus_in(btv,btv->mbox_data)) {
4398 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4402 dprintk("bttv%d: tea5757:",btv->c.nr);
4403 for (i = 0; i < 24; i++) {
4405 bus_high(btv,btv->mbox_clk);
4407 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4408 bus_low(btv,btv->mbox_clk);
4410 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4411 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4413 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4417 static int tea5757_write(struct bttv *btv, int value)
4422 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4424 if (btv->mbox_ior) {
4425 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4426 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4430 bttv_gpio_tracking(btv,"tea5757 write");
4432 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4433 bus_low(btv,btv->mbox_clk);
4434 bus_high(btv,btv->mbox_we);
4435 for (i = 0; i < 25; i++) {
4436 if (reg & 0x1000000)
4437 bus_high(btv,btv->mbox_data);
4439 bus_low(btv,btv->mbox_data);
4441 bus_high(btv,btv->mbox_clk);
4443 bus_low(btv,btv->mbox_clk);
4446 bus_low(btv,btv->mbox_we); /* unmute !!! */
4450 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4452 dprintk("tea5757_set_freq %d\n",freq);
4453 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4456 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4458 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4459 * switch instead (CD22M3494E). This IC can have multiple active connections
4460 * between Xn (input) and Yn (output) pins. We need to clear any existing
4461 * connection prior to establish a new one, pulsing the STROBE pin.
4463 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4464 * GPIO pins are wired as:
4465 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4466 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4467 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4468 * GPIO[8] - - P3[5] (microcontroller)
4469 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4470 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4471 * GPINTR - - P3[4] (microcontroller)
4473 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4474 * configuration either directly (as we are doing) or using the microcontroller
4475 * which is also wired to I2C interface. I have no further info on the
4476 * microcontroller features, one would need to disassembly the firmware.
4477 * note: the vendor refused to give any information on this product, all
4478 * that stuff was found using a multimeter! :)
4480 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4482 /* reset all conections */
4483 gpio_bits(0x200,0x200);
4485 gpio_bits(0x200,0x000);
4488 /* create a new connection */
4489 gpio_bits(0x480,0x080);
4490 gpio_bits(0x480,0x480);
4492 gpio_bits(0x480,0x080);
4496 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4498 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4499 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4500 * chips, ten eight input analog multiplexors, a not chip and a few
4503 * 16 inputs on a secondary bracket are provided and can be selected
4504 * from each of the four capture chips. Two of the eight input
4505 * multiplexors are used to select from any of the 16 input signals.
4507 * Unsupported hardware capabilities:
4508 * . A video output monitor on the secondary bracket can be selected from
4509 * one of the 878A chips.
4510 * . Another passthrough but I haven't spent any time investigating it.
4511 * . Digital I/O (logic level connected to GPIO) is available from an
4514 * The on chip input mux should always be set to 2.
4515 * GPIO[16:19] - Video input selection
4516 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4517 * GPIO[?:?] - Digital I/O.
4519 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4520 * determined what function (if any) it provides. With the microcontroller
4521 * and sync seperator chips a guess is that it might have to do with video
4522 * switching and maybe some digital I/O.
4524 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4527 gpio_bits(0x0f0000, input << 16);
4530 static void tibetCS16_init(struct bttv *btv)
4532 /* enable gpio bits, mask obtained via btSpy */
4533 gpio_inout(0xffffff, 0x0f7fff);
4534 gpio_write(0x0f7fff);
4538 * The following routines for the Kodicom-4400r get a little mind-twisting.
4539 * There is a "master" controller and three "slave" controllers, together
4540 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4541 * The analog switch is controlled by the "master", but the detection order
4542 * of the four BT878A chips is in an order which I just don't understand.
4543 * The "master" is actually the second controller to be detected. The
4544 * logic on the board uses logical numbers for the 4 controllers, but
4545 * those numbers are different from the detection sequence. When working
4546 * with the analog switch, we need to "map" from the detection sequence
4547 * over to the board's logical controller number. This mapping sequence
4548 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4549 * unit 3, the second (which is the master) is logical unit 0, etc.
4550 * We need to maintain the status of the analog switch (which of the 16
4551 * cameras is connected to which of the 4 controllers). Rather than
4552 * add to the bttv structure for this, we use the data reserved for
4553 * the mbox (unused for this card type).
4557 * First a routine to set the analog switch, which controls which camera
4558 * is routed to which controller. The switch comprises an X-address
4559 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4560 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4561 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4562 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4563 * specified address. The idea is to set the address and data, then bring
4564 * STROBE high, and finally bring STROBE back to low.
4566 static void kodicom4400r_write(struct bttv *btv,
4567 unsigned char xaddr,
4568 unsigned char yaddr,
4569 unsigned char data) {
4572 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4573 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4574 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4575 gpio_bits(0x1ff, udata); /* strobe low */
4579 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4580 * use this routine. The routine finds the "master" for the card, maps
4581 * the controller number from the detected position over to the logical
4582 * number, writes the appropriate data to the analog switch, and housekeeps
4583 * the local copy of the switch information. The parameter 'input' is the
4584 * requested camera number (0 - 15).
4586 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4591 static unsigned char map[4] = {3, 0, 2, 1};
4593 mctlr = master[btv->c.nr];
4594 if (mctlr == NULL) { /* ignore if master not yet detected */
4597 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4599 sw_status = (char *)(&mctlr->mbox_we);
4600 xaddr = input & 0xf;
4601 /* Check if the controller/camera pair has changed, else ignore */
4602 if (sw_status[yaddr] != xaddr)
4604 /* "open" the old switch, "close" the new one, save the new */
4605 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4606 sw_status[yaddr] = xaddr;
4607 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4612 * During initialisation, we need to reset the analog switch. We
4613 * also preset the switch to map the 4 connectors on the card to the
4614 * *user's* (see above description of kodicom4400r_muxsel) channels
4617 static void kodicom4400r_init(struct bttv *btv)
4619 char *sw_status = (char *)(&btv->mbox_we);
4622 gpio_inout(0x0003ff, 0x0003ff);
4623 gpio_write(1 << 9); /* reset MUX */
4625 /* Preset camera 0 to the 4 controllers */
4626 for (ix = 0; ix < 4; ix++) {
4628 kodicom4400r_write(btv, ix, ix, 1);
4631 * Since this is the "master", we need to set up the
4632 * other three controller chips' pointers to this structure
4633 * for later use in the muxsel routine.
4635 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4637 master[btv->c.nr-1] = btv;
4638 master[btv->c.nr] = btv;
4639 master[btv->c.nr+1] = btv;
4640 master[btv->c.nr+2] = btv;
4643 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4644 * video multiplexers to provide up to 16 video inputs. These
4645 * multiplexers are controlled by the lower 8 GPIO pins of the
4646 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4648 * xxx0 is pin xxx of multiplexer U5,
4649 * yyy1 is pin yyy of multiplexer U2
4661 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4663 static const int masks[] = {
4664 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4665 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4666 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4667 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4669 gpio_write(masks[input%16]);
4671 static void picolo_tetra_init(struct bttv *btv)
4673 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4674 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4675 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4677 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4680 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4681 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4682 /*GPIO[20]&GPIO[21] used to choose the right input*/
4683 btwrite (input<<20,BT848_GPIO_DATA);
4688 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4690 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4691 * swichers to provide 16 channels to MUX0. The TDA8540's have
4692 * 4 independent outputs and as such the IVC120G also has the
4693 * optional "Monitor Out" bus. This allows the card to be looking
4694 * at one input while the monitor is looking at another.
4696 * Since I've couldn't be bothered figuring out how to add an
4697 * independant muxsel for the monitor bus, I've just set it to
4698 * whatever the card is looking at.
4700 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4701 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4703 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4704 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4705 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4706 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4710 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4711 #define I2C_TDA8540 0x90
4712 #define I2C_TDA8540_ALT1 0x92
4713 #define I2C_TDA8540_ALT2 0x94
4714 #define I2C_TDA8540_ALT3 0x96
4715 #define I2C_TDA8540_ALT4 0x98
4716 #define I2C_TDA8540_ALT5 0x9a
4717 #define I2C_TDA8540_ALT6 0x9c
4719 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4722 int key = input % 4;
4723 int matrix = input / 4;
4725 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4726 btv->c.nr, input, matrix, key);
4728 /* Handles the input selection on the TDA8540's */
4729 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4730 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4731 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4732 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4733 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4734 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4735 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4736 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4738 /* Handles the output enables on the TDA8540's */
4739 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4740 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4741 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4742 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4743 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4744 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4745 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4746 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4748 /* Selects MUX0 for input on the 878 */
4749 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4753 /* PXC200 muxsel helper
4754 * luke@syseng.anu.edu.au
4755 * another transplant
4756 * from Alessandro Rubini (rubini@linux.it)
4758 * There are 4 kinds of cards:
4759 * PXC200L which is bt848
4760 * PXC200F which is bt848 with PIC controlling mux
4761 * PXC200AL which is bt878
4762 * PXC200AF which is bt878 with PIC controlling mux
4764 #define PX_CFG_PXC200F 0x01
4765 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4766 #define PX_I2C_PIC 0x0f
4767 #define PX_PXC200A_CARDID 0x200a1295
4768 #define PX_I2C_CMD_CFG 0x00
4770 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4775 unsigned char buf[2];
4777 /* Read PIC config to determine if this is a PXC200F */
4781 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4783 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4784 /* not PXC ? do nothing */
4788 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4789 if (!(rc & PX_CFG_PXC200F)) {
4790 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4795 /* The multiplexer in the 200F is handled by the GPIO port */
4796 /* get correct mapping between inputs */
4797 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4798 /* ** not needed!? */
4801 /* make sure output pins are enabled */
4802 /* bitmask=0x30f; */
4804 /* check whether we have a PXC200A */
4805 if (btv->cardid == PX_PXC200A_CARDID) {
4806 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4807 bitmask |= 7<<4; /* the DAC */
4809 btwrite(bitmask, BT848_GPIO_OUT_EN);
4811 bitmask = btread(BT848_GPIO_DATA);
4812 if (btv->cardid == PX_PXC200A_CARDID)
4813 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4814 else /* older device */
4815 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4816 btwrite(bitmask,BT848_GPIO_DATA);
4819 * Was "to be safe, set the bt848 to input 0"
4820 * Actually, since it's ok at load time, better not messing
4821 * with these bits (on PXC200AF you need to set mux 2 here)
4823 * needed because bttv-driver sets mux before calling this function
4825 if (btv->cardid == PX_PXC200A_CARDID)
4826 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4827 else /* older device */
4828 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4830 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4833 /* ----------------------------------------------------------------------- */
4834 /* motherboard chipset specific stuff */
4836 void __init bttv_check_chipset(void)
4838 int pcipci_fail = 0;
4839 struct pci_dev *dev = NULL;
4841 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4843 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4845 if (pci_pci_problems & PCIPCI_VSFX)
4847 #ifdef PCIPCI_ALIMAGIK
4848 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4853 /* print warnings about any quirks found */
4855 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4857 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4859 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4862 printk(KERN_INFO "bttv: overlay will be disabled.\n");
4865 printk(KERN_INFO "bttv: overlay forced. Use this "
4866 "option at your own risk.\n");
4869 if (UNSET != latency)
4870 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4871 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4872 PCI_DEVICE_ID_INTEL_82441, dev))) {
4874 pci_read_config_byte(dev, 0x53, &b);
4876 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4877 "bufcon=0x%02x\n",b);
4881 int __devinit bttv_handle_chipset(struct bttv *btv)
4883 unsigned char command;
4885 if (!triton1 && !vsfx && UNSET == latency)
4890 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4891 if (vsfx && btv->id >= 878)
4892 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4893 if (UNSET != latency)
4894 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4898 if (btv->id < 878) {
4899 /* bt848 (mis)uses a bit in the irq mask for etbf */
4901 btv->triton1 = BT848_INT_ETBF;
4903 /* bt878 has a bit in the pci config space for it */
4904 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4906 command |= BT878_EN_TBFX;
4908 command |= BT878_EN_VSFX;
4909 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4911 if (UNSET != latency)
4912 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);