5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/config.h>
29 #include <linux/delay.h>
30 #include <linux/module.h>
31 #include <linux/moduleparam.h>
32 #include <linux/kmod.h>
33 #include <linux/init.h>
34 #include <linux/pci.h>
35 #include <linux/vmalloc.h>
36 #include <linux/firmware.h>
43 static void boot_msp34xx(struct bttv *btv, int pin);
44 static void boot_bt832(struct bttv *btv);
45 static void hauppauge_eeprom(struct bttv *btv);
46 static void avermedia_eeprom(struct bttv *btv);
47 static void osprey_eeprom(struct bttv *btv);
48 static void modtec_eeprom(struct bttv *btv);
49 static void init_PXC200(struct bttv *btv);
50 static void init_RTV24(struct bttv *btv);
52 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
53 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
54 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
56 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
58 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
59 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
60 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void rv605_muxsel(struct bttv *btv, unsigned int input);
67 static void eagle_muxsel(struct bttv *btv, unsigned int input);
68 static void xguard_muxsel(struct bttv *btv, unsigned int input);
69 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
70 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
72 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
74 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
75 static void picolo_tetra_init(struct bttv *btv);
77 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
78 static void tibetCS16_init(struct bttv *btv);
80 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
81 static void kodicom4400r_init(struct bttv *btv);
83 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
84 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
86 static int terratec_active_radio_upgrade(struct bttv *btv);
87 static int tea5757_read(struct bttv *btv);
88 static int tea5757_write(struct bttv *btv, int value);
89 static void identify_by_eeprom(struct bttv *btv,
90 unsigned char eeprom_data[256]);
91 static int __devinit pvr_boot(struct bttv *btv);
93 /* config variables */
94 static unsigned int triton1=0;
95 static unsigned int vsfx=0;
96 static unsigned int latency = UNSET;
99 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
106 static unsigned int autoload = 1;
108 static unsigned int autoload = 0;
110 static unsigned int gpiomask = UNSET;
111 static unsigned int audioall = UNSET;
112 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
115 module_param(triton1, int, 0444);
116 module_param(vsfx, int, 0444);
117 module_param(no_overlay, int, 0444);
118 module_param(latency, int, 0444);
119 module_param(gpiomask, int, 0444);
120 module_param(audioall, int, 0444);
121 module_param(autoload, int, 0444);
123 module_param_array(card, int, NULL, 0444);
124 module_param_array(pll, int, NULL, 0444);
125 module_param_array(tuner, int, NULL, 0444);
126 module_param_array(svhs, int, NULL, 0444);
127 module_param_array(remote, int, NULL, 0444);
128 module_param_array(audiomux, int, NULL, 0444);
130 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
131 "[enable bug compatibility for triton1 + others]");
132 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
133 "[yet another chipset flaw workaround]");
134 MODULE_PARM_DESC(latency,"pci latency timer");
135 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
136 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
137 MODULE_PARM_DESC(tuner,"specify installed tuner type");
138 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
140 /* ----------------------------------------------------------------------- */
141 /* list of card IDs for bt878+ cards */
147 } cards[] __devinitdata = {
148 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
149 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
150 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
151 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
152 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
153 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
154 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
155 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
156 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
158 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
159 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
161 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
162 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
172 /* some cards ship with byteswapped IDs ... */
173 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
174 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
175 /* this seems to happen as well ... */
176 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
178 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
180 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
182 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
183 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
184 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
185 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
186 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
187 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
188 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
190 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
191 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
192 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
194 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
196 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
197 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
198 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
199 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
201 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
202 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
203 /* clashes with FlyVideo
204 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
205 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
206 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
207 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
208 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
210 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
212 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
217 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
218 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
219 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
220 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
222 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
223 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
224 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
225 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
227 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
228 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
229 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
230 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
232 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
233 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
234 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
235 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
236 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
238 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
239 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
240 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
242 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
243 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
244 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
259 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
261 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
263 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
264 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
265 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
266 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
268 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
269 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
271 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
272 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
274 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
275 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
276 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
285 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
286 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
287 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
288 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
290 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
292 /* likely broken, vendor id doesn't match the other magic views ...
293 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
295 /* DVB cards (using pci function .1 for mpeg data xfer) */
296 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
297 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
298 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
299 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
300 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
301 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
302 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
303 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
304 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
309 /* ----------------------------------------------------------------------- */
310 /* array with description for bt848 / bt878 tv/grabber cards */
312 struct tvcard bttv_tvcards[] = {
313 /* ---- card 0x00 ---------------------------------- */
314 [BTTV_BOARD_UNKNOWN] = {
315 .name = " *** UNKNOWN/GENERIC *** ",
320 .muxsel = { 2, 3, 1, 0},
322 .tuner_addr = ADDR_UNSET,
323 .radio_addr = ADDR_UNSET,
325 [BTTV_BOARD_MIRO] = {
332 .muxsel = { 2, 3, 1, 1},
333 .audiomux = { 2, 0, 0, 0, 10},
336 .tuner_addr = ADDR_UNSET,
337 .radio_addr = ADDR_UNSET,
339 [BTTV_BOARD_HAUPPAUGE] = {
340 .name = "Hauppauge (bt848)",
346 .muxsel = { 2, 3, 1, 1},
347 .audiomux = { 0, 1, 2, 3, 4},
350 .tuner_addr = ADDR_UNSET,
351 .radio_addr = ADDR_UNSET,
354 .name = "STB, Gateway P/N 6000699 (bt848)",
360 .muxsel = { 2, 3, 1, 1},
361 .audiomux = { 4, 0, 2, 3, 1},
364 .tuner_type = TUNER_PHILIPS_NTSC,
365 .tuner_addr = ADDR_UNSET,
366 .radio_addr = ADDR_UNSET,
371 /* ---- card 0x04 ---------------------------------- */
372 [BTTV_BOARD_INTEL] = {
373 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
379 .muxsel = { 2, 3, 1, 1},
383 .tuner_addr = ADDR_UNSET,
384 .radio_addr = ADDR_UNSET,
386 [BTTV_BOARD_DIAMOND] = {
387 .name = "Diamond DTV2000",
393 .muxsel = { 2, 3, 1, 0},
394 .audiomux = { 0, 1, 0, 1, 3},
397 .tuner_addr = ADDR_UNSET,
398 .radio_addr = ADDR_UNSET,
400 [BTTV_BOARD_AVERMEDIA] = {
401 .name = "AVerMedia TVPhone",
406 .muxsel = { 2, 3, 1, 1},
408 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
409 /* 0x04 for some cards ?? */
412 .tuner_addr = ADDR_UNSET,
413 .radio_addr = ADDR_UNSET,
414 .audio_hook = avermedia_tvphone_audio,
417 [BTTV_BOARD_MATRIX_VISION] = {
418 .name = "MATRIX-Vision MV-Delta",
424 .muxsel = { 2, 3, 1, 0, 0},
428 .tuner_addr = ADDR_UNSET,
429 .radio_addr = ADDR_UNSET,
432 /* ---- card 0x08 ---------------------------------- */
433 [BTTV_BOARD_FLYVIDEO] = {
434 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
440 .muxsel = { 2, 3, 1, 1},
441 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
445 .tuner_addr = ADDR_UNSET,
446 .radio_addr = ADDR_UNSET,
448 [BTTV_BOARD_TURBOTV] = {
449 .name = "IMS/IXmicro TurboTV",
455 .muxsel = { 2, 3, 1, 1},
456 .audiomux = { 1, 1, 2, 3, 0},
459 .tuner_type = TUNER_TEMIC_PAL,
460 .tuner_addr = ADDR_UNSET,
461 .radio_addr = ADDR_UNSET,
463 [BTTV_BOARD_HAUPPAUGE878] = {
464 .name = "Hauppauge (bt878)",
469 .gpiomask = 0x0f, /* old: 7 */
470 .muxsel = { 2, 0, 1, 1},
471 .audiomux = { 0, 1, 2, 3, 4},
475 .tuner_addr = ADDR_UNSET,
476 .radio_addr = ADDR_UNSET,
478 [BTTV_BOARD_MIROPRO] = {
479 .name = "MIRO PCTV pro",
485 .muxsel = { 2, 3, 1, 1},
486 .audiomux = { 0x20001,0x10001, 0, 0,10},
489 .tuner_addr = ADDR_UNSET,
490 .radio_addr = ADDR_UNSET,
493 /* ---- card 0x0c ---------------------------------- */
494 [BTTV_BOARD_ADSTECH_TV] = {
495 .name = "ADS Technologies Channel Surfer TV (bt848)",
501 .muxsel = { 2, 3, 1, 1},
502 .audiomux = { 13, 14, 11, 7, 0, 0},
505 .tuner_addr = ADDR_UNSET,
506 .radio_addr = ADDR_UNSET,
508 [BTTV_BOARD_AVERMEDIA98] = {
509 .name = "AVerMedia TVCapture 98",
515 .muxsel = { 2, 3, 1, 1},
516 .audiomux = { 13, 14, 11, 7, 0, 0},
520 .tuner_type = TUNER_PHILIPS_PAL,
521 .tuner_addr = ADDR_UNSET,
522 .radio_addr = ADDR_UNSET,
523 .audio_hook = avermedia_tv_stereo_audio,
527 .name = "Aimslab Video Highway Xtreme (VHX)",
533 .muxsel = { 2, 3, 1, 1},
534 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
538 .tuner_addr = ADDR_UNSET,
539 .radio_addr = ADDR_UNSET,
541 [BTTV_BOARD_ZOLTRIX] = {
542 .name = "Zoltrix TV-Max",
548 .muxsel = { 2, 3, 1, 1},
549 .audiomux = {0 , 0, 1 , 0, 10},
552 .tuner_addr = ADDR_UNSET,
553 .radio_addr = ADDR_UNSET,
556 /* ---- card 0x10 ---------------------------------- */
557 [BTTV_BOARD_PIXVIEWPLAYTV] = {
558 .name = "Prolink Pixelview PlayTV (bt878)",
563 .gpiomask = 0x01fe00,
564 .muxsel = { 2, 3, 1, 1},
567 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
569 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
570 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
576 [BTTV_BOARD_WINVIEW_601] = {
577 .name = "Leadtek WinView 601",
582 .gpiomask = 0x8300f8,
583 .muxsel = { 2, 3, 1, 1,0},
584 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
587 .tuner_addr = ADDR_UNSET,
588 .radio_addr = ADDR_UNSET,
589 .audio_hook = winview_audio,
592 [BTTV_BOARD_AVEC_INTERCAP] = {
593 .name = "AVEC Intercapture",
599 .muxsel = {2, 3, 1, 1},
600 .audiomux = {1, 0, 0, 0, 0},
603 .tuner_addr = ADDR_UNSET,
604 .radio_addr = ADDR_UNSET,
606 [BTTV_BOARD_LIFE_FLYKIT] = {
607 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
612 .gpiomask = 0x8dff00,
613 .muxsel = { 2, 3, 1, 1},
617 .tuner_addr = ADDR_UNSET,
618 .radio_addr = ADDR_UNSET,
621 /* ---- card 0x14 ---------------------------------- */
622 [BTTV_BOARD_CEI_RAFFLES] = {
623 .name = "CEI Raffles Card",
628 .muxsel = {2, 3, 1, 1},
630 .tuner_addr = ADDR_UNSET,
631 .radio_addr = ADDR_UNSET,
633 [BTTV_BOARD_CONFERENCETV] = {
634 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
636 .audio_inputs = 2, /* tuner, line in */
640 .muxsel = { 2, 3, 1, 1},
641 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
643 .tuner_type = TUNER_PHILIPS_PAL_I,
644 .tuner_addr = ADDR_UNSET,
645 .radio_addr = ADDR_UNSET,
647 [BTTV_BOARD_PHOEBE_TVMAS] = {
648 .name = "Askey CPH050/ Phoebe Tv Master + FM",
654 .muxsel = { 2, 3, 1, 1},
655 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
659 .tuner_addr = ADDR_UNSET,
660 .radio_addr = ADDR_UNSET,
662 [BTTV_BOARD_MODTEC_205] = {
663 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
669 .muxsel = { 2, 3, -1 },
670 .digital_mode = DIGITAL_MODE_CAMERA,
671 .audiomux = { 0, 0, 0, 0, 0 },
674 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
675 .tuner_addr = ADDR_UNSET,
676 .radio_addr = ADDR_UNSET,
679 /* ---- card 0x18 ---------------------------------- */
680 [BTTV_BOARD_MAGICTVIEW061] = {
681 .name = "Askey CPH05X/06X (bt878) [many vendors]",
687 .muxsel = { 2, 3, 1, 1},
688 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
692 .tuner_addr = ADDR_UNSET,
693 .radio_addr = ADDR_UNSET,
696 [BTTV_BOARD_VOBIS_BOOSTAR] = {
697 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
702 .gpiomask = 0x1f0fff,
703 .muxsel = { 2, 3, 1, 1},
704 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
706 .tuner_type = TUNER_PHILIPS_PAL,
707 .tuner_addr = ADDR_UNSET,
708 .radio_addr = ADDR_UNSET,
709 .audio_hook = terratv_audio,
711 [BTTV_BOARD_HAUPPAUG_WCAM] = {
712 .name = "Hauppauge WinCam newer (bt878)",
718 .muxsel = { 2, 0, 1, 1},
719 .audiomux = { 0, 1, 2, 3, 4},
722 .tuner_addr = ADDR_UNSET,
723 .radio_addr = ADDR_UNSET,
725 [BTTV_BOARD_MAXI] = {
726 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
732 .muxsel = { 2, 3, 1, 1},
733 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
735 .tuner_type = TUNER_PHILIPS_SECAM,
736 .tuner_addr = ADDR_UNSET,
737 .radio_addr = ADDR_UNSET,
740 /* ---- card 0x1c ---------------------------------- */
741 [BTTV_BOARD_TERRATV] = {
742 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
747 .gpiomask = 0x1f0fff,
748 .muxsel = { 2, 3, 1, 1},
749 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
751 .tuner_type = TUNER_PHILIPS_PAL,
752 .tuner_addr = ADDR_UNSET,
753 .radio_addr = ADDR_UNSET,
754 .audio_hook = terratv_audio,
756 External 20 pin connector (for Active Radio Upgrade board)
762 gpio05: om5610-stereo
766 gpio09+10: nIOR, nSEL ?? (bt878)
770 gpio16: u2-A0 (1st 4052bt)
773 gpio19: u4-A0 (2nd 4052)
777 00000 : Cdrom (internal audio input)
778 10000 : ext. Video audio input
787 [BTTV_BOARD_PXC200] = {
788 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
789 .name = "Imagenation PXC200",
793 .svhs = 1, /* was: 4 */
795 .muxsel = { 2, 3, 1, 0, 0},
799 .tuner_addr = ADDR_UNSET,
800 .radio_addr = ADDR_UNSET,
801 .muxsel_hook = PXC200_muxsel,
804 [BTTV_BOARD_FLYVIDEO_98] = {
805 .name = "Lifeview FlyVideo 98 LR50",
810 .gpiomask = 0x1800, /* 0x8dfe00 */
811 .muxsel = { 2, 3, 1, 1},
812 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
815 .tuner_addr = ADDR_UNSET,
816 .radio_addr = ADDR_UNSET,
818 [BTTV_BOARD_IPROTV] = {
819 .name = "Formac iProTV, Formac ProTV I (bt848)",
825 .muxsel = { 2, 3, 1, 1},
826 .audiomux = { 1, 0, 0, 0, 0 },
828 .tuner_type = TUNER_PHILIPS_PAL,
829 .tuner_addr = ADDR_UNSET,
830 .radio_addr = ADDR_UNSET,
833 /* ---- card 0x20 ---------------------------------- */
834 [BTTV_BOARD_INTEL_C_S_PCI] = {
835 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
841 .muxsel = { 2, 3, 1, 1},
845 .tuner_addr = ADDR_UNSET,
846 .radio_addr = ADDR_UNSET,
848 [BTTV_BOARD_TERRATVALUE] = {
849 .name = "Terratec TerraTValue Version Bt878",
854 .gpiomask = 0xffff00,
855 .muxsel = { 2, 3, 1, 1},
856 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
859 .tuner_type = TUNER_PHILIPS_PAL,
860 .tuner_addr = ADDR_UNSET,
861 .radio_addr = ADDR_UNSET,
863 [BTTV_BOARD_WINFAST2000] = {
864 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
869 .muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
871 .gpiomask = 0xc33000,
872 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
874 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
875 .gpiomask = 0xb33000,
876 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
878 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
879 gpio23 -- hef4052:nEnable (0x800000)
882 0x0000: external audio
886 Note: There exists another variant "Winfast 2000" with tv stereo !?
887 Note: eeprom only contains FF and pci subsystem id 107d:6606
892 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
893 .tuner_addr = ADDR_UNSET,
894 .radio_addr = ADDR_UNSET,
895 .audio_hook = winfast2000_audio,
898 [BTTV_BOARD_CHRONOS_VS2] = {
899 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
905 .muxsel = { 2, 3, 1, 1},
906 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
909 .tuner_addr = ADDR_UNSET,
910 .radio_addr = ADDR_UNSET,
913 /* ---- card 0x24 ---------------------------------- */
914 [BTTV_BOARD_TYPHOON_TVIEW] = {
915 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
921 .muxsel = { 2, 3, 1, 1},
922 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
925 .tuner_addr = ADDR_UNSET,
926 .radio_addr = ADDR_UNSET,
929 [BTTV_BOARD_PXELVWPLTVPRO] = {
930 .name = "Prolink PixelView PlayTV pro",
936 .muxsel = { 2, 3, 1, 1 },
937 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
941 .tuner_addr = ADDR_UNSET,
942 .radio_addr = ADDR_UNSET,
944 [BTTV_BOARD_MAGICTVIEW063] = {
945 .name = "Askey CPH06X TView99",
950 .gpiomask = 0x551e00,
951 .muxsel = { 2, 3, 1, 0},
952 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
956 .tuner_addr = ADDR_UNSET,
957 .radio_addr = ADDR_UNSET,
960 [BTTV_BOARD_PINNACLE] = {
961 .name = "Pinnacle PCTV Studio/Rave",
966 .gpiomask = 0x03000F,
967 .muxsel = { 2, 3, 1, 1},
968 .audiomux = { 2, 0xd0001, 0, 0, 1},
972 .tuner_addr = ADDR_UNSET,
973 .radio_addr = ADDR_UNSET,
976 /* ---- card 0x28 ---------------------------------- */
977 [BTTV_BOARD_STB2] = {
978 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
984 .muxsel = { 2, 3, 1, 1},
985 .audiomux = { 4, 0, 2, 3, 1},
988 .tuner_type = TUNER_PHILIPS_NTSC,
989 .tuner_addr = ADDR_UNSET,
990 .radio_addr = ADDR_UNSET,
994 [BTTV_BOARD_AVPHONE98] = {
995 .name = "AVerMedia TVPhone 98",
1001 .muxsel = { 2, 3, 1, 1},
1002 .audiomux = { 13, 4, 11, 7, 0, 0},
1006 .tuner_addr = ADDR_UNSET,
1007 .radio_addr = ADDR_UNSET,
1009 .audio_hook = avermedia_tvphone_audio,
1011 [BTTV_BOARD_PV951] = {
1012 .name = "ProVideo PV951", /* pic16c54 */
1018 .muxsel = { 2, 3, 1, 1},
1019 .audiomux = { 0, 0, 0, 0, 0},
1024 .tuner_addr = ADDR_UNSET,
1025 .radio_addr = ADDR_UNSET,
1027 [BTTV_BOARD_ONAIR_TV] = {
1028 .name = "Little OnAir TV",
1034 .muxsel = {2, 3, 1, 1},
1035 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
1038 .tuner_addr = ADDR_UNSET,
1039 .radio_addr = ADDR_UNSET,
1042 /* ---- card 0x2c ---------------------------------- */
1043 [BTTV_BOARD_SIGMA_TVII_FM] = {
1044 .name = "Sigma TVII-FM",
1050 .muxsel = {2, 3, 1, 1},
1051 .audiomux = {1, 1, 0, 2, 3},
1055 .tuner_addr = ADDR_UNSET,
1056 .radio_addr = ADDR_UNSET,
1058 [BTTV_BOARD_MATRIX_VISION2] = {
1059 .name = "MATRIX-Vision MV-Delta 2",
1065 .muxsel = { 2, 3, 1, 0, 0},
1070 .tuner_addr = ADDR_UNSET,
1071 .radio_addr = ADDR_UNSET,
1073 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1074 .name = "Zoltrix Genie TV/FM",
1079 .gpiomask = 0xbcf03f,
1080 .muxsel = { 2, 3, 1, 1},
1081 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
1085 .tuner_addr = ADDR_UNSET,
1086 .radio_addr = ADDR_UNSET,
1088 [BTTV_BOARD_TERRATVRADIO] = {
1089 .name = "Terratec TV/Radio+",
1094 .gpiomask = 0x70000,
1095 .muxsel = { 2, 3, 1, 1},
1096 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1101 .tuner_addr = ADDR_UNSET,
1102 .radio_addr = ADDR_UNSET,
1106 /* ---- card 0x30 ---------------------------------- */
1107 [BTTV_BOARD_DYNALINK] = {
1108 .name = "Askey CPH03x/ Dynalink Magic TView",
1114 .muxsel = { 2, 3, 1, 1},
1115 .audiomux = {2,0,0,0,1},
1119 .tuner_addr = ADDR_UNSET,
1120 .radio_addr = ADDR_UNSET,
1122 [BTTV_BOARD_GVBCTV3PCI] = {
1123 .name = "IODATA GV-BCTV3/PCI",
1128 .gpiomask = 0x010f00,
1129 .muxsel = {2, 3, 0, 0},
1130 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1133 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1134 .tuner_addr = ADDR_UNSET,
1135 .radio_addr = ADDR_UNSET,
1136 .audio_hook = gvbctv3pci_audio,
1138 [BTTV_BOARD_PXELVWPLTVPAK] = {
1139 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1144 .gpiomask = 0xAA0000,
1145 .muxsel = { 2,3,1,1,-1 },
1146 .digital_mode = DIGITAL_MODE_CAMERA,
1147 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1150 .tuner_type = TUNER_PHILIPS_PAL_I,
1151 .tuner_addr = ADDR_UNSET,
1152 .radio_addr = ADDR_UNSET,
1154 /* GPIO wiring: (different from Rev.4C !)
1155 GPIO17: U4.A0 (first hef4052bt)
1157 GPIO20: U5.A1 (second hef4052bt)
1159 GPIO22: BT832 Reset Line
1160 GPIO23: A5,A0, U5,nEN
1161 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1164 [BTTV_BOARD_EAGLE] = {
1165 .name = "Eagle Wireless Capricorn2 (bt878A)",
1171 .muxsel = { 2, 0, 1, 1},
1172 .audiomux = { 0, 1, 2, 3, 4},
1174 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1175 .tuner_addr = ADDR_UNSET,
1176 .radio_addr = ADDR_UNSET,
1179 /* ---- card 0x34 ---------------------------------- */
1180 [BTTV_BOARD_PINNACLEPRO] = {
1181 /* David Härdeman <david@2gen.com> */
1182 .name = "Pinnacle PCTV Studio Pro",
1187 .gpiomask = 0x03000F,
1188 .muxsel = { 2, 3, 1, 1},
1189 .audiomux = { 1, 0xd0001, 0, 0, 10},
1190 /* sound path (5 sources):
1191 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1194 2= Mono TV sound from Tuner
1196 MUX2 (mask 0x30000):
1198 1= FM stereo Radio from Tuner */
1202 .tuner_addr = ADDR_UNSET,
1203 .radio_addr = ADDR_UNSET,
1205 [BTTV_BOARD_TVIEW_RDS_FM] = {
1206 /* Claas Langbehn <claas@bigfoot.com>,
1207 Sven Grothklags <sven@upb.de> */
1208 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1214 .muxsel = { 2, 3, 1, 1},
1215 .audiomux = { 0, 0, 0x10, 8, 4 },
1218 .tuner_type = TUNER_PHILIPS_PAL,
1219 .tuner_addr = ADDR_UNSET,
1220 .radio_addr = ADDR_UNSET,
1223 [BTTV_BOARD_LIFETEC_9415] = {
1224 /* Tim Röstermundt <rosterm@uni-muenster.de>
1225 in de.comp.os.unix.linux.hardware:
1226 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1227 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1228 options tuner type=5 */
1229 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1235 .muxsel = { 2, 3, 1, 1},
1236 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1237 /* For cards with tda9820/tda9821:
1238 0x0000: Tuner normal stereo
1239 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1240 0x0880: Tuner A2 stereo */
1243 .tuner_addr = ADDR_UNSET,
1244 .radio_addr = ADDR_UNSET,
1246 [BTTV_BOARD_BESTBUY_EASYTV] = {
1247 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1248 old Easy TV BT848 version (model CPH031) */
1249 .name = "Askey CPH031/ BESTBUY Easy TV",
1255 .muxsel = { 2, 3, 1, 0},
1256 .audiomux = { 2, 0, 0, 0, 10},
1259 .tuner_type = TUNER_TEMIC_PAL,
1260 .tuner_addr = ADDR_UNSET,
1261 .radio_addr = ADDR_UNSET,
1264 /* ---- card 0x38 ---------------------------------- */
1265 [BTTV_BOARD_FLYVIDEO_98FM] = {
1266 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1267 .name = "Lifeview FlyVideo 98FM LR50",
1273 .muxsel = { 2, 3, 1, 1},
1274 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1277 .tuner_addr = ADDR_UNSET,
1278 .radio_addr = ADDR_UNSET,
1280 /* This is the ultimate cheapo capture card
1281 * just a BT848A on a small PCB!
1282 * Steve Hosgood <steve@equiinet.com> */
1283 [BTTV_BOARD_GRANDTEC] = {
1284 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1296 .tuner_addr = ADDR_UNSET,
1297 .radio_addr = ADDR_UNSET,
1299 [BTTV_BOARD_ASKEY_CPH060] = {
1300 /* Daniel Herrington <daniel.herrington@home.com> */
1301 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1307 .muxsel = { 2, 3, 1, 1},
1308 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1311 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1312 .tuner_addr = ADDR_UNSET,
1313 .radio_addr = ADDR_UNSET,
1315 [BTTV_BOARD_ASKEY_CPH03X] = {
1316 /* Matti Mottus <mottus@physic.ut.ee> */
1317 .name = "Askey CPH03x TV Capturer",
1322 .gpiomask = 0x03000F,
1323 .muxsel = { 2, 3, 1, 0},
1324 .audiomux = { 2,0,0,0,1 },
1327 .tuner_addr = ADDR_UNSET,
1328 .radio_addr = ADDR_UNSET,
1331 /* ---- card 0x3c ---------------------------------- */
1332 [BTTV_BOARD_MM100PCTV] = {
1333 /* Philip Blundell <philb@gnu.org> */
1334 .name = "Modular Technology MM100PCTV",
1340 .muxsel = { 2, 3, 1, 1},
1341 .audiomux = { 2, 0, 0, 1, 8},
1343 .tuner_type = TUNER_TEMIC_PAL,
1344 .tuner_addr = ADDR_UNSET,
1345 .radio_addr = ADDR_UNSET,
1347 [BTTV_BOARD_GMV1] = {
1348 /* Adrian Cox <adrian@humboldt.co.uk */
1349 .name = "AG Electronics GMV1",
1361 .tuner_addr = ADDR_UNSET,
1362 .radio_addr = ADDR_UNSET,
1364 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1365 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1366 new Easy TV BT878 version (model CPH061)
1367 special thanks to Informatica Mieres for providing the card */
1368 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1374 .muxsel = { 2, 3, 1, 0},
1375 .audiomux = { 1, 0, 4, 4, 9},
1378 .tuner_type = TUNER_PHILIPS_PAL,
1379 .tuner_addr = ADDR_UNSET,
1380 .radio_addr = ADDR_UNSET,
1382 [BTTV_BOARD_ATI_TVWONDER] = {
1383 /* Lukas Gebauer <geby@volny.cz> */
1384 .name = "ATI TV-Wonder",
1390 .muxsel = { 2, 3, 1, 0 },
1391 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1393 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1394 .tuner_addr = ADDR_UNSET,
1395 .radio_addr = ADDR_UNSET,
1398 /* ---- card 0x40 ---------------------------------- */
1399 [BTTV_BOARD_ATI_TVWONDERVE] = {
1400 /* Lukas Gebauer <geby@volny.cz> */
1401 .name = "ATI TV-Wonder VE",
1407 .muxsel = { 2, 3, 0, 1},
1408 .audiomux = { 0, 0, 1, 0, 0},
1411 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1412 .tuner_addr = ADDR_UNSET,
1413 .radio_addr = ADDR_UNSET,
1415 [BTTV_BOARD_FLYVIDEO2000] = {
1416 /* DeeJay <deejay@westel900.net (2000S) */
1417 .name = "Lifeview FlyVideo 2000S LR90",
1423 .muxsel = { 2, 3, 0, 1},
1424 /* Radio changed from 1e80 to 0x800 to make
1425 FlyVideo2000S in .hu happy (gm)*/
1426 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1427 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1428 .audio_hook = fv2000s_audio,
1434 .tuner_addr = ADDR_UNSET,
1435 .radio_addr = ADDR_UNSET,
1437 [BTTV_BOARD_TERRATVALUER] = {
1438 .name = "Terratec TValueRadio",
1443 .gpiomask = 0xffff00,
1444 .muxsel = { 2, 3, 1, 1},
1445 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1448 .tuner_type = TUNER_PHILIPS_PAL,
1449 .tuner_addr = ADDR_UNSET,
1450 .radio_addr = ADDR_UNSET,
1453 [BTTV_BOARD_GVBCTV4PCI] = {
1454 /* TANAKA Kei <peg00625@nifty.com> */
1455 .name = "IODATA GV-BCTV4/PCI",
1460 .gpiomask = 0x010f00,
1461 .muxsel = {2, 3, 0, 0},
1462 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1465 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1466 .tuner_addr = ADDR_UNSET,
1467 .radio_addr = ADDR_UNSET,
1468 .audio_hook = gvbctv3pci_audio,
1471 /* ---- card 0x44 ---------------------------------- */
1472 [BTTV_BOARD_VOODOOTV_FM] = {
1473 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1474 /* try "insmod msp3400 simple=0" if you have
1475 * sound problems with this card. */
1480 .gpiomask = 0x4f8a00,
1481 /* 0x100000: 1=MSP enabled (0=disable again)
1482 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1483 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1484 /* tvtuner, radio, external,internal, mute, stereo
1485 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1486 .muxsel = { 2, 3 ,0 ,1},
1487 .tuner_type = TUNER_MT2032,
1488 .tuner_addr = ADDR_UNSET,
1489 .radio_addr = ADDR_UNSET,
1493 [BTTV_BOARD_AIMMS] = {
1494 /* Philip Blundell <pb@nexus.co.uk> */
1495 .name = "Active Imaging AIMMS",
1500 .tuner_addr = ADDR_UNSET,
1501 .radio_addr = ADDR_UNSET,
1506 [BTTV_BOARD_PV_BT878P_PLUS] = {
1507 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1508 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1514 .muxsel = { 2, 3, 1, 1},
1515 .audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
1519 .tuner_addr = ADDR_UNSET,
1520 .radio_addr = ADDR_UNSET,
1523 GPIO0: U4.A0 (hef4052bt)
1525 GPIO2: U4.A1 (second hef4052bt)
1526 GPIO3: U4.nEN, U5.A0, A5.nEN
1530 [BTTV_BOARD_FLYVIDEO98EZ] = {
1531 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1536 .muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1539 .tuner_type = UNSET,
1540 .tuner_addr = ADDR_UNSET,
1541 .radio_addr = ADDR_UNSET,
1544 /* ---- card 0x48 ---------------------------------- */
1545 [BTTV_BOARD_PV_BT878P_9B] = {
1546 /* Dariusz Kowalewski <darekk@automex.pl> */
1547 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1553 .muxsel = { 2, 3, 1, 1 },
1554 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1560 .tuner_addr = ADDR_UNSET,
1561 .radio_addr = ADDR_UNSET,
1562 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1563 .has_radio = 1, /* Note: not all cards have radio */
1570 GPIO20,22,23: R30,R29,R28
1573 [BTTV_BOARD_SENSORAY311] = {
1574 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1575 /* you must jumper JP5 for the card to work */
1576 .name = "Sensoray 311",
1582 .muxsel = { 2, 3, 1, 0, 0},
1586 .tuner_addr = ADDR_UNSET,
1587 .radio_addr = ADDR_UNSET,
1589 [BTTV_BOARD_RV605] = {
1590 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1591 .name = "RemoteVision MX (RV605)",
1597 .gpiomask2 = 0x07ff,
1598 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1599 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1603 .tuner_addr = ADDR_UNSET,
1604 .radio_addr = ADDR_UNSET,
1605 .muxsel_hook = rv605_muxsel,
1607 [BTTV_BOARD_POWERCLR_MTV878] = {
1608 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1613 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1614 .muxsel = { 2, 1, 1, },
1615 .audiomux = { 0, 1, 2, 2, 4 },
1617 .tuner_type = TUNER_PHILIPS_PAL,
1618 .tuner_addr = ADDR_UNSET,
1619 .radio_addr = ADDR_UNSET,
1624 /* ---- card 0x4c ---------------------------------- */
1625 [BTTV_BOARD_WINDVR] = {
1626 /* Masaki Suzuki <masaki@btree.org> */
1627 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1632 .gpiomask = 0x140007,
1633 .muxsel = { 2, 3, 1, 1 },
1634 .audiomux = { 0, 1, 2, 3, 4, 0 },
1635 .tuner_type = TUNER_PHILIPS_NTSC,
1636 .tuner_addr = ADDR_UNSET,
1637 .radio_addr = ADDR_UNSET,
1638 .audio_hook = windvr_audio,
1640 [BTTV_BOARD_GRANDTEC_MULTI] = {
1641 .name = "GrandTec Multi Capture Card (Bt878)",
1647 .muxsel = { 2, 3, 1, 0 },
1653 .tuner_addr = ADDR_UNSET,
1654 .radio_addr = ADDR_UNSET,
1656 [BTTV_BOARD_KWORLD] = {
1657 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1663 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1664 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1665 * This card lacks external Audio In, so we mute it on Ext. & Int.
1666 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1667 * This card lacks PCI subsystem ID, sigh.
1668 * audiomux=1: lower volume, 2+3: mute
1669 * btwincap uses 0x80000/0x80003
1675 .tuner_addr = ADDR_UNSET,
1676 .radio_addr = ADDR_UNSET,
1677 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1678 radio signal strength indicators work fine. */
1681 GPIO0,1: HEF4052 A0,A1
1682 GPIO2: HEF4052 nENABLE
1684 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1688 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1690 [BTTV_BOARD_DSP_TCVIDEO] = {
1691 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1692 .name = "DSP Design TCVIDEO",
1695 .muxsel = { 2, 3, 1, 0},
1698 .tuner_addr = ADDR_UNSET,
1699 .radio_addr = ADDR_UNSET,
1702 /* ---- card 0x50 ---------------------------------- */
1703 [BTTV_BOARD_HAUPPAUGEPVR] = {
1704 .name = "Hauppauge WinTV PVR",
1709 .muxsel = { 2, 0, 1, 1},
1713 .tuner_addr = ADDR_UNSET,
1714 .radio_addr = ADDR_UNSET,
1719 [BTTV_BOARD_GVBCTV5PCI] = {
1720 .name = "IODATA GV-BCTV5/PCI",
1725 .gpiomask = 0x0f0f80,
1726 .muxsel = {2, 3, 1, 0},
1727 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1730 .tuner_type = TUNER_PHILIPS_NTSC_M,
1731 .tuner_addr = ADDR_UNSET,
1732 .radio_addr = ADDR_UNSET,
1733 .audio_hook = gvbctv5pci_audio,
1736 [BTTV_BOARD_OSPREY1x0] = {
1737 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1738 .video_inputs = 4, /* id-inputs-clock */
1742 .muxsel = { 3, 2, 0, 1 },
1745 .tuner_addr = ADDR_UNSET,
1746 .radio_addr = ADDR_UNSET,
1751 [BTTV_BOARD_OSPREY1x0_848] = {
1752 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1757 .muxsel = { 2, 3, 1 },
1760 .tuner_addr = ADDR_UNSET,
1761 .radio_addr = ADDR_UNSET,
1767 /* ---- card 0x54 ---------------------------------- */
1768 [BTTV_BOARD_OSPREY101_848] = {
1769 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1777 .tuner_addr = ADDR_UNSET,
1778 .radio_addr = ADDR_UNSET,
1783 [BTTV_BOARD_OSPREY1x1] = {
1784 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1792 .tuner_addr = ADDR_UNSET,
1793 .radio_addr = ADDR_UNSET,
1798 [BTTV_BOARD_OSPREY1x1_SVID] = {
1799 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1807 .tuner_addr = ADDR_UNSET,
1808 .radio_addr = ADDR_UNSET,
1813 [BTTV_BOARD_OSPREY2xx] = {
1814 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1821 .tuner_type = UNSET,
1822 .tuner_addr = ADDR_UNSET,
1823 .radio_addr = ADDR_UNSET,
1829 /* ---- card 0x58 ---------------------------------- */
1830 [BTTV_BOARD_OSPREY2x0_SVID] = {
1831 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1838 .tuner_type = UNSET,
1839 .tuner_addr = ADDR_UNSET,
1840 .radio_addr = ADDR_UNSET,
1845 [BTTV_BOARD_OSPREY2x0] = {
1846 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1853 .tuner_type = UNSET,
1854 .tuner_addr = ADDR_UNSET,
1855 .radio_addr = ADDR_UNSET,
1860 [BTTV_BOARD_OSPREY500] = {
1861 .name = "Osprey 500", /* 500 */
1869 .tuner_addr = ADDR_UNSET,
1870 .radio_addr = ADDR_UNSET,
1875 [BTTV_BOARD_OSPREY540] = {
1876 .name = "Osprey 540", /* 540 */
1880 #if 0 /* TODO ... */
1881 .svhs = OSPREY540_SVID_ANALOG,
1882 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1883 [OSPREY540_SVID_ANALOG] = 3, },
1887 .tuner_addr = ADDR_UNSET,
1888 .radio_addr = ADDR_UNSET,
1892 #if 0 /* TODO ... */
1893 .muxsel_hook = osprey_540_muxsel,
1894 .picture_hook = osprey_540_set_picture,
1898 /* ---- card 0x5C ---------------------------------- */
1899 [BTTV_BOARD_OSPREY2000] = {
1900 .name = "Osprey 2000", /* 2000 */
1907 .tuner_type = UNSET,
1908 .tuner_addr = ADDR_UNSET,
1909 .radio_addr = ADDR_UNSET,
1912 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1914 [BTTV_BOARD_IDS_EAGLE] = {
1915 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1916 .name = "IDS Eagle",
1921 .tuner_addr = ADDR_UNSET,
1922 .radio_addr = ADDR_UNSET,
1925 .muxsel = { 0, 1, 2, 3 },
1926 .muxsel_hook = eagle_muxsel,
1931 [BTTV_BOARD_PINNACLESAT] = {
1932 .name = "Pinnacle PCTV Sat",
1938 .tuner_addr = ADDR_UNSET,
1939 .radio_addr = ADDR_UNSET,
1943 .muxsel = { 3, 0, 1, 2},
1948 [BTTV_BOARD_FORMAC_PROTV] = {
1949 .name = "Formac ProTV II (bt878)",
1955 /* TV, Comp1, Composite over SVID con, SVID */
1956 .muxsel = { 2, 3, 1, 1},
1957 .audiomux = { 2, 2, 0, 0, 0 },
1960 .tuner_type = TUNER_PHILIPS_PAL,
1961 .tuner_addr = ADDR_UNSET,
1962 .radio_addr = ADDR_UNSET,
1964 GPIO=0x00,0x01,0x03: mute (?)
1965 0x02: both TV and radio (tuner: FM1216/I)
1966 The card has onboard audio connectors labeled "cdrom" and "board",
1967 not soldered here, though unknown wiring.
1968 Card lacks: external audio in, pci subsystem id.
1972 /* ---- card 0x60 ---------------------------------- */
1973 [BTTV_BOARD_MACHTV] = {
1980 .muxsel = { 2, 3, 1, 1},
1981 .audiomux = { 0, 1, 2, 3, 4},
1984 .tuner_addr = ADDR_UNSET,
1985 .radio_addr = ADDR_UNSET,
1988 [BTTV_BOARD_EURESYS_PICOLO] = {
1989 .name = "Euresys Picolo",
1998 .muxsel = { 2, 0, 1},
2000 .tuner_type = UNSET,
2001 .tuner_addr = ADDR_UNSET,
2002 .radio_addr = ADDR_UNSET,
2004 [BTTV_BOARD_PV150] = {
2005 /* Luc Van Hoeylandt <luc@e-magic.be> */
2006 .name = "ProVideo PV150", /* 0x4f */
2017 .tuner_type = UNSET,
2018 .tuner_addr = ADDR_UNSET,
2019 .radio_addr = ADDR_UNSET,
2021 [BTTV_BOARD_AD_TVK503] = {
2022 /* Hiroshi Takekawa <sian@big.or.jp> */
2023 /* This card lacks subsystem ID */
2024 .name = "AD-TVK503", /* 0x63 */
2029 .gpiomask = 0x001e8007,
2030 .muxsel = { 2, 3, 1, 0 },
2031 /* Tuner, Radio, external, internal, off, on */
2032 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2037 .tuner_addr = ADDR_UNSET,
2038 .radio_addr = ADDR_UNSET,
2039 .audio_hook = adtvk503_audio,
2042 /* ---- card 0x64 ---------------------------------- */
2043 [BTTV_BOARD_HERCULES_SM_TV] = {
2044 .name = "Hercules Smart TV Stereo",
2050 .muxsel = { 2, 3, 1, 1 },
2055 .tuner_addr = ADDR_UNSET,
2056 .radio_addr = ADDR_UNSET,
2058 - card lacks subsystem ID
2059 - stereo variant w/ daughter board with tda9874a @0xb0
2061 always from tda9874 independent of GPIO (?)
2062 external line in: unknown
2063 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2064 hef4053 (instead 4052) for unknown function
2067 [BTTV_BOARD_PACETV] = {
2068 .name = "Pace TV & Radio Card",
2073 .muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
2078 .tuner_addr = ADDR_UNSET,
2079 .radio_addr = ADDR_UNSET,
2082 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2083 only internal line out: (4pin header) RGGL
2084 Radio must be decoded by msp3410d (not routed through)*/
2086 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2089 [BTTV_BOARD_IVC200] = {
2090 /* Chris Willing <chris@vislab.usyd.edu.au> */
2096 .tuner_addr = ADDR_UNSET,
2097 .radio_addr = ADDR_UNSET,
2103 [BTTV_BOARD_XGUARD] = {
2104 .name = "Grand X-Guard / Trust 814PCI",
2110 .tuner_addr = ADDR_UNSET,
2111 .radio_addr = ADDR_UNSET,
2113 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2114 .muxsel_hook = xguard_muxsel,
2121 /* ---- card 0x68 ---------------------------------- */
2122 [BTTV_BOARD_NEBULA_DIGITV] = {
2123 .name = "Nebula Electronics DigiTV",
2127 .muxsel = { 2, 3, 1, 0},
2133 .tuner_addr = ADDR_UNSET,
2134 .radio_addr = ADDR_UNSET,
2138 [BTTV_BOARD_PV143] = {
2139 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2140 .name = "ProVideo PV143",
2146 .muxsel = { 2, 3, 1, 0 },
2152 .tuner_addr = ADDR_UNSET,
2153 .radio_addr = ADDR_UNSET,
2155 [BTTV_BOARD_VD009X1_MINIDIN] = {
2156 /* M.Klahr@phytec.de */
2157 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2160 .tuner = -1, /* card has no tuner */
2163 .muxsel = { 2, 3, 1, 0},
2164 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2168 .tuner_addr = ADDR_UNSET,
2169 .radio_addr = ADDR_UNSET,
2171 [BTTV_BOARD_VD009X1_COMBI] = {
2172 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2175 .tuner = -1, /* card has no tuner */
2178 .muxsel = { 2, 3, 1, 1},
2179 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2183 .tuner_addr = ADDR_UNSET,
2184 .radio_addr = ADDR_UNSET,
2187 /* ---- card 0x6c ---------------------------------- */
2188 [BTTV_BOARD_VD009_MINIDIN] = {
2189 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2192 .tuner = -1, /* card has no tuner */
2195 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2196 via the upper nibble of muxsel. here: used for
2197 xternal video-mux */
2198 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2199 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2203 .tuner_addr = ADDR_UNSET,
2204 .radio_addr = ADDR_UNSET,
2206 [BTTV_BOARD_VD009_COMBI] = {
2207 .name = "PHYTEC VD-009 Combi (bt878)",
2210 .tuner = -1, /* card has no tuner */
2213 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2214 via the upper nibble of muxsel. here: used for
2215 xternal video-mux */
2216 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2217 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2221 .tuner_addr = ADDR_UNSET,
2222 .radio_addr = ADDR_UNSET,
2224 [BTTV_BOARD_IVC100] = {
2230 .tuner_addr = ADDR_UNSET,
2231 .radio_addr = ADDR_UNSET,
2234 .muxsel = { 2, 3, 1, 0 },
2237 [BTTV_BOARD_IVC120] = {
2238 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2241 .audio_inputs = 0, /* card has no audio */
2242 .tuner = -1, /* card has no tuner */
2244 .tuner_addr = ADDR_UNSET,
2245 .radio_addr = ADDR_UNSET,
2246 .svhs = -1, /* card has no svhs */
2252 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2253 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2254 .muxsel_hook = ivc120_muxsel,
2258 /* ---- card 0x70 ---------------------------------- */
2259 [BTTV_BOARD_PC_HDTV] = {
2260 .name = "pcHDTV HD-2000 TV",
2265 .muxsel = { 2, 3, 1, 0},
2266 .tuner_type = TUNER_PHILIPS_ATSC,
2267 .tuner_addr = ADDR_UNSET,
2268 .radio_addr = ADDR_UNSET,
2271 [BTTV_BOARD_TWINHAN_DST] = {
2272 .name = "Twinhan DST + clones",
2276 .tuner_type = TUNER_ABSENT,
2277 .tuner_addr = ADDR_UNSET,
2278 .radio_addr = ADDR_UNSET,
2282 [BTTV_BOARD_WINFASTVC100] = {
2283 .name = "Winfast VC100",
2288 .muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
2292 .tuner_type = TUNER_ABSENT,
2293 .tuner_addr = ADDR_UNSET,
2294 .radio_addr = ADDR_UNSET,
2297 [BTTV_BOARD_TEV560] = {
2298 .name = "Teppro TEV-560/InterVision IV-560",
2304 .muxsel = { 2, 3, 1, 1},
2305 .audiomux = { 1, 1, 1, 1, 0},
2307 .tuner_type = TUNER_PHILIPS_PAL,
2308 .tuner_addr = ADDR_UNSET,
2309 .radio_addr = ADDR_UNSET,
2313 /* ---- card 0x74 ---------------------------------- */
2314 [BTTV_BOARD_SIMUS_GVC1100] = {
2315 .name = "SIMUS GVC1100",
2321 .tuner_addr = ADDR_UNSET,
2322 .radio_addr = ADDR_UNSET,
2324 .muxsel = { 2, 2, 2, 2},
2326 .muxsel_hook = gvc1100_muxsel,
2328 [BTTV_BOARD_NGSTV_PLUS] = {
2329 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2330 .name = "NGS NGSTV+",
2334 .gpiomask = 0x008007,
2335 .muxsel = {2, 3, 0, 0},
2336 .audiomux = {0, 0, 0, 0, 0x000003, 0},
2338 .tuner_type = TUNER_PHILIPS_PAL,
2339 .tuner_addr = ADDR_UNSET,
2340 .radio_addr = ADDR_UNSET,
2343 [BTTV_BOARD_LMLBT4] = {
2344 /* http://linuxmedialabs.com */
2346 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2350 .muxsel = { 2, 3, 1, 0 },
2356 .tuner_addr = ADDR_UNSET,
2357 .radio_addr = ADDR_UNSET,
2359 [BTTV_BOARD_TEKRAM_M205] = {
2360 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2361 .name = "Tekram M205 PRO",
2365 .tuner_type = TUNER_PHILIPS_PAL,
2366 .tuner_addr = ADDR_UNSET,
2367 .radio_addr = ADDR_UNSET,
2371 .muxsel = { 2, 3, 1},
2372 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2376 /* ---- card 0x78 ---------------------------------- */
2377 [BTTV_BOARD_CONTVFMI] = {
2378 /* Javier Cendan Ares <jcendan@lycos.es> */
2379 /* bt878 TV + FM without subsystem ID */
2380 .name = "Conceptronic CONTVFMi",
2385 .gpiomask = 0x008007,
2386 .muxsel = { 2, 3, 1, 1 },
2387 .audiomux = { 0, 1, 2, 2, 3 },
2390 .tuner_type = TUNER_PHILIPS_PAL,
2391 .tuner_addr = ADDR_UNSET,
2392 .radio_addr = ADDR_UNSET,
2396 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2397 /*Eric DEBIEF <debief@telemsa.com>*/
2398 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2399 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2401 .name = "Euresys Picolo Tetra",
2407 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2411 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2412 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2415 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2417 .tuner_addr = ADDR_UNSET,
2418 .radio_addr = ADDR_UNSET,
2420 [BTTV_BOARD_SPIRIT_TV] = {
2421 /* Spirit TV Tuner from http://spiritmodems.com.au */
2422 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2423 .name = "Spirit TV Tuner",
2428 .gpiomask = 0x0000000f,
2429 .muxsel = { 2, 1, 1 },
2430 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2431 .tuner_type = TUNER_TEMIC_PAL,
2432 .tuner_addr = ADDR_UNSET,
2433 .radio_addr = ADDR_UNSET,
2437 [BTTV_BOARD_AVDVBT_771] = {
2438 /* Wolfram Joost <wojo@frokaschwei.de> */
2439 .name = "AVerMedia AVerTV DVB-T 771",
2443 .tuner_type = TUNER_ABSENT,
2444 .tuner_addr = ADDR_UNSET,
2445 .radio_addr = ADDR_UNSET,
2446 .muxsel = { 3 , 3 },
2455 /* ---- card 0x7c ---------------------------------- */
2456 [BTTV_BOARD_AVDVBT_761] = {
2457 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2458 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2459 .name = "AverMedia AverTV DVB-T 761",
2463 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2469 .tuner_addr = ADDR_UNSET,
2470 .radio_addr = ADDR_UNSET,
2475 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2476 /* andre.schwarz@matrix-vision.de */
2477 .name = "MATRIX Vision Sigma-SQ",
2483 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2484 3, 3, 3, 3, 3, 3, 3, 3 },
2485 .muxsel_hook = sigmaSQ_muxsel,
2490 .tuner_addr = ADDR_UNSET,
2491 .radio_addr = ADDR_UNSET,
2493 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2494 /* andre.schwarz@matrix-vision.de */
2495 .name = "MATRIX Vision Sigma-SLC",
2501 .muxsel = { 2, 2, 2, 2 },
2502 .muxsel_hook = sigmaSLC_muxsel,
2507 .tuner_addr = ADDR_UNSET,
2508 .radio_addr = ADDR_UNSET,
2510 /* BTTV_BOARD_APAC_VIEWCOMP */
2511 [BTTV_BOARD_APAC_VIEWCOMP] = {
2512 /* Attila Kondoros <attila.kondoros@chello.hu> */
2513 /* bt878 TV + FM 0x00000000 subsystem ID */
2514 .name = "APAC Viewcomp 878(AMAX)",
2520 .muxsel = { 2, 3, 1, 1},
2521 .audiomux = { 2, 0, 0, 0, 10},
2524 .tuner_type = TUNER_PHILIPS_PAL,
2525 .tuner_addr = ADDR_UNSET,
2526 .radio_addr = ADDR_UNSET,
2527 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2528 .has_radio = 1, /* not every card has radio */
2531 /* ---- card 0x80 ---------------------------------- */
2532 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2533 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2534 .name = "DViCO FusionHDTV DVB-T Lite",
2543 .tuner_addr = ADDR_UNSET,
2544 .radio_addr = ADDR_UNSET,
2546 [BTTV_BOARD_VGEAR_MYVCD] = {
2547 /* Steven <photon38@pchome.com.tw> */
2548 .name = "V-Gear MyVCD",
2554 .muxsel = {2, 3, 1, 0},
2555 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2558 .tuner_type = TUNER_PHILIPS_NTSC_M,
2559 .tuner_addr = ADDR_UNSET,
2560 .radio_addr = ADDR_UNSET,
2566 [BTTV_BOARD_SUPER_TV] = {
2567 /* Rick C <cryptdragoon@gmail.com> */
2568 .name = "Super TV Tuner",
2573 .muxsel = { 2, 3, 1, 0},
2574 .tuner_type = TUNER_PHILIPS_NTSC,
2575 .tuner_addr = ADDR_UNSET,
2576 .radio_addr = ADDR_UNSET,
2577 .gpiomask = 0x008007,
2578 .audiomux = { 0, 0x000001,0,0, 0},
2582 [BTTV_BOARD_TIBET_CS16] = {
2583 /* Chris Fanning <video4linux@haydon.net> */
2584 .name = "Tibet Systems 'Progress DVR' CS16",
2589 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2595 .tuner_addr = ADDR_UNSET,
2596 .radio_addr = ADDR_UNSET,
2597 .muxsel_hook = tibetCS16_muxsel,
2599 [BTTV_BOARD_KODICOM_4400R] = {
2600 /* Bill Brack <wbrack@mmm.com.hk> */
2602 * Note that, because of the card's wiring, the "master"
2603 * BT878A chip (i.e. the one which controls the analog switch
2604 * and must use this card type) is the 2nd one detected. The
2605 * other 3 chips should use card type 0x85, whose description
2606 * follows this one. There is a EEPROM on the card (which is
2607 * connected to the I2C of one of those other chips), but is
2608 * not currently handled. There is also a facility for a
2609 * "monitor", which is also not currently implemented.
2611 .name = "Kodicom 4400R (master)",
2616 .tuner_addr = ADDR_UNSET,
2617 .radio_addr = ADDR_UNSET,
2619 /* GPIO bits 0-9 used for analog switch:
2620 * 00 - 03: camera selector
2621 * 04 - 06: channel (controller) selector
2622 * 07: data (1->on, 0->off)
2625 * bit 16 is input from sync separator for the channel
2627 .gpiomask = 0x0003ff,
2629 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2634 .muxsel_hook = kodicom4400r_muxsel,
2636 [BTTV_BOARD_KODICOM_4400R_SL] = {
2637 /* Bill Brack <wbrack@mmm.com.hk> */
2638 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2639 * one which controls the analog switch, and must use the card type)
2640 * is the 2nd one detected. The other 3 chips should use this card
2643 .name = "Kodicom 4400R (slave)",
2648 .tuner_addr = ADDR_UNSET,
2649 .radio_addr = ADDR_UNSET,
2651 .gpiomask = 0x010000,
2653 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2658 .muxsel_hook = kodicom4400r_muxsel,
2660 /* ---- card 0x86---------------------------------- */
2661 [BTTV_BOARD_ADLINK_RTV24] = {
2662 /* Michael Henson <mhenson@clarityvi.com> */
2663 /* Adlink RTV24 with special unlock codes */
2664 .name = "Adlink RTV24",
2669 .muxsel = { 2, 3, 1, 0},
2671 .tuner_addr = ADDR_UNSET,
2672 .radio_addr = ADDR_UNSET,
2675 /* ---- card 0x87---------------------------------- */
2676 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2677 /* Michael Krufky <mkrufky@m1k.net> */
2678 .name = "DViCO FusionHDTV 5 Lite",
2680 .tuner_type = TUNER_LG_TDVS_H062F,
2681 .tuner_addr = ADDR_UNSET,
2682 .radio_addr = ADDR_UNSET,
2686 .muxsel = { 2, 3, 1 },
2687 .gpiomask = 0x00e00007,
2688 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2694 /* ---- card 0x88---------------------------------- */
2695 [BTTV_BOARD_ACORP_Y878F] = {
2696 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2697 .name = "Acorp Y878F",
2702 .gpiomask = 0x01fe00,
2703 .muxsel = { 2, 3, 1, 1},
2704 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2707 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2708 .tuner_addr = 0xc1 >>1,
2709 .radio_addr = 0xc1 >>1,
2712 /* ---- card 0x89 ---------------------------------- */
2713 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2714 .name = "Conceptronic CTVFMi v2",
2719 .gpiomask = 0x001c0007,
2720 .muxsel = { 2, 3, 1, 1 },
2721 .audiomux = { 0, 1, 2, 2, 3 },
2724 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2725 .tuner_addr = ADDR_UNSET,
2726 .radio_addr = ADDR_UNSET,
2732 /* ---- card 0x8a ---------------------------------- */
2733 [BTTV_BOARD_PV_BT878P_2E] = {
2734 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2739 .gpiomask = 0x01fe00,
2740 .muxsel = { 2,3,1,1,-1 },
2741 .digital_mode = DIGITAL_MODE_CAMERA,
2742 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2745 .tuner_type = TUNER_LG_PAL_FM,
2746 .tuner_addr = ADDR_UNSET,
2747 .radio_addr = ADDR_UNSET,
2750 /* ---- card 0x8b ---------------------------------- */
2751 [BTTV_BOARD_PV_M4900] = {
2752 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2753 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2759 .muxsel = { 2, 3, 1, 1 },
2760 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2763 .tuner_type = TUNER_YMEC_TVF_5533MF,
2764 .tuner_addr = ADDR_UNSET,
2765 .radio_addr = ADDR_UNSET,
2769 /* ---- card 0x8c ---------------------------------- */
2770 [BTTV_BOARD_OSPREY440] = {
2771 .name = "Osprey 440",
2778 .tuner_type = UNSET,
2779 .tuner_addr = ADDR_UNSET,
2780 .radio_addr = ADDR_UNSET,
2785 /* ---- card 0x8d ---------------------------------- */
2786 [BTTV_BOARD_ASOUND_SKYEYE] = {
2787 .name = "Asound Skyeye PCTV",
2793 .muxsel = { 2, 3, 1, 1},
2794 .audiomux = {2,0,0,0,1},
2798 .tuner_addr = ADDR_UNSET,
2799 .radio_addr = ADDR_UNSET,
2804 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2806 /* ----------------------------------------------------------------------- */
2808 static unsigned char eeprom_data[256];
2813 void __devinit bttv_idcard(struct bttv *btv)
2815 unsigned int gpiobits;
2819 /* read PCI subsystem ID */
2820 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2821 btv->cardid = tmp << 16;
2822 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2825 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2826 /* look for the card */
2827 for (type = -1, i = 0; cards[i].id != 0; i++)
2828 if (cards[i].id == btv->cardid)
2833 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2834 "PCI subsystem ID is %04x:%04x\n",
2835 btv->c.nr,cards[type].name,cards[type].cardnr,
2836 btv->cardid & 0xffff,
2837 (btv->cardid >> 16) & 0xffff);
2838 btv->c.type = cards[type].cardnr;
2841 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2842 btv->c.nr, btv->cardid & 0xffff,
2843 (btv->cardid >> 16) & 0xffff);
2844 printk(KERN_DEBUG "please mail id, board name and "
2845 "the correct card= insmod option to video4linux-list@redhat.com\n");
2849 /* let the user override the autodetected type */
2850 if (card[btv->c.nr] < bttv_num_tvcards)
2851 btv->c.type=card[btv->c.nr];
2853 /* print which card config we are using */
2854 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2855 bttv_tvcards[btv->c.type].name, btv->c.type,
2856 card[btv->c.nr] < bttv_num_tvcards
2857 ? "insmod option" : "autodetected");
2859 /* overwrite gpio stuff ?? */
2860 if (UNSET == audioall && UNSET == audiomux[0])
2863 if (UNSET != audiomux[0]) {
2865 for (i = 0; i < 5; i++) {
2866 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2867 gpiobits |= audiomux[i];
2870 gpiobits = audioall;
2871 for (i = 0; i < 5; i++) {
2872 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2875 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2876 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2877 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2878 for (i = 0; i < 5; i++) {
2879 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2885 * (most) board specific initialisations goes here
2888 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2889 void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2893 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2894 type = BTTV_BOARD_MODTEC_205;
2895 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2896 type = BTTV_BOARD_EURESYS_PICOLO;
2897 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2898 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2902 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2903 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2907 static void flyvideo_gpio(struct bttv *btv)
2909 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2912 gpio_inout(0xffffff, 0);
2913 udelay(8); /* without this we would see the 0x1800 mask */
2915 /* FIXME: must restore OUR_EN ??? */
2917 /* all cards provide GPIO info, some have an additional eeprom
2918 * LR50: GPIO coding can be found lower right CP1 .. CP9
2919 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2921 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
2923 * lowest 3 bytes are remote control codes (no handshake needed)
2924 * xxxFFF: No remote control chip soldered
2925 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2926 * Note: Some bits are Audio_Mask !
2928 ttype=(gpio&0x0f0000)>>16;
2930 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
2932 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
2934 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
2936 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
2938 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
2941 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2944 has_remote = gpio & 0x800000;
2945 has_radio = gpio & 0x400000;
2946 /* unknown 0x200000;
2947 * unknown2 0x100000; */
2948 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
2949 has_tda9820_tda9821 = !(gpio & 0x004000);
2950 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2952 * gpio & 0x001000 output bit for audio routing */
2955 tuner=4; /* No tuner present */
2957 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2958 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2959 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2960 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2961 is_capture_only?"yes":"no ");
2963 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
2964 btv->tuner_type = tuner;
2965 btv->has_radio = has_radio;
2967 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2968 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2969 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
2970 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
2971 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
2974 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2975 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2976 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2977 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2979 static void miro_pinnacle_gpio(struct bttv *btv)
2984 gpio_inout(0xffffff, 0);
2986 id = ((gpio>>10) & 63) -1;
2987 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2989 btv->tuner_type = miro_tunermap[id];
2990 if (0 == (gpio & 0x20)) {
2992 if (!miro_fmtuner[id]) {
2993 btv->has_matchbox = 1;
2994 btv->mbox_we = (1<<6);
2995 btv->mbox_most = (1<<7);
2996 btv->mbox_clk = (1<<8);
2997 btv->mbox_data = (1<<9);
2998 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3004 if (btv->c.type == BTTV_BOARD_MIRO)
3005 btv->c.type = BTTV_BOARD_MIROPRO;
3006 if (btv->c.type == BTTV_BOARD_PINNACLE)
3007 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3010 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3011 btv->c.nr, id+1, btv->tuner_type,
3012 !btv->has_radio ? "no" :
3013 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3014 (-1 == msp) ? "no" : "yes");
3016 /* new cards with microtune tuner */
3021 info = "PAL / mono";
3024 info = "PAL+SECAM / stereo";
3028 info = "NTSC / stereo";
3032 info = "PAL+SECAM / mono";
3035 info = "NTSC / mono";
3038 info = "NTSC / stereo";
3041 info = "PAL / stereo";
3044 info = "oops: unknown card";
3048 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3050 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3051 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3052 btv->tuner_type = 33;
3053 btv->pinnacle_id = id;
3057 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3058 #define LM1882_SYNC_DRIVE 0x200000L
3060 static void init_ids_eagle(struct bttv *btv)
3062 gpio_inout(0xffffff,0xFFFF37);
3063 gpio_write(0x200020);
3065 /* flash strobe inverter ?! */
3066 gpio_write(0x200024);
3068 /* switch sync drive off */
3069 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3071 /* set BT848 muxel to 2 */
3072 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3075 /* Muxsel helper for the IDS Eagle.
3076 * the eagles does not use the standard muxsel-bits but
3077 * has its own multiplexer */
3078 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3080 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3081 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3084 /* set chroma ADC to sleep */
3085 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3086 /* set to composite video */
3087 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3088 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3090 /* switch sync drive off */
3091 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3094 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3096 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3097 gpio_write(masks[input%4]);
3100 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3103 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3104 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3106 IN - sensor inputs, INx - sensor inputs and TI XORed together
3107 O1,O2,O3 - alarm outputs (relays)
3109 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3113 static void init_lmlbt4x(struct bttv *btv)
3115 printk(KERN_DEBUG "LMLBT4x init\n");
3116 btwrite(0x000000, BT848_GPIO_REG_INP);
3117 gpio_inout(0xffffff, 0x0006C0);
3118 gpio_write(0x000000);
3121 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3123 unsigned int inmux = input % 8;
3124 gpio_inout( 0xf, 0xf );
3125 gpio_bits( 0xf, inmux );
3128 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3130 unsigned int inmux = input % 4;
3131 gpio_inout( 3<<9, 3<<9 );
3132 gpio_bits( 3<<9, inmux<<9 );
3135 /* ----------------------------------------------------------------------- */
3137 static void bttv_reset_audio(struct bttv *btv)
3140 * BT878A has a audio-reset register.
3141 * 1. This register is an audio reset function but it is in
3142 * function-0 (video capture) address space.
3143 * 2. It is enough to do this once per power-up of the card.
3144 * 3. There is a typo in the Conexant doc -- it is not at
3145 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3146 * --//Shrikumar 030609
3152 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3153 btwrite((1<<7), 0x058);
3158 /* initialization part one -- before registering i2c bus */
3159 void __devinit bttv_init_card1(struct bttv *btv)
3161 switch (btv->c.type) {
3162 case BTTV_BOARD_HAUPPAUGE:
3163 case BTTV_BOARD_HAUPPAUGE878:
3164 boot_msp34xx(btv,5);
3166 case BTTV_BOARD_VOODOOTV_FM:
3167 boot_msp34xx(btv,20);
3169 case BTTV_BOARD_AVERMEDIA98:
3170 boot_msp34xx(btv,11);
3172 case BTTV_BOARD_HAUPPAUGEPVR:
3175 case BTTV_BOARD_TWINHAN_DST:
3176 case BTTV_BOARD_AVDVBT_771:
3177 case BTTV_BOARD_PINNACLESAT:
3178 btv->use_i2c_hw = 1;
3180 case BTTV_BOARD_ADLINK_RTV24:
3185 if (!bttv_tvcards[btv->c.type].has_dvb)
3186 bttv_reset_audio(btv);
3189 /* initialization part two -- after registering i2c bus */
3190 void __devinit bttv_init_card2(struct bttv *btv)
3193 int addr=ADDR_UNSET, radio_addr=ADDR_UNSET;
3195 btv->tuner_type = -1;
3197 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3198 bttv_readee(btv,eeprom_data,0xa0);
3199 identify_by_eeprom(btv,eeprom_data);
3202 switch (btv->c.type) {
3203 case BTTV_BOARD_MIRO:
3204 case BTTV_BOARD_MIROPRO:
3205 case BTTV_BOARD_PINNACLE:
3206 case BTTV_BOARD_PINNACLEPRO:
3208 miro_pinnacle_gpio(btv);
3210 case BTTV_BOARD_FLYVIDEO_98:
3211 case BTTV_BOARD_MAXI:
3212 case BTTV_BOARD_LIFE_FLYKIT:
3213 case BTTV_BOARD_FLYVIDEO:
3214 case BTTV_BOARD_TYPHOON_TVIEW:
3215 case BTTV_BOARD_CHRONOS_VS2:
3216 case BTTV_BOARD_FLYVIDEO_98FM:
3217 case BTTV_BOARD_FLYVIDEO2000:
3218 case BTTV_BOARD_FLYVIDEO98EZ:
3219 case BTTV_BOARD_CONFERENCETV:
3220 case BTTV_BOARD_LIFETEC_9415:
3223 case BTTV_BOARD_HAUPPAUGE:
3224 case BTTV_BOARD_HAUPPAUGE878:
3225 case BTTV_BOARD_HAUPPAUGEPVR:
3226 /* pick up some config infos from the eeprom */
3227 bttv_readee(btv,eeprom_data,0xa0);
3228 hauppauge_eeprom(btv);
3230 case BTTV_BOARD_AVERMEDIA98:
3231 case BTTV_BOARD_AVPHONE98:
3232 bttv_readee(btv,eeprom_data,0xa0);
3233 avermedia_eeprom(btv);
3235 case BTTV_BOARD_PXC200:
3238 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3239 picolo_tetra_init(btv);
3241 case BTTV_BOARD_VHX:
3243 btv->has_matchbox = 1;
3244 btv->mbox_we = 0x20;
3246 btv->mbox_clk = 0x08;
3247 btv->mbox_data = 0x10;
3248 btv->mbox_mask = 0x38;
3250 case BTTV_BOARD_VOBIS_BOOSTAR:
3251 case BTTV_BOARD_TERRATV:
3252 terratec_active_radio_upgrade(btv);
3254 case BTTV_BOARD_MAGICTVIEW061:
3255 if (btv->cardid == 0x3002144f) {
3257 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3260 case BTTV_BOARD_STB2:
3261 if (btv->cardid == 0x3060121a) {
3262 /* Fix up entry for 3DFX VoodooTV 100,
3263 which is an OEM STB card variant. */
3265 btv->tuner_type=TUNER_TEMIC_NTSC;
3268 case BTTV_BOARD_OSPREY1x0:
3269 case BTTV_BOARD_OSPREY1x0_848:
3270 case BTTV_BOARD_OSPREY101_848:
3271 case BTTV_BOARD_OSPREY1x1:
3272 case BTTV_BOARD_OSPREY1x1_SVID:
3273 case BTTV_BOARD_OSPREY2xx:
3274 case BTTV_BOARD_OSPREY2x0_SVID:
3275 case BTTV_BOARD_OSPREY2x0:
3276 case BTTV_BOARD_OSPREY500:
3277 case BTTV_BOARD_OSPREY540:
3278 case BTTV_BOARD_OSPREY2000:
3279 bttv_readee(btv,eeprom_data,0xa0);
3282 case BTTV_BOARD_IDS_EAGLE:
3283 init_ids_eagle(btv);
3285 case BTTV_BOARD_MODTEC_205:
3286 bttv_readee(btv,eeprom_data,0xa0);
3289 case BTTV_BOARD_LMLBT4:
3292 case BTTV_BOARD_TIBET_CS16:
3293 tibetCS16_init(btv);
3295 case BTTV_BOARD_KODICOM_4400R:
3296 kodicom4400r_init(btv);
3300 /* pll configuration */
3301 if (!(btv->id==848 && btv->revision==0x11)) {
3302 /* defaults from card list */
3303 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3304 btv->pll.pll_ifreq=28636363;
3305 btv->pll.pll_crystal=BT848_IFORM_XT0;
3307 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3308 btv->pll.pll_ifreq=35468950;
3309 btv->pll.pll_crystal=BT848_IFORM_XT1;
3311 /* insmod options can override */
3312 switch (pll[btv->c.nr]) {
3314 btv->pll.pll_crystal = 0;
3315 btv->pll.pll_ifreq = 0;
3316 btv->pll.pll_ofreq = 0;
3318 case 1: /* 28 MHz */
3320 btv->pll.pll_ifreq = 28636363;
3321 btv->pll.pll_ofreq = 0;
3322 btv->pll.pll_crystal = BT848_IFORM_XT0;
3324 case 2: /* 35 MHz */
3326 btv->pll.pll_ifreq = 35468950;
3327 btv->pll.pll_ofreq = 0;
3328 btv->pll.pll_crystal = BT848_IFORM_XT1;
3332 btv->pll.pll_current = -1;
3334 /* tuner configuration (from card list / autodetect / insmod option) */
3335 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3336 addr = bttv_tvcards[btv->c.type].tuner_addr;
3338 if (ADDR_UNSET != bttv_tvcards[btv->c.type].radio_addr)
3339 radio_addr = bttv_tvcards[btv->c.type].radio_addr;
3341 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3342 if(UNSET == btv->tuner_type)
3343 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3344 if (UNSET != tuner[btv->c.nr])
3345 btv->tuner_type = tuner[btv->c.nr];
3346 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
3347 if (btv->pinnacle_id != UNSET)
3348 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
3350 if (btv->tuner_type != UNSET) {
3351 struct tuner_setup tun_setup;
3353 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3354 tun_setup.type = btv->tuner_type;
3355 tun_setup.addr = addr;
3357 if (addr == radio_addr)
3358 tun_setup.mode_mask = T_RADIO;
3360 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3363 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3364 if (svhs[btv->c.nr] != UNSET)
3365 btv->svhs = svhs[btv->c.nr];
3366 if (remote[btv->c.nr] != UNSET)
3367 btv->has_remote = remote[btv->c.nr];
3369 if (bttv_tvcards[btv->c.type].has_radio)
3371 if (bttv_tvcards[btv->c.type].has_remote)
3373 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3375 if (bttv_tvcards[btv->c.type].audio_hook)
3376 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3378 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3379 /* detect Bt832 chip for quartzsight digital camera */
3380 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
3381 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
3388 /* try to detect audio/fader chips */
3389 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3390 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
3391 request_module("msp3400");
3393 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3394 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3395 request_module("msp3400");
3397 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3398 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
3399 request_module("tda9875");
3401 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3402 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
3403 request_module("tda7432");
3405 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3406 request_module("tvaudio");
3410 if (btv->pinnacle_id != UNSET)
3412 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3413 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
3415 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3416 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3417 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3419 request_module("tda9887");
3420 if (btv->tuner_type != UNSET)
3421 request_module("tuner");
3425 /* ----------------------------------------------------------------------- */
3427 static void modtec_eeprom(struct bttv *btv)
3429 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3430 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3431 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3432 btv->c.nr,&eeprom_data[0x1e]);
3433 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3434 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3435 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3436 btv->c.nr,&eeprom_data[0x1e]);
3437 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3438 btv->tuner_type=TUNER_PHILIPS_NTSC;
3439 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3440 btv->c.nr,&eeprom_data[0x1e]);
3442 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3443 btv->c.nr,&eeprom_data[0x1e]);
3447 static void __devinit hauppauge_eeprom(struct bttv *btv)
3451 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3452 btv->tuner_type = tv.tuner_type;
3453 btv->has_radio = tv.has_radio;
3456 static int terratec_active_radio_upgrade(struct bttv *btv)
3461 btv->has_matchbox = 1;
3462 btv->mbox_we = 0x10;
3463 btv->mbox_most = 0x20;
3464 btv->mbox_clk = 0x08;
3465 btv->mbox_data = 0x04;
3466 btv->mbox_mask = 0x3c;
3468 btv->mbox_iow = 1 << 8;
3469 btv->mbox_ior = 1 << 9;
3470 btv->mbox_csel = 1 << 10;
3473 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3474 if (0x1ed8 == tea5757_read(btv)) {
3475 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3478 btv->has_matchbox = 1;
3481 btv->has_matchbox = 0;
3487 /* ----------------------------------------------------------------------- */
3490 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3492 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3493 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3494 * unpacked with unzip).
3496 #define PVR_GPIO_DELAY 10
3498 #define BTTV_ALT_DATA 0x000001
3499 #define BTTV_ALT_DCLK 0x100000
3500 #define BTTV_ALT_NCONFIG 0x800000
3502 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3508 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3510 udelay(PVR_GPIO_DELAY);
3512 gpio_write(BTTV_ALT_NCONFIG);
3513 udelay(PVR_GPIO_DELAY);
3515 for (n = 0; n < microlen; n++) {
3517 for ( i = 0 ; i < 8 ; i++ ) {
3518 gpio_bits(BTTV_ALT_DCLK,0);
3520 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3522 gpio_bits(BTTV_ALT_DATA,0);
3523 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3527 gpio_bits(BTTV_ALT_DCLK,0);
3528 udelay(PVR_GPIO_DELAY);
3530 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3531 for (i = 0 ; i < 30 ; i++) {
3532 gpio_bits(BTTV_ALT_DCLK,0);
3533 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3535 gpio_bits(BTTV_ALT_DCLK,0);
3539 static int __devinit pvr_boot(struct bttv *btv)
3541 const struct firmware *fw_entry;
3544 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3546 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3550 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3551 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3552 btv->c.nr, (rc < 0) ? "failed" : "ok");
3553 release_firmware(fw_entry);
3557 /* ----------------------------------------------------------------------- */
3558 /* some osprey specific stuff */
3560 static void __devinit osprey_eeprom(struct bttv *btv)
3563 unsigned char *ee = eeprom_data;
3564 unsigned long serial = 0;
3566 if (btv->c.type == 0) {
3567 /* this might be an antique... check for MMAC label in eeprom */
3568 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3569 unsigned char checksum = 0;
3570 for (i =0; i<21; i++)
3572 if (checksum != ee[21])
3574 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3575 for (i = 12; i < 21; i++)
3576 serial *= 10, serial += ee[i] - '0';
3579 unsigned short type;
3582 for(; offset < 8*16; offset += 16) {
3583 unsigned short checksum = 0;
3584 /* verify the checksum */
3585 for(i = 0; i<14; i++) checksum += ee[i+offset];
3586 checksum = ~checksum; /* no idea why */
3587 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3588 ((checksum & 0x0FF) == ee[offset+15])) {
3596 /* found a valid descriptor */
3597 type = (ee[offset+4]<<8) | (ee[offset+5]);
3603 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3606 btv->c.type = BTTV_BOARD_OSPREY101_848;
3612 btv->c.type = BTTV_BOARD_OSPREY1x0;
3616 btv->c.type = BTTV_BOARD_OSPREY1x1;
3621 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
3627 btv->c.type = BTTV_BOARD_OSPREY2xx;
3631 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
3634 btv->c.type = BTTV_BOARD_OSPREY500;
3638 btv->c.type = BTTV_BOARD_OSPREY540;
3639 /* bttv_osprey_540_init(btv); */
3643 btv->c.type = BTTV_BOARD_OSPREY2x0;
3644 /* enable output on select control lines */
3645 gpio_inout(0xffffff,0x000303);
3648 /* unknown...leave generic, but get serial # */
3651 serial = (ee[offset+6] << 24)
3652 | (ee[offset+7] << 16)
3653 | (ee[offset+8] << 8)
3657 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3658 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3661 /* ----------------------------------------------------------------------- */
3662 /* AVermedia specific stuff, from bktr_card.c */
3664 static int tuner_0_table[] = {
3665 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3666 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3667 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3668 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3669 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3670 TUNER_PHILIPS_FM1216ME_MK3 };
3672 static int tuner_1_table[] = {
3673 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3674 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3675 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3676 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3677 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3679 static void __devinit avermedia_eeprom(struct bttv *btv)
3681 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3683 tuner_make = (eeprom_data[0x41] & 0x7);
3684 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3685 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3686 btv->has_remote = (eeprom_data[0x42] & 0x01);
3688 if (tuner_make == 0 || tuner_make == 2)
3689 if(tuner_format <=0x0a)
3690 tuner = tuner_0_table[tuner_format];
3691 if (tuner_make == 1)
3692 if(tuner_format <=9)
3693 tuner = tuner_1_table[tuner_format];
3695 if (tuner_make == 4)
3696 if(tuner_format == 0x09)
3697 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3699 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3700 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3702 btv->tuner_type=tuner;
3705 printk("Unknown type");
3706 printk(" radio:%s remote control:%s\n",
3707 tuner_tv_fm ? "yes" : "no",
3708 btv->has_remote ? "yes" : "no");
3711 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3712 void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3714 /* fix up our card entry */
3715 if(norm==VIDEO_MODE_NTSC) {
3716 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff;
3717 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff;
3718 dprintk("bttv_tda9880_setnorm to NTSC\n");
3721 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3722 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
3723 dprintk("bttv_tda9880_setnorm to PAL\n");
3725 /* set GPIO according */
3726 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3727 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3732 * reset/enable the MSP on some Hauppauge cards
3733 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3738 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3740 int mask = (1 << pin);
3742 gpio_inout(mask,mask);
3745 gpio_bits(mask,mask);
3748 bttv_gpio_tracking(btv,"msp34xx");
3750 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3751 "init [%d]\n", btv->c.nr, pin);
3754 static void __devinit boot_bt832(struct bttv *btv)
3758 /* ----------------------------------------------------------------------- */
3759 /* Imagenation L-Model PXC200 Framegrabber */
3760 /* This is basically the same procedure as
3761 * used by Alessandro Rubini in his pxc200
3762 * driver, but using BTTV functions */
3764 static void __devinit init_PXC200(struct bttv *btv)
3766 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3767 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3773 /* Initialise GPIO-connevted stuff */
3774 gpio_inout(0xffffff, (1<<13));
3778 /* GPIO inputs are pulled up, so no need to drive
3779 * reset pin any longer */
3780 gpio_bits(0xffffff, 0);
3782 bttv_gpio_tracking(btv,"pxc200");
3784 /* we could/should try and reset/control the AD pots? but
3785 right now we simply turned off the crushing. Without
3786 this the AGC drifts drifts
3787 remember the EN is reverse logic -->
3788 setting BT848_ADC_AGC_EN disable the AGC
3789 tboult@eecs.lehigh.edu
3792 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3794 /* Initialise MAX517 DAC */
3795 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3796 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3798 /* Initialise 12C508 PIC */
3799 /* The I2CWrite and I2CRead commmands are actually to the
3800 * same chips - but the R/W bit is included in the address
3801 * argument so the numbers are different */
3804 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3806 /* First of all, enable the clock line. This is used in the PXC200-F */
3807 val = btread(BT848_GPIO_DMA_CTL);
3808 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3809 btwrite(val, BT848_GPIO_DMA_CTL);
3811 /* Then, push to 0 the reset pin long enough to reset the *
3812 * device same as above for the reset line, but not the same
3813 * value sent to the GPIO-connected stuff
3814 * which one is the good one? */
3815 gpio_inout(0xffffff,(1<<2));
3820 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3821 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3824 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3825 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3829 printk(KERN_INFO "PXC200 Initialised.\n");
3834 /* ----------------------------------------------------------------------- */
3836 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3837 * it. This apparently involves the following procedure for each 878 chip:
3839 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3841 * 2) write to GPIO_DATA
3847 * read from GPIO_DATA into buf (uint_32)
3848 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3849 * error. ERROR_CPLD_Check_Failed stop.
3851 * 3) write to GPIO_DATA
3852 * - write 0x4400 + 0x0E
3854 * - write 0x4410 + 0x0E
3857 * read from GPIO_DATA into buf (uint_32)
3858 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3859 * error. ERROR_CPLD_Check_Failed.
3861 /* ----------------------------------------------------------------------- */
3863 init_RTV24 (struct bttv *btv)
3865 uint32_t dataRead = 0;
3866 long watchdog_value = 0x0E;
3869 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3872 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
3874 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3876 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3878 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3880 dataRead = btread (BT848_GPIO_DATA);
3882 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3884 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3885 btv->c.nr, dataRead);
3888 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3890 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3892 btwrite (watchdog_value, BT848_GPIO_DATA);
3894 dataRead = btread (BT848_GPIO_DATA);
3896 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3898 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3899 btv->c.nr, dataRead);
3905 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
3910 /* ----------------------------------------------------------------------- */
3911 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3913 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3914 * This code is placed under the terms of the GNU General Public License
3916 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3919 static void bus_low(struct bttv *btv, int bit)
3921 if (btv->mbox_ior) {
3922 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3923 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3930 if (btv->mbox_ior) {
3931 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3936 static void bus_high(struct bttv *btv, int bit)
3938 if (btv->mbox_ior) {
3939 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3940 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3947 if (btv->mbox_ior) {
3948 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3953 static int bus_in(struct bttv *btv, int bit)
3955 if (btv->mbox_ior) {
3956 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3957 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3960 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3963 return gpio_read() & (bit);
3966 /* TEA5757 register bits */
3967 #define TEA_FREQ 0:14
3968 #define TEA_BUFFER 15:15
3970 #define TEA_SIGNAL_STRENGTH 16:17
3972 #define TEA_PORT1 18:18
3973 #define TEA_PORT0 19:19
3975 #define TEA_BAND 20:21
3976 #define TEA_BAND_FM 0
3977 #define TEA_BAND_MW 1
3978 #define TEA_BAND_LW 2
3979 #define TEA_BAND_SW 3
3981 #define TEA_MONO 22:22
3982 #define TEA_ALLOW_STEREO 0
3983 #define TEA_FORCE_MONO 1
3985 #define TEA_SEARCH_DIRECTION 23:23
3986 #define TEA_SEARCH_DOWN 0
3987 #define TEA_SEARCH_UP 1
3989 #define TEA_STATUS 24:24
3990 #define TEA_STATUS_TUNED 0
3991 #define TEA_STATUS_SEARCHING 1
3993 /* Low-level stuff */
3994 static int tea5757_read(struct bttv *btv)
3996 unsigned long timeout;
4000 /* better safe than sorry */
4001 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4003 if (btv->mbox_ior) {
4004 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4005 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4010 bttv_gpio_tracking(btv,"tea5757 read");
4012 bus_low(btv,btv->mbox_we);
4013 bus_low(btv,btv->mbox_clk);
4016 timeout= jiffies + HZ;
4018 /* wait for DATA line to go low; error if it doesn't */
4019 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4021 if (bus_in(btv,btv->mbox_data)) {
4022 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4026 dprintk("bttv%d: tea5757:",btv->c.nr);
4027 for(i = 0; i < 24; i++)
4030 bus_high(btv,btv->mbox_clk);
4032 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4033 bus_low(btv,btv->mbox_clk);
4035 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4036 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4038 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4042 static int tea5757_write(struct bttv *btv, int value)
4047 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4049 if (btv->mbox_ior) {
4050 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4051 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4055 bttv_gpio_tracking(btv,"tea5757 write");
4057 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4058 bus_low(btv,btv->mbox_clk);
4059 bus_high(btv,btv->mbox_we);
4060 for(i = 0; i < 25; i++)
4062 if (reg & 0x1000000)
4063 bus_high(btv,btv->mbox_data);
4065 bus_low(btv,btv->mbox_data);
4067 bus_high(btv,btv->mbox_clk);
4069 bus_low(btv,btv->mbox_clk);
4072 bus_low(btv,btv->mbox_we); /* unmute !!! */
4076 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4078 dprintk("tea5757_set_freq %d\n",freq);
4079 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4083 /* ----------------------------------------------------------------------- */
4086 void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4088 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4089 int bits_out, loops, vol, data;
4092 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4093 v->flags |= VIDEO_AUDIO_VOLUME;
4097 /* 32 levels logarithmic */
4098 vol = 32 - ((v->volume>>11));
4100 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4102 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4103 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4105 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4106 WINVIEW_PT2254_STROBE);
4107 for (loops = 17; loops >= 0 ; loops--) {
4108 if (bits_out & (1<<loops))
4109 data |= WINVIEW_PT2254_DATA;
4111 data &= ~WINVIEW_PT2254_DATA;
4114 data |= WINVIEW_PT2254_CLK;
4117 data &= ~WINVIEW_PT2254_CLK;
4120 data |= WINVIEW_PT2254_STROBE;
4121 data &= ~WINVIEW_PT2254_DATA;
4124 data &= ~WINVIEW_PT2254_STROBE;
4128 /* ----------------------------------------------------------------------- */
4129 /* mono/stereo control for various cards (which don't use i2c chips but */
4130 /* connect something to the GPIO pins */
4133 gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4135 unsigned int con = 0;
4138 gpio_inout(0x300, 0x300);
4139 if (v->mode & VIDEO_SOUND_LANG1)
4141 if (v->mode & VIDEO_SOUND_LANG2)
4143 if (v->mode & VIDEO_SOUND_STEREO)
4145 /* if (v->mode & VIDEO_SOUND_MONO)
4147 gpio_bits(0x300, con);
4149 v->mode = VIDEO_SOUND_STEREO |
4150 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4155 gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4157 unsigned int val, con;
4159 if (btv->radio_user)
4165 if (v->mode & VIDEO_SOUND_LANG2) {
4166 if (v->mode & VIDEO_SOUND_LANG1) {
4175 if (con != (val & 0x300)) {
4176 gpio_bits(0x300, con);
4178 bttv_gpio_tracking(btv,"gvbctv5pci");
4181 switch (val & 0x70) {
4183 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4186 v->mode = VIDEO_SOUND_LANG2;
4189 v->mode = VIDEO_SOUND_LANG1;
4192 v->mode = VIDEO_SOUND_STEREO;
4195 v->mode = VIDEO_SOUND_MONO;
4198 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4199 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4205 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4206 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4207 * 0xdde enables mono and 0xccd enables sap
4209 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4210 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4211 * input/output sound connection, so both must be set for output mode.
4213 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4214 * handles this with a tda9840
4218 avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4223 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4225 if (v->mode & VIDEO_SOUND_STEREO)
4228 gpio_bits(0x03,val);
4230 bttv_gpio_tracking(btv,"avermedia");
4233 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4240 avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4245 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4247 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4249 btaor(val, ~0x03, BT848_GPIO_DATA);
4251 bttv_gpio_tracking(btv,"avermedia");
4253 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4254 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4259 /* Lifetec 9415 handling */
4261 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4265 if (gpio_read() & 0x4000) {
4266 v->mode = VIDEO_SOUND_MONO;
4271 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4273 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4275 if ((v->mode & VIDEO_SOUND_LANG1) ||
4276 (v->mode & VIDEO_SOUND_MONO))
4278 gpio_bits(0x0880, val);
4280 bttv_gpio_tracking(btv,"lt9415");
4282 /* autodetect doesn't work with this card :-( */
4283 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4284 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4289 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4291 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4293 unsigned int con = 0;
4296 gpio_inout(0x180000,0x180000);
4297 if (v->mode & VIDEO_SOUND_LANG2)
4299 if (v->mode & VIDEO_SOUND_STEREO)
4301 gpio_bits(0x180000, con);
4303 bttv_gpio_tracking(btv,"terratv");
4305 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4306 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4311 winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4313 unsigned long val = 0;
4316 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4317 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4319 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4321 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4323 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4326 gpio_bits(0x430000, val);
4328 bttv_gpio_tracking(btv,"winfast2000");
4331 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4332 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4337 * Dariusz Kowalewski <darekk@automex.pl>
4338 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4339 * revision 9B has on-board TDA9874A sound decoder).
4341 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4342 * will mute this cards.
4345 pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4347 unsigned int val = 0;
4349 if (btv->radio_user)
4353 if (v->mode & VIDEO_SOUND_MONO) {
4356 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4357 || (v->mode & VIDEO_SOUND_STEREO)) {
4361 gpio_bits(0x03,val);
4363 bttv_gpio_tracking(btv,"pvbt878p9b");
4366 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4367 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4372 * Dariusz Kowalewski <darekk@automex.pl>
4373 * sound control for FlyVideo 2000S (with tda9874 decoder)
4374 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4377 fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4379 unsigned int val = 0xffff;
4381 if (btv->radio_user)
4384 if (v->mode & VIDEO_SOUND_MONO) {
4387 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4388 || (v->mode & VIDEO_SOUND_STEREO)) {
4389 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4391 if (val != 0xffff) {
4392 gpio_bits(0x1800, val);
4394 bttv_gpio_tracking(btv,"fv2000s");
4397 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4398 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4403 * sound control for Canopus WinDVR PCI
4404 * Masaki Suzuki <masaki@btree.org>
4407 windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4409 unsigned long val = 0;
4412 if (v->mode & VIDEO_SOUND_MONO)
4414 if (v->mode & VIDEO_SOUND_LANG1)
4416 if (v->mode & VIDEO_SOUND_LANG2)
4418 if (v->mode & VIDEO_SOUND_STEREO)
4421 gpio_bits(0x140000, val);
4423 bttv_gpio_tracking(btv,"windvr");
4426 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4427 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4432 * sound control for AD-TVK503
4433 * Hiroshi Takekawa <sian@big.or.jp>
4436 adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4438 unsigned int con = 0xffffff;
4440 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4443 /* btor(***, BT848_GPIO_OUT_EN); */
4444 if (v->mode & VIDEO_SOUND_LANG1)
4446 if (v->mode & VIDEO_SOUND_LANG2)
4448 if (v->mode & VIDEO_SOUND_STEREO)
4450 if (v->mode & VIDEO_SOUND_MONO)
4452 if (con != 0xffffff) {
4453 gpio_bits(0x1e0000,con);
4455 bttv_gpio_tracking(btv, "adtvk503");
4458 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4459 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4463 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4465 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4466 * switch instead (CD22M3494E). This IC can have multiple active connections
4467 * between Xn (input) and Yn (output) pins. We need to clear any existing
4468 * connection prior to establish a new one, pulsing the STROBE pin.
4470 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4471 * GPIO pins are wired as:
4472 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4473 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4474 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4475 * GPIO[8] - - P3[5] (microcontroler)
4476 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4477 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4478 * GPINTR - - P3[4] (microcontroler)
4480 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4481 * configuration either directly (as we are doing) or using the microcontroler
4482 * which is also wired to I2C interface. I have no further info on the
4483 * microcontroler features, one would need to disassembly the firmware.
4484 * note: the vendor refused to give any information on this product, all
4485 * that stuff was found using a multimeter! :)
4487 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4489 /* reset all conections */
4490 gpio_bits(0x200,0x200);
4492 gpio_bits(0x200,0x000);
4495 /* create a new conection */
4496 gpio_bits(0x480,0x080);
4497 gpio_bits(0x480,0x480);
4499 gpio_bits(0x480,0x080);
4503 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4505 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4506 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4507 * chips, ten eight input analog multiplexors, a not chip and a few
4510 * 16 inputs on a secondary bracket are provided and can be selected
4511 * from each of the four capture chips. Two of the eight input
4512 * multiplexors are used to select from any of the 16 input signals.
4514 * Unsupported hardware capabilities:
4515 * . A video output monitor on the secondary bracket can be selected from
4516 * one of the 878A chips.
4517 * . Another passthrough but I haven't spent any time investigating it.
4518 * . Digital I/O (logic level connected to GPIO) is available from an
4521 * The on chip input mux should always be set to 2.
4522 * GPIO[16:19] - Video input selection
4523 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4524 * GPIO[?:?] - Digital I/O.
4526 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4527 * determined what function (if any) it provides. With the microcontroller
4528 * and sync seperator chips a guess is that it might have to do with video
4529 * switching and maybe some digital I/O.
4531 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4534 gpio_bits(0x0f0000, input << 16);
4537 static void tibetCS16_init(struct bttv *btv)
4539 /* enable gpio bits, mask obtained via btSpy */
4540 gpio_inout(0xffffff, 0x0f7fff);
4541 gpio_write(0x0f7fff);
4545 * The following routines for the Kodicom-4400r get a little mind-twisting.
4546 * There is a "master" controller and three "slave" controllers, together
4547 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4548 * The analog switch is controlled by the "master", but the detection order
4549 * of the four BT878A chips is in an order which I just don't understand.
4550 * The "master" is actually the second controller to be detected. The
4551 * logic on the board uses logical numbers for the 4 controlers, but
4552 * those numbers are different from the detection sequence. When working
4553 * with the analog switch, we need to "map" from the detection sequence
4554 * over to the board's logical controller number. This mapping sequence
4555 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4556 * unit 3, the second (which is the master) is logical unit 0, etc.
4557 * We need to maintain the status of the analog switch (which of the 16
4558 * cameras is connected to which of the 4 controllers). Rather than
4559 * add to the bttv structure for this, we use the data reserved for
4560 * the mbox (unused for this card type).
4564 * First a routine to set the analog switch, which controls which camera
4565 * is routed to which controller. The switch comprises an X-address
4566 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4567 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4568 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4569 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4570 * specified address. The idea is to set the address and data, then bring
4571 * STROBE high, and finally bring STROBE back to low.
4573 static void kodicom4400r_write(struct bttv *btv,
4574 unsigned char xaddr,
4575 unsigned char yaddr,
4576 unsigned char data) {
4579 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4580 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4581 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4582 gpio_bits(0x1ff, udata); /* strobe low */
4586 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4587 * use this routine. The routine finds the "master" for the card, maps
4588 * the controller number from the detected position over to the logical
4589 * number, writes the appropriate data to the analog switch, and housekeeps
4590 * the local copy of the switch information. The parameter 'input' is the
4591 * requested camera number (0 - 15).
4593 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4598 static unsigned char map[4] = {3, 0, 2, 1};
4600 mctlr = master[btv->c.nr];
4601 if (mctlr == NULL) { /* ignore if master not yet detected */
4604 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4606 sw_status = (char *)(&mctlr->mbox_we);
4607 xaddr = input & 0xf;
4608 /* Check if the controller/camera pair has changed, else ignore */
4609 if (sw_status[yaddr] != xaddr)
4611 /* "open" the old switch, "close" the new one, save the new */
4612 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4613 sw_status[yaddr] = xaddr;
4614 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4619 * During initialisation, we need to reset the analog switch. We
4620 * also preset the switch to map the 4 connectors on the card to the
4621 * *user's* (see above description of kodicom4400r_muxsel) channels
4624 static void kodicom4400r_init(struct bttv *btv)
4626 char *sw_status = (char *)(&btv->mbox_we);
4629 gpio_inout(0x0003ff, 0x0003ff);
4630 gpio_write(1 << 9); /* reset MUX */
4632 /* Preset camera 0 to the 4 controllers */
4633 for (ix=0; ix<4; ix++) {
4635 kodicom4400r_write(btv, ix, ix, 1);
4638 * Since this is the "master", we need to set up the
4639 * other three controller chips' pointers to this structure
4640 * for later use in the muxsel routine.
4642 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4644 master[btv->c.nr-1] = btv;
4645 master[btv->c.nr] = btv;
4646 master[btv->c.nr+1] = btv;
4647 master[btv->c.nr+2] = btv;
4650 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4651 * video multiplexers to provide up to 16 video inputs. These
4652 * multiplexers are controlled by the lower 8 GPIO pins of the
4653 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4655 * xxx0 is pin xxx of multiplexer U5,
4656 * yyy1 is pin yyy of multiplexer U2
4668 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4670 static const int masks[] = {
4671 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4672 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4673 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4674 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4676 gpio_write(masks[input%16]);
4678 static void picolo_tetra_init(struct bttv *btv)
4680 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4681 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4682 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4684 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4687 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4688 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4689 /*GPIO[20]&GPIO[21] used to choose the right input*/
4690 btwrite (input<<20,BT848_GPIO_DATA);
4695 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4697 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4698 * swichers to provide 16 channels to MUX0. The TDA8540's have
4699 * 4 indepedant outputs and as such the IVC120G also has the
4700 * optional "Monitor Out" bus. This allows the card to be looking
4701 * at one input while the monitor is looking at another.
4703 * Since I've couldn't be bothered figuring out how to add an
4704 * independant muxsel for the monitor bus, I've just set it to
4705 * whatever the card is looking at.
4707 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4708 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4710 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4711 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4712 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4713 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4717 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4718 #define I2C_TDA8540 0x90
4719 #define I2C_TDA8540_ALT1 0x92
4720 #define I2C_TDA8540_ALT2 0x94
4721 #define I2C_TDA8540_ALT3 0x96
4722 #define I2C_TDA8540_ALT4 0x98
4723 #define I2C_TDA8540_ALT5 0x9a
4724 #define I2C_TDA8540_ALT6 0x9c
4726 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4729 int key = input % 4;
4730 int matrix = input / 4;
4732 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4733 btv->c.nr, input, matrix, key);
4735 /* Handles the input selection on the TDA8540's */
4736 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4737 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4738 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4739 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4740 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4741 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4742 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4743 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4745 /* Handles the output enables on the TDA8540's */
4746 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4747 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4748 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4749 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4750 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4751 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4752 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4753 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4755 /* Selects MUX0 for input on the 878 */
4756 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4760 /* PXC200 muxsel helper
4761 * luke@syseng.anu.edu.au
4762 * another transplant
4763 * from Alessandro Rubini (rubini@linux.it)
4765 * There are 4 kinds of cards:
4766 * PXC200L which is bt848
4767 * PXC200F which is bt848 with PIC controlling mux
4768 * PXC200AL which is bt878
4769 * PXC200AF which is bt878 with PIC controlling mux
4771 #define PX_CFG_PXC200F 0x01
4772 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4773 #define PX_I2C_PIC 0x0f
4774 #define PX_PXC200A_CARDID 0x200a1295
4775 #define PX_I2C_CMD_CFG 0x00
4777 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4782 unsigned char buf[2];
4784 /* Read PIC config to determine if this is a PXC200F */
4788 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4790 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4791 /* not PXC ? do nothing */
4795 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4796 if (!(rc & PX_CFG_PXC200F)) {
4797 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4802 /* The multiplexer in the 200F is handled by the GPIO port */
4803 /* get correct mapping between inputs */
4804 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4805 /* ** not needed!? */
4808 /* make sure output pins are enabled */
4809 /* bitmask=0x30f; */
4811 /* check whether we have a PXC200A */
4812 if (btv->cardid == PX_PXC200A_CARDID) {
4813 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4814 bitmask |= 7<<4; /* the DAC */
4816 btwrite(bitmask, BT848_GPIO_OUT_EN);
4818 bitmask = btread(BT848_GPIO_DATA);
4819 if (btv->cardid == PX_PXC200A_CARDID)
4820 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4821 else /* older device */
4822 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4823 btwrite(bitmask,BT848_GPIO_DATA);
4826 * Was "to be safe, set the bt848 to input 0"
4827 * Actually, since it's ok at load time, better not messing
4828 * with these bits (on PXC200AF you need to set mux 2 here)
4830 * needed because bttv-driver sets mux before calling this function
4832 if (btv->cardid == PX_PXC200A_CARDID)
4833 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4834 else /* older device */
4835 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4837 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4840 /* ----------------------------------------------------------------------- */
4841 /* motherboard chipset specific stuff */
4843 void __devinit bttv_check_chipset(void)
4845 int pcipci_fail = 0;
4846 struct pci_dev *dev = NULL;
4848 if (pci_pci_problems & PCIPCI_FAIL)
4850 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4852 if (pci_pci_problems & PCIPCI_VSFX)
4854 #ifdef PCIPCI_ALIMAGIK
4855 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4860 /* print warnings about any quirks found */
4862 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4864 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4866 printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
4868 printk(KERN_WARNING "bttv: overlay will be disabled.\n");
4871 printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n");
4874 if (UNSET != latency)
4875 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
4876 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4877 PCI_DEVICE_ID_INTEL_82441, dev))) {
4879 pci_read_config_byte(dev, 0x53, &b);
4881 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4882 "bufcon=0x%02x\n",b);
4886 int __devinit bttv_handle_chipset(struct bttv *btv)
4888 unsigned char command;
4890 if (!triton1 && !vsfx && UNSET == latency)
4895 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4896 if (vsfx && btv->id >= 878)
4897 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4898 if (UNSET != latency)
4899 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4903 if (btv->id < 878) {
4904 /* bt848 (mis)uses a bit in the irq mask for etbf */
4906 btv->triton1 = BT848_INT_ETBF;
4908 /* bt878 has a bit in the pci config space for it */
4909 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4911 command |= BT878_EN_TBFX;
4913 command |= BT878_EN_VSFX;
4914 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4916 if (UNSET != latency)
4917 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);