5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/delay.h>
29 #include <linux/module.h>
30 #include <linux/moduleparam.h>
31 #include <linux/kmod.h>
32 #include <linux/init.h>
33 #include <linux/pci.h>
34 #include <linux/vmalloc.h>
35 #include <linux/firmware.h>
40 #include <media/v4l2-common.h>
41 #include <media/tvaudio.h>
44 static void boot_msp34xx(struct bttv *btv, int pin);
45 static void boot_bt832(struct bttv *btv);
46 static void hauppauge_eeprom(struct bttv *btv);
47 static void avermedia_eeprom(struct bttv *btv);
48 static void osprey_eeprom(struct bttv *btv);
49 static void modtec_eeprom(struct bttv *btv);
50 static void init_PXC200(struct bttv *btv);
51 static void init_RTV24(struct bttv *btv);
53 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
54 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
55 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
57 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
59 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
60 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
67 static void rv605_muxsel(struct bttv *btv, unsigned int input);
68 static void eagle_muxsel(struct bttv *btv, unsigned int input);
69 static void xguard_muxsel(struct bttv *btv, unsigned int input);
70 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
71 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
73 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
75 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
76 static void picolo_tetra_init(struct bttv *btv);
78 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
79 static void tibetCS16_init(struct bttv *btv);
81 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
82 static void kodicom4400r_init(struct bttv *btv);
84 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
85 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
87 static int terratec_active_radio_upgrade(struct bttv *btv);
88 static int tea5757_read(struct bttv *btv);
89 static int tea5757_write(struct bttv *btv, int value);
90 static void identify_by_eeprom(struct bttv *btv,
91 unsigned char eeprom_data[256]);
92 static int __devinit pvr_boot(struct bttv *btv);
94 /* config variables */
95 static unsigned int triton1;
96 static unsigned int vsfx;
97 static unsigned int latency = UNSET;
100 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
107 static unsigned int autoload = 1;
109 static unsigned int autoload;
111 static unsigned int gpiomask = UNSET;
112 static unsigned int audioall = UNSET;
113 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
116 module_param(triton1, int, 0444);
117 module_param(vsfx, int, 0444);
118 module_param(no_overlay, int, 0444);
119 module_param(latency, int, 0444);
120 module_param(gpiomask, int, 0444);
121 module_param(audioall, int, 0444);
122 module_param(autoload, int, 0444);
124 module_param_array(card, int, NULL, 0444);
125 module_param_array(pll, int, NULL, 0444);
126 module_param_array(tuner, int, NULL, 0444);
127 module_param_array(svhs, int, NULL, 0444);
128 module_param_array(remote, int, NULL, 0444);
129 module_param_array(audiomux, int, NULL, 0444);
131 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
132 "[enable bug compatibility for triton1 + others]");
133 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
134 "[yet another chipset flaw workaround]");
135 MODULE_PARM_DESC(latency,"pci latency timer");
136 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
137 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138 MODULE_PARM_DESC(tuner,"specify installed tuner type");
139 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
140 MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
141 " [some VIA/SIS chipsets are known to have problem with overlay]");
143 /* ----------------------------------------------------------------------- */
144 /* list of card IDs for bt878+ cards */
150 } cards[] __devinitdata = {
151 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
155 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
156 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
157 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
158 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
159 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
161 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
162 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
164 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
165 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
166 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
167 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
170 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
171 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
172 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
174 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
175 /* some cards ship with byteswapped IDs ... */
176 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
177 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 /* this seems to happen as well ... */
179 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
181 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
185 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
186 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
187 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
188 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
189 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
190 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
191 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
193 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
194 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
195 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
196 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
197 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
199 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
200 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
201 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
202 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
204 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
205 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
206 /* clashes with FlyVideo
207 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
208 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
209 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
210 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
211 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
213 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
214 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
219 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
220 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
221 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
222 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
223 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
225 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
226 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
227 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
228 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
230 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
231 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
232 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
233 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
235 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
236 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
261 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
262 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
264 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
265 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
267 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
268 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
269 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
271 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
272 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
274 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
275 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
276 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
278 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
279 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
280 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
281 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
282 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
284 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
285 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
287 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
288 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
289 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
290 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
292 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
294 /* likely broken, vendor id doesn't match the other magic views ...
295 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
297 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
298 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
300 /* DVB cards (using pci function .1 for mpeg data xfer) */
301 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
302 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
303 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
304 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
305 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
306 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
307 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
308 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
309 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
310 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
311 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
316 /* ----------------------------------------------------------------------- */
317 /* array with description for bt848 / bt878 tv/grabber cards */
319 struct tvcard bttv_tvcards[] = {
320 /* ---- card 0x00 ---------------------------------- */
321 [BTTV_BOARD_UNKNOWN] = {
322 .name = " *** UNKNOWN/GENERIC *** ",
327 .muxsel = { 2, 3, 1, 0 },
329 .tuner_addr = ADDR_UNSET,
330 .radio_addr = ADDR_UNSET,
332 [BTTV_BOARD_MIRO] = {
339 .muxsel = { 2, 3, 1, 1 },
340 .gpiomux = { 2, 0, 0, 0 },
344 .tuner_addr = ADDR_UNSET,
345 .radio_addr = ADDR_UNSET,
347 [BTTV_BOARD_HAUPPAUGE] = {
348 .name = "Hauppauge (bt848)",
354 .muxsel = { 2, 3, 1, 1 },
355 .gpiomux = { 0, 1, 2, 3 },
359 .tuner_addr = ADDR_UNSET,
360 .radio_addr = ADDR_UNSET,
363 .name = "STB, Gateway P/N 6000699 (bt848)",
369 .muxsel = { 2, 3, 1, 1 },
370 .gpiomux = { 4, 0, 2, 3 },
374 .tuner_type = TUNER_PHILIPS_NTSC,
375 .tuner_addr = ADDR_UNSET,
376 .radio_addr = ADDR_UNSET,
381 /* ---- card 0x04 ---------------------------------- */
382 [BTTV_BOARD_INTEL] = {
383 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
389 .muxsel = { 2, 3, 1, 1 },
393 .tuner_addr = ADDR_UNSET,
394 .radio_addr = ADDR_UNSET,
396 [BTTV_BOARD_DIAMOND] = {
397 .name = "Diamond DTV2000",
403 .muxsel = { 2, 3, 1, 0 },
404 .gpiomux = { 0, 1, 0, 1 },
408 .tuner_addr = ADDR_UNSET,
409 .radio_addr = ADDR_UNSET,
411 [BTTV_BOARD_AVERMEDIA] = {
412 .name = "AVerMedia TVPhone",
417 .muxsel = { 2, 3, 1, 1 },
419 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
420 /* 0x04 for some cards ?? */
423 .tuner_addr = ADDR_UNSET,
424 .radio_addr = ADDR_UNSET,
425 .audio_hook = avermedia_tvphone_audio,
428 [BTTV_BOARD_MATRIX_VISION] = {
429 .name = "MATRIX-Vision MV-Delta",
435 .muxsel = { 2, 3, 1, 0, 0 },
439 .tuner_addr = ADDR_UNSET,
440 .radio_addr = ADDR_UNSET,
443 /* ---- card 0x08 ---------------------------------- */
444 [BTTV_BOARD_FLYVIDEO] = {
445 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
451 .muxsel = { 2, 3, 1, 1 },
452 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
457 .tuner_addr = ADDR_UNSET,
458 .radio_addr = ADDR_UNSET,
460 [BTTV_BOARD_TURBOTV] = {
461 .name = "IMS/IXmicro TurboTV",
467 .muxsel = { 2, 3, 1, 1 },
468 .gpiomux = { 1, 1, 2, 3 },
471 .tuner_type = TUNER_TEMIC_PAL,
472 .tuner_addr = ADDR_UNSET,
473 .radio_addr = ADDR_UNSET,
475 [BTTV_BOARD_HAUPPAUGE878] = {
476 .name = "Hauppauge (bt878)",
481 .gpiomask = 0x0f, /* old: 7 */
482 .muxsel = { 2, 0, 1, 1 },
483 .gpiomux = { 0, 1, 2, 3 },
488 .tuner_addr = ADDR_UNSET,
489 .radio_addr = ADDR_UNSET,
491 [BTTV_BOARD_MIROPRO] = {
492 .name = "MIRO PCTV pro",
498 .muxsel = { 2, 3, 1, 1 },
499 .gpiomux = { 0x20001,0x10001, 0, 0 },
503 .tuner_addr = ADDR_UNSET,
504 .radio_addr = ADDR_UNSET,
507 /* ---- card 0x0c ---------------------------------- */
508 [BTTV_BOARD_ADSTECH_TV] = {
509 .name = "ADS Technologies Channel Surfer TV (bt848)",
515 .muxsel = { 2, 3, 1, 1 },
516 .gpiomux = { 13, 14, 11, 7 },
519 .tuner_addr = ADDR_UNSET,
520 .radio_addr = ADDR_UNSET,
522 [BTTV_BOARD_AVERMEDIA98] = {
523 .name = "AVerMedia TVCapture 98",
529 .muxsel = { 2, 3, 1, 1 },
530 .gpiomux = { 13, 14, 11, 7 },
534 .tuner_type = TUNER_PHILIPS_PAL,
535 .tuner_addr = ADDR_UNSET,
536 .radio_addr = ADDR_UNSET,
537 .audio_hook = avermedia_tv_stereo_audio,
541 .name = "Aimslab Video Highway Xtreme (VHX)",
547 .muxsel = { 2, 3, 1, 1 },
548 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
553 .tuner_addr = ADDR_UNSET,
554 .radio_addr = ADDR_UNSET,
556 [BTTV_BOARD_ZOLTRIX] = {
557 .name = "Zoltrix TV-Max",
563 .muxsel = { 2, 3, 1, 1 },
564 .gpiomux = { 0, 0, 1, 0 },
568 .tuner_addr = ADDR_UNSET,
569 .radio_addr = ADDR_UNSET,
572 /* ---- card 0x10 ---------------------------------- */
573 [BTTV_BOARD_PIXVIEWPLAYTV] = {
574 .name = "Prolink Pixelview PlayTV (bt878)",
579 .gpiomask = 0x01fe00,
580 .muxsel = { 2, 3, 1, 1 },
581 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
582 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
583 .gpiomute = 0x002000,
588 [BTTV_BOARD_WINVIEW_601] = {
589 .name = "Leadtek WinView 601",
594 .gpiomask = 0x8300f8,
595 .muxsel = { 2, 3, 1, 1,0 },
596 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
597 .gpiomute = 0xcfa007,
600 .tuner_addr = ADDR_UNSET,
601 .radio_addr = ADDR_UNSET,
602 .audio_hook = winview_audio,
605 [BTTV_BOARD_AVEC_INTERCAP] = {
606 .name = "AVEC Intercapture",
612 .muxsel = { 2, 3, 1, 1 },
613 .gpiomux = { 1, 0, 0, 0 },
616 .tuner_addr = ADDR_UNSET,
617 .radio_addr = ADDR_UNSET,
619 [BTTV_BOARD_LIFE_FLYKIT] = {
620 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
625 .gpiomask = 0x8dff00,
626 .muxsel = { 2, 3, 1, 1 },
630 .tuner_addr = ADDR_UNSET,
631 .radio_addr = ADDR_UNSET,
634 /* ---- card 0x14 ---------------------------------- */
635 [BTTV_BOARD_CEI_RAFFLES] = {
636 .name = "CEI Raffles Card",
641 .muxsel = { 2, 3, 1, 1 },
643 .tuner_addr = ADDR_UNSET,
644 .radio_addr = ADDR_UNSET,
646 [BTTV_BOARD_CONFERENCETV] = {
647 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
649 .audio_inputs = 2, /* tuner, line in */
653 .muxsel = { 2, 3, 1, 1 },
654 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
657 .tuner_type = TUNER_PHILIPS_PAL_I,
658 .tuner_addr = ADDR_UNSET,
659 .radio_addr = ADDR_UNSET,
661 [BTTV_BOARD_PHOEBE_TVMAS] = {
662 .name = "Askey CPH050/ Phoebe Tv Master + FM",
668 .muxsel = { 2, 3, 1, 1 },
669 .gpiomux = { 0, 1, 0x800, 0x400 },
674 .tuner_addr = ADDR_UNSET,
675 .radio_addr = ADDR_UNSET,
677 [BTTV_BOARD_MODTEC_205] = {
678 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
684 .muxsel = { 2, 3, -1 },
685 .digital_mode = DIGITAL_MODE_CAMERA,
686 .gpiomux = { 0, 0, 0, 0 },
689 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
690 .tuner_addr = ADDR_UNSET,
691 .radio_addr = ADDR_UNSET,
694 /* ---- card 0x18 ---------------------------------- */
695 [BTTV_BOARD_MAGICTVIEW061] = {
696 .name = "Askey CPH05X/06X (bt878) [many vendors]",
702 .muxsel = { 2, 3, 1, 1 },
703 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
708 .tuner_addr = ADDR_UNSET,
709 .radio_addr = ADDR_UNSET,
712 [BTTV_BOARD_VOBIS_BOOSTAR] = {
713 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
718 .gpiomask = 0x1f0fff,
719 .muxsel = { 2, 3, 1, 1 },
720 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
723 .tuner_type = TUNER_PHILIPS_PAL,
724 .tuner_addr = ADDR_UNSET,
725 .radio_addr = ADDR_UNSET,
726 .audio_hook = terratv_audio,
728 [BTTV_BOARD_HAUPPAUG_WCAM] = {
729 .name = "Hauppauge WinCam newer (bt878)",
735 .muxsel = { 2, 0, 1, 1 },
736 .gpiomux = { 0, 1, 2, 3 },
740 .tuner_addr = ADDR_UNSET,
741 .radio_addr = ADDR_UNSET,
743 [BTTV_BOARD_MAXI] = {
744 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
750 .muxsel = { 2, 3, 1, 1 },
751 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
754 .tuner_type = TUNER_PHILIPS_SECAM,
755 .tuner_addr = ADDR_UNSET,
756 .radio_addr = ADDR_UNSET,
759 /* ---- card 0x1c ---------------------------------- */
760 [BTTV_BOARD_TERRATV] = {
761 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
766 .gpiomask = 0x1f0fff,
767 .muxsel = { 2, 3, 1, 1 },
768 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
771 .tuner_type = TUNER_PHILIPS_PAL,
772 .tuner_addr = ADDR_UNSET,
773 .radio_addr = ADDR_UNSET,
774 .audio_hook = terratv_audio,
776 External 20 pin connector (for Active Radio Upgrade board)
782 gpio05: om5610-stereo
786 gpio09+10: nIOR, nSEL ?? (bt878)
790 gpio16: u2-A0 (1st 4052bt)
793 gpio19: u4-A0 (2nd 4052)
797 00000 : Cdrom (internal audio input)
798 10000 : ext. Video audio input
807 [BTTV_BOARD_PXC200] = {
808 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
809 .name = "Imagenation PXC200",
813 .svhs = 1, /* was: 4 */
815 .muxsel = { 2, 3, 1, 0, 0},
819 .tuner_addr = ADDR_UNSET,
820 .radio_addr = ADDR_UNSET,
821 .muxsel_hook = PXC200_muxsel,
824 [BTTV_BOARD_FLYVIDEO_98] = {
825 .name = "Lifeview FlyVideo 98 LR50",
830 .gpiomask = 0x1800, /* 0x8dfe00 */
831 .muxsel = { 2, 3, 1, 1 },
832 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
836 .tuner_addr = ADDR_UNSET,
837 .radio_addr = ADDR_UNSET,
839 [BTTV_BOARD_IPROTV] = {
840 .name = "Formac iProTV, Formac ProTV I (bt848)",
846 .muxsel = { 2, 3, 1, 1 },
847 .gpiomux = { 1, 0, 0, 0 },
849 .tuner_type = TUNER_PHILIPS_PAL,
850 .tuner_addr = ADDR_UNSET,
851 .radio_addr = ADDR_UNSET,
854 /* ---- card 0x20 ---------------------------------- */
855 [BTTV_BOARD_INTEL_C_S_PCI] = {
856 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
862 .muxsel = { 2, 3, 1, 1 },
866 .tuner_addr = ADDR_UNSET,
867 .radio_addr = ADDR_UNSET,
869 [BTTV_BOARD_TERRATVALUE] = {
870 .name = "Terratec TerraTValue Version Bt878",
875 .gpiomask = 0xffff00,
876 .muxsel = { 2, 3, 1, 1 },
877 .gpiomux = { 0x500, 0, 0x300, 0x900 },
881 .tuner_type = TUNER_PHILIPS_PAL,
882 .tuner_addr = ADDR_UNSET,
883 .radio_addr = ADDR_UNSET,
885 [BTTV_BOARD_WINFAST2000] = {
886 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
891 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
892 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
893 .gpiomask = 0xb33000,
894 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
895 .gpiomute = 0x800000,
896 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
897 gpio23 -- hef4052:nEnable (0x800000)
900 0x0000: external audio
904 Note: There exists another variant "Winfast 2000" with tv stereo !?
905 Note: eeprom only contains FF and pci subsystem id 107d:6606
910 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
911 .tuner_addr = ADDR_UNSET,
912 .radio_addr = ADDR_UNSET,
913 .audio_hook = winfast2000_audio,
916 [BTTV_BOARD_CHRONOS_VS2] = {
917 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
923 .muxsel = { 2, 3, 1, 1 },
924 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
928 .tuner_addr = ADDR_UNSET,
929 .radio_addr = ADDR_UNSET,
932 /* ---- card 0x24 ---------------------------------- */
933 [BTTV_BOARD_TYPHOON_TVIEW] = {
934 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
940 .muxsel = { 2, 3, 1, 1 },
941 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
945 .tuner_addr = ADDR_UNSET,
946 .radio_addr = ADDR_UNSET,
949 [BTTV_BOARD_PXELVWPLTVPRO] = {
950 .name = "Prolink PixelView PlayTV pro",
956 .muxsel = { 2, 3, 1, 1 },
957 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
962 .tuner_addr = ADDR_UNSET,
963 .radio_addr = ADDR_UNSET,
965 [BTTV_BOARD_MAGICTVIEW063] = {
966 .name = "Askey CPH06X TView99",
971 .gpiomask = 0x551e00,
972 .muxsel = { 2, 3, 1, 0 },
973 .gpiomux = { 0x551400, 0x551200, 0, 0 },
974 .gpiomute = 0x551c00,
978 .tuner_addr = ADDR_UNSET,
979 .radio_addr = ADDR_UNSET,
982 [BTTV_BOARD_PINNACLE] = {
983 .name = "Pinnacle PCTV Studio/Rave",
988 .gpiomask = 0x03000F,
989 .muxsel = { 2, 3, 1, 1 },
990 .gpiomux = { 2, 0xd0001, 0, 0 },
995 .tuner_addr = ADDR_UNSET,
996 .radio_addr = ADDR_UNSET,
999 /* ---- card 0x28 ---------------------------------- */
1000 [BTTV_BOARD_STB2] = {
1001 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1007 .muxsel = { 2, 3, 1, 1 },
1008 .gpiomux = { 4, 0, 2, 3 },
1012 .tuner_type = TUNER_PHILIPS_NTSC,
1013 .tuner_addr = ADDR_UNSET,
1014 .radio_addr = ADDR_UNSET,
1018 [BTTV_BOARD_AVPHONE98] = {
1019 .name = "AVerMedia TVPhone 98",
1025 .muxsel = { 2, 3, 1, 1 },
1026 .gpiomux = { 13, 4, 11, 7 },
1030 .tuner_addr = ADDR_UNSET,
1031 .radio_addr = ADDR_UNSET,
1033 .audio_hook = avermedia_tvphone_audio,
1035 [BTTV_BOARD_PV951] = {
1036 .name = "ProVideo PV951", /* pic16c54 */
1042 .muxsel = { 2, 3, 1, 1},
1043 .gpiomux = { 0, 0, 0, 0},
1048 .tuner_addr = ADDR_UNSET,
1049 .radio_addr = ADDR_UNSET,
1051 [BTTV_BOARD_ONAIR_TV] = {
1052 .name = "Little OnAir TV",
1058 .muxsel = { 2, 3, 1, 1 },
1059 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1060 .gpiomute = 0xff3ffc,
1063 .tuner_addr = ADDR_UNSET,
1064 .radio_addr = ADDR_UNSET,
1067 /* ---- card 0x2c ---------------------------------- */
1068 [BTTV_BOARD_SIGMA_TVII_FM] = {
1069 .name = "Sigma TVII-FM",
1075 .muxsel = { 2, 3, 1, 1 },
1076 .gpiomux = { 1, 1, 0, 2 },
1081 .tuner_addr = ADDR_UNSET,
1082 .radio_addr = ADDR_UNSET,
1084 [BTTV_BOARD_MATRIX_VISION2] = {
1085 .name = "MATRIX-Vision MV-Delta 2",
1091 .muxsel = { 2, 3, 1, 0, 0 },
1096 .tuner_addr = ADDR_UNSET,
1097 .radio_addr = ADDR_UNSET,
1099 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1100 .name = "Zoltrix Genie TV/FM",
1105 .gpiomask = 0xbcf03f,
1106 .muxsel = { 2, 3, 1, 1 },
1107 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1108 .gpiomute = 0xbcb03f,
1112 .tuner_addr = ADDR_UNSET,
1113 .radio_addr = ADDR_UNSET,
1115 [BTTV_BOARD_TERRATVRADIO] = {
1116 .name = "Terratec TV/Radio+",
1121 .gpiomask = 0x70000,
1122 .muxsel = { 2, 3, 1, 1 },
1123 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1124 .gpiomute = 0x40000,
1129 .tuner_addr = ADDR_UNSET,
1130 .radio_addr = ADDR_UNSET,
1134 /* ---- card 0x30 ---------------------------------- */
1135 [BTTV_BOARD_DYNALINK] = {
1136 .name = "Askey CPH03x/ Dynalink Magic TView",
1142 .muxsel = { 2, 3, 1, 1 },
1143 .gpiomux = {2,0,0,0 },
1148 .tuner_addr = ADDR_UNSET,
1149 .radio_addr = ADDR_UNSET,
1151 [BTTV_BOARD_GVBCTV3PCI] = {
1152 .name = "IODATA GV-BCTV3/PCI",
1157 .gpiomask = 0x010f00,
1158 .muxsel = {2, 3, 0, 0 },
1159 .gpiomux = {0x10000, 0, 0x10000, 0 },
1162 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1163 .tuner_addr = ADDR_UNSET,
1164 .radio_addr = ADDR_UNSET,
1165 .audio_hook = gvbctv3pci_audio,
1167 [BTTV_BOARD_PXELVWPLTVPAK] = {
1168 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1173 .gpiomask = 0xAA0000,
1174 .muxsel = { 2,3,1,1,-1 },
1175 .digital_mode = DIGITAL_MODE_CAMERA,
1176 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1177 .gpiomute = 0xa8000,
1180 .tuner_type = TUNER_PHILIPS_PAL_I,
1181 .tuner_addr = ADDR_UNSET,
1182 .radio_addr = ADDR_UNSET,
1184 /* GPIO wiring: (different from Rev.4C !)
1185 GPIO17: U4.A0 (first hef4052bt)
1187 GPIO20: U5.A1 (second hef4052bt)
1189 GPIO22: BT832 Reset Line
1190 GPIO23: A5,A0, U5,nEN
1191 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1194 [BTTV_BOARD_EAGLE] = {
1195 .name = "Eagle Wireless Capricorn2 (bt878A)",
1201 .muxsel = { 2, 0, 1, 1 },
1202 .gpiomux = { 0, 1, 2, 3 },
1205 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1206 .tuner_addr = ADDR_UNSET,
1207 .radio_addr = ADDR_UNSET,
1210 /* ---- card 0x34 ---------------------------------- */
1211 [BTTV_BOARD_PINNACLEPRO] = {
1212 /* David Härdeman <david@2gen.com> */
1213 .name = "Pinnacle PCTV Studio Pro",
1218 .gpiomask = 0x03000F,
1219 .muxsel = { 2, 3, 1, 1 },
1220 .gpiomux = { 1, 0xd0001, 0, 0 },
1222 /* sound path (5 sources):
1223 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1226 2= Mono TV sound from Tuner
1228 MUX2 (mask 0x30000):
1230 1= FM stereo Radio from Tuner */
1234 .tuner_addr = ADDR_UNSET,
1235 .radio_addr = ADDR_UNSET,
1237 [BTTV_BOARD_TVIEW_RDS_FM] = {
1238 /* Claas Langbehn <claas@bigfoot.com>,
1239 Sven Grothklags <sven@upb.de> */
1240 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1246 .muxsel = { 2, 3, 1, 1 },
1247 .gpiomux = { 0, 0, 0x10, 8 },
1251 .tuner_type = TUNER_PHILIPS_PAL,
1252 .tuner_addr = ADDR_UNSET,
1253 .radio_addr = ADDR_UNSET,
1256 [BTTV_BOARD_LIFETEC_9415] = {
1257 /* Tim Röstermundt <rosterm@uni-muenster.de>
1258 in de.comp.os.unix.linux.hardware:
1259 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1260 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1261 options tuner type=5 */
1262 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1268 .muxsel = { 2, 3, 1, 1 },
1269 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1271 /* For cards with tda9820/tda9821:
1272 0x0000: Tuner normal stereo
1273 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1274 0x0880: Tuner A2 stereo */
1277 .tuner_addr = ADDR_UNSET,
1278 .radio_addr = ADDR_UNSET,
1280 [BTTV_BOARD_BESTBUY_EASYTV] = {
1281 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1282 old Easy TV BT848 version (model CPH031) */
1283 .name = "Askey CPH031/ BESTBUY Easy TV",
1289 .muxsel = { 2, 3, 1, 0 },
1290 .gpiomux = { 2, 0, 0, 0 },
1294 .tuner_type = TUNER_TEMIC_PAL,
1295 .tuner_addr = ADDR_UNSET,
1296 .radio_addr = ADDR_UNSET,
1299 /* ---- card 0x38 ---------------------------------- */
1300 [BTTV_BOARD_FLYVIDEO_98FM] = {
1301 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1302 .name = "Lifeview FlyVideo 98FM LR50",
1308 .muxsel = { 2, 3, 1, 1 },
1309 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1313 .tuner_addr = ADDR_UNSET,
1314 .radio_addr = ADDR_UNSET,
1316 /* This is the ultimate cheapo capture card
1317 * just a BT848A on a small PCB!
1318 * Steve Hosgood <steve@equiinet.com> */
1319 [BTTV_BOARD_GRANDTEC] = {
1320 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1332 .tuner_addr = ADDR_UNSET,
1333 .radio_addr = ADDR_UNSET,
1335 [BTTV_BOARD_ASKEY_CPH060] = {
1336 /* Daniel Herrington <daniel.herrington@home.com> */
1337 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1343 .muxsel = { 2, 3, 1, 1},
1344 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1348 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1349 .tuner_addr = ADDR_UNSET,
1350 .radio_addr = ADDR_UNSET,
1352 [BTTV_BOARD_ASKEY_CPH03X] = {
1353 /* Matti Mottus <mottus@physic.ut.ee> */
1354 .name = "Askey CPH03x TV Capturer",
1359 .gpiomask = 0x03000F,
1360 .muxsel = { 2, 3, 1, 0 },
1361 .gpiomux = { 2, 0, 0, 0 },
1365 .tuner_addr = ADDR_UNSET,
1366 .radio_addr = ADDR_UNSET,
1369 /* ---- card 0x3c ---------------------------------- */
1370 [BTTV_BOARD_MM100PCTV] = {
1371 /* Philip Blundell <philb@gnu.org> */
1372 .name = "Modular Technology MM100PCTV",
1378 .muxsel = { 2, 3, 1, 1 },
1379 .gpiomux = { 2, 0, 0, 1 },
1382 .tuner_type = TUNER_TEMIC_PAL,
1383 .tuner_addr = ADDR_UNSET,
1384 .radio_addr = ADDR_UNSET,
1386 [BTTV_BOARD_GMV1] = {
1387 /* Adrian Cox <adrian@humboldt.co.uk */
1388 .name = "AG Electronics GMV1",
1400 .tuner_addr = ADDR_UNSET,
1401 .radio_addr = ADDR_UNSET,
1403 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1404 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1405 new Easy TV BT878 version (model CPH061)
1406 special thanks to Informatica Mieres for providing the card */
1407 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1413 .muxsel = { 2, 3, 1, 0 },
1414 .gpiomux = { 1, 0, 4, 4 },
1418 .tuner_type = TUNER_PHILIPS_PAL,
1419 .tuner_addr = ADDR_UNSET,
1420 .radio_addr = ADDR_UNSET,
1422 [BTTV_BOARD_ATI_TVWONDER] = {
1423 /* Lukas Gebauer <geby@volny.cz> */
1424 .name = "ATI TV-Wonder",
1430 .muxsel = { 2, 3, 1, 0 },
1431 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1434 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1435 .tuner_addr = ADDR_UNSET,
1436 .radio_addr = ADDR_UNSET,
1439 /* ---- card 0x40 ---------------------------------- */
1440 [BTTV_BOARD_ATI_TVWONDERVE] = {
1441 /* Lukas Gebauer <geby@volny.cz> */
1442 .name = "ATI TV-Wonder VE",
1448 .muxsel = { 2, 3, 0, 1 },
1449 .gpiomux = { 0, 0, 1, 0 },
1452 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1453 .tuner_addr = ADDR_UNSET,
1454 .radio_addr = ADDR_UNSET,
1456 [BTTV_BOARD_FLYVIDEO2000] = {
1457 /* DeeJay <deejay@westel900.net (2000S) */
1458 .name = "Lifeview FlyVideo 2000S LR90",
1464 .muxsel = { 2, 3, 0, 1 },
1465 /* Radio changed from 1e80 to 0x800 to make
1466 FlyVideo2000S in .hu happy (gm)*/
1467 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1468 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1470 .audio_hook = fv2000s_audio,
1476 .tuner_addr = ADDR_UNSET,
1477 .radio_addr = ADDR_UNSET,
1479 [BTTV_BOARD_TERRATVALUER] = {
1480 .name = "Terratec TValueRadio",
1485 .gpiomask = 0xffff00,
1486 .muxsel = { 2, 3, 1, 1 },
1487 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1491 .tuner_type = TUNER_PHILIPS_PAL,
1492 .tuner_addr = ADDR_UNSET,
1493 .radio_addr = ADDR_UNSET,
1496 [BTTV_BOARD_GVBCTV4PCI] = {
1497 /* TANAKA Kei <peg00625@nifty.com> */
1498 .name = "IODATA GV-BCTV4/PCI",
1503 .gpiomask = 0x010f00,
1504 .muxsel = {2, 3, 0, 0 },
1505 .gpiomux = {0x10000, 0, 0x10000, 0 },
1508 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1509 .tuner_addr = ADDR_UNSET,
1510 .radio_addr = ADDR_UNSET,
1511 .audio_hook = gvbctv3pci_audio,
1514 /* ---- card 0x44 ---------------------------------- */
1515 [BTTV_BOARD_VOODOOTV_FM] = {
1516 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1517 /* try "insmod msp3400 simple=0" if you have
1518 * sound problems with this card. */
1523 .gpiomask = 0x4f8a00,
1524 /* 0x100000: 1=MSP enabled (0=disable again)
1525 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1526 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1527 .gpiomute = 0x947fff,
1528 /* tvtuner, radio, external,internal, mute, stereo
1529 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1530 .muxsel = { 2, 3 ,0 ,1 },
1531 .tuner_type = TUNER_MT2032,
1532 .tuner_addr = ADDR_UNSET,
1533 .radio_addr = ADDR_UNSET,
1537 [BTTV_BOARD_AIMMS] = {
1538 /* Philip Blundell <pb@nexus.co.uk> */
1539 .name = "Active Imaging AIMMS",
1544 .tuner_addr = ADDR_UNSET,
1545 .radio_addr = ADDR_UNSET,
1550 [BTTV_BOARD_PV_BT878P_PLUS] = {
1551 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1552 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1558 .muxsel = { 2, 3, 1, 1 },
1559 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1564 .tuner_addr = ADDR_UNSET,
1565 .radio_addr = ADDR_UNSET,
1568 GPIO0: U4.A0 (hef4052bt)
1570 GPIO2: U4.A1 (second hef4052bt)
1571 GPIO3: U4.nEN, U5.A0, A5.nEN
1575 [BTTV_BOARD_FLYVIDEO98EZ] = {
1576 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1581 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1584 .tuner_type = UNSET,
1585 .tuner_addr = ADDR_UNSET,
1586 .radio_addr = ADDR_UNSET,
1589 /* ---- card 0x48 ---------------------------------- */
1590 [BTTV_BOARD_PV_BT878P_9B] = {
1591 /* Dariusz Kowalewski <darekk@automex.pl> */
1592 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1598 .muxsel = { 2, 3, 1, 1 },
1599 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1606 .tuner_addr = ADDR_UNSET,
1607 .radio_addr = ADDR_UNSET,
1608 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1609 .has_radio = 1, /* Note: not all cards have radio */
1616 GPIO20,22,23: R30,R29,R28
1619 [BTTV_BOARD_SENSORAY311] = {
1620 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1621 /* you must jumper JP5 for the card to work */
1622 .name = "Sensoray 311",
1628 .muxsel = { 2, 3, 1, 0, 0 },
1632 .tuner_addr = ADDR_UNSET,
1633 .radio_addr = ADDR_UNSET,
1635 [BTTV_BOARD_RV605] = {
1636 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1637 .name = "RemoteVision MX (RV605)",
1643 .gpiomask2 = 0x07ff,
1644 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1645 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1649 .tuner_addr = ADDR_UNSET,
1650 .radio_addr = ADDR_UNSET,
1651 .muxsel_hook = rv605_muxsel,
1653 [BTTV_BOARD_POWERCLR_MTV878] = {
1654 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1659 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1660 .muxsel = { 2, 1, 1, },
1661 .gpiomux = { 0, 1, 2, 2 },
1664 .tuner_type = TUNER_PHILIPS_PAL,
1665 .tuner_addr = ADDR_UNSET,
1666 .radio_addr = ADDR_UNSET,
1671 /* ---- card 0x4c ---------------------------------- */
1672 [BTTV_BOARD_WINDVR] = {
1673 /* Masaki Suzuki <masaki@btree.org> */
1674 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1679 .gpiomask = 0x140007,
1680 .muxsel = { 2, 3, 1, 1 },
1681 .gpiomux = { 0, 1, 2, 3 },
1683 .tuner_type = TUNER_PHILIPS_NTSC,
1684 .tuner_addr = ADDR_UNSET,
1685 .radio_addr = ADDR_UNSET,
1686 .audio_hook = windvr_audio,
1688 [BTTV_BOARD_GRANDTEC_MULTI] = {
1689 .name = "GrandTec Multi Capture Card (Bt878)",
1695 .muxsel = { 2, 3, 1, 0 },
1701 .tuner_addr = ADDR_UNSET,
1702 .radio_addr = ADDR_UNSET,
1704 [BTTV_BOARD_KWORLD] = {
1705 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1711 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1712 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1713 * This card lacks external Audio In, so we mute it on Ext. & Int.
1714 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1715 * This card lacks PCI subsystem ID, sigh.
1716 * gpiomux =1: lower volume, 2+3: mute
1717 * btwincap uses 0x80000/0x80003
1724 .tuner_addr = ADDR_UNSET,
1725 .radio_addr = ADDR_UNSET,
1726 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1727 radio signal strength indicators work fine. */
1730 GPIO0,1: HEF4052 A0,A1
1731 GPIO2: HEF4052 nENABLE
1733 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1737 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1739 [BTTV_BOARD_DSP_TCVIDEO] = {
1740 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1741 .name = "DSP Design TCVIDEO",
1744 .muxsel = { 2, 3, 1, 0 },
1747 .tuner_addr = ADDR_UNSET,
1748 .radio_addr = ADDR_UNSET,
1751 /* ---- card 0x50 ---------------------------------- */
1752 [BTTV_BOARD_HAUPPAUGEPVR] = {
1753 .name = "Hauppauge WinTV PVR",
1758 .muxsel = { 2, 0, 1, 1 },
1762 .tuner_addr = ADDR_UNSET,
1763 .radio_addr = ADDR_UNSET,
1768 [BTTV_BOARD_GVBCTV5PCI] = {
1769 .name = "IODATA GV-BCTV5/PCI",
1774 .gpiomask = 0x0f0f80,
1775 .muxsel = {2, 3, 1, 0 },
1776 .gpiomux = {0x030000, 0x010000, 0, 0 },
1777 .gpiomute = 0x020000,
1780 .tuner_type = TUNER_PHILIPS_NTSC_M,
1781 .tuner_addr = ADDR_UNSET,
1782 .radio_addr = ADDR_UNSET,
1783 .audio_hook = gvbctv5pci_audio,
1786 [BTTV_BOARD_OSPREY1x0] = {
1787 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1788 .video_inputs = 4, /* id-inputs-clock */
1792 .muxsel = { 3, 2, 0, 1 },
1795 .tuner_addr = ADDR_UNSET,
1796 .radio_addr = ADDR_UNSET,
1801 [BTTV_BOARD_OSPREY1x0_848] = {
1802 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1807 .muxsel = { 2, 3, 1 },
1810 .tuner_addr = ADDR_UNSET,
1811 .radio_addr = ADDR_UNSET,
1817 /* ---- card 0x54 ---------------------------------- */
1818 [BTTV_BOARD_OSPREY101_848] = {
1819 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1827 .tuner_addr = ADDR_UNSET,
1828 .radio_addr = ADDR_UNSET,
1833 [BTTV_BOARD_OSPREY1x1] = {
1834 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1842 .tuner_addr = ADDR_UNSET,
1843 .radio_addr = ADDR_UNSET,
1848 [BTTV_BOARD_OSPREY1x1_SVID] = {
1849 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1857 .tuner_addr = ADDR_UNSET,
1858 .radio_addr = ADDR_UNSET,
1863 [BTTV_BOARD_OSPREY2xx] = {
1864 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1871 .tuner_type = UNSET,
1872 .tuner_addr = ADDR_UNSET,
1873 .radio_addr = ADDR_UNSET,
1879 /* ---- card 0x58 ---------------------------------- */
1880 [BTTV_BOARD_OSPREY2x0_SVID] = {
1881 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1888 .tuner_type = UNSET,
1889 .tuner_addr = ADDR_UNSET,
1890 .radio_addr = ADDR_UNSET,
1895 [BTTV_BOARD_OSPREY2x0] = {
1896 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1903 .tuner_type = UNSET,
1904 .tuner_addr = ADDR_UNSET,
1905 .radio_addr = ADDR_UNSET,
1910 [BTTV_BOARD_OSPREY500] = {
1911 .name = "Osprey 500", /* 500 */
1919 .tuner_addr = ADDR_UNSET,
1920 .radio_addr = ADDR_UNSET,
1925 [BTTV_BOARD_OSPREY540] = {
1926 .name = "Osprey 540", /* 540 */
1932 .tuner_addr = ADDR_UNSET,
1933 .radio_addr = ADDR_UNSET,
1939 /* ---- card 0x5C ---------------------------------- */
1940 [BTTV_BOARD_OSPREY2000] = {
1941 .name = "Osprey 2000", /* 2000 */
1948 .tuner_type = UNSET,
1949 .tuner_addr = ADDR_UNSET,
1950 .radio_addr = ADDR_UNSET,
1953 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1955 [BTTV_BOARD_IDS_EAGLE] = {
1956 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1957 .name = "IDS Eagle",
1962 .tuner_addr = ADDR_UNSET,
1963 .radio_addr = ADDR_UNSET,
1966 .muxsel = { 0, 1, 2, 3 },
1967 .muxsel_hook = eagle_muxsel,
1972 [BTTV_BOARD_PINNACLESAT] = {
1973 .name = "Pinnacle PCTV Sat",
1979 .tuner_addr = ADDR_UNSET,
1980 .radio_addr = ADDR_UNSET,
1989 [BTTV_BOARD_FORMAC_PROTV] = {
1990 .name = "Formac ProTV II (bt878)",
1996 /* TV, Comp1, Composite over SVID con, SVID */
1997 .muxsel = { 2, 3, 1, 1 },
1998 .gpiomux = { 2, 2, 0, 0 },
2001 .tuner_type = TUNER_PHILIPS_PAL,
2002 .tuner_addr = ADDR_UNSET,
2003 .radio_addr = ADDR_UNSET,
2005 GPIO=0x00,0x01,0x03: mute (?)
2006 0x02: both TV and radio (tuner: FM1216/I)
2007 The card has onboard audio connectors labeled "cdrom" and "board",
2008 not soldered here, though unknown wiring.
2009 Card lacks: external audio in, pci subsystem id.
2013 /* ---- card 0x60 ---------------------------------- */
2014 [BTTV_BOARD_MACHTV] = {
2021 .muxsel = { 2, 3, 1, 1},
2022 .gpiomux = { 0, 1, 2, 3},
2026 .tuner_addr = ADDR_UNSET,
2027 .radio_addr = ADDR_UNSET,
2030 [BTTV_BOARD_EURESYS_PICOLO] = {
2031 .name = "Euresys Picolo",
2040 .muxsel = { 2, 0, 1},
2042 .tuner_type = UNSET,
2043 .tuner_addr = ADDR_UNSET,
2044 .radio_addr = ADDR_UNSET,
2046 [BTTV_BOARD_PV150] = {
2047 /* Luc Van Hoeylandt <luc@e-magic.be> */
2048 .name = "ProVideo PV150", /* 0x4f */
2059 .tuner_type = UNSET,
2060 .tuner_addr = ADDR_UNSET,
2061 .radio_addr = ADDR_UNSET,
2063 [BTTV_BOARD_AD_TVK503] = {
2064 /* Hiroshi Takekawa <sian@big.or.jp> */
2065 /* This card lacks subsystem ID */
2066 .name = "AD-TVK503", /* 0x63 */
2071 .gpiomask = 0x001e8007,
2072 .muxsel = { 2, 3, 1, 0 },
2073 /* Tuner, Radio, external, internal, off, on */
2074 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2080 .tuner_addr = ADDR_UNSET,
2081 .radio_addr = ADDR_UNSET,
2082 .audio_hook = adtvk503_audio,
2085 /* ---- card 0x64 ---------------------------------- */
2086 [BTTV_BOARD_HERCULES_SM_TV] = {
2087 .name = "Hercules Smart TV Stereo",
2093 .muxsel = { 2, 3, 1, 1 },
2098 .tuner_addr = ADDR_UNSET,
2099 .radio_addr = ADDR_UNSET,
2101 - card lacks subsystem ID
2102 - stereo variant w/ daughter board with tda9874a @0xb0
2104 always from tda9874 independent of GPIO (?)
2105 external line in: unknown
2106 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2107 hef4053 (instead 4052) for unknown function
2110 [BTTV_BOARD_PACETV] = {
2111 .name = "Pace TV & Radio Card",
2116 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2121 .tuner_addr = ADDR_UNSET,
2122 .radio_addr = ADDR_UNSET,
2125 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2126 only internal line out: (4pin header) RGGL
2127 Radio must be decoded by msp3410d (not routed through)*/
2129 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2132 [BTTV_BOARD_IVC200] = {
2133 /* Chris Willing <chris@vislab.usyd.edu.au> */
2139 .tuner_addr = ADDR_UNSET,
2140 .radio_addr = ADDR_UNSET,
2146 [BTTV_BOARD_XGUARD] = {
2147 .name = "Grand X-Guard / Trust 814PCI",
2153 .tuner_addr = ADDR_UNSET,
2154 .radio_addr = ADDR_UNSET,
2156 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2157 .muxsel_hook = xguard_muxsel,
2164 /* ---- card 0x68 ---------------------------------- */
2165 [BTTV_BOARD_NEBULA_DIGITV] = {
2166 .name = "Nebula Electronics DigiTV",
2170 .muxsel = { 2, 3, 1, 0 },
2176 .tuner_addr = ADDR_UNSET,
2177 .radio_addr = ADDR_UNSET,
2183 [BTTV_BOARD_PV143] = {
2184 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2185 .name = "ProVideo PV143",
2191 .muxsel = { 2, 3, 1, 0 },
2197 .tuner_addr = ADDR_UNSET,
2198 .radio_addr = ADDR_UNSET,
2200 [BTTV_BOARD_VD009X1_MINIDIN] = {
2201 /* M.Klahr@phytec.de */
2202 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2205 .tuner = -1, /* card has no tuner */
2208 .muxsel = { 2, 3, 1, 0 },
2209 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2213 .tuner_addr = ADDR_UNSET,
2214 .radio_addr = ADDR_UNSET,
2216 [BTTV_BOARD_VD009X1_COMBI] = {
2217 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2220 .tuner = -1, /* card has no tuner */
2223 .muxsel = { 2, 3, 1, 1 },
2224 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2228 .tuner_addr = ADDR_UNSET,
2229 .radio_addr = ADDR_UNSET,
2232 /* ---- card 0x6c ---------------------------------- */
2233 [BTTV_BOARD_VD009_MINIDIN] = {
2234 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2237 .tuner = -1, /* card has no tuner */
2240 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2241 via the upper nibble of muxsel. here: used for
2242 xternal video-mux */
2243 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2244 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2248 .tuner_addr = ADDR_UNSET,
2249 .radio_addr = ADDR_UNSET,
2251 [BTTV_BOARD_VD009_COMBI] = {
2252 .name = "PHYTEC VD-009 Combi (bt878)",
2255 .tuner = -1, /* card has no tuner */
2258 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2259 via the upper nibble of muxsel. here: used for
2260 xternal video-mux */
2261 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2262 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2266 .tuner_addr = ADDR_UNSET,
2267 .radio_addr = ADDR_UNSET,
2269 [BTTV_BOARD_IVC100] = {
2275 .tuner_addr = ADDR_UNSET,
2276 .radio_addr = ADDR_UNSET,
2279 .muxsel = { 2, 3, 1, 0 },
2282 [BTTV_BOARD_IVC120] = {
2283 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2286 .audio_inputs = 0, /* card has no audio */
2287 .tuner = -1, /* card has no tuner */
2289 .tuner_addr = ADDR_UNSET,
2290 .radio_addr = ADDR_UNSET,
2291 .svhs = -1, /* card has no svhs */
2297 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2298 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2299 .muxsel_hook = ivc120_muxsel,
2303 /* ---- card 0x70 ---------------------------------- */
2304 [BTTV_BOARD_PC_HDTV] = {
2305 .name = "pcHDTV HD-2000 TV",
2310 .muxsel = { 2, 3, 1, 0 },
2311 .tuner_type = TUNER_PHILIPS_ATSC,
2312 .tuner_addr = ADDR_UNSET,
2313 .radio_addr = ADDR_UNSET,
2316 [BTTV_BOARD_TWINHAN_DST] = {
2317 .name = "Twinhan DST + clones",
2321 .tuner_type = TUNER_ABSENT,
2322 .tuner_addr = ADDR_UNSET,
2323 .radio_addr = ADDR_UNSET,
2327 [BTTV_BOARD_WINFASTVC100] = {
2328 .name = "Winfast VC100",
2333 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2337 .tuner_type = TUNER_ABSENT,
2338 .tuner_addr = ADDR_UNSET,
2339 .radio_addr = ADDR_UNSET,
2342 [BTTV_BOARD_TEV560] = {
2343 .name = "Teppro TEV-560/InterVision IV-560",
2349 .muxsel = { 2, 3, 1, 1 },
2350 .gpiomux = { 1, 1, 1, 1 },
2352 .tuner_type = TUNER_PHILIPS_PAL,
2353 .tuner_addr = ADDR_UNSET,
2354 .radio_addr = ADDR_UNSET,
2358 /* ---- card 0x74 ---------------------------------- */
2359 [BTTV_BOARD_SIMUS_GVC1100] = {
2360 .name = "SIMUS GVC1100",
2366 .tuner_addr = ADDR_UNSET,
2367 .radio_addr = ADDR_UNSET,
2369 .muxsel = { 2, 2, 2, 2 },
2371 .muxsel_hook = gvc1100_muxsel,
2373 [BTTV_BOARD_NGSTV_PLUS] = {
2374 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2375 .name = "NGS NGSTV+",
2379 .gpiomask = 0x008007,
2380 .muxsel = { 2, 3, 0, 0 },
2381 .gpiomux = { 0, 0, 0, 0 },
2382 .gpiomute = 0x000003,
2384 .tuner_type = TUNER_PHILIPS_PAL,
2385 .tuner_addr = ADDR_UNSET,
2386 .radio_addr = ADDR_UNSET,
2389 [BTTV_BOARD_LMLBT4] = {
2390 /* http://linuxmedialabs.com */
2392 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2396 .muxsel = { 2, 3, 1, 0 },
2402 .tuner_addr = ADDR_UNSET,
2403 .radio_addr = ADDR_UNSET,
2405 [BTTV_BOARD_TEKRAM_M205] = {
2406 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2407 .name = "Tekram M205 PRO",
2411 .tuner_type = TUNER_PHILIPS_PAL,
2412 .tuner_addr = ADDR_UNSET,
2413 .radio_addr = ADDR_UNSET,
2417 .muxsel = { 2, 3, 1 },
2418 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2422 /* ---- card 0x78 ---------------------------------- */
2423 [BTTV_BOARD_CONTVFMI] = {
2424 /* Javier Cendan Ares <jcendan@lycos.es> */
2425 /* bt878 TV + FM without subsystem ID */
2426 .name = "Conceptronic CONTVFMi",
2431 .gpiomask = 0x008007,
2432 .muxsel = { 2, 3, 1, 1 },
2433 .gpiomux = { 0, 1, 2, 2 },
2437 .tuner_type = TUNER_PHILIPS_PAL,
2438 .tuner_addr = ADDR_UNSET,
2439 .radio_addr = ADDR_UNSET,
2443 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2444 /*Eric DEBIEF <debief@telemsa.com>*/
2445 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2446 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2448 .name = "Euresys Picolo Tetra",
2454 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2458 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2459 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2462 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2464 .tuner_addr = ADDR_UNSET,
2465 .radio_addr = ADDR_UNSET,
2467 [BTTV_BOARD_SPIRIT_TV] = {
2468 /* Spirit TV Tuner from http://spiritmodems.com.au */
2469 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2470 .name = "Spirit TV Tuner",
2475 .gpiomask = 0x0000000f,
2476 .muxsel = { 2, 1, 1 },
2477 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2478 .tuner_type = TUNER_TEMIC_PAL,
2479 .tuner_addr = ADDR_UNSET,
2480 .radio_addr = ADDR_UNSET,
2484 [BTTV_BOARD_AVDVBT_771] = {
2485 /* Wolfram Joost <wojo@frokaschwei.de> */
2486 .name = "AVerMedia AVerTV DVB-T 771",
2490 .tuner_type = TUNER_ABSENT,
2491 .tuner_addr = ADDR_UNSET,
2492 .radio_addr = ADDR_UNSET,
2493 .muxsel = { 3 , 3 },
2502 /* ---- card 0x7c ---------------------------------- */
2503 [BTTV_BOARD_AVDVBT_761] = {
2504 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2505 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2506 .name = "AverMedia AverTV DVB-T 761",
2510 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2516 .tuner_addr = ADDR_UNSET,
2517 .radio_addr = ADDR_UNSET,
2522 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2523 /* andre.schwarz@matrix-vision.de */
2524 .name = "MATRIX Vision Sigma-SQ",
2530 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2531 3, 3, 3, 3, 3, 3, 3, 3 },
2532 .muxsel_hook = sigmaSQ_muxsel,
2537 .tuner_addr = ADDR_UNSET,
2538 .radio_addr = ADDR_UNSET,
2540 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2541 /* andre.schwarz@matrix-vision.de */
2542 .name = "MATRIX Vision Sigma-SLC",
2548 .muxsel = { 2, 2, 2, 2 },
2549 .muxsel_hook = sigmaSLC_muxsel,
2554 .tuner_addr = ADDR_UNSET,
2555 .radio_addr = ADDR_UNSET,
2557 /* BTTV_BOARD_APAC_VIEWCOMP */
2558 [BTTV_BOARD_APAC_VIEWCOMP] = {
2559 /* Attila Kondoros <attila.kondoros@chello.hu> */
2560 /* bt878 TV + FM 0x00000000 subsystem ID */
2561 .name = "APAC Viewcomp 878(AMAX)",
2567 .muxsel = { 2, 3, 1, 1 },
2568 .gpiomux = { 2, 0, 0, 0 },
2572 .tuner_type = TUNER_PHILIPS_PAL,
2573 .tuner_addr = ADDR_UNSET,
2574 .radio_addr = ADDR_UNSET,
2575 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2576 .has_radio = 1, /* not every card has radio */
2579 /* ---- card 0x80 ---------------------------------- */
2580 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2581 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2582 .name = "DViCO FusionHDTV DVB-T Lite",
2591 .tuner_addr = ADDR_UNSET,
2592 .radio_addr = ADDR_UNSET,
2594 [BTTV_BOARD_VGEAR_MYVCD] = {
2595 /* Steven <photon38@pchome.com.tw> */
2596 .name = "V-Gear MyVCD",
2602 .muxsel = {2, 3, 1, 0 },
2603 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2607 .tuner_type = TUNER_PHILIPS_NTSC_M,
2608 .tuner_addr = ADDR_UNSET,
2609 .radio_addr = ADDR_UNSET,
2612 [BTTV_BOARD_SUPER_TV] = {
2613 /* Rick C <cryptdragoon@gmail.com> */
2614 .name = "Super TV Tuner",
2619 .muxsel = { 2, 3, 1, 0 },
2620 .tuner_type = TUNER_PHILIPS_NTSC,
2621 .tuner_addr = ADDR_UNSET,
2622 .radio_addr = ADDR_UNSET,
2623 .gpiomask = 0x008007,
2624 .gpiomux = { 0, 0x000001,0,0 },
2628 [BTTV_BOARD_TIBET_CS16] = {
2629 /* Chris Fanning <video4linux@haydon.net> */
2630 .name = "Tibet Systems 'Progress DVR' CS16",
2635 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2641 .tuner_addr = ADDR_UNSET,
2642 .radio_addr = ADDR_UNSET,
2643 .muxsel_hook = tibetCS16_muxsel,
2645 [BTTV_BOARD_KODICOM_4400R] = {
2646 /* Bill Brack <wbrack@mmm.com.hk> */
2648 * Note that, because of the card's wiring, the "master"
2649 * BT878A chip (i.e. the one which controls the analog switch
2650 * and must use this card type) is the 2nd one detected. The
2651 * other 3 chips should use card type 0x85, whose description
2652 * follows this one. There is a EEPROM on the card (which is
2653 * connected to the I2C of one of those other chips), but is
2654 * not currently handled. There is also a facility for a
2655 * "monitor", which is also not currently implemented.
2657 .name = "Kodicom 4400R (master)",
2662 .tuner_addr = ADDR_UNSET,
2663 .radio_addr = ADDR_UNSET,
2665 /* GPIO bits 0-9 used for analog switch:
2666 * 00 - 03: camera selector
2667 * 04 - 06: channel (controller) selector
2668 * 07: data (1->on, 0->off)
2671 * bit 16 is input from sync separator for the channel
2673 .gpiomask = 0x0003ff,
2675 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2680 .muxsel_hook = kodicom4400r_muxsel,
2682 [BTTV_BOARD_KODICOM_4400R_SL] = {
2683 /* Bill Brack <wbrack@mmm.com.hk> */
2684 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2685 * one which controls the analog switch, and must use the card type)
2686 * is the 2nd one detected. The other 3 chips should use this card
2689 .name = "Kodicom 4400R (slave)",
2694 .tuner_addr = ADDR_UNSET,
2695 .radio_addr = ADDR_UNSET,
2697 .gpiomask = 0x010000,
2699 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2704 .muxsel_hook = kodicom4400r_muxsel,
2706 /* ---- card 0x86---------------------------------- */
2707 [BTTV_BOARD_ADLINK_RTV24] = {
2708 /* Michael Henson <mhenson@clarityvi.com> */
2709 /* Adlink RTV24 with special unlock codes */
2710 .name = "Adlink RTV24",
2715 .muxsel = { 2, 3, 1, 0 },
2717 .tuner_addr = ADDR_UNSET,
2718 .radio_addr = ADDR_UNSET,
2721 /* ---- card 0x87---------------------------------- */
2722 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2723 /* Michael Krufky <mkrufky@m1k.net> */
2724 .name = "DViCO FusionHDTV 5 Lite",
2726 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2727 .tuner_addr = ADDR_UNSET,
2728 .radio_addr = ADDR_UNSET,
2732 .muxsel = { 2, 3, 1 },
2733 .gpiomask = 0x00e00007,
2734 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2735 .gpiomute = 0x00c00007,
2741 /* ---- card 0x88---------------------------------- */
2742 [BTTV_BOARD_ACORP_Y878F] = {
2743 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2744 .name = "Acorp Y878F",
2749 .gpiomask = 0x01fe00,
2750 .muxsel = { 2, 3, 1, 1 },
2751 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2752 .gpiomute = 0x002000,
2755 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2756 .tuner_addr = 0xc1 >>1,
2757 .radio_addr = 0xc1 >>1,
2760 /* ---- card 0x89 ---------------------------------- */
2761 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2762 .name = "Conceptronic CTVFMi v2",
2767 .gpiomask = 0x001c0007,
2768 .muxsel = { 2, 3, 1, 1 },
2769 .gpiomux = { 0, 1, 2, 2 },
2773 .tuner_type = TUNER_TENA_9533_DI,
2774 .tuner_addr = ADDR_UNSET,
2775 .radio_addr = ADDR_UNSET,
2779 /* ---- card 0x8a ---------------------------------- */
2780 [BTTV_BOARD_PV_BT878P_2E] = {
2781 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2786 .gpiomask = 0x01fe00,
2787 .muxsel = { 2,3,1,1,-1 },
2788 .digital_mode = DIGITAL_MODE_CAMERA,
2789 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2790 .gpiomute = 0x12400,
2793 .tuner_type = TUNER_LG_PAL_FM,
2794 .tuner_addr = ADDR_UNSET,
2795 .radio_addr = ADDR_UNSET,
2798 /* ---- card 0x8b ---------------------------------- */
2799 [BTTV_BOARD_PV_M4900] = {
2800 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2801 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2807 .muxsel = { 2, 3, 1, 1 },
2808 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2812 .tuner_type = TUNER_YMEC_TVF_5533MF,
2813 .tuner_addr = ADDR_UNSET,
2814 .radio_addr = ADDR_UNSET,
2818 /* ---- card 0x8c ---------------------------------- */
2819 [BTTV_BOARD_OSPREY440] = {
2820 .name = "Osprey 440",
2827 .tuner_type = UNSET,
2828 .tuner_addr = ADDR_UNSET,
2829 .radio_addr = ADDR_UNSET,
2834 /* ---- card 0x8d ---------------------------------- */
2835 [BTTV_BOARD_ASOUND_SKYEYE] = {
2836 .name = "Asound Skyeye PCTV",
2842 .muxsel = { 2, 3, 1, 1 },
2843 .gpiomux = { 2, 0, 0, 0 },
2848 .tuner_addr = ADDR_UNSET,
2849 .radio_addr = ADDR_UNSET,
2851 /* ---- card 0x8e ---------------------------------- */
2852 [BTTV_BOARD_SABRENT_TVFM] = {
2853 .name = "Sabrent TV-FM (bttv version)",
2858 .gpiomask = 0x108007,
2859 .muxsel = { 2, 3, 1, 1 },
2860 .gpiomux = { 100000, 100002, 100002, 100000 },
2865 .tuner_type = TUNER_TNF_5335MF,
2866 .tuner_addr = ADDR_UNSET,
2869 /* ---- card 0x8f ---------------------------------- */
2870 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2871 .name = "Hauppauge ImpactVCB (bt878)",
2876 .gpiomask = 0x0f, /* old: 7 */
2877 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2882 .tuner_addr = ADDR_UNSET,
2883 .radio_addr = ADDR_UNSET,
2885 [BTTV_BOARD_MACHTV_MAGICTV] = {
2886 /* Julian Calaby <julian.calaby@gmail.com>
2887 * Slightly different from original MachTV definition (0x60)
2889 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2890 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2891 * properly (methinks) causing no keyup bits being set */
2893 .name = "MagicTV", /* rebranded MachTV */
2899 .muxsel = { 2, 3, 1, 1 },
2900 .gpiomux = { 0, 1, 2, 3 },
2902 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2903 .tuner_addr = ADDR_UNSET,
2904 .radio_addr = ADDR_UNSET,
2911 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2913 /* ----------------------------------------------------------------------- */
2915 static unsigned char eeprom_data[256];
2920 void __devinit bttv_idcard(struct bttv *btv)
2922 unsigned int gpiobits;
2926 /* read PCI subsystem ID */
2927 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2928 btv->cardid = tmp << 16;
2929 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2932 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2933 /* look for the card */
2934 for (type = -1, i = 0; cards[i].id != 0; i++)
2935 if (cards[i].id == btv->cardid)
2940 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2941 "PCI subsystem ID is %04x:%04x\n",
2942 btv->c.nr,cards[type].name,cards[type].cardnr,
2943 btv->cardid & 0xffff,
2944 (btv->cardid >> 16) & 0xffff);
2945 btv->c.type = cards[type].cardnr;
2948 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2949 btv->c.nr, btv->cardid & 0xffff,
2950 (btv->cardid >> 16) & 0xffff);
2951 printk(KERN_DEBUG "please mail id, board name and "
2952 "the correct card= insmod option to video4linux-list@redhat.com\n");
2956 /* let the user override the autodetected type */
2957 if (card[btv->c.nr] < bttv_num_tvcards)
2958 btv->c.type=card[btv->c.nr];
2960 /* print which card config we are using */
2961 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2962 bttv_tvcards[btv->c.type].name, btv->c.type,
2963 card[btv->c.nr] < bttv_num_tvcards
2964 ? "insmod option" : "autodetected");
2966 /* overwrite gpio stuff ?? */
2967 if (UNSET == audioall && UNSET == audiomux[0])
2970 if (UNSET != audiomux[0]) {
2972 for (i = 0; i < 4; i++) {
2973 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2974 gpiobits |= audiomux[i];
2977 gpiobits = audioall;
2978 for (i = 0; i < 4; i++) {
2979 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2982 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2983 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2984 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2985 for (i = 0; i < 5; i++) {
2986 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2992 * (most) board specific initialisations goes here
2995 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2996 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3000 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
3001 type = BTTV_BOARD_MODTEC_205;
3002 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
3003 type = BTTV_BOARD_EURESYS_PICOLO;
3004 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
3005 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
3009 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3010 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3014 static void flyvideo_gpio(struct bttv *btv)
3016 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3019 gpio_inout(0xffffff, 0);
3020 udelay(8); /* without this we would see the 0x1800 mask */
3022 /* FIXME: must restore OUR_EN ??? */
3024 /* all cards provide GPIO info, some have an additional eeprom
3025 * LR50: GPIO coding can be found lower right CP1 .. CP9
3026 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3028 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3030 * lowest 3 bytes are remote control codes (no handshake needed)
3031 * xxxFFF: No remote control chip soldered
3032 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3033 * Note: Some bits are Audio_Mask !
3035 ttype=(gpio&0x0f0000)>>16;
3037 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
3039 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
3041 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3043 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
3045 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3048 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3051 has_remote = gpio & 0x800000;
3052 has_radio = gpio & 0x400000;
3053 /* unknown 0x200000;
3054 * unknown2 0x100000; */
3055 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3056 has_tda9820_tda9821 = !(gpio & 0x004000);
3057 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3059 * gpio & 0x001000 output bit for audio routing */
3062 tuner=4; /* No tuner present */
3064 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3065 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3066 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3067 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3068 is_capture_only?"yes":"no ");
3070 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
3071 btv->tuner_type = tuner;
3072 btv->has_radio = has_radio;
3074 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3075 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3076 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3077 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
3078 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
3081 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3082 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3083 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3084 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3086 static void miro_pinnacle_gpio(struct bttv *btv)
3091 gpio_inout(0xffffff, 0);
3093 id = ((gpio>>10) & 63) -1;
3094 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3096 btv->tuner_type = miro_tunermap[id];
3097 if (0 == (gpio & 0x20)) {
3099 if (!miro_fmtuner[id]) {
3100 btv->has_matchbox = 1;
3101 btv->mbox_we = (1<<6);
3102 btv->mbox_most = (1<<7);
3103 btv->mbox_clk = (1<<8);
3104 btv->mbox_data = (1<<9);
3105 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3111 if (btv->c.type == BTTV_BOARD_MIRO)
3112 btv->c.type = BTTV_BOARD_MIROPRO;
3113 if (btv->c.type == BTTV_BOARD_PINNACLE)
3114 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3117 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3118 btv->c.nr, id+1, btv->tuner_type,
3119 !btv->has_radio ? "no" :
3120 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3121 (-1 == msp) ? "no" : "yes");
3123 /* new cards with microtune tuner */
3128 info = "PAL / mono";
3129 btv->tda9887_conf = TDA9887_INTERCARRIER;
3132 info = "PAL+SECAM / stereo";
3134 btv->tda9887_conf = TDA9887_QSS;
3137 info = "NTSC / stereo";
3139 btv->tda9887_conf = TDA9887_QSS;
3142 info = "PAL+SECAM / mono";
3143 btv->tda9887_conf = TDA9887_QSS;
3146 info = "NTSC / mono";
3147 btv->tda9887_conf = TDA9887_INTERCARRIER;
3150 info = "NTSC / stereo";
3151 btv->tda9887_conf = TDA9887_INTERCARRIER;
3154 info = "PAL / stereo";
3155 btv->tda9887_conf = TDA9887_INTERCARRIER;
3158 info = "oops: unknown card";
3162 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3164 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3165 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3166 btv->tuner_type = TUNER_MT2032;
3170 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3171 #define LM1882_SYNC_DRIVE 0x200000L
3173 static void init_ids_eagle(struct bttv *btv)
3175 gpio_inout(0xffffff,0xFFFF37);
3176 gpio_write(0x200020);
3178 /* flash strobe inverter ?! */
3179 gpio_write(0x200024);
3181 /* switch sync drive off */
3182 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3184 /* set BT848 muxel to 2 */
3185 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3188 /* Muxsel helper for the IDS Eagle.
3189 * the eagles does not use the standard muxsel-bits but
3190 * has its own multiplexer */
3191 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3193 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3194 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3197 /* set chroma ADC to sleep */
3198 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3199 /* set to composite video */
3200 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3201 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3203 /* switch sync drive off */
3204 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3207 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3209 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3210 gpio_write(masks[input%4]);
3213 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3216 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3217 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3219 IN - sensor inputs, INx - sensor inputs and TI XORed together
3220 O1,O2,O3 - alarm outputs (relays)
3222 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3226 static void init_lmlbt4x(struct bttv *btv)
3228 printk(KERN_DEBUG "LMLBT4x init\n");
3229 btwrite(0x000000, BT848_GPIO_REG_INP);
3230 gpio_inout(0xffffff, 0x0006C0);
3231 gpio_write(0x000000);
3234 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3236 unsigned int inmux = input % 8;
3237 gpio_inout( 0xf, 0xf );
3238 gpio_bits( 0xf, inmux );
3241 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3243 unsigned int inmux = input % 4;
3244 gpio_inout( 3<<9, 3<<9 );
3245 gpio_bits( 3<<9, inmux<<9 );
3248 /* ----------------------------------------------------------------------- */
3250 static void bttv_reset_audio(struct bttv *btv)
3253 * BT878A has a audio-reset register.
3254 * 1. This register is an audio reset function but it is in
3255 * function-0 (video capture) address space.
3256 * 2. It is enough to do this once per power-up of the card.
3257 * 3. There is a typo in the Conexant doc -- it is not at
3258 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3259 * --//Shrikumar 030609
3265 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3266 btwrite((1<<7), 0x058);
3271 /* initialization part one -- before registering i2c bus */
3272 void __devinit bttv_init_card1(struct bttv *btv)
3274 switch (btv->c.type) {
3275 case BTTV_BOARD_HAUPPAUGE:
3276 case BTTV_BOARD_HAUPPAUGE878:
3277 boot_msp34xx(btv,5);
3279 case BTTV_BOARD_VOODOOTV_FM:
3280 boot_msp34xx(btv,20);
3282 case BTTV_BOARD_AVERMEDIA98:
3283 boot_msp34xx(btv,11);
3285 case BTTV_BOARD_HAUPPAUGEPVR:
3288 case BTTV_BOARD_TWINHAN_DST:
3289 case BTTV_BOARD_AVDVBT_771:
3290 case BTTV_BOARD_PINNACLESAT:
3291 btv->use_i2c_hw = 1;
3293 case BTTV_BOARD_ADLINK_RTV24:
3298 if (!bttv_tvcards[btv->c.type].has_dvb)
3299 bttv_reset_audio(btv);
3302 /* initialization part two -- after registering i2c bus */
3303 void __devinit bttv_init_card2(struct bttv *btv)
3306 int addr=ADDR_UNSET;
3308 btv->tuner_type = -1;
3310 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3311 bttv_readee(btv,eeprom_data,0xa0);
3312 identify_by_eeprom(btv,eeprom_data);
3315 switch (btv->c.type) {
3316 case BTTV_BOARD_MIRO:
3317 case BTTV_BOARD_MIROPRO:
3318 case BTTV_BOARD_PINNACLE:
3319 case BTTV_BOARD_PINNACLEPRO:
3321 miro_pinnacle_gpio(btv);
3323 case BTTV_BOARD_FLYVIDEO_98:
3324 case BTTV_BOARD_MAXI:
3325 case BTTV_BOARD_LIFE_FLYKIT:
3326 case BTTV_BOARD_FLYVIDEO:
3327 case BTTV_BOARD_TYPHOON_TVIEW:
3328 case BTTV_BOARD_CHRONOS_VS2:
3329 case BTTV_BOARD_FLYVIDEO_98FM:
3330 case BTTV_BOARD_FLYVIDEO2000:
3331 case BTTV_BOARD_FLYVIDEO98EZ:
3332 case BTTV_BOARD_CONFERENCETV:
3333 case BTTV_BOARD_LIFETEC_9415:
3336 case BTTV_BOARD_HAUPPAUGE:
3337 case BTTV_BOARD_HAUPPAUGE878:
3338 case BTTV_BOARD_HAUPPAUGEPVR:
3339 /* pick up some config infos from the eeprom */
3340 bttv_readee(btv,eeprom_data,0xa0);
3341 hauppauge_eeprom(btv);
3343 case BTTV_BOARD_AVERMEDIA98:
3344 case BTTV_BOARD_AVPHONE98:
3345 bttv_readee(btv,eeprom_data,0xa0);
3346 avermedia_eeprom(btv);
3348 case BTTV_BOARD_PXC200:
3351 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3352 picolo_tetra_init(btv);
3354 case BTTV_BOARD_VHX:
3356 btv->has_matchbox = 1;
3357 btv->mbox_we = 0x20;
3359 btv->mbox_clk = 0x08;
3360 btv->mbox_data = 0x10;
3361 btv->mbox_mask = 0x38;
3363 case BTTV_BOARD_VOBIS_BOOSTAR:
3364 case BTTV_BOARD_TERRATV:
3365 terratec_active_radio_upgrade(btv);
3367 case BTTV_BOARD_MAGICTVIEW061:
3368 if (btv->cardid == 0x3002144f) {
3370 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3373 case BTTV_BOARD_STB2:
3374 if (btv->cardid == 0x3060121a) {
3375 /* Fix up entry for 3DFX VoodooTV 100,
3376 which is an OEM STB card variant. */
3378 btv->tuner_type=TUNER_TEMIC_NTSC;
3381 case BTTV_BOARD_OSPREY1x0:
3382 case BTTV_BOARD_OSPREY1x0_848:
3383 case BTTV_BOARD_OSPREY101_848:
3384 case BTTV_BOARD_OSPREY1x1:
3385 case BTTV_BOARD_OSPREY1x1_SVID:
3386 case BTTV_BOARD_OSPREY2xx:
3387 case BTTV_BOARD_OSPREY2x0_SVID:
3388 case BTTV_BOARD_OSPREY2x0:
3389 case BTTV_BOARD_OSPREY500:
3390 case BTTV_BOARD_OSPREY540:
3391 case BTTV_BOARD_OSPREY2000:
3392 bttv_readee(btv,eeprom_data,0xa0);
3395 case BTTV_BOARD_IDS_EAGLE:
3396 init_ids_eagle(btv);
3398 case BTTV_BOARD_MODTEC_205:
3399 bttv_readee(btv,eeprom_data,0xa0);
3402 case BTTV_BOARD_LMLBT4:
3405 case BTTV_BOARD_TIBET_CS16:
3406 tibetCS16_init(btv);
3408 case BTTV_BOARD_KODICOM_4400R:
3409 kodicom4400r_init(btv);
3413 /* pll configuration */
3414 if (!(btv->id==848 && btv->revision==0x11)) {
3415 /* defaults from card list */
3416 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3417 btv->pll.pll_ifreq=28636363;
3418 btv->pll.pll_crystal=BT848_IFORM_XT0;
3420 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3421 btv->pll.pll_ifreq=35468950;
3422 btv->pll.pll_crystal=BT848_IFORM_XT1;
3424 /* insmod options can override */
3425 switch (pll[btv->c.nr]) {
3427 btv->pll.pll_crystal = 0;
3428 btv->pll.pll_ifreq = 0;
3429 btv->pll.pll_ofreq = 0;
3431 case 1: /* 28 MHz */
3433 btv->pll.pll_ifreq = 28636363;
3434 btv->pll.pll_ofreq = 0;
3435 btv->pll.pll_crystal = BT848_IFORM_XT0;
3437 case 2: /* 35 MHz */
3439 btv->pll.pll_ifreq = 35468950;
3440 btv->pll.pll_ofreq = 0;
3441 btv->pll.pll_crystal = BT848_IFORM_XT1;
3445 btv->pll.pll_current = -1;
3447 /* tuner configuration (from card list / autodetect / insmod option) */
3448 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3449 addr = bttv_tvcards[btv->c.type].tuner_addr;
3451 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3452 if(UNSET == btv->tuner_type)
3453 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3454 if (UNSET != tuner[btv->c.nr])
3455 btv->tuner_type = tuner[btv->c.nr];
3456 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
3458 if (btv->tuner_type != UNSET) {
3459 struct tuner_setup tun_setup;
3461 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3462 tun_setup.type = btv->tuner_type;
3463 tun_setup.addr = addr;
3465 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3468 if (btv->tda9887_conf) {
3469 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3470 &btv->tda9887_conf);
3473 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3474 if (svhs[btv->c.nr] != UNSET)
3475 btv->svhs = svhs[btv->c.nr];
3476 if (remote[btv->c.nr] != UNSET)
3477 btv->has_remote = remote[btv->c.nr];
3479 if (bttv_tvcards[btv->c.type].has_radio)
3481 if (bttv_tvcards[btv->c.type].has_remote)
3483 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3485 if (bttv_tvcards[btv->c.type].audio_hook)
3486 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3488 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3489 /* detect Bt832 chip for quartzsight digital camera */
3490 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3491 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
3498 /* try to detect audio/fader chips */
3499 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3500 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3501 request_module("msp3400");
3503 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3504 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3505 request_module("msp3400");
3507 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3508 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3509 request_module("tda9875");
3511 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3512 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3513 request_module("tda7432");
3515 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3516 request_module("tvaudio");
3520 if (btv->tda9887_conf)
3522 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3523 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
3525 /* Hybrid DVB card, DOES have a tda9887 */
3526 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3528 if (btv->tuner_type != UNSET)
3529 request_module("tuner");
3533 /* ----------------------------------------------------------------------- */
3535 static void modtec_eeprom(struct bttv *btv)
3537 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3538 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3539 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3540 btv->c.nr,&eeprom_data[0x1e]);
3541 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3542 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3543 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3544 btv->c.nr,&eeprom_data[0x1e]);
3545 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3546 btv->tuner_type=TUNER_PHILIPS_NTSC;
3547 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3548 btv->c.nr,&eeprom_data[0x1e]);
3550 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3551 btv->c.nr,&eeprom_data[0x1e]);
3555 static void __devinit hauppauge_eeprom(struct bttv *btv)
3559 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3560 btv->tuner_type = tv.tuner_type;
3561 btv->has_radio = tv.has_radio;
3563 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3564 btv->c.nr, tv.model);
3567 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3568 * type based on model #.
3570 if(tv.model == 64900) {
3571 printk("bttv%d: Switching board type from %s to %s\n",
3573 bttv_tvcards[btv->c.type].name,
3574 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3575 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3579 static int terratec_active_radio_upgrade(struct bttv *btv)
3584 btv->has_matchbox = 1;
3585 btv->mbox_we = 0x10;
3586 btv->mbox_most = 0x20;
3587 btv->mbox_clk = 0x08;
3588 btv->mbox_data = 0x04;
3589 btv->mbox_mask = 0x3c;
3591 btv->mbox_iow = 1 << 8;
3592 btv->mbox_ior = 1 << 9;
3593 btv->mbox_csel = 1 << 10;
3596 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3597 if (0x1ed8 == tea5757_read(btv)) {
3598 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3601 btv->has_matchbox = 1;
3604 btv->has_matchbox = 0;
3610 /* ----------------------------------------------------------------------- */
3613 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3615 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3616 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3617 * unpacked with unzip).
3619 #define PVR_GPIO_DELAY 10
3621 #define BTTV_ALT_DATA 0x000001
3622 #define BTTV_ALT_DCLK 0x100000
3623 #define BTTV_ALT_NCONFIG 0x800000
3625 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3631 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3633 udelay(PVR_GPIO_DELAY);
3635 gpio_write(BTTV_ALT_NCONFIG);
3636 udelay(PVR_GPIO_DELAY);
3638 for (n = 0; n < microlen; n++) {
3640 for ( i = 0 ; i < 8 ; i++ ) {
3641 gpio_bits(BTTV_ALT_DCLK,0);
3643 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3645 gpio_bits(BTTV_ALT_DATA,0);
3646 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3650 gpio_bits(BTTV_ALT_DCLK,0);
3651 udelay(PVR_GPIO_DELAY);
3653 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3654 for (i = 0 ; i < 30 ; i++) {
3655 gpio_bits(BTTV_ALT_DCLK,0);
3656 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3658 gpio_bits(BTTV_ALT_DCLK,0);
3662 static int __devinit pvr_boot(struct bttv *btv)
3664 const struct firmware *fw_entry;
3667 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3669 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3673 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3674 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3675 btv->c.nr, (rc < 0) ? "failed" : "ok");
3676 release_firmware(fw_entry);
3680 /* ----------------------------------------------------------------------- */
3681 /* some osprey specific stuff */
3683 static void __devinit osprey_eeprom(struct bttv *btv)
3686 unsigned char *ee = eeprom_data;
3687 unsigned long serial = 0;
3689 if (btv->c.type == 0) {
3690 /* this might be an antique... check for MMAC label in eeprom */
3691 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3692 unsigned char checksum = 0;
3693 for (i =0; i<21; i++)
3695 if (checksum != ee[21])
3697 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3698 for (i = 12; i < 21; i++)
3699 serial *= 10, serial += ee[i] - '0';
3702 unsigned short type;
3705 for(; offset < 8*16; offset += 16) {
3706 unsigned short checksum = 0;
3707 /* verify the checksum */
3708 for(i = 0; i<14; i++) checksum += ee[i+offset];
3709 checksum = ~checksum; /* no idea why */
3710 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3711 ((checksum & 0x0FF) == ee[offset+15])) {
3719 /* found a valid descriptor */
3720 type = (ee[offset+4]<<8) | (ee[offset+5]);
3726 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3729 btv->c.type = BTTV_BOARD_OSPREY101_848;
3735 btv->c.type = BTTV_BOARD_OSPREY1x0;
3739 btv->c.type = BTTV_BOARD_OSPREY1x1;
3744 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
3750 btv->c.type = BTTV_BOARD_OSPREY2xx;
3754 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
3757 btv->c.type = BTTV_BOARD_OSPREY500;
3761 btv->c.type = BTTV_BOARD_OSPREY540;
3762 /* bttv_osprey_540_init(btv); */
3767 btv->c.type = BTTV_BOARD_OSPREY2x0;
3768 /* enable output on select control lines */
3769 gpio_inout(0xffffff,0x000303);
3772 /* unknown...leave generic, but get serial # */
3775 serial = (ee[offset+6] << 24)
3776 | (ee[offset+7] << 16)
3777 | (ee[offset+8] << 8)
3781 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3782 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3785 /* ----------------------------------------------------------------------- */
3786 /* AVermedia specific stuff, from bktr_card.c */
3788 static int tuner_0_table[] = {
3789 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3790 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3791 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3792 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3793 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3794 TUNER_PHILIPS_FM1216ME_MK3 };
3796 static int tuner_1_table[] = {
3797 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3798 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3799 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3800 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3801 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3803 static void __devinit avermedia_eeprom(struct bttv *btv)
3805 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3807 tuner_make = (eeprom_data[0x41] & 0x7);
3808 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3809 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3810 btv->has_remote = (eeprom_data[0x42] & 0x01);
3812 if (tuner_make == 0 || tuner_make == 2)
3813 if(tuner_format <=0x0a)
3814 tuner = tuner_0_table[tuner_format];
3815 if (tuner_make == 1)
3816 if(tuner_format <=9)
3817 tuner = tuner_1_table[tuner_format];
3819 if (tuner_make == 4)
3820 if(tuner_format == 0x09)
3821 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3823 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3824 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3826 btv->tuner_type=tuner;
3829 printk("Unknown type");
3830 printk(" radio:%s remote control:%s\n",
3831 tuner_tv_fm ? "yes" : "no",
3832 btv->has_remote ? "yes" : "no");
3835 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3836 void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3838 /* fix up our card entry */
3839 if(norm==VIDEO_MODE_NTSC) {
3840 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3841 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
3842 dprintk("bttv_tda9880_setnorm to NTSC\n");
3845 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3846 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
3847 dprintk("bttv_tda9880_setnorm to PAL\n");
3849 /* set GPIO according */
3850 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3851 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
3856 * reset/enable the MSP on some Hauppauge cards
3857 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3862 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3864 int mask = (1 << pin);
3866 gpio_inout(mask,mask);
3869 gpio_bits(mask,mask);
3872 bttv_gpio_tracking(btv,"msp34xx");
3874 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3875 "init [%d]\n", btv->c.nr, pin);
3878 static void __devinit boot_bt832(struct bttv *btv)
3882 /* ----------------------------------------------------------------------- */
3883 /* Imagenation L-Model PXC200 Framegrabber */
3884 /* This is basically the same procedure as
3885 * used by Alessandro Rubini in his pxc200
3886 * driver, but using BTTV functions */
3888 static void __devinit init_PXC200(struct bttv *btv)
3890 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3891 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3897 /* Initialise GPIO-connevted stuff */
3898 gpio_inout(0xffffff, (1<<13));
3902 /* GPIO inputs are pulled up, so no need to drive
3903 * reset pin any longer */
3904 gpio_bits(0xffffff, 0);
3906 bttv_gpio_tracking(btv,"pxc200");
3908 /* we could/should try and reset/control the AD pots? but
3909 right now we simply turned off the crushing. Without
3910 this the AGC drifts drifts
3911 remember the EN is reverse logic -->
3912 setting BT848_ADC_AGC_EN disable the AGC
3913 tboult@eecs.lehigh.edu
3916 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3918 /* Initialise MAX517 DAC */
3919 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3920 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3922 /* Initialise 12C508 PIC */
3923 /* The I2CWrite and I2CRead commmands are actually to the
3924 * same chips - but the R/W bit is included in the address
3925 * argument so the numbers are different */
3928 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3930 /* First of all, enable the clock line. This is used in the PXC200-F */
3931 val = btread(BT848_GPIO_DMA_CTL);
3932 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3933 btwrite(val, BT848_GPIO_DMA_CTL);
3935 /* Then, push to 0 the reset pin long enough to reset the *
3936 * device same as above for the reset line, but not the same
3937 * value sent to the GPIO-connected stuff
3938 * which one is the good one? */
3939 gpio_inout(0xffffff,(1<<2));
3944 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3945 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3948 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3949 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3953 printk(KERN_INFO "PXC200 Initialised.\n");
3958 /* ----------------------------------------------------------------------- */
3960 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3961 * it. This apparently involves the following procedure for each 878 chip:
3963 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3965 * 2) write to GPIO_DATA
3971 * read from GPIO_DATA into buf (uint_32)
3972 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3973 * error. ERROR_CPLD_Check_Failed stop.
3975 * 3) write to GPIO_DATA
3976 * - write 0x4400 + 0x0E
3978 * - write 0x4410 + 0x0E
3981 * read from GPIO_DATA into buf (uint_32)
3982 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
3983 * error. ERROR_CPLD_Check_Failed.
3985 /* ----------------------------------------------------------------------- */
3987 init_RTV24 (struct bttv *btv)
3989 uint32_t dataRead = 0;
3990 long watchdog_value = 0x0E;
3993 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
3996 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
3998 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4000 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4002 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4004 dataRead = btread (BT848_GPIO_DATA);
4006 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4008 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4009 btv->c.nr, dataRead);
4012 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4014 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4016 btwrite (watchdog_value, BT848_GPIO_DATA);
4018 dataRead = btread (BT848_GPIO_DATA);
4020 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4022 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4023 btv->c.nr, dataRead);
4029 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4034 /* ----------------------------------------------------------------------- */
4035 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4037 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4038 * This code is placed under the terms of the GNU General Public License
4040 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4043 static void bus_low(struct bttv *btv, int bit)
4045 if (btv->mbox_ior) {
4046 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4047 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4054 if (btv->mbox_ior) {
4055 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4060 static void bus_high(struct bttv *btv, int bit)
4062 if (btv->mbox_ior) {
4063 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4064 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4071 if (btv->mbox_ior) {
4072 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4077 static int bus_in(struct bttv *btv, int bit)
4079 if (btv->mbox_ior) {
4080 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4081 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4084 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4087 return gpio_read() & (bit);
4090 /* TEA5757 register bits */
4091 #define TEA_FREQ 0:14
4092 #define TEA_BUFFER 15:15
4094 #define TEA_SIGNAL_STRENGTH 16:17
4096 #define TEA_PORT1 18:18
4097 #define TEA_PORT0 19:19
4099 #define TEA_BAND 20:21
4100 #define TEA_BAND_FM 0
4101 #define TEA_BAND_MW 1
4102 #define TEA_BAND_LW 2
4103 #define TEA_BAND_SW 3
4105 #define TEA_MONO 22:22
4106 #define TEA_ALLOW_STEREO 0
4107 #define TEA_FORCE_MONO 1
4109 #define TEA_SEARCH_DIRECTION 23:23
4110 #define TEA_SEARCH_DOWN 0
4111 #define TEA_SEARCH_UP 1
4113 #define TEA_STATUS 24:24
4114 #define TEA_STATUS_TUNED 0
4115 #define TEA_STATUS_SEARCHING 1
4117 /* Low-level stuff */
4118 static int tea5757_read(struct bttv *btv)
4120 unsigned long timeout;
4124 /* better safe than sorry */
4125 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4127 if (btv->mbox_ior) {
4128 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4129 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4134 bttv_gpio_tracking(btv,"tea5757 read");
4136 bus_low(btv,btv->mbox_we);
4137 bus_low(btv,btv->mbox_clk);
4140 timeout= jiffies + HZ;
4142 /* wait for DATA line to go low; error if it doesn't */
4143 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4145 if (bus_in(btv,btv->mbox_data)) {
4146 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4150 dprintk("bttv%d: tea5757:",btv->c.nr);
4151 for(i = 0; i < 24; i++)
4154 bus_high(btv,btv->mbox_clk);
4156 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4157 bus_low(btv,btv->mbox_clk);
4159 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4160 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4162 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4166 static int tea5757_write(struct bttv *btv, int value)
4171 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4173 if (btv->mbox_ior) {
4174 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4175 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4179 bttv_gpio_tracking(btv,"tea5757 write");
4181 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4182 bus_low(btv,btv->mbox_clk);
4183 bus_high(btv,btv->mbox_we);
4184 for(i = 0; i < 25; i++)
4186 if (reg & 0x1000000)
4187 bus_high(btv,btv->mbox_data);
4189 bus_low(btv,btv->mbox_data);
4191 bus_high(btv,btv->mbox_clk);
4193 bus_low(btv,btv->mbox_clk);
4196 bus_low(btv,btv->mbox_we); /* unmute !!! */
4200 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4202 dprintk("tea5757_set_freq %d\n",freq);
4203 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4207 /* ----------------------------------------------------------------------- */
4210 static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4212 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4213 int bits_out, loops, vol, data;
4216 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4217 v->flags |= VIDEO_AUDIO_VOLUME;
4221 /* 32 levels logarithmic */
4222 vol = 32 - ((v->volume>>11));
4224 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4226 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4227 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4229 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4230 WINVIEW_PT2254_STROBE);
4231 for (loops = 17; loops >= 0 ; loops--) {
4232 if (bits_out & (1<<loops))
4233 data |= WINVIEW_PT2254_DATA;
4235 data &= ~WINVIEW_PT2254_DATA;
4238 data |= WINVIEW_PT2254_CLK;
4241 data &= ~WINVIEW_PT2254_CLK;
4244 data |= WINVIEW_PT2254_STROBE;
4245 data &= ~WINVIEW_PT2254_DATA;
4248 data &= ~WINVIEW_PT2254_STROBE;
4252 /* ----------------------------------------------------------------------- */
4253 /* mono/stereo control for various cards (which don't use i2c chips but */
4254 /* connect something to the GPIO pins */
4257 gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4259 unsigned int con = 0;
4262 gpio_inout(0x300, 0x300);
4263 if (v->mode & VIDEO_SOUND_LANG1)
4265 if (v->mode & VIDEO_SOUND_LANG2)
4267 if (v->mode & VIDEO_SOUND_STEREO)
4269 /* if (v->mode & VIDEO_SOUND_MONO)
4271 gpio_bits(0x300, con);
4273 v->mode = VIDEO_SOUND_STEREO |
4274 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4279 gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4281 unsigned int val, con;
4283 if (btv->radio_user)
4289 if (v->mode & VIDEO_SOUND_LANG2) {
4290 if (v->mode & VIDEO_SOUND_LANG1) {
4299 if (con != (val & 0x300)) {
4300 gpio_bits(0x300, con);
4302 bttv_gpio_tracking(btv,"gvbctv5pci");
4305 switch (val & 0x70) {
4307 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4310 v->mode = VIDEO_SOUND_LANG2;
4313 v->mode = VIDEO_SOUND_LANG1;
4316 v->mode = VIDEO_SOUND_STEREO;
4319 v->mode = VIDEO_SOUND_MONO;
4322 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4323 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4329 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4330 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4331 * 0xdde enables mono and 0xccd enables sap
4333 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4334 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4335 * input/output sound connection, so both must be set for output mode.
4337 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4338 * handles this with a tda9840
4342 avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4347 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4349 if (v->mode & VIDEO_SOUND_STEREO)
4352 gpio_bits(0x03,val);
4354 bttv_gpio_tracking(btv,"avermedia");
4357 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4364 avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4369 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4371 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4373 btaor(val, ~0x03, BT848_GPIO_DATA);
4375 bttv_gpio_tracking(btv,"avermedia");
4377 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4378 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4383 /* Lifetec 9415 handling */
4385 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4389 if (gpio_read() & 0x4000) {
4390 v->mode = VIDEO_SOUND_MONO;
4395 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4397 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4399 if ((v->mode & VIDEO_SOUND_LANG1) ||
4400 (v->mode & VIDEO_SOUND_MONO))
4402 gpio_bits(0x0880, val);
4404 bttv_gpio_tracking(btv,"lt9415");
4406 /* autodetect doesn't work with this card :-( */
4407 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4408 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4413 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4415 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4417 unsigned int con = 0;
4420 gpio_inout(0x180000,0x180000);
4421 if (v->mode & VIDEO_SOUND_LANG2)
4423 if (v->mode & VIDEO_SOUND_STEREO)
4425 gpio_bits(0x180000, con);
4427 bttv_gpio_tracking(btv,"terratv");
4429 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4430 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4435 winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4437 unsigned long val = 0;
4440 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4441 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4443 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4445 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4447 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4450 gpio_bits(0x430000, val);
4452 bttv_gpio_tracking(btv,"winfast2000");
4455 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4456 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4461 * Dariusz Kowalewski <darekk@automex.pl>
4462 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4463 * revision 9B has on-board TDA9874A sound decoder).
4465 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4466 * will mute this cards.
4469 pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4471 unsigned int val = 0;
4473 if (btv->radio_user)
4477 if (v->mode & VIDEO_SOUND_MONO) {
4480 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4481 || (v->mode & VIDEO_SOUND_STEREO)) {
4485 gpio_bits(0x03,val);
4487 bttv_gpio_tracking(btv,"pvbt878p9b");
4490 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4491 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4496 * Dariusz Kowalewski <darekk@automex.pl>
4497 * sound control for FlyVideo 2000S (with tda9874 decoder)
4498 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4501 fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4503 unsigned int val = 0xffff;
4505 if (btv->radio_user)
4508 if (v->mode & VIDEO_SOUND_MONO) {
4511 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4512 || (v->mode & VIDEO_SOUND_STEREO)) {
4513 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4515 if (val != 0xffff) {
4516 gpio_bits(0x1800, val);
4518 bttv_gpio_tracking(btv,"fv2000s");
4521 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4522 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4527 * sound control for Canopus WinDVR PCI
4528 * Masaki Suzuki <masaki@btree.org>
4531 windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4533 unsigned long val = 0;
4536 if (v->mode & VIDEO_SOUND_MONO)
4538 if (v->mode & VIDEO_SOUND_LANG1)
4540 if (v->mode & VIDEO_SOUND_LANG2)
4542 if (v->mode & VIDEO_SOUND_STEREO)
4545 gpio_bits(0x140000, val);
4547 bttv_gpio_tracking(btv,"windvr");
4550 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4551 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4556 * sound control for AD-TVK503
4557 * Hiroshi Takekawa <sian@big.or.jp>
4560 adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4562 unsigned int con = 0xffffff;
4564 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4567 /* btor(***, BT848_GPIO_OUT_EN); */
4568 if (v->mode & VIDEO_SOUND_LANG1)
4570 if (v->mode & VIDEO_SOUND_LANG2)
4572 if (v->mode & VIDEO_SOUND_STEREO)
4574 if (v->mode & VIDEO_SOUND_MONO)
4576 if (con != 0xffffff) {
4577 gpio_bits(0x1e0000,con);
4579 bttv_gpio_tracking(btv, "adtvk503");
4582 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4583 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4587 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4589 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4590 * switch instead (CD22M3494E). This IC can have multiple active connections
4591 * between Xn (input) and Yn (output) pins. We need to clear any existing
4592 * connection prior to establish a new one, pulsing the STROBE pin.
4594 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4595 * GPIO pins are wired as:
4596 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4597 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4598 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4599 * GPIO[8] - - P3[5] (microcontroler)
4600 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4601 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4602 * GPINTR - - P3[4] (microcontroler)
4604 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4605 * configuration either directly (as we are doing) or using the microcontroler
4606 * which is also wired to I2C interface. I have no further info on the
4607 * microcontroler features, one would need to disassembly the firmware.
4608 * note: the vendor refused to give any information on this product, all
4609 * that stuff was found using a multimeter! :)
4611 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4613 /* reset all conections */
4614 gpio_bits(0x200,0x200);
4616 gpio_bits(0x200,0x000);
4619 /* create a new conection */
4620 gpio_bits(0x480,0x080);
4621 gpio_bits(0x480,0x480);
4623 gpio_bits(0x480,0x080);
4627 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4629 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4630 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4631 * chips, ten eight input analog multiplexors, a not chip and a few
4634 * 16 inputs on a secondary bracket are provided and can be selected
4635 * from each of the four capture chips. Two of the eight input
4636 * multiplexors are used to select from any of the 16 input signals.
4638 * Unsupported hardware capabilities:
4639 * . A video output monitor on the secondary bracket can be selected from
4640 * one of the 878A chips.
4641 * . Another passthrough but I haven't spent any time investigating it.
4642 * . Digital I/O (logic level connected to GPIO) is available from an
4645 * The on chip input mux should always be set to 2.
4646 * GPIO[16:19] - Video input selection
4647 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4648 * GPIO[?:?] - Digital I/O.
4650 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4651 * determined what function (if any) it provides. With the microcontroller
4652 * and sync seperator chips a guess is that it might have to do with video
4653 * switching and maybe some digital I/O.
4655 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4658 gpio_bits(0x0f0000, input << 16);
4661 static void tibetCS16_init(struct bttv *btv)
4663 /* enable gpio bits, mask obtained via btSpy */
4664 gpio_inout(0xffffff, 0x0f7fff);
4665 gpio_write(0x0f7fff);
4669 * The following routines for the Kodicom-4400r get a little mind-twisting.
4670 * There is a "master" controller and three "slave" controllers, together
4671 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4672 * The analog switch is controlled by the "master", but the detection order
4673 * of the four BT878A chips is in an order which I just don't understand.
4674 * The "master" is actually the second controller to be detected. The
4675 * logic on the board uses logical numbers for the 4 controlers, but
4676 * those numbers are different from the detection sequence. When working
4677 * with the analog switch, we need to "map" from the detection sequence
4678 * over to the board's logical controller number. This mapping sequence
4679 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4680 * unit 3, the second (which is the master) is logical unit 0, etc.
4681 * We need to maintain the status of the analog switch (which of the 16
4682 * cameras is connected to which of the 4 controllers). Rather than
4683 * add to the bttv structure for this, we use the data reserved for
4684 * the mbox (unused for this card type).
4688 * First a routine to set the analog switch, which controls which camera
4689 * is routed to which controller. The switch comprises an X-address
4690 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4691 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4692 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4693 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4694 * specified address. The idea is to set the address and data, then bring
4695 * STROBE high, and finally bring STROBE back to low.
4697 static void kodicom4400r_write(struct bttv *btv,
4698 unsigned char xaddr,
4699 unsigned char yaddr,
4700 unsigned char data) {
4703 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4704 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4705 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4706 gpio_bits(0x1ff, udata); /* strobe low */
4710 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4711 * use this routine. The routine finds the "master" for the card, maps
4712 * the controller number from the detected position over to the logical
4713 * number, writes the appropriate data to the analog switch, and housekeeps
4714 * the local copy of the switch information. The parameter 'input' is the
4715 * requested camera number (0 - 15).
4717 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4722 static unsigned char map[4] = {3, 0, 2, 1};
4724 mctlr = master[btv->c.nr];
4725 if (mctlr == NULL) { /* ignore if master not yet detected */
4728 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4730 sw_status = (char *)(&mctlr->mbox_we);
4731 xaddr = input & 0xf;
4732 /* Check if the controller/camera pair has changed, else ignore */
4733 if (sw_status[yaddr] != xaddr)
4735 /* "open" the old switch, "close" the new one, save the new */
4736 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4737 sw_status[yaddr] = xaddr;
4738 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4743 * During initialisation, we need to reset the analog switch. We
4744 * also preset the switch to map the 4 connectors on the card to the
4745 * *user's* (see above description of kodicom4400r_muxsel) channels
4748 static void kodicom4400r_init(struct bttv *btv)
4750 char *sw_status = (char *)(&btv->mbox_we);
4753 gpio_inout(0x0003ff, 0x0003ff);
4754 gpio_write(1 << 9); /* reset MUX */
4756 /* Preset camera 0 to the 4 controllers */
4757 for (ix=0; ix<4; ix++) {
4759 kodicom4400r_write(btv, ix, ix, 1);
4762 * Since this is the "master", we need to set up the
4763 * other three controller chips' pointers to this structure
4764 * for later use in the muxsel routine.
4766 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4768 master[btv->c.nr-1] = btv;
4769 master[btv->c.nr] = btv;
4770 master[btv->c.nr+1] = btv;
4771 master[btv->c.nr+2] = btv;
4774 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4775 * video multiplexers to provide up to 16 video inputs. These
4776 * multiplexers are controlled by the lower 8 GPIO pins of the
4777 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4779 * xxx0 is pin xxx of multiplexer U5,
4780 * yyy1 is pin yyy of multiplexer U2
4792 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4794 static const int masks[] = {
4795 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4796 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4797 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4798 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4800 gpio_write(masks[input%16]);
4802 static void picolo_tetra_init(struct bttv *btv)
4804 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4805 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4806 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4808 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4811 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4812 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4813 /*GPIO[20]&GPIO[21] used to choose the right input*/
4814 btwrite (input<<20,BT848_GPIO_DATA);
4819 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4821 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4822 * swichers to provide 16 channels to MUX0. The TDA8540's have
4823 * 4 independent outputs and as such the IVC120G also has the
4824 * optional "Monitor Out" bus. This allows the card to be looking
4825 * at one input while the monitor is looking at another.
4827 * Since I've couldn't be bothered figuring out how to add an
4828 * independant muxsel for the monitor bus, I've just set it to
4829 * whatever the card is looking at.
4831 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4832 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4834 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4835 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4836 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4837 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4841 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4842 #define I2C_TDA8540 0x90
4843 #define I2C_TDA8540_ALT1 0x92
4844 #define I2C_TDA8540_ALT2 0x94
4845 #define I2C_TDA8540_ALT3 0x96
4846 #define I2C_TDA8540_ALT4 0x98
4847 #define I2C_TDA8540_ALT5 0x9a
4848 #define I2C_TDA8540_ALT6 0x9c
4850 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4853 int key = input % 4;
4854 int matrix = input / 4;
4856 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4857 btv->c.nr, input, matrix, key);
4859 /* Handles the input selection on the TDA8540's */
4860 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4861 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4862 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4863 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4864 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4865 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4866 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4867 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4869 /* Handles the output enables on the TDA8540's */
4870 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4871 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4872 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4873 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4874 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4875 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4876 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4877 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4879 /* Selects MUX0 for input on the 878 */
4880 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4884 /* PXC200 muxsel helper
4885 * luke@syseng.anu.edu.au
4886 * another transplant
4887 * from Alessandro Rubini (rubini@linux.it)
4889 * There are 4 kinds of cards:
4890 * PXC200L which is bt848
4891 * PXC200F which is bt848 with PIC controlling mux
4892 * PXC200AL which is bt878
4893 * PXC200AF which is bt878 with PIC controlling mux
4895 #define PX_CFG_PXC200F 0x01
4896 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4897 #define PX_I2C_PIC 0x0f
4898 #define PX_PXC200A_CARDID 0x200a1295
4899 #define PX_I2C_CMD_CFG 0x00
4901 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4906 unsigned char buf[2];
4908 /* Read PIC config to determine if this is a PXC200F */
4912 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4914 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4915 /* not PXC ? do nothing */
4919 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4920 if (!(rc & PX_CFG_PXC200F)) {
4921 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4926 /* The multiplexer in the 200F is handled by the GPIO port */
4927 /* get correct mapping between inputs */
4928 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4929 /* ** not needed!? */
4932 /* make sure output pins are enabled */
4933 /* bitmask=0x30f; */
4935 /* check whether we have a PXC200A */
4936 if (btv->cardid == PX_PXC200A_CARDID) {
4937 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4938 bitmask |= 7<<4; /* the DAC */
4940 btwrite(bitmask, BT848_GPIO_OUT_EN);
4942 bitmask = btread(BT848_GPIO_DATA);
4943 if (btv->cardid == PX_PXC200A_CARDID)
4944 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4945 else /* older device */
4946 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4947 btwrite(bitmask,BT848_GPIO_DATA);
4950 * Was "to be safe, set the bt848 to input 0"
4951 * Actually, since it's ok at load time, better not messing
4952 * with these bits (on PXC200AF you need to set mux 2 here)
4954 * needed because bttv-driver sets mux before calling this function
4956 if (btv->cardid == PX_PXC200A_CARDID)
4957 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4958 else /* older device */
4959 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4961 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4964 /* ----------------------------------------------------------------------- */
4965 /* motherboard chipset specific stuff */
4967 void __devinit bttv_check_chipset(void)
4969 int pcipci_fail = 0;
4970 struct pci_dev *dev = NULL;
4972 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4974 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4976 if (pci_pci_problems & PCIPCI_VSFX)
4978 #ifdef PCIPCI_ALIMAGIK
4979 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4984 /* print warnings about any quirks found */
4986 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4988 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4990 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4993 printk(KERN_INFO "bttv: overlay will be disabled.\n");
4996 printk(KERN_INFO "bttv: overlay forced. Use this "
4997 "option at your own risk.\n");
5000 if (UNSET != latency)
5001 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
5002 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
5003 PCI_DEVICE_ID_INTEL_82441, dev))) {
5005 pci_read_config_byte(dev, 0x53, &b);
5007 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5008 "bufcon=0x%02x\n",b);
5012 int __devinit bttv_handle_chipset(struct bttv *btv)
5014 unsigned char command;
5016 if (!triton1 && !vsfx && UNSET == latency)
5021 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5022 if (vsfx && btv->id >= 878)
5023 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5024 if (UNSET != latency)
5025 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5029 if (btv->id < 878) {
5030 /* bt848 (mis)uses a bit in the irq mask for etbf */
5032 btv->triton1 = BT848_INT_ETBF;
5034 /* bt878 has a bit in the pci config space for it */
5035 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
5037 command |= BT878_EN_TBFX;
5039 command |= BT878_EN_VSFX;
5040 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5042 if (UNSET != latency)
5043 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);