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 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30 #include <linux/delay.h>
31 #include <linux/module.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>
37 #include <net/checksum.h>
39 #include <asm/unaligned.h>
43 #include <media/v4l2-common.h>
44 #include <media/tvaudio.h>
45 #include "bttv-audio-hook.h"
48 static void boot_msp34xx(struct bttv *btv, int pin);
49 static void hauppauge_eeprom(struct bttv *btv);
50 static void avermedia_eeprom(struct bttv *btv);
51 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
52 static void modtec_eeprom(struct bttv *btv);
53 static void init_PXC200(struct bttv *btv);
54 static void init_RTV24(struct bttv *btv);
56 static void rv605_muxsel(struct bttv *btv, unsigned int input);
57 static void eagle_muxsel(struct bttv *btv, unsigned int input);
58 static void xguard_muxsel(struct bttv *btv, unsigned int input);
59 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
60 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
62 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
64 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
65 static void picolo_tetra_init(struct bttv *btv);
67 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
68 static void tibetCS16_init(struct bttv *btv);
70 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
71 static void kodicom4400r_init(struct bttv *btv);
73 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
74 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
76 static void geovision_muxsel(struct bttv *btv, unsigned int input);
78 static void phytec_muxsel(struct bttv *btv, unsigned int input);
80 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
81 static void gv800s_init(struct bttv *btv);
83 static int terratec_active_radio_upgrade(struct bttv *btv);
84 static int tea5757_read(struct bttv *btv);
85 static int tea5757_write(struct bttv *btv, int value);
86 static void identify_by_eeprom(struct bttv *btv,
87 unsigned char eeprom_data[256]);
88 static int __devinit pvr_boot(struct bttv *btv);
90 /* config variables */
91 static unsigned int triton1;
92 static unsigned int vsfx;
93 static unsigned int latency = UNSET;
96 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
97 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
98 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
99 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int audiodev[BTTV_MAX];
102 static unsigned int saa6588[BTTV_MAX];
103 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
104 static unsigned int autoload = UNSET;
105 static unsigned int gpiomask = UNSET;
106 static unsigned int audioall = UNSET;
107 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
110 module_param(triton1, int, 0444);
111 module_param(vsfx, int, 0444);
112 module_param(no_overlay, int, 0444);
113 module_param(latency, int, 0444);
114 module_param(gpiomask, int, 0444);
115 module_param(audioall, int, 0444);
116 module_param(autoload, int, 0444);
118 module_param_array(card, int, NULL, 0444);
119 module_param_array(pll, int, NULL, 0444);
120 module_param_array(tuner, int, NULL, 0444);
121 module_param_array(svhs, int, NULL, 0444);
122 module_param_array(remote, int, NULL, 0444);
123 module_param_array(audiodev, int, NULL, 0444);
124 module_param_array(audiomux, int, NULL, 0444);
126 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
127 "[enable bug compatibility for triton1 + others]");
128 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
129 "[yet another chipset flaw workaround]");
130 MODULE_PARM_DESC(latency,"pci latency timer");
131 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
132 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
133 MODULE_PARM_DESC(tuner,"specify installed tuner type");
134 MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");
135 MODULE_PARM_DESC(audiodev, "specify audio device:\n"
136 "\t\t-1 = no audio\n"
137 "\t\t 0 = autodetect (default)\n"
141 MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
142 MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
143 " [some VIA/SIS chipsets are known to have problem with overlay]");
145 /* ----------------------------------------------------------------------- */
146 /* list of card IDs for bt878+ cards */
152 } cards[] __devinitdata = {
153 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
154 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
155 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
156 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
157 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
158 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
159 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
160 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
161 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
163 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
164 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
166 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
167 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
168 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
169 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
170 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
171 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
172 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
173 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
174 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
176 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
177 /* some cards ship with byteswapped IDs ... */
178 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
179 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
180 /* this seems to happen as well ... */
181 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
183 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
184 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
185 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
187 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
188 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
189 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
190 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
191 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
192 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
193 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
195 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
196 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
197 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
198 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
199 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
201 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
202 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
203 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
204 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
206 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
207 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
208 /* clashes with FlyVideo
209 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
210 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
211 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
212 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
213 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
215 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
217 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
219 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
221 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
222 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
223 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
224 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
225 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
227 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
228 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
229 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
230 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
232 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
233 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
234 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
235 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
237 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
238 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
242 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
246 { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
247 { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
248 { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
249 { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
250 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
261 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
263 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
264 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
265 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
266 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
267 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
268 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
269 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
271 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
272 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
274 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
275 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
276 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
277 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
278 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
279 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
281 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
282 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
284 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
285 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
286 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
287 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
288 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
289 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
290 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
291 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
292 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
294 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
295 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
297 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
298 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
299 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
300 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
302 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
304 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
305 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
307 /* likely broken, vendor id doesn't match the other magic views ...
308 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
310 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
311 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
313 { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},
315 /* DVB cards (using pci function .1 for mpeg data xfer) */
316 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
317 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
318 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
319 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
320 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
321 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
322 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
323 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
324 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
325 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
326 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
327 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
328 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
329 { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
330 { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
331 { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },
332 { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
333 { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
334 { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
336 { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },
337 { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },
338 { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },
339 { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },
340 { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },
341 { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },
342 { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },
343 { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },
348 /* ----------------------------------------------------------------------- */
349 /* array with description for bt848 / bt878 tv/grabber cards */
351 struct tvcard bttv_tvcards[] = {
352 /* ---- card 0x00 ---------------------------------- */
353 [BTTV_BOARD_UNKNOWN] = {
354 .name = " *** UNKNOWN/GENERIC *** ",
357 .muxsel = MUXSEL(2, 3, 1, 0),
359 .tuner_addr = ADDR_UNSET,
361 [BTTV_BOARD_MIRO] = {
364 /* .audio_inputs= 1, */
367 .muxsel = MUXSEL(2, 3, 1, 1),
368 .gpiomux = { 2, 0, 0, 0 },
372 .tuner_addr = ADDR_UNSET,
374 [BTTV_BOARD_HAUPPAUGE] = {
375 .name = "Hauppauge (bt848)",
377 /* .audio_inputs= 1, */
380 .muxsel = MUXSEL(2, 3, 1, 1),
381 .gpiomux = { 0, 1, 2, 3 },
385 .tuner_addr = ADDR_UNSET,
388 .name = "STB, Gateway P/N 6000699 (bt848)",
390 /* .audio_inputs= 1, */
393 .muxsel = MUXSEL(2, 3, 1, 1),
394 .gpiomux = { 4, 0, 2, 3 },
398 .tuner_type = TUNER_PHILIPS_NTSC,
399 .tuner_addr = ADDR_UNSET,
404 /* ---- card 0x04 ---------------------------------- */
405 [BTTV_BOARD_INTEL] = {
406 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
408 /* .audio_inputs= 0, */
411 .muxsel = MUXSEL(2, 3, 1, 1),
414 .tuner_type = TUNER_ABSENT,
415 .tuner_addr = ADDR_UNSET,
417 [BTTV_BOARD_DIAMOND] = {
418 .name = "Diamond DTV2000",
420 /* .audio_inputs= 1, */
423 .muxsel = MUXSEL(2, 3, 1, 0),
424 .gpiomux = { 0, 1, 0, 1 },
428 .tuner_addr = ADDR_UNSET,
430 [BTTV_BOARD_AVERMEDIA] = {
431 .name = "AVerMedia TVPhone",
433 /* .audio_inputs= 1, */
435 .muxsel = MUXSEL(2, 3, 1, 1),
437 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
438 /* 0x04 for some cards ?? */
441 .tuner_addr = ADDR_UNSET,
442 .audio_mode_gpio= avermedia_tvphone_audio,
445 [BTTV_BOARD_MATRIX_VISION] = {
446 .name = "MATRIX-Vision MV-Delta",
448 /* .audio_inputs= 1, */
451 .muxsel = MUXSEL(2, 3, 1, 0, 0),
454 .tuner_type = TUNER_ABSENT,
455 .tuner_addr = ADDR_UNSET,
458 /* ---- card 0x08 ---------------------------------- */
459 [BTTV_BOARD_FLYVIDEO] = {
460 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
462 /* .audio_inputs= 1, */
465 .muxsel = MUXSEL(2, 3, 1, 1),
466 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
471 .tuner_addr = ADDR_UNSET,
473 [BTTV_BOARD_TURBOTV] = {
474 .name = "IMS/IXmicro TurboTV",
476 /* .audio_inputs= 1, */
479 .muxsel = MUXSEL(2, 3, 1, 1),
480 .gpiomux = { 1, 1, 2, 3 },
483 .tuner_type = TUNER_TEMIC_PAL,
484 .tuner_addr = ADDR_UNSET,
486 [BTTV_BOARD_HAUPPAUGE878] = {
487 .name = "Hauppauge (bt878)",
489 /* .audio_inputs= 1, */
491 .gpiomask = 0x0f, /* old: 7 */
492 .muxsel = MUXSEL(2, 0, 1, 1),
493 .gpiomux = { 0, 1, 2, 3 },
498 .tuner_addr = ADDR_UNSET,
500 [BTTV_BOARD_MIROPRO] = {
501 .name = "MIRO PCTV pro",
503 /* .audio_inputs= 1, */
506 .muxsel = MUXSEL(2, 3, 1, 1),
507 .gpiomux = { 0x20001,0x10001, 0, 0 },
511 .tuner_addr = ADDR_UNSET,
514 /* ---- card 0x0c ---------------------------------- */
515 [BTTV_BOARD_ADSTECH_TV] = {
516 .name = "ADS Technologies Channel Surfer TV (bt848)",
518 /* .audio_inputs= 1, */
521 .muxsel = MUXSEL(2, 3, 1, 1),
522 .gpiomux = { 13, 14, 11, 7 },
525 .tuner_addr = ADDR_UNSET,
527 [BTTV_BOARD_AVERMEDIA98] = {
528 .name = "AVerMedia TVCapture 98",
530 /* .audio_inputs= 4, */
533 .muxsel = MUXSEL(2, 3, 1, 1),
534 .gpiomux = { 13, 14, 11, 7 },
538 .tuner_type = TUNER_PHILIPS_PAL,
539 .tuner_addr = ADDR_UNSET,
540 .audio_mode_gpio= avermedia_tv_stereo_audio,
544 .name = "Aimslab Video Highway Xtreme (VHX)",
546 /* .audio_inputs= 1, */
549 .muxsel = MUXSEL(2, 3, 1, 1),
550 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
555 .tuner_addr = ADDR_UNSET,
557 [BTTV_BOARD_ZOLTRIX] = {
558 .name = "Zoltrix TV-Max",
560 /* .audio_inputs= 1, */
563 .muxsel = MUXSEL(2, 3, 1, 1),
564 .gpiomux = { 0, 0, 1, 0 },
568 .tuner_addr = ADDR_UNSET,
571 /* ---- card 0x10 ---------------------------------- */
572 [BTTV_BOARD_PIXVIEWPLAYTV] = {
573 .name = "Prolink Pixelview PlayTV (bt878)",
575 /* .audio_inputs= 1, */
577 .gpiomask = 0x01fe00,
578 .muxsel = MUXSEL(2, 3, 1, 1),
579 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
580 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
581 .gpiomute = 0x002000,
585 .tuner_addr = ADDR_UNSET,
587 [BTTV_BOARD_WINVIEW_601] = {
588 .name = "Leadtek WinView 601",
590 /* .audio_inputs= 1, */
592 .gpiomask = 0x8300f8,
593 .muxsel = MUXSEL(2, 3, 1, 1, 0),
594 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
595 .gpiomute = 0xcfa007,
598 .tuner_addr = ADDR_UNSET,
599 .volume_gpio = winview_volume,
602 [BTTV_BOARD_AVEC_INTERCAP] = {
603 .name = "AVEC Intercapture",
605 /* .audio_inputs= 2, */
608 .muxsel = MUXSEL(2, 3, 1, 1),
609 .gpiomux = { 1, 0, 0, 0 },
612 .tuner_addr = ADDR_UNSET,
614 [BTTV_BOARD_LIFE_FLYKIT] = {
615 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
617 /* .audio_inputs= 1, */
619 .gpiomask = 0x8dff00,
620 .muxsel = MUXSEL(2, 3, 1, 1),
623 .tuner_type = TUNER_ABSENT,
624 .tuner_addr = ADDR_UNSET,
627 /* ---- card 0x14 ---------------------------------- */
628 [BTTV_BOARD_CEI_RAFFLES] = {
629 .name = "CEI Raffles Card",
631 /* .audio_inputs= 3, */
633 .muxsel = MUXSEL(2, 3, 1, 1),
635 .tuner_addr = ADDR_UNSET,
637 [BTTV_BOARD_CONFERENCETV] = {
638 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
640 /* .audio_inputs= 2, tuner, line in */
643 .muxsel = MUXSEL(2, 3, 1, 1),
644 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
647 .tuner_type = TUNER_PHILIPS_PAL_I,
648 .tuner_addr = ADDR_UNSET,
650 [BTTV_BOARD_PHOEBE_TVMAS] = {
651 .name = "Askey CPH050/ Phoebe Tv Master + FM",
653 /* .audio_inputs= 1, */
656 .muxsel = MUXSEL(2, 3, 1, 1),
657 .gpiomux = { 0, 1, 0x800, 0x400 },
662 .tuner_addr = ADDR_UNSET,
664 [BTTV_BOARD_MODTEC_205] = {
665 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
667 /* .audio_inputs= 1, */
671 .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */
672 /* .digital_mode= DIGITAL_MODE_CAMERA, */
673 .gpiomux = { 0, 0, 0, 0 },
676 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
677 .tuner_addr = ADDR_UNSET,
680 /* ---- card 0x18 ---------------------------------- */
681 [BTTV_BOARD_MAGICTVIEW061] = {
682 .name = "Askey CPH05X/06X (bt878) [many vendors]",
684 /* .audio_inputs= 1, */
687 .muxsel = MUXSEL(2, 3, 1, 1),
688 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
693 .tuner_addr = ADDR_UNSET,
696 [BTTV_BOARD_VOBIS_BOOSTAR] = {
697 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
699 /* .audio_inputs= 1, */
701 .gpiomask = 0x1f0fff,
702 .muxsel = MUXSEL(2, 3, 1, 1),
703 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
706 .tuner_type = TUNER_PHILIPS_PAL,
707 .tuner_addr = ADDR_UNSET,
708 .audio_mode_gpio= terratv_audio,
710 [BTTV_BOARD_HAUPPAUG_WCAM] = {
711 .name = "Hauppauge WinCam newer (bt878)",
713 /* .audio_inputs= 1, */
716 .muxsel = MUXSEL(2, 0, 1, 1),
717 .gpiomux = { 0, 1, 2, 3 },
721 .tuner_addr = ADDR_UNSET,
723 [BTTV_BOARD_MAXI] = {
724 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
726 /* .audio_inputs= 2, */
729 .muxsel = MUXSEL(2, 3, 1, 1),
730 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
733 .tuner_type = TUNER_PHILIPS_SECAM,
734 .tuner_addr = ADDR_UNSET,
737 /* ---- card 0x1c ---------------------------------- */
738 [BTTV_BOARD_TERRATV] = {
739 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
741 /* .audio_inputs= 1, */
743 .gpiomask = 0x1f0fff,
744 .muxsel = MUXSEL(2, 3, 1, 1),
745 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
748 .tuner_type = TUNER_PHILIPS_PAL,
749 .tuner_addr = ADDR_UNSET,
750 .audio_mode_gpio= terratv_audio,
752 External 20 pin connector (for Active Radio Upgrade board)
758 gpio05: om5610-stereo
762 gpio09+10: nIOR, nSEL ?? (bt878)
766 gpio16: u2-A0 (1st 4052bt)
769 gpio19: u4-A0 (2nd 4052)
773 00000 : Cdrom (internal audio input)
774 10000 : ext. Video audio input
783 [BTTV_BOARD_PXC200] = {
784 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
785 .name = "Imagenation PXC200",
787 /* .audio_inputs= 1, */
788 .svhs = 1, /* was: 4 */
790 .muxsel = MUXSEL(2, 3, 1, 0, 0),
793 .tuner_type = TUNER_ABSENT,
794 .tuner_addr = ADDR_UNSET,
795 .muxsel_hook = PXC200_muxsel,
798 [BTTV_BOARD_FLYVIDEO_98] = {
799 .name = "Lifeview FlyVideo 98 LR50",
801 /* .audio_inputs= 1, */
803 .gpiomask = 0x1800, /* 0x8dfe00 */
804 .muxsel = MUXSEL(2, 3, 1, 1),
805 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
809 .tuner_addr = ADDR_UNSET,
811 [BTTV_BOARD_IPROTV] = {
812 .name = "Formac iProTV, Formac ProTV I (bt848)",
814 /* .audio_inputs= 1, */
817 .muxsel = MUXSEL(2, 3, 1, 1),
818 .gpiomux = { 1, 0, 0, 0 },
820 .tuner_type = TUNER_PHILIPS_PAL,
821 .tuner_addr = ADDR_UNSET,
824 /* ---- card 0x20 ---------------------------------- */
825 [BTTV_BOARD_INTEL_C_S_PCI] = {
826 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
828 /* .audio_inputs= 0, */
831 .muxsel = MUXSEL(2, 3, 1, 1),
834 .tuner_type = TUNER_ABSENT,
835 .tuner_addr = ADDR_UNSET,
837 [BTTV_BOARD_TERRATVALUE] = {
838 .name = "Terratec TerraTValue Version Bt878",
840 /* .audio_inputs= 1, */
842 .gpiomask = 0xffff00,
843 .muxsel = MUXSEL(2, 3, 1, 1),
844 .gpiomux = { 0x500, 0, 0x300, 0x900 },
848 .tuner_type = TUNER_PHILIPS_PAL,
849 .tuner_addr = ADDR_UNSET,
851 [BTTV_BOARD_WINFAST2000] = {
852 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
854 /* .audio_inputs= 1, */
856 /* TV, CVid, SVid, CVid over SVid connector */
857 .muxsel = MUXSEL(2, 3, 1, 1, 0),
858 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
859 .gpiomask = 0xb33000,
860 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
861 .gpiomute = 0x800000,
862 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
863 gpio23 -- hef4052:nEnable (0x800000)
866 0x0000: external audio
870 Note: There exists another variant "Winfast 2000" with tv stereo !?
871 Note: eeprom only contains FF and pci subsystem id 107d:6606
876 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
877 .tuner_addr = ADDR_UNSET,
878 .audio_mode_gpio= winfast2000_audio,
881 [BTTV_BOARD_CHRONOS_VS2] = {
882 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
884 /* .audio_inputs= 3, */
887 .muxsel = MUXSEL(2, 3, 1, 1),
888 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
892 .tuner_addr = ADDR_UNSET,
895 /* ---- card 0x24 ---------------------------------- */
896 [BTTV_BOARD_TYPHOON_TVIEW] = {
897 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
899 /* .audio_inputs= 3, */
902 .muxsel = MUXSEL(2, 3, 1, 1),
903 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
907 .tuner_addr = ADDR_UNSET,
910 [BTTV_BOARD_PXELVWPLTVPRO] = {
911 .name = "Prolink PixelView PlayTV pro",
913 /* .audio_inputs= 1, */
916 .muxsel = MUXSEL(2, 3, 1, 1),
917 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
922 .tuner_addr = ADDR_UNSET,
924 [BTTV_BOARD_MAGICTVIEW063] = {
925 .name = "Askey CPH06X TView99",
927 /* .audio_inputs= 1, */
929 .gpiomask = 0x551e00,
930 .muxsel = MUXSEL(2, 3, 1, 0),
931 .gpiomux = { 0x551400, 0x551200, 0, 0 },
932 .gpiomute = 0x551c00,
935 .tuner_type = TUNER_PHILIPS_PAL_I,
936 .tuner_addr = ADDR_UNSET,
939 [BTTV_BOARD_PINNACLE] = {
940 .name = "Pinnacle PCTV Studio/Rave",
942 /* .audio_inputs= 1, */
944 .gpiomask = 0x03000F,
945 .muxsel = MUXSEL(2, 3, 1, 1),
946 .gpiomux = { 2, 0xd0001, 0, 0 },
951 .tuner_addr = ADDR_UNSET,
954 /* ---- card 0x28 ---------------------------------- */
955 [BTTV_BOARD_STB2] = {
956 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
958 /* .audio_inputs= 1, */
961 .muxsel = MUXSEL(2, 3, 1, 1),
962 .gpiomux = { 4, 0, 2, 3 },
966 .tuner_type = TUNER_PHILIPS_NTSC,
967 .tuner_addr = ADDR_UNSET,
971 [BTTV_BOARD_AVPHONE98] = {
972 .name = "AVerMedia TVPhone 98",
974 /* .audio_inputs= 4, */
977 .muxsel = MUXSEL(2, 3, 1, 1),
978 .gpiomux = { 13, 4, 11, 7 },
982 .tuner_addr = ADDR_UNSET,
984 .audio_mode_gpio= avermedia_tvphone_audio,
986 [BTTV_BOARD_PV951] = {
987 .name = "ProVideo PV951", /* pic16c54 */
989 /* .audio_inputs= 1, */
992 .muxsel = MUXSEL(2, 3, 1, 1),
993 .gpiomux = { 0, 0, 0, 0},
997 .tuner_type = TUNER_PHILIPS_PAL_I,
998 .tuner_addr = ADDR_UNSET,
1000 [BTTV_BOARD_ONAIR_TV] = {
1001 .name = "Little OnAir TV",
1003 /* .audio_inputs= 1, */
1006 .muxsel = MUXSEL(2, 3, 1, 1),
1007 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1008 .gpiomute = 0xff3ffc,
1010 .tuner_type = UNSET,
1011 .tuner_addr = ADDR_UNSET,
1014 /* ---- card 0x2c ---------------------------------- */
1015 [BTTV_BOARD_SIGMA_TVII_FM] = {
1016 .name = "Sigma TVII-FM",
1018 /* .audio_inputs= 1, */
1021 .muxsel = MUXSEL(2, 3, 1, 1),
1022 .gpiomux = { 1, 1, 0, 2 },
1026 .tuner_type = UNSET,
1027 .tuner_addr = ADDR_UNSET,
1029 [BTTV_BOARD_MATRIX_VISION2] = {
1030 .name = "MATRIX-Vision MV-Delta 2",
1032 /* .audio_inputs= 1, */
1035 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1039 .tuner_type = TUNER_ABSENT,
1040 .tuner_addr = ADDR_UNSET,
1042 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1043 .name = "Zoltrix Genie TV/FM",
1045 /* .audio_inputs= 1, */
1047 .gpiomask = 0xbcf03f,
1048 .muxsel = MUXSEL(2, 3, 1, 1),
1049 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1050 .gpiomute = 0xbcb03f,
1053 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1054 .tuner_addr = ADDR_UNSET,
1056 [BTTV_BOARD_TERRATVRADIO] = {
1057 .name = "Terratec TV/Radio+",
1059 /* .audio_inputs= 1, */
1061 .gpiomask = 0x70000,
1062 .muxsel = MUXSEL(2, 3, 1, 1),
1063 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1064 .gpiomute = 0x40000,
1068 .tuner_type = TUNER_PHILIPS_PAL_I,
1069 .tuner_addr = ADDR_UNSET,
1073 /* ---- card 0x30 ---------------------------------- */
1074 [BTTV_BOARD_DYNALINK] = {
1075 .name = "Askey CPH03x/ Dynalink Magic TView",
1077 /* .audio_inputs= 1, */
1080 .muxsel = MUXSEL(2, 3, 1, 1),
1081 .gpiomux = {2,0,0,0 },
1085 .tuner_type = UNSET,
1086 .tuner_addr = ADDR_UNSET,
1088 [BTTV_BOARD_GVBCTV3PCI] = {
1089 .name = "IODATA GV-BCTV3/PCI",
1091 /* .audio_inputs= 1, */
1093 .gpiomask = 0x010f00,
1094 .muxsel = MUXSEL(2, 3, 0, 0),
1095 .gpiomux = {0x10000, 0, 0x10000, 0 },
1098 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1099 .tuner_addr = ADDR_UNSET,
1100 .audio_mode_gpio= gvbctv3pci_audio,
1102 [BTTV_BOARD_PXELVWPLTVPAK] = {
1103 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1105 /* .audio_inputs= 1, */
1108 .gpiomask = 0xAA0000,
1109 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
1110 /* .digital_mode= DIGITAL_MODE_CAMERA, */
1111 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1112 .gpiomute = 0xa8000,
1115 .tuner_type = TUNER_PHILIPS_PAL_I,
1116 .tuner_addr = ADDR_UNSET,
1118 /* GPIO wiring: (different from Rev.4C !)
1119 GPIO17: U4.A0 (first hef4052bt)
1121 GPIO20: U5.A1 (second hef4052bt)
1123 GPIO22: BT832 Reset Line
1124 GPIO23: A5,A0, U5,nEN
1125 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1128 [BTTV_BOARD_EAGLE] = {
1129 .name = "Eagle Wireless Capricorn2 (bt878A)",
1131 /* .audio_inputs= 1, */
1134 .muxsel = MUXSEL(2, 0, 1, 1),
1135 .gpiomux = { 0, 1, 2, 3 },
1138 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1139 .tuner_addr = ADDR_UNSET,
1142 /* ---- card 0x34 ---------------------------------- */
1143 [BTTV_BOARD_PINNACLEPRO] = {
1144 /* David Härdeman <david@2gen.com> */
1145 .name = "Pinnacle PCTV Studio Pro",
1147 /* .audio_inputs= 1, */
1149 .gpiomask = 0x03000F,
1150 .muxsel = MUXSEL(2, 3, 1, 1),
1151 .gpiomux = { 1, 0xd0001, 0, 0 },
1153 /* sound path (5 sources):
1154 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1157 2= Mono TV sound from Tuner
1159 MUX2 (mask 0x30000):
1161 1= FM stereo Radio from Tuner */
1164 .tuner_type = UNSET,
1165 .tuner_addr = ADDR_UNSET,
1167 [BTTV_BOARD_TVIEW_RDS_FM] = {
1168 /* Claas Langbehn <claas@bigfoot.com>,
1169 Sven Grothklags <sven@upb.de> */
1170 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1172 /* .audio_inputs= 3, */
1175 .muxsel = MUXSEL(2, 3, 1, 1),
1176 .gpiomux = { 0, 0, 0x10, 8 },
1180 .tuner_type = TUNER_PHILIPS_PAL,
1181 .tuner_addr = ADDR_UNSET,
1184 [BTTV_BOARD_LIFETEC_9415] = {
1185 /* Tim Röstermundt <rosterm@uni-muenster.de>
1186 in de.comp.os.unix.linux.hardware:
1187 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1188 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1189 options tuner type=5 */
1190 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1192 /* .audio_inputs= 1, */
1195 .muxsel = MUXSEL(2, 3, 1, 1),
1196 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1198 /* For cards with tda9820/tda9821:
1199 0x0000: Tuner normal stereo
1200 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1201 0x0880: Tuner A2 stereo */
1203 .tuner_type = UNSET,
1204 .tuner_addr = ADDR_UNSET,
1206 [BTTV_BOARD_BESTBUY_EASYTV] = {
1207 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1208 old Easy TV BT848 version (model CPH031) */
1209 .name = "Askey CPH031/ BESTBUY Easy TV",
1211 /* .audio_inputs= 1, */
1214 .muxsel = MUXSEL(2, 3, 1, 0),
1215 .gpiomux = { 2, 0, 0, 0 },
1219 .tuner_type = TUNER_TEMIC_PAL,
1220 .tuner_addr = ADDR_UNSET,
1223 /* ---- card 0x38 ---------------------------------- */
1224 [BTTV_BOARD_FLYVIDEO_98FM] = {
1225 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1226 .name = "Lifeview FlyVideo 98FM LR50",
1228 /* .audio_inputs= 3, */
1231 .muxsel = MUXSEL(2, 3, 1, 1),
1232 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1235 .tuner_type = TUNER_PHILIPS_PAL,
1236 .tuner_addr = ADDR_UNSET,
1238 /* This is the ultimate cheapo capture card
1239 * just a BT848A on a small PCB!
1240 * Steve Hosgood <steve@equiinet.com> */
1241 [BTTV_BOARD_GRANDTEC] = {
1242 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1244 /* .audio_inputs= 0, */
1247 .muxsel = MUXSEL(3, 1),
1252 .tuner_type = TUNER_ABSENT,
1253 .tuner_addr = ADDR_UNSET,
1255 [BTTV_BOARD_ASKEY_CPH060] = {
1256 /* Daniel Herrington <daniel.herrington@home.com> */
1257 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1259 /* .audio_inputs= 1, */
1262 .muxsel = MUXSEL(2, 3, 1, 1),
1263 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1267 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1268 .tuner_addr = ADDR_UNSET,
1270 [BTTV_BOARD_ASKEY_CPH03X] = {
1271 /* Matti Mottus <mottus@physic.ut.ee> */
1272 .name = "Askey CPH03x TV Capturer",
1274 /* .audio_inputs= 1, */
1276 .gpiomask = 0x03000F,
1277 .muxsel = MUXSEL(2, 3, 1, 0),
1278 .gpiomux = { 2, 0, 0, 0 },
1281 .tuner_type = TUNER_TEMIC_PAL,
1282 .tuner_addr = ADDR_UNSET,
1286 /* ---- card 0x3c ---------------------------------- */
1287 [BTTV_BOARD_MM100PCTV] = {
1288 /* Philip Blundell <philb@gnu.org> */
1289 .name = "Modular Technology MM100PCTV",
1291 /* .audio_inputs= 2, */
1294 .muxsel = MUXSEL(2, 3, 1, 1),
1295 .gpiomux = { 2, 0, 0, 1 },
1298 .tuner_type = TUNER_TEMIC_PAL,
1299 .tuner_addr = ADDR_UNSET,
1301 [BTTV_BOARD_GMV1] = {
1302 /* Adrian Cox <adrian@humboldt.co.uk */
1303 .name = "AG Electronics GMV1",
1305 /* .audio_inputs= 0, */
1308 .muxsel = MUXSEL(2, 2),
1313 .tuner_type = TUNER_ABSENT,
1314 .tuner_addr = ADDR_UNSET,
1316 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1317 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1318 new Easy TV BT878 version (model CPH061)
1319 special thanks to Informatica Mieres for providing the card */
1320 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1322 /* .audio_inputs= 2, */
1325 .muxsel = MUXSEL(2, 3, 1, 0),
1326 .gpiomux = { 1, 0, 4, 4 },
1330 .tuner_type = TUNER_PHILIPS_PAL,
1331 .tuner_addr = ADDR_UNSET,
1333 [BTTV_BOARD_ATI_TVWONDER] = {
1334 /* Lukas Gebauer <geby@volny.cz> */
1335 .name = "ATI TV-Wonder",
1337 /* .audio_inputs= 1, */
1340 .muxsel = MUXSEL(2, 3, 1, 0),
1341 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1344 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1345 .tuner_addr = ADDR_UNSET,
1348 /* ---- card 0x40 ---------------------------------- */
1349 [BTTV_BOARD_ATI_TVWONDERVE] = {
1350 /* Lukas Gebauer <geby@volny.cz> */
1351 .name = "ATI TV-Wonder VE",
1353 /* .audio_inputs= 1, */
1356 .muxsel = MUXSEL(2, 3, 0, 1),
1357 .gpiomux = { 0, 0, 1, 0 },
1360 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1361 .tuner_addr = ADDR_UNSET,
1363 [BTTV_BOARD_FLYVIDEO2000] = {
1364 /* DeeJay <deejay@westel900.net (2000S) */
1365 .name = "Lifeview FlyVideo 2000S LR90",
1367 /* .audio_inputs= 3, */
1370 .muxsel = MUXSEL(2, 3, 0, 1),
1371 /* Radio changed from 1e80 to 0x800 to make
1372 FlyVideo2000S in .hu happy (gm)*/
1373 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1374 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1376 .audio_mode_gpio= fv2000s_audio,
1380 .tuner_type = TUNER_PHILIPS_PAL,
1381 .tuner_addr = ADDR_UNSET,
1383 [BTTV_BOARD_TERRATVALUER] = {
1384 .name = "Terratec TValueRadio",
1386 /* .audio_inputs= 1, */
1388 .gpiomask = 0xffff00,
1389 .muxsel = MUXSEL(2, 3, 1, 1),
1390 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1394 .tuner_type = TUNER_PHILIPS_PAL,
1395 .tuner_addr = ADDR_UNSET,
1398 [BTTV_BOARD_GVBCTV4PCI] = {
1399 /* TANAKA Kei <peg00625@nifty.com> */
1400 .name = "IODATA GV-BCTV4/PCI",
1402 /* .audio_inputs= 1, */
1404 .gpiomask = 0x010f00,
1405 .muxsel = MUXSEL(2, 3, 0, 0),
1406 .gpiomux = {0x10000, 0, 0x10000, 0 },
1409 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1410 .tuner_addr = ADDR_UNSET,
1411 .audio_mode_gpio= gvbctv3pci_audio,
1414 /* ---- card 0x44 ---------------------------------- */
1415 [BTTV_BOARD_VOODOOTV_FM] = {
1416 .name = "3Dfx VoodooTV FM (Euro)",
1417 /* try "insmod msp3400 simple=0" if you have
1418 * sound problems with this card. */
1420 /* .audio_inputs= 1, */
1422 .gpiomask = 0x4f8a00,
1423 /* 0x100000: 1=MSP enabled (0=disable again)
1424 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1425 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1426 .gpiomute = 0x947fff,
1427 /* tvtuner, radio, external,internal, mute, stereo
1428 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1429 .muxsel = MUXSEL(2, 3, 0, 1),
1430 .tuner_type = TUNER_MT2032,
1431 .tuner_addr = ADDR_UNSET,
1435 [BTTV_BOARD_VOODOOTV_200] = {
1436 .name = "VoodooTV 200 (USA)",
1437 /* try "insmod msp3400 simple=0" if you have
1438 * sound problems with this card. */
1440 /* .audio_inputs= 1, */
1442 .gpiomask = 0x4f8a00,
1443 /* 0x100000: 1=MSP enabled (0=disable again)
1444 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1445 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1446 .gpiomute = 0x947fff,
1447 /* tvtuner, radio, external,internal, mute, stereo
1448 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1449 .muxsel = MUXSEL(2, 3, 0, 1),
1450 .tuner_type = TUNER_MT2032,
1451 .tuner_addr = ADDR_UNSET,
1455 [BTTV_BOARD_AIMMS] = {
1456 /* Philip Blundell <pb@nexus.co.uk> */
1457 .name = "Active Imaging AIMMS",
1459 /* .audio_inputs= 0, */
1460 .tuner_type = TUNER_ABSENT,
1461 .tuner_addr = ADDR_UNSET,
1463 .muxsel = MUXSEL(2),
1466 [BTTV_BOARD_PV_BT878P_PLUS] = {
1467 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1468 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1470 /* .audio_inputs= 4, */
1473 .muxsel = MUXSEL(2, 3, 1, 1),
1474 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1478 .tuner_type = TUNER_LG_PAL_I_FM,
1479 .tuner_addr = ADDR_UNSET,
1482 GPIO0: U4.A0 (hef4052bt)
1484 GPIO2: U4.A1 (second hef4052bt)
1485 GPIO3: U4.nEN, U5.A0, A5.nEN
1489 [BTTV_BOARD_FLYVIDEO98EZ] = {
1490 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1492 /* .audio_inputs= 0, */
1494 /* AV1, AV2, SVHS, CVid adapter on SVHS */
1495 .muxsel = MUXSEL(2, 3, 1, 1),
1498 .tuner_type = TUNER_ABSENT,
1499 .tuner_addr = ADDR_UNSET,
1502 /* ---- card 0x48 ---------------------------------- */
1503 [BTTV_BOARD_PV_BT878P_9B] = {
1504 /* Dariusz Kowalewski <darekk@automex.pl> */
1505 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1507 /* .audio_inputs= 1, */
1510 .muxsel = MUXSEL(2, 3, 1, 1),
1511 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1516 .tuner_type = TUNER_PHILIPS_PAL,
1517 .tuner_addr = ADDR_UNSET,
1518 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1519 .has_radio = 1, /* Note: not all cards have radio */
1526 GPIO20,22,23: R30,R29,R28
1529 [BTTV_BOARD_SENSORAY311] = {
1530 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1531 /* you must jumper JP5 for the card to work */
1532 .name = "Sensoray 311",
1534 /* .audio_inputs= 0, */
1537 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1540 .tuner_type = TUNER_ABSENT,
1541 .tuner_addr = ADDR_UNSET,
1543 [BTTV_BOARD_RV605] = {
1544 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1545 .name = "RemoteVision MX (RV605)",
1547 /* .audio_inputs= 0, */
1550 .gpiomask2 = 0x07ff,
1551 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
1553 .tuner_type = TUNER_ABSENT,
1554 .tuner_addr = ADDR_UNSET,
1555 .muxsel_hook = rv605_muxsel,
1557 [BTTV_BOARD_POWERCLR_MTV878] = {
1558 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1560 /* .audio_inputs= 2, */
1562 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1563 .muxsel = MUXSEL(2, 1, 1),
1564 .gpiomux = { 0, 1, 2, 2 },
1567 .tuner_type = TUNER_PHILIPS_PAL,
1568 .tuner_addr = ADDR_UNSET,
1573 /* ---- card 0x4c ---------------------------------- */
1574 [BTTV_BOARD_WINDVR] = {
1575 /* Masaki Suzuki <masaki@btree.org> */
1576 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1578 /* .audio_inputs= 1, */
1580 .gpiomask = 0x140007,
1581 .muxsel = MUXSEL(2, 3, 1, 1),
1582 .gpiomux = { 0, 1, 2, 3 },
1584 .tuner_type = TUNER_PHILIPS_NTSC,
1585 .tuner_addr = ADDR_UNSET,
1586 .audio_mode_gpio= windvr_audio,
1588 [BTTV_BOARD_GRANDTEC_MULTI] = {
1589 .name = "GrandTec Multi Capture Card (Bt878)",
1591 /* .audio_inputs= 0, */
1594 .muxsel = MUXSEL(2, 3, 1, 0),
1599 .tuner_type = TUNER_ABSENT,
1600 .tuner_addr = ADDR_UNSET,
1602 [BTTV_BOARD_KWORLD] = {
1603 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1605 /* .audio_inputs= 3, */
1608 /* Tuner, SVid, SVHS, SVid to SVHS connector */
1609 .muxsel = MUXSEL(2, 3, 1, 1),
1610 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1611 * This card lacks external Audio In, so we mute it on Ext. & Int.
1612 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1613 * This card lacks PCI subsystem ID, sigh.
1614 * gpiomux =1: lower volume, 2+3: mute
1615 * btwincap uses 0x80000/0x80003
1621 .tuner_type = TUNER_PHILIPS_PAL,
1622 .tuner_addr = ADDR_UNSET,
1623 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1624 radio signal strength indicators work fine. */
1627 GPIO0,1: HEF4052 A0,A1
1628 GPIO2: HEF4052 nENABLE
1630 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1634 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1636 [BTTV_BOARD_DSP_TCVIDEO] = {
1637 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1638 .name = "DSP Design TCVIDEO",
1641 .muxsel = MUXSEL(2, 3, 1, 0),
1643 .tuner_type = UNSET,
1644 .tuner_addr = ADDR_UNSET,
1647 /* ---- card 0x50 ---------------------------------- */
1648 [BTTV_BOARD_HAUPPAUGEPVR] = {
1649 .name = "Hauppauge WinTV PVR",
1651 /* .audio_inputs= 1, */
1653 .muxsel = MUXSEL(2, 0, 1, 1),
1656 .tuner_type = UNSET,
1657 .tuner_addr = ADDR_UNSET,
1662 [BTTV_BOARD_GVBCTV5PCI] = {
1663 .name = "IODATA GV-BCTV5/PCI",
1665 /* .audio_inputs= 1, */
1667 .gpiomask = 0x0f0f80,
1668 .muxsel = MUXSEL(2, 3, 1, 0),
1669 .gpiomux = {0x030000, 0x010000, 0, 0 },
1670 .gpiomute = 0x020000,
1673 .tuner_type = TUNER_PHILIPS_NTSC_M,
1674 .tuner_addr = ADDR_UNSET,
1675 .audio_mode_gpio= gvbctv5pci_audio,
1678 [BTTV_BOARD_OSPREY1x0] = {
1679 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1680 .video_inputs = 4, /* id-inputs-clock */
1681 /* .audio_inputs= 0, */
1683 .muxsel = MUXSEL(3, 2, 0, 1),
1685 .tuner_type = TUNER_ABSENT,
1686 .tuner_addr = ADDR_UNSET,
1690 [BTTV_BOARD_OSPREY1x0_848] = {
1691 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1693 /* .audio_inputs= 0, */
1695 .muxsel = MUXSEL(2, 3, 1),
1697 .tuner_type = TUNER_ABSENT,
1698 .tuner_addr = ADDR_UNSET,
1703 /* ---- card 0x54 ---------------------------------- */
1704 [BTTV_BOARD_OSPREY101_848] = {
1705 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1707 /* .audio_inputs= 0, */
1709 .muxsel = MUXSEL(3, 1),
1711 .tuner_type = TUNER_ABSENT,
1712 .tuner_addr = ADDR_UNSET,
1716 [BTTV_BOARD_OSPREY1x1] = {
1717 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1719 /* .audio_inputs= 0, */
1721 .muxsel = MUXSEL(0),
1723 .tuner_type = TUNER_ABSENT,
1724 .tuner_addr = ADDR_UNSET,
1728 [BTTV_BOARD_OSPREY1x1_SVID] = {
1729 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1731 /* .audio_inputs= 0, */
1733 .muxsel = MUXSEL(0, 1),
1735 .tuner_type = TUNER_ABSENT,
1736 .tuner_addr = ADDR_UNSET,
1740 [BTTV_BOARD_OSPREY2xx] = {
1741 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1743 /* .audio_inputs= 1, */
1745 .muxsel = MUXSEL(0),
1747 .tuner_type = TUNER_ABSENT,
1748 .tuner_addr = ADDR_UNSET,
1753 /* ---- card 0x58 ---------------------------------- */
1754 [BTTV_BOARD_OSPREY2x0_SVID] = {
1755 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1757 /* .audio_inputs= 1, */
1759 .muxsel = MUXSEL(0, 1),
1761 .tuner_type = TUNER_ABSENT,
1762 .tuner_addr = ADDR_UNSET,
1766 [BTTV_BOARD_OSPREY2x0] = {
1767 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1769 /* .audio_inputs= 1, */
1771 .muxsel = MUXSEL(2, 3),
1773 .tuner_type = TUNER_ABSENT,
1774 .tuner_addr = ADDR_UNSET,
1778 [BTTV_BOARD_OSPREY500] = {
1779 .name = "Osprey 500", /* 500 */
1781 /* .audio_inputs= 1, */
1783 .muxsel = MUXSEL(2, 3),
1785 .tuner_type = TUNER_ABSENT,
1786 .tuner_addr = ADDR_UNSET,
1790 [BTTV_BOARD_OSPREY540] = {
1791 .name = "Osprey 540", /* 540 */
1793 /* .audio_inputs= 1, */
1795 .tuner_type = TUNER_ABSENT,
1796 .tuner_addr = ADDR_UNSET,
1801 /* ---- card 0x5C ---------------------------------- */
1802 [BTTV_BOARD_OSPREY2000] = {
1803 .name = "Osprey 2000", /* 2000 */
1805 /* .audio_inputs= 1, */
1807 .muxsel = MUXSEL(2, 3),
1809 .tuner_type = TUNER_ABSENT,
1810 .tuner_addr = ADDR_UNSET,
1812 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1814 [BTTV_BOARD_IDS_EAGLE] = {
1815 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1816 .name = "IDS Eagle",
1818 /* .audio_inputs= 0, */
1819 .tuner_type = TUNER_ABSENT,
1820 .tuner_addr = ADDR_UNSET,
1823 .muxsel = MUXSEL(2, 2, 2, 2),
1824 .muxsel_hook = eagle_muxsel,
1828 [BTTV_BOARD_PINNACLESAT] = {
1829 .name = "Pinnacle PCTV Sat",
1831 /* .audio_inputs= 0, */
1833 .tuner_type = TUNER_ABSENT,
1834 .tuner_addr = ADDR_UNSET,
1837 .muxsel = MUXSEL(3, 1),
1842 [BTTV_BOARD_FORMAC_PROTV] = {
1843 .name = "Formac ProTV II (bt878)",
1845 /* .audio_inputs= 1, */
1848 /* TV, Comp1, Composite over SVID con, SVID */
1849 .muxsel = MUXSEL(2, 3, 1, 1),
1850 .gpiomux = { 2, 2, 0, 0 },
1853 .tuner_type = TUNER_PHILIPS_PAL,
1854 .tuner_addr = ADDR_UNSET,
1856 GPIO=0x00,0x01,0x03: mute (?)
1857 0x02: both TV and radio (tuner: FM1216/I)
1858 The card has onboard audio connectors labeled "cdrom" and "board",
1859 not soldered here, though unknown wiring.
1860 Card lacks: external audio in, pci subsystem id.
1864 /* ---- card 0x60 ---------------------------------- */
1865 [BTTV_BOARD_MACHTV] = {
1868 /* .audio_inputs= 1, */
1871 .muxsel = MUXSEL(2, 3, 1, 1),
1872 .gpiomux = { 0, 1, 2, 3},
1875 .tuner_type = TUNER_PHILIPS_PAL,
1876 .tuner_addr = ADDR_UNSET,
1879 [BTTV_BOARD_EURESYS_PICOLO] = {
1880 .name = "Euresys Picolo",
1882 /* .audio_inputs= 0, */
1887 .muxsel = MUXSEL(2, 0, 1),
1889 .tuner_type = TUNER_ABSENT,
1890 .tuner_addr = ADDR_UNSET,
1892 [BTTV_BOARD_PV150] = {
1893 /* Luc Van Hoeylandt <luc@e-magic.be> */
1894 .name = "ProVideo PV150", /* 0x4f */
1896 /* .audio_inputs= 0, */
1899 .muxsel = MUXSEL(2, 3),
1904 .tuner_type = TUNER_ABSENT,
1905 .tuner_addr = ADDR_UNSET,
1907 [BTTV_BOARD_AD_TVK503] = {
1908 /* Hiroshi Takekawa <sian@big.or.jp> */
1909 /* This card lacks subsystem ID */
1910 .name = "AD-TVK503", /* 0x63 */
1912 /* .audio_inputs= 1, */
1914 .gpiomask = 0x001e8007,
1915 .muxsel = MUXSEL(2, 3, 1, 0),
1916 /* Tuner, Radio, external, internal, off, on */
1917 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1922 .tuner_type = TUNER_PHILIPS_NTSC,
1923 .tuner_addr = ADDR_UNSET,
1924 .audio_mode_gpio= adtvk503_audio,
1927 /* ---- card 0x64 ---------------------------------- */
1928 [BTTV_BOARD_HERCULES_SM_TV] = {
1929 .name = "Hercules Smart TV Stereo",
1931 /* .audio_inputs= 1, */
1934 .muxsel = MUXSEL(2, 3, 1, 1),
1938 .tuner_type = TUNER_PHILIPS_PAL,
1939 .tuner_addr = ADDR_UNSET,
1941 - card lacks subsystem ID
1942 - stereo variant w/ daughter board with tda9874a @0xb0
1944 always from tda9874 independent of GPIO (?)
1945 external line in: unknown
1946 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1947 hef4053 (instead 4052) for unknown function
1950 [BTTV_BOARD_PACETV] = {
1951 .name = "Pace TV & Radio Card",
1953 /* .audio_inputs= 1, */
1955 /* Tuner, CVid, SVid, CVid over SVid connector */
1956 .muxsel = MUXSEL(2, 3, 1, 1),
1959 .tuner_type = TUNER_PHILIPS_PAL_I,
1960 .tuner_addr = ADDR_UNSET,
1963 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1964 only internal line out: (4pin header) RGGL
1965 Radio must be decoded by msp3410d (not routed through)*/
1967 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1970 [BTTV_BOARD_IVC200] = {
1971 /* Chris Willing <chris@vislab.usyd.edu.au> */
1974 /* .audio_inputs= 0, */
1975 .tuner_type = TUNER_ABSENT,
1976 .tuner_addr = ADDR_UNSET,
1979 .muxsel = MUXSEL(2),
1982 [BTTV_BOARD_IVCE8784] = {
1983 .name = "IVCE-8784",
1985 /* .audio_inputs= 0, */
1986 .tuner_type = TUNER_ABSENT,
1987 .tuner_addr = ADDR_UNSET,
1990 .muxsel = MUXSEL(2),
1993 [BTTV_BOARD_XGUARD] = {
1994 .name = "Grand X-Guard / Trust 814PCI",
1996 /* .audio_inputs= 0, */
1998 .tuner_type = TUNER_ABSENT,
1999 .tuner_addr = ADDR_UNSET,
2001 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
2002 .muxsel_hook = xguard_muxsel,
2008 /* ---- card 0x68 ---------------------------------- */
2009 [BTTV_BOARD_NEBULA_DIGITV] = {
2010 .name = "Nebula Electronics DigiTV",
2013 .muxsel = MUXSEL(2, 3, 1, 0),
2017 .tuner_type = TUNER_ABSENT,
2018 .tuner_addr = ADDR_UNSET,
2024 [BTTV_BOARD_PV143] = {
2025 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2026 .name = "ProVideo PV143",
2028 /* .audio_inputs= 0, */
2031 .muxsel = MUXSEL(2, 3, 1, 0),
2036 .tuner_type = TUNER_ABSENT,
2037 .tuner_addr = ADDR_UNSET,
2039 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
2040 /* M.Klahr@phytec.de */
2041 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
2043 /* .audio_inputs= 0, */
2046 .muxsel = MUXSEL(2, 3, 1, 0),
2047 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2050 .tuner_type = TUNER_ABSENT,
2051 .tuner_addr = ADDR_UNSET,
2053 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2054 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2056 /* .audio_inputs= 0, */
2059 .muxsel = MUXSEL(2, 3, 1, 1),
2060 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2063 .tuner_type = TUNER_ABSENT,
2064 .tuner_addr = ADDR_UNSET,
2067 /* ---- card 0x6c ---------------------------------- */
2068 [BTTV_BOARD_VD009_MINIDIN] = {
2069 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2071 /* .audio_inputs= 0, */
2074 .gpiomask2 = 0x03, /* used for external vodeo mux */
2075 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2076 .muxsel_hook = phytec_muxsel,
2077 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2080 .tuner_type = TUNER_ABSENT,
2081 .tuner_addr = ADDR_UNSET,
2083 [BTTV_BOARD_VD009_COMBI] = {
2084 .name = "PHYTEC VD-009 Combi (bt878)",
2086 /* .audio_inputs= 0, */
2089 .gpiomask2 = 0x03, /* used for external vodeo mux */
2090 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2091 .muxsel_hook = phytec_muxsel,
2092 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2095 .tuner_type = TUNER_ABSENT,
2096 .tuner_addr = ADDR_UNSET,
2098 [BTTV_BOARD_IVC100] = {
2101 /* .audio_inputs= 0, */
2102 .tuner_type = TUNER_ABSENT,
2103 .tuner_addr = ADDR_UNSET,
2106 .muxsel = MUXSEL(2, 3, 1, 0),
2109 [BTTV_BOARD_IVC120] = {
2110 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2113 /* .audio_inputs= 0, */
2114 .tuner_type = TUNER_ABSENT,
2115 .tuner_addr = ADDR_UNSET,
2116 .svhs = NO_SVHS, /* card has no svhs */
2121 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2122 .muxsel_hook = ivc120_muxsel,
2126 /* ---- card 0x70 ---------------------------------- */
2127 [BTTV_BOARD_PC_HDTV] = {
2128 .name = "pcHDTV HD-2000 TV",
2130 /* .audio_inputs= 1, */
2132 .muxsel = MUXSEL(2, 3, 1, 0),
2133 .tuner_type = TUNER_PHILIPS_FCV1236D,
2134 .tuner_addr = ADDR_UNSET,
2137 [BTTV_BOARD_TWINHAN_DST] = {
2138 .name = "Twinhan DST + clones",
2141 .tuner_type = TUNER_ABSENT,
2142 .tuner_addr = ADDR_UNSET,
2146 [BTTV_BOARD_WINFASTVC100] = {
2147 .name = "Winfast VC100",
2149 /* .audio_inputs= 0, */
2151 /* Vid In, SVid In, Vid over SVid in connector */
2152 .muxsel = MUXSEL(3, 1, 1, 3),
2155 .tuner_type = TUNER_ABSENT,
2156 .tuner_addr = ADDR_UNSET,
2159 [BTTV_BOARD_TEV560] = {
2160 .name = "Teppro TEV-560/InterVision IV-560",
2162 /* .audio_inputs= 1, */
2165 .muxsel = MUXSEL(2, 3, 1, 1),
2166 .gpiomux = { 1, 1, 1, 1 },
2168 .tuner_type = TUNER_PHILIPS_PAL,
2169 .tuner_addr = ADDR_UNSET,
2173 /* ---- card 0x74 ---------------------------------- */
2174 [BTTV_BOARD_SIMUS_GVC1100] = {
2175 .name = "SIMUS GVC1100",
2177 /* .audio_inputs= 0, */
2179 .tuner_type = TUNER_ABSENT,
2180 .tuner_addr = ADDR_UNSET,
2182 .muxsel = MUXSEL(2, 2, 2, 2),
2184 .muxsel_hook = gvc1100_muxsel,
2186 [BTTV_BOARD_NGSTV_PLUS] = {
2187 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2188 .name = "NGS NGSTV+",
2191 .gpiomask = 0x008007,
2192 .muxsel = MUXSEL(2, 3, 0, 0),
2193 .gpiomux = { 0, 0, 0, 0 },
2194 .gpiomute = 0x000003,
2196 .tuner_type = TUNER_PHILIPS_PAL,
2197 .tuner_addr = ADDR_UNSET,
2200 [BTTV_BOARD_LMLBT4] = {
2201 /* http://linuxmedialabs.com */
2203 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2204 /* .audio_inputs= 0, */
2206 .muxsel = MUXSEL(2, 3, 1, 0),
2210 .tuner_type = TUNER_ABSENT,
2211 .tuner_addr = ADDR_UNSET,
2213 [BTTV_BOARD_TEKRAM_M205] = {
2214 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2215 .name = "Tekram M205 PRO",
2217 /* .audio_inputs= 1, */
2218 .tuner_type = TUNER_PHILIPS_PAL,
2219 .tuner_addr = ADDR_UNSET,
2223 .muxsel = MUXSEL(2, 3, 1),
2224 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2228 /* ---- card 0x78 ---------------------------------- */
2229 [BTTV_BOARD_CONTVFMI] = {
2230 /* Javier Cendan Ares <jcendan@lycos.es> */
2231 /* bt878 TV + FM without subsystem ID */
2232 .name = "Conceptronic CONTVFMi",
2234 /* .audio_inputs= 1, */
2236 .gpiomask = 0x008007,
2237 .muxsel = MUXSEL(2, 3, 1, 1),
2238 .gpiomux = { 0, 1, 2, 2 },
2242 .tuner_type = TUNER_PHILIPS_PAL,
2243 .tuner_addr = ADDR_UNSET,
2247 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2248 /*Eric DEBIEF <debief@telemsa.com>*/
2249 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/
2250 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2252 .name = "Euresys Picolo Tetra",
2254 /* .audio_inputs= 0, */
2257 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2260 /*878A input is always MUX0, see above.*/
2261 .muxsel = MUXSEL(2, 2, 2, 2),
2262 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2265 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2266 .tuner_type = TUNER_ABSENT,
2267 .tuner_addr = ADDR_UNSET,
2269 [BTTV_BOARD_SPIRIT_TV] = {
2270 /* Spirit TV Tuner from http://spiritmodems.com.au */
2271 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2272 .name = "Spirit TV Tuner",
2274 /* .audio_inputs= 1, */
2276 .gpiomask = 0x0000000f,
2277 .muxsel = MUXSEL(2, 1, 1),
2278 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2279 .tuner_type = TUNER_TEMIC_PAL,
2280 .tuner_addr = ADDR_UNSET,
2283 [BTTV_BOARD_AVDVBT_771] = {
2284 /* Wolfram Joost <wojo@frokaschwei.de> */
2285 .name = "AVerMedia AVerTV DVB-T 771",
2288 .tuner_type = TUNER_ABSENT,
2289 .tuner_addr = ADDR_UNSET,
2290 .muxsel = MUXSEL(3, 3),
2298 /* ---- card 0x7c ---------------------------------- */
2299 [BTTV_BOARD_AVDVBT_761] = {
2300 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2301 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2302 .name = "AverMedia AverTV DVB-T 761",
2305 .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
2309 .tuner_type = TUNER_ABSENT,
2310 .tuner_addr = ADDR_UNSET,
2315 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2316 /* andre.schwarz@matrix-vision.de */
2317 .name = "MATRIX Vision Sigma-SQ",
2319 /* .audio_inputs= 0, */
2322 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
2323 .muxsel_hook = sigmaSQ_muxsel,
2327 .tuner_type = TUNER_ABSENT,
2328 .tuner_addr = ADDR_UNSET,
2330 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2331 /* andre.schwarz@matrix-vision.de */
2332 .name = "MATRIX Vision Sigma-SLC",
2334 /* .audio_inputs= 0, */
2337 .muxsel = MUXSEL(2, 2, 2, 2),
2338 .muxsel_hook = sigmaSLC_muxsel,
2342 .tuner_type = TUNER_ABSENT,
2343 .tuner_addr = ADDR_UNSET,
2345 /* BTTV_BOARD_APAC_VIEWCOMP */
2346 [BTTV_BOARD_APAC_VIEWCOMP] = {
2347 /* Attila Kondoros <attila.kondoros@chello.hu> */
2348 /* bt878 TV + FM 0x00000000 subsystem ID */
2349 .name = "APAC Viewcomp 878(AMAX)",
2351 /* .audio_inputs= 1, */
2354 .muxsel = MUXSEL(2, 3, 1, 1),
2355 .gpiomux = { 2, 0, 0, 0 },
2359 .tuner_type = TUNER_PHILIPS_PAL,
2360 .tuner_addr = ADDR_UNSET,
2361 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2362 .has_radio = 1, /* not every card has radio */
2365 /* ---- card 0x80 ---------------------------------- */
2366 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2367 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2368 .name = "DViCO FusionHDTV DVB-T Lite",
2374 .tuner_type = TUNER_ABSENT,
2375 .tuner_addr = ADDR_UNSET,
2377 [BTTV_BOARD_VGEAR_MYVCD] = {
2378 /* Steven <photon38@pchome.com.tw> */
2379 .name = "V-Gear MyVCD",
2381 /* .audio_inputs= 1, */
2384 .muxsel = MUXSEL(2, 3, 1, 0),
2385 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2389 .tuner_type = TUNER_PHILIPS_NTSC_M,
2390 .tuner_addr = ADDR_UNSET,
2393 [BTTV_BOARD_SUPER_TV] = {
2394 /* Rick C <cryptdragoon@gmail.com> */
2395 .name = "Super TV Tuner",
2397 /* .audio_inputs= 1, */
2399 .muxsel = MUXSEL(2, 3, 1, 0),
2400 .tuner_type = TUNER_PHILIPS_NTSC,
2401 .tuner_addr = ADDR_UNSET,
2402 .gpiomask = 0x008007,
2403 .gpiomux = { 0, 0x000001,0,0 },
2407 [BTTV_BOARD_TIBET_CS16] = {
2408 /* Chris Fanning <video4linux@haydon.net> */
2409 .name = "Tibet Systems 'Progress DVR' CS16",
2411 /* .audio_inputs= 0, */
2413 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2417 .tuner_type = TUNER_ABSENT,
2418 .tuner_addr = ADDR_UNSET,
2419 .muxsel_hook = tibetCS16_muxsel,
2421 [BTTV_BOARD_KODICOM_4400R] = {
2422 /* Bill Brack <wbrack@mmm.com.hk> */
2424 * Note that, because of the card's wiring, the "master"
2425 * BT878A chip (i.e. the one which controls the analog switch
2426 * and must use this card type) is the 2nd one detected. The
2427 * other 3 chips should use card type 0x85, whose description
2428 * follows this one. There is a EEPROM on the card (which is
2429 * connected to the I2C of one of those other chips), but is
2430 * not currently handled. There is also a facility for a
2431 * "monitor", which is also not currently implemented.
2433 .name = "Kodicom 4400R (master)",
2435 /* .audio_inputs= 0, */
2436 .tuner_type = TUNER_ABSENT,
2437 .tuner_addr = ADDR_UNSET,
2439 /* GPIO bits 0-9 used for analog switch:
2440 * 00 - 03: camera selector
2441 * 04 - 06: channel (controller) selector
2442 * 07: data (1->on, 0->off)
2445 * bit 16 is input from sync separator for the channel
2447 .gpiomask = 0x0003ff,
2449 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2453 .muxsel_hook = kodicom4400r_muxsel,
2455 [BTTV_BOARD_KODICOM_4400R_SL] = {
2456 /* Bill Brack <wbrack@mmm.com.hk> */
2457 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2458 * one which controls the analog switch, and must use the card type)
2459 * is the 2nd one detected. The other 3 chips should use this card
2462 .name = "Kodicom 4400R (slave)",
2464 /* .audio_inputs= 0, */
2465 .tuner_type = TUNER_ABSENT,
2466 .tuner_addr = ADDR_UNSET,
2468 .gpiomask = 0x010000,
2470 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2474 .muxsel_hook = kodicom4400r_muxsel,
2476 /* ---- card 0x86---------------------------------- */
2477 [BTTV_BOARD_ADLINK_RTV24] = {
2478 /* Michael Henson <mhenson@clarityvi.com> */
2479 /* Adlink RTV24 with special unlock codes */
2480 .name = "Adlink RTV24",
2482 /* .audio_inputs= 1, */
2484 .muxsel = MUXSEL(2, 3, 1, 0),
2485 .tuner_type = UNSET,
2486 .tuner_addr = ADDR_UNSET,
2489 /* ---- card 0x87---------------------------------- */
2490 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2491 /* Michael Krufky <mkrufky@m1k.net> */
2492 .name = "DViCO FusionHDTV 5 Lite",
2493 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2494 .tuner_addr = ADDR_UNSET,
2496 /* .audio_inputs= 1, */
2498 .muxsel = MUXSEL(2, 3, 1),
2499 .gpiomask = 0x00e00007,
2500 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2501 .gpiomute = 0x00c00007,
2506 /* ---- card 0x88---------------------------------- */
2507 [BTTV_BOARD_ACORP_Y878F] = {
2508 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2509 .name = "Acorp Y878F",
2511 /* .audio_inputs= 1, */
2513 .gpiomask = 0x01fe00,
2514 .muxsel = MUXSEL(2, 3, 1, 1),
2515 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2516 .gpiomute = 0x002000,
2519 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2520 .tuner_addr = 0xc1 >>1,
2523 /* ---- card 0x89 ---------------------------------- */
2524 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2525 .name = "Conceptronic CTVFMi v2",
2527 /* .audio_inputs= 1, */
2529 .gpiomask = 0x001c0007,
2530 .muxsel = MUXSEL(2, 3, 1, 1),
2531 .gpiomux = { 0, 1, 2, 2 },
2535 .tuner_type = TUNER_TENA_9533_DI,
2536 .tuner_addr = ADDR_UNSET,
2540 /* ---- card 0x8a ---------------------------------- */
2541 [BTTV_BOARD_PV_BT878P_2E] = {
2542 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2544 /* .audio_inputs= 1, */
2547 .gpiomask = 0x01fe00,
2548 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
2549 /* .digital_mode= DIGITAL_MODE_CAMERA, */
2550 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2551 .gpiomute = 0x12400,
2554 .tuner_type = TUNER_LG_PAL_FM,
2555 .tuner_addr = ADDR_UNSET,
2558 /* ---- card 0x8b ---------------------------------- */
2559 [BTTV_BOARD_PV_M4900] = {
2560 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2561 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2563 /* .audio_inputs= 1, */
2566 .muxsel = MUXSEL(2, 3, 1, 1),
2567 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2571 .tuner_type = TUNER_YMEC_TVF_5533MF,
2572 .tuner_addr = ADDR_UNSET,
2576 /* ---- card 0x8c ---------------------------------- */
2577 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2578 one external BNC composite input (mux 2)
2579 three internal composite inputs (unknown muxes)
2580 an 18-bit stereo A/D (CS5331A), which has:
2581 one external stereo unblanced (RCA) audio connection
2582 one (or 3?) internal stereo balanced (XLR) audio connection
2583 input is selected via gpio to a 14052B mux
2584 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2585 gain is controlled via an X9221A chip on the I2C bus @0x28
2586 sample rate is controlled via gpio to an MK1413S
2587 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2588 There is neither a tuner nor an svideo input. */
2589 [BTTV_BOARD_OSPREY440] = {
2590 .name = "Osprey 440",
2592 /* .audio_inputs= 2, */
2594 .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */
2596 .gpiomute = 0x000, /* int + 32kHz */
2597 .gpiomux = { 0, 0, 0x000, 0x100},
2599 .tuner_type = TUNER_ABSENT,
2600 .tuner_addr = ADDR_UNSET,
2604 /* ---- card 0x8d ---------------------------------- */
2605 [BTTV_BOARD_ASOUND_SKYEYE] = {
2606 .name = "Asound Skyeye PCTV",
2608 /* .audio_inputs= 1, */
2611 .muxsel = MUXSEL(2, 3, 1, 1),
2612 .gpiomux = { 2, 0, 0, 0 },
2616 .tuner_type = TUNER_PHILIPS_NTSC,
2617 .tuner_addr = ADDR_UNSET,
2619 /* ---- card 0x8e ---------------------------------- */
2620 [BTTV_BOARD_SABRENT_TVFM] = {
2621 .name = "Sabrent TV-FM (bttv version)",
2623 /* .audio_inputs= 1, */
2625 .gpiomask = 0x108007,
2626 .muxsel = MUXSEL(2, 3, 1, 1),
2627 .gpiomux = { 100000, 100002, 100002, 100000 },
2631 .tuner_type = TUNER_TNF_5335MF,
2632 .tuner_addr = ADDR_UNSET,
2635 /* ---- card 0x8f ---------------------------------- */
2636 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2637 .name = "Hauppauge ImpactVCB (bt878)",
2639 /* .audio_inputs= 0, */
2641 .gpiomask = 0x0f, /* old: 7 */
2642 .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
2645 .tuner_type = TUNER_ABSENT,
2646 .tuner_addr = ADDR_UNSET,
2648 [BTTV_BOARD_MACHTV_MAGICTV] = {
2649 /* Julian Calaby <julian.calaby@gmail.com>
2650 * Slightly different from original MachTV definition (0x60)
2652 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2653 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2654 * properly (methinks) causing no keyup bits being set */
2656 .name = "MagicTV", /* rebranded MachTV */
2658 /* .audio_inputs= 1, */
2661 .muxsel = MUXSEL(2, 3, 1, 1),
2662 .gpiomux = { 0, 1, 2, 3 },
2664 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2665 .tuner_addr = ADDR_UNSET,
2670 [BTTV_BOARD_SSAI_SECURITY] = {
2671 .name = "SSAI Security Video Interface",
2673 /* .audio_inputs= 0, */
2675 .muxsel = MUXSEL(0, 1, 2, 3),
2676 .tuner_type = TUNER_ABSENT,
2677 .tuner_addr = ADDR_UNSET,
2679 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2680 .name = "SSAI Ultrasound Video Interface",
2682 /* .audio_inputs= 0, */
2684 .muxsel = MUXSEL(2, 0, 1, 3),
2685 .tuner_type = TUNER_ABSENT,
2686 .tuner_addr = ADDR_UNSET,
2688 /* ---- card 0x94---------------------------------- */
2689 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2690 .name = "DViCO FusionHDTV 2",
2691 .tuner_type = TUNER_PHILIPS_FCV1236D,
2692 .tuner_addr = ADDR_UNSET,
2694 /* .audio_inputs= 1, */
2696 .muxsel = MUXSEL(2, 3, 1),
2697 .gpiomask = 0x00e00007,
2698 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2699 .gpiomute = 0x00c00007,
2703 /* ---- card 0x95---------------------------------- */
2704 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2705 .name = "Typhoon TV-Tuner PCI (50684)",
2707 /* .audio_inputs= 1, */
2709 .gpiomask = 0x3014f,
2710 .muxsel = MUXSEL(2, 3, 1, 1),
2711 .gpiomux = { 0x20001,0x10001, 0, 0 },
2715 .tuner_type = TUNER_PHILIPS_PAL_I,
2716 .tuner_addr = ADDR_UNSET,
2718 [BTTV_BOARD_GEOVISION_GV600] = {
2720 .name = "Geovision GV-600",
2722 /* .audio_inputs= 0, */
2725 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2726 .muxsel_hook = geovision_muxsel,
2730 .tuner_type = TUNER_ABSENT,
2731 .tuner_addr = ADDR_UNSET,
2733 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2734 /* Mauro Lacy <mauro@lacy.com.ar>
2735 * Based on MagicTV and Conceptronic CONTVFMi */
2737 .name = "Kozumi KTV-01C",
2739 /* .audio_inputs= 1, */
2741 .gpiomask = 0x008007,
2742 .muxsel = MUXSEL(2, 3, 1, 1),
2743 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2744 .gpiomute = 3, /* CONTVFMi */
2746 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2747 .tuner_addr = ADDR_UNSET,
2752 [BTTV_BOARD_ENLTV_FM_2] = {
2753 /* Encore TV Tuner Pro ENL TV-FM-2
2754 Mauro Carvalho Chehab <mchehab@infradead.org */
2755 .name = "Encore ENL TV-FM-2",
2757 /* .audio_inputs= 1, */
2759 /* bit 6 -> IR disabled
2760 bit 18/17 = 00 -> mute
2761 01 -> enable external audio input
2762 10 -> internal audio input (mono?)
2763 11 -> internal audio input
2765 .gpiomask = 0x060040,
2766 .muxsel = MUXSEL(2, 3, 3),
2767 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2769 .tuner_type = TUNER_TCL_MF02GIP_5N,
2770 .tuner_addr = ADDR_UNSET,
2775 [BTTV_BOARD_VD012] = {
2776 /* D.Heer@Phytec.de */
2777 .name = "PHYTEC VD-012 (bt878)",
2779 /* .audio_inputs= 0, */
2782 .muxsel = MUXSEL(0, 2, 3, 1),
2783 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2786 .tuner_type = TUNER_ABSENT,
2787 .tuner_addr = ADDR_UNSET,
2789 [BTTV_BOARD_VD012_X1] = {
2790 /* D.Heer@Phytec.de */
2791 .name = "PHYTEC VD-012-X1 (bt878)",
2793 /* .audio_inputs= 0, */
2796 .muxsel = MUXSEL(2, 3, 1),
2797 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2800 .tuner_type = TUNER_ABSENT,
2801 .tuner_addr = ADDR_UNSET,
2803 [BTTV_BOARD_VD012_X2] = {
2804 /* D.Heer@Phytec.de */
2805 .name = "PHYTEC VD-012-X2 (bt878)",
2807 /* .audio_inputs= 0, */
2810 .muxsel = MUXSEL(3, 2, 1),
2811 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2814 .tuner_type = TUNER_ABSENT,
2815 .tuner_addr = ADDR_UNSET,
2817 [BTTV_BOARD_GEOVISION_GV800S] = {
2818 /* Bruno Christo <bchristo@inf.ufsm.br>
2820 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2821 * 1 audio input per BT878A = 4 audio inputs
2822 * 4 video inputs per BT878A = 16 video inputs
2823 * This is the first BT878A chip of the GV-800(S). It's the
2824 * "master" chip and it controls the video inputs through an
2825 * analog multiplexer (a CD22M3494) via some GPIO pins. The
2826 * slaves should use card type 0x9e (following this one).
2827 * There is a EEPROM on the card which is currently not handled.
2828 * The audio input is not working yet.
2830 .name = "Geovision GV-800(S) (master)",
2832 /* .audio_inputs= 1, */
2833 .tuner_type = TUNER_ABSENT,
2834 .tuner_addr = ADDR_UNSET,
2836 .gpiomask = 0xf107f,
2838 .muxsel = MUXSEL(2, 2, 2, 2),
2842 .muxsel_hook = gv800s_muxsel,
2844 [BTTV_BOARD_GEOVISION_GV800S_SL] = {
2845 /* Bruno Christo <bchristo@inf.ufsm.br>
2847 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2848 * 1 audio input per BT878A = 4 audio inputs
2849 * 4 video inputs per BT878A = 16 video inputs
2850 * The 3 other BT878A chips are "slave" chips of the GV-800(S)
2851 * and should use this card type.
2852 * The audio input is not working yet.
2854 .name = "Geovision GV-800(S) (slave)",
2856 /* .audio_inputs= 1, */
2857 .tuner_type = TUNER_ABSENT,
2858 .tuner_addr = ADDR_UNSET,
2862 .muxsel = MUXSEL(2, 2, 2, 2),
2866 .muxsel_hook = gv800s_muxsel,
2868 [BTTV_BOARD_PV183] = {
2869 .name = "ProVideo PV183", /* 0x9f */
2871 /* .audio_inputs= 0, */
2874 .muxsel = MUXSEL(2, 3),
2879 .tuner_type = TUNER_ABSENT,
2880 .tuner_addr = ADDR_UNSET,
2884 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2886 /* ----------------------------------------------------------------------- */
2888 static unsigned char eeprom_data[256];
2893 void __devinit bttv_idcard(struct bttv *btv)
2895 unsigned int gpiobits;
2898 /* read PCI subsystem ID */
2899 btv->cardid = btv->c.pci->subsystem_device << 16;
2900 btv->cardid |= btv->c.pci->subsystem_vendor;
2902 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2903 /* look for the card */
2904 for (type = -1, i = 0; cards[i].id != 0; i++)
2905 if (cards[i].id == btv->cardid)
2910 pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2911 btv->c.nr, cards[type].name, cards[type].cardnr,
2912 btv->cardid & 0xffff,
2913 (btv->cardid >> 16) & 0xffff);
2914 btv->c.type = cards[type].cardnr;
2917 pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
2918 btv->c.nr, btv->cardid & 0xffff,
2919 (btv->cardid >> 16) & 0xffff);
2920 pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
2924 /* let the user override the autodetected type */
2925 if (card[btv->c.nr] < bttv_num_tvcards)
2926 btv->c.type=card[btv->c.nr];
2928 /* print which card config we are using */
2929 pr_info("%d: using: %s [card=%d,%s]\n",
2930 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
2931 card[btv->c.nr] < bttv_num_tvcards
2932 ? "insmod option" : "autodetected");
2934 /* overwrite gpio stuff ?? */
2935 if (UNSET == audioall && UNSET == audiomux[0])
2938 if (UNSET != audiomux[0]) {
2940 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2941 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2942 gpiobits |= audiomux[i];
2945 gpiobits = audioall;
2946 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2947 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2950 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2951 pr_info("%d: gpio config override: mask=0x%x, mux=",
2952 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
2953 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2955 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2961 * (most) board specific initialisations goes here
2964 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2965 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2969 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2970 type = BTTV_BOARD_MODTEC_205;
2971 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2972 type = BTTV_BOARD_EURESYS_PICOLO;
2973 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2974 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2978 pr_info("%d: detected by eeprom: %s [card=%d]\n",
2979 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2983 static void flyvideo_gpio(struct bttv *btv)
2985 int gpio, has_remote, has_radio, is_capture_only;
2986 int is_lr90, has_tda9820_tda9821;
2987 int tuner_type = UNSET, ttype;
2989 gpio_inout(0xffffff, 0);
2990 udelay(8); /* without this we would see the 0x1800 mask */
2992 /* FIXME: must restore OUR_EN ??? */
2994 /* all cards provide GPIO info, some have an additional eeprom
2995 * LR50: GPIO coding can be found lower right CP1 .. CP9
2996 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2998 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3000 * lowest 3 bytes are remote control codes (no handshake needed)
3001 * xxxFFF: No remote control chip soldered
3002 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3003 * Note: Some bits are Audio_Mask !
3005 ttype = (gpio & 0x0f0000) >> 16;
3008 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3011 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3014 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3017 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3020 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3023 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
3027 has_remote = gpio & 0x800000;
3028 has_radio = gpio & 0x400000;
3029 /* unknown 0x200000;
3030 * unknown2 0x100000; */
3031 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3032 has_tda9820_tda9821 = !(gpio & 0x004000);
3033 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3035 * gpio & 0x001000 output bit for audio routing */
3037 if (is_capture_only)
3038 tuner_type = TUNER_ABSENT; /* No tuner present */
3040 pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3041 btv->c.nr, has_radio ? "yes" : "no",
3042 has_remote ? "yes" : "no", tuner_type, gpio);
3043 pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3044 btv->c.nr, is_lr90 ? "yes" : "no",
3045 has_tda9820_tda9821 ? "yes" : "no",
3046 is_capture_only ? "yes" : "no");
3048 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3049 btv->tuner_type = tuner_type;
3050 btv->has_radio = has_radio;
3052 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3053 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3054 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3055 if (has_tda9820_tda9821)
3056 btv->audio_mode_gpio = lt9415_audio;
3057 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3060 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3061 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3062 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3063 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3065 static void miro_pinnacle_gpio(struct bttv *btv)
3070 gpio_inout(0xffffff, 0);
3072 id = ((gpio>>10) & 63) -1;
3073 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3075 btv->tuner_type = miro_tunermap[id];
3076 if (0 == (gpio & 0x20)) {
3078 if (!miro_fmtuner[id]) {
3079 btv->has_matchbox = 1;
3080 btv->mbox_we = (1<<6);
3081 btv->mbox_most = (1<<7);
3082 btv->mbox_clk = (1<<8);
3083 btv->mbox_data = (1<<9);
3084 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3090 if (btv->c.type == BTTV_BOARD_MIRO)
3091 btv->c.type = BTTV_BOARD_MIROPRO;
3092 if (btv->c.type == BTTV_BOARD_PINNACLE)
3093 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3095 pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3096 btv->c.nr, id+1, btv->tuner_type,
3097 !btv->has_radio ? "no" :
3098 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3099 (-1 == msp) ? "no" : "yes");
3101 /* new cards with microtune tuner */
3106 info = "PAL / mono";
3107 btv->tda9887_conf = TDA9887_INTERCARRIER;
3110 info = "PAL+SECAM / stereo";
3112 btv->tda9887_conf = TDA9887_QSS;
3115 info = "NTSC / stereo";
3117 btv->tda9887_conf = TDA9887_QSS;
3120 info = "PAL+SECAM / mono";
3121 btv->tda9887_conf = TDA9887_QSS;
3124 info = "NTSC / mono";
3125 btv->tda9887_conf = TDA9887_INTERCARRIER;
3128 info = "NTSC / stereo";
3129 btv->tda9887_conf = TDA9887_INTERCARRIER;
3132 info = "PAL / stereo";
3133 btv->tda9887_conf = TDA9887_INTERCARRIER;
3136 info = "oops: unknown card";
3140 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3141 pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3142 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3143 btv->tuner_type = TUNER_MT2032;
3147 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3148 #define LM1882_SYNC_DRIVE 0x200000L
3150 static void init_ids_eagle(struct bttv *btv)
3152 gpio_inout(0xffffff,0xFFFF37);
3153 gpio_write(0x200020);
3155 /* flash strobe inverter ?! */
3156 gpio_write(0x200024);
3158 /* switch sync drive off */
3159 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3161 /* set BT848 muxel to 2 */
3162 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3165 /* Muxsel helper for the IDS Eagle.
3166 * the eagles does not use the standard muxsel-bits but
3167 * has its own multiplexer */
3168 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3170 gpio_bits(3, input & 3);
3173 /* set chroma ADC to sleep */
3174 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3175 /* set to composite video */
3176 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3177 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3179 /* switch sync drive off */
3180 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3183 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3185 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3186 gpio_write(masks[input%4]);
3189 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3192 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3193 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3195 IN - sensor inputs, INx - sensor inputs and TI XORed together
3196 O1,O2,O3 - alarm outputs (relays)
3198 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3202 static void init_lmlbt4x(struct bttv *btv)
3204 pr_debug("LMLBT4x init\n");
3205 btwrite(0x000000, BT848_GPIO_REG_INP);
3206 gpio_inout(0xffffff, 0x0006C0);
3207 gpio_write(0x000000);
3210 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3212 unsigned int inmux = input % 8;
3213 gpio_inout( 0xf, 0xf );
3214 gpio_bits( 0xf, inmux );
3217 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3219 unsigned int inmux = input % 4;
3220 gpio_inout( 3<<9, 3<<9 );
3221 gpio_bits( 3<<9, inmux<<9 );
3224 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3226 unsigned int inmux = input % 16;
3227 gpio_inout(0xf, 0xf);
3228 gpio_bits(0xf, inmux);
3231 /* ----------------------------------------------------------------------- */
3233 static void bttv_reset_audio(struct bttv *btv)
3236 * BT878A has a audio-reset register.
3237 * 1. This register is an audio reset function but it is in
3238 * function-0 (video capture) address space.
3239 * 2. It is enough to do this once per power-up of the card.
3240 * 3. There is a typo in the Conexant doc -- it is not at
3241 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3242 * --//Shrikumar 030609
3248 pr_debug("%d: BT878A ARESET\n", btv->c.nr);
3249 btwrite((1<<7), 0x058);
3254 /* initialization part one -- before registering i2c bus */
3255 void __devinit bttv_init_card1(struct bttv *btv)
3257 switch (btv->c.type) {
3258 case BTTV_BOARD_HAUPPAUGE:
3259 case BTTV_BOARD_HAUPPAUGE878:
3260 boot_msp34xx(btv,5);
3262 case BTTV_BOARD_VOODOOTV_200:
3263 case BTTV_BOARD_VOODOOTV_FM:
3264 boot_msp34xx(btv,20);
3266 case BTTV_BOARD_AVERMEDIA98:
3267 boot_msp34xx(btv,11);
3269 case BTTV_BOARD_HAUPPAUGEPVR:
3272 case BTTV_BOARD_TWINHAN_DST:
3273 case BTTV_BOARD_AVDVBT_771:
3274 case BTTV_BOARD_PINNACLESAT:
3275 btv->use_i2c_hw = 1;
3277 case BTTV_BOARD_ADLINK_RTV24:
3282 if (!bttv_tvcards[btv->c.type].has_dvb)
3283 bttv_reset_audio(btv);
3286 /* initialization part two -- after registering i2c bus */
3287 void __devinit bttv_init_card2(struct bttv *btv)
3289 btv->tuner_type = UNSET;
3291 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3292 bttv_readee(btv,eeprom_data,0xa0);
3293 identify_by_eeprom(btv,eeprom_data);
3296 switch (btv->c.type) {
3297 case BTTV_BOARD_MIRO:
3298 case BTTV_BOARD_MIROPRO:
3299 case BTTV_BOARD_PINNACLE:
3300 case BTTV_BOARD_PINNACLEPRO:
3302 miro_pinnacle_gpio(btv);
3304 case BTTV_BOARD_FLYVIDEO_98:
3305 case BTTV_BOARD_MAXI:
3306 case BTTV_BOARD_LIFE_FLYKIT:
3307 case BTTV_BOARD_FLYVIDEO:
3308 case BTTV_BOARD_TYPHOON_TVIEW:
3309 case BTTV_BOARD_CHRONOS_VS2:
3310 case BTTV_BOARD_FLYVIDEO_98FM:
3311 case BTTV_BOARD_FLYVIDEO2000:
3312 case BTTV_BOARD_FLYVIDEO98EZ:
3313 case BTTV_BOARD_CONFERENCETV:
3314 case BTTV_BOARD_LIFETEC_9415:
3317 case BTTV_BOARD_HAUPPAUGE:
3318 case BTTV_BOARD_HAUPPAUGE878:
3319 case BTTV_BOARD_HAUPPAUGEPVR:
3320 /* pick up some config infos from the eeprom */
3321 bttv_readee(btv,eeprom_data,0xa0);
3322 hauppauge_eeprom(btv);
3324 case BTTV_BOARD_AVERMEDIA98:
3325 case BTTV_BOARD_AVPHONE98:
3326 bttv_readee(btv,eeprom_data,0xa0);
3327 avermedia_eeprom(btv);
3329 case BTTV_BOARD_PXC200:
3332 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3333 picolo_tetra_init(btv);
3335 case BTTV_BOARD_VHX:
3337 btv->has_matchbox = 1;
3338 btv->mbox_we = 0x20;
3340 btv->mbox_clk = 0x08;
3341 btv->mbox_data = 0x10;
3342 btv->mbox_mask = 0x38;
3344 case BTTV_BOARD_VOBIS_BOOSTAR:
3345 case BTTV_BOARD_TERRATV:
3346 terratec_active_radio_upgrade(btv);
3348 case BTTV_BOARD_MAGICTVIEW061:
3349 if (btv->cardid == 0x3002144f) {
3351 pr_info("%d: radio detected by subsystem id (CPH05x)\n",
3355 case BTTV_BOARD_STB2:
3356 if (btv->cardid == 0x3060121a) {
3357 /* Fix up entry for 3DFX VoodooTV 100,
3358 which is an OEM STB card variant. */
3360 btv->tuner_type=TUNER_TEMIC_NTSC;
3363 case BTTV_BOARD_OSPREY1x0:
3364 case BTTV_BOARD_OSPREY1x0_848:
3365 case BTTV_BOARD_OSPREY101_848:
3366 case BTTV_BOARD_OSPREY1x1:
3367 case BTTV_BOARD_OSPREY1x1_SVID:
3368 case BTTV_BOARD_OSPREY2xx:
3369 case BTTV_BOARD_OSPREY2x0_SVID:
3370 case BTTV_BOARD_OSPREY2x0:
3371 case BTTV_BOARD_OSPREY440:
3372 case BTTV_BOARD_OSPREY500:
3373 case BTTV_BOARD_OSPREY540:
3374 case BTTV_BOARD_OSPREY2000:
3375 bttv_readee(btv,eeprom_data,0xa0);
3376 osprey_eeprom(btv, eeprom_data);
3378 case BTTV_BOARD_IDS_EAGLE:
3379 init_ids_eagle(btv);
3381 case BTTV_BOARD_MODTEC_205:
3382 bttv_readee(btv,eeprom_data,0xa0);
3385 case BTTV_BOARD_LMLBT4:
3388 case BTTV_BOARD_TIBET_CS16:
3389 tibetCS16_init(btv);
3391 case BTTV_BOARD_KODICOM_4400R:
3392 kodicom4400r_init(btv);
3394 case BTTV_BOARD_GEOVISION_GV800S:
3399 /* pll configuration */
3400 if (!(btv->id==848 && btv->revision==0x11)) {
3401 /* defaults from card list */
3402 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3403 btv->pll.pll_ifreq=28636363;
3404 btv->pll.pll_crystal=BT848_IFORM_XT0;
3406 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3407 btv->pll.pll_ifreq=35468950;
3408 btv->pll.pll_crystal=BT848_IFORM_XT1;
3410 /* insmod options can override */
3411 switch (pll[btv->c.nr]) {
3413 btv->pll.pll_crystal = 0;
3414 btv->pll.pll_ifreq = 0;
3415 btv->pll.pll_ofreq = 0;
3417 case 1: /* 28 MHz */
3419 btv->pll.pll_ifreq = 28636363;
3420 btv->pll.pll_ofreq = 0;
3421 btv->pll.pll_crystal = BT848_IFORM_XT0;
3423 case 2: /* 35 MHz */
3425 btv->pll.pll_ifreq = 35468950;
3426 btv->pll.pll_ofreq = 0;
3427 btv->pll.pll_crystal = BT848_IFORM_XT1;
3431 btv->pll.pll_current = -1;
3433 /* tuner configuration (from card list / autodetect / insmod option) */
3434 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3435 if (UNSET == btv->tuner_type)
3436 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3437 if (UNSET != tuner[btv->c.nr])
3438 btv->tuner_type = tuner[btv->c.nr];
3440 if (btv->tuner_type == TUNER_ABSENT)
3441 pr_info("%d: tuner absent\n", btv->c.nr);
3442 else if (btv->tuner_type == UNSET)
3443 pr_warn("%d: tuner type unset\n", btv->c.nr);
3445 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3447 if (autoload != UNSET) {
3448 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
3449 pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3453 if (UNSET == btv->tuner_type)
3454 btv->tuner_type = TUNER_ABSENT;
3456 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3457 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3458 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3459 UNSET : bttv_tvcards[btv->c.type].svhs;
3460 if (svhs[btv->c.nr] != UNSET)
3461 btv->svhs = svhs[btv->c.nr];
3462 if (remote[btv->c.nr] != UNSET)
3463 btv->has_remote = remote[btv->c.nr];
3465 if (bttv_tvcards[btv->c.type].has_radio)
3467 if (bttv_tvcards[btv->c.type].has_remote)
3468 btv->has_remote = 1;
3469 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3471 if (bttv_tvcards[btv->c.type].volume_gpio)
3472 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3473 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3474 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3476 if (btv->tuner_type == TUNER_ABSENT)
3477 return; /* no tuner or related drivers to load */
3479 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3480 /* Probe for RDS receiver chip */
3481 static const unsigned short addrs[] = {
3486 struct v4l2_subdev *sd;
3488 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3489 &btv->c.i2c_adap, "saa6588", 0, addrs);
3490 btv->has_saa6588 = (sd != NULL);
3493 /* try to detect audio/fader chips */
3495 /* First check if the user specified the audio chip via a module
3498 switch (audiodev[btv->c.nr]) {
3500 return; /* do not load any audio module */
3502 case 0: /* autodetect */
3506 /* The user specified that we should probe for msp3400 */
3507 static const unsigned short addrs[] = {
3508 I2C_ADDR_MSP3400 >> 1,
3509 I2C_ADDR_MSP3400_ALT >> 1,
3513 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3514 &btv->c.i2c_adap, "msp3400", 0, addrs);
3515 if (btv->sd_msp34xx)
3521 /* The user specified that we should probe for tda7432 */
3522 static const unsigned short addrs[] = {
3523 I2C_ADDR_TDA7432 >> 1,
3527 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3528 &btv->c.i2c_adap, "tda7432", 0, addrs))
3534 /* The user specified that we should probe for tvaudio */
3535 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3536 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3537 if (btv->sd_tvaudio)
3543 pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
3547 /* There were no overrides, so now we try to discover this through the
3550 /* probe for msp3400 first: this driver can detect whether or not
3551 it really is a msp3400, so it will return NULL when the device
3552 found is really something else (e.g. a tea6300). */
3553 if (!bttv_tvcards[btv->c.type].no_msp34xx) {
3554 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3555 &btv->c.i2c_adap, "msp3400",
3556 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
3557 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
3558 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3559 &btv->c.i2c_adap, "msp3400",
3560 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
3563 /* If we found a msp34xx, then we're done. */
3564 if (btv->sd_msp34xx)
3567 /* it might also be a tda7432. */
3568 if (!bttv_tvcards[btv->c.type].no_tda7432) {
3569 static const unsigned short addrs[] = {
3570 I2C_ADDR_TDA7432 >> 1,
3574 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3575 &btv->c.i2c_adap, "tda7432", 0, addrs))
3579 /* Now see if we can find one of the tvaudio devices. */
3580 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3581 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3582 if (btv->sd_tvaudio)
3586 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
3590 /* initialize the tuner */
3591 void __devinit bttv_init_tuner(struct bttv *btv)
3593 int addr = ADDR_UNSET;
3595 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3596 addr = bttv_tvcards[btv->c.type].tuner_addr;
3598 if (btv->tuner_type != TUNER_ABSENT) {
3599 struct tuner_setup tun_setup;
3601 /* Load tuner module before issuing tuner config call! */
3602 if (bttv_tvcards[btv->c.type].has_radio)
3603 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3604 &btv->c.i2c_adap, "tuner",
3605 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3606 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3607 &btv->c.i2c_adap, "tuner",
3608 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3609 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3610 &btv->c.i2c_adap, "tuner",
3611 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3613 tun_setup.mode_mask = T_ANALOG_TV;
3614 tun_setup.type = btv->tuner_type;
3615 tun_setup.addr = addr;
3617 if (bttv_tvcards[btv->c.type].has_radio)
3618 tun_setup.mode_mask |= T_RADIO;
3620 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3623 if (btv->tda9887_conf) {
3624 struct v4l2_priv_tun_config tda9887_cfg;
3626 tda9887_cfg.tuner = TUNER_TDA9887;
3627 tda9887_cfg.priv = &btv->tda9887_conf;
3629 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3633 /* ----------------------------------------------------------------------- */
3635 static void modtec_eeprom(struct bttv *btv)
3637 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3638 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3639 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3640 btv->c.nr, &eeprom_data[0x1e]);
3641 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3642 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3643 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3644 btv->c.nr, &eeprom_data[0x1e]);
3645 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3646 btv->tuner_type=TUNER_PHILIPS_NTSC;
3647 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3648 btv->c.nr, &eeprom_data[0x1e]);
3650 pr_info("%d: Modtec: Unknown TunerString: %s\n",
3651 btv->c.nr, &eeprom_data[0x1e]);
3655 static void __devinit hauppauge_eeprom(struct bttv *btv)
3659 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3660 btv->tuner_type = tv.tuner_type;
3661 btv->has_radio = tv.has_radio;
3663 pr_info("%d: Hauppauge eeprom indicates model#%d\n",
3664 btv->c.nr, tv.model);
3667 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3668 * type based on model #.
3670 if(tv.model == 64900) {
3671 pr_info("%d: Switching board type from %s to %s\n",
3673 bttv_tvcards[btv->c.type].name,
3674 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3675 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3679 static int terratec_active_radio_upgrade(struct bttv *btv)
3684 btv->has_matchbox = 1;
3685 btv->mbox_we = 0x10;
3686 btv->mbox_most = 0x20;
3687 btv->mbox_clk = 0x08;
3688 btv->mbox_data = 0x04;
3689 btv->mbox_mask = 0x3c;
3691 btv->mbox_iow = 1 << 8;
3692 btv->mbox_ior = 1 << 9;
3693 btv->mbox_csel = 1 << 10;
3696 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3697 if (0x1ed8 == tea5757_read(btv)) {
3698 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3700 btv->has_saa6588 = 1;
3701 btv->has_matchbox = 1;
3704 btv->has_matchbox = 0;
3710 /* ----------------------------------------------------------------------- */
3713 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3716 #define PVR_GPIO_DELAY 10
3718 #define BTTV_ALT_DATA 0x000001
3719 #define BTTV_ALT_DCLK 0x100000
3720 #define BTTV_ALT_NCONFIG 0x800000
3722 static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3729 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3731 udelay(PVR_GPIO_DELAY);
3733 gpio_write(BTTV_ALT_NCONFIG);
3734 udelay(PVR_GPIO_DELAY);
3736 for (n = 0; n < microlen; n++) {
3738 for (i = 0 ; i < 8 ; i++) {
3739 gpio_bits(BTTV_ALT_DCLK,0);
3741 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3743 gpio_bits(BTTV_ALT_DATA,0);
3744 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3748 gpio_bits(BTTV_ALT_DCLK,0);
3749 udelay(PVR_GPIO_DELAY);
3751 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3752 for (i = 0 ; i < 30 ; i++) {
3753 gpio_bits(BTTV_ALT_DCLK,0);
3754 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3756 gpio_bits(BTTV_ALT_DCLK,0);
3760 static int __devinit pvr_boot(struct bttv *btv)
3762 const struct firmware *fw_entry;
3765 rc = reject_firmware(&fw_entry, "/*(DEBLOBBED)*/", &btv->c.pci->dev);
3767 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
3770 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3771 pr_info("%d: altera firmware upload %s\n",
3772 btv->c.nr, (rc < 0) ? "failed" : "ok");
3773 release_firmware(fw_entry);
3777 /* ----------------------------------------------------------------------- */
3778 /* some osprey specific stuff */
3780 static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3786 /* This code will nevery actually get called in this case.... */
3787 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3788 /* this might be an antique... check for MMAC label in eeprom */
3789 if (!strncmp(ee, "MMAC", 4)) {
3791 for (i = 0; i < 21; i++)
3793 if (checksum != ee[21])
3795 cardid = BTTV_BOARD_OSPREY1x0_848;
3796 for (i = 12; i < 21; i++)
3797 serial *= 10, serial += ee[i] - '0';
3800 unsigned short type;
3802 for (i = 4*16; i < 8*16; i += 16) {
3803 u16 checksum = ip_compute_csum(ee + i, 16);
3805 if ((checksum&0xff) + (checksum>>8) == 0xff)
3812 /* found a valid descriptor */
3813 type = get_unaligned_be16((__be16 *)(ee+4));
3818 cardid = BTTV_BOARD_OSPREY1x0_848;
3821 cardid = BTTV_BOARD_OSPREY101_848;
3827 cardid = BTTV_BOARD_OSPREY1x0;
3831 cardid = BTTV_BOARD_OSPREY1x1;
3836 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3842 cardid = BTTV_BOARD_OSPREY2xx;
3846 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3849 cardid = BTTV_BOARD_OSPREY500;
3853 cardid = BTTV_BOARD_OSPREY540;
3854 /* bttv_osprey_540_init(btv); */
3859 cardid = BTTV_BOARD_OSPREY2x0;
3860 /* enable output on select control lines */
3861 gpio_inout(0xffffff,0x000303);
3864 cardid = BTTV_BOARD_OSPREY440;
3867 /* unknown...leave generic, but get serial # */
3868 pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
3872 serial = get_unaligned_be32((__be32 *)(ee+6));
3875 pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
3877 cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3879 if (cardid<0 || btv->c.type == cardid)
3882 /* card type isn't set correctly */
3883 if (card[btv->c.nr] < bttv_num_tvcards) {
3884 pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
3887 pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
3888 btv->c.nr, btv->c.type, cardid);
3889 btv->c.type = cardid;
3893 /* ----------------------------------------------------------------------- */
3894 /* AVermedia specific stuff, from bktr_card.c */
3896 static int tuner_0_table[] = {
3897 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3898 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3899 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3900 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3901 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3902 TUNER_PHILIPS_FM1216ME_MK3 };
3904 static int tuner_1_table[] = {
3905 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3906 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3907 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3908 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3909 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3911 static void __devinit avermedia_eeprom(struct bttv *btv)
3913 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
3915 tuner_make = (eeprom_data[0x41] & 0x7);
3916 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3917 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3918 btv->has_remote = (eeprom_data[0x42] & 0x01);
3920 if (tuner_make == 0 || tuner_make == 2)
3921 if (tuner_format <= 0x0a)
3922 tuner_type = tuner_0_table[tuner_format];
3923 if (tuner_make == 1)
3924 if (tuner_format <= 9)
3925 tuner_type = tuner_1_table[tuner_format];
3927 if (tuner_make == 4)
3928 if (tuner_format == 0x09)
3929 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3931 pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3932 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3934 btv->tuner_type = tuner_type;
3935 pr_cont("%d", tuner_type);
3937 pr_cont("Unknown type");
3938 pr_cont(" radio:%s remote control:%s\n",
3939 tuner_tv_fm ? "yes" : "no",
3940 btv->has_remote ? "yes" : "no");
3944 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
3945 * analog demod, which is not I2C controlled like the newer and more common
3946 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
3947 * that control the IF for the video and audio. Apparently, bttv GPIO
3948 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
3949 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
3951 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
3954 if (btv->audio == TVAUDIO_INPUT_TUNER) {
3955 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
3956 gpiobits |= 0x10000;
3958 gpiobits &= ~0x10000;
3961 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
3967 * reset/enable the MSP on some Hauppauge cards
3968 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3973 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3975 int mask = (1 << pin);
3977 gpio_inout(mask,mask);
3981 gpio_bits(mask,mask);
3984 bttv_gpio_tracking(btv,"msp34xx");
3986 pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
3990 /* ----------------------------------------------------------------------- */
3991 /* Imagenation L-Model PXC200 Framegrabber */
3992 /* This is basically the same procedure as
3993 * used by Alessandro Rubini in his pxc200
3994 * driver, but using BTTV functions */
3996 static void __devinit init_PXC200(struct bttv *btv)
3998 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3999 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
4005 /* Initialise GPIO-connevted stuff */
4006 gpio_inout(0xffffff, (1<<13));
4010 /* GPIO inputs are pulled up, so no need to drive
4011 * reset pin any longer */
4012 gpio_bits(0xffffff, 0);
4014 bttv_gpio_tracking(btv,"pxc200");
4016 /* we could/should try and reset/control the AD pots? but
4017 right now we simply turned off the crushing. Without
4018 this the AGC drifts drifts
4019 remember the EN is reverse logic -->
4020 setting BT848_ADC_AGC_EN disable the AGC
4021 tboult@eecs.lehigh.edu
4024 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4026 /* Initialise MAX517 DAC */
4027 pr_info("Setting DAC reference voltage level ...\n");
4028 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4030 /* Initialise 12C508 PIC */
4031 /* The I2CWrite and I2CRead commmands are actually to the
4032 * same chips - but the R/W bit is included in the address
4033 * argument so the numbers are different */
4036 pr_info("Initialising 12C508 PIC chip ...\n");
4038 /* First of all, enable the clock line. This is used in the PXC200-F */
4039 val = btread(BT848_GPIO_DMA_CTL);
4040 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4041 btwrite(val, BT848_GPIO_DMA_CTL);
4043 /* Then, push to 0 the reset pin long enough to reset the *
4044 * device same as above for the reset line, but not the same
4045 * value sent to the GPIO-connected stuff
4046 * which one is the good one? */
4047 gpio_inout(0xffffff,(1<<2));
4052 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4053 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4055 pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4056 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4060 pr_info("PXC200 Initialised\n");
4065 /* ----------------------------------------------------------------------- */
4067 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4068 * it. This apparently involves the following procedure for each 878 chip:
4070 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4072 * 2) write to GPIO_DATA
4078 * read from GPIO_DATA into buf (uint_32)
4079 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4080 * error. ERROR_CPLD_Check_Failed stop.
4082 * 3) write to GPIO_DATA
4083 * - write 0x4400 + 0x0E
4085 * - write 0x4410 + 0x0E
4088 * read from GPIO_DATA into buf (uint_32)
4089 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4090 * error. ERROR_CPLD_Check_Failed.
4092 /* ----------------------------------------------------------------------- */
4094 init_RTV24 (struct bttv *btv)
4096 uint32_t dataRead = 0;
4097 long watchdog_value = 0x0E;
4099 pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
4102 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4104 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4106 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4108 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4110 dataRead = btread (BT848_GPIO_DATA);
4112 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4113 pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4114 btv->c.nr, dataRead);
4117 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4119 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4121 btwrite (watchdog_value, BT848_GPIO_DATA);
4123 dataRead = btread (BT848_GPIO_DATA);
4125 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4126 pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4127 btv->c.nr, dataRead);
4132 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4137 /* ----------------------------------------------------------------------- */
4138 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4140 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4141 * This code is placed under the terms of the GNU General Public License
4143 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4146 static void bus_low(struct bttv *btv, int bit)
4148 if (btv->mbox_ior) {
4149 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4150 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4157 if (btv->mbox_ior) {
4158 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4163 static void bus_high(struct bttv *btv, int bit)
4165 if (btv->mbox_ior) {
4166 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4167 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4174 if (btv->mbox_ior) {
4175 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4180 static int bus_in(struct bttv *btv, int bit)
4182 if (btv->mbox_ior) {
4183 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4184 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4187 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4190 return gpio_read() & (bit);
4193 /* TEA5757 register bits */
4194 #define TEA_FREQ 0:14
4195 #define TEA_BUFFER 15:15
4197 #define TEA_SIGNAL_STRENGTH 16:17
4199 #define TEA_PORT1 18:18
4200 #define TEA_PORT0 19:19
4202 #define TEA_BAND 20:21
4203 #define TEA_BAND_FM 0
4204 #define TEA_BAND_MW 1
4205 #define TEA_BAND_LW 2
4206 #define TEA_BAND_SW 3
4208 #define TEA_MONO 22:22
4209 #define TEA_ALLOW_STEREO 0
4210 #define TEA_FORCE_MONO 1
4212 #define TEA_SEARCH_DIRECTION 23:23
4213 #define TEA_SEARCH_DOWN 0
4214 #define TEA_SEARCH_UP 1
4216 #define TEA_STATUS 24:24
4217 #define TEA_STATUS_TUNED 0
4218 #define TEA_STATUS_SEARCHING 1
4220 /* Low-level stuff */
4221 static int tea5757_read(struct bttv *btv)
4223 unsigned long timeout;
4227 /* better safe than sorry */
4228 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4230 if (btv->mbox_ior) {
4231 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4232 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4237 bttv_gpio_tracking(btv,"tea5757 read");
4239 bus_low(btv,btv->mbox_we);
4240 bus_low(btv,btv->mbox_clk);
4243 timeout= jiffies + msecs_to_jiffies(1000);
4245 /* wait for DATA line to go low; error if it doesn't */
4246 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4248 if (bus_in(btv,btv->mbox_data)) {
4249 pr_warn("%d: tea5757: read timeout\n", btv->c.nr);
4253 dprintk("%d: tea5757:", btv->c.nr);
4254 for (i = 0; i < 24; i++) {
4256 bus_high(btv,btv->mbox_clk);
4259 bus_in(btv, btv->mbox_most) == 0 ? 'T' : '-');
4260 bus_low(btv,btv->mbox_clk);
4262 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4264 bus_in(btv, btv->mbox_most) == 0 ? 'S' : 'M');
4267 dprintk("%d: tea5757: read 0x%X\n", btv->c.nr, value);
4271 static int tea5757_write(struct bttv *btv, int value)
4276 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4278 if (btv->mbox_ior) {
4279 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4280 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4284 bttv_gpio_tracking(btv,"tea5757 write");
4286 dprintk("%d: tea5757: write 0x%X\n", btv->c.nr, value);
4287 bus_low(btv,btv->mbox_clk);
4288 bus_high(btv,btv->mbox_we);
4289 for (i = 0; i < 25; i++) {
4290 if (reg & 0x1000000)
4291 bus_high(btv,btv->mbox_data);
4293 bus_low(btv,btv->mbox_data);
4295 bus_high(btv,btv->mbox_clk);
4297 bus_low(btv,btv->mbox_clk);
4300 bus_low(btv,btv->mbox_we); /* unmute !!! */
4304 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4306 dprintk("tea5757_set_freq %d\n",freq);
4307 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4310 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4312 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4313 * switch instead (CD22M3494E). This IC can have multiple active connections
4314 * between Xn (input) and Yn (output) pins. We need to clear any existing
4315 * connection prior to establish a new one, pulsing the STROBE pin.
4317 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4318 * GPIO pins are wired as:
4319 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4320 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4321 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4322 * GPIO[8] - - P3[5] (microcontroller)
4323 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4324 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4325 * GPINTR - - P3[4] (microcontroller)
4327 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4328 * configuration either directly (as we are doing) or using the microcontroller
4329 * which is also wired to I2C interface. I have no further info on the
4330 * microcontroller features, one would need to disassembly the firmware.
4331 * note: the vendor refused to give any information on this product, all
4332 * that stuff was found using a multimeter! :)
4334 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4336 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4337 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4339 gpio_bits(0x07f, muxgpio[input]);
4341 /* reset all conections */
4342 gpio_bits(0x200,0x200);
4344 gpio_bits(0x200,0x000);
4347 /* create a new connection */
4348 gpio_bits(0x480,0x480);
4350 gpio_bits(0x480,0x080);
4354 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4356 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4357 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
4358 * chips, ten eight input analog multiplexors, a not chip and a few
4361 * 16 inputs on a secondary bracket are provided and can be selected
4362 * from each of the four capture chips. Two of the eight input
4363 * multiplexors are used to select from any of the 16 input signals.
4365 * Unsupported hardware capabilities:
4366 * . A video output monitor on the secondary bracket can be selected from
4367 * one of the 878A chips.
4368 * . Another passthrough but I haven't spent any time investigating it.
4369 * . Digital I/O (logic level connected to GPIO) is available from an
4372 * The on chip input mux should always be set to 2.
4373 * GPIO[16:19] - Video input selection
4374 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4375 * GPIO[?:?] - Digital I/O.
4377 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4378 * determined what function (if any) it provides. With the microcontroller
4379 * and sync separator chips a guess is that it might have to do with video
4380 * switching and maybe some digital I/O.
4382 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4385 gpio_bits(0x0f0000, input << 16);
4388 static void tibetCS16_init(struct bttv *btv)
4390 /* enable gpio bits, mask obtained via btSpy */
4391 gpio_inout(0xffffff, 0x0f7fff);
4392 gpio_write(0x0f7fff);
4396 * The following routines for the Kodicom-4400r get a little mind-twisting.
4397 * There is a "master" controller and three "slave" controllers, together
4398 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4399 * The analog switch is controlled by the "master", but the detection order
4400 * of the four BT878A chips is in an order which I just don't understand.
4401 * The "master" is actually the second controller to be detected. The
4402 * logic on the board uses logical numbers for the 4 controllers, but
4403 * those numbers are different from the detection sequence. When working
4404 * with the analog switch, we need to "map" from the detection sequence
4405 * over to the board's logical controller number. This mapping sequence
4406 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4407 * unit 3, the second (which is the master) is logical unit 0, etc.
4408 * We need to maintain the status of the analog switch (which of the 16
4409 * cameras is connected to which of the 4 controllers). Rather than
4410 * add to the bttv structure for this, we use the data reserved for
4411 * the mbox (unused for this card type).
4415 * First a routine to set the analog switch, which controls which camera
4416 * is routed to which controller. The switch comprises an X-address
4417 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4418 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4419 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4420 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4421 * specified address. The idea is to set the address and data, then bring
4422 * STROBE high, and finally bring STROBE back to low.
4424 static void kodicom4400r_write(struct bttv *btv,
4425 unsigned char xaddr,
4426 unsigned char yaddr,
4427 unsigned char data) {
4430 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4431 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4432 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4433 gpio_bits(0x1ff, udata); /* strobe low */
4437 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4438 * use this routine. The routine finds the "master" for the card, maps
4439 * the controller number from the detected position over to the logical
4440 * number, writes the appropriate data to the analog switch, and housekeeps
4441 * the local copy of the switch information. The parameter 'input' is the
4442 * requested camera number (0 - 15).
4444 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4449 static unsigned char map[4] = {3, 0, 2, 1};
4451 mctlr = master[btv->c.nr];
4452 if (mctlr == NULL) { /* ignore if master not yet detected */
4455 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4457 sw_status = (char *)(&mctlr->mbox_we);
4458 xaddr = input & 0xf;
4459 /* Check if the controller/camera pair has changed, else ignore */
4460 if (sw_status[yaddr] != xaddr)
4462 /* "open" the old switch, "close" the new one, save the new */
4463 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4464 sw_status[yaddr] = xaddr;
4465 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4470 * During initialisation, we need to reset the analog switch. We
4471 * also preset the switch to map the 4 connectors on the card to the
4472 * *user's* (see above description of kodicom4400r_muxsel) channels
4475 static void kodicom4400r_init(struct bttv *btv)
4477 char *sw_status = (char *)(&btv->mbox_we);
4480 gpio_inout(0x0003ff, 0x0003ff);
4481 gpio_write(1 << 9); /* reset MUX */
4483 /* Preset camera 0 to the 4 controllers */
4484 for (ix = 0; ix < 4; ix++) {
4486 kodicom4400r_write(btv, ix, ix, 1);
4489 * Since this is the "master", we need to set up the
4490 * other three controller chips' pointers to this structure
4491 * for later use in the muxsel routine.
4493 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4495 master[btv->c.nr-1] = btv;
4496 master[btv->c.nr] = btv;
4497 master[btv->c.nr+1] = btv;
4498 master[btv->c.nr+2] = btv;
4501 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4502 * video multiplexers to provide up to 16 video inputs. These
4503 * multiplexers are controlled by the lower 8 GPIO pins of the
4504 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4506 * xxx0 is pin xxx of multiplexer U5,
4507 * yyy1 is pin yyy of multiplexer U2
4519 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4521 static const int masks[] = {
4522 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4523 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4524 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4525 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4527 gpio_write(masks[input%16]);
4529 static void picolo_tetra_init(struct bttv *btv)
4531 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4532 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4533 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4535 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4538 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4539 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4540 /*GPIO[20]&GPIO[21] used to choose the right input*/
4541 btwrite (input<<20,BT848_GPIO_DATA);
4546 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4548 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4549 * swichers to provide 16 channels to MUX0. The TDA8540's have
4550 * 4 independent outputs and as such the IVC120G also has the
4551 * optional "Monitor Out" bus. This allows the card to be looking
4552 * at one input while the monitor is looking at another.
4554 * Since I've couldn't be bothered figuring out how to add an
4555 * independent muxsel for the monitor bus, I've just set it to
4556 * whatever the card is looking at.
4558 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4559 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4561 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4562 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4563 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4564 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4568 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4569 #define I2C_TDA8540 0x90
4570 #define I2C_TDA8540_ALT1 0x92
4571 #define I2C_TDA8540_ALT2 0x94
4572 #define I2C_TDA8540_ALT3 0x96
4573 #define I2C_TDA8540_ALT4 0x98
4574 #define I2C_TDA8540_ALT5 0x9a
4575 #define I2C_TDA8540_ALT6 0x9c
4577 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4580 int key = input % 4;
4581 int matrix = input / 4;
4583 dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4584 btv->c.nr, input, matrix, key);
4586 /* Handles the input selection on the TDA8540's */
4587 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4588 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4589 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4590 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4591 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4592 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4593 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4594 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4596 /* Handles the output enables on the TDA8540's */
4597 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4598 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4599 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4600 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4601 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4602 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4603 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4604 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4606 /* 878's MUX0 is already selected for input via muxsel values */
4610 /* PXC200 muxsel helper
4611 * luke@syseng.anu.edu.au
4612 * another transplant
4613 * from Alessandro Rubini (rubini@linux.it)
4615 * There are 4 kinds of cards:
4616 * PXC200L which is bt848
4617 * PXC200F which is bt848 with PIC controlling mux
4618 * PXC200AL which is bt878
4619 * PXC200AF which is bt878 with PIC controlling mux
4621 #define PX_CFG_PXC200F 0x01
4622 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4623 #define PX_I2C_PIC 0x0f
4624 #define PX_PXC200A_CARDID 0x200a1295
4625 #define PX_I2C_CMD_CFG 0x00
4627 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4632 unsigned char buf[2];
4634 /* Read PIC config to determine if this is a PXC200F */
4638 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4640 pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
4642 /* not PXC ? do nothing */
4646 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4647 if (!(rc & PX_CFG_PXC200F)) {
4648 pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
4654 /* The multiplexer in the 200F is handled by the GPIO port */
4655 /* get correct mapping between inputs */
4656 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4657 /* ** not needed!? */
4660 /* make sure output pins are enabled */
4661 /* bitmask=0x30f; */
4663 /* check whether we have a PXC200A */
4664 if (btv->cardid == PX_PXC200A_CARDID) {
4665 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4666 bitmask |= 7<<4; /* the DAC */
4668 btwrite(bitmask, BT848_GPIO_OUT_EN);
4670 bitmask = btread(BT848_GPIO_DATA);
4671 if (btv->cardid == PX_PXC200A_CARDID)
4672 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4673 else /* older device */
4674 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4675 btwrite(bitmask,BT848_GPIO_DATA);
4678 * Was "to be safe, set the bt848 to input 0"
4679 * Actually, since it's ok at load time, better not messing
4680 * with these bits (on PXC200AF you need to set mux 2 here)
4682 * needed because bttv-driver sets mux before calling this function
4684 if (btv->cardid == PX_PXC200A_CARDID)
4685 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4686 else /* older device */
4687 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4689 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
4692 static void phytec_muxsel(struct bttv *btv, unsigned int input)
4694 unsigned int mux = input % 4;
4696 if (input == btv->svhs)
4699 gpio_bits(0x3, mux);
4703 * GeoVision GV-800(S) functions
4704 * Bruno Christo <bchristo@inf.ufsm.br>
4707 /* This is a function to control the analog switch, which determines which
4708 * camera is routed to which controller. The switch comprises an X-address
4709 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4710 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4711 * A data value (gpio bit 18) of '1' enables the switch, and '0' disables
4712 * the switch. A STROBE bit (gpio bit 17) latches the data value into the
4713 * specified address. There is also a chip select (gpio bit 16).
4714 * The idea is to set the address and chip select together, bring
4715 * STROBE high, write the data, and finally bring STROBE back to low.
4717 static void gv800s_write(struct bttv *btv,
4718 unsigned char xaddr,
4719 unsigned char yaddr,
4720 unsigned char data) {
4721 /* On the "master" 878A:
4722 * GPIO bits 0-9 are used for the analog switch:
4723 * 00 - 03: camera selector
4724 * 04 - 06: 878A (controller) selector
4727 * 18: data (1->on, 0->off)
4730 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4731 const u32 CSELECT = 1<<16;
4732 const u32 STROBE = 1<<17;
4733 const u32 DATA = data<<18;
4735 gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */
4736 gpio_bits(0x20000, STROBE); /* STROBE high */
4737 gpio_bits(0x40000, DATA); /* write DATA */
4738 gpio_bits(0x20000, ~STROBE); /* STROBE low */
4742 * GeoVision GV-800(S) muxsel
4744 * Each of the 4 cards (controllers) use this function.
4745 * The controller using this function selects the input through the GPIO pins
4746 * of the "master" card. A pointer to this card is stored in master[btv->c.nr].
4748 * The parameter 'input' is the requested camera number (0-4) on the controller.
4749 * The map array has the address of each input. Note that the addresses in the
4750 * array are in the sequence the original GeoVision driver uses, that is, set
4751 * every controller to input 0, then to input 1, 2, 3, repeat. This means that
4752 * the physical "camera 1" connector corresponds to controller 0 input 0,
4753 * "camera 2" corresponds to controller 1 input 0, and so on.
4755 * After getting the input address, the function then writes the appropriate
4756 * data to the analog switch, and housekeeps the local copy of the switch
4759 static void gv800s_muxsel(struct bttv *btv, unsigned int input)
4764 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4765 { 0x1, 0x5, 0xb, 0x7 },
4766 { 0x2, 0x8, 0xc, 0xe },
4767 { 0x3, 0x9, 0xd, 0xf } };
4769 mctlr = master[btv->c.nr];
4770 if (mctlr == NULL) {
4771 /* do nothing until the "master" is detected */
4774 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4775 sw_status = (char *)(&mctlr->mbox_we);
4776 xaddr = map[yaddr][input] & 0xf;
4778 /* Check if the controller/camera pair has changed, ignore otherwise */
4779 if (sw_status[yaddr] != xaddr) {
4780 /* disable the old switch, enable the new one and save status */
4781 gv800s_write(mctlr, sw_status[yaddr], yaddr, 0);
4782 sw_status[yaddr] = xaddr;
4783 gv800s_write(mctlr, xaddr, yaddr, 1);
4787 /* GeoVision GV-800(S) "master" chip init */
4788 static void gv800s_init(struct bttv *btv)
4790 char *sw_status = (char *)(&btv->mbox_we);
4793 gpio_inout(0xf107f, 0xf107f);
4794 gpio_write(1<<19); /* reset the analog MUX */
4797 /* Preset camera 0 to the 4 controllers */
4798 for (ix = 0; ix < 4; ix++) {
4800 gv800s_write(btv, ix, ix, 1);
4803 /* Inputs on the "master" controller need this brightness fix */
4804 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
4806 if (btv->c.nr > BTTV_MAX-4)
4809 * Store the "master" controller pointer in the master
4810 * array for later use in the muxsel function.
4812 master[btv->c.nr] = btv;
4813 master[btv->c.nr+1] = btv;
4814 master[btv->c.nr+2] = btv;
4815 master[btv->c.nr+3] = btv;
4818 /* ----------------------------------------------------------------------- */
4819 /* motherboard chipset specific stuff */
4821 void __init bttv_check_chipset(void)
4823 int pcipci_fail = 0;
4824 struct pci_dev *dev = NULL;
4826 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4828 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4830 if (pci_pci_problems & PCIPCI_VSFX)
4832 #ifdef PCIPCI_ALIMAGIK
4833 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4838 /* print warnings about any quirks found */
4840 pr_info("Host bridge needs ETBF enabled\n");
4842 pr_info("Host bridge needs VSFX enabled\n");
4844 pr_info("bttv and your chipset may not work together\n");
4846 pr_info("overlay will be disabled\n");
4849 pr_info("overlay forced. Use this option at your own risk.\n");
4852 if (UNSET != latency)
4853 pr_info("pci latency fixup [%d]\n", latency);
4854 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4855 PCI_DEVICE_ID_INTEL_82441, dev))) {
4857 pci_read_config_byte(dev, 0x53, &b);
4859 pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4864 int __devinit bttv_handle_chipset(struct bttv *btv)
4866 unsigned char command;
4868 if (!triton1 && !vsfx && UNSET == latency)
4873 pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
4875 if (vsfx && btv->id >= 878)
4876 pr_info("%d: enabling VSFX\n", btv->c.nr);
4877 if (UNSET != latency)
4878 pr_info("%d: setting pci timer to %d\n",
4879 btv->c.nr, latency);
4882 if (btv->id < 878) {
4883 /* bt848 (mis)uses a bit in the irq mask for etbf */
4885 btv->triton1 = BT848_INT_ETBF;
4887 /* bt878 has a bit in the pci config space for it */
4888 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4890 command |= BT878_EN_TBFX;
4892 command |= BT878_EN_VSFX;
4893 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4895 if (UNSET != latency)
4896 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);