5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/config.h>
29 #include <linux/delay.h>
30 #include <linux/module.h>
31 #include <linux/moduleparam.h>
32 #include <linux/kmod.h>
33 #include <linux/init.h>
34 #include <linux/pci.h>
35 #include <linux/vmalloc.h>
36 #include <linux/firmware.h>
41 #include <media/v4l2-common.h>
42 #include <media/tvaudio.h>
45 static void boot_msp34xx(struct bttv *btv, int pin);
46 static void boot_bt832(struct bttv *btv);
47 static void hauppauge_eeprom(struct bttv *btv);
48 static void avermedia_eeprom(struct bttv *btv);
49 static void osprey_eeprom(struct bttv *btv);
50 static void modtec_eeprom(struct bttv *btv);
51 static void init_PXC200(struct bttv *btv);
52 static void init_RTV24(struct bttv *btv);
54 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
55 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
56 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
58 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
60 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
67 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
68 static void rv605_muxsel(struct bttv *btv, unsigned int input);
69 static void eagle_muxsel(struct bttv *btv, unsigned int input);
70 static void xguard_muxsel(struct bttv *btv, unsigned int input);
71 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
72 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
74 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
76 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
77 static void picolo_tetra_init(struct bttv *btv);
79 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
80 static void tibetCS16_init(struct bttv *btv);
82 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
83 static void kodicom4400r_init(struct bttv *btv);
85 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
86 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
88 static int terratec_active_radio_upgrade(struct bttv *btv);
89 static int tea5757_read(struct bttv *btv);
90 static int tea5757_write(struct bttv *btv, int value);
91 static void identify_by_eeprom(struct bttv *btv,
92 unsigned char eeprom_data[256]);
93 static int __devinit pvr_boot(struct bttv *btv);
95 /* config variables */
96 static unsigned int triton1;
97 static unsigned int vsfx;
98 static unsigned int latency = UNSET;
101 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
106 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
108 static unsigned int autoload = 1;
110 static unsigned int autoload;
112 static unsigned int gpiomask = UNSET;
113 static unsigned int audioall = UNSET;
114 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
117 module_param(triton1, int, 0444);
118 module_param(vsfx, int, 0444);
119 module_param(no_overlay, int, 0444);
120 module_param(latency, int, 0444);
121 module_param(gpiomask, int, 0444);
122 module_param(audioall, int, 0444);
123 module_param(autoload, int, 0444);
125 module_param_array(card, int, NULL, 0444);
126 module_param_array(pll, int, NULL, 0444);
127 module_param_array(tuner, int, NULL, 0444);
128 module_param_array(svhs, int, NULL, 0444);
129 module_param_array(remote, int, NULL, 0444);
130 module_param_array(audiomux, int, NULL, 0444);
132 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
133 "[enable bug compatibility for triton1 + others]");
134 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
135 "[yet another chipset flaw workaround]");
136 MODULE_PARM_DESC(latency,"pci latency timer");
137 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
138 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
139 MODULE_PARM_DESC(tuner,"specify installed tuner type");
140 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
141 MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
142 " [some VIA/SIS chipsets are known to have problem with overlay]");
144 /* ----------------------------------------------------------------------- */
145 /* list of card IDs for bt878+ cards */
151 } cards[] __devinitdata = {
152 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
153 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
154 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
155 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
156 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
157 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
158 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
159 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
160 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
162 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
163 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
165 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
166 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
167 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
168 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
170 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
171 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
172 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
173 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
175 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
176 /* some cards ship with byteswapped IDs ... */
177 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
179 /* this seems to happen as well ... */
180 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
182 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
184 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
186 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
187 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
188 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
189 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
190 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
191 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
192 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
194 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
196 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
197 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
198 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
200 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
201 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
202 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
203 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
205 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
206 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
207 /* clashes with FlyVideo
208 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
209 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
210 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
211 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
212 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
214 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
220 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
221 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
222 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
223 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
224 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
226 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
227 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
228 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
229 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
231 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
232 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
233 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
234 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
236 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
237 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
263 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
265 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
267 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
268 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
269 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
270 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
272 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
273 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
275 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
276 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
278 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
279 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
280 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
281 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
282 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
283 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
285 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
286 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
288 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
289 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
290 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
291 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
293 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
295 /* likely broken, vendor id doesn't match the other magic views ...
296 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
298 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
299 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
301 /* DVB cards (using pci function .1 for mpeg data xfer) */
302 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
303 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
304 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
305 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
306 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
307 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
308 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
309 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
310 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
311 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
312 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
317 /* ----------------------------------------------------------------------- */
318 /* array with description for bt848 / bt878 tv/grabber cards */
320 struct tvcard bttv_tvcards[] = {
321 /* ---- card 0x00 ---------------------------------- */
322 [BTTV_BOARD_UNKNOWN] = {
323 .name = " *** UNKNOWN/GENERIC *** ",
328 .muxsel = { 2, 3, 1, 0 },
330 .tuner_addr = ADDR_UNSET,
331 .radio_addr = ADDR_UNSET,
333 [BTTV_BOARD_MIRO] = {
340 .muxsel = { 2, 3, 1, 1 },
341 .gpiomux = { 2, 0, 0, 0 },
345 .tuner_addr = ADDR_UNSET,
346 .radio_addr = ADDR_UNSET,
348 [BTTV_BOARD_HAUPPAUGE] = {
349 .name = "Hauppauge (bt848)",
355 .muxsel = { 2, 3, 1, 1 },
356 .gpiomux = { 0, 1, 2, 3 },
360 .tuner_addr = ADDR_UNSET,
361 .radio_addr = ADDR_UNSET,
364 .name = "STB, Gateway P/N 6000699 (bt848)",
370 .muxsel = { 2, 3, 1, 1 },
371 .gpiomux = { 4, 0, 2, 3 },
375 .tuner_type = TUNER_PHILIPS_NTSC,
376 .tuner_addr = ADDR_UNSET,
377 .radio_addr = ADDR_UNSET,
382 /* ---- card 0x04 ---------------------------------- */
383 [BTTV_BOARD_INTEL] = {
384 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
390 .muxsel = { 2, 3, 1, 1 },
394 .tuner_addr = ADDR_UNSET,
395 .radio_addr = ADDR_UNSET,
397 [BTTV_BOARD_DIAMOND] = {
398 .name = "Diamond DTV2000",
404 .muxsel = { 2, 3, 1, 0 },
405 .gpiomux = { 0, 1, 0, 1 },
409 .tuner_addr = ADDR_UNSET,
410 .radio_addr = ADDR_UNSET,
412 [BTTV_BOARD_AVERMEDIA] = {
413 .name = "AVerMedia TVPhone",
418 .muxsel = { 2, 3, 1, 1 },
420 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
421 /* 0x04 for some cards ?? */
424 .tuner_addr = ADDR_UNSET,
425 .radio_addr = ADDR_UNSET,
426 .audio_hook = avermedia_tvphone_audio,
429 [BTTV_BOARD_MATRIX_VISION] = {
430 .name = "MATRIX-Vision MV-Delta",
436 .muxsel = { 2, 3, 1, 0, 0 },
440 .tuner_addr = ADDR_UNSET,
441 .radio_addr = ADDR_UNSET,
444 /* ---- card 0x08 ---------------------------------- */
445 [BTTV_BOARD_FLYVIDEO] = {
446 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
452 .muxsel = { 2, 3, 1, 1 },
453 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
458 .tuner_addr = ADDR_UNSET,
459 .radio_addr = ADDR_UNSET,
461 [BTTV_BOARD_TURBOTV] = {
462 .name = "IMS/IXmicro TurboTV",
468 .muxsel = { 2, 3, 1, 1 },
469 .gpiomux = { 1, 1, 2, 3 },
472 .tuner_type = TUNER_TEMIC_PAL,
473 .tuner_addr = ADDR_UNSET,
474 .radio_addr = ADDR_UNSET,
476 [BTTV_BOARD_HAUPPAUGE878] = {
477 .name = "Hauppauge (bt878)",
482 .gpiomask = 0x0f, /* old: 7 */
483 .muxsel = { 2, 0, 1, 1 },
484 .gpiomux = { 0, 1, 2, 3 },
489 .tuner_addr = ADDR_UNSET,
490 .radio_addr = ADDR_UNSET,
492 [BTTV_BOARD_MIROPRO] = {
493 .name = "MIRO PCTV pro",
499 .muxsel = { 2, 3, 1, 1 },
500 .gpiomux = { 0x20001,0x10001, 0, 0 },
504 .tuner_addr = ADDR_UNSET,
505 .radio_addr = ADDR_UNSET,
508 /* ---- card 0x0c ---------------------------------- */
509 [BTTV_BOARD_ADSTECH_TV] = {
510 .name = "ADS Technologies Channel Surfer TV (bt848)",
516 .muxsel = { 2, 3, 1, 1 },
517 .gpiomux = { 13, 14, 11, 7 },
520 .tuner_addr = ADDR_UNSET,
521 .radio_addr = ADDR_UNSET,
523 [BTTV_BOARD_AVERMEDIA98] = {
524 .name = "AVerMedia TVCapture 98",
530 .muxsel = { 2, 3, 1, 1 },
531 .gpiomux = { 13, 14, 11, 7 },
535 .tuner_type = TUNER_PHILIPS_PAL,
536 .tuner_addr = ADDR_UNSET,
537 .radio_addr = ADDR_UNSET,
538 .audio_hook = avermedia_tv_stereo_audio,
542 .name = "Aimslab Video Highway Xtreme (VHX)",
548 .muxsel = { 2, 3, 1, 1 },
549 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
554 .tuner_addr = ADDR_UNSET,
555 .radio_addr = ADDR_UNSET,
557 [BTTV_BOARD_ZOLTRIX] = {
558 .name = "Zoltrix TV-Max",
564 .muxsel = { 2, 3, 1, 1 },
565 .gpiomux = { 0, 0, 1, 0 },
569 .tuner_addr = ADDR_UNSET,
570 .radio_addr = ADDR_UNSET,
573 /* ---- card 0x10 ---------------------------------- */
574 [BTTV_BOARD_PIXVIEWPLAYTV] = {
575 .name = "Prolink Pixelview PlayTV (bt878)",
580 .gpiomask = 0x01fe00,
581 .muxsel = { 2, 3, 1, 1 },
584 .gpiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000 },
586 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
587 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
588 .gpiomute = 0x002000,
594 [BTTV_BOARD_WINVIEW_601] = {
595 .name = "Leadtek WinView 601",
600 .gpiomask = 0x8300f8,
601 .muxsel = { 2, 3, 1, 1,0 },
602 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
603 .gpiomute = 0xcfa007,
606 .tuner_addr = ADDR_UNSET,
607 .radio_addr = ADDR_UNSET,
608 .audio_hook = winview_audio,
611 [BTTV_BOARD_AVEC_INTERCAP] = {
612 .name = "AVEC Intercapture",
618 .muxsel = { 2, 3, 1, 1 },
619 .gpiomux = { 1, 0, 0, 0 },
622 .tuner_addr = ADDR_UNSET,
623 .radio_addr = ADDR_UNSET,
625 [BTTV_BOARD_LIFE_FLYKIT] = {
626 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
631 .gpiomask = 0x8dff00,
632 .muxsel = { 2, 3, 1, 1 },
636 .tuner_addr = ADDR_UNSET,
637 .radio_addr = ADDR_UNSET,
640 /* ---- card 0x14 ---------------------------------- */
641 [BTTV_BOARD_CEI_RAFFLES] = {
642 .name = "CEI Raffles Card",
647 .muxsel = { 2, 3, 1, 1 },
649 .tuner_addr = ADDR_UNSET,
650 .radio_addr = ADDR_UNSET,
652 [BTTV_BOARD_CONFERENCETV] = {
653 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
655 .audio_inputs = 2, /* tuner, line in */
659 .muxsel = { 2, 3, 1, 1 },
660 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
663 .tuner_type = TUNER_PHILIPS_PAL_I,
664 .tuner_addr = ADDR_UNSET,
665 .radio_addr = ADDR_UNSET,
667 [BTTV_BOARD_PHOEBE_TVMAS] = {
668 .name = "Askey CPH050/ Phoebe Tv Master + FM",
674 .muxsel = { 2, 3, 1, 1 },
675 .gpiomux = { 0, 1, 0x800, 0x400 },
680 .tuner_addr = ADDR_UNSET,
681 .radio_addr = ADDR_UNSET,
683 [BTTV_BOARD_MODTEC_205] = {
684 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
690 .muxsel = { 2, 3, -1 },
691 .digital_mode = DIGITAL_MODE_CAMERA,
692 .gpiomux = { 0, 0, 0, 0 },
695 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
696 .tuner_addr = ADDR_UNSET,
697 .radio_addr = ADDR_UNSET,
700 /* ---- card 0x18 ---------------------------------- */
701 [BTTV_BOARD_MAGICTVIEW061] = {
702 .name = "Askey CPH05X/06X (bt878) [many vendors]",
708 .muxsel = { 2, 3, 1, 1 },
709 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
714 .tuner_addr = ADDR_UNSET,
715 .radio_addr = ADDR_UNSET,
718 [BTTV_BOARD_VOBIS_BOOSTAR] = {
719 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
724 .gpiomask = 0x1f0fff,
725 .muxsel = { 2, 3, 1, 1 },
726 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
729 .tuner_type = TUNER_PHILIPS_PAL,
730 .tuner_addr = ADDR_UNSET,
731 .radio_addr = ADDR_UNSET,
732 .audio_hook = terratv_audio,
734 [BTTV_BOARD_HAUPPAUG_WCAM] = {
735 .name = "Hauppauge WinCam newer (bt878)",
741 .muxsel = { 2, 0, 1, 1 },
742 .gpiomux = { 0, 1, 2, 3 },
746 .tuner_addr = ADDR_UNSET,
747 .radio_addr = ADDR_UNSET,
749 [BTTV_BOARD_MAXI] = {
750 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
756 .muxsel = { 2, 3, 1, 1 },
757 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
760 .tuner_type = TUNER_PHILIPS_SECAM,
761 .tuner_addr = ADDR_UNSET,
762 .radio_addr = ADDR_UNSET,
765 /* ---- card 0x1c ---------------------------------- */
766 [BTTV_BOARD_TERRATV] = {
767 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
772 .gpiomask = 0x1f0fff,
773 .muxsel = { 2, 3, 1, 1 },
774 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
777 .tuner_type = TUNER_PHILIPS_PAL,
778 .tuner_addr = ADDR_UNSET,
779 .radio_addr = ADDR_UNSET,
780 .audio_hook = terratv_audio,
782 External 20 pin connector (for Active Radio Upgrade board)
788 gpio05: om5610-stereo
792 gpio09+10: nIOR, nSEL ?? (bt878)
796 gpio16: u2-A0 (1st 4052bt)
799 gpio19: u4-A0 (2nd 4052)
803 00000 : Cdrom (internal audio input)
804 10000 : ext. Video audio input
813 [BTTV_BOARD_PXC200] = {
814 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
815 .name = "Imagenation PXC200",
819 .svhs = 1, /* was: 4 */
821 .muxsel = { 2, 3, 1, 0, 0},
825 .tuner_addr = ADDR_UNSET,
826 .radio_addr = ADDR_UNSET,
827 .muxsel_hook = PXC200_muxsel,
830 [BTTV_BOARD_FLYVIDEO_98] = {
831 .name = "Lifeview FlyVideo 98 LR50",
836 .gpiomask = 0x1800, /* 0x8dfe00 */
837 .muxsel = { 2, 3, 1, 1 },
838 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
842 .tuner_addr = ADDR_UNSET,
843 .radio_addr = ADDR_UNSET,
845 [BTTV_BOARD_IPROTV] = {
846 .name = "Formac iProTV, Formac ProTV I (bt848)",
852 .muxsel = { 2, 3, 1, 1 },
853 .gpiomux = { 1, 0, 0, 0 },
855 .tuner_type = TUNER_PHILIPS_PAL,
856 .tuner_addr = ADDR_UNSET,
857 .radio_addr = ADDR_UNSET,
860 /* ---- card 0x20 ---------------------------------- */
861 [BTTV_BOARD_INTEL_C_S_PCI] = {
862 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
868 .muxsel = { 2, 3, 1, 1 },
872 .tuner_addr = ADDR_UNSET,
873 .radio_addr = ADDR_UNSET,
875 [BTTV_BOARD_TERRATVALUE] = {
876 .name = "Terratec TerraTValue Version Bt878",
881 .gpiomask = 0xffff00,
882 .muxsel = { 2, 3, 1, 1 },
883 .gpiomux = { 0x500, 0, 0x300, 0x900 },
887 .tuner_type = TUNER_PHILIPS_PAL,
888 .tuner_addr = ADDR_UNSET,
889 .radio_addr = ADDR_UNSET,
891 [BTTV_BOARD_WINFAST2000] = {
892 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
897 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
899 .gpiomask = 0xc33000,
900 .gpiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
902 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
903 .gpiomask = 0xb33000,
904 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
905 .gpiomute = 0x800000,
907 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
908 gpio23 -- hef4052:nEnable (0x800000)
911 0x0000: external audio
915 Note: There exists another variant "Winfast 2000" with tv stereo !?
916 Note: eeprom only contains FF and pci subsystem id 107d:6606
921 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
922 .tuner_addr = ADDR_UNSET,
923 .radio_addr = ADDR_UNSET,
924 .audio_hook = winfast2000_audio,
927 [BTTV_BOARD_CHRONOS_VS2] = {
928 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
934 .muxsel = { 2, 3, 1, 1 },
935 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
939 .tuner_addr = ADDR_UNSET,
940 .radio_addr = ADDR_UNSET,
943 /* ---- card 0x24 ---------------------------------- */
944 [BTTV_BOARD_TYPHOON_TVIEW] = {
945 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
951 .muxsel = { 2, 3, 1, 1 },
952 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
956 .tuner_addr = ADDR_UNSET,
957 .radio_addr = ADDR_UNSET,
960 [BTTV_BOARD_PXELVWPLTVPRO] = {
961 .name = "Prolink PixelView PlayTV pro",
967 .muxsel = { 2, 3, 1, 1 },
968 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
973 .tuner_addr = ADDR_UNSET,
974 .radio_addr = ADDR_UNSET,
976 [BTTV_BOARD_MAGICTVIEW063] = {
977 .name = "Askey CPH06X TView99",
982 .gpiomask = 0x551e00,
983 .muxsel = { 2, 3, 1, 0 },
984 .gpiomux = { 0x551400, 0x551200, 0, 0 },
985 .gpiomute = 0x551c00,
989 .tuner_addr = ADDR_UNSET,
990 .radio_addr = ADDR_UNSET,
993 [BTTV_BOARD_PINNACLE] = {
994 .name = "Pinnacle PCTV Studio/Rave",
999 .gpiomask = 0x03000F,
1000 .muxsel = { 2, 3, 1, 1 },
1001 .gpiomux = { 2, 0xd0001, 0, 0 },
1006 .tuner_addr = ADDR_UNSET,
1007 .radio_addr = ADDR_UNSET,
1010 /* ---- card 0x28 ---------------------------------- */
1011 [BTTV_BOARD_STB2] = {
1012 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1018 .muxsel = { 2, 3, 1, 1 },
1019 .gpiomux = { 4, 0, 2, 3 },
1023 .tuner_type = TUNER_PHILIPS_NTSC,
1024 .tuner_addr = ADDR_UNSET,
1025 .radio_addr = ADDR_UNSET,
1029 [BTTV_BOARD_AVPHONE98] = {
1030 .name = "AVerMedia TVPhone 98",
1036 .muxsel = { 2, 3, 1, 1 },
1037 .gpiomux = { 13, 4, 11, 7 },
1041 .tuner_addr = ADDR_UNSET,
1042 .radio_addr = ADDR_UNSET,
1044 .audio_hook = avermedia_tvphone_audio,
1046 [BTTV_BOARD_PV951] = {
1047 .name = "ProVideo PV951", /* pic16c54 */
1053 .muxsel = { 2, 3, 1, 1},
1054 .gpiomux = { 0, 0, 0, 0},
1059 .tuner_addr = ADDR_UNSET,
1060 .radio_addr = ADDR_UNSET,
1062 [BTTV_BOARD_ONAIR_TV] = {
1063 .name = "Little OnAir TV",
1069 .muxsel = { 2, 3, 1, 1 },
1070 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1071 .gpiomute = 0xff3ffc,
1074 .tuner_addr = ADDR_UNSET,
1075 .radio_addr = ADDR_UNSET,
1078 /* ---- card 0x2c ---------------------------------- */
1079 [BTTV_BOARD_SIGMA_TVII_FM] = {
1080 .name = "Sigma TVII-FM",
1086 .muxsel = { 2, 3, 1, 1 },
1087 .gpiomux = { 1, 1, 0, 2 },
1092 .tuner_addr = ADDR_UNSET,
1093 .radio_addr = ADDR_UNSET,
1095 [BTTV_BOARD_MATRIX_VISION2] = {
1096 .name = "MATRIX-Vision MV-Delta 2",
1102 .muxsel = { 2, 3, 1, 0, 0 },
1107 .tuner_addr = ADDR_UNSET,
1108 .radio_addr = ADDR_UNSET,
1110 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1111 .name = "Zoltrix Genie TV/FM",
1116 .gpiomask = 0xbcf03f,
1117 .muxsel = { 2, 3, 1, 1 },
1118 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1119 .gpiomute = 0xbcb03f,
1123 .tuner_addr = ADDR_UNSET,
1124 .radio_addr = ADDR_UNSET,
1126 [BTTV_BOARD_TERRATVRADIO] = {
1127 .name = "Terratec TV/Radio+",
1132 .gpiomask = 0x70000,
1133 .muxsel = { 2, 3, 1, 1 },
1134 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1135 .gpiomute = 0x40000,
1140 .tuner_addr = ADDR_UNSET,
1141 .radio_addr = ADDR_UNSET,
1145 /* ---- card 0x30 ---------------------------------- */
1146 [BTTV_BOARD_DYNALINK] = {
1147 .name = "Askey CPH03x/ Dynalink Magic TView",
1153 .muxsel = { 2, 3, 1, 1 },
1154 .gpiomux = {2,0,0,0 },
1159 .tuner_addr = ADDR_UNSET,
1160 .radio_addr = ADDR_UNSET,
1162 [BTTV_BOARD_GVBCTV3PCI] = {
1163 .name = "IODATA GV-BCTV3/PCI",
1168 .gpiomask = 0x010f00,
1169 .muxsel = {2, 3, 0, 0 },
1170 .gpiomux = {0x10000, 0, 0x10000, 0 },
1173 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1174 .tuner_addr = ADDR_UNSET,
1175 .radio_addr = ADDR_UNSET,
1176 .audio_hook = gvbctv3pci_audio,
1178 [BTTV_BOARD_PXELVWPLTVPAK] = {
1179 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1184 .gpiomask = 0xAA0000,
1185 .muxsel = { 2,3,1,1,-1 },
1186 .digital_mode = DIGITAL_MODE_CAMERA,
1187 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1188 .gpiomute = 0xa8000,
1191 .tuner_type = TUNER_PHILIPS_PAL_I,
1192 .tuner_addr = ADDR_UNSET,
1193 .radio_addr = ADDR_UNSET,
1195 /* GPIO wiring: (different from Rev.4C !)
1196 GPIO17: U4.A0 (first hef4052bt)
1198 GPIO20: U5.A1 (second hef4052bt)
1200 GPIO22: BT832 Reset Line
1201 GPIO23: A5,A0, U5,nEN
1202 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1205 [BTTV_BOARD_EAGLE] = {
1206 .name = "Eagle Wireless Capricorn2 (bt878A)",
1212 .muxsel = { 2, 0, 1, 1 },
1213 .gpiomux = { 0, 1, 2, 3 },
1216 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1217 .tuner_addr = ADDR_UNSET,
1218 .radio_addr = ADDR_UNSET,
1221 /* ---- card 0x34 ---------------------------------- */
1222 [BTTV_BOARD_PINNACLEPRO] = {
1223 /* David Härdeman <david@2gen.com> */
1224 .name = "Pinnacle PCTV Studio Pro",
1229 .gpiomask = 0x03000F,
1230 .muxsel = { 2, 3, 1, 1 },
1231 .gpiomux = { 1, 0xd0001, 0, 0 },
1233 /* sound path (5 sources):
1234 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1237 2= Mono TV sound from Tuner
1239 MUX2 (mask 0x30000):
1241 1= FM stereo Radio from Tuner */
1245 .tuner_addr = ADDR_UNSET,
1246 .radio_addr = ADDR_UNSET,
1248 [BTTV_BOARD_TVIEW_RDS_FM] = {
1249 /* Claas Langbehn <claas@bigfoot.com>,
1250 Sven Grothklags <sven@upb.de> */
1251 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1257 .muxsel = { 2, 3, 1, 1 },
1258 .gpiomux = { 0, 0, 0x10, 8 },
1262 .tuner_type = TUNER_PHILIPS_PAL,
1263 .tuner_addr = ADDR_UNSET,
1264 .radio_addr = ADDR_UNSET,
1267 [BTTV_BOARD_LIFETEC_9415] = {
1268 /* Tim Röstermundt <rosterm@uni-muenster.de>
1269 in de.comp.os.unix.linux.hardware:
1270 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1271 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1272 options tuner type=5 */
1273 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1279 .muxsel = { 2, 3, 1, 1 },
1280 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1282 /* For cards with tda9820/tda9821:
1283 0x0000: Tuner normal stereo
1284 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1285 0x0880: Tuner A2 stereo */
1288 .tuner_addr = ADDR_UNSET,
1289 .radio_addr = ADDR_UNSET,
1291 [BTTV_BOARD_BESTBUY_EASYTV] = {
1292 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1293 old Easy TV BT848 version (model CPH031) */
1294 .name = "Askey CPH031/ BESTBUY Easy TV",
1300 .muxsel = { 2, 3, 1, 0 },
1301 .gpiomux = { 2, 0, 0, 0 },
1305 .tuner_type = TUNER_TEMIC_PAL,
1306 .tuner_addr = ADDR_UNSET,
1307 .radio_addr = ADDR_UNSET,
1310 /* ---- card 0x38 ---------------------------------- */
1311 [BTTV_BOARD_FLYVIDEO_98FM] = {
1312 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1313 .name = "Lifeview FlyVideo 98FM LR50",
1319 .muxsel = { 2, 3, 1, 1 },
1320 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1324 .tuner_addr = ADDR_UNSET,
1325 .radio_addr = ADDR_UNSET,
1327 /* This is the ultimate cheapo capture card
1328 * just a BT848A on a small PCB!
1329 * Steve Hosgood <steve@equiinet.com> */
1330 [BTTV_BOARD_GRANDTEC] = {
1331 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1343 .tuner_addr = ADDR_UNSET,
1344 .radio_addr = ADDR_UNSET,
1346 [BTTV_BOARD_ASKEY_CPH060] = {
1347 /* Daniel Herrington <daniel.herrington@home.com> */
1348 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1354 .muxsel = { 2, 3, 1, 1},
1355 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1359 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1360 .tuner_addr = ADDR_UNSET,
1361 .radio_addr = ADDR_UNSET,
1363 [BTTV_BOARD_ASKEY_CPH03X] = {
1364 /* Matti Mottus <mottus@physic.ut.ee> */
1365 .name = "Askey CPH03x TV Capturer",
1370 .gpiomask = 0x03000F,
1371 .muxsel = { 2, 3, 1, 0 },
1372 .gpiomux = { 2, 0, 0, 0 },
1376 .tuner_addr = ADDR_UNSET,
1377 .radio_addr = ADDR_UNSET,
1380 /* ---- card 0x3c ---------------------------------- */
1381 [BTTV_BOARD_MM100PCTV] = {
1382 /* Philip Blundell <philb@gnu.org> */
1383 .name = "Modular Technology MM100PCTV",
1389 .muxsel = { 2, 3, 1, 1 },
1390 .gpiomux = { 2, 0, 0, 1 },
1393 .tuner_type = TUNER_TEMIC_PAL,
1394 .tuner_addr = ADDR_UNSET,
1395 .radio_addr = ADDR_UNSET,
1397 [BTTV_BOARD_GMV1] = {
1398 /* Adrian Cox <adrian@humboldt.co.uk */
1399 .name = "AG Electronics GMV1",
1411 .tuner_addr = ADDR_UNSET,
1412 .radio_addr = ADDR_UNSET,
1414 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1415 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1416 new Easy TV BT878 version (model CPH061)
1417 special thanks to Informatica Mieres for providing the card */
1418 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1424 .muxsel = { 2, 3, 1, 0 },
1425 .gpiomux = { 1, 0, 4, 4 },
1429 .tuner_type = TUNER_PHILIPS_PAL,
1430 .tuner_addr = ADDR_UNSET,
1431 .radio_addr = ADDR_UNSET,
1433 [BTTV_BOARD_ATI_TVWONDER] = {
1434 /* Lukas Gebauer <geby@volny.cz> */
1435 .name = "ATI TV-Wonder",
1441 .muxsel = { 2, 3, 1, 0 },
1442 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1445 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1446 .tuner_addr = ADDR_UNSET,
1447 .radio_addr = ADDR_UNSET,
1450 /* ---- card 0x40 ---------------------------------- */
1451 [BTTV_BOARD_ATI_TVWONDERVE] = {
1452 /* Lukas Gebauer <geby@volny.cz> */
1453 .name = "ATI TV-Wonder VE",
1459 .muxsel = { 2, 3, 0, 1 },
1460 .gpiomux = { 0, 0, 1, 0 },
1463 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1464 .tuner_addr = ADDR_UNSET,
1465 .radio_addr = ADDR_UNSET,
1467 [BTTV_BOARD_FLYVIDEO2000] = {
1468 /* DeeJay <deejay@westel900.net (2000S) */
1469 .name = "Lifeview FlyVideo 2000S LR90",
1475 .muxsel = { 2, 3, 0, 1 },
1476 /* Radio changed from 1e80 to 0x800 to make
1477 FlyVideo2000S in .hu happy (gm)*/
1478 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1479 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1481 .audio_hook = fv2000s_audio,
1487 .tuner_addr = ADDR_UNSET,
1488 .radio_addr = ADDR_UNSET,
1490 [BTTV_BOARD_TERRATVALUER] = {
1491 .name = "Terratec TValueRadio",
1496 .gpiomask = 0xffff00,
1497 .muxsel = { 2, 3, 1, 1 },
1498 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1502 .tuner_type = TUNER_PHILIPS_PAL,
1503 .tuner_addr = ADDR_UNSET,
1504 .radio_addr = ADDR_UNSET,
1507 [BTTV_BOARD_GVBCTV4PCI] = {
1508 /* TANAKA Kei <peg00625@nifty.com> */
1509 .name = "IODATA GV-BCTV4/PCI",
1514 .gpiomask = 0x010f00,
1515 .muxsel = {2, 3, 0, 0 },
1516 .gpiomux = {0x10000, 0, 0x10000, 0 },
1519 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1520 .tuner_addr = ADDR_UNSET,
1521 .radio_addr = ADDR_UNSET,
1522 .audio_hook = gvbctv3pci_audio,
1525 /* ---- card 0x44 ---------------------------------- */
1526 [BTTV_BOARD_VOODOOTV_FM] = {
1527 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1528 /* try "insmod msp3400 simple=0" if you have
1529 * sound problems with this card. */
1534 .gpiomask = 0x4f8a00,
1535 /* 0x100000: 1=MSP enabled (0=disable again)
1536 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1537 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1538 .gpiomute = 0x947fff,
1539 /* tvtuner, radio, external,internal, mute, stereo
1540 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1541 .muxsel = { 2, 3 ,0 ,1 },
1542 .tuner_type = TUNER_MT2032,
1543 .tuner_addr = ADDR_UNSET,
1544 .radio_addr = ADDR_UNSET,
1548 [BTTV_BOARD_AIMMS] = {
1549 /* Philip Blundell <pb@nexus.co.uk> */
1550 .name = "Active Imaging AIMMS",
1555 .tuner_addr = ADDR_UNSET,
1556 .radio_addr = ADDR_UNSET,
1561 [BTTV_BOARD_PV_BT878P_PLUS] = {
1562 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1563 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1569 .muxsel = { 2, 3, 1, 1 },
1570 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1575 .tuner_addr = ADDR_UNSET,
1576 .radio_addr = ADDR_UNSET,
1579 GPIO0: U4.A0 (hef4052bt)
1581 GPIO2: U4.A1 (second hef4052bt)
1582 GPIO3: U4.nEN, U5.A0, A5.nEN
1586 [BTTV_BOARD_FLYVIDEO98EZ] = {
1587 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1592 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1595 .tuner_type = UNSET,
1596 .tuner_addr = ADDR_UNSET,
1597 .radio_addr = ADDR_UNSET,
1600 /* ---- card 0x48 ---------------------------------- */
1601 [BTTV_BOARD_PV_BT878P_9B] = {
1602 /* Dariusz Kowalewski <darekk@automex.pl> */
1603 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1609 .muxsel = { 2, 3, 1, 1 },
1610 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1617 .tuner_addr = ADDR_UNSET,
1618 .radio_addr = ADDR_UNSET,
1619 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1620 .has_radio = 1, /* Note: not all cards have radio */
1627 GPIO20,22,23: R30,R29,R28
1630 [BTTV_BOARD_SENSORAY311] = {
1631 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1632 /* you must jumper JP5 for the card to work */
1633 .name = "Sensoray 311",
1639 .muxsel = { 2, 3, 1, 0, 0 },
1643 .tuner_addr = ADDR_UNSET,
1644 .radio_addr = ADDR_UNSET,
1646 [BTTV_BOARD_RV605] = {
1647 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1648 .name = "RemoteVision MX (RV605)",
1654 .gpiomask2 = 0x07ff,
1655 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1656 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1660 .tuner_addr = ADDR_UNSET,
1661 .radio_addr = ADDR_UNSET,
1662 .muxsel_hook = rv605_muxsel,
1664 [BTTV_BOARD_POWERCLR_MTV878] = {
1665 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1670 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1671 .muxsel = { 2, 1, 1, },
1672 .gpiomux = { 0, 1, 2, 2 },
1675 .tuner_type = TUNER_PHILIPS_PAL,
1676 .tuner_addr = ADDR_UNSET,
1677 .radio_addr = ADDR_UNSET,
1682 /* ---- card 0x4c ---------------------------------- */
1683 [BTTV_BOARD_WINDVR] = {
1684 /* Masaki Suzuki <masaki@btree.org> */
1685 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1690 .gpiomask = 0x140007,
1691 .muxsel = { 2, 3, 1, 1 },
1692 .gpiomux = { 0, 1, 2, 3 },
1694 .tuner_type = TUNER_PHILIPS_NTSC,
1695 .tuner_addr = ADDR_UNSET,
1696 .radio_addr = ADDR_UNSET,
1697 .audio_hook = windvr_audio,
1699 [BTTV_BOARD_GRANDTEC_MULTI] = {
1700 .name = "GrandTec Multi Capture Card (Bt878)",
1706 .muxsel = { 2, 3, 1, 0 },
1712 .tuner_addr = ADDR_UNSET,
1713 .radio_addr = ADDR_UNSET,
1715 [BTTV_BOARD_KWORLD] = {
1716 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1722 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1723 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1724 * This card lacks external Audio In, so we mute it on Ext. & Int.
1725 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1726 * This card lacks PCI subsystem ID, sigh.
1727 * gpiomux =1: lower volume, 2+3: mute
1728 * btwincap uses 0x80000/0x80003
1735 .tuner_addr = ADDR_UNSET,
1736 .radio_addr = ADDR_UNSET,
1737 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1738 radio signal strength indicators work fine. */
1741 GPIO0,1: HEF4052 A0,A1
1742 GPIO2: HEF4052 nENABLE
1744 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1748 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1750 [BTTV_BOARD_DSP_TCVIDEO] = {
1751 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1752 .name = "DSP Design TCVIDEO",
1755 .muxsel = { 2, 3, 1, 0 },
1758 .tuner_addr = ADDR_UNSET,
1759 .radio_addr = ADDR_UNSET,
1762 /* ---- card 0x50 ---------------------------------- */
1763 [BTTV_BOARD_HAUPPAUGEPVR] = {
1764 .name = "Hauppauge WinTV PVR",
1769 .muxsel = { 2, 0, 1, 1 },
1773 .tuner_addr = ADDR_UNSET,
1774 .radio_addr = ADDR_UNSET,
1779 [BTTV_BOARD_GVBCTV5PCI] = {
1780 .name = "IODATA GV-BCTV5/PCI",
1785 .gpiomask = 0x0f0f80,
1786 .muxsel = {2, 3, 1, 0 },
1787 .gpiomux = {0x030000, 0x010000, 0, 0 },
1788 .gpiomute = 0x020000,
1791 .tuner_type = TUNER_PHILIPS_NTSC_M,
1792 .tuner_addr = ADDR_UNSET,
1793 .radio_addr = ADDR_UNSET,
1794 .audio_hook = gvbctv5pci_audio,
1797 [BTTV_BOARD_OSPREY1x0] = {
1798 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1799 .video_inputs = 4, /* id-inputs-clock */
1803 .muxsel = { 3, 2, 0, 1 },
1806 .tuner_addr = ADDR_UNSET,
1807 .radio_addr = ADDR_UNSET,
1812 [BTTV_BOARD_OSPREY1x0_848] = {
1813 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1818 .muxsel = { 2, 3, 1 },
1821 .tuner_addr = ADDR_UNSET,
1822 .radio_addr = ADDR_UNSET,
1828 /* ---- card 0x54 ---------------------------------- */
1829 [BTTV_BOARD_OSPREY101_848] = {
1830 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1838 .tuner_addr = ADDR_UNSET,
1839 .radio_addr = ADDR_UNSET,
1844 [BTTV_BOARD_OSPREY1x1] = {
1845 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1853 .tuner_addr = ADDR_UNSET,
1854 .radio_addr = ADDR_UNSET,
1859 [BTTV_BOARD_OSPREY1x1_SVID] = {
1860 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1868 .tuner_addr = ADDR_UNSET,
1869 .radio_addr = ADDR_UNSET,
1874 [BTTV_BOARD_OSPREY2xx] = {
1875 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1882 .tuner_type = UNSET,
1883 .tuner_addr = ADDR_UNSET,
1884 .radio_addr = ADDR_UNSET,
1890 /* ---- card 0x58 ---------------------------------- */
1891 [BTTV_BOARD_OSPREY2x0_SVID] = {
1892 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1899 .tuner_type = UNSET,
1900 .tuner_addr = ADDR_UNSET,
1901 .radio_addr = ADDR_UNSET,
1906 [BTTV_BOARD_OSPREY2x0] = {
1907 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1914 .tuner_type = UNSET,
1915 .tuner_addr = ADDR_UNSET,
1916 .radio_addr = ADDR_UNSET,
1921 [BTTV_BOARD_OSPREY500] = {
1922 .name = "Osprey 500", /* 500 */
1930 .tuner_addr = ADDR_UNSET,
1931 .radio_addr = ADDR_UNSET,
1936 [BTTV_BOARD_OSPREY540] = {
1937 .name = "Osprey 540", /* 540 */
1941 #if 0 /* TODO ... */
1942 .svhs = OSPREY540_SVID_ANALOG,
1943 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1944 [OSPREY540_SVID_ANALOG] = 3, },
1948 .tuner_addr = ADDR_UNSET,
1949 .radio_addr = ADDR_UNSET,
1953 #if 0 /* TODO ... */
1954 .muxsel_hook = osprey_540_muxsel,
1955 .picture_hook = osprey_540_set_picture,
1959 /* ---- card 0x5C ---------------------------------- */
1960 [BTTV_BOARD_OSPREY2000] = {
1961 .name = "Osprey 2000", /* 2000 */
1968 .tuner_type = UNSET,
1969 .tuner_addr = ADDR_UNSET,
1970 .radio_addr = ADDR_UNSET,
1973 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1975 [BTTV_BOARD_IDS_EAGLE] = {
1976 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1977 .name = "IDS Eagle",
1982 .tuner_addr = ADDR_UNSET,
1983 .radio_addr = ADDR_UNSET,
1986 .muxsel = { 0, 1, 2, 3 },
1987 .muxsel_hook = eagle_muxsel,
1992 [BTTV_BOARD_PINNACLESAT] = {
1993 .name = "Pinnacle PCTV Sat",
1999 .tuner_addr = ADDR_UNSET,
2000 .radio_addr = ADDR_UNSET,
2004 .muxsel = { 3, 0, 1, 2 },
2009 [BTTV_BOARD_FORMAC_PROTV] = {
2010 .name = "Formac ProTV II (bt878)",
2016 /* TV, Comp1, Composite over SVID con, SVID */
2017 .muxsel = { 2, 3, 1, 1 },
2018 .gpiomux = { 2, 2, 0, 0 },
2021 .tuner_type = TUNER_PHILIPS_PAL,
2022 .tuner_addr = ADDR_UNSET,
2023 .radio_addr = ADDR_UNSET,
2025 GPIO=0x00,0x01,0x03: mute (?)
2026 0x02: both TV and radio (tuner: FM1216/I)
2027 The card has onboard audio connectors labeled "cdrom" and "board",
2028 not soldered here, though unknown wiring.
2029 Card lacks: external audio in, pci subsystem id.
2033 /* ---- card 0x60 ---------------------------------- */
2034 [BTTV_BOARD_MACHTV] = {
2041 .muxsel = { 2, 3, 1, 1},
2042 .gpiomux = { 0, 1, 2, 3},
2046 .tuner_addr = ADDR_UNSET,
2047 .radio_addr = ADDR_UNSET,
2050 [BTTV_BOARD_EURESYS_PICOLO] = {
2051 .name = "Euresys Picolo",
2060 .muxsel = { 2, 0, 1},
2062 .tuner_type = UNSET,
2063 .tuner_addr = ADDR_UNSET,
2064 .radio_addr = ADDR_UNSET,
2066 [BTTV_BOARD_PV150] = {
2067 /* Luc Van Hoeylandt <luc@e-magic.be> */
2068 .name = "ProVideo PV150", /* 0x4f */
2079 .tuner_type = UNSET,
2080 .tuner_addr = ADDR_UNSET,
2081 .radio_addr = ADDR_UNSET,
2083 [BTTV_BOARD_AD_TVK503] = {
2084 /* Hiroshi Takekawa <sian@big.or.jp> */
2085 /* This card lacks subsystem ID */
2086 .name = "AD-TVK503", /* 0x63 */
2091 .gpiomask = 0x001e8007,
2092 .muxsel = { 2, 3, 1, 0 },
2093 /* Tuner, Radio, external, internal, off, on */
2094 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2100 .tuner_addr = ADDR_UNSET,
2101 .radio_addr = ADDR_UNSET,
2102 .audio_hook = adtvk503_audio,
2105 /* ---- card 0x64 ---------------------------------- */
2106 [BTTV_BOARD_HERCULES_SM_TV] = {
2107 .name = "Hercules Smart TV Stereo",
2113 .muxsel = { 2, 3, 1, 1 },
2118 .tuner_addr = ADDR_UNSET,
2119 .radio_addr = ADDR_UNSET,
2121 - card lacks subsystem ID
2122 - stereo variant w/ daughter board with tda9874a @0xb0
2124 always from tda9874 independent of GPIO (?)
2125 external line in: unknown
2126 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2127 hef4053 (instead 4052) for unknown function
2130 [BTTV_BOARD_PACETV] = {
2131 .name = "Pace TV & Radio Card",
2136 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2141 .tuner_addr = ADDR_UNSET,
2142 .radio_addr = ADDR_UNSET,
2145 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2146 only internal line out: (4pin header) RGGL
2147 Radio must be decoded by msp3410d (not routed through)*/
2149 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2152 [BTTV_BOARD_IVC200] = {
2153 /* Chris Willing <chris@vislab.usyd.edu.au> */
2159 .tuner_addr = ADDR_UNSET,
2160 .radio_addr = ADDR_UNSET,
2166 [BTTV_BOARD_XGUARD] = {
2167 .name = "Grand X-Guard / Trust 814PCI",
2173 .tuner_addr = ADDR_UNSET,
2174 .radio_addr = ADDR_UNSET,
2176 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2177 .muxsel_hook = xguard_muxsel,
2184 /* ---- card 0x68 ---------------------------------- */
2185 [BTTV_BOARD_NEBULA_DIGITV] = {
2186 .name = "Nebula Electronics DigiTV",
2190 .muxsel = { 2, 3, 1, 0 },
2196 .tuner_addr = ADDR_UNSET,
2197 .radio_addr = ADDR_UNSET,
2203 [BTTV_BOARD_PV143] = {
2204 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2205 .name = "ProVideo PV143",
2211 .muxsel = { 2, 3, 1, 0 },
2217 .tuner_addr = ADDR_UNSET,
2218 .radio_addr = ADDR_UNSET,
2220 [BTTV_BOARD_VD009X1_MINIDIN] = {
2221 /* M.Klahr@phytec.de */
2222 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2225 .tuner = -1, /* card has no tuner */
2228 .muxsel = { 2, 3, 1, 0 },
2229 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2233 .tuner_addr = ADDR_UNSET,
2234 .radio_addr = ADDR_UNSET,
2236 [BTTV_BOARD_VD009X1_COMBI] = {
2237 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2240 .tuner = -1, /* card has no tuner */
2243 .muxsel = { 2, 3, 1, 1 },
2244 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2248 .tuner_addr = ADDR_UNSET,
2249 .radio_addr = ADDR_UNSET,
2252 /* ---- card 0x6c ---------------------------------- */
2253 [BTTV_BOARD_VD009_MINIDIN] = {
2254 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2257 .tuner = -1, /* card has no tuner */
2260 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2261 via the upper nibble of muxsel. here: used for
2262 xternal video-mux */
2263 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2264 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2268 .tuner_addr = ADDR_UNSET,
2269 .radio_addr = ADDR_UNSET,
2271 [BTTV_BOARD_VD009_COMBI] = {
2272 .name = "PHYTEC VD-009 Combi (bt878)",
2275 .tuner = -1, /* card has no tuner */
2278 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2279 via the upper nibble of muxsel. here: used for
2280 xternal video-mux */
2281 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2282 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2286 .tuner_addr = ADDR_UNSET,
2287 .radio_addr = ADDR_UNSET,
2289 [BTTV_BOARD_IVC100] = {
2295 .tuner_addr = ADDR_UNSET,
2296 .radio_addr = ADDR_UNSET,
2299 .muxsel = { 2, 3, 1, 0 },
2302 [BTTV_BOARD_IVC120] = {
2303 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2306 .audio_inputs = 0, /* card has no audio */
2307 .tuner = -1, /* card has no tuner */
2309 .tuner_addr = ADDR_UNSET,
2310 .radio_addr = ADDR_UNSET,
2311 .svhs = -1, /* card has no svhs */
2317 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2318 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2319 .muxsel_hook = ivc120_muxsel,
2323 /* ---- card 0x70 ---------------------------------- */
2324 [BTTV_BOARD_PC_HDTV] = {
2325 .name = "pcHDTV HD-2000 TV",
2330 .muxsel = { 2, 3, 1, 0 },
2331 .tuner_type = TUNER_PHILIPS_ATSC,
2332 .tuner_addr = ADDR_UNSET,
2333 .radio_addr = ADDR_UNSET,
2336 [BTTV_BOARD_TWINHAN_DST] = {
2337 .name = "Twinhan DST + clones",
2341 .tuner_type = TUNER_ABSENT,
2342 .tuner_addr = ADDR_UNSET,
2343 .radio_addr = ADDR_UNSET,
2347 [BTTV_BOARD_WINFASTVC100] = {
2348 .name = "Winfast VC100",
2353 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2357 .tuner_type = TUNER_ABSENT,
2358 .tuner_addr = ADDR_UNSET,
2359 .radio_addr = ADDR_UNSET,
2362 [BTTV_BOARD_TEV560] = {
2363 .name = "Teppro TEV-560/InterVision IV-560",
2369 .muxsel = { 2, 3, 1, 1 },
2370 .gpiomux = { 1, 1, 1, 1 },
2372 .tuner_type = TUNER_PHILIPS_PAL,
2373 .tuner_addr = ADDR_UNSET,
2374 .radio_addr = ADDR_UNSET,
2378 /* ---- card 0x74 ---------------------------------- */
2379 [BTTV_BOARD_SIMUS_GVC1100] = {
2380 .name = "SIMUS GVC1100",
2386 .tuner_addr = ADDR_UNSET,
2387 .radio_addr = ADDR_UNSET,
2389 .muxsel = { 2, 2, 2, 2 },
2391 .muxsel_hook = gvc1100_muxsel,
2393 [BTTV_BOARD_NGSTV_PLUS] = {
2394 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2395 .name = "NGS NGSTV+",
2399 .gpiomask = 0x008007,
2400 .muxsel = { 2, 3, 0, 0 },
2401 .gpiomux = { 0, 0, 0, 0 },
2402 .gpiomute = 0x000003,
2404 .tuner_type = TUNER_PHILIPS_PAL,
2405 .tuner_addr = ADDR_UNSET,
2406 .radio_addr = ADDR_UNSET,
2409 [BTTV_BOARD_LMLBT4] = {
2410 /* http://linuxmedialabs.com */
2412 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2416 .muxsel = { 2, 3, 1, 0 },
2422 .tuner_addr = ADDR_UNSET,
2423 .radio_addr = ADDR_UNSET,
2425 [BTTV_BOARD_TEKRAM_M205] = {
2426 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2427 .name = "Tekram M205 PRO",
2431 .tuner_type = TUNER_PHILIPS_PAL,
2432 .tuner_addr = ADDR_UNSET,
2433 .radio_addr = ADDR_UNSET,
2437 .muxsel = { 2, 3, 1 },
2438 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2442 /* ---- card 0x78 ---------------------------------- */
2443 [BTTV_BOARD_CONTVFMI] = {
2444 /* Javier Cendan Ares <jcendan@lycos.es> */
2445 /* bt878 TV + FM without subsystem ID */
2446 .name = "Conceptronic CONTVFMi",
2451 .gpiomask = 0x008007,
2452 .muxsel = { 2, 3, 1, 1 },
2453 .gpiomux = { 0, 1, 2, 2 },
2457 .tuner_type = TUNER_PHILIPS_PAL,
2458 .tuner_addr = ADDR_UNSET,
2459 .radio_addr = ADDR_UNSET,
2463 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2464 /*Eric DEBIEF <debief@telemsa.com>*/
2465 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2466 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2468 .name = "Euresys Picolo Tetra",
2474 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2478 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2479 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2482 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2484 .tuner_addr = ADDR_UNSET,
2485 .radio_addr = ADDR_UNSET,
2487 [BTTV_BOARD_SPIRIT_TV] = {
2488 /* Spirit TV Tuner from http://spiritmodems.com.au */
2489 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2490 .name = "Spirit TV Tuner",
2495 .gpiomask = 0x0000000f,
2496 .muxsel = { 2, 1, 1 },
2497 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2498 .tuner_type = TUNER_TEMIC_PAL,
2499 .tuner_addr = ADDR_UNSET,
2500 .radio_addr = ADDR_UNSET,
2504 [BTTV_BOARD_AVDVBT_771] = {
2505 /* Wolfram Joost <wojo@frokaschwei.de> */
2506 .name = "AVerMedia AVerTV DVB-T 771",
2510 .tuner_type = TUNER_ABSENT,
2511 .tuner_addr = ADDR_UNSET,
2512 .radio_addr = ADDR_UNSET,
2513 .muxsel = { 3 , 3 },
2522 /* ---- card 0x7c ---------------------------------- */
2523 [BTTV_BOARD_AVDVBT_761] = {
2524 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2525 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2526 .name = "AverMedia AverTV DVB-T 761",
2530 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2536 .tuner_addr = ADDR_UNSET,
2537 .radio_addr = ADDR_UNSET,
2542 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2543 /* andre.schwarz@matrix-vision.de */
2544 .name = "MATRIX Vision Sigma-SQ",
2550 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2551 3, 3, 3, 3, 3, 3, 3, 3 },
2552 .muxsel_hook = sigmaSQ_muxsel,
2557 .tuner_addr = ADDR_UNSET,
2558 .radio_addr = ADDR_UNSET,
2560 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2561 /* andre.schwarz@matrix-vision.de */
2562 .name = "MATRIX Vision Sigma-SLC",
2568 .muxsel = { 2, 2, 2, 2 },
2569 .muxsel_hook = sigmaSLC_muxsel,
2574 .tuner_addr = ADDR_UNSET,
2575 .radio_addr = ADDR_UNSET,
2577 /* BTTV_BOARD_APAC_VIEWCOMP */
2578 [BTTV_BOARD_APAC_VIEWCOMP] = {
2579 /* Attila Kondoros <attila.kondoros@chello.hu> */
2580 /* bt878 TV + FM 0x00000000 subsystem ID */
2581 .name = "APAC Viewcomp 878(AMAX)",
2587 .muxsel = { 2, 3, 1, 1 },
2588 .gpiomux = { 2, 0, 0, 0 },
2592 .tuner_type = TUNER_PHILIPS_PAL,
2593 .tuner_addr = ADDR_UNSET,
2594 .radio_addr = ADDR_UNSET,
2595 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2596 .has_radio = 1, /* not every card has radio */
2599 /* ---- card 0x80 ---------------------------------- */
2600 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2601 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2602 .name = "DViCO FusionHDTV DVB-T Lite",
2611 .tuner_addr = ADDR_UNSET,
2612 .radio_addr = ADDR_UNSET,
2614 [BTTV_BOARD_VGEAR_MYVCD] = {
2615 /* Steven <photon38@pchome.com.tw> */
2616 .name = "V-Gear MyVCD",
2622 .muxsel = {2, 3, 1, 0 },
2623 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2627 .tuner_type = TUNER_PHILIPS_NTSC_M,
2628 .tuner_addr = ADDR_UNSET,
2629 .radio_addr = ADDR_UNSET,
2635 [BTTV_BOARD_SUPER_TV] = {
2636 /* Rick C <cryptdragoon@gmail.com> */
2637 .name = "Super TV Tuner",
2642 .muxsel = { 2, 3, 1, 0 },
2643 .tuner_type = TUNER_PHILIPS_NTSC,
2644 .tuner_addr = ADDR_UNSET,
2645 .radio_addr = ADDR_UNSET,
2646 .gpiomask = 0x008007,
2647 .gpiomux = { 0, 0x000001,0,0 },
2651 [BTTV_BOARD_TIBET_CS16] = {
2652 /* Chris Fanning <video4linux@haydon.net> */
2653 .name = "Tibet Systems 'Progress DVR' CS16",
2658 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2664 .tuner_addr = ADDR_UNSET,
2665 .radio_addr = ADDR_UNSET,
2666 .muxsel_hook = tibetCS16_muxsel,
2668 [BTTV_BOARD_KODICOM_4400R] = {
2669 /* Bill Brack <wbrack@mmm.com.hk> */
2671 * Note that, because of the card's wiring, the "master"
2672 * BT878A chip (i.e. the one which controls the analog switch
2673 * and must use this card type) is the 2nd one detected. The
2674 * other 3 chips should use card type 0x85, whose description
2675 * follows this one. There is a EEPROM on the card (which is
2676 * connected to the I2C of one of those other chips), but is
2677 * not currently handled. There is also a facility for a
2678 * "monitor", which is also not currently implemented.
2680 .name = "Kodicom 4400R (master)",
2685 .tuner_addr = ADDR_UNSET,
2686 .radio_addr = ADDR_UNSET,
2688 /* GPIO bits 0-9 used for analog switch:
2689 * 00 - 03: camera selector
2690 * 04 - 06: channel (controller) selector
2691 * 07: data (1->on, 0->off)
2694 * bit 16 is input from sync separator for the channel
2696 .gpiomask = 0x0003ff,
2698 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2703 .muxsel_hook = kodicom4400r_muxsel,
2705 [BTTV_BOARD_KODICOM_4400R_SL] = {
2706 /* Bill Brack <wbrack@mmm.com.hk> */
2707 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2708 * one which controls the analog switch, and must use the card type)
2709 * is the 2nd one detected. The other 3 chips should use this card
2712 .name = "Kodicom 4400R (slave)",
2717 .tuner_addr = ADDR_UNSET,
2718 .radio_addr = ADDR_UNSET,
2720 .gpiomask = 0x010000,
2722 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2727 .muxsel_hook = kodicom4400r_muxsel,
2729 /* ---- card 0x86---------------------------------- */
2730 [BTTV_BOARD_ADLINK_RTV24] = {
2731 /* Michael Henson <mhenson@clarityvi.com> */
2732 /* Adlink RTV24 with special unlock codes */
2733 .name = "Adlink RTV24",
2738 .muxsel = { 2, 3, 1, 0 },
2740 .tuner_addr = ADDR_UNSET,
2741 .radio_addr = ADDR_UNSET,
2744 /* ---- card 0x87---------------------------------- */
2745 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2746 /* Michael Krufky <mkrufky@m1k.net> */
2747 .name = "DViCO FusionHDTV 5 Lite",
2749 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2750 .tuner_addr = ADDR_UNSET,
2751 .radio_addr = ADDR_UNSET,
2755 .muxsel = { 2, 3, 1 },
2756 .gpiomask = 0x00e00007,
2757 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2758 .gpiomute = 0x00c00007,
2764 /* ---- card 0x88---------------------------------- */
2765 [BTTV_BOARD_ACORP_Y878F] = {
2766 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2767 .name = "Acorp Y878F",
2772 .gpiomask = 0x01fe00,
2773 .muxsel = { 2, 3, 1, 1 },
2774 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2775 .gpiomute = 0x002000,
2778 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2779 .tuner_addr = 0xc1 >>1,
2780 .radio_addr = 0xc1 >>1,
2783 /* ---- card 0x89 ---------------------------------- */
2784 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2785 .name = "Conceptronic CTVFMi v2",
2790 .gpiomask = 0x001c0007,
2791 .muxsel = { 2, 3, 1, 1 },
2792 .gpiomux = { 0, 1, 2, 2 },
2796 .tuner_type = TUNER_TENA_9533_DI,
2797 .tuner_addr = ADDR_UNSET,
2798 .radio_addr = ADDR_UNSET,
2802 /* ---- card 0x8a ---------------------------------- */
2803 [BTTV_BOARD_PV_BT878P_2E] = {
2804 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2809 .gpiomask = 0x01fe00,
2810 .muxsel = { 2,3,1,1,-1 },
2811 .digital_mode = DIGITAL_MODE_CAMERA,
2812 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2813 .gpiomute = 0x12400,
2816 .tuner_type = TUNER_LG_PAL_FM,
2817 .tuner_addr = ADDR_UNSET,
2818 .radio_addr = ADDR_UNSET,
2821 /* ---- card 0x8b ---------------------------------- */
2822 [BTTV_BOARD_PV_M4900] = {
2823 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2824 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2830 .muxsel = { 2, 3, 1, 1 },
2831 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2835 .tuner_type = TUNER_YMEC_TVF_5533MF,
2836 .tuner_addr = ADDR_UNSET,
2837 .radio_addr = ADDR_UNSET,
2841 /* ---- card 0x8c ---------------------------------- */
2842 [BTTV_BOARD_OSPREY440] = {
2843 .name = "Osprey 440",
2850 .tuner_type = UNSET,
2851 .tuner_addr = ADDR_UNSET,
2852 .radio_addr = ADDR_UNSET,
2857 /* ---- card 0x8d ---------------------------------- */
2858 [BTTV_BOARD_ASOUND_SKYEYE] = {
2859 .name = "Asound Skyeye PCTV",
2865 .muxsel = { 2, 3, 1, 1 },
2866 .gpiomux = { 2, 0, 0, 0 },
2871 .tuner_addr = ADDR_UNSET,
2872 .radio_addr = ADDR_UNSET,
2874 /* ---- card 0x8e ---------------------------------- */
2875 [BTTV_BOARD_SABRENT_TVFM] = {
2876 .name = "Sabrent TV-FM (bttv version)",
2881 .gpiomask = 0x108007,
2882 .muxsel = { 2, 3, 1, 1 },
2883 .gpiomux = { 100000, 100002, 100002, 100000 },
2888 .tuner_type = TUNER_TNF_5335MF,
2889 .tuner_addr = ADDR_UNSET,
2892 /* ---- card 0x8f ---------------------------------- */
2893 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2894 .name = "Hauppauge ImpactVCB (bt878)",
2899 .gpiomask = 0x0f, /* old: 7 */
2900 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2905 .tuner_addr = ADDR_UNSET,
2906 .radio_addr = ADDR_UNSET,
2908 [BTTV_BOARD_MACHTV_MAGICTV] = {
2909 /* Julian Calaby <julian.calaby@gmail.com>
2910 * Slightly different from original MachTV definition (0x60)
2912 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2913 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2914 * properly (methinks) causing no keyup bits being set */
2916 .name = "MagicTV", /* rebranded MachTV */
2922 .muxsel = { 2, 3, 1, 1 },
2923 .gpiomux = { 0, 1, 2, 3 },
2925 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2926 .tuner_addr = ADDR_UNSET,
2927 .radio_addr = ADDR_UNSET,
2934 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2936 /* ----------------------------------------------------------------------- */
2938 static unsigned char eeprom_data[256];
2943 void __devinit bttv_idcard(struct bttv *btv)
2945 unsigned int gpiobits;
2949 /* read PCI subsystem ID */
2950 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2951 btv->cardid = tmp << 16;
2952 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2955 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2956 /* look for the card */
2957 for (type = -1, i = 0; cards[i].id != 0; i++)
2958 if (cards[i].id == btv->cardid)
2963 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2964 "PCI subsystem ID is %04x:%04x\n",
2965 btv->c.nr,cards[type].name,cards[type].cardnr,
2966 btv->cardid & 0xffff,
2967 (btv->cardid >> 16) & 0xffff);
2968 btv->c.type = cards[type].cardnr;
2971 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2972 btv->c.nr, btv->cardid & 0xffff,
2973 (btv->cardid >> 16) & 0xffff);
2974 printk(KERN_DEBUG "please mail id, board name and "
2975 "the correct card= insmod option to video4linux-list@redhat.com\n");
2979 /* let the user override the autodetected type */
2980 if (card[btv->c.nr] < bttv_num_tvcards)
2981 btv->c.type=card[btv->c.nr];
2983 /* print which card config we are using */
2984 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2985 bttv_tvcards[btv->c.type].name, btv->c.type,
2986 card[btv->c.nr] < bttv_num_tvcards
2987 ? "insmod option" : "autodetected");
2989 /* overwrite gpio stuff ?? */
2990 if (UNSET == audioall && UNSET == audiomux[0])
2993 if (UNSET != audiomux[0]) {
2995 for (i = 0; i < 4; i++) {
2996 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2997 gpiobits |= audiomux[i];
3000 gpiobits = audioall;
3001 for (i = 0; i < 4; i++) {
3002 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
3005 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3006 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3007 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
3008 for (i = 0; i < 5; i++) {
3009 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
3015 * (most) board specific initialisations goes here
3018 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
3019 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3023 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
3024 type = BTTV_BOARD_MODTEC_205;
3025 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
3026 type = BTTV_BOARD_EURESYS_PICOLO;
3027 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
3028 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
3032 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3033 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3037 static void flyvideo_gpio(struct bttv *btv)
3039 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3042 gpio_inout(0xffffff, 0);
3043 udelay(8); /* without this we would see the 0x1800 mask */
3045 /* FIXME: must restore OUR_EN ??? */
3047 /* all cards provide GPIO info, some have an additional eeprom
3048 * LR50: GPIO coding can be found lower right CP1 .. CP9
3049 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3051 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3053 * lowest 3 bytes are remote control codes (no handshake needed)
3054 * xxxFFF: No remote control chip soldered
3055 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3056 * Note: Some bits are Audio_Mask !
3058 ttype=(gpio&0x0f0000)>>16;
3060 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
3062 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
3064 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3066 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
3068 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3071 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3074 has_remote = gpio & 0x800000;
3075 has_radio = gpio & 0x400000;
3076 /* unknown 0x200000;
3077 * unknown2 0x100000; */
3078 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3079 has_tda9820_tda9821 = !(gpio & 0x004000);
3080 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3082 * gpio & 0x001000 output bit for audio routing */
3085 tuner=4; /* No tuner present */
3087 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3088 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3089 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3090 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3091 is_capture_only?"yes":"no ");
3093 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
3094 btv->tuner_type = tuner;
3095 btv->has_radio = has_radio;
3097 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3098 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3099 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3100 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
3101 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
3104 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3105 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3106 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3107 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3109 static void miro_pinnacle_gpio(struct bttv *btv)
3114 gpio_inout(0xffffff, 0);
3116 id = ((gpio>>10) & 63) -1;
3117 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3119 btv->tuner_type = miro_tunermap[id];
3120 if (0 == (gpio & 0x20)) {
3122 if (!miro_fmtuner[id]) {
3123 btv->has_matchbox = 1;
3124 btv->mbox_we = (1<<6);
3125 btv->mbox_most = (1<<7);
3126 btv->mbox_clk = (1<<8);
3127 btv->mbox_data = (1<<9);
3128 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3134 if (btv->c.type == BTTV_BOARD_MIRO)
3135 btv->c.type = BTTV_BOARD_MIROPRO;
3136 if (btv->c.type == BTTV_BOARD_PINNACLE)
3137 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3140 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3141 btv->c.nr, id+1, btv->tuner_type,
3142 !btv->has_radio ? "no" :
3143 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3144 (-1 == msp) ? "no" : "yes");
3146 /* new cards with microtune tuner */
3151 info = "PAL / mono";
3152 btv->tda9887_conf = TDA9887_INTERCARRIER;
3155 info = "PAL+SECAM / stereo";
3157 btv->tda9887_conf = TDA9887_QSS;
3160 info = "NTSC / stereo";
3162 btv->tda9887_conf = TDA9887_QSS;
3165 info = "PAL+SECAM / mono";
3166 btv->tda9887_conf = TDA9887_QSS;
3169 info = "NTSC / mono";
3170 btv->tda9887_conf = TDA9887_INTERCARRIER;
3173 info = "NTSC / stereo";
3174 btv->tda9887_conf = TDA9887_INTERCARRIER;
3177 info = "PAL / stereo";
3178 btv->tda9887_conf = TDA9887_INTERCARRIER;
3181 info = "oops: unknown card";
3185 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3187 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3188 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3189 btv->tuner_type = TUNER_MT2032;
3193 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3194 #define LM1882_SYNC_DRIVE 0x200000L
3196 static void init_ids_eagle(struct bttv *btv)
3198 gpio_inout(0xffffff,0xFFFF37);
3199 gpio_write(0x200020);
3201 /* flash strobe inverter ?! */
3202 gpio_write(0x200024);
3204 /* switch sync drive off */
3205 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3207 /* set BT848 muxel to 2 */
3208 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3211 /* Muxsel helper for the IDS Eagle.
3212 * the eagles does not use the standard muxsel-bits but
3213 * has its own multiplexer */
3214 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3216 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3217 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3220 /* set chroma ADC to sleep */
3221 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3222 /* set to composite video */
3223 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3224 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3226 /* switch sync drive off */
3227 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3230 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3232 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3233 gpio_write(masks[input%4]);
3236 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3239 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3240 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3242 IN - sensor inputs, INx - sensor inputs and TI XORed together
3243 O1,O2,O3 - alarm outputs (relays)
3245 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3249 static void init_lmlbt4x(struct bttv *btv)
3251 printk(KERN_DEBUG "LMLBT4x init\n");
3252 btwrite(0x000000, BT848_GPIO_REG_INP);
3253 gpio_inout(0xffffff, 0x0006C0);
3254 gpio_write(0x000000);
3257 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3259 unsigned int inmux = input % 8;
3260 gpio_inout( 0xf, 0xf );
3261 gpio_bits( 0xf, inmux );
3264 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3266 unsigned int inmux = input % 4;
3267 gpio_inout( 3<<9, 3<<9 );
3268 gpio_bits( 3<<9, inmux<<9 );
3271 /* ----------------------------------------------------------------------- */
3273 static void bttv_reset_audio(struct bttv *btv)
3276 * BT878A has a audio-reset register.
3277 * 1. This register is an audio reset function but it is in
3278 * function-0 (video capture) address space.
3279 * 2. It is enough to do this once per power-up of the card.
3280 * 3. There is a typo in the Conexant doc -- it is not at
3281 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3282 * --//Shrikumar 030609
3288 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3289 btwrite((1<<7), 0x058);
3294 /* initialization part one -- before registering i2c bus */
3295 void __devinit bttv_init_card1(struct bttv *btv)
3297 switch (btv->c.type) {
3298 case BTTV_BOARD_HAUPPAUGE:
3299 case BTTV_BOARD_HAUPPAUGE878:
3300 boot_msp34xx(btv,5);
3302 case BTTV_BOARD_VOODOOTV_FM:
3303 boot_msp34xx(btv,20);
3305 case BTTV_BOARD_AVERMEDIA98:
3306 boot_msp34xx(btv,11);
3308 case BTTV_BOARD_HAUPPAUGEPVR:
3311 case BTTV_BOARD_TWINHAN_DST:
3312 case BTTV_BOARD_AVDVBT_771:
3313 case BTTV_BOARD_PINNACLESAT:
3314 btv->use_i2c_hw = 1;
3316 case BTTV_BOARD_ADLINK_RTV24:
3321 if (!bttv_tvcards[btv->c.type].has_dvb)
3322 bttv_reset_audio(btv);
3325 /* initialization part two -- after registering i2c bus */
3326 void __devinit bttv_init_card2(struct bttv *btv)
3329 int addr=ADDR_UNSET;
3331 btv->tuner_type = -1;
3333 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3334 bttv_readee(btv,eeprom_data,0xa0);
3335 identify_by_eeprom(btv,eeprom_data);
3338 switch (btv->c.type) {
3339 case BTTV_BOARD_MIRO:
3340 case BTTV_BOARD_MIROPRO:
3341 case BTTV_BOARD_PINNACLE:
3342 case BTTV_BOARD_PINNACLEPRO:
3344 miro_pinnacle_gpio(btv);
3346 case BTTV_BOARD_FLYVIDEO_98:
3347 case BTTV_BOARD_MAXI:
3348 case BTTV_BOARD_LIFE_FLYKIT:
3349 case BTTV_BOARD_FLYVIDEO:
3350 case BTTV_BOARD_TYPHOON_TVIEW:
3351 case BTTV_BOARD_CHRONOS_VS2:
3352 case BTTV_BOARD_FLYVIDEO_98FM:
3353 case BTTV_BOARD_FLYVIDEO2000:
3354 case BTTV_BOARD_FLYVIDEO98EZ:
3355 case BTTV_BOARD_CONFERENCETV:
3356 case BTTV_BOARD_LIFETEC_9415:
3359 case BTTV_BOARD_HAUPPAUGE:
3360 case BTTV_BOARD_HAUPPAUGE878:
3361 case BTTV_BOARD_HAUPPAUGEPVR:
3362 /* pick up some config infos from the eeprom */
3363 bttv_readee(btv,eeprom_data,0xa0);
3364 hauppauge_eeprom(btv);
3366 case BTTV_BOARD_AVERMEDIA98:
3367 case BTTV_BOARD_AVPHONE98:
3368 bttv_readee(btv,eeprom_data,0xa0);
3369 avermedia_eeprom(btv);
3371 case BTTV_BOARD_PXC200:
3374 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3375 picolo_tetra_init(btv);
3377 case BTTV_BOARD_VHX:
3379 btv->has_matchbox = 1;
3380 btv->mbox_we = 0x20;
3382 btv->mbox_clk = 0x08;
3383 btv->mbox_data = 0x10;
3384 btv->mbox_mask = 0x38;
3386 case BTTV_BOARD_VOBIS_BOOSTAR:
3387 case BTTV_BOARD_TERRATV:
3388 terratec_active_radio_upgrade(btv);
3390 case BTTV_BOARD_MAGICTVIEW061:
3391 if (btv->cardid == 0x3002144f) {
3393 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3396 case BTTV_BOARD_STB2:
3397 if (btv->cardid == 0x3060121a) {
3398 /* Fix up entry for 3DFX VoodooTV 100,
3399 which is an OEM STB card variant. */
3401 btv->tuner_type=TUNER_TEMIC_NTSC;
3404 case BTTV_BOARD_OSPREY1x0:
3405 case BTTV_BOARD_OSPREY1x0_848:
3406 case BTTV_BOARD_OSPREY101_848:
3407 case BTTV_BOARD_OSPREY1x1:
3408 case BTTV_BOARD_OSPREY1x1_SVID:
3409 case BTTV_BOARD_OSPREY2xx:
3410 case BTTV_BOARD_OSPREY2x0_SVID:
3411 case BTTV_BOARD_OSPREY2x0:
3412 case BTTV_BOARD_OSPREY500:
3413 case BTTV_BOARD_OSPREY540:
3414 case BTTV_BOARD_OSPREY2000:
3415 bttv_readee(btv,eeprom_data,0xa0);
3418 case BTTV_BOARD_IDS_EAGLE:
3419 init_ids_eagle(btv);
3421 case BTTV_BOARD_MODTEC_205:
3422 bttv_readee(btv,eeprom_data,0xa0);
3425 case BTTV_BOARD_LMLBT4:
3428 case BTTV_BOARD_TIBET_CS16:
3429 tibetCS16_init(btv);
3431 case BTTV_BOARD_KODICOM_4400R:
3432 kodicom4400r_init(btv);
3436 /* pll configuration */
3437 if (!(btv->id==848 && btv->revision==0x11)) {
3438 /* defaults from card list */
3439 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3440 btv->pll.pll_ifreq=28636363;
3441 btv->pll.pll_crystal=BT848_IFORM_XT0;
3443 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3444 btv->pll.pll_ifreq=35468950;
3445 btv->pll.pll_crystal=BT848_IFORM_XT1;
3447 /* insmod options can override */
3448 switch (pll[btv->c.nr]) {
3450 btv->pll.pll_crystal = 0;
3451 btv->pll.pll_ifreq = 0;
3452 btv->pll.pll_ofreq = 0;
3454 case 1: /* 28 MHz */
3456 btv->pll.pll_ifreq = 28636363;
3457 btv->pll.pll_ofreq = 0;
3458 btv->pll.pll_crystal = BT848_IFORM_XT0;
3460 case 2: /* 35 MHz */
3462 btv->pll.pll_ifreq = 35468950;
3463 btv->pll.pll_ofreq = 0;
3464 btv->pll.pll_crystal = BT848_IFORM_XT1;
3468 btv->pll.pll_current = -1;
3470 /* tuner configuration (from card list / autodetect / insmod option) */
3471 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3472 addr = bttv_tvcards[btv->c.type].tuner_addr;
3474 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3475 if(UNSET == btv->tuner_type)
3476 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3477 if (UNSET != tuner[btv->c.nr])
3478 btv->tuner_type = tuner[btv->c.nr];
3479 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
3481 if (btv->tuner_type != UNSET) {
3482 struct tuner_setup tun_setup;
3484 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3485 tun_setup.type = btv->tuner_type;
3486 tun_setup.addr = addr;
3488 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3491 if (btv->tda9887_conf) {
3492 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3493 &btv->tda9887_conf);
3496 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3497 if (svhs[btv->c.nr] != UNSET)
3498 btv->svhs = svhs[btv->c.nr];
3499 if (remote[btv->c.nr] != UNSET)
3500 btv->has_remote = remote[btv->c.nr];
3502 if (bttv_tvcards[btv->c.type].has_radio)
3504 if (bttv_tvcards[btv->c.type].has_remote)
3506 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3508 if (bttv_tvcards[btv->c.type].audio_hook)
3509 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3511 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3512 /* detect Bt832 chip for quartzsight digital camera */
3513 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3514 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
3521 /* try to detect audio/fader chips */
3522 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3523 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3524 request_module("msp3400");
3526 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3527 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3528 request_module("msp3400");
3530 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3531 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3532 request_module("tda9875");
3534 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3535 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3536 request_module("tda7432");
3538 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3539 request_module("tvaudio");
3543 if (btv->tda9887_conf)
3545 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3546 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
3548 /* Hybrid DVB card, DOES have a tda9887 */
3549 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3551 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3552 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3553 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3555 request_module("tda9887");
3556 if (btv->tuner_type != UNSET)
3557 request_module("tuner");
3561 /* ----------------------------------------------------------------------- */
3563 static void modtec_eeprom(struct bttv *btv)
3565 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3566 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3567 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3568 btv->c.nr,&eeprom_data[0x1e]);
3569 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3570 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3571 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3572 btv->c.nr,&eeprom_data[0x1e]);
3573 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3574 btv->tuner_type=TUNER_PHILIPS_NTSC;
3575 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3576 btv->c.nr,&eeprom_data[0x1e]);
3578 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3579 btv->c.nr,&eeprom_data[0x1e]);
3583 static void __devinit hauppauge_eeprom(struct bttv *btv)
3587 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3588 btv->tuner_type = tv.tuner_type;
3589 btv->has_radio = tv.has_radio;
3591 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3592 btv->c.nr, tv.model);
3595 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3596 * type based on model #.
3598 if(tv.model == 64900) {
3599 printk("bttv%d: Switching board type from %s to %s\n",
3601 bttv_tvcards[btv->c.type].name,
3602 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3603 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3607 static int terratec_active_radio_upgrade(struct bttv *btv)
3612 btv->has_matchbox = 1;
3613 btv->mbox_we = 0x10;
3614 btv->mbox_most = 0x20;
3615 btv->mbox_clk = 0x08;
3616 btv->mbox_data = 0x04;
3617 btv->mbox_mask = 0x3c;
3619 btv->mbox_iow = 1 << 8;
3620 btv->mbox_ior = 1 << 9;
3621 btv->mbox_csel = 1 << 10;
3624 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3625 if (0x1ed8 == tea5757_read(btv)) {
3626 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3629 btv->has_matchbox = 1;
3632 btv->has_matchbox = 0;
3638 /* ----------------------------------------------------------------------- */
3641 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3643 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3644 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3645 * unpacked with unzip).
3647 #define PVR_GPIO_DELAY 10
3649 #define BTTV_ALT_DATA 0x000001
3650 #define BTTV_ALT_DCLK 0x100000
3651 #define BTTV_ALT_NCONFIG 0x800000
3653 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3659 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3661 udelay(PVR_GPIO_DELAY);
3663 gpio_write(BTTV_ALT_NCONFIG);
3664 udelay(PVR_GPIO_DELAY);
3666 for (n = 0; n < microlen; n++) {
3668 for ( i = 0 ; i < 8 ; i++ ) {
3669 gpio_bits(BTTV_ALT_DCLK,0);
3671 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3673 gpio_bits(BTTV_ALT_DATA,0);
3674 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3678 gpio_bits(BTTV_ALT_DCLK,0);
3679 udelay(PVR_GPIO_DELAY);
3681 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3682 for (i = 0 ; i < 30 ; i++) {
3683 gpio_bits(BTTV_ALT_DCLK,0);
3684 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3686 gpio_bits(BTTV_ALT_DCLK,0);
3690 static int __devinit pvr_boot(struct bttv *btv)
3692 const struct firmware *fw_entry;
3695 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3697 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3701 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3702 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3703 btv->c.nr, (rc < 0) ? "failed" : "ok");
3704 release_firmware(fw_entry);
3708 /* ----------------------------------------------------------------------- */
3709 /* some osprey specific stuff */
3711 static void __devinit osprey_eeprom(struct bttv *btv)
3714 unsigned char *ee = eeprom_data;
3715 unsigned long serial = 0;
3717 if (btv->c.type == 0) {
3718 /* this might be an antique... check for MMAC label in eeprom */
3719 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3720 unsigned char checksum = 0;
3721 for (i =0; i<21; i++)
3723 if (checksum != ee[21])
3725 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3726 for (i = 12; i < 21; i++)
3727 serial *= 10, serial += ee[i] - '0';
3730 unsigned short type;
3733 for(; offset < 8*16; offset += 16) {
3734 unsigned short checksum = 0;
3735 /* verify the checksum */
3736 for(i = 0; i<14; i++) checksum += ee[i+offset];
3737 checksum = ~checksum; /* no idea why */
3738 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3739 ((checksum & 0x0FF) == ee[offset+15])) {
3747 /* found a valid descriptor */
3748 type = (ee[offset+4]<<8) | (ee[offset+5]);
3754 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
3757 btv->c.type = BTTV_BOARD_OSPREY101_848;
3763 btv->c.type = BTTV_BOARD_OSPREY1x0;
3767 btv->c.type = BTTV_BOARD_OSPREY1x1;
3772 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
3778 btv->c.type = BTTV_BOARD_OSPREY2xx;
3782 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
3785 btv->c.type = BTTV_BOARD_OSPREY500;
3789 btv->c.type = BTTV_BOARD_OSPREY540;
3790 /* bttv_osprey_540_init(btv); */
3795 btv->c.type = BTTV_BOARD_OSPREY2x0;
3796 /* enable output on select control lines */
3797 gpio_inout(0xffffff,0x000303);
3800 /* unknown...leave generic, but get serial # */
3803 serial = (ee[offset+6] << 24)
3804 | (ee[offset+7] << 16)
3805 | (ee[offset+8] << 8)
3809 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3810 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3813 /* ----------------------------------------------------------------------- */
3814 /* AVermedia specific stuff, from bktr_card.c */
3816 static int tuner_0_table[] = {
3817 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3818 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3819 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3820 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3821 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3822 TUNER_PHILIPS_FM1216ME_MK3 };
3824 static int tuner_1_table[] = {
3825 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3826 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3827 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3828 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3829 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3831 static void __devinit avermedia_eeprom(struct bttv *btv)
3833 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3835 tuner_make = (eeprom_data[0x41] & 0x7);
3836 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3837 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3838 btv->has_remote = (eeprom_data[0x42] & 0x01);
3840 if (tuner_make == 0 || tuner_make == 2)
3841 if(tuner_format <=0x0a)
3842 tuner = tuner_0_table[tuner_format];
3843 if (tuner_make == 1)
3844 if(tuner_format <=9)
3845 tuner = tuner_1_table[tuner_format];
3847 if (tuner_make == 4)
3848 if(tuner_format == 0x09)
3849 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3851 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3852 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3854 btv->tuner_type=tuner;
3857 printk("Unknown type");
3858 printk(" radio:%s remote control:%s\n",
3859 tuner_tv_fm ? "yes" : "no",
3860 btv->has_remote ? "yes" : "no");
3863 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3864 void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3866 /* fix up our card entry */
3867 if(norm==VIDEO_MODE_NTSC) {
3868 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3869 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
3870 dprintk("bttv_tda9880_setnorm to NTSC\n");
3873 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3874 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
3875 dprintk("bttv_tda9880_setnorm to PAL\n");
3877 /* set GPIO according */
3878 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3879 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
3884 * reset/enable the MSP on some Hauppauge cards
3885 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3890 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3892 int mask = (1 << pin);
3894 gpio_inout(mask,mask);
3897 gpio_bits(mask,mask);
3900 bttv_gpio_tracking(btv,"msp34xx");
3902 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3903 "init [%d]\n", btv->c.nr, pin);
3906 static void __devinit boot_bt832(struct bttv *btv)
3910 /* ----------------------------------------------------------------------- */
3911 /* Imagenation L-Model PXC200 Framegrabber */
3912 /* This is basically the same procedure as
3913 * used by Alessandro Rubini in his pxc200
3914 * driver, but using BTTV functions */
3916 static void __devinit init_PXC200(struct bttv *btv)
3918 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3919 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3925 /* Initialise GPIO-connevted stuff */
3926 gpio_inout(0xffffff, (1<<13));
3930 /* GPIO inputs are pulled up, so no need to drive
3931 * reset pin any longer */
3932 gpio_bits(0xffffff, 0);
3934 bttv_gpio_tracking(btv,"pxc200");
3936 /* we could/should try and reset/control the AD pots? but
3937 right now we simply turned off the crushing. Without
3938 this the AGC drifts drifts
3939 remember the EN is reverse logic -->
3940 setting BT848_ADC_AGC_EN disable the AGC
3941 tboult@eecs.lehigh.edu
3944 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3946 /* Initialise MAX517 DAC */
3947 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3948 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3950 /* Initialise 12C508 PIC */
3951 /* The I2CWrite and I2CRead commmands are actually to the
3952 * same chips - but the R/W bit is included in the address
3953 * argument so the numbers are different */
3956 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3958 /* First of all, enable the clock line. This is used in the PXC200-F */
3959 val = btread(BT848_GPIO_DMA_CTL);
3960 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3961 btwrite(val, BT848_GPIO_DMA_CTL);
3963 /* Then, push to 0 the reset pin long enough to reset the *
3964 * device same as above for the reset line, but not the same
3965 * value sent to the GPIO-connected stuff
3966 * which one is the good one? */
3967 gpio_inout(0xffffff,(1<<2));
3972 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3973 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3976 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3977 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3981 printk(KERN_INFO "PXC200 Initialised.\n");
3986 /* ----------------------------------------------------------------------- */
3988 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3989 * it. This apparently involves the following procedure for each 878 chip:
3991 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3993 * 2) write to GPIO_DATA
3999 * read from GPIO_DATA into buf (uint_32)
4000 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4001 * error. ERROR_CPLD_Check_Failed stop.
4003 * 3) write to GPIO_DATA
4004 * - write 0x4400 + 0x0E
4006 * - write 0x4410 + 0x0E
4009 * read from GPIO_DATA into buf (uint_32)
4010 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
4011 * error. ERROR_CPLD_Check_Failed.
4013 /* ----------------------------------------------------------------------- */
4015 init_RTV24 (struct bttv *btv)
4017 uint32_t dataRead = 0;
4018 long watchdog_value = 0x0E;
4021 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
4024 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4026 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4028 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4030 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4032 dataRead = btread (BT848_GPIO_DATA);
4034 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4036 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4037 btv->c.nr, dataRead);
4040 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4042 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4044 btwrite (watchdog_value, BT848_GPIO_DATA);
4046 dataRead = btread (BT848_GPIO_DATA);
4048 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4050 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4051 btv->c.nr, dataRead);
4057 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4062 /* ----------------------------------------------------------------------- */
4063 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4065 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4066 * This code is placed under the terms of the GNU General Public License
4068 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4071 static void bus_low(struct bttv *btv, int bit)
4073 if (btv->mbox_ior) {
4074 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4075 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4082 if (btv->mbox_ior) {
4083 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4088 static void bus_high(struct bttv *btv, int bit)
4090 if (btv->mbox_ior) {
4091 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4092 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4099 if (btv->mbox_ior) {
4100 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4105 static int bus_in(struct bttv *btv, int bit)
4107 if (btv->mbox_ior) {
4108 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4109 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4112 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4115 return gpio_read() & (bit);
4118 /* TEA5757 register bits */
4119 #define TEA_FREQ 0:14
4120 #define TEA_BUFFER 15:15
4122 #define TEA_SIGNAL_STRENGTH 16:17
4124 #define TEA_PORT1 18:18
4125 #define TEA_PORT0 19:19
4127 #define TEA_BAND 20:21
4128 #define TEA_BAND_FM 0
4129 #define TEA_BAND_MW 1
4130 #define TEA_BAND_LW 2
4131 #define TEA_BAND_SW 3
4133 #define TEA_MONO 22:22
4134 #define TEA_ALLOW_STEREO 0
4135 #define TEA_FORCE_MONO 1
4137 #define TEA_SEARCH_DIRECTION 23:23
4138 #define TEA_SEARCH_DOWN 0
4139 #define TEA_SEARCH_UP 1
4141 #define TEA_STATUS 24:24
4142 #define TEA_STATUS_TUNED 0
4143 #define TEA_STATUS_SEARCHING 1
4145 /* Low-level stuff */
4146 static int tea5757_read(struct bttv *btv)
4148 unsigned long timeout;
4152 /* better safe than sorry */
4153 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4155 if (btv->mbox_ior) {
4156 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4157 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4162 bttv_gpio_tracking(btv,"tea5757 read");
4164 bus_low(btv,btv->mbox_we);
4165 bus_low(btv,btv->mbox_clk);
4168 timeout= jiffies + HZ;
4170 /* wait for DATA line to go low; error if it doesn't */
4171 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4173 if (bus_in(btv,btv->mbox_data)) {
4174 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4178 dprintk("bttv%d: tea5757:",btv->c.nr);
4179 for(i = 0; i < 24; i++)
4182 bus_high(btv,btv->mbox_clk);
4184 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4185 bus_low(btv,btv->mbox_clk);
4187 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4188 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4190 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4194 static int tea5757_write(struct bttv *btv, int value)
4199 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4201 if (btv->mbox_ior) {
4202 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4203 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4207 bttv_gpio_tracking(btv,"tea5757 write");
4209 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4210 bus_low(btv,btv->mbox_clk);
4211 bus_high(btv,btv->mbox_we);
4212 for(i = 0; i < 25; i++)
4214 if (reg & 0x1000000)
4215 bus_high(btv,btv->mbox_data);
4217 bus_low(btv,btv->mbox_data);
4219 bus_high(btv,btv->mbox_clk);
4221 bus_low(btv,btv->mbox_clk);
4224 bus_low(btv,btv->mbox_we); /* unmute !!! */
4228 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4230 dprintk("tea5757_set_freq %d\n",freq);
4231 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4235 /* ----------------------------------------------------------------------- */
4238 static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4240 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4241 int bits_out, loops, vol, data;
4244 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4245 v->flags |= VIDEO_AUDIO_VOLUME;
4249 /* 32 levels logarithmic */
4250 vol = 32 - ((v->volume>>11));
4252 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4254 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4255 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4257 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4258 WINVIEW_PT2254_STROBE);
4259 for (loops = 17; loops >= 0 ; loops--) {
4260 if (bits_out & (1<<loops))
4261 data |= WINVIEW_PT2254_DATA;
4263 data &= ~WINVIEW_PT2254_DATA;
4266 data |= WINVIEW_PT2254_CLK;
4269 data &= ~WINVIEW_PT2254_CLK;
4272 data |= WINVIEW_PT2254_STROBE;
4273 data &= ~WINVIEW_PT2254_DATA;
4276 data &= ~WINVIEW_PT2254_STROBE;
4280 /* ----------------------------------------------------------------------- */
4281 /* mono/stereo control for various cards (which don't use i2c chips but */
4282 /* connect something to the GPIO pins */
4285 gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4287 unsigned int con = 0;
4290 gpio_inout(0x300, 0x300);
4291 if (v->mode & VIDEO_SOUND_LANG1)
4293 if (v->mode & VIDEO_SOUND_LANG2)
4295 if (v->mode & VIDEO_SOUND_STEREO)
4297 /* if (v->mode & VIDEO_SOUND_MONO)
4299 gpio_bits(0x300, con);
4301 v->mode = VIDEO_SOUND_STEREO |
4302 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4307 gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4309 unsigned int val, con;
4311 if (btv->radio_user)
4317 if (v->mode & VIDEO_SOUND_LANG2) {
4318 if (v->mode & VIDEO_SOUND_LANG1) {
4327 if (con != (val & 0x300)) {
4328 gpio_bits(0x300, con);
4330 bttv_gpio_tracking(btv,"gvbctv5pci");
4333 switch (val & 0x70) {
4335 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4338 v->mode = VIDEO_SOUND_LANG2;
4341 v->mode = VIDEO_SOUND_LANG1;
4344 v->mode = VIDEO_SOUND_STEREO;
4347 v->mode = VIDEO_SOUND_MONO;
4350 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4351 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4357 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4358 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4359 * 0xdde enables mono and 0xccd enables sap
4361 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4362 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4363 * input/output sound connection, so both must be set for output mode.
4365 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4366 * handles this with a tda9840
4370 avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4375 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4377 if (v->mode & VIDEO_SOUND_STEREO)
4380 gpio_bits(0x03,val);
4382 bttv_gpio_tracking(btv,"avermedia");
4385 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4392 avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4397 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4399 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4401 btaor(val, ~0x03, BT848_GPIO_DATA);
4403 bttv_gpio_tracking(btv,"avermedia");
4405 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4406 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4411 /* Lifetec 9415 handling */
4413 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4417 if (gpio_read() & 0x4000) {
4418 v->mode = VIDEO_SOUND_MONO;
4423 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4425 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4427 if ((v->mode & VIDEO_SOUND_LANG1) ||
4428 (v->mode & VIDEO_SOUND_MONO))
4430 gpio_bits(0x0880, val);
4432 bttv_gpio_tracking(btv,"lt9415");
4434 /* autodetect doesn't work with this card :-( */
4435 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4436 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4441 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4443 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4445 unsigned int con = 0;
4448 gpio_inout(0x180000,0x180000);
4449 if (v->mode & VIDEO_SOUND_LANG2)
4451 if (v->mode & VIDEO_SOUND_STEREO)
4453 gpio_bits(0x180000, con);
4455 bttv_gpio_tracking(btv,"terratv");
4457 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4458 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4463 winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4465 unsigned long val = 0;
4468 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4469 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4471 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4473 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4475 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4478 gpio_bits(0x430000, val);
4480 bttv_gpio_tracking(btv,"winfast2000");
4483 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4484 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4489 * Dariusz Kowalewski <darekk@automex.pl>
4490 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4491 * revision 9B has on-board TDA9874A sound decoder).
4493 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4494 * will mute this cards.
4497 pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4499 unsigned int val = 0;
4501 if (btv->radio_user)
4505 if (v->mode & VIDEO_SOUND_MONO) {
4508 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4509 || (v->mode & VIDEO_SOUND_STEREO)) {
4513 gpio_bits(0x03,val);
4515 bttv_gpio_tracking(btv,"pvbt878p9b");
4518 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4519 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4524 * Dariusz Kowalewski <darekk@automex.pl>
4525 * sound control for FlyVideo 2000S (with tda9874 decoder)
4526 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4529 fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4531 unsigned int val = 0xffff;
4533 if (btv->radio_user)
4536 if (v->mode & VIDEO_SOUND_MONO) {
4539 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4540 || (v->mode & VIDEO_SOUND_STEREO)) {
4541 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4543 if (val != 0xffff) {
4544 gpio_bits(0x1800, val);
4546 bttv_gpio_tracking(btv,"fv2000s");
4549 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4550 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4555 * sound control for Canopus WinDVR PCI
4556 * Masaki Suzuki <masaki@btree.org>
4559 windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4561 unsigned long val = 0;
4564 if (v->mode & VIDEO_SOUND_MONO)
4566 if (v->mode & VIDEO_SOUND_LANG1)
4568 if (v->mode & VIDEO_SOUND_LANG2)
4570 if (v->mode & VIDEO_SOUND_STEREO)
4573 gpio_bits(0x140000, val);
4575 bttv_gpio_tracking(btv,"windvr");
4578 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4579 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4584 * sound control for AD-TVK503
4585 * Hiroshi Takekawa <sian@big.or.jp>
4588 adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4590 unsigned int con = 0xffffff;
4592 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4595 /* btor(***, BT848_GPIO_OUT_EN); */
4596 if (v->mode & VIDEO_SOUND_LANG1)
4598 if (v->mode & VIDEO_SOUND_LANG2)
4600 if (v->mode & VIDEO_SOUND_STEREO)
4602 if (v->mode & VIDEO_SOUND_MONO)
4604 if (con != 0xffffff) {
4605 gpio_bits(0x1e0000,con);
4607 bttv_gpio_tracking(btv, "adtvk503");
4610 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4611 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4615 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4617 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4618 * switch instead (CD22M3494E). This IC can have multiple active connections
4619 * between Xn (input) and Yn (output) pins. We need to clear any existing
4620 * connection prior to establish a new one, pulsing the STROBE pin.
4622 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4623 * GPIO pins are wired as:
4624 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4625 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4626 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4627 * GPIO[8] - - P3[5] (microcontroler)
4628 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4629 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4630 * GPINTR - - P3[4] (microcontroler)
4632 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4633 * configuration either directly (as we are doing) or using the microcontroler
4634 * which is also wired to I2C interface. I have no further info on the
4635 * microcontroler features, one would need to disassembly the firmware.
4636 * note: the vendor refused to give any information on this product, all
4637 * that stuff was found using a multimeter! :)
4639 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4641 /* reset all conections */
4642 gpio_bits(0x200,0x200);
4644 gpio_bits(0x200,0x000);
4647 /* create a new conection */
4648 gpio_bits(0x480,0x080);
4649 gpio_bits(0x480,0x480);
4651 gpio_bits(0x480,0x080);
4655 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4657 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4658 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4659 * chips, ten eight input analog multiplexors, a not chip and a few
4662 * 16 inputs on a secondary bracket are provided and can be selected
4663 * from each of the four capture chips. Two of the eight input
4664 * multiplexors are used to select from any of the 16 input signals.
4666 * Unsupported hardware capabilities:
4667 * . A video output monitor on the secondary bracket can be selected from
4668 * one of the 878A chips.
4669 * . Another passthrough but I haven't spent any time investigating it.
4670 * . Digital I/O (logic level connected to GPIO) is available from an
4673 * The on chip input mux should always be set to 2.
4674 * GPIO[16:19] - Video input selection
4675 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4676 * GPIO[?:?] - Digital I/O.
4678 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4679 * determined what function (if any) it provides. With the microcontroller
4680 * and sync seperator chips a guess is that it might have to do with video
4681 * switching and maybe some digital I/O.
4683 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4686 gpio_bits(0x0f0000, input << 16);
4689 static void tibetCS16_init(struct bttv *btv)
4691 /* enable gpio bits, mask obtained via btSpy */
4692 gpio_inout(0xffffff, 0x0f7fff);
4693 gpio_write(0x0f7fff);
4697 * The following routines for the Kodicom-4400r get a little mind-twisting.
4698 * There is a "master" controller and three "slave" controllers, together
4699 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4700 * The analog switch is controlled by the "master", but the detection order
4701 * of the four BT878A chips is in an order which I just don't understand.
4702 * The "master" is actually the second controller to be detected. The
4703 * logic on the board uses logical numbers for the 4 controlers, but
4704 * those numbers are different from the detection sequence. When working
4705 * with the analog switch, we need to "map" from the detection sequence
4706 * over to the board's logical controller number. This mapping sequence
4707 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4708 * unit 3, the second (which is the master) is logical unit 0, etc.
4709 * We need to maintain the status of the analog switch (which of the 16
4710 * cameras is connected to which of the 4 controllers). Rather than
4711 * add to the bttv structure for this, we use the data reserved for
4712 * the mbox (unused for this card type).
4716 * First a routine to set the analog switch, which controls which camera
4717 * is routed to which controller. The switch comprises an X-address
4718 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4719 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4720 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4721 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4722 * specified address. The idea is to set the address and data, then bring
4723 * STROBE high, and finally bring STROBE back to low.
4725 static void kodicom4400r_write(struct bttv *btv,
4726 unsigned char xaddr,
4727 unsigned char yaddr,
4728 unsigned char data) {
4731 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4732 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4733 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4734 gpio_bits(0x1ff, udata); /* strobe low */
4738 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4739 * use this routine. The routine finds the "master" for the card, maps
4740 * the controller number from the detected position over to the logical
4741 * number, writes the appropriate data to the analog switch, and housekeeps
4742 * the local copy of the switch information. The parameter 'input' is the
4743 * requested camera number (0 - 15).
4745 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4750 static unsigned char map[4] = {3, 0, 2, 1};
4752 mctlr = master[btv->c.nr];
4753 if (mctlr == NULL) { /* ignore if master not yet detected */
4756 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4758 sw_status = (char *)(&mctlr->mbox_we);
4759 xaddr = input & 0xf;
4760 /* Check if the controller/camera pair has changed, else ignore */
4761 if (sw_status[yaddr] != xaddr)
4763 /* "open" the old switch, "close" the new one, save the new */
4764 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4765 sw_status[yaddr] = xaddr;
4766 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4771 * During initialisation, we need to reset the analog switch. We
4772 * also preset the switch to map the 4 connectors on the card to the
4773 * *user's* (see above description of kodicom4400r_muxsel) channels
4776 static void kodicom4400r_init(struct bttv *btv)
4778 char *sw_status = (char *)(&btv->mbox_we);
4781 gpio_inout(0x0003ff, 0x0003ff);
4782 gpio_write(1 << 9); /* reset MUX */
4784 /* Preset camera 0 to the 4 controllers */
4785 for (ix=0; ix<4; ix++) {
4787 kodicom4400r_write(btv, ix, ix, 1);
4790 * Since this is the "master", we need to set up the
4791 * other three controller chips' pointers to this structure
4792 * for later use in the muxsel routine.
4794 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4796 master[btv->c.nr-1] = btv;
4797 master[btv->c.nr] = btv;
4798 master[btv->c.nr+1] = btv;
4799 master[btv->c.nr+2] = btv;
4802 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4803 * video multiplexers to provide up to 16 video inputs. These
4804 * multiplexers are controlled by the lower 8 GPIO pins of the
4805 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4807 * xxx0 is pin xxx of multiplexer U5,
4808 * yyy1 is pin yyy of multiplexer U2
4820 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4822 static const int masks[] = {
4823 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4824 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4825 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4826 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4828 gpio_write(masks[input%16]);
4830 static void picolo_tetra_init(struct bttv *btv)
4832 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4833 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4834 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4836 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4839 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4840 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4841 /*GPIO[20]&GPIO[21] used to choose the right input*/
4842 btwrite (input<<20,BT848_GPIO_DATA);
4847 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4849 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4850 * swichers to provide 16 channels to MUX0. The TDA8540's have
4851 * 4 independent outputs and as such the IVC120G also has the
4852 * optional "Monitor Out" bus. This allows the card to be looking
4853 * at one input while the monitor is looking at another.
4855 * Since I've couldn't be bothered figuring out how to add an
4856 * independant muxsel for the monitor bus, I've just set it to
4857 * whatever the card is looking at.
4859 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4860 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4862 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4863 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4864 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4865 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4869 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4870 #define I2C_TDA8540 0x90
4871 #define I2C_TDA8540_ALT1 0x92
4872 #define I2C_TDA8540_ALT2 0x94
4873 #define I2C_TDA8540_ALT3 0x96
4874 #define I2C_TDA8540_ALT4 0x98
4875 #define I2C_TDA8540_ALT5 0x9a
4876 #define I2C_TDA8540_ALT6 0x9c
4878 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4881 int key = input % 4;
4882 int matrix = input / 4;
4884 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4885 btv->c.nr, input, matrix, key);
4887 /* Handles the input selection on the TDA8540's */
4888 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4889 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4890 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4891 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4892 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4893 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4894 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4895 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4897 /* Handles the output enables on the TDA8540's */
4898 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4899 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4900 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4901 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4902 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4903 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4904 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4905 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4907 /* Selects MUX0 for input on the 878 */
4908 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4912 /* PXC200 muxsel helper
4913 * luke@syseng.anu.edu.au
4914 * another transplant
4915 * from Alessandro Rubini (rubini@linux.it)
4917 * There are 4 kinds of cards:
4918 * PXC200L which is bt848
4919 * PXC200F which is bt848 with PIC controlling mux
4920 * PXC200AL which is bt878
4921 * PXC200AF which is bt878 with PIC controlling mux
4923 #define PX_CFG_PXC200F 0x01
4924 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4925 #define PX_I2C_PIC 0x0f
4926 #define PX_PXC200A_CARDID 0x200a1295
4927 #define PX_I2C_CMD_CFG 0x00
4929 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4934 unsigned char buf[2];
4936 /* Read PIC config to determine if this is a PXC200F */
4940 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4942 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4943 /* not PXC ? do nothing */
4947 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4948 if (!(rc & PX_CFG_PXC200F)) {
4949 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4954 /* The multiplexer in the 200F is handled by the GPIO port */
4955 /* get correct mapping between inputs */
4956 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4957 /* ** not needed!? */
4960 /* make sure output pins are enabled */
4961 /* bitmask=0x30f; */
4963 /* check whether we have a PXC200A */
4964 if (btv->cardid == PX_PXC200A_CARDID) {
4965 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4966 bitmask |= 7<<4; /* the DAC */
4968 btwrite(bitmask, BT848_GPIO_OUT_EN);
4970 bitmask = btread(BT848_GPIO_DATA);
4971 if (btv->cardid == PX_PXC200A_CARDID)
4972 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4973 else /* older device */
4974 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4975 btwrite(bitmask,BT848_GPIO_DATA);
4978 * Was "to be safe, set the bt848 to input 0"
4979 * Actually, since it's ok at load time, better not messing
4980 * with these bits (on PXC200AF you need to set mux 2 here)
4982 * needed because bttv-driver sets mux before calling this function
4984 if (btv->cardid == PX_PXC200A_CARDID)
4985 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4986 else /* older device */
4987 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4989 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4992 /* ----------------------------------------------------------------------- */
4993 /* motherboard chipset specific stuff */
4995 void __devinit bttv_check_chipset(void)
4997 int pcipci_fail = 0;
4998 struct pci_dev *dev = NULL;
5000 if (pci_pci_problems & PCIPCI_FAIL)
5002 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
5004 if (pci_pci_problems & PCIPCI_VSFX)
5006 #ifdef PCIPCI_ALIMAGIK
5007 if (pci_pci_problems & PCIPCI_ALIMAGIK)
5012 /* print warnings about any quirks found */
5014 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
5016 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
5018 printk(KERN_INFO "bttv: bttv and your chipset may not work "
5021 printk(KERN_INFO "bttv: overlay will be disabled.\n");
5024 printk(KERN_INFO "bttv: overlay forced. Use this "
5025 "option at your own risk.\n");
5028 if (UNSET != latency)
5029 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
5030 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
5031 PCI_DEVICE_ID_INTEL_82441, dev))) {
5033 pci_read_config_byte(dev, 0x53, &b);
5035 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5036 "bufcon=0x%02x\n",b);
5040 int __devinit bttv_handle_chipset(struct bttv *btv)
5042 unsigned char command;
5044 if (!triton1 && !vsfx && UNSET == latency)
5049 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5050 if (vsfx && btv->id >= 878)
5051 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5052 if (UNSET != latency)
5053 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5057 if (btv->id < 878) {
5058 /* bt848 (mis)uses a bit in the irq mask for etbf */
5060 btv->triton1 = BT848_INT_ETBF;
5062 /* bt878 has a bit in the pci config space for it */
5063 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
5065 command |= BT878_EN_TBFX;
5067 command |= BT878_EN_VSFX;
5068 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5070 if (UNSET != latency)
5071 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);