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 *** ",
324 .muxsel = { 2, 3, 1, 0 },
326 .tuner_addr = ADDR_UNSET,
328 [BTTV_BOARD_MIRO] = {
331 /* .audio_inputs= 1, */
334 .muxsel = { 2, 3, 1, 1 },
335 .gpiomux = { 2, 0, 0, 0 },
339 .tuner_addr = ADDR_UNSET,
341 [BTTV_BOARD_HAUPPAUGE] = {
342 .name = "Hauppauge (bt848)",
344 /* .audio_inputs= 1, */
347 .muxsel = { 2, 3, 1, 1 },
348 .gpiomux = { 0, 1, 2, 3 },
352 .tuner_addr = ADDR_UNSET,
355 .name = "STB, Gateway P/N 6000699 (bt848)",
357 /* .audio_inputs= 1, */
360 .muxsel = { 2, 3, 1, 1 },
361 .gpiomux = { 4, 0, 2, 3 },
365 .tuner_type = TUNER_PHILIPS_NTSC,
366 .tuner_addr = ADDR_UNSET,
371 /* ---- card 0x04 ---------------------------------- */
372 [BTTV_BOARD_INTEL] = {
373 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
375 /* .audio_inputs= 0, */
378 .muxsel = { 2, 3, 1, 1 },
381 .tuner_type = TUNER_ABSENT,
382 .tuner_addr = ADDR_UNSET,
384 [BTTV_BOARD_DIAMOND] = {
385 .name = "Diamond DTV2000",
387 /* .audio_inputs= 1, */
390 .muxsel = { 2, 3, 1, 0 },
391 .gpiomux = { 0, 1, 0, 1 },
395 .tuner_addr = ADDR_UNSET,
397 [BTTV_BOARD_AVERMEDIA] = {
398 .name = "AVerMedia TVPhone",
400 /* .audio_inputs= 1, */
402 .muxsel = { 2, 3, 1, 1 },
404 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
405 /* 0x04 for some cards ?? */
408 .tuner_addr = ADDR_UNSET,
409 .audio_mode_gpio= avermedia_tvphone_audio,
412 [BTTV_BOARD_MATRIX_VISION] = {
413 .name = "MATRIX-Vision MV-Delta",
415 /* .audio_inputs= 1, */
418 .muxsel = { 2, 3, 1, 0, 0 },
421 .tuner_type = TUNER_ABSENT,
422 .tuner_addr = ADDR_UNSET,
425 /* ---- card 0x08 ---------------------------------- */
426 [BTTV_BOARD_FLYVIDEO] = {
427 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
429 /* .audio_inputs= 1, */
432 .muxsel = { 2, 3, 1, 1 },
433 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
438 .tuner_addr = ADDR_UNSET,
440 [BTTV_BOARD_TURBOTV] = {
441 .name = "IMS/IXmicro TurboTV",
443 /* .audio_inputs= 1, */
446 .muxsel = { 2, 3, 1, 1 },
447 .gpiomux = { 1, 1, 2, 3 },
450 .tuner_type = TUNER_TEMIC_PAL,
451 .tuner_addr = ADDR_UNSET,
453 [BTTV_BOARD_HAUPPAUGE878] = {
454 .name = "Hauppauge (bt878)",
456 /* .audio_inputs= 1, */
458 .gpiomask = 0x0f, /* old: 7 */
459 .muxsel = { 2, 0, 1, 1 },
460 .gpiomux = { 0, 1, 2, 3 },
465 .tuner_addr = ADDR_UNSET,
467 [BTTV_BOARD_MIROPRO] = {
468 .name = "MIRO PCTV pro",
470 /* .audio_inputs= 1, */
473 .muxsel = { 2, 3, 1, 1 },
474 .gpiomux = { 0x20001,0x10001, 0, 0 },
478 .tuner_addr = ADDR_UNSET,
481 /* ---- card 0x0c ---------------------------------- */
482 [BTTV_BOARD_ADSTECH_TV] = {
483 .name = "ADS Technologies Channel Surfer TV (bt848)",
485 /* .audio_inputs= 1, */
488 .muxsel = { 2, 3, 1, 1 },
489 .gpiomux = { 13, 14, 11, 7 },
492 .tuner_addr = ADDR_UNSET,
494 [BTTV_BOARD_AVERMEDIA98] = {
495 .name = "AVerMedia TVCapture 98",
497 /* .audio_inputs= 4, */
500 .muxsel = { 2, 3, 1, 1 },
501 .gpiomux = { 13, 14, 11, 7 },
505 .tuner_type = TUNER_PHILIPS_PAL,
506 .tuner_addr = ADDR_UNSET,
507 .audio_mode_gpio= avermedia_tv_stereo_audio,
511 .name = "Aimslab Video Highway Xtreme (VHX)",
513 /* .audio_inputs= 1, */
516 .muxsel = { 2, 3, 1, 1 },
517 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
522 .tuner_addr = ADDR_UNSET,
524 [BTTV_BOARD_ZOLTRIX] = {
525 .name = "Zoltrix TV-Max",
527 /* .audio_inputs= 1, */
530 .muxsel = { 2, 3, 1, 1 },
531 .gpiomux = { 0, 0, 1, 0 },
535 .tuner_addr = ADDR_UNSET,
538 /* ---- card 0x10 ---------------------------------- */
539 [BTTV_BOARD_PIXVIEWPLAYTV] = {
540 .name = "Prolink Pixelview PlayTV (bt878)",
542 /* .audio_inputs= 1, */
544 .gpiomask = 0x01fe00,
545 .muxsel = { 2, 3, 1, 1 },
546 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
547 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
548 .gpiomute = 0x002000,
552 .tuner_addr = ADDR_UNSET,
554 [BTTV_BOARD_WINVIEW_601] = {
555 .name = "Leadtek WinView 601",
557 /* .audio_inputs= 1, */
559 .gpiomask = 0x8300f8,
560 .muxsel = { 2, 3, 1, 1,0 },
561 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
562 .gpiomute = 0xcfa007,
565 .tuner_addr = ADDR_UNSET,
566 .volume_gpio = winview_volume,
569 [BTTV_BOARD_AVEC_INTERCAP] = {
570 .name = "AVEC Intercapture",
572 /* .audio_inputs= 2, */
575 .muxsel = { 2, 3, 1, 1 },
576 .gpiomux = { 1, 0, 0, 0 },
579 .tuner_addr = ADDR_UNSET,
581 [BTTV_BOARD_LIFE_FLYKIT] = {
582 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
584 /* .audio_inputs= 1, */
586 .gpiomask = 0x8dff00,
587 .muxsel = { 2, 3, 1, 1 },
590 .tuner_type = TUNER_ABSENT,
591 .tuner_addr = ADDR_UNSET,
594 /* ---- card 0x14 ---------------------------------- */
595 [BTTV_BOARD_CEI_RAFFLES] = {
596 .name = "CEI Raffles Card",
598 /* .audio_inputs= 3, */
600 .muxsel = { 2, 3, 1, 1 },
602 .tuner_addr = ADDR_UNSET,
604 [BTTV_BOARD_CONFERENCETV] = {
605 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
607 /* .audio_inputs= 2, tuner, line in */
610 .muxsel = { 2, 3, 1, 1 },
611 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
614 .tuner_type = TUNER_PHILIPS_PAL_I,
615 .tuner_addr = ADDR_UNSET,
617 [BTTV_BOARD_PHOEBE_TVMAS] = {
618 .name = "Askey CPH050/ Phoebe Tv Master + FM",
620 /* .audio_inputs= 1, */
623 .muxsel = { 2, 3, 1, 1 },
624 .gpiomux = { 0, 1, 0x800, 0x400 },
629 .tuner_addr = ADDR_UNSET,
631 [BTTV_BOARD_MODTEC_205] = {
632 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
634 /* .audio_inputs= 1, */
638 .muxsel = { 2, 3, 0 }, /* input 2 is digital */
639 /* .digital_mode= DIGITAL_MODE_CAMERA, */
640 .gpiomux = { 0, 0, 0, 0 },
643 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
644 .tuner_addr = ADDR_UNSET,
647 /* ---- card 0x18 ---------------------------------- */
648 [BTTV_BOARD_MAGICTVIEW061] = {
649 .name = "Askey CPH05X/06X (bt878) [many vendors]",
651 /* .audio_inputs= 1, */
654 .muxsel = { 2, 3, 1, 1 },
655 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
660 .tuner_addr = ADDR_UNSET,
663 [BTTV_BOARD_VOBIS_BOOSTAR] = {
664 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
666 /* .audio_inputs= 1, */
668 .gpiomask = 0x1f0fff,
669 .muxsel = { 2, 3, 1, 1 },
670 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
673 .tuner_type = TUNER_PHILIPS_PAL,
674 .tuner_addr = ADDR_UNSET,
675 .audio_mode_gpio= terratv_audio,
677 [BTTV_BOARD_HAUPPAUG_WCAM] = {
678 .name = "Hauppauge WinCam newer (bt878)",
680 /* .audio_inputs= 1, */
683 .muxsel = { 2, 0, 1, 1 },
684 .gpiomux = { 0, 1, 2, 3 },
688 .tuner_addr = ADDR_UNSET,
690 [BTTV_BOARD_MAXI] = {
691 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
693 /* .audio_inputs= 2, */
696 .muxsel = { 2, 3, 1, 1 },
697 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
700 .tuner_type = TUNER_PHILIPS_SECAM,
701 .tuner_addr = ADDR_UNSET,
704 /* ---- card 0x1c ---------------------------------- */
705 [BTTV_BOARD_TERRATV] = {
706 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
708 /* .audio_inputs= 1, */
710 .gpiomask = 0x1f0fff,
711 .muxsel = { 2, 3, 1, 1 },
712 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
715 .tuner_type = TUNER_PHILIPS_PAL,
716 .tuner_addr = ADDR_UNSET,
717 .audio_mode_gpio= terratv_audio,
719 External 20 pin connector (for Active Radio Upgrade board)
725 gpio05: om5610-stereo
729 gpio09+10: nIOR, nSEL ?? (bt878)
733 gpio16: u2-A0 (1st 4052bt)
736 gpio19: u4-A0 (2nd 4052)
740 00000 : Cdrom (internal audio input)
741 10000 : ext. Video audio input
750 [BTTV_BOARD_PXC200] = {
751 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
752 .name = "Imagenation PXC200",
754 /* .audio_inputs= 1, */
755 .svhs = 1, /* was: 4 */
757 .muxsel = { 2, 3, 1, 0, 0},
760 .tuner_type = TUNER_ABSENT,
761 .tuner_addr = ADDR_UNSET,
762 .muxsel_hook = PXC200_muxsel,
765 [BTTV_BOARD_FLYVIDEO_98] = {
766 .name = "Lifeview FlyVideo 98 LR50",
768 /* .audio_inputs= 1, */
770 .gpiomask = 0x1800, /* 0x8dfe00 */
771 .muxsel = { 2, 3, 1, 1 },
772 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
776 .tuner_addr = ADDR_UNSET,
778 [BTTV_BOARD_IPROTV] = {
779 .name = "Formac iProTV, Formac ProTV I (bt848)",
781 /* .audio_inputs= 1, */
784 .muxsel = { 2, 3, 1, 1 },
785 .gpiomux = { 1, 0, 0, 0 },
787 .tuner_type = TUNER_PHILIPS_PAL,
788 .tuner_addr = ADDR_UNSET,
791 /* ---- card 0x20 ---------------------------------- */
792 [BTTV_BOARD_INTEL_C_S_PCI] = {
793 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
795 /* .audio_inputs= 0, */
798 .muxsel = { 2, 3, 1, 1 },
801 .tuner_type = TUNER_ABSENT,
802 .tuner_addr = ADDR_UNSET,
804 [BTTV_BOARD_TERRATVALUE] = {
805 .name = "Terratec TerraTValue Version Bt878",
807 /* .audio_inputs= 1, */
809 .gpiomask = 0xffff00,
810 .muxsel = { 2, 3, 1, 1 },
811 .gpiomux = { 0x500, 0, 0x300, 0x900 },
815 .tuner_type = TUNER_PHILIPS_PAL,
816 .tuner_addr = ADDR_UNSET,
818 [BTTV_BOARD_WINFAST2000] = {
819 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
821 /* .audio_inputs= 1, */
823 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
824 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
825 .gpiomask = 0xb33000,
826 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
827 .gpiomute = 0x800000,
828 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
829 gpio23 -- hef4052:nEnable (0x800000)
832 0x0000: external audio
836 Note: There exists another variant "Winfast 2000" with tv stereo !?
837 Note: eeprom only contains FF and pci subsystem id 107d:6606
842 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
843 .tuner_addr = ADDR_UNSET,
844 .audio_mode_gpio= winfast2000_audio,
847 [BTTV_BOARD_CHRONOS_VS2] = {
848 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
850 /* .audio_inputs= 3, */
853 .muxsel = { 2, 3, 1, 1 },
854 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
858 .tuner_addr = ADDR_UNSET,
861 /* ---- card 0x24 ---------------------------------- */
862 [BTTV_BOARD_TYPHOON_TVIEW] = {
863 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
865 /* .audio_inputs= 3, */
868 .muxsel = { 2, 3, 1, 1 },
869 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
873 .tuner_addr = ADDR_UNSET,
876 [BTTV_BOARD_PXELVWPLTVPRO] = {
877 .name = "Prolink PixelView PlayTV pro",
879 /* .audio_inputs= 1, */
882 .muxsel = { 2, 3, 1, 1 },
883 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
888 .tuner_addr = ADDR_UNSET,
890 [BTTV_BOARD_MAGICTVIEW063] = {
891 .name = "Askey CPH06X TView99",
893 /* .audio_inputs= 1, */
895 .gpiomask = 0x551e00,
896 .muxsel = { 2, 3, 1, 0 },
897 .gpiomux = { 0x551400, 0x551200, 0, 0 },
898 .gpiomute = 0x551c00,
901 .tuner_type = TUNER_PHILIPS_PAL_I,
902 .tuner_addr = ADDR_UNSET,
905 [BTTV_BOARD_PINNACLE] = {
906 .name = "Pinnacle PCTV Studio/Rave",
908 /* .audio_inputs= 1, */
910 .gpiomask = 0x03000F,
911 .muxsel = { 2, 3, 1, 1 },
912 .gpiomux = { 2, 0xd0001, 0, 0 },
917 .tuner_addr = ADDR_UNSET,
920 /* ---- card 0x28 ---------------------------------- */
921 [BTTV_BOARD_STB2] = {
922 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
924 /* .audio_inputs= 1, */
927 .muxsel = { 2, 3, 1, 1 },
928 .gpiomux = { 4, 0, 2, 3 },
932 .tuner_type = TUNER_PHILIPS_NTSC,
933 .tuner_addr = ADDR_UNSET,
937 [BTTV_BOARD_AVPHONE98] = {
938 .name = "AVerMedia TVPhone 98",
940 /* .audio_inputs= 4, */
943 .muxsel = { 2, 3, 1, 1 },
944 .gpiomux = { 13, 4, 11, 7 },
948 .tuner_addr = ADDR_UNSET,
950 .audio_mode_gpio= avermedia_tvphone_audio,
952 [BTTV_BOARD_PV951] = {
953 .name = "ProVideo PV951", /* pic16c54 */
955 /* .audio_inputs= 1, */
958 .muxsel = { 2, 3, 1, 1},
959 .gpiomux = { 0, 0, 0, 0},
963 .tuner_type = TUNER_PHILIPS_PAL_I,
964 .tuner_addr = ADDR_UNSET,
966 [BTTV_BOARD_ONAIR_TV] = {
967 .name = "Little OnAir TV",
969 /* .audio_inputs= 1, */
972 .muxsel = { 2, 3, 1, 1 },
973 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
974 .gpiomute = 0xff3ffc,
977 .tuner_addr = ADDR_UNSET,
980 /* ---- card 0x2c ---------------------------------- */
981 [BTTV_BOARD_SIGMA_TVII_FM] = {
982 .name = "Sigma TVII-FM",
984 /* .audio_inputs= 1, */
987 .muxsel = { 2, 3, 1, 1 },
988 .gpiomux = { 1, 1, 0, 2 },
993 .tuner_addr = ADDR_UNSET,
995 [BTTV_BOARD_MATRIX_VISION2] = {
996 .name = "MATRIX-Vision MV-Delta 2",
998 /* .audio_inputs= 1, */
1001 .muxsel = { 2, 3, 1, 0, 0 },
1005 .tuner_type = TUNER_ABSENT,
1006 .tuner_addr = ADDR_UNSET,
1008 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1009 .name = "Zoltrix Genie TV/FM",
1011 /* .audio_inputs= 1, */
1013 .gpiomask = 0xbcf03f,
1014 .muxsel = { 2, 3, 1, 1 },
1015 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1016 .gpiomute = 0xbcb03f,
1019 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1020 .tuner_addr = ADDR_UNSET,
1022 [BTTV_BOARD_TERRATVRADIO] = {
1023 .name = "Terratec TV/Radio+",
1025 /* .audio_inputs= 1, */
1027 .gpiomask = 0x70000,
1028 .muxsel = { 2, 3, 1, 1 },
1029 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1030 .gpiomute = 0x40000,
1034 .tuner_type = TUNER_PHILIPS_PAL_I,
1035 .tuner_addr = ADDR_UNSET,
1039 /* ---- card 0x30 ---------------------------------- */
1040 [BTTV_BOARD_DYNALINK] = {
1041 .name = "Askey CPH03x/ Dynalink Magic TView",
1043 /* .audio_inputs= 1, */
1046 .muxsel = { 2, 3, 1, 1 },
1047 .gpiomux = {2,0,0,0 },
1051 .tuner_type = UNSET,
1052 .tuner_addr = ADDR_UNSET,
1054 [BTTV_BOARD_GVBCTV3PCI] = {
1055 .name = "IODATA GV-BCTV3/PCI",
1057 /* .audio_inputs= 1, */
1059 .gpiomask = 0x010f00,
1060 .muxsel = {2, 3, 0, 0 },
1061 .gpiomux = {0x10000, 0, 0x10000, 0 },
1064 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1065 .tuner_addr = ADDR_UNSET,
1066 .audio_mode_gpio= gvbctv3pci_audio,
1068 [BTTV_BOARD_PXELVWPLTVPAK] = {
1069 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1071 /* .audio_inputs= 1, */
1074 .gpiomask = 0xAA0000,
1075 .muxsel = { 2, 3, 1, 1, 0 }, /* input 4 is digital */
1076 /* .digital_mode= DIGITAL_MODE_CAMERA, */
1077 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1078 .gpiomute = 0xa8000,
1081 .tuner_type = TUNER_PHILIPS_PAL_I,
1082 .tuner_addr = ADDR_UNSET,
1084 /* GPIO wiring: (different from Rev.4C !)
1085 GPIO17: U4.A0 (first hef4052bt)
1087 GPIO20: U5.A1 (second hef4052bt)
1089 GPIO22: BT832 Reset Line
1090 GPIO23: A5,A0, U5,nEN
1091 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1094 [BTTV_BOARD_EAGLE] = {
1095 .name = "Eagle Wireless Capricorn2 (bt878A)",
1097 /* .audio_inputs= 1, */
1100 .muxsel = { 2, 0, 1, 1 },
1101 .gpiomux = { 0, 1, 2, 3 },
1104 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1105 .tuner_addr = ADDR_UNSET,
1108 /* ---- card 0x34 ---------------------------------- */
1109 [BTTV_BOARD_PINNACLEPRO] = {
1110 /* David Härdeman <david@2gen.com> */
1111 .name = "Pinnacle PCTV Studio Pro",
1113 /* .audio_inputs= 1, */
1115 .gpiomask = 0x03000F,
1116 .muxsel = { 2, 3, 1, 1 },
1117 .gpiomux = { 1, 0xd0001, 0, 0 },
1119 /* sound path (5 sources):
1120 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1123 2= Mono TV sound from Tuner
1125 MUX2 (mask 0x30000):
1127 1= FM stereo Radio from Tuner */
1130 .tuner_type = UNSET,
1131 .tuner_addr = ADDR_UNSET,
1133 [BTTV_BOARD_TVIEW_RDS_FM] = {
1134 /* Claas Langbehn <claas@bigfoot.com>,
1135 Sven Grothklags <sven@upb.de> */
1136 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1138 /* .audio_inputs= 3, */
1141 .muxsel = { 2, 3, 1, 1 },
1142 .gpiomux = { 0, 0, 0x10, 8 },
1146 .tuner_type = TUNER_PHILIPS_PAL,
1147 .tuner_addr = ADDR_UNSET,
1150 [BTTV_BOARD_LIFETEC_9415] = {
1151 /* Tim Röstermundt <rosterm@uni-muenster.de>
1152 in de.comp.os.unix.linux.hardware:
1153 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1154 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1155 options tuner type=5 */
1156 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1158 /* .audio_inputs= 1, */
1161 .muxsel = { 2, 3, 1, 1 },
1162 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1164 /* For cards with tda9820/tda9821:
1165 0x0000: Tuner normal stereo
1166 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1167 0x0880: Tuner A2 stereo */
1169 .tuner_type = UNSET,
1170 .tuner_addr = ADDR_UNSET,
1172 [BTTV_BOARD_BESTBUY_EASYTV] = {
1173 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1174 old Easy TV BT848 version (model CPH031) */
1175 .name = "Askey CPH031/ BESTBUY Easy TV",
1177 /* .audio_inputs= 1, */
1180 .muxsel = { 2, 3, 1, 0 },
1181 .gpiomux = { 2, 0, 0, 0 },
1185 .tuner_type = TUNER_TEMIC_PAL,
1186 .tuner_addr = ADDR_UNSET,
1189 /* ---- card 0x38 ---------------------------------- */
1190 [BTTV_BOARD_FLYVIDEO_98FM] = {
1191 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1192 .name = "Lifeview FlyVideo 98FM LR50",
1194 /* .audio_inputs= 3, */
1197 .muxsel = { 2, 3, 1, 1 },
1198 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1201 .tuner_type = TUNER_PHILIPS_PAL,
1202 .tuner_addr = ADDR_UNSET,
1204 /* This is the ultimate cheapo capture card
1205 * just a BT848A on a small PCB!
1206 * Steve Hosgood <steve@equiinet.com> */
1207 [BTTV_BOARD_GRANDTEC] = {
1208 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1210 /* .audio_inputs= 0, */
1218 .tuner_type = TUNER_ABSENT,
1219 .tuner_addr = ADDR_UNSET,
1221 [BTTV_BOARD_ASKEY_CPH060] = {
1222 /* Daniel Herrington <daniel.herrington@home.com> */
1223 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1225 /* .audio_inputs= 1, */
1228 .muxsel = { 2, 3, 1, 1},
1229 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1233 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1234 .tuner_addr = ADDR_UNSET,
1236 [BTTV_BOARD_ASKEY_CPH03X] = {
1237 /* Matti Mottus <mottus@physic.ut.ee> */
1238 .name = "Askey CPH03x TV Capturer",
1240 /* .audio_inputs= 1, */
1242 .gpiomask = 0x03000F,
1243 .muxsel = { 2, 3, 1, 0 },
1244 .gpiomux = { 2, 0, 0, 0 },
1247 .tuner_type = TUNER_TEMIC_PAL,
1248 .tuner_addr = ADDR_UNSET,
1251 /* ---- card 0x3c ---------------------------------- */
1252 [BTTV_BOARD_MM100PCTV] = {
1253 /* Philip Blundell <philb@gnu.org> */
1254 .name = "Modular Technology MM100PCTV",
1256 /* .audio_inputs= 2, */
1259 .muxsel = { 2, 3, 1, 1 },
1260 .gpiomux = { 2, 0, 0, 1 },
1263 .tuner_type = TUNER_TEMIC_PAL,
1264 .tuner_addr = ADDR_UNSET,
1266 [BTTV_BOARD_GMV1] = {
1267 /* Adrian Cox <adrian@humboldt.co.uk */
1268 .name = "AG Electronics GMV1",
1270 /* .audio_inputs= 0, */
1278 .tuner_type = TUNER_ABSENT,
1279 .tuner_addr = ADDR_UNSET,
1281 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1282 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1283 new Easy TV BT878 version (model CPH061)
1284 special thanks to Informatica Mieres for providing the card */
1285 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1287 /* .audio_inputs= 2, */
1290 .muxsel = { 2, 3, 1, 0 },
1291 .gpiomux = { 1, 0, 4, 4 },
1295 .tuner_type = TUNER_PHILIPS_PAL,
1296 .tuner_addr = ADDR_UNSET,
1298 [BTTV_BOARD_ATI_TVWONDER] = {
1299 /* Lukas Gebauer <geby@volny.cz> */
1300 .name = "ATI TV-Wonder",
1302 /* .audio_inputs= 1, */
1305 .muxsel = { 2, 3, 1, 0 },
1306 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1309 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1310 .tuner_addr = ADDR_UNSET,
1313 /* ---- card 0x40 ---------------------------------- */
1314 [BTTV_BOARD_ATI_TVWONDERVE] = {
1315 /* Lukas Gebauer <geby@volny.cz> */
1316 .name = "ATI TV-Wonder VE",
1318 /* .audio_inputs= 1, */
1321 .muxsel = { 2, 3, 0, 1 },
1322 .gpiomux = { 0, 0, 1, 0 },
1325 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1326 .tuner_addr = ADDR_UNSET,
1328 [BTTV_BOARD_FLYVIDEO2000] = {
1329 /* DeeJay <deejay@westel900.net (2000S) */
1330 .name = "Lifeview FlyVideo 2000S LR90",
1332 /* .audio_inputs= 3, */
1335 .muxsel = { 2, 3, 0, 1 },
1336 /* Radio changed from 1e80 to 0x800 to make
1337 FlyVideo2000S in .hu happy (gm)*/
1338 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1339 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1341 .audio_mode_gpio= fv2000s_audio,
1346 .tuner_type = TUNER_PHILIPS_PAL,
1347 .tuner_addr = ADDR_UNSET,
1349 [BTTV_BOARD_TERRATVALUER] = {
1350 .name = "Terratec TValueRadio",
1352 /* .audio_inputs= 1, */
1354 .gpiomask = 0xffff00,
1355 .muxsel = { 2, 3, 1, 1 },
1356 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1360 .tuner_type = TUNER_PHILIPS_PAL,
1361 .tuner_addr = ADDR_UNSET,
1364 [BTTV_BOARD_GVBCTV4PCI] = {
1365 /* TANAKA Kei <peg00625@nifty.com> */
1366 .name = "IODATA GV-BCTV4/PCI",
1368 /* .audio_inputs= 1, */
1370 .gpiomask = 0x010f00,
1371 .muxsel = {2, 3, 0, 0 },
1372 .gpiomux = {0x10000, 0, 0x10000, 0 },
1375 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1376 .tuner_addr = ADDR_UNSET,
1377 .audio_mode_gpio= gvbctv3pci_audio,
1380 /* ---- card 0x44 ---------------------------------- */
1381 [BTTV_BOARD_VOODOOTV_FM] = {
1382 .name = "3Dfx VoodooTV FM (Euro)",
1383 /* try "insmod msp3400 simple=0" if you have
1384 * sound problems with this card. */
1386 /* .audio_inputs= 1, */
1388 .gpiomask = 0x4f8a00,
1389 /* 0x100000: 1=MSP enabled (0=disable again)
1390 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1391 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1392 .gpiomute = 0x947fff,
1393 /* tvtuner, radio, external,internal, mute, stereo
1394 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1395 .muxsel = { 2, 3 ,0 ,1 },
1396 .tuner_type = TUNER_MT2032,
1397 .tuner_addr = ADDR_UNSET,
1401 [BTTV_BOARD_VOODOOTV_200] = {
1402 .name = "VoodooTV 200 (USA)",
1403 /* try "insmod msp3400 simple=0" if you have
1404 * sound problems with this card. */
1406 /* .audio_inputs= 1, */
1408 .gpiomask = 0x4f8a00,
1409 /* 0x100000: 1=MSP enabled (0=disable again)
1410 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1411 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1412 .gpiomute = 0x947fff,
1413 /* tvtuner, radio, external,internal, mute, stereo
1414 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1415 .muxsel = { 2, 3 ,0 ,1 },
1416 .tuner_type = TUNER_MT2032,
1417 .tuner_addr = ADDR_UNSET,
1421 [BTTV_BOARD_AIMMS] = {
1422 /* Philip Blundell <pb@nexus.co.uk> */
1423 .name = "Active Imaging AIMMS",
1425 /* .audio_inputs= 0, */
1426 .tuner_type = TUNER_ABSENT,
1427 .tuner_addr = ADDR_UNSET,
1432 [BTTV_BOARD_PV_BT878P_PLUS] = {
1433 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1434 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1436 /* .audio_inputs= 4, */
1439 .muxsel = { 2, 3, 1, 1 },
1440 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1444 .tuner_type = TUNER_LG_PAL_I_FM,
1445 .tuner_addr = ADDR_UNSET,
1448 GPIO0: U4.A0 (hef4052bt)
1450 GPIO2: U4.A1 (second hef4052bt)
1451 GPIO3: U4.nEN, U5.A0, A5.nEN
1455 [BTTV_BOARD_FLYVIDEO98EZ] = {
1456 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1458 /* .audio_inputs= 0, */
1460 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1463 .tuner_type = TUNER_ABSENT,
1464 .tuner_addr = ADDR_UNSET,
1467 /* ---- card 0x48 ---------------------------------- */
1468 [BTTV_BOARD_PV_BT878P_9B] = {
1469 /* Dariusz Kowalewski <darekk@automex.pl> */
1470 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1472 /* .audio_inputs= 1, */
1475 .muxsel = { 2, 3, 1, 1 },
1476 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1482 .tuner_type = TUNER_PHILIPS_PAL,
1483 .tuner_addr = ADDR_UNSET,
1484 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1485 .has_radio = 1, /* Note: not all cards have radio */
1492 GPIO20,22,23: R30,R29,R28
1495 [BTTV_BOARD_SENSORAY311] = {
1496 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1497 /* you must jumper JP5 for the card to work */
1498 .name = "Sensoray 311",
1500 /* .audio_inputs= 0, */
1503 .muxsel = { 2, 3, 1, 0, 0 },
1506 .tuner_type = TUNER_ABSENT,
1507 .tuner_addr = ADDR_UNSET,
1509 [BTTV_BOARD_RV605] = {
1510 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1511 .name = "RemoteVision MX (RV605)",
1513 /* .audio_inputs= 0, */
1516 .gpiomask2 = 0x07ff,
1517 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1518 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1521 .tuner_type = TUNER_ABSENT,
1522 .tuner_addr = ADDR_UNSET,
1523 .muxsel_hook = rv605_muxsel,
1525 [BTTV_BOARD_POWERCLR_MTV878] = {
1526 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1528 /* .audio_inputs= 2, */
1530 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1531 .muxsel = { 2, 1, 1, },
1532 .gpiomux = { 0, 1, 2, 2 },
1535 .tuner_type = TUNER_PHILIPS_PAL,
1536 .tuner_addr = ADDR_UNSET,
1541 /* ---- card 0x4c ---------------------------------- */
1542 [BTTV_BOARD_WINDVR] = {
1543 /* Masaki Suzuki <masaki@btree.org> */
1544 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1546 /* .audio_inputs= 1, */
1548 .gpiomask = 0x140007,
1549 .muxsel = { 2, 3, 1, 1 },
1550 .gpiomux = { 0, 1, 2, 3 },
1552 .tuner_type = TUNER_PHILIPS_NTSC,
1553 .tuner_addr = ADDR_UNSET,
1554 .audio_mode_gpio= windvr_audio,
1556 [BTTV_BOARD_GRANDTEC_MULTI] = {
1557 .name = "GrandTec Multi Capture Card (Bt878)",
1559 /* .audio_inputs= 0, */
1562 .muxsel = { 2, 3, 1, 0 },
1567 .tuner_type = TUNER_ABSENT,
1568 .tuner_addr = ADDR_UNSET,
1570 [BTTV_BOARD_KWORLD] = {
1571 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1573 /* .audio_inputs= 3, */
1576 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1577 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1578 * This card lacks external Audio In, so we mute it on Ext. & Int.
1579 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1580 * This card lacks PCI subsystem ID, sigh.
1581 * gpiomux =1: lower volume, 2+3: mute
1582 * btwincap uses 0x80000/0x80003
1588 .tuner_type = TUNER_PHILIPS_PAL,
1589 .tuner_addr = ADDR_UNSET,
1590 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1591 radio signal strength indicators work fine. */
1594 GPIO0,1: HEF4052 A0,A1
1595 GPIO2: HEF4052 nENABLE
1597 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1601 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1603 [BTTV_BOARD_DSP_TCVIDEO] = {
1604 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1605 .name = "DSP Design TCVIDEO",
1608 .muxsel = { 2, 3, 1, 0 },
1610 .tuner_type = UNSET,
1611 .tuner_addr = ADDR_UNSET,
1614 /* ---- card 0x50 ---------------------------------- */
1615 [BTTV_BOARD_HAUPPAUGEPVR] = {
1616 .name = "Hauppauge WinTV PVR",
1618 /* .audio_inputs= 1, */
1620 .muxsel = { 2, 0, 1, 1 },
1623 .tuner_type = UNSET,
1624 .tuner_addr = ADDR_UNSET,
1629 [BTTV_BOARD_GVBCTV5PCI] = {
1630 .name = "IODATA GV-BCTV5/PCI",
1632 /* .audio_inputs= 1, */
1634 .gpiomask = 0x0f0f80,
1635 .muxsel = {2, 3, 1, 0 },
1636 .gpiomux = {0x030000, 0x010000, 0, 0 },
1637 .gpiomute = 0x020000,
1640 .tuner_type = TUNER_PHILIPS_NTSC_M,
1641 .tuner_addr = ADDR_UNSET,
1642 .audio_mode_gpio= gvbctv5pci_audio,
1645 [BTTV_BOARD_OSPREY1x0] = {
1646 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1647 .video_inputs = 4, /* id-inputs-clock */
1648 /* .audio_inputs= 0, */
1650 .muxsel = { 3, 2, 0, 1 },
1652 .tuner_type = TUNER_ABSENT,
1653 .tuner_addr = ADDR_UNSET,
1658 [BTTV_BOARD_OSPREY1x0_848] = {
1659 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1661 /* .audio_inputs= 0, */
1663 .muxsel = { 2, 3, 1 },
1665 .tuner_type = TUNER_ABSENT,
1666 .tuner_addr = ADDR_UNSET,
1672 /* ---- card 0x54 ---------------------------------- */
1673 [BTTV_BOARD_OSPREY101_848] = {
1674 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1676 /* .audio_inputs= 0, */
1680 .tuner_type = TUNER_ABSENT,
1681 .tuner_addr = ADDR_UNSET,
1686 [BTTV_BOARD_OSPREY1x1] = {
1687 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1689 /* .audio_inputs= 0, */
1693 .tuner_type = TUNER_ABSENT,
1694 .tuner_addr = ADDR_UNSET,
1699 [BTTV_BOARD_OSPREY1x1_SVID] = {
1700 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1702 /* .audio_inputs= 0, */
1706 .tuner_type = TUNER_ABSENT,
1707 .tuner_addr = ADDR_UNSET,
1712 [BTTV_BOARD_OSPREY2xx] = {
1713 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1715 /* .audio_inputs= 1, */
1719 .tuner_type = TUNER_ABSENT,
1720 .tuner_addr = ADDR_UNSET,
1726 /* ---- card 0x58 ---------------------------------- */
1727 [BTTV_BOARD_OSPREY2x0_SVID] = {
1728 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1730 /* .audio_inputs= 1, */
1734 .tuner_type = TUNER_ABSENT,
1735 .tuner_addr = ADDR_UNSET,
1740 [BTTV_BOARD_OSPREY2x0] = {
1741 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1743 /* .audio_inputs= 1, */
1747 .tuner_type = TUNER_ABSENT,
1748 .tuner_addr = ADDR_UNSET,
1753 [BTTV_BOARD_OSPREY500] = {
1754 .name = "Osprey 500", /* 500 */
1756 /* .audio_inputs= 1, */
1760 .tuner_type = TUNER_ABSENT,
1761 .tuner_addr = ADDR_UNSET,
1766 [BTTV_BOARD_OSPREY540] = {
1767 .name = "Osprey 540", /* 540 */
1769 /* .audio_inputs= 1, */
1771 .tuner_type = TUNER_ABSENT,
1772 .tuner_addr = ADDR_UNSET,
1778 /* ---- card 0x5C ---------------------------------- */
1779 [BTTV_BOARD_OSPREY2000] = {
1780 .name = "Osprey 2000", /* 2000 */
1782 /* .audio_inputs= 1, */
1786 .tuner_type = TUNER_ABSENT,
1787 .tuner_addr = ADDR_UNSET,
1790 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1792 [BTTV_BOARD_IDS_EAGLE] = {
1793 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1794 .name = "IDS Eagle",
1796 /* .audio_inputs= 0, */
1797 .tuner_type = TUNER_ABSENT,
1798 .tuner_addr = ADDR_UNSET,
1801 .muxsel = { 0, 1, 2, 3 },
1802 .muxsel_hook = eagle_muxsel,
1807 [BTTV_BOARD_PINNACLESAT] = {
1808 .name = "Pinnacle PCTV Sat",
1810 /* .audio_inputs= 0, */
1812 .tuner_type = TUNER_ABSENT,
1813 .tuner_addr = ADDR_UNSET,
1822 [BTTV_BOARD_FORMAC_PROTV] = {
1823 .name = "Formac ProTV II (bt878)",
1825 /* .audio_inputs= 1, */
1828 /* TV, Comp1, Composite over SVID con, SVID */
1829 .muxsel = { 2, 3, 1, 1 },
1830 .gpiomux = { 2, 2, 0, 0 },
1833 .tuner_type = TUNER_PHILIPS_PAL,
1834 .tuner_addr = ADDR_UNSET,
1836 GPIO=0x00,0x01,0x03: mute (?)
1837 0x02: both TV and radio (tuner: FM1216/I)
1838 The card has onboard audio connectors labeled "cdrom" and "board",
1839 not soldered here, though unknown wiring.
1840 Card lacks: external audio in, pci subsystem id.
1844 /* ---- card 0x60 ---------------------------------- */
1845 [BTTV_BOARD_MACHTV] = {
1848 /* .audio_inputs= 1, */
1851 .muxsel = { 2, 3, 1, 1},
1852 .gpiomux = { 0, 1, 2, 3},
1855 .tuner_type = TUNER_PHILIPS_PAL,
1856 .tuner_addr = ADDR_UNSET,
1859 [BTTV_BOARD_EURESYS_PICOLO] = {
1860 .name = "Euresys Picolo",
1862 /* .audio_inputs= 0, */
1868 .muxsel = { 2, 0, 1},
1870 .tuner_type = TUNER_ABSENT,
1871 .tuner_addr = ADDR_UNSET,
1873 [BTTV_BOARD_PV150] = {
1874 /* Luc Van Hoeylandt <luc@e-magic.be> */
1875 .name = "ProVideo PV150", /* 0x4f */
1877 /* .audio_inputs= 0, */
1885 .tuner_type = TUNER_ABSENT,
1886 .tuner_addr = ADDR_UNSET,
1888 [BTTV_BOARD_AD_TVK503] = {
1889 /* Hiroshi Takekawa <sian@big.or.jp> */
1890 /* This card lacks subsystem ID */
1891 .name = "AD-TVK503", /* 0x63 */
1893 /* .audio_inputs= 1, */
1895 .gpiomask = 0x001e8007,
1896 .muxsel = { 2, 3, 1, 0 },
1897 /* Tuner, Radio, external, internal, off, on */
1898 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1903 .tuner_type = TUNER_PHILIPS_NTSC,
1904 .tuner_addr = ADDR_UNSET,
1905 .audio_mode_gpio= adtvk503_audio,
1908 /* ---- card 0x64 ---------------------------------- */
1909 [BTTV_BOARD_HERCULES_SM_TV] = {
1910 .name = "Hercules Smart TV Stereo",
1912 /* .audio_inputs= 1, */
1915 .muxsel = { 2, 3, 1, 1 },
1919 .tuner_type = TUNER_PHILIPS_PAL,
1920 .tuner_addr = ADDR_UNSET,
1922 - card lacks subsystem ID
1923 - stereo variant w/ daughter board with tda9874a @0xb0
1925 always from tda9874 independent of GPIO (?)
1926 external line in: unknown
1927 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1928 hef4053 (instead 4052) for unknown function
1931 [BTTV_BOARD_PACETV] = {
1932 .name = "Pace TV & Radio Card",
1934 /* .audio_inputs= 1, */
1936 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
1940 .tuner_type = TUNER_PHILIPS_PAL_I,
1941 .tuner_addr = ADDR_UNSET,
1944 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1945 only internal line out: (4pin header) RGGL
1946 Radio must be decoded by msp3410d (not routed through)*/
1948 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1951 [BTTV_BOARD_IVC200] = {
1952 /* Chris Willing <chris@vislab.usyd.edu.au> */
1955 /* .audio_inputs= 0, */
1956 .tuner_type = TUNER_ABSENT,
1957 .tuner_addr = ADDR_UNSET,
1963 [BTTV_BOARD_IVCE8784] = {
1964 .name = "IVCE-8784",
1966 /* .audio_inputs= 0, */
1967 .tuner_type = TUNER_ABSENT,
1968 .tuner_addr = ADDR_UNSET,
1974 [BTTV_BOARD_XGUARD] = {
1975 .name = "Grand X-Guard / Trust 814PCI",
1977 /* .audio_inputs= 0, */
1979 .tuner_type = TUNER_ABSENT,
1980 .tuner_addr = ADDR_UNSET,
1982 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
1983 .muxsel_hook = xguard_muxsel,
1990 /* ---- card 0x68 ---------------------------------- */
1991 [BTTV_BOARD_NEBULA_DIGITV] = {
1992 .name = "Nebula Electronics DigiTV",
1995 .muxsel = { 2, 3, 1, 0 },
2000 .tuner_type = TUNER_ABSENT,
2001 .tuner_addr = ADDR_UNSET,
2007 [BTTV_BOARD_PV143] = {
2008 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2009 .name = "ProVideo PV143",
2011 /* .audio_inputs= 0, */
2014 .muxsel = { 2, 3, 1, 0 },
2019 .tuner_type = TUNER_ABSENT,
2020 .tuner_addr = ADDR_UNSET,
2022 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
2023 /* M.Klahr@phytec.de */
2024 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
2026 /* .audio_inputs= 0, */
2029 .muxsel = { 2, 3, 1, 0 },
2030 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2033 .tuner_type = TUNER_ABSENT,
2034 .tuner_addr = ADDR_UNSET,
2036 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2037 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2039 /* .audio_inputs= 0, */
2042 .muxsel = { 2, 3, 1, 1 },
2043 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2046 .tuner_type = TUNER_ABSENT,
2047 .tuner_addr = ADDR_UNSET,
2050 /* ---- card 0x6c ---------------------------------- */
2051 [BTTV_BOARD_VD009_MINIDIN] = {
2052 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2054 /* .audio_inputs= 0, */
2057 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2058 via the upper nibble of muxsel. here: used for
2059 xternal video-mux */
2060 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2061 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2064 .tuner_type = TUNER_ABSENT,
2065 .tuner_addr = ADDR_UNSET,
2067 [BTTV_BOARD_VD009_COMBI] = {
2068 .name = "PHYTEC VD-009 Combi (bt878)",
2070 /* .audio_inputs= 0, */
2073 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2074 via the upper nibble of muxsel. here: used for
2075 xternal video-mux */
2076 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2077 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2080 .tuner_type = TUNER_ABSENT,
2081 .tuner_addr = ADDR_UNSET,
2083 [BTTV_BOARD_IVC100] = {
2086 /* .audio_inputs= 0, */
2087 .tuner_type = TUNER_ABSENT,
2088 .tuner_addr = ADDR_UNSET,
2091 .muxsel = { 2, 3, 1, 0 },
2094 [BTTV_BOARD_IVC120] = {
2095 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2098 /* .audio_inputs= 0, */
2099 .tuner_type = TUNER_ABSENT,
2100 .tuner_addr = ADDR_UNSET,
2101 .svhs = NO_SVHS, /* card has no svhs */
2107 .muxsel = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
2108 .muxsel_hook = ivc120_muxsel,
2112 /* ---- card 0x70 ---------------------------------- */
2113 [BTTV_BOARD_PC_HDTV] = {
2114 .name = "pcHDTV HD-2000 TV",
2116 /* .audio_inputs= 1, */
2118 .muxsel = { 2, 3, 1, 0 },
2119 .tuner_type = TUNER_PHILIPS_FCV1236D,
2120 .tuner_addr = ADDR_UNSET,
2123 [BTTV_BOARD_TWINHAN_DST] = {
2124 .name = "Twinhan DST + clones",
2128 .tuner_type = TUNER_ABSENT,
2129 .tuner_addr = ADDR_UNSET,
2133 [BTTV_BOARD_WINFASTVC100] = {
2134 .name = "Winfast VC100",
2136 /* .audio_inputs= 0, */
2138 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2142 .tuner_type = TUNER_ABSENT,
2143 .tuner_addr = ADDR_UNSET,
2146 [BTTV_BOARD_TEV560] = {
2147 .name = "Teppro TEV-560/InterVision IV-560",
2149 /* .audio_inputs= 1, */
2152 .muxsel = { 2, 3, 1, 1 },
2153 .gpiomux = { 1, 1, 1, 1 },
2155 .tuner_type = TUNER_PHILIPS_PAL,
2156 .tuner_addr = ADDR_UNSET,
2160 /* ---- card 0x74 ---------------------------------- */
2161 [BTTV_BOARD_SIMUS_GVC1100] = {
2162 .name = "SIMUS GVC1100",
2164 /* .audio_inputs= 0, */
2166 .tuner_type = TUNER_ABSENT,
2167 .tuner_addr = ADDR_UNSET,
2169 .muxsel = { 2, 2, 2, 2 },
2171 .muxsel_hook = gvc1100_muxsel,
2173 [BTTV_BOARD_NGSTV_PLUS] = {
2174 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2175 .name = "NGS NGSTV+",
2178 .gpiomask = 0x008007,
2179 .muxsel = { 2, 3, 0, 0 },
2180 .gpiomux = { 0, 0, 0, 0 },
2181 .gpiomute = 0x000003,
2183 .tuner_type = TUNER_PHILIPS_PAL,
2184 .tuner_addr = ADDR_UNSET,
2187 [BTTV_BOARD_LMLBT4] = {
2188 /* http://linuxmedialabs.com */
2190 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2191 /* .audio_inputs= 0, */
2193 .muxsel = { 2, 3, 1, 0 },
2198 .tuner_type = TUNER_ABSENT,
2199 .tuner_addr = ADDR_UNSET,
2201 [BTTV_BOARD_TEKRAM_M205] = {
2202 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2203 .name = "Tekram M205 PRO",
2205 /* .audio_inputs= 1, */
2206 .tuner_type = TUNER_PHILIPS_PAL,
2207 .tuner_addr = ADDR_UNSET,
2211 .muxsel = { 2, 3, 1 },
2212 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2216 /* ---- card 0x78 ---------------------------------- */
2217 [BTTV_BOARD_CONTVFMI] = {
2218 /* Javier Cendan Ares <jcendan@lycos.es> */
2219 /* bt878 TV + FM without subsystem ID */
2220 .name = "Conceptronic CONTVFMi",
2222 /* .audio_inputs= 1, */
2224 .gpiomask = 0x008007,
2225 .muxsel = { 2, 3, 1, 1 },
2226 .gpiomux = { 0, 1, 2, 2 },
2230 .tuner_type = TUNER_PHILIPS_PAL,
2231 .tuner_addr = ADDR_UNSET,
2235 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2236 /*Eric DEBIEF <debief@telemsa.com>*/
2237 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2238 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2240 .name = "Euresys Picolo Tetra",
2242 /* .audio_inputs= 0, */
2245 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2249 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2250 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2253 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2254 .tuner_type = TUNER_ABSENT,
2255 .tuner_addr = ADDR_UNSET,
2257 [BTTV_BOARD_SPIRIT_TV] = {
2258 /* Spirit TV Tuner from http://spiritmodems.com.au */
2259 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2260 .name = "Spirit TV Tuner",
2262 /* .audio_inputs= 1, */
2264 .gpiomask = 0x0000000f,
2265 .muxsel = { 2, 1, 1 },
2266 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2267 .tuner_type = TUNER_TEMIC_PAL,
2268 .tuner_addr = ADDR_UNSET,
2272 [BTTV_BOARD_AVDVBT_771] = {
2273 /* Wolfram Joost <wojo@frokaschwei.de> */
2274 .name = "AVerMedia AVerTV DVB-T 771",
2277 .tuner_type = TUNER_ABSENT,
2278 .tuner_addr = ADDR_UNSET,
2279 .muxsel = { 3 , 3 },
2288 /* ---- card 0x7c ---------------------------------- */
2289 [BTTV_BOARD_AVDVBT_761] = {
2290 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2291 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2292 .name = "AverMedia AverTV DVB-T 761",
2295 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2300 .tuner_type = TUNER_ABSENT,
2301 .tuner_addr = ADDR_UNSET,
2306 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2307 /* andre.schwarz@matrix-vision.de */
2308 .name = "MATRIX Vision Sigma-SQ",
2310 /* .audio_inputs= 0, */
2313 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2314 3, 3, 3, 3, 3, 3, 3, 3 },
2315 .muxsel_hook = sigmaSQ_muxsel,
2319 .tuner_type = TUNER_ABSENT,
2320 .tuner_addr = ADDR_UNSET,
2322 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2323 /* andre.schwarz@matrix-vision.de */
2324 .name = "MATRIX Vision Sigma-SLC",
2326 /* .audio_inputs= 0, */
2329 .muxsel = { 2, 2, 2, 2 },
2330 .muxsel_hook = sigmaSLC_muxsel,
2334 .tuner_type = TUNER_ABSENT,
2335 .tuner_addr = ADDR_UNSET,
2337 /* BTTV_BOARD_APAC_VIEWCOMP */
2338 [BTTV_BOARD_APAC_VIEWCOMP] = {
2339 /* Attila Kondoros <attila.kondoros@chello.hu> */
2340 /* bt878 TV + FM 0x00000000 subsystem ID */
2341 .name = "APAC Viewcomp 878(AMAX)",
2343 /* .audio_inputs= 1, */
2346 .muxsel = { 2, 3, 1, 1 },
2347 .gpiomux = { 2, 0, 0, 0 },
2351 .tuner_type = TUNER_PHILIPS_PAL,
2352 .tuner_addr = ADDR_UNSET,
2353 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2354 .has_radio = 1, /* not every card has radio */
2357 /* ---- card 0x80 ---------------------------------- */
2358 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2359 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2360 .name = "DViCO FusionHDTV DVB-T Lite",
2367 .tuner_type = TUNER_ABSENT,
2368 .tuner_addr = ADDR_UNSET,
2370 [BTTV_BOARD_VGEAR_MYVCD] = {
2371 /* Steven <photon38@pchome.com.tw> */
2372 .name = "V-Gear MyVCD",
2374 /* .audio_inputs= 1, */
2377 .muxsel = {2, 3, 1, 0 },
2378 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2382 .tuner_type = TUNER_PHILIPS_NTSC_M,
2383 .tuner_addr = ADDR_UNSET,
2386 [BTTV_BOARD_SUPER_TV] = {
2387 /* Rick C <cryptdragoon@gmail.com> */
2388 .name = "Super TV Tuner",
2390 /* .audio_inputs= 1, */
2392 .muxsel = { 2, 3, 1, 0 },
2393 .tuner_type = TUNER_PHILIPS_NTSC,
2394 .tuner_addr = ADDR_UNSET,
2395 .gpiomask = 0x008007,
2396 .gpiomux = { 0, 0x000001,0,0 },
2400 [BTTV_BOARD_TIBET_CS16] = {
2401 /* Chris Fanning <video4linux@haydon.net> */
2402 .name = "Tibet Systems 'Progress DVR' CS16",
2404 /* .audio_inputs= 0, */
2406 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2411 .tuner_type = TUNER_ABSENT,
2412 .tuner_addr = ADDR_UNSET,
2413 .muxsel_hook = tibetCS16_muxsel,
2415 [BTTV_BOARD_KODICOM_4400R] = {
2416 /* Bill Brack <wbrack@mmm.com.hk> */
2418 * Note that, because of the card's wiring, the "master"
2419 * BT878A chip (i.e. the one which controls the analog switch
2420 * and must use this card type) is the 2nd one detected. The
2421 * other 3 chips should use card type 0x85, whose description
2422 * follows this one. There is a EEPROM on the card (which is
2423 * connected to the I2C of one of those other chips), but is
2424 * not currently handled. There is also a facility for a
2425 * "monitor", which is also not currently implemented.
2427 .name = "Kodicom 4400R (master)",
2429 /* .audio_inputs= 0, */
2430 .tuner_type = TUNER_ABSENT,
2431 .tuner_addr = ADDR_UNSET,
2433 /* GPIO bits 0-9 used for analog switch:
2434 * 00 - 03: camera selector
2435 * 04 - 06: channel (controller) selector
2436 * 07: data (1->on, 0->off)
2439 * bit 16 is input from sync separator for the channel
2441 .gpiomask = 0x0003ff,
2443 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2448 .muxsel_hook = kodicom4400r_muxsel,
2450 [BTTV_BOARD_KODICOM_4400R_SL] = {
2451 /* Bill Brack <wbrack@mmm.com.hk> */
2452 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2453 * one which controls the analog switch, and must use the card type)
2454 * is the 2nd one detected. The other 3 chips should use this card
2457 .name = "Kodicom 4400R (slave)",
2459 /* .audio_inputs= 0, */
2460 .tuner_type = TUNER_ABSENT,
2461 .tuner_addr = ADDR_UNSET,
2463 .gpiomask = 0x010000,
2465 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2470 .muxsel_hook = kodicom4400r_muxsel,
2472 /* ---- card 0x86---------------------------------- */
2473 [BTTV_BOARD_ADLINK_RTV24] = {
2474 /* Michael Henson <mhenson@clarityvi.com> */
2475 /* Adlink RTV24 with special unlock codes */
2476 .name = "Adlink RTV24",
2478 /* .audio_inputs= 1, */
2480 .muxsel = { 2, 3, 1, 0 },
2481 .tuner_type = UNSET,
2482 .tuner_addr = ADDR_UNSET,
2485 /* ---- card 0x87---------------------------------- */
2486 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2487 /* Michael Krufky <mkrufky@m1k.net> */
2488 .name = "DViCO FusionHDTV 5 Lite",
2489 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2490 .tuner_addr = ADDR_UNSET,
2492 /* .audio_inputs= 1, */
2494 .muxsel = { 2, 3, 1 },
2495 .gpiomask = 0x00e00007,
2496 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2497 .gpiomute = 0x00c00007,
2503 /* ---- card 0x88---------------------------------- */
2504 [BTTV_BOARD_ACORP_Y878F] = {
2505 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2506 .name = "Acorp Y878F",
2508 /* .audio_inputs= 1, */
2510 .gpiomask = 0x01fe00,
2511 .muxsel = { 2, 3, 1, 1 },
2512 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2513 .gpiomute = 0x002000,
2516 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2517 .tuner_addr = 0xc1 >>1,
2520 /* ---- card 0x89 ---------------------------------- */
2521 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2522 .name = "Conceptronic CTVFMi v2",
2524 /* .audio_inputs= 1, */
2526 .gpiomask = 0x001c0007,
2527 .muxsel = { 2, 3, 1, 1 },
2528 .gpiomux = { 0, 1, 2, 2 },
2532 .tuner_type = TUNER_TENA_9533_DI,
2533 .tuner_addr = ADDR_UNSET,
2537 /* ---- card 0x8a ---------------------------------- */
2538 [BTTV_BOARD_PV_BT878P_2E] = {
2539 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2541 /* .audio_inputs= 1, */
2544 .gpiomask = 0x01fe00,
2545 .muxsel = { 2, 3, 1, 1, 0 }, /* in 4 is digital */
2546 /* .digital_mode= DIGITAL_MODE_CAMERA, */
2547 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2548 .gpiomute = 0x12400,
2551 .tuner_type = TUNER_LG_PAL_FM,
2552 .tuner_addr = ADDR_UNSET,
2555 /* ---- card 0x8b ---------------------------------- */
2556 [BTTV_BOARD_PV_M4900] = {
2557 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2558 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2560 /* .audio_inputs= 1, */
2563 .muxsel = { 2, 3, 1, 1 },
2564 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2568 .tuner_type = TUNER_YMEC_TVF_5533MF,
2569 .tuner_addr = ADDR_UNSET,
2573 /* ---- card 0x8c ---------------------------------- */
2574 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2575 one external BNC composite input (mux 2)
2576 three internal composite inputs (unknown muxes)
2577 an 18-bit stereo A/D (CS5331A), which has:
2578 one external stereo unblanced (RCA) audio connection
2579 one (or 3?) internal stereo balanced (XLR) audio connection
2580 input is selected via gpio to a 14052B mux
2581 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2582 gain is controlled via an X9221A chip on the I2C bus @0x28
2583 sample rate is controlled via gpio to an MK1413S
2584 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2585 There is neither a tuner nor an svideo input. */
2586 [BTTV_BOARD_OSPREY440] = {
2587 .name = "Osprey 440",
2589 /* .audio_inputs= 2, */
2591 .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */
2593 .gpiomute = 0x000, /* int + 32kHz */
2594 .gpiomux = { 0, 0, 0x000, 0x100},
2596 .tuner_type = TUNER_ABSENT,
2597 .tuner_addr = ADDR_UNSET,
2602 /* ---- card 0x8d ---------------------------------- */
2603 [BTTV_BOARD_ASOUND_SKYEYE] = {
2604 .name = "Asound Skyeye PCTV",
2606 /* .audio_inputs= 1, */
2609 .muxsel = { 2, 3, 1, 1 },
2610 .gpiomux = { 2, 0, 0, 0 },
2614 .tuner_type = TUNER_PHILIPS_NTSC,
2615 .tuner_addr = ADDR_UNSET,
2617 /* ---- card 0x8e ---------------------------------- */
2618 [BTTV_BOARD_SABRENT_TVFM] = {
2619 .name = "Sabrent TV-FM (bttv version)",
2621 /* .audio_inputs= 1, */
2623 .gpiomask = 0x108007,
2624 .muxsel = { 2, 3, 1, 1 },
2625 .gpiomux = { 100000, 100002, 100002, 100000 },
2630 .tuner_type = TUNER_TNF_5335MF,
2631 .tuner_addr = ADDR_UNSET,
2634 /* ---- card 0x8f ---------------------------------- */
2635 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2636 .name = "Hauppauge ImpactVCB (bt878)",
2638 /* .audio_inputs= 0, */
2640 .gpiomask = 0x0f, /* old: 7 */
2641 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2645 .tuner_type = TUNER_ABSENT,
2646 .tuner_addr = ADDR_UNSET,
2648 [BTTV_BOARD_MACHTV_MAGICTV] = {
2649 /* Julian Calaby <julian.calaby@gmail.com>
2650 * Slightly different from original MachTV definition (0x60)
2652 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2653 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2654 * properly (methinks) causing no keyup bits being set */
2656 .name = "MagicTV", /* rebranded MachTV */
2658 /* .audio_inputs= 1, */
2661 .muxsel = { 2, 3, 1, 1 },
2662 .gpiomux = { 0, 1, 2, 3 },
2664 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2665 .tuner_addr = ADDR_UNSET,
2670 [BTTV_BOARD_SSAI_SECURITY] = {
2671 .name = "SSAI Security Video Interface",
2673 /* .audio_inputs= 0, */
2675 .muxsel = { 0, 1, 2, 3 },
2676 .tuner_type = TUNER_ABSENT,
2677 .tuner_addr = ADDR_UNSET,
2679 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2680 .name = "SSAI Ultrasound Video Interface",
2682 /* .audio_inputs= 0, */
2684 .muxsel = { 2, 0, 1, 3 },
2685 .tuner_type = TUNER_ABSENT,
2686 .tuner_addr = ADDR_UNSET,
2688 /* ---- card 0x94---------------------------------- */
2689 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2690 .name = "DViCO FusionHDTV 2",
2691 .tuner_type = TUNER_PHILIPS_FCV1236D,
2692 .tuner_addr = ADDR_UNSET,
2694 /* .audio_inputs= 1, */
2696 .muxsel = { 2, 3, 1 },
2697 .gpiomask = 0x00e00007,
2698 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2699 .gpiomute = 0x00c00007,
2704 /* ---- card 0x95---------------------------------- */
2705 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2706 .name = "Typhoon TV-Tuner PCI (50684)",
2708 /* .audio_inputs= 1, */
2710 .gpiomask = 0x3014f,
2711 .muxsel = { 2, 3, 1, 1 },
2712 .gpiomux = { 0x20001,0x10001, 0, 0 },
2716 .tuner_type = TUNER_PHILIPS_PAL_I,
2717 .tuner_addr = ADDR_UNSET,
2719 [BTTV_BOARD_GEOVISION_GV600] = {
2721 .name = "Geovision GV-600",
2723 /* .audio_inputs= 0, */
2726 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2727 2, 2, 2, 2, 2, 2, 2, 2 },
2728 .muxsel_hook = geovision_muxsel,
2732 .tuner_type = TUNER_ABSENT,
2733 .tuner_addr = ADDR_UNSET,
2735 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2736 /* Mauro Lacy <mauro@lacy.com.ar>
2737 * Based on MagicTV and Conceptronic CONTVFMi */
2739 .name = "Kozumi KTV-01C",
2741 /* .audio_inputs= 1, */
2743 .gpiomask = 0x008007,
2744 .muxsel = { 2, 3, 1, 1 },
2745 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2746 .gpiomute = 3, /* CONTVFMi */
2748 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2749 .tuner_addr = ADDR_UNSET,
2754 [BTTV_BOARD_ENLTV_FM_2] = {
2755 /* Encore TV Tuner Pro ENL TV-FM-2
2756 Mauro Carvalho Chehab <mchehab@infradead.org */
2757 .name = "Encore ENL TV-FM-2",
2759 /* .audio_inputs= 1, */
2761 /* bit 6 -> IR disabled
2762 bit 18/17 = 00 -> mute
2763 01 -> enable external audio input
2764 10 -> internal audio input (mono?)
2765 11 -> internal audio input
2767 .gpiomask = 0x060040,
2768 .muxsel = { 2, 3, 3 },
2769 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2771 .tuner_type = TUNER_TCL_MF02GIP_5N,
2772 .tuner_addr = ADDR_UNSET,
2777 [BTTV_BOARD_VD012] = {
2778 /* D.Heer@Phytec.de */
2779 .name = "PHYTEC VD-012 (bt878)",
2781 /* .audio_inputs= 0, */
2784 .muxsel = { 0, 2, 3, 1 },
2785 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2788 .tuner_type = TUNER_ABSENT,
2789 .tuner_addr = ADDR_UNSET,
2791 [BTTV_BOARD_VD012_X1] = {
2792 /* D.Heer@Phytec.de */
2793 .name = "PHYTEC VD-012-X1 (bt878)",
2795 /* .audio_inputs= 0, */
2798 .muxsel = { 2, 3, 1 },
2799 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2802 .tuner_type = TUNER_ABSENT,
2803 .tuner_addr = ADDR_UNSET,
2805 [BTTV_BOARD_VD012_X2] = {
2806 /* D.Heer@Phytec.de */
2807 .name = "PHYTEC VD-012-X2 (bt878)",
2809 /* .audio_inputs= 0, */
2812 .muxsel = { 3, 2, 1 },
2813 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2816 .tuner_type = TUNER_ABSENT,
2817 .tuner_addr = ADDR_UNSET,
2821 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2823 /* ----------------------------------------------------------------------- */
2825 static unsigned char eeprom_data[256];
2830 void __devinit bttv_idcard(struct bttv *btv)
2832 unsigned int gpiobits;
2836 /* read PCI subsystem ID */
2837 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2838 btv->cardid = tmp << 16;
2839 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2842 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2843 /* look for the card */
2844 for (type = -1, i = 0; cards[i].id != 0; i++)
2845 if (cards[i].id == btv->cardid)
2850 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2851 "PCI subsystem ID is %04x:%04x\n",
2852 btv->c.nr,cards[type].name,cards[type].cardnr,
2853 btv->cardid & 0xffff,
2854 (btv->cardid >> 16) & 0xffff);
2855 btv->c.type = cards[type].cardnr;
2858 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2859 btv->c.nr, btv->cardid & 0xffff,
2860 (btv->cardid >> 16) & 0xffff);
2861 printk(KERN_DEBUG "please mail id, board name and "
2862 "the correct card= insmod option to video4linux-list@redhat.com\n");
2866 /* let the user override the autodetected type */
2867 if (card[btv->c.nr] < bttv_num_tvcards)
2868 btv->c.type=card[btv->c.nr];
2870 /* print which card config we are using */
2871 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2872 bttv_tvcards[btv->c.type].name, btv->c.type,
2873 card[btv->c.nr] < bttv_num_tvcards
2874 ? "insmod option" : "autodetected");
2876 /* overwrite gpio stuff ?? */
2877 if (UNSET == audioall && UNSET == audiomux[0])
2880 if (UNSET != audiomux[0]) {
2882 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2883 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2884 gpiobits |= audiomux[i];
2887 gpiobits = audioall;
2888 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2889 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2892 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2893 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2894 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2895 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2896 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2902 * (most) board specific initialisations goes here
2905 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2906 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2910 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2911 type = BTTV_BOARD_MODTEC_205;
2912 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2913 type = BTTV_BOARD_EURESYS_PICOLO;
2914 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2915 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2919 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2920 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2924 static void flyvideo_gpio(struct bttv *btv)
2926 int gpio, has_remote, has_radio, is_capture_only;
2927 int is_lr90, has_tda9820_tda9821;
2928 int tuner_type = UNSET, ttype;
2930 gpio_inout(0xffffff, 0);
2931 udelay(8); /* without this we would see the 0x1800 mask */
2933 /* FIXME: must restore OUR_EN ??? */
2935 /* all cards provide GPIO info, some have an additional eeprom
2936 * LR50: GPIO coding can be found lower right CP1 .. CP9
2937 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2939 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
2941 * lowest 3 bytes are remote control codes (no handshake needed)
2942 * xxxFFF: No remote control chip soldered
2943 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2944 * Note: Some bits are Audio_Mask !
2946 ttype = (gpio & 0x0f0000) >> 16;
2949 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
2952 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
2955 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
2958 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
2961 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
2964 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2968 has_remote = gpio & 0x800000;
2969 has_radio = gpio & 0x400000;
2970 /* unknown 0x200000;
2971 * unknown2 0x100000; */
2972 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
2973 has_tda9820_tda9821 = !(gpio & 0x004000);
2974 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2976 * gpio & 0x001000 output bit for audio routing */
2978 if (is_capture_only)
2979 tuner_type = TUNER_ABSENT; /* No tuner present */
2981 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2982 btv->c.nr, has_radio ? "yes" : "no ",
2983 has_remote ? "yes" : "no ", tuner_type, gpio);
2984 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2985 btv->c.nr, is_lr90 ? "yes" : "no ",
2986 has_tda9820_tda9821 ? "yes" : "no ",
2987 is_capture_only ? "yes" : "no ");
2989 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
2990 btv->tuner_type = tuner_type;
2991 btv->has_radio = has_radio;
2993 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2994 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2995 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
2996 if (has_tda9820_tda9821)
2997 btv->audio_mode_gpio = lt9415_audio;
2998 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3001 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3002 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3003 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3004 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3006 static void miro_pinnacle_gpio(struct bttv *btv)
3011 gpio_inout(0xffffff, 0);
3013 id = ((gpio>>10) & 63) -1;
3014 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3016 btv->tuner_type = miro_tunermap[id];
3017 if (0 == (gpio & 0x20)) {
3019 if (!miro_fmtuner[id]) {
3020 btv->has_matchbox = 1;
3021 btv->mbox_we = (1<<6);
3022 btv->mbox_most = (1<<7);
3023 btv->mbox_clk = (1<<8);
3024 btv->mbox_data = (1<<9);
3025 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3031 if (btv->c.type == BTTV_BOARD_MIRO)
3032 btv->c.type = BTTV_BOARD_MIROPRO;
3033 if (btv->c.type == BTTV_BOARD_PINNACLE)
3034 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3037 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3038 btv->c.nr, id+1, btv->tuner_type,
3039 !btv->has_radio ? "no" :
3040 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3041 (-1 == msp) ? "no" : "yes");
3043 /* new cards with microtune tuner */
3048 info = "PAL / mono";
3049 btv->tda9887_conf = TDA9887_INTERCARRIER;
3052 info = "PAL+SECAM / stereo";
3054 btv->tda9887_conf = TDA9887_QSS;
3057 info = "NTSC / stereo";
3059 btv->tda9887_conf = TDA9887_QSS;
3062 info = "PAL+SECAM / mono";
3063 btv->tda9887_conf = TDA9887_QSS;
3066 info = "NTSC / mono";
3067 btv->tda9887_conf = TDA9887_INTERCARRIER;
3070 info = "NTSC / stereo";
3071 btv->tda9887_conf = TDA9887_INTERCARRIER;
3074 info = "PAL / stereo";
3075 btv->tda9887_conf = TDA9887_INTERCARRIER;
3078 info = "oops: unknown card";
3082 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3084 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3085 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3086 btv->tuner_type = TUNER_MT2032;
3090 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3091 #define LM1882_SYNC_DRIVE 0x200000L
3093 static void init_ids_eagle(struct bttv *btv)
3095 gpio_inout(0xffffff,0xFFFF37);
3096 gpio_write(0x200020);
3098 /* flash strobe inverter ?! */
3099 gpio_write(0x200024);
3101 /* switch sync drive off */
3102 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3104 /* set BT848 muxel to 2 */
3105 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3108 /* Muxsel helper for the IDS Eagle.
3109 * the eagles does not use the standard muxsel-bits but
3110 * has its own multiplexer */
3111 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3113 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3114 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3117 /* set chroma ADC to sleep */
3118 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3119 /* set to composite video */
3120 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3121 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3123 /* switch sync drive off */
3124 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3127 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3129 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3130 gpio_write(masks[input%4]);
3133 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3136 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3137 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3139 IN - sensor inputs, INx - sensor inputs and TI XORed together
3140 O1,O2,O3 - alarm outputs (relays)
3142 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3146 static void init_lmlbt4x(struct bttv *btv)
3148 printk(KERN_DEBUG "LMLBT4x init\n");
3149 btwrite(0x000000, BT848_GPIO_REG_INP);
3150 gpio_inout(0xffffff, 0x0006C0);
3151 gpio_write(0x000000);
3154 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3156 unsigned int inmux = input % 8;
3157 gpio_inout( 0xf, 0xf );
3158 gpio_bits( 0xf, inmux );
3161 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3163 unsigned int inmux = input % 4;
3164 gpio_inout( 3<<9, 3<<9 );
3165 gpio_bits( 3<<9, inmux<<9 );
3168 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3170 unsigned int inmux = input % 16;
3171 gpio_inout(0xf, 0xf);
3172 gpio_bits(0xf, inmux);
3175 /* ----------------------------------------------------------------------- */
3177 static void bttv_reset_audio(struct bttv *btv)
3180 * BT878A has a audio-reset register.
3181 * 1. This register is an audio reset function but it is in
3182 * function-0 (video capture) address space.
3183 * 2. It is enough to do this once per power-up of the card.
3184 * 3. There is a typo in the Conexant doc -- it is not at
3185 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3186 * --//Shrikumar 030609
3192 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3193 btwrite((1<<7), 0x058);
3198 /* initialization part one -- before registering i2c bus */
3199 void __devinit bttv_init_card1(struct bttv *btv)
3201 switch (btv->c.type) {
3202 case BTTV_BOARD_HAUPPAUGE:
3203 case BTTV_BOARD_HAUPPAUGE878:
3204 boot_msp34xx(btv,5);
3206 case BTTV_BOARD_VOODOOTV_200:
3207 case BTTV_BOARD_VOODOOTV_FM:
3208 boot_msp34xx(btv,20);
3210 case BTTV_BOARD_AVERMEDIA98:
3211 boot_msp34xx(btv,11);
3213 case BTTV_BOARD_HAUPPAUGEPVR:
3216 case BTTV_BOARD_TWINHAN_DST:
3217 case BTTV_BOARD_AVDVBT_771:
3218 case BTTV_BOARD_PINNACLESAT:
3219 btv->use_i2c_hw = 1;
3221 case BTTV_BOARD_ADLINK_RTV24:
3226 if (!bttv_tvcards[btv->c.type].has_dvb)
3227 bttv_reset_audio(btv);
3230 /* initialization part two -- after registering i2c bus */
3231 void __devinit bttv_init_card2(struct bttv *btv)
3233 int addr=ADDR_UNSET;
3235 btv->tuner_type = UNSET;
3237 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3238 bttv_readee(btv,eeprom_data,0xa0);
3239 identify_by_eeprom(btv,eeprom_data);
3242 switch (btv->c.type) {
3243 case BTTV_BOARD_MIRO:
3244 case BTTV_BOARD_MIROPRO:
3245 case BTTV_BOARD_PINNACLE:
3246 case BTTV_BOARD_PINNACLEPRO:
3248 miro_pinnacle_gpio(btv);
3250 case BTTV_BOARD_FLYVIDEO_98:
3251 case BTTV_BOARD_MAXI:
3252 case BTTV_BOARD_LIFE_FLYKIT:
3253 case BTTV_BOARD_FLYVIDEO:
3254 case BTTV_BOARD_TYPHOON_TVIEW:
3255 case BTTV_BOARD_CHRONOS_VS2:
3256 case BTTV_BOARD_FLYVIDEO_98FM:
3257 case BTTV_BOARD_FLYVIDEO2000:
3258 case BTTV_BOARD_FLYVIDEO98EZ:
3259 case BTTV_BOARD_CONFERENCETV:
3260 case BTTV_BOARD_LIFETEC_9415:
3263 case BTTV_BOARD_HAUPPAUGE:
3264 case BTTV_BOARD_HAUPPAUGE878:
3265 case BTTV_BOARD_HAUPPAUGEPVR:
3266 /* pick up some config infos from the eeprom */
3267 bttv_readee(btv,eeprom_data,0xa0);
3268 hauppauge_eeprom(btv);
3270 case BTTV_BOARD_AVERMEDIA98:
3271 case BTTV_BOARD_AVPHONE98:
3272 bttv_readee(btv,eeprom_data,0xa0);
3273 avermedia_eeprom(btv);
3275 case BTTV_BOARD_PXC200:
3278 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3279 picolo_tetra_init(btv);
3281 case BTTV_BOARD_VHX:
3283 btv->has_matchbox = 1;
3284 btv->mbox_we = 0x20;
3286 btv->mbox_clk = 0x08;
3287 btv->mbox_data = 0x10;
3288 btv->mbox_mask = 0x38;
3290 case BTTV_BOARD_VOBIS_BOOSTAR:
3291 case BTTV_BOARD_TERRATV:
3292 terratec_active_radio_upgrade(btv);
3294 case BTTV_BOARD_MAGICTVIEW061:
3295 if (btv->cardid == 0x3002144f) {
3297 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3300 case BTTV_BOARD_STB2:
3301 if (btv->cardid == 0x3060121a) {
3302 /* Fix up entry for 3DFX VoodooTV 100,
3303 which is an OEM STB card variant. */
3305 btv->tuner_type=TUNER_TEMIC_NTSC;
3308 case BTTV_BOARD_OSPREY1x0:
3309 case BTTV_BOARD_OSPREY1x0_848:
3310 case BTTV_BOARD_OSPREY101_848:
3311 case BTTV_BOARD_OSPREY1x1:
3312 case BTTV_BOARD_OSPREY1x1_SVID:
3313 case BTTV_BOARD_OSPREY2xx:
3314 case BTTV_BOARD_OSPREY2x0_SVID:
3315 case BTTV_BOARD_OSPREY2x0:
3316 case BTTV_BOARD_OSPREY440:
3317 case BTTV_BOARD_OSPREY500:
3318 case BTTV_BOARD_OSPREY540:
3319 case BTTV_BOARD_OSPREY2000:
3320 bttv_readee(btv,eeprom_data,0xa0);
3321 osprey_eeprom(btv, eeprom_data);
3323 case BTTV_BOARD_IDS_EAGLE:
3324 init_ids_eagle(btv);
3326 case BTTV_BOARD_MODTEC_205:
3327 bttv_readee(btv,eeprom_data,0xa0);
3330 case BTTV_BOARD_LMLBT4:
3333 case BTTV_BOARD_TIBET_CS16:
3334 tibetCS16_init(btv);
3336 case BTTV_BOARD_KODICOM_4400R:
3337 kodicom4400r_init(btv);
3341 /* pll configuration */
3342 if (!(btv->id==848 && btv->revision==0x11)) {
3343 /* defaults from card list */
3344 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3345 btv->pll.pll_ifreq=28636363;
3346 btv->pll.pll_crystal=BT848_IFORM_XT0;
3348 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3349 btv->pll.pll_ifreq=35468950;
3350 btv->pll.pll_crystal=BT848_IFORM_XT1;
3352 /* insmod options can override */
3353 switch (pll[btv->c.nr]) {
3355 btv->pll.pll_crystal = 0;
3356 btv->pll.pll_ifreq = 0;
3357 btv->pll.pll_ofreq = 0;
3359 case 1: /* 28 MHz */
3361 btv->pll.pll_ifreq = 28636363;
3362 btv->pll.pll_ofreq = 0;
3363 btv->pll.pll_crystal = BT848_IFORM_XT0;
3365 case 2: /* 35 MHz */
3367 btv->pll.pll_ifreq = 35468950;
3368 btv->pll.pll_ofreq = 0;
3369 btv->pll.pll_crystal = BT848_IFORM_XT1;
3373 btv->pll.pll_current = -1;
3375 /* tuner configuration (from card list / autodetect / insmod option) */
3376 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3377 addr = bttv_tvcards[btv->c.type].tuner_addr;
3379 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3380 if (UNSET == btv->tuner_type)
3381 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3382 if (UNSET != tuner[btv->c.nr])
3383 btv->tuner_type = tuner[btv->c.nr];
3385 if (btv->tuner_type == TUNER_ABSENT)
3386 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3387 else if(btv->tuner_type == UNSET)
3388 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3390 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3393 if (UNSET == btv->tuner_type)
3394 btv->tuner_type = TUNER_ABSENT;
3396 if (btv->tuner_type != TUNER_ABSENT) {
3397 struct tuner_setup tun_setup;
3399 /* Load tuner module before issuing tuner config call! */
3401 request_module("tuner");
3403 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3404 tun_setup.type = btv->tuner_type;
3405 tun_setup.addr = addr;
3407 if (bttv_tvcards[btv->c.type].has_radio)
3408 tun_setup.mode_mask |= T_RADIO;
3410 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3413 if (btv->tda9887_conf) {
3414 struct v4l2_priv_tun_config tda9887_cfg;
3416 tda9887_cfg.tuner = TUNER_TDA9887;
3417 tda9887_cfg.priv = &btv->tda9887_conf;
3419 bttv_call_i2c_clients(btv, TUNER_SET_CONFIG, &tda9887_cfg);
3422 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3423 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3424 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3425 UNSET : bttv_tvcards[btv->c.type].svhs;
3426 if (svhs[btv->c.nr] != UNSET)
3427 btv->svhs = svhs[btv->c.nr];
3428 if (remote[btv->c.nr] != UNSET)
3429 btv->has_remote = remote[btv->c.nr];
3431 if (bttv_tvcards[btv->c.type].has_radio)
3433 if (bttv_tvcards[btv->c.type].has_remote)
3435 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3437 if (bttv_tvcards[btv->c.type].volume_gpio)
3438 btv->volume_gpio=bttv_tvcards[btv->c.type].volume_gpio;
3439 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3440 btv->audio_mode_gpio=bttv_tvcards[btv->c.type].audio_mode_gpio;
3445 if (btv->tuner_type == TUNER_ABSENT)
3446 return; /* no tuner or related drivers to load */
3448 /* try to detect audio/fader chips */
3449 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3450 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3451 request_module("msp3400");
3453 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3454 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3455 request_module("msp3400");
3457 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3458 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3459 request_module("tda9875");
3461 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3462 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3463 request_module("tda7432");
3465 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3466 request_module("tvaudio");
3470 /* ----------------------------------------------------------------------- */
3472 static void modtec_eeprom(struct bttv *btv)
3474 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3475 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3476 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3477 btv->c.nr,&eeprom_data[0x1e]);
3478 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3479 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3480 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3481 btv->c.nr,&eeprom_data[0x1e]);
3482 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3483 btv->tuner_type=TUNER_PHILIPS_NTSC;
3484 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3485 btv->c.nr,&eeprom_data[0x1e]);
3487 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3488 btv->c.nr,&eeprom_data[0x1e]);
3492 static void __devinit hauppauge_eeprom(struct bttv *btv)
3496 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3497 btv->tuner_type = tv.tuner_type;
3498 btv->has_radio = tv.has_radio;
3500 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3501 btv->c.nr, tv.model);
3504 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3505 * type based on model #.
3507 if(tv.model == 64900) {
3508 printk("bttv%d: Switching board type from %s to %s\n",
3510 bttv_tvcards[btv->c.type].name,
3511 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3512 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3516 static int terratec_active_radio_upgrade(struct bttv *btv)
3521 btv->has_matchbox = 1;
3522 btv->mbox_we = 0x10;
3523 btv->mbox_most = 0x20;
3524 btv->mbox_clk = 0x08;
3525 btv->mbox_data = 0x04;
3526 btv->mbox_mask = 0x3c;
3528 btv->mbox_iow = 1 << 8;
3529 btv->mbox_ior = 1 << 9;
3530 btv->mbox_csel = 1 << 10;
3533 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3534 if (0x1ed8 == tea5757_read(btv)) {
3535 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3538 btv->has_matchbox = 1;
3541 btv->has_matchbox = 0;
3547 /* ----------------------------------------------------------------------- */
3550 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3552 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3553 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3554 * unpacked with unzip).
3556 #define PVR_GPIO_DELAY 10
3558 #define BTTV_ALT_DATA 0x000001
3559 #define BTTV_ALT_DCLK 0x100000
3560 #define BTTV_ALT_NCONFIG 0x800000
3562 static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3569 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3571 udelay(PVR_GPIO_DELAY);
3573 gpio_write(BTTV_ALT_NCONFIG);
3574 udelay(PVR_GPIO_DELAY);
3576 for (n = 0; n < microlen; n++) {
3578 for (i = 0 ; i < 8 ; i++) {
3579 gpio_bits(BTTV_ALT_DCLK,0);
3581 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3583 gpio_bits(BTTV_ALT_DATA,0);
3584 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3588 gpio_bits(BTTV_ALT_DCLK,0);
3589 udelay(PVR_GPIO_DELAY);
3591 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3592 for (i = 0 ; i < 30 ; i++) {
3593 gpio_bits(BTTV_ALT_DCLK,0);
3594 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3596 gpio_bits(BTTV_ALT_DCLK,0);
3600 static int __devinit pvr_boot(struct bttv *btv)
3602 const struct firmware *fw_entry;
3605 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3607 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3611 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3612 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3613 btv->c.nr, (rc < 0) ? "failed" : "ok");
3614 release_firmware(fw_entry);
3618 /* ----------------------------------------------------------------------- */
3619 /* some osprey specific stuff */
3621 static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3627 /* This code will nevery actually get called in this case.... */
3628 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3629 /* this might be an antique... check for MMAC label in eeprom */
3630 if (!strncmp(ee, "MMAC", 4)) {
3632 for (i = 0; i < 21; i++)
3634 if (checksum != ee[21])
3636 cardid = BTTV_BOARD_OSPREY1x0_848;
3637 for (i = 12; i < 21; i++)
3638 serial *= 10, serial += ee[i] - '0';
3641 unsigned short type;
3643 for (i = 4*16; i < 8*16; i += 16) {
3644 u16 checksum = ip_compute_csum(ee + i, 16);
3646 if ((checksum&0xff) + (checksum>>8) == 0xff)
3653 /* found a valid descriptor */
3654 type = get_unaligned_be16((__be16 *)(ee+4));
3659 cardid = BTTV_BOARD_OSPREY1x0_848;
3662 cardid = BTTV_BOARD_OSPREY101_848;
3668 cardid = BTTV_BOARD_OSPREY1x0;
3672 cardid = BTTV_BOARD_OSPREY1x1;
3677 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3683 cardid = BTTV_BOARD_OSPREY2xx;
3687 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3690 cardid = BTTV_BOARD_OSPREY500;
3694 cardid = BTTV_BOARD_OSPREY540;
3695 /* bttv_osprey_540_init(btv); */
3700 cardid = BTTV_BOARD_OSPREY2x0;
3701 /* enable output on select control lines */
3702 gpio_inout(0xffffff,0x000303);
3705 cardid = BTTV_BOARD_OSPREY440;
3708 /* unknown...leave generic, but get serial # */
3709 printk(KERN_INFO "bttv%d: "
3710 "osprey eeprom: unknown card type 0x%04x\n",
3714 serial = get_unaligned_be32((__be32 *)(ee+6));
3717 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
3719 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3721 if (cardid<0 || btv->c.type == cardid)
3724 /* card type isn't set correctly */
3725 if (card[btv->c.nr] < bttv_num_tvcards) {
3726 printk(KERN_WARNING "bttv%d: osprey eeprom: "
3727 "Not overriding user specified card type\n", btv->c.nr);
3729 printk(KERN_INFO "bttv%d: osprey eeprom: "
3730 "Changing card type from %d to %d\n", btv->c.nr,
3731 btv->c.type, cardid);
3732 btv->c.type = cardid;
3736 /* ----------------------------------------------------------------------- */
3737 /* AVermedia specific stuff, from bktr_card.c */
3739 static int tuner_0_table[] = {
3740 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3741 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3742 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3743 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3744 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3745 TUNER_PHILIPS_FM1216ME_MK3 };
3747 static int tuner_1_table[] = {
3748 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3749 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3750 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3751 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3752 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3754 static void __devinit avermedia_eeprom(struct bttv *btv)
3756 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3758 tuner_make = (eeprom_data[0x41] & 0x7);
3759 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3760 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3761 btv->has_remote = (eeprom_data[0x42] & 0x01);
3763 if (tuner_make == 0 || tuner_make == 2)
3764 if (tuner_format <= 0x0a)
3765 tuner_type = tuner_0_table[tuner_format];
3766 if (tuner_make == 1)
3767 if (tuner_format <= 9)
3768 tuner_type = tuner_1_table[tuner_format];
3770 if (tuner_make == 4)
3771 if (tuner_format == 0x09)
3772 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3774 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3775 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3777 btv->tuner_type = tuner_type;
3778 printk(KERN_CONT "%d", tuner_type);
3780 printk(KERN_CONT "Unknown type");
3781 printk(KERN_CONT " radio:%s remote control:%s\n",
3782 tuner_tv_fm ? "yes" : "no",
3783 btv->has_remote ? "yes" : "no");
3787 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
3788 * analog demod, which is not I2C controlled like the newer and more common
3789 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
3790 * that control the IF for the video and audio. Apparently, bttv GPIO
3791 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
3792 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
3794 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
3797 if (btv->audio == TVAUDIO_INPUT_TUNER) {
3798 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
3799 gpiobits |= 0x10000;
3801 gpiobits &= ~0x10000;
3804 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
3810 * reset/enable the MSP on some Hauppauge cards
3811 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3816 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3818 int mask = (1 << pin);
3820 gpio_inout(mask,mask);
3824 gpio_bits(mask,mask);
3827 bttv_gpio_tracking(btv,"msp34xx");
3829 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3830 "init [%d]\n", btv->c.nr, pin);
3833 /* ----------------------------------------------------------------------- */
3834 /* Imagenation L-Model PXC200 Framegrabber */
3835 /* This is basically the same procedure as
3836 * used by Alessandro Rubini in his pxc200
3837 * driver, but using BTTV functions */
3839 static void __devinit init_PXC200(struct bttv *btv)
3841 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3842 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3848 /* Initialise GPIO-connevted stuff */
3849 gpio_inout(0xffffff, (1<<13));
3853 /* GPIO inputs are pulled up, so no need to drive
3854 * reset pin any longer */
3855 gpio_bits(0xffffff, 0);
3857 bttv_gpio_tracking(btv,"pxc200");
3859 /* we could/should try and reset/control the AD pots? but
3860 right now we simply turned off the crushing. Without
3861 this the AGC drifts drifts
3862 remember the EN is reverse logic -->
3863 setting BT848_ADC_AGC_EN disable the AGC
3864 tboult@eecs.lehigh.edu
3867 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3869 /* Initialise MAX517 DAC */
3870 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3871 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3873 /* Initialise 12C508 PIC */
3874 /* The I2CWrite and I2CRead commmands are actually to the
3875 * same chips - but the R/W bit is included in the address
3876 * argument so the numbers are different */
3879 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3881 /* First of all, enable the clock line. This is used in the PXC200-F */
3882 val = btread(BT848_GPIO_DMA_CTL);
3883 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3884 btwrite(val, BT848_GPIO_DMA_CTL);
3886 /* Then, push to 0 the reset pin long enough to reset the *
3887 * device same as above for the reset line, but not the same
3888 * value sent to the GPIO-connected stuff
3889 * which one is the good one? */
3890 gpio_inout(0xffffff,(1<<2));
3895 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3896 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3899 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3900 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3904 printk(KERN_INFO "PXC200 Initialised.\n");
3909 /* ----------------------------------------------------------------------- */
3911 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3912 * it. This apparently involves the following procedure for each 878 chip:
3914 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3916 * 2) write to GPIO_DATA
3922 * read from GPIO_DATA into buf (uint_32)
3923 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3924 * error. ERROR_CPLD_Check_Failed stop.
3926 * 3) write to GPIO_DATA
3927 * - write 0x4400 + 0x0E
3929 * - write 0x4410 + 0x0E
3932 * read from GPIO_DATA into buf (uint_32)
3933 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
3934 * error. ERROR_CPLD_Check_Failed.
3936 /* ----------------------------------------------------------------------- */
3938 init_RTV24 (struct bttv *btv)
3940 uint32_t dataRead = 0;
3941 long watchdog_value = 0x0E;
3944 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3947 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
3949 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3951 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3953 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3955 dataRead = btread (BT848_GPIO_DATA);
3957 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3959 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3960 btv->c.nr, dataRead);
3963 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3965 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3967 btwrite (watchdog_value, BT848_GPIO_DATA);
3969 dataRead = btread (BT848_GPIO_DATA);
3971 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3973 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3974 btv->c.nr, dataRead);
3980 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
3985 /* ----------------------------------------------------------------------- */
3986 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3988 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3989 * This code is placed under the terms of the GNU General Public License
3991 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3994 static void bus_low(struct bttv *btv, int bit)
3996 if (btv->mbox_ior) {
3997 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3998 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4005 if (btv->mbox_ior) {
4006 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4011 static void bus_high(struct bttv *btv, int bit)
4013 if (btv->mbox_ior) {
4014 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4015 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4022 if (btv->mbox_ior) {
4023 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4028 static int bus_in(struct bttv *btv, int bit)
4030 if (btv->mbox_ior) {
4031 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4032 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4035 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4038 return gpio_read() & (bit);
4041 /* TEA5757 register bits */
4042 #define TEA_FREQ 0:14
4043 #define TEA_BUFFER 15:15
4045 #define TEA_SIGNAL_STRENGTH 16:17
4047 #define TEA_PORT1 18:18
4048 #define TEA_PORT0 19:19
4050 #define TEA_BAND 20:21
4051 #define TEA_BAND_FM 0
4052 #define TEA_BAND_MW 1
4053 #define TEA_BAND_LW 2
4054 #define TEA_BAND_SW 3
4056 #define TEA_MONO 22:22
4057 #define TEA_ALLOW_STEREO 0
4058 #define TEA_FORCE_MONO 1
4060 #define TEA_SEARCH_DIRECTION 23:23
4061 #define TEA_SEARCH_DOWN 0
4062 #define TEA_SEARCH_UP 1
4064 #define TEA_STATUS 24:24
4065 #define TEA_STATUS_TUNED 0
4066 #define TEA_STATUS_SEARCHING 1
4068 /* Low-level stuff */
4069 static int tea5757_read(struct bttv *btv)
4071 unsigned long timeout;
4075 /* better safe than sorry */
4076 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4078 if (btv->mbox_ior) {
4079 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4080 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4085 bttv_gpio_tracking(btv,"tea5757 read");
4087 bus_low(btv,btv->mbox_we);
4088 bus_low(btv,btv->mbox_clk);
4091 timeout= jiffies + msecs_to_jiffies(1000);
4093 /* wait for DATA line to go low; error if it doesn't */
4094 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4096 if (bus_in(btv,btv->mbox_data)) {
4097 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4101 dprintk("bttv%d: tea5757:",btv->c.nr);
4102 for (i = 0; i < 24; i++) {
4104 bus_high(btv,btv->mbox_clk);
4106 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4107 bus_low(btv,btv->mbox_clk);
4109 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4110 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4112 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4116 static int tea5757_write(struct bttv *btv, int value)
4121 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4123 if (btv->mbox_ior) {
4124 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4125 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4129 bttv_gpio_tracking(btv,"tea5757 write");
4131 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4132 bus_low(btv,btv->mbox_clk);
4133 bus_high(btv,btv->mbox_we);
4134 for (i = 0; i < 25; i++) {
4135 if (reg & 0x1000000)
4136 bus_high(btv,btv->mbox_data);
4138 bus_low(btv,btv->mbox_data);
4140 bus_high(btv,btv->mbox_clk);
4142 bus_low(btv,btv->mbox_clk);
4145 bus_low(btv,btv->mbox_we); /* unmute !!! */
4149 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4151 dprintk("tea5757_set_freq %d\n",freq);
4152 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4155 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4157 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4158 * switch instead (CD22M3494E). This IC can have multiple active connections
4159 * between Xn (input) and Yn (output) pins. We need to clear any existing
4160 * connection prior to establish a new one, pulsing the STROBE pin.
4162 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4163 * GPIO pins are wired as:
4164 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4165 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4166 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4167 * GPIO[8] - - P3[5] (microcontroller)
4168 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4169 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4170 * GPINTR - - P3[4] (microcontroller)
4172 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4173 * configuration either directly (as we are doing) or using the microcontroller
4174 * which is also wired to I2C interface. I have no further info on the
4175 * microcontroller features, one would need to disassembly the firmware.
4176 * note: the vendor refused to give any information on this product, all
4177 * that stuff was found using a multimeter! :)
4179 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4181 /* reset all conections */
4182 gpio_bits(0x200,0x200);
4184 gpio_bits(0x200,0x000);
4187 /* create a new connection */
4188 gpio_bits(0x480,0x080);
4189 gpio_bits(0x480,0x480);
4191 gpio_bits(0x480,0x080);
4195 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4197 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4198 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4199 * chips, ten eight input analog multiplexors, a not chip and a few
4202 * 16 inputs on a secondary bracket are provided and can be selected
4203 * from each of the four capture chips. Two of the eight input
4204 * multiplexors are used to select from any of the 16 input signals.
4206 * Unsupported hardware capabilities:
4207 * . A video output monitor on the secondary bracket can be selected from
4208 * one of the 878A chips.
4209 * . Another passthrough but I haven't spent any time investigating it.
4210 * . Digital I/O (logic level connected to GPIO) is available from an
4213 * The on chip input mux should always be set to 2.
4214 * GPIO[16:19] - Video input selection
4215 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4216 * GPIO[?:?] - Digital I/O.
4218 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4219 * determined what function (if any) it provides. With the microcontroller
4220 * and sync seperator chips a guess is that it might have to do with video
4221 * switching and maybe some digital I/O.
4223 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4226 gpio_bits(0x0f0000, input << 16);
4229 static void tibetCS16_init(struct bttv *btv)
4231 /* enable gpio bits, mask obtained via btSpy */
4232 gpio_inout(0xffffff, 0x0f7fff);
4233 gpio_write(0x0f7fff);
4237 * The following routines for the Kodicom-4400r get a little mind-twisting.
4238 * There is a "master" controller and three "slave" controllers, together
4239 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4240 * The analog switch is controlled by the "master", but the detection order
4241 * of the four BT878A chips is in an order which I just don't understand.
4242 * The "master" is actually the second controller to be detected. The
4243 * logic on the board uses logical numbers for the 4 controllers, but
4244 * those numbers are different from the detection sequence. When working
4245 * with the analog switch, we need to "map" from the detection sequence
4246 * over to the board's logical controller number. This mapping sequence
4247 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4248 * unit 3, the second (which is the master) is logical unit 0, etc.
4249 * We need to maintain the status of the analog switch (which of the 16
4250 * cameras is connected to which of the 4 controllers). Rather than
4251 * add to the bttv structure for this, we use the data reserved for
4252 * the mbox (unused for this card type).
4256 * First a routine to set the analog switch, which controls which camera
4257 * is routed to which controller. The switch comprises an X-address
4258 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4259 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4260 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4261 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4262 * specified address. The idea is to set the address and data, then bring
4263 * STROBE high, and finally bring STROBE back to low.
4265 static void kodicom4400r_write(struct bttv *btv,
4266 unsigned char xaddr,
4267 unsigned char yaddr,
4268 unsigned char data) {
4271 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4272 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4273 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4274 gpio_bits(0x1ff, udata); /* strobe low */
4278 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4279 * use this routine. The routine finds the "master" for the card, maps
4280 * the controller number from the detected position over to the logical
4281 * number, writes the appropriate data to the analog switch, and housekeeps
4282 * the local copy of the switch information. The parameter 'input' is the
4283 * requested camera number (0 - 15).
4285 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4290 static unsigned char map[4] = {3, 0, 2, 1};
4292 mctlr = master[btv->c.nr];
4293 if (mctlr == NULL) { /* ignore if master not yet detected */
4296 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4298 sw_status = (char *)(&mctlr->mbox_we);
4299 xaddr = input & 0xf;
4300 /* Check if the controller/camera pair has changed, else ignore */
4301 if (sw_status[yaddr] != xaddr)
4303 /* "open" the old switch, "close" the new one, save the new */
4304 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4305 sw_status[yaddr] = xaddr;
4306 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4311 * During initialisation, we need to reset the analog switch. We
4312 * also preset the switch to map the 4 connectors on the card to the
4313 * *user's* (see above description of kodicom4400r_muxsel) channels
4316 static void kodicom4400r_init(struct bttv *btv)
4318 char *sw_status = (char *)(&btv->mbox_we);
4321 gpio_inout(0x0003ff, 0x0003ff);
4322 gpio_write(1 << 9); /* reset MUX */
4324 /* Preset camera 0 to the 4 controllers */
4325 for (ix = 0; ix < 4; ix++) {
4327 kodicom4400r_write(btv, ix, ix, 1);
4330 * Since this is the "master", we need to set up the
4331 * other three controller chips' pointers to this structure
4332 * for later use in the muxsel routine.
4334 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4336 master[btv->c.nr-1] = btv;
4337 master[btv->c.nr] = btv;
4338 master[btv->c.nr+1] = btv;
4339 master[btv->c.nr+2] = btv;
4342 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4343 * video multiplexers to provide up to 16 video inputs. These
4344 * multiplexers are controlled by the lower 8 GPIO pins of the
4345 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4347 * xxx0 is pin xxx of multiplexer U5,
4348 * yyy1 is pin yyy of multiplexer U2
4360 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4362 static const int masks[] = {
4363 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4364 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4365 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4366 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4368 gpio_write(masks[input%16]);
4370 static void picolo_tetra_init(struct bttv *btv)
4372 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4373 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4374 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4376 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4379 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4380 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4381 /*GPIO[20]&GPIO[21] used to choose the right input*/
4382 btwrite (input<<20,BT848_GPIO_DATA);
4387 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4389 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4390 * swichers to provide 16 channels to MUX0. The TDA8540's have
4391 * 4 independent outputs and as such the IVC120G also has the
4392 * optional "Monitor Out" bus. This allows the card to be looking
4393 * at one input while the monitor is looking at another.
4395 * Since I've couldn't be bothered figuring out how to add an
4396 * independant muxsel for the monitor bus, I've just set it to
4397 * whatever the card is looking at.
4399 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4400 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4402 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4403 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4404 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4405 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4409 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4410 #define I2C_TDA8540 0x90
4411 #define I2C_TDA8540_ALT1 0x92
4412 #define I2C_TDA8540_ALT2 0x94
4413 #define I2C_TDA8540_ALT3 0x96
4414 #define I2C_TDA8540_ALT4 0x98
4415 #define I2C_TDA8540_ALT5 0x9a
4416 #define I2C_TDA8540_ALT6 0x9c
4418 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4421 int key = input % 4;
4422 int matrix = input / 4;
4424 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4425 btv->c.nr, input, matrix, key);
4427 /* Handles the input selection on the TDA8540's */
4428 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4429 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4430 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4431 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4432 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4433 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4434 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4435 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4437 /* Handles the output enables on the TDA8540's */
4438 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4439 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4440 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4441 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4442 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4443 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4444 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4445 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4447 /* 878's MUX0 is already selected for input via muxsel values */
4451 /* PXC200 muxsel helper
4452 * luke@syseng.anu.edu.au
4453 * another transplant
4454 * from Alessandro Rubini (rubini@linux.it)
4456 * There are 4 kinds of cards:
4457 * PXC200L which is bt848
4458 * PXC200F which is bt848 with PIC controlling mux
4459 * PXC200AL which is bt878
4460 * PXC200AF which is bt878 with PIC controlling mux
4462 #define PX_CFG_PXC200F 0x01
4463 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4464 #define PX_I2C_PIC 0x0f
4465 #define PX_PXC200A_CARDID 0x200a1295
4466 #define PX_I2C_CMD_CFG 0x00
4468 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4473 unsigned char buf[2];
4475 /* Read PIC config to determine if this is a PXC200F */
4479 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4481 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4482 /* not PXC ? do nothing */
4486 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4487 if (!(rc & PX_CFG_PXC200F)) {
4488 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4493 /* The multiplexer in the 200F is handled by the GPIO port */
4494 /* get correct mapping between inputs */
4495 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4496 /* ** not needed!? */
4499 /* make sure output pins are enabled */
4500 /* bitmask=0x30f; */
4502 /* check whether we have a PXC200A */
4503 if (btv->cardid == PX_PXC200A_CARDID) {
4504 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4505 bitmask |= 7<<4; /* the DAC */
4507 btwrite(bitmask, BT848_GPIO_OUT_EN);
4509 bitmask = btread(BT848_GPIO_DATA);
4510 if (btv->cardid == PX_PXC200A_CARDID)
4511 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4512 else /* older device */
4513 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4514 btwrite(bitmask,BT848_GPIO_DATA);
4517 * Was "to be safe, set the bt848 to input 0"
4518 * Actually, since it's ok at load time, better not messing
4519 * with these bits (on PXC200AF you need to set mux 2 here)
4521 * needed because bttv-driver sets mux before calling this function
4523 if (btv->cardid == PX_PXC200A_CARDID)
4524 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4525 else /* older device */
4526 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4528 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4531 /* ----------------------------------------------------------------------- */
4532 /* motherboard chipset specific stuff */
4534 void __init bttv_check_chipset(void)
4536 int pcipci_fail = 0;
4537 struct pci_dev *dev = NULL;
4539 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4541 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4543 if (pci_pci_problems & PCIPCI_VSFX)
4545 #ifdef PCIPCI_ALIMAGIK
4546 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4551 /* print warnings about any quirks found */
4553 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4555 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4557 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4560 printk(KERN_INFO "bttv: overlay will be disabled.\n");
4563 printk(KERN_INFO "bttv: overlay forced. Use this "
4564 "option at your own risk.\n");
4567 if (UNSET != latency)
4568 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4569 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4570 PCI_DEVICE_ID_INTEL_82441, dev))) {
4572 pci_read_config_byte(dev, 0x53, &b);
4574 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4575 "bufcon=0x%02x\n",b);
4579 int __devinit bttv_handle_chipset(struct bttv *btv)
4581 unsigned char command;
4583 if (!triton1 && !vsfx && UNSET == latency)
4588 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4589 if (vsfx && btv->id >= 878)
4590 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4591 if (UNSET != latency)
4592 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4596 if (btv->id < 878) {
4597 /* bt848 (mis)uses a bit in the irq mask for etbf */
4599 btv->triton1 = BT848_INT_ETBF;
4601 /* bt878 has a bit in the pci config space for it */
4602 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4604 command |= BT878_EN_TBFX;
4606 command |= BT878_EN_VSFX;
4607 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4609 if (UNSET != latency)
4610 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);