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/i2c/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);
55 static void init_PCI8604PW(struct bttv *btv);
57 static void rv605_muxsel(struct bttv *btv, unsigned int input);
58 static void eagle_muxsel(struct bttv *btv, unsigned int input);
59 static void xguard_muxsel(struct bttv *btv, unsigned int input);
60 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
61 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
63 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
65 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
66 static void picolo_tetra_init(struct bttv *btv);
68 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
69 static void tibetCS16_init(struct bttv *btv);
71 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
72 static void kodicom4400r_init(struct bttv *btv);
74 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
75 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
77 static void geovision_muxsel(struct bttv *btv, unsigned int input);
79 static void phytec_muxsel(struct bttv *btv, unsigned int input);
81 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
82 static void gv800s_init(struct bttv *btv);
84 static void td3116_muxsel(struct bttv *btv, unsigned int input);
86 static int terratec_active_radio_upgrade(struct bttv *btv);
87 static int tea575x_init(struct bttv *btv);
88 static void identify_by_eeprom(struct bttv *btv,
89 unsigned char eeprom_data[256]);
90 static int pvr_boot(struct bttv *btv);
92 /* config variables */
93 static unsigned int triton1;
94 static unsigned int vsfx;
95 static unsigned int latency = UNSET;
98 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
99 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int audiodev[BTTV_MAX];
104 static unsigned int saa6588[BTTV_MAX];
105 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
106 static unsigned int autoload = UNSET;
107 static unsigned int gpiomask = UNSET;
108 static unsigned int audioall = UNSET;
109 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
112 module_param(triton1, int, 0444);
113 module_param(vsfx, int, 0444);
114 module_param(no_overlay, int, 0444);
115 module_param(latency, int, 0444);
116 module_param(gpiomask, int, 0444);
117 module_param(audioall, int, 0444);
118 module_param(autoload, int, 0444);
120 module_param_array(card, int, NULL, 0444);
121 module_param_array(pll, int, NULL, 0444);
122 module_param_array(tuner, int, NULL, 0444);
123 module_param_array(svhs, int, NULL, 0444);
124 module_param_array(remote, int, NULL, 0444);
125 module_param_array(audiodev, int, NULL, 0444);
126 module_param_array(audiomux, int, NULL, 0444);
128 MODULE_PARM_DESC(triton1, "set ETBF pci config bit [enable bug compatibility for triton1 + others]");
129 MODULE_PARM_DESC(vsfx, "set VSFX pci config bit [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, 14=14 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) [some VIA/SIS chipsets are known to have problem with overlay]");
144 /* ----------------------------------------------------------------------- */
145 /* list of card IDs for bt878+ cards */
152 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
153 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
154 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
155 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
156 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
157 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
158 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
159 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
160 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
162 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
163 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
165 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
166 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
167 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
168 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
170 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
171 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
172 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
173 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
175 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
176 /* some cards ship with byteswapped IDs ... */
177 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
179 /* this seems to happen as well ... */
180 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
182 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
183 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
184 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
186 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
187 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
188 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
189 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
190 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
191 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
192 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
194 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
196 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
197 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
198 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
200 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
201 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
202 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
203 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
205 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
206 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
207 /* clashes with FlyVideo
208 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
209 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
210 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
211 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
212 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
214 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
220 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
221 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
222 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
223 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
224 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
226 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
227 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
228 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
229 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
231 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
232 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
233 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
234 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
236 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
237 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
246 { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
247 { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
248 { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
249 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
261 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
263 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
264 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
265 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
266 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
267 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
268 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
270 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
271 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
273 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
274 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
275 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
276 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
277 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
278 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
280 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
281 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
283 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
284 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
285 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
286 { 0x03116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 311" },
287 { 0x06116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 611" },
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" },
344 { 0x3116f200, BTTV_BOARD_TVT_TD3116, "Tongwei Video Technology TD-3116" },
345 { 0x02280279, BTTV_BOARD_APOSONIC_WDVR, "Aposonic W-DVR" },
349 /* ----------------------------------------------------------------------- */
350 /* array with description for bt848 / bt878 tv/grabber cards */
352 struct tvcard bttv_tvcards[] = {
353 /* ---- card 0x00 ---------------------------------- */
354 [BTTV_BOARD_UNKNOWN] = {
355 .name = " *** UNKNOWN/GENERIC *** ",
358 .muxsel = MUXSEL(2, 3, 1, 0),
360 .tuner_addr = ADDR_UNSET,
362 [BTTV_BOARD_MIRO] = {
365 /* .audio_inputs= 1, */
368 .muxsel = MUXSEL(2, 3, 1, 1),
369 .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 },
384 .tuner_addr = ADDR_UNSET,
387 .name = "STB, Gateway P/N 6000699 (bt848)",
389 /* .audio_inputs= 1, */
392 .muxsel = MUXSEL(2, 3, 1, 1),
393 .gpiomux = { 4, 0, 2, 3 },
396 .tuner_type = TUNER_PHILIPS_NTSC,
397 .tuner_addr = ADDR_UNSET,
402 /* ---- card 0x04 ---------------------------------- */
403 [BTTV_BOARD_INTEL] = {
404 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
406 /* .audio_inputs= 0, */
409 .muxsel = MUXSEL(2, 3, 1, 1),
411 .tuner_type = TUNER_ABSENT,
412 .tuner_addr = ADDR_UNSET,
414 [BTTV_BOARD_DIAMOND] = {
415 .name = "Diamond DTV2000",
417 /* .audio_inputs= 1, */
420 .muxsel = MUXSEL(2, 3, 1, 0),
421 .gpiomux = { 0, 1, 0, 1 },
424 .tuner_addr = ADDR_UNSET,
426 [BTTV_BOARD_AVERMEDIA] = {
427 .name = "AVerMedia TVPhone",
429 /* .audio_inputs= 1, */
431 .muxsel = MUXSEL(2, 3, 1, 1),
433 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
434 /* 0x04 for some cards ?? */
436 .tuner_addr = ADDR_UNSET,
437 .audio_mode_gpio= avermedia_tvphone_audio,
440 [BTTV_BOARD_MATRIX_VISION] = {
441 .name = "MATRIX-Vision MV-Delta",
443 /* .audio_inputs= 1, */
446 .muxsel = MUXSEL(2, 3, 1, 0, 0),
448 .tuner_type = TUNER_ABSENT,
449 .tuner_addr = ADDR_UNSET,
452 /* ---- card 0x08 ---------------------------------- */
453 [BTTV_BOARD_FLYVIDEO] = {
454 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
456 /* .audio_inputs= 1, */
459 .muxsel = MUXSEL(2, 3, 1, 1),
460 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
464 .tuner_addr = ADDR_UNSET,
466 [BTTV_BOARD_TURBOTV] = {
467 .name = "IMS/IXmicro TurboTV",
469 /* .audio_inputs= 1, */
472 .muxsel = MUXSEL(2, 3, 1, 1),
473 .gpiomux = { 1, 1, 2, 3 },
475 .tuner_type = TUNER_TEMIC_PAL,
476 .tuner_addr = ADDR_UNSET,
478 [BTTV_BOARD_HAUPPAUGE878] = {
479 .name = "Hauppauge (bt878)",
481 /* .audio_inputs= 1, */
483 .gpiomask = 0x0f, /* old: 7 */
484 .muxsel = MUXSEL(2, 0, 1, 1),
485 .gpiomux = { 0, 1, 2, 3 },
489 .tuner_addr = ADDR_UNSET,
491 [BTTV_BOARD_MIROPRO] = {
492 .name = "MIRO PCTV pro",
494 /* .audio_inputs= 1, */
497 .muxsel = MUXSEL(2, 3, 1, 1),
498 .gpiomux = { 0x20001,0x10001, 0, 0 },
501 .tuner_addr = ADDR_UNSET,
504 /* ---- card 0x0c ---------------------------------- */
505 [BTTV_BOARD_ADSTECH_TV] = {
506 .name = "ADS Technologies Channel Surfer TV (bt848)",
508 /* .audio_inputs= 1, */
511 .muxsel = MUXSEL(2, 3, 1, 1),
512 .gpiomux = { 13, 14, 11, 7 },
514 .tuner_addr = ADDR_UNSET,
516 [BTTV_BOARD_AVERMEDIA98] = {
517 .name = "AVerMedia TVCapture 98",
519 /* .audio_inputs= 4, */
522 .muxsel = MUXSEL(2, 3, 1, 1),
523 .gpiomux = { 13, 14, 11, 7 },
526 .tuner_type = TUNER_PHILIPS_PAL,
527 .tuner_addr = ADDR_UNSET,
528 .audio_mode_gpio= avermedia_tv_stereo_audio,
532 .name = "Aimslab Video Highway Xtreme (VHX)",
534 /* .audio_inputs= 1, */
537 .muxsel = MUXSEL(2, 3, 1, 1),
538 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
542 .tuner_addr = ADDR_UNSET,
544 [BTTV_BOARD_ZOLTRIX] = {
545 .name = "Zoltrix TV-Max",
547 /* .audio_inputs= 1, */
550 .muxsel = MUXSEL(2, 3, 1, 1),
551 .gpiomux = { 0, 0, 1, 0 },
554 .tuner_addr = ADDR_UNSET,
557 /* ---- card 0x10 ---------------------------------- */
558 [BTTV_BOARD_PIXVIEWPLAYTV] = {
559 .name = "Prolink Pixelview PlayTV (bt878)",
561 /* .audio_inputs= 1, */
563 .gpiomask = 0x01fe00,
564 .muxsel = MUXSEL(2, 3, 1, 1),
565 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
566 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
567 .gpiomute = 0x002000,
570 .tuner_addr = ADDR_UNSET,
572 [BTTV_BOARD_WINVIEW_601] = {
573 .name = "Leadtek WinView 601",
575 /* .audio_inputs= 1, */
577 .gpiomask = 0x8300f8,
578 .muxsel = MUXSEL(2, 3, 1, 1, 0),
579 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
580 .gpiomute = 0xcfa007,
582 .tuner_addr = ADDR_UNSET,
583 .volume_gpio = winview_volume,
586 [BTTV_BOARD_AVEC_INTERCAP] = {
587 .name = "AVEC Intercapture",
589 /* .audio_inputs= 2, */
592 .muxsel = MUXSEL(2, 3, 1, 1),
593 .gpiomux = { 1, 0, 0, 0 },
595 .tuner_addr = ADDR_UNSET,
597 [BTTV_BOARD_LIFE_FLYKIT] = {
598 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
600 /* .audio_inputs= 1, */
602 .gpiomask = 0x8dff00,
603 .muxsel = MUXSEL(2, 3, 1, 1),
606 .tuner_type = TUNER_ABSENT,
607 .tuner_addr = ADDR_UNSET,
610 /* ---- card 0x14 ---------------------------------- */
611 [BTTV_BOARD_CEI_RAFFLES] = {
612 .name = "CEI Raffles Card",
614 /* .audio_inputs= 3, */
616 .muxsel = MUXSEL(2, 3, 1, 1),
618 .tuner_addr = ADDR_UNSET,
620 [BTTV_BOARD_CONFERENCETV] = {
621 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
623 /* .audio_inputs= 2, tuner, line in */
626 .muxsel = MUXSEL(2, 3, 1, 1),
627 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
630 .tuner_type = TUNER_PHILIPS_PAL_I,
631 .tuner_addr = ADDR_UNSET,
633 [BTTV_BOARD_PHOEBE_TVMAS] = {
634 .name = "Askey CPH050/ Phoebe Tv Master + FM",
636 /* .audio_inputs= 1, */
639 .muxsel = MUXSEL(2, 3, 1, 1),
640 .gpiomux = { 0, 1, 0x800, 0x400 },
644 .tuner_addr = ADDR_UNSET,
646 [BTTV_BOARD_MODTEC_205] = {
647 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
649 /* .audio_inputs= 1, */
653 .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */
654 /* .digital_mode= DIGITAL_MODE_CAMERA, */
655 .gpiomux = { 0, 0, 0, 0 },
658 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
659 .tuner_addr = ADDR_UNSET,
662 /* ---- card 0x18 ---------------------------------- */
663 [BTTV_BOARD_MAGICTVIEW061] = {
664 .name = "Askey CPH05X/06X (bt878) [many vendors]",
666 /* .audio_inputs= 1, */
669 .muxsel = MUXSEL(2, 3, 1, 1),
670 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
674 .tuner_addr = ADDR_UNSET,
676 .has_radio = 1, /* not every card has radio */
678 [BTTV_BOARD_VOBIS_BOOSTAR] = {
679 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
681 /* .audio_inputs= 1, */
683 .gpiomask = 0x1f0fff,
684 .muxsel = MUXSEL(2, 3, 1, 1),
685 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
687 .tuner_type = TUNER_PHILIPS_PAL,
688 .tuner_addr = ADDR_UNSET,
689 .audio_mode_gpio= terratv_audio,
691 [BTTV_BOARD_HAUPPAUG_WCAM] = {
692 .name = "Hauppauge WinCam newer (bt878)",
694 /* .audio_inputs= 1, */
697 .muxsel = MUXSEL(2, 0, 1, 1),
698 .gpiomux = { 0, 1, 2, 3 },
701 .tuner_addr = ADDR_UNSET,
703 [BTTV_BOARD_MAXI] = {
704 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
706 /* .audio_inputs= 2, */
709 .muxsel = MUXSEL(2, 3, 1, 1),
710 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
713 .tuner_type = TUNER_PHILIPS_SECAM,
714 .tuner_addr = ADDR_UNSET,
717 /* ---- card 0x1c ---------------------------------- */
718 [BTTV_BOARD_TERRATV] = {
719 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
721 /* .audio_inputs= 1, */
723 .gpiomask = 0x1f0fff,
724 .muxsel = MUXSEL(2, 3, 1, 1),
725 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
727 .tuner_type = TUNER_PHILIPS_PAL,
728 .tuner_addr = ADDR_UNSET,
729 .audio_mode_gpio= terratv_audio,
731 External 20 pin connector (for Active Radio Upgrade board)
737 gpio05: om5610-stereo
741 gpio09+10: nIOR, nSEL ?? (bt878)
745 gpio16: u2-A0 (1st 4052bt)
748 gpio19: u4-A0 (2nd 4052)
752 00000 : Cdrom (internal audio input)
753 10000 : ext. Video audio input
762 [BTTV_BOARD_PXC200] = {
763 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
764 .name = "Imagenation PXC200",
766 /* .audio_inputs= 1, */
767 .svhs = 1, /* was: 4 */
769 .muxsel = MUXSEL(2, 3, 1, 0, 0),
771 .tuner_type = TUNER_ABSENT,
772 .tuner_addr = ADDR_UNSET,
773 .muxsel_hook = PXC200_muxsel,
776 [BTTV_BOARD_FLYVIDEO_98] = {
777 .name = "Lifeview FlyVideo 98 LR50",
779 /* .audio_inputs= 1, */
781 .gpiomask = 0x1800, /* 0x8dfe00 */
782 .muxsel = MUXSEL(2, 3, 1, 1),
783 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
787 .tuner_addr = ADDR_UNSET,
789 [BTTV_BOARD_IPROTV] = {
790 .name = "Formac iProTV, Formac ProTV I (bt848)",
792 /* .audio_inputs= 1, */
795 .muxsel = MUXSEL(2, 3, 1, 1),
796 .gpiomux = { 1, 0, 0, 0 },
798 .tuner_type = TUNER_PHILIPS_PAL,
799 .tuner_addr = ADDR_UNSET,
802 /* ---- card 0x20 ---------------------------------- */
803 [BTTV_BOARD_INTEL_C_S_PCI] = {
804 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
806 /* .audio_inputs= 0, */
809 .muxsel = MUXSEL(2, 3, 1, 1),
811 .tuner_type = TUNER_ABSENT,
812 .tuner_addr = ADDR_UNSET,
814 [BTTV_BOARD_TERRATVALUE] = {
815 .name = "Terratec TerraTValue Version Bt878",
817 /* .audio_inputs= 1, */
819 .gpiomask = 0xffff00,
820 .muxsel = MUXSEL(2, 3, 1, 1),
821 .gpiomux = { 0x500, 0, 0x300, 0x900 },
824 .tuner_type = TUNER_PHILIPS_PAL,
825 .tuner_addr = ADDR_UNSET,
827 [BTTV_BOARD_WINFAST2000] = {
828 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
830 /* .audio_inputs= 1, */
832 /* TV, CVid, SVid, CVid over SVid connector */
833 .muxsel = MUXSEL(2, 3, 1, 1, 0),
834 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
835 .gpiomask = 0xb33000,
836 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
837 .gpiomute = 0x800000,
838 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
839 gpio23 -- hef4052:nEnable (0x800000)
842 0x0000: external audio
846 Note: There exists another variant "Winfast 2000" with tv stereo !?
847 Note: eeprom only contains FF and pci subsystem id 107d:6606
851 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
852 .tuner_addr = ADDR_UNSET,
853 .audio_mode_gpio= winfast2000_audio,
856 [BTTV_BOARD_CHRONOS_VS2] = {
857 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
859 /* .audio_inputs= 3, */
862 .muxsel = MUXSEL(2, 3, 1, 1),
863 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
867 .tuner_addr = ADDR_UNSET,
870 /* ---- card 0x24 ---------------------------------- */
871 [BTTV_BOARD_TYPHOON_TVIEW] = {
872 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
874 /* .audio_inputs= 3, */
877 .muxsel = MUXSEL(2, 3, 1, 1),
878 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
882 .tuner_addr = ADDR_UNSET,
885 [BTTV_BOARD_PXELVWPLTVPRO] = {
886 .name = "Prolink PixelView PlayTV pro",
888 /* .audio_inputs= 1, */
891 .muxsel = MUXSEL(2, 3, 1, 1),
892 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
897 .tuner_addr = ADDR_UNSET,
899 [BTTV_BOARD_MAGICTVIEW063] = {
900 .name = "Askey CPH06X TView99",
902 /* .audio_inputs= 1, */
904 .gpiomask = 0x551e00,
905 .muxsel = MUXSEL(2, 3, 1, 0),
906 .gpiomux = { 0x551400, 0x551200, 0, 0 },
907 .gpiomute = 0x551c00,
909 .tuner_type = TUNER_PHILIPS_PAL_I,
910 .tuner_addr = ADDR_UNSET,
913 [BTTV_BOARD_PINNACLE] = {
914 .name = "Pinnacle PCTV Studio/Rave",
916 /* .audio_inputs= 1, */
918 .gpiomask = 0x03000F,
919 .muxsel = MUXSEL(2, 3, 1, 1),
920 .gpiomux = { 2, 0xd0001, 0, 0 },
924 .tuner_addr = ADDR_UNSET,
927 /* ---- card 0x28 ---------------------------------- */
928 [BTTV_BOARD_STB2] = {
929 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
931 /* .audio_inputs= 1, */
934 .muxsel = MUXSEL(2, 3, 1, 1),
935 .gpiomux = { 4, 0, 2, 3 },
938 .tuner_type = TUNER_PHILIPS_NTSC,
939 .tuner_addr = ADDR_UNSET,
943 [BTTV_BOARD_AVPHONE98] = {
944 .name = "AVerMedia TVPhone 98",
946 /* .audio_inputs= 4, */
949 .muxsel = MUXSEL(2, 3, 1, 1),
950 .gpiomux = { 13, 4, 11, 7 },
953 .tuner_addr = ADDR_UNSET,
955 .audio_mode_gpio= avermedia_tvphone_audio,
957 [BTTV_BOARD_PV951] = {
958 .name = "ProVideo PV951", /* pic16c54 */
960 /* .audio_inputs= 1, */
963 .muxsel = MUXSEL(2, 3, 1, 1),
964 .gpiomux = { 0, 0, 0, 0},
967 .tuner_type = TUNER_PHILIPS_PAL_I,
968 .tuner_addr = ADDR_UNSET,
970 [BTTV_BOARD_ONAIR_TV] = {
971 .name = "Little OnAir TV",
973 /* .audio_inputs= 1, */
976 .muxsel = MUXSEL(2, 3, 1, 1),
977 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
978 .gpiomute = 0xff3ffc,
981 .tuner_addr = ADDR_UNSET,
984 /* ---- card 0x2c ---------------------------------- */
985 [BTTV_BOARD_SIGMA_TVII_FM] = {
986 .name = "Sigma TVII-FM",
988 /* .audio_inputs= 1, */
991 .muxsel = MUXSEL(2, 3, 1, 1),
992 .gpiomux = { 1, 1, 0, 2 },
997 .tuner_addr = ADDR_UNSET,
999 [BTTV_BOARD_MATRIX_VISION2] = {
1000 .name = "MATRIX-Vision MV-Delta 2",
1002 /* .audio_inputs= 1, */
1005 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1009 .tuner_type = TUNER_ABSENT,
1010 .tuner_addr = ADDR_UNSET,
1012 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1013 .name = "Zoltrix Genie TV/FM",
1015 /* .audio_inputs= 1, */
1017 .gpiomask = 0xbcf03f,
1018 .muxsel = MUXSEL(2, 3, 1, 1),
1019 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1020 .gpiomute = 0xbcb03f,
1023 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1024 .tuner_addr = ADDR_UNSET,
1026 [BTTV_BOARD_TERRATVRADIO] = {
1027 .name = "Terratec TV/Radio+",
1029 /* .audio_inputs= 1, */
1031 .gpiomask = 0x70000,
1032 .muxsel = MUXSEL(2, 3, 1, 1),
1033 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1034 .gpiomute = 0x40000,
1037 .tuner_type = TUNER_PHILIPS_PAL_I,
1038 .tuner_addr = ADDR_UNSET,
1042 /* ---- card 0x30 ---------------------------------- */
1043 [BTTV_BOARD_DYNALINK] = {
1044 .name = "Askey CPH03x/ Dynalink Magic TView",
1046 /* .audio_inputs= 1, */
1049 .muxsel = MUXSEL(2, 3, 1, 1),
1050 .gpiomux = {2,0,0,0 },
1053 .tuner_type = UNSET,
1054 .tuner_addr = ADDR_UNSET,
1056 [BTTV_BOARD_GVBCTV3PCI] = {
1057 .name = "IODATA GV-BCTV3/PCI",
1059 /* .audio_inputs= 1, */
1061 .gpiomask = 0x010f00,
1062 .muxsel = MUXSEL(2, 3, 0, 0),
1063 .gpiomux = {0x10000, 0, 0x10000, 0 },
1066 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1067 .tuner_addr = ADDR_UNSET,
1068 .audio_mode_gpio= gvbctv3pci_audio,
1070 [BTTV_BOARD_PXELVWPLTVPAK] = {
1071 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1073 /* .audio_inputs= 1, */
1076 .gpiomask = 0xAA0000,
1077 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
1078 /* .digital_mode= DIGITAL_MODE_CAMERA, */
1079 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1080 .gpiomute = 0xa8000,
1083 .tuner_type = TUNER_PHILIPS_PAL_I,
1084 .tuner_addr = ADDR_UNSET,
1086 /* GPIO wiring: (different from Rev.4C !)
1087 GPIO17: U4.A0 (first hef4052bt)
1089 GPIO20: U5.A1 (second hef4052bt)
1091 GPIO22: BT832 Reset Line
1092 GPIO23: A5,A0, U5,nEN
1093 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1096 [BTTV_BOARD_EAGLE] = {
1097 .name = "Eagle Wireless Capricorn2 (bt878A)",
1099 /* .audio_inputs= 1, */
1102 .muxsel = MUXSEL(2, 0, 1, 1),
1103 .gpiomux = { 0, 1, 2, 3 },
1106 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1107 .tuner_addr = ADDR_UNSET,
1110 /* ---- card 0x34 ---------------------------------- */
1111 [BTTV_BOARD_PINNACLEPRO] = {
1112 /* David Härdeman <david@2gen.com> */
1113 .name = "Pinnacle PCTV Studio Pro",
1115 /* .audio_inputs= 1, */
1117 .gpiomask = 0x03000F,
1118 .muxsel = MUXSEL(2, 3, 1, 1),
1119 .gpiomux = { 1, 0xd0001, 0, 0 },
1121 /* sound path (5 sources):
1122 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1125 2= Mono TV sound from Tuner
1127 MUX2 (mask 0x30000):
1129 1= FM stereo Radio from Tuner */
1131 .tuner_type = UNSET,
1132 .tuner_addr = ADDR_UNSET,
1134 [BTTV_BOARD_TVIEW_RDS_FM] = {
1135 /* Claas Langbehn <claas@bigfoot.com>,
1136 Sven Grothklags <sven@upb.de> */
1137 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1139 /* .audio_inputs= 3, */
1142 .muxsel = MUXSEL(2, 3, 1, 1),
1143 .gpiomux = { 0, 0, 0x10, 8 },
1146 .tuner_type = TUNER_PHILIPS_PAL,
1147 .tuner_addr = ADDR_UNSET,
1150 [BTTV_BOARD_LIFETEC_9415] = {
1151 /* Tim Röstermundt <rosterm@uni-muenster.de>
1152 in de.comp.os.unix.linux.hardware:
1153 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1154 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1155 options tuner type=5 */
1156 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1158 /* .audio_inputs= 1, */
1161 .muxsel = MUXSEL(2, 3, 1, 1),
1162 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1164 /* For cards with tda9820/tda9821:
1165 0x0000: Tuner normal stereo
1166 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1167 0x0880: Tuner A2 stereo */
1169 .tuner_type = UNSET,
1170 .tuner_addr = ADDR_UNSET,
1172 [BTTV_BOARD_BESTBUY_EASYTV] = {
1173 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1174 old Easy TV BT848 version (model CPH031) */
1175 .name = "Askey CPH031/ BESTBUY Easy TV",
1177 /* .audio_inputs= 1, */
1180 .muxsel = MUXSEL(2, 3, 1, 0),
1181 .gpiomux = { 2, 0, 0, 0 },
1184 .tuner_type = TUNER_TEMIC_PAL,
1185 .tuner_addr = ADDR_UNSET,
1188 /* ---- card 0x38 ---------------------------------- */
1189 [BTTV_BOARD_FLYVIDEO_98FM] = {
1190 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1191 .name = "Lifeview FlyVideo 98FM LR50",
1193 /* .audio_inputs= 3, */
1196 .muxsel = MUXSEL(2, 3, 1, 1),
1197 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1200 .tuner_type = TUNER_PHILIPS_PAL,
1201 .tuner_addr = ADDR_UNSET,
1203 /* This is the ultimate cheapo capture card
1204 * just a BT848A on a small PCB!
1205 * Steve Hosgood <steve@equiinet.com> */
1206 [BTTV_BOARD_GRANDTEC] = {
1207 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1209 /* .audio_inputs= 0, */
1212 .muxsel = MUXSEL(3, 1),
1216 .tuner_type = TUNER_ABSENT,
1217 .tuner_addr = ADDR_UNSET,
1219 [BTTV_BOARD_ASKEY_CPH060] = {
1220 /* Daniel Herrington <daniel.herrington@home.com> */
1221 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1223 /* .audio_inputs= 1, */
1226 .muxsel = MUXSEL(2, 3, 1, 1),
1227 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1230 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1231 .tuner_addr = ADDR_UNSET,
1233 [BTTV_BOARD_ASKEY_CPH03X] = {
1234 /* Matti Mottus <mottus@physic.ut.ee> */
1235 .name = "Askey CPH03x TV Capturer",
1237 /* .audio_inputs= 1, */
1239 .gpiomask = 0x03000F,
1240 .muxsel = MUXSEL(2, 3, 1, 0),
1241 .gpiomux = { 2, 0, 0, 0 },
1244 .tuner_type = TUNER_TEMIC_PAL,
1245 .tuner_addr = ADDR_UNSET,
1249 /* ---- card 0x3c ---------------------------------- */
1250 [BTTV_BOARD_MM100PCTV] = {
1251 /* Philip Blundell <philb@gnu.org> */
1252 .name = "Modular Technology MM100PCTV",
1254 /* .audio_inputs= 2, */
1257 .muxsel = MUXSEL(2, 3, 1, 1),
1258 .gpiomux = { 2, 0, 0, 1 },
1261 .tuner_type = TUNER_TEMIC_PAL,
1262 .tuner_addr = ADDR_UNSET,
1264 [BTTV_BOARD_GMV1] = {
1265 /* Adrian Cox <adrian@humboldt.co.uk */
1266 .name = "AG Electronics GMV1",
1268 /* .audio_inputs= 0, */
1271 .muxsel = MUXSEL(2, 2),
1275 .tuner_type = TUNER_ABSENT,
1276 .tuner_addr = ADDR_UNSET,
1278 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1279 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1280 new Easy TV BT878 version (model CPH061)
1281 special thanks to Informatica Mieres for providing the card */
1282 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1284 /* .audio_inputs= 2, */
1287 .muxsel = MUXSEL(2, 3, 1, 0),
1288 .gpiomux = { 1, 0, 4, 4 },
1291 .tuner_type = TUNER_PHILIPS_PAL,
1292 .tuner_addr = ADDR_UNSET,
1294 [BTTV_BOARD_ATI_TVWONDER] = {
1295 /* Lukas Gebauer <geby@volny.cz> */
1296 .name = "ATI TV-Wonder",
1298 /* .audio_inputs= 1, */
1301 .muxsel = MUXSEL(2, 3, 1, 0),
1302 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1305 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1306 .tuner_addr = ADDR_UNSET,
1309 /* ---- card 0x40 ---------------------------------- */
1310 [BTTV_BOARD_ATI_TVWONDERVE] = {
1311 /* Lukas Gebauer <geby@volny.cz> */
1312 .name = "ATI TV-Wonder VE",
1314 /* .audio_inputs= 1, */
1317 .muxsel = MUXSEL(2, 3, 0, 1),
1318 .gpiomux = { 0, 0, 1, 0 },
1321 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1322 .tuner_addr = ADDR_UNSET,
1324 [BTTV_BOARD_FLYVIDEO2000] = {
1325 /* DeeJay <deejay@westel900.net (2000S) */
1326 .name = "Lifeview FlyVideo 2000S LR90",
1328 /* .audio_inputs= 3, */
1331 .muxsel = MUXSEL(2, 3, 0, 1),
1332 /* Radio changed from 1e80 to 0x800 to make
1333 FlyVideo2000S in .hu happy (gm)*/
1334 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1335 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1337 .audio_mode_gpio= fv2000s_audio,
1340 .tuner_type = TUNER_PHILIPS_PAL,
1341 .tuner_addr = ADDR_UNSET,
1343 [BTTV_BOARD_TERRATVALUER] = {
1344 .name = "Terratec TValueRadio",
1346 /* .audio_inputs= 1, */
1348 .gpiomask = 0xffff00,
1349 .muxsel = MUXSEL(2, 3, 1, 1),
1350 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1353 .tuner_type = TUNER_PHILIPS_PAL,
1354 .tuner_addr = ADDR_UNSET,
1357 [BTTV_BOARD_GVBCTV4PCI] = {
1358 /* TANAKA Kei <peg00625@nifty.com> */
1359 .name = "IODATA GV-BCTV4/PCI",
1361 /* .audio_inputs= 1, */
1363 .gpiomask = 0x010f00,
1364 .muxsel = MUXSEL(2, 3, 0, 0),
1365 .gpiomux = {0x10000, 0, 0x10000, 0 },
1368 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1369 .tuner_addr = ADDR_UNSET,
1370 .audio_mode_gpio= gvbctv3pci_audio,
1373 /* ---- card 0x44 ---------------------------------- */
1374 [BTTV_BOARD_VOODOOTV_FM] = {
1375 .name = "3Dfx VoodooTV FM (Euro)",
1376 /* try "insmod msp3400 simple=0" if you have
1377 * sound problems with this card. */
1379 /* .audio_inputs= 1, */
1381 .gpiomask = 0x4f8a00,
1382 /* 0x100000: 1=MSP enabled (0=disable again)
1383 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1384 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1385 .gpiomute = 0x947fff,
1386 /* tvtuner, radio, external,internal, mute, stereo
1387 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1388 .muxsel = MUXSEL(2, 3, 0, 1),
1389 .tuner_type = TUNER_MT2032,
1390 .tuner_addr = ADDR_UNSET,
1394 [BTTV_BOARD_VOODOOTV_200] = {
1395 .name = "VoodooTV 200 (USA)",
1396 /* try "insmod msp3400 simple=0" if you have
1397 * sound problems with this card. */
1399 /* .audio_inputs= 1, */
1401 .gpiomask = 0x4f8a00,
1402 /* 0x100000: 1=MSP enabled (0=disable again)
1403 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1404 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1405 .gpiomute = 0x947fff,
1406 /* tvtuner, radio, external,internal, mute, stereo
1407 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1408 .muxsel = MUXSEL(2, 3, 0, 1),
1409 .tuner_type = TUNER_MT2032,
1410 .tuner_addr = ADDR_UNSET,
1414 [BTTV_BOARD_AIMMS] = {
1415 /* Philip Blundell <pb@nexus.co.uk> */
1416 .name = "Active Imaging AIMMS",
1418 /* .audio_inputs= 0, */
1419 .tuner_type = TUNER_ABSENT,
1420 .tuner_addr = ADDR_UNSET,
1422 .muxsel = MUXSEL(2),
1425 [BTTV_BOARD_PV_BT878P_PLUS] = {
1426 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1427 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1429 /* .audio_inputs= 4, */
1432 .muxsel = MUXSEL(2, 3, 1, 1),
1433 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1436 .tuner_type = TUNER_LG_PAL_I_FM,
1437 .tuner_addr = ADDR_UNSET,
1440 GPIO0: U4.A0 (hef4052bt)
1442 GPIO2: U4.A1 (second hef4052bt)
1443 GPIO3: U4.nEN, U5.A0, A5.nEN
1447 [BTTV_BOARD_FLYVIDEO98EZ] = {
1448 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1450 /* .audio_inputs= 0, */
1452 /* AV1, AV2, SVHS, CVid adapter on SVHS */
1453 .muxsel = MUXSEL(2, 3, 1, 1),
1456 .tuner_type = TUNER_ABSENT,
1457 .tuner_addr = ADDR_UNSET,
1460 /* ---- card 0x48 ---------------------------------- */
1461 [BTTV_BOARD_PV_BT878P_9B] = {
1462 /* Dariusz Kowalewski <darekk@automex.pl> */
1463 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1465 /* .audio_inputs= 1, */
1468 .muxsel = MUXSEL(2, 3, 1, 1),
1469 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1473 .tuner_type = TUNER_PHILIPS_PAL,
1474 .tuner_addr = ADDR_UNSET,
1475 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1476 .has_radio = 1, /* Note: not all cards have radio */
1483 GPIO20,22,23: R30,R29,R28
1486 [BTTV_BOARD_SENSORAY311_611] = {
1487 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1488 /* you must jumper JP5 for the 311 card (PC/104+) to work */
1489 .name = "Sensoray 311/611",
1491 /* .audio_inputs= 0, */
1494 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1496 .tuner_type = TUNER_ABSENT,
1497 .tuner_addr = ADDR_UNSET,
1499 [BTTV_BOARD_RV605] = {
1500 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1501 .name = "RemoteVision MX (RV605)",
1503 /* .audio_inputs= 0, */
1506 .gpiomask2 = 0x07ff,
1507 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
1509 .tuner_type = TUNER_ABSENT,
1510 .tuner_addr = ADDR_UNSET,
1511 .muxsel_hook = rv605_muxsel,
1513 [BTTV_BOARD_POWERCLR_MTV878] = {
1514 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1516 /* .audio_inputs= 2, */
1518 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1519 .muxsel = MUXSEL(2, 1, 1),
1520 .gpiomux = { 0, 1, 2, 2 },
1522 .tuner_type = TUNER_PHILIPS_PAL,
1523 .tuner_addr = ADDR_UNSET,
1528 /* ---- card 0x4c ---------------------------------- */
1529 [BTTV_BOARD_WINDVR] = {
1530 /* Masaki Suzuki <masaki@btree.org> */
1531 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1533 /* .audio_inputs= 1, */
1535 .gpiomask = 0x140007,
1536 .muxsel = MUXSEL(2, 3, 1, 1),
1537 .gpiomux = { 0, 1, 2, 3 },
1539 .tuner_type = TUNER_PHILIPS_NTSC,
1540 .tuner_addr = ADDR_UNSET,
1541 .audio_mode_gpio= windvr_audio,
1543 [BTTV_BOARD_GRANDTEC_MULTI] = {
1544 .name = "GrandTec Multi Capture Card (Bt878)",
1546 /* .audio_inputs= 0, */
1549 .muxsel = MUXSEL(2, 3, 1, 0),
1553 .tuner_type = TUNER_ABSENT,
1554 .tuner_addr = ADDR_UNSET,
1556 [BTTV_BOARD_KWORLD] = {
1557 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1559 /* .audio_inputs= 3, */
1562 /* Tuner, SVid, SVHS, SVid to SVHS connector */
1563 .muxsel = MUXSEL(2, 3, 1, 1),
1564 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1565 * This card lacks external Audio In, so we mute it on Ext. & Int.
1566 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1567 * This card lacks PCI subsystem ID, sigh.
1568 * gpiomux =1: lower volume, 2+3: mute
1569 * btwincap uses 0x80000/0x80003
1574 .tuner_type = TUNER_PHILIPS_PAL,
1575 .tuner_addr = ADDR_UNSET,
1576 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1577 radio signal strength indicators work fine. */
1580 GPIO0,1: HEF4052 A0,A1
1581 GPIO2: HEF4052 nENABLE
1583 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1587 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1589 [BTTV_BOARD_DSP_TCVIDEO] = {
1590 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1591 .name = "DSP Design TCVIDEO",
1594 .muxsel = MUXSEL(2, 3, 1, 0),
1596 .tuner_type = UNSET,
1597 .tuner_addr = ADDR_UNSET,
1600 /* ---- card 0x50 ---------------------------------- */
1601 [BTTV_BOARD_HAUPPAUGEPVR] = {
1602 .name = "Hauppauge WinTV PVR",
1604 /* .audio_inputs= 1, */
1606 .muxsel = MUXSEL(2, 0, 1, 1),
1608 .tuner_type = UNSET,
1609 .tuner_addr = ADDR_UNSET,
1614 [BTTV_BOARD_GVBCTV5PCI] = {
1615 .name = "IODATA GV-BCTV5/PCI",
1617 /* .audio_inputs= 1, */
1619 .gpiomask = 0x0f0f80,
1620 .muxsel = MUXSEL(2, 3, 1, 0),
1621 .gpiomux = {0x030000, 0x010000, 0, 0 },
1622 .gpiomute = 0x020000,
1625 .tuner_type = TUNER_PHILIPS_NTSC_M,
1626 .tuner_addr = ADDR_UNSET,
1627 .audio_mode_gpio= gvbctv5pci_audio,
1630 [BTTV_BOARD_OSPREY1x0] = {
1631 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1632 .video_inputs = 4, /* id-inputs-clock */
1633 /* .audio_inputs= 0, */
1635 .muxsel = MUXSEL(3, 2, 0, 1),
1637 .tuner_type = TUNER_ABSENT,
1638 .tuner_addr = ADDR_UNSET,
1642 [BTTV_BOARD_OSPREY1x0_848] = {
1643 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1645 /* .audio_inputs= 0, */
1647 .muxsel = MUXSEL(2, 3, 1),
1649 .tuner_type = TUNER_ABSENT,
1650 .tuner_addr = ADDR_UNSET,
1655 /* ---- card 0x54 ---------------------------------- */
1656 [BTTV_BOARD_OSPREY101_848] = {
1657 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1659 /* .audio_inputs= 0, */
1661 .muxsel = MUXSEL(3, 1),
1663 .tuner_type = TUNER_ABSENT,
1664 .tuner_addr = ADDR_UNSET,
1668 [BTTV_BOARD_OSPREY1x1] = {
1669 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1671 /* .audio_inputs= 0, */
1673 .muxsel = MUXSEL(0),
1675 .tuner_type = TUNER_ABSENT,
1676 .tuner_addr = ADDR_UNSET,
1680 [BTTV_BOARD_OSPREY1x1_SVID] = {
1681 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1683 /* .audio_inputs= 0, */
1685 .muxsel = MUXSEL(0, 1),
1687 .tuner_type = TUNER_ABSENT,
1688 .tuner_addr = ADDR_UNSET,
1692 [BTTV_BOARD_OSPREY2xx] = {
1693 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1695 /* .audio_inputs= 1, */
1697 .muxsel = MUXSEL(0),
1699 .tuner_type = TUNER_ABSENT,
1700 .tuner_addr = ADDR_UNSET,
1705 /* ---- card 0x58 ---------------------------------- */
1706 [BTTV_BOARD_OSPREY2x0_SVID] = {
1707 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1709 /* .audio_inputs= 1, */
1711 .muxsel = MUXSEL(0, 1),
1713 .tuner_type = TUNER_ABSENT,
1714 .tuner_addr = ADDR_UNSET,
1718 [BTTV_BOARD_OSPREY2x0] = {
1719 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1721 /* .audio_inputs= 1, */
1723 .muxsel = MUXSEL(2, 3),
1725 .tuner_type = TUNER_ABSENT,
1726 .tuner_addr = ADDR_UNSET,
1730 [BTTV_BOARD_OSPREY500] = {
1731 .name = "Osprey 500", /* 500 */
1733 /* .audio_inputs= 1, */
1735 .muxsel = MUXSEL(2, 3),
1737 .tuner_type = TUNER_ABSENT,
1738 .tuner_addr = ADDR_UNSET,
1742 [BTTV_BOARD_OSPREY540] = {
1743 .name = "Osprey 540", /* 540 */
1745 /* .audio_inputs= 1, */
1747 .tuner_type = TUNER_ABSENT,
1748 .tuner_addr = ADDR_UNSET,
1753 /* ---- card 0x5C ---------------------------------- */
1754 [BTTV_BOARD_OSPREY2000] = {
1755 .name = "Osprey 2000", /* 2000 */
1757 /* .audio_inputs= 1, */
1759 .muxsel = MUXSEL(2, 3),
1761 .tuner_type = TUNER_ABSENT,
1762 .tuner_addr = ADDR_UNSET,
1764 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1766 [BTTV_BOARD_IDS_EAGLE] = {
1767 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1768 .name = "IDS Eagle",
1770 /* .audio_inputs= 0, */
1771 .tuner_type = TUNER_ABSENT,
1772 .tuner_addr = ADDR_UNSET,
1775 .muxsel = MUXSEL(2, 2, 2, 2),
1776 .muxsel_hook = eagle_muxsel,
1780 [BTTV_BOARD_PINNACLESAT] = {
1781 .name = "Pinnacle PCTV Sat",
1783 /* .audio_inputs= 0, */
1785 .tuner_type = TUNER_ABSENT,
1786 .tuner_addr = ADDR_UNSET,
1789 .muxsel = MUXSEL(3, 1),
1794 [BTTV_BOARD_FORMAC_PROTV] = {
1795 .name = "Formac ProTV II (bt878)",
1797 /* .audio_inputs= 1, */
1800 /* TV, Comp1, Composite over SVID con, SVID */
1801 .muxsel = MUXSEL(2, 3, 1, 1),
1802 .gpiomux = { 2, 2, 0, 0 },
1805 .tuner_type = TUNER_PHILIPS_PAL,
1806 .tuner_addr = ADDR_UNSET,
1808 GPIO=0x00,0x01,0x03: mute (?)
1809 0x02: both TV and radio (tuner: FM1216/I)
1810 The card has onboard audio connectors labeled "cdrom" and "board",
1811 not soldered here, though unknown wiring.
1812 Card lacks: external audio in, pci subsystem id.
1816 /* ---- card 0x60 ---------------------------------- */
1817 [BTTV_BOARD_MACHTV] = {
1820 /* .audio_inputs= 1, */
1823 .muxsel = MUXSEL(2, 3, 1, 1),
1824 .gpiomux = { 0, 1, 2, 3},
1826 .tuner_type = TUNER_PHILIPS_PAL,
1827 .tuner_addr = ADDR_UNSET,
1830 [BTTV_BOARD_EURESYS_PICOLO] = {
1831 .name = "Euresys Picolo",
1833 /* .audio_inputs= 0, */
1838 .muxsel = MUXSEL(2, 0, 1),
1840 .tuner_type = TUNER_ABSENT,
1841 .tuner_addr = ADDR_UNSET,
1843 [BTTV_BOARD_PV150] = {
1844 /* Luc Van Hoeylandt <luc@e-magic.be> */
1845 .name = "ProVideo PV150", /* 0x4f */
1847 /* .audio_inputs= 0, */
1850 .muxsel = MUXSEL(2, 3),
1854 .tuner_type = TUNER_ABSENT,
1855 .tuner_addr = ADDR_UNSET,
1857 [BTTV_BOARD_AD_TVK503] = {
1858 /* Hiroshi Takekawa <sian@big.or.jp> */
1859 /* This card lacks subsystem ID */
1860 .name = "AD-TVK503", /* 0x63 */
1862 /* .audio_inputs= 1, */
1864 .gpiomask = 0x001e8007,
1865 .muxsel = MUXSEL(2, 3, 1, 0),
1866 /* Tuner, Radio, external, internal, off, on */
1867 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1871 .tuner_type = TUNER_PHILIPS_NTSC,
1872 .tuner_addr = ADDR_UNSET,
1873 .audio_mode_gpio= adtvk503_audio,
1876 /* ---- card 0x64 ---------------------------------- */
1877 [BTTV_BOARD_HERCULES_SM_TV] = {
1878 .name = "Hercules Smart TV Stereo",
1880 /* .audio_inputs= 1, */
1883 .muxsel = MUXSEL(2, 3, 1, 1),
1886 .tuner_type = TUNER_PHILIPS_PAL,
1887 .tuner_addr = ADDR_UNSET,
1889 - card lacks subsystem ID
1890 - stereo variant w/ daughter board with tda9874a @0xb0
1892 always from tda9874 independent of GPIO (?)
1893 external line in: unknown
1894 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1895 hef4053 (instead 4052) for unknown function
1898 [BTTV_BOARD_PACETV] = {
1899 .name = "Pace TV & Radio Card",
1901 /* .audio_inputs= 1, */
1903 /* Tuner, CVid, SVid, CVid over SVid connector */
1904 .muxsel = MUXSEL(2, 3, 1, 1),
1907 .tuner_type = TUNER_PHILIPS_PAL_I,
1908 .tuner_addr = ADDR_UNSET,
1911 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1912 only internal line out: (4pin header) RGGL
1913 Radio must be decoded by msp3410d (not routed through)*/
1915 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1918 [BTTV_BOARD_IVC200] = {
1919 /* Chris Willing <chris@vislab.usyd.edu.au> */
1922 /* .audio_inputs= 0, */
1923 .tuner_type = TUNER_ABSENT,
1924 .tuner_addr = ADDR_UNSET,
1927 .muxsel = MUXSEL(2),
1930 [BTTV_BOARD_IVCE8784] = {
1931 .name = "IVCE-8784",
1933 /* .audio_inputs= 0, */
1934 .tuner_type = TUNER_ABSENT,
1935 .tuner_addr = ADDR_UNSET,
1938 .muxsel = MUXSEL(2),
1941 [BTTV_BOARD_XGUARD] = {
1942 .name = "Grand X-Guard / Trust 814PCI",
1944 /* .audio_inputs= 0, */
1946 .tuner_type = TUNER_ABSENT,
1947 .tuner_addr = ADDR_UNSET,
1949 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
1950 .muxsel_hook = xguard_muxsel,
1956 /* ---- card 0x68 ---------------------------------- */
1957 [BTTV_BOARD_NEBULA_DIGITV] = {
1958 .name = "Nebula Electronics DigiTV",
1961 .muxsel = MUXSEL(2, 3, 1, 0),
1965 .tuner_type = TUNER_ABSENT,
1966 .tuner_addr = ADDR_UNSET,
1972 [BTTV_BOARD_PV143] = {
1973 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
1974 .name = "ProVideo PV143",
1976 /* .audio_inputs= 0, */
1979 .muxsel = MUXSEL(2, 3, 1, 0),
1983 .tuner_type = TUNER_ABSENT,
1984 .tuner_addr = ADDR_UNSET,
1986 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
1987 /* M.Klahr@phytec.de */
1988 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
1990 /* .audio_inputs= 0, */
1993 .muxsel = MUXSEL(2, 3, 1, 0),
1994 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
1996 .tuner_type = TUNER_ABSENT,
1997 .tuner_addr = ADDR_UNSET,
1999 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2000 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2002 /* .audio_inputs= 0, */
2005 .muxsel = MUXSEL(2, 3, 1, 1),
2006 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2008 .tuner_type = TUNER_ABSENT,
2009 .tuner_addr = ADDR_UNSET,
2012 /* ---- card 0x6c ---------------------------------- */
2013 [BTTV_BOARD_VD009_MINIDIN] = {
2014 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2016 /* .audio_inputs= 0, */
2019 .gpiomask2 = 0x03, /* used for external vodeo mux */
2020 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2021 .muxsel_hook = phytec_muxsel,
2022 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2024 .tuner_type = TUNER_ABSENT,
2025 .tuner_addr = ADDR_UNSET,
2027 [BTTV_BOARD_VD009_COMBI] = {
2028 .name = "PHYTEC VD-009 Combi (bt878)",
2030 /* .audio_inputs= 0, */
2033 .gpiomask2 = 0x03, /* used for external vodeo mux */
2034 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2035 .muxsel_hook = phytec_muxsel,
2036 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2038 .tuner_type = TUNER_ABSENT,
2039 .tuner_addr = ADDR_UNSET,
2041 [BTTV_BOARD_IVC100] = {
2044 /* .audio_inputs= 0, */
2045 .tuner_type = TUNER_ABSENT,
2046 .tuner_addr = ADDR_UNSET,
2049 .muxsel = MUXSEL(2, 3, 1, 0),
2052 [BTTV_BOARD_IVC120] = {
2053 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2056 /* .audio_inputs= 0, */
2057 .tuner_type = TUNER_ABSENT,
2058 .tuner_addr = ADDR_UNSET,
2059 .svhs = NO_SVHS, /* card has no svhs */
2063 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2064 .muxsel_hook = ivc120_muxsel,
2068 /* ---- card 0x70 ---------------------------------- */
2069 [BTTV_BOARD_PC_HDTV] = {
2070 .name = "pcHDTV HD-2000 TV",
2072 /* .audio_inputs= 1, */
2074 .muxsel = MUXSEL(2, 3, 1, 0),
2075 .tuner_type = TUNER_PHILIPS_FCV1236D,
2076 .tuner_addr = ADDR_UNSET,
2079 [BTTV_BOARD_TWINHAN_DST] = {
2080 .name = "Twinhan DST + clones",
2083 .tuner_type = TUNER_ABSENT,
2084 .tuner_addr = ADDR_UNSET,
2088 [BTTV_BOARD_WINFASTVC100] = {
2089 .name = "Winfast VC100",
2091 /* .audio_inputs= 0, */
2093 /* Vid In, SVid In, Vid over SVid in connector */
2094 .muxsel = MUXSEL(3, 1, 1, 3),
2097 .tuner_type = TUNER_ABSENT,
2098 .tuner_addr = ADDR_UNSET,
2101 [BTTV_BOARD_TEV560] = {
2102 .name = "Teppro TEV-560/InterVision IV-560",
2104 /* .audio_inputs= 1, */
2107 .muxsel = MUXSEL(2, 3, 1, 1),
2108 .gpiomux = { 1, 1, 1, 1 },
2109 .tuner_type = TUNER_PHILIPS_PAL,
2110 .tuner_addr = ADDR_UNSET,
2114 /* ---- card 0x74 ---------------------------------- */
2115 [BTTV_BOARD_SIMUS_GVC1100] = {
2116 .name = "SIMUS GVC1100",
2118 /* .audio_inputs= 0, */
2120 .tuner_type = TUNER_ABSENT,
2121 .tuner_addr = ADDR_UNSET,
2123 .muxsel = MUXSEL(2, 2, 2, 2),
2125 .muxsel_hook = gvc1100_muxsel,
2127 [BTTV_BOARD_NGSTV_PLUS] = {
2128 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2129 .name = "NGS NGSTV+",
2132 .gpiomask = 0x008007,
2133 .muxsel = MUXSEL(2, 3, 0, 0),
2134 .gpiomux = { 0, 0, 0, 0 },
2135 .gpiomute = 0x000003,
2137 .tuner_type = TUNER_PHILIPS_PAL,
2138 .tuner_addr = ADDR_UNSET,
2141 [BTTV_BOARD_LMLBT4] = {
2142 /* http://linuxmedialabs.com */
2144 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2145 /* .audio_inputs= 0, */
2147 .muxsel = MUXSEL(2, 3, 1, 0),
2150 .tuner_type = TUNER_ABSENT,
2151 .tuner_addr = ADDR_UNSET,
2153 [BTTV_BOARD_TEKRAM_M205] = {
2154 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2155 .name = "Tekram M205 PRO",
2157 /* .audio_inputs= 1, */
2158 .tuner_type = TUNER_PHILIPS_PAL,
2159 .tuner_addr = ADDR_UNSET,
2162 .muxsel = MUXSEL(2, 3, 1),
2163 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2167 /* ---- card 0x78 ---------------------------------- */
2168 [BTTV_BOARD_CONTVFMI] = {
2169 /* Javier Cendan Ares <jcendan@lycos.es> */
2170 /* bt878 TV + FM without subsystem ID */
2171 .name = "Conceptronic CONTVFMi",
2173 /* .audio_inputs= 1, */
2175 .gpiomask = 0x008007,
2176 .muxsel = MUXSEL(2, 3, 1, 1),
2177 .gpiomux = { 0, 1, 2, 2 },
2180 .tuner_type = TUNER_PHILIPS_PAL,
2181 .tuner_addr = ADDR_UNSET,
2185 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2186 /*Eric DEBIEF <debief@telemsa.com>*/
2187 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/
2188 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2190 .name = "Euresys Picolo Tetra",
2192 /* .audio_inputs= 0, */
2195 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2198 /*878A input is always MUX0, see above.*/
2199 .muxsel = MUXSEL(2, 2, 2, 2),
2200 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2202 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2203 .tuner_type = TUNER_ABSENT,
2204 .tuner_addr = ADDR_UNSET,
2206 [BTTV_BOARD_SPIRIT_TV] = {
2207 /* Spirit TV Tuner from http://spiritmodems.com.au */
2208 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2209 .name = "Spirit TV Tuner",
2211 /* .audio_inputs= 1, */
2213 .gpiomask = 0x0000000f,
2214 .muxsel = MUXSEL(2, 1, 1),
2215 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2216 .tuner_type = TUNER_TEMIC_PAL,
2217 .tuner_addr = ADDR_UNSET,
2220 [BTTV_BOARD_AVDVBT_771] = {
2221 /* Wolfram Joost <wojo@frokaschwei.de> */
2222 .name = "AVerMedia AVerTV DVB-T 771",
2225 .tuner_type = TUNER_ABSENT,
2226 .tuner_addr = ADDR_UNSET,
2227 .muxsel = MUXSEL(3, 3),
2235 /* ---- card 0x7c ---------------------------------- */
2236 [BTTV_BOARD_AVDVBT_761] = {
2237 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2238 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2239 .name = "AverMedia AverTV DVB-T 761",
2242 .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
2246 .tuner_type = TUNER_ABSENT,
2247 .tuner_addr = ADDR_UNSET,
2252 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2253 /* andre.schwarz@matrix-vision.de */
2254 .name = "MATRIX Vision Sigma-SQ",
2256 /* .audio_inputs= 0, */
2259 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
2260 .muxsel_hook = sigmaSQ_muxsel,
2264 .tuner_type = TUNER_ABSENT,
2265 .tuner_addr = ADDR_UNSET,
2267 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2268 /* andre.schwarz@matrix-vision.de */
2269 .name = "MATRIX Vision Sigma-SLC",
2271 /* .audio_inputs= 0, */
2274 .muxsel = MUXSEL(2, 2, 2, 2),
2275 .muxsel_hook = sigmaSLC_muxsel,
2279 .tuner_type = TUNER_ABSENT,
2280 .tuner_addr = ADDR_UNSET,
2282 /* BTTV_BOARD_APAC_VIEWCOMP */
2283 [BTTV_BOARD_APAC_VIEWCOMP] = {
2284 /* Attila Kondoros <attila.kondoros@chello.hu> */
2285 /* bt878 TV + FM 0x00000000 subsystem ID */
2286 .name = "APAC Viewcomp 878(AMAX)",
2288 /* .audio_inputs= 1, */
2291 .muxsel = MUXSEL(2, 3, 1, 1),
2292 .gpiomux = { 2, 0, 0, 0 },
2295 .tuner_type = TUNER_PHILIPS_PAL,
2296 .tuner_addr = ADDR_UNSET,
2297 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2298 .has_radio = 1, /* not every card has radio */
2301 /* ---- card 0x80 ---------------------------------- */
2302 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2303 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2304 .name = "DViCO FusionHDTV DVB-T Lite",
2310 .tuner_type = TUNER_ABSENT,
2311 .tuner_addr = ADDR_UNSET,
2313 [BTTV_BOARD_VGEAR_MYVCD] = {
2314 /* Steven <photon38@pchome.com.tw> */
2315 .name = "V-Gear MyVCD",
2317 /* .audio_inputs= 1, */
2320 .muxsel = MUXSEL(2, 3, 1, 0),
2321 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2325 .tuner_type = TUNER_PHILIPS_NTSC_M,
2326 .tuner_addr = ADDR_UNSET,
2329 [BTTV_BOARD_SUPER_TV] = {
2330 /* Rick C <cryptdragoon@gmail.com> */
2331 .name = "Super TV Tuner",
2333 /* .audio_inputs= 1, */
2335 .muxsel = MUXSEL(2, 3, 1, 0),
2336 .tuner_type = TUNER_PHILIPS_NTSC,
2337 .tuner_addr = ADDR_UNSET,
2338 .gpiomask = 0x008007,
2339 .gpiomux = { 0, 0x000001,0,0 },
2342 [BTTV_BOARD_TIBET_CS16] = {
2343 /* Chris Fanning <video4linux@haydon.net> */
2344 .name = "Tibet Systems 'Progress DVR' CS16",
2346 /* .audio_inputs= 0, */
2348 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2352 .tuner_type = TUNER_ABSENT,
2353 .tuner_addr = ADDR_UNSET,
2354 .muxsel_hook = tibetCS16_muxsel,
2356 [BTTV_BOARD_KODICOM_4400R] = {
2357 /* Bill Brack <wbrack@mmm.com.hk> */
2359 * Note that, because of the card's wiring, the "master"
2360 * BT878A chip (i.e. the one which controls the analog switch
2361 * and must use this card type) is the 2nd one detected. The
2362 * other 3 chips should use card type 0x85, whose description
2363 * follows this one. There is a EEPROM on the card (which is
2364 * connected to the I2C of one of those other chips), but is
2365 * not currently handled. There is also a facility for a
2366 * "monitor", which is also not currently implemented.
2368 .name = "Kodicom 4400R (master)",
2370 /* .audio_inputs= 0, */
2371 .tuner_type = TUNER_ABSENT,
2372 .tuner_addr = ADDR_UNSET,
2374 /* GPIO bits 0-9 used for analog switch:
2375 * 00 - 03: camera selector
2376 * 04 - 06: channel (controller) selector
2377 * 07: data (1->on, 0->off)
2380 * bit 16 is input from sync separator for the channel
2382 .gpiomask = 0x0003ff,
2384 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2388 .muxsel_hook = kodicom4400r_muxsel,
2390 [BTTV_BOARD_KODICOM_4400R_SL] = {
2391 /* Bill Brack <wbrack@mmm.com.hk> */
2392 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2393 * one which controls the analog switch, and must use the card type)
2394 * is the 2nd one detected. The other 3 chips should use this card
2397 .name = "Kodicom 4400R (slave)",
2399 /* .audio_inputs= 0, */
2400 .tuner_type = TUNER_ABSENT,
2401 .tuner_addr = ADDR_UNSET,
2403 .gpiomask = 0x010000,
2405 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2409 .muxsel_hook = kodicom4400r_muxsel,
2411 /* ---- card 0x86---------------------------------- */
2412 [BTTV_BOARD_ADLINK_RTV24] = {
2413 /* Michael Henson <mhenson@clarityvi.com> */
2414 /* Adlink RTV24 with special unlock codes */
2415 .name = "Adlink RTV24",
2417 /* .audio_inputs= 1, */
2419 .muxsel = MUXSEL(2, 3, 1, 0),
2420 .tuner_type = UNSET,
2421 .tuner_addr = ADDR_UNSET,
2424 /* ---- card 0x87---------------------------------- */
2425 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2426 /* Michael Krufky <mkrufky@linuxtv.org> */
2427 .name = "DViCO FusionHDTV 5 Lite",
2428 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2429 .tuner_addr = ADDR_UNSET,
2431 /* .audio_inputs= 1, */
2433 .muxsel = MUXSEL(2, 3, 1),
2434 .gpiomask = 0x00e00007,
2435 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2436 .gpiomute = 0x00c00007,
2441 /* ---- card 0x88---------------------------------- */
2442 [BTTV_BOARD_ACORP_Y878F] = {
2443 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2444 .name = "Acorp Y878F",
2446 /* .audio_inputs= 1, */
2448 .gpiomask = 0x01fe00,
2449 .muxsel = MUXSEL(2, 3, 1, 1),
2450 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2451 .gpiomute = 0x002000,
2453 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2454 .tuner_addr = 0xc1 >>1,
2457 /* ---- card 0x89 ---------------------------------- */
2458 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2459 .name = "Conceptronic CTVFMi v2",
2461 /* .audio_inputs= 1, */
2463 .gpiomask = 0x001c0007,
2464 .muxsel = MUXSEL(2, 3, 1, 1),
2465 .gpiomux = { 0, 1, 2, 2 },
2468 .tuner_type = TUNER_TENA_9533_DI,
2469 .tuner_addr = ADDR_UNSET,
2473 /* ---- card 0x8a ---------------------------------- */
2474 [BTTV_BOARD_PV_BT878P_2E] = {
2475 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2477 /* .audio_inputs= 1, */
2480 .gpiomask = 0x01fe00,
2481 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
2482 /* .digital_mode= DIGITAL_MODE_CAMERA, */
2483 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2484 .gpiomute = 0x12400,
2487 .tuner_type = TUNER_LG_PAL_FM,
2488 .tuner_addr = ADDR_UNSET,
2491 /* ---- card 0x8b ---------------------------------- */
2492 [BTTV_BOARD_PV_M4900] = {
2493 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2494 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2496 /* .audio_inputs= 1, */
2499 .muxsel = MUXSEL(2, 3, 1, 1),
2500 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2504 .tuner_type = TUNER_YMEC_TVF_5533MF,
2505 .tuner_addr = ADDR_UNSET,
2509 /* ---- card 0x8c ---------------------------------- */
2510 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2511 one external BNC composite input (mux 2)
2512 three internal composite inputs (unknown muxes)
2513 an 18-bit stereo A/D (CS5331A), which has:
2514 one external stereo unblanced (RCA) audio connection
2515 one (or 3?) internal stereo balanced (XLR) audio connection
2516 input is selected via gpio to a 14052B mux
2517 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2518 gain is controlled via an X9221A chip on the I2C bus @0x28
2519 sample rate is controlled via gpio to an MK1413S
2520 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2521 There is neither a tuner nor an svideo input. */
2522 [BTTV_BOARD_OSPREY440] = {
2523 .name = "Osprey 440",
2525 /* .audio_inputs= 2, */
2527 .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */
2529 .gpiomute = 0x000, /* int + 32kHz */
2530 .gpiomux = { 0, 0, 0x000, 0x100},
2532 .tuner_type = TUNER_ABSENT,
2533 .tuner_addr = ADDR_UNSET,
2537 /* ---- card 0x8d ---------------------------------- */
2538 [BTTV_BOARD_ASOUND_SKYEYE] = {
2539 .name = "Asound Skyeye PCTV",
2541 /* .audio_inputs= 1, */
2544 .muxsel = MUXSEL(2, 3, 1, 1),
2545 .gpiomux = { 2, 0, 0, 0 },
2548 .tuner_type = TUNER_PHILIPS_NTSC,
2549 .tuner_addr = ADDR_UNSET,
2551 /* ---- card 0x8e ---------------------------------- */
2552 [BTTV_BOARD_SABRENT_TVFM] = {
2553 .name = "Sabrent TV-FM (bttv version)",
2555 /* .audio_inputs= 1, */
2557 .gpiomask = 0x108007,
2558 .muxsel = MUXSEL(2, 3, 1, 1),
2559 .gpiomux = { 100000, 100002, 100002, 100000 },
2563 .tuner_type = TUNER_TNF_5335MF,
2564 .tuner_addr = ADDR_UNSET,
2567 /* ---- card 0x8f ---------------------------------- */
2568 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2569 .name = "Hauppauge ImpactVCB (bt878)",
2571 /* .audio_inputs= 0, */
2573 .gpiomask = 0x0f, /* old: 7 */
2574 .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
2577 .tuner_type = TUNER_ABSENT,
2578 .tuner_addr = ADDR_UNSET,
2580 [BTTV_BOARD_MACHTV_MAGICTV] = {
2581 /* Julian Calaby <julian.calaby@gmail.com>
2582 * Slightly different from original MachTV definition (0x60)
2584 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2585 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2586 * properly (methinks) causing no keyup bits being set */
2588 .name = "MagicTV", /* rebranded MachTV */
2590 /* .audio_inputs= 1, */
2593 .muxsel = MUXSEL(2, 3, 1, 1),
2594 .gpiomux = { 0, 1, 2, 3 },
2596 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2597 .tuner_addr = ADDR_UNSET,
2602 [BTTV_BOARD_SSAI_SECURITY] = {
2603 .name = "SSAI Security Video Interface",
2605 /* .audio_inputs= 0, */
2607 .muxsel = MUXSEL(0, 1, 2, 3),
2608 .tuner_type = TUNER_ABSENT,
2609 .tuner_addr = ADDR_UNSET,
2611 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2612 .name = "SSAI Ultrasound Video Interface",
2614 /* .audio_inputs= 0, */
2616 .muxsel = MUXSEL(2, 0, 1, 3),
2617 .tuner_type = TUNER_ABSENT,
2618 .tuner_addr = ADDR_UNSET,
2620 /* ---- card 0x94---------------------------------- */
2621 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2622 .name = "DViCO FusionHDTV 2",
2623 .tuner_type = TUNER_PHILIPS_FCV1236D,
2624 .tuner_addr = ADDR_UNSET,
2626 /* .audio_inputs= 1, */
2628 .muxsel = MUXSEL(2, 3, 1),
2629 .gpiomask = 0x00e00007,
2630 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2631 .gpiomute = 0x00c00007,
2635 /* ---- card 0x95---------------------------------- */
2636 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2637 .name = "Typhoon TV-Tuner PCI (50684)",
2639 /* .audio_inputs= 1, */
2641 .gpiomask = 0x3014f,
2642 .muxsel = MUXSEL(2, 3, 1, 1),
2643 .gpiomux = { 0x20001,0x10001, 0, 0 },
2646 .tuner_type = TUNER_PHILIPS_PAL_I,
2647 .tuner_addr = ADDR_UNSET,
2649 [BTTV_BOARD_GEOVISION_GV600] = {
2651 .name = "Geovision GV-600",
2653 /* .audio_inputs= 0, */
2656 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2657 .muxsel_hook = geovision_muxsel,
2661 .tuner_type = TUNER_ABSENT,
2662 .tuner_addr = ADDR_UNSET,
2664 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2665 /* Mauro Lacy <mauro@lacy.com.ar>
2666 * Based on MagicTV and Conceptronic CONTVFMi */
2668 .name = "Kozumi KTV-01C",
2670 /* .audio_inputs= 1, */
2672 .gpiomask = 0x008007,
2673 .muxsel = MUXSEL(2, 3, 1, 1),
2674 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2675 .gpiomute = 3, /* CONTVFMi */
2676 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2677 .tuner_addr = ADDR_UNSET,
2682 [BTTV_BOARD_ENLTV_FM_2] = {
2683 /* Encore TV Tuner Pro ENL TV-FM-2
2684 Mauro Carvalho Chehab <mchehab@infradead.org */
2685 .name = "Encore ENL TV-FM-2",
2687 /* .audio_inputs= 1, */
2689 /* bit 6 -> IR disabled
2690 bit 18/17 = 00 -> mute
2691 01 -> enable external audio input
2692 10 -> internal audio input (mono?)
2693 11 -> internal audio input
2695 .gpiomask = 0x060040,
2696 .muxsel = MUXSEL(2, 3, 3),
2697 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2699 .tuner_type = TUNER_TCL_MF02GIP_5N,
2700 .tuner_addr = ADDR_UNSET,
2705 [BTTV_BOARD_VD012] = {
2706 /* D.Heer@Phytec.de */
2707 .name = "PHYTEC VD-012 (bt878)",
2709 /* .audio_inputs= 0, */
2712 .muxsel = MUXSEL(0, 2, 3, 1),
2713 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2715 .tuner_type = TUNER_ABSENT,
2716 .tuner_addr = ADDR_UNSET,
2718 [BTTV_BOARD_VD012_X1] = {
2719 /* D.Heer@Phytec.de */
2720 .name = "PHYTEC VD-012-X1 (bt878)",
2722 /* .audio_inputs= 0, */
2725 .muxsel = MUXSEL(2, 3, 1),
2726 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2728 .tuner_type = TUNER_ABSENT,
2729 .tuner_addr = ADDR_UNSET,
2731 [BTTV_BOARD_VD012_X2] = {
2732 /* D.Heer@Phytec.de */
2733 .name = "PHYTEC VD-012-X2 (bt878)",
2735 /* .audio_inputs= 0, */
2738 .muxsel = MUXSEL(3, 2, 1),
2739 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2741 .tuner_type = TUNER_ABSENT,
2742 .tuner_addr = ADDR_UNSET,
2744 [BTTV_BOARD_GEOVISION_GV800S] = {
2745 /* Bruno Christo <bchristo@inf.ufsm.br>
2747 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2748 * 1 audio input per BT878A = 4 audio inputs
2749 * 4 video inputs per BT878A = 16 video inputs
2750 * This is the first BT878A chip of the GV-800(S). It's the
2751 * "master" chip and it controls the video inputs through an
2752 * analog multiplexer (a CD22M3494) via some GPIO pins. The
2753 * slaves should use card type 0x9e (following this one).
2754 * There is a EEPROM on the card which is currently not handled.
2755 * The audio input is not working yet.
2757 .name = "Geovision GV-800(S) (master)",
2759 /* .audio_inputs= 1, */
2760 .tuner_type = TUNER_ABSENT,
2761 .tuner_addr = ADDR_UNSET,
2763 .gpiomask = 0xf107f,
2765 .muxsel = MUXSEL(2, 2, 2, 2),
2769 .muxsel_hook = gv800s_muxsel,
2771 [BTTV_BOARD_GEOVISION_GV800S_SL] = {
2772 /* Bruno Christo <bchristo@inf.ufsm.br>
2774 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2775 * 1 audio input per BT878A = 4 audio inputs
2776 * 4 video inputs per BT878A = 16 video inputs
2777 * The 3 other BT878A chips are "slave" chips of the GV-800(S)
2778 * and should use this card type.
2779 * The audio input is not working yet.
2781 .name = "Geovision GV-800(S) (slave)",
2783 /* .audio_inputs= 1, */
2784 .tuner_type = TUNER_ABSENT,
2785 .tuner_addr = ADDR_UNSET,
2789 .muxsel = MUXSEL(2, 2, 2, 2),
2793 .muxsel_hook = gv800s_muxsel,
2795 [BTTV_BOARD_PV183] = {
2796 .name = "ProVideo PV183", /* 0x9f */
2798 /* .audio_inputs= 0, */
2801 .muxsel = MUXSEL(2, 3),
2805 .tuner_type = TUNER_ABSENT,
2806 .tuner_addr = ADDR_UNSET,
2808 /* ---- card 0xa0---------------------------------- */
2809 [BTTV_BOARD_TVT_TD3116] = {
2810 .name = "Tongwei Video Technology TD-3116",
2812 .gpiomask = 0xc00ff,
2813 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2814 .muxsel_hook = td3116_muxsel,
2817 .tuner_type = TUNER_ABSENT,
2819 [BTTV_BOARD_APOSONIC_WDVR] = {
2820 .name = "Aposonic W-DVR",
2823 .muxsel = MUXSEL(2, 3, 1, 0),
2824 .tuner_type = TUNER_ABSENT,
2826 [BTTV_BOARD_ADLINK_MPG24] = {
2828 .name = "Adlink MPG24",
2830 /* .audio_inputs= 1, */
2832 .muxsel = MUXSEL(2, 2, 2, 2),
2833 .tuner_type = UNSET,
2834 .tuner_addr = ADDR_UNSET,
2837 [BTTV_BOARD_BT848_CAP_14] = {
2838 .name = "Bt848 Capture 14MHz",
2841 .muxsel = MUXSEL(2, 3, 1, 0),
2843 .tuner_type = TUNER_ABSENT,
2845 [BTTV_BOARD_CYBERVISION_CV06] = {
2846 .name = "CyberVision CV06 (SV)",
2848 /* .audio_inputs= 0, */
2850 .muxsel = MUXSEL(2, 3, 1, 0),
2852 .tuner_type = TUNER_ABSENT,
2853 .tuner_addr = ADDR_UNSET,
2855 [BTTV_BOARD_KWORLD_VSTREAM_XPERT] = {
2856 /* Pojar George <geoubuntu@gmail.com> */
2857 .name = "Kworld V-Stream Xpert TV PVR878",
2859 /* .audio_inputs= 1, */
2861 .gpiomask = 0x001c0007,
2862 .muxsel = MUXSEL(2, 3, 1, 1),
2863 .gpiomux = { 0, 1, 2, 2 },
2866 .tuner_type = TUNER_TENA_9533_DI,
2867 .tuner_addr = ADDR_UNSET,
2871 /* ---- card 0xa6---------------------------------- */
2872 [BTTV_BOARD_PCI_8604PW] = {
2873 /* PCI-8604PW with special unlock sequence */
2874 .name = "PCI-8604PW",
2876 /* .audio_inputs= 0, */
2878 /* The second input is available on CN4, if populated.
2879 * The other 5x2 header (CN2?) connects to the same inputs
2880 * as the on-board BNCs */
2881 .muxsel = MUXSEL(2, 3),
2882 .tuner_type = TUNER_ABSENT,
2889 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2891 /* ----------------------------------------------------------------------- */
2893 static unsigned char eeprom_data[256];
2898 void bttv_idcard(struct bttv *btv)
2900 unsigned int gpiobits;
2903 /* read PCI subsystem ID */
2904 btv->cardid = btv->c.pci->subsystem_device << 16;
2905 btv->cardid |= btv->c.pci->subsystem_vendor;
2907 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2908 /* look for the card */
2909 for (type = -1, i = 0; cards[i].id != 0; i++)
2910 if (cards[i].id == btv->cardid)
2915 pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2916 btv->c.nr, cards[type].name, cards[type].cardnr,
2917 btv->cardid & 0xffff,
2918 (btv->cardid >> 16) & 0xffff);
2919 btv->c.type = cards[type].cardnr;
2922 pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
2923 btv->c.nr, btv->cardid & 0xffff,
2924 (btv->cardid >> 16) & 0xffff);
2925 pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
2929 /* let the user override the autodetected type */
2930 if (card[btv->c.nr] < bttv_num_tvcards)
2931 btv->c.type=card[btv->c.nr];
2933 /* print which card config we are using */
2934 pr_info("%d: using: %s [card=%d,%s]\n",
2935 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
2936 card[btv->c.nr] < bttv_num_tvcards
2937 ? "insmod option" : "autodetected");
2939 /* overwrite gpio stuff ?? */
2940 if (UNSET == audioall && UNSET == audiomux[0])
2943 if (UNSET != audiomux[0]) {
2945 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2946 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2947 gpiobits |= audiomux[i];
2950 gpiobits = audioall;
2951 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2952 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2955 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2956 pr_info("%d: gpio config override: mask=0x%x, mux=",
2957 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
2958 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2960 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2966 * (most) board specific initialisations goes here
2969 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2970 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2974 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2975 type = BTTV_BOARD_MODTEC_205;
2976 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2977 type = BTTV_BOARD_EURESYS_PICOLO;
2978 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2979 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2983 pr_info("%d: detected by eeprom: %s [card=%d]\n",
2984 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2988 static void flyvideo_gpio(struct bttv *btv)
2990 int gpio, has_remote, has_radio, is_capture_only;
2991 int is_lr90, has_tda9820_tda9821;
2992 int tuner_type = UNSET, ttype;
2994 gpio_inout(0xffffff, 0);
2995 udelay(8); /* without this we would see the 0x1800 mask */
2997 /* FIXME: must restore OUR_EN ??? */
2999 /* all cards provide GPIO info, some have an additional eeprom
3000 * LR50: GPIO coding can be found lower right CP1 .. CP9
3001 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3003 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3005 * lowest 3 bytes are remote control codes (no handshake needed)
3006 * xxxFFF: No remote control chip soldered
3007 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3008 * Note: Some bits are Audio_Mask !
3010 ttype = (gpio & 0x0f0000) >> 16;
3013 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3016 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3019 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3022 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3025 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3028 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
3032 has_remote = gpio & 0x800000;
3033 has_radio = gpio & 0x400000;
3034 /* unknown 0x200000;
3035 * unknown2 0x100000; */
3036 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3037 has_tda9820_tda9821 = !(gpio & 0x004000);
3038 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3040 * gpio & 0x001000 output bit for audio routing */
3042 if (is_capture_only)
3043 tuner_type = TUNER_ABSENT; /* No tuner present */
3045 pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3046 btv->c.nr, has_radio ? "yes" : "no",
3047 has_remote ? "yes" : "no", tuner_type, gpio);
3048 pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3049 btv->c.nr, is_lr90 ? "yes" : "no",
3050 has_tda9820_tda9821 ? "yes" : "no",
3051 is_capture_only ? "yes" : "no");
3053 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3054 btv->tuner_type = tuner_type;
3055 btv->has_radio = has_radio;
3057 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3058 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3059 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3060 if (has_tda9820_tda9821)
3061 btv->audio_mode_gpio = lt9415_audio;
3062 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3065 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3066 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3067 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3068 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3070 static void miro_pinnacle_gpio(struct bttv *btv)
3075 gpio_inout(0xffffff, 0);
3077 id = ((gpio>>10) & 63) -1;
3078 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3080 btv->tuner_type = miro_tunermap[id];
3081 if (0 == (gpio & 0x20)) {
3083 if (!miro_fmtuner[id]) {
3084 btv->has_tea575x = 1;
3085 btv->tea_gpio.wren = 6;
3086 btv->tea_gpio.most = 7;
3087 btv->tea_gpio.clk = 8;
3088 btv->tea_gpio.data = 9;
3095 if (btv->c.type == BTTV_BOARD_MIRO)
3096 btv->c.type = BTTV_BOARD_MIROPRO;
3097 if (btv->c.type == BTTV_BOARD_PINNACLE)
3098 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3100 pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3101 btv->c.nr, id+1, btv->tuner_type,
3102 !btv->has_radio ? "no" :
3103 (btv->has_tea575x ? "tea575x" : "fmtuner"),
3104 (-1 == msp) ? "no" : "yes");
3106 /* new cards with microtune tuner */
3111 info = "PAL / mono";
3112 btv->tda9887_conf = TDA9887_INTERCARRIER;
3115 info = "PAL+SECAM / stereo";
3117 btv->tda9887_conf = TDA9887_QSS;
3120 info = "NTSC / stereo";
3122 btv->tda9887_conf = TDA9887_QSS;
3125 info = "PAL+SECAM / mono";
3126 btv->tda9887_conf = TDA9887_QSS;
3129 info = "NTSC / mono";
3130 btv->tda9887_conf = TDA9887_INTERCARRIER;
3133 info = "NTSC / stereo";
3134 btv->tda9887_conf = TDA9887_INTERCARRIER;
3137 info = "PAL / stereo";
3138 btv->tda9887_conf = TDA9887_INTERCARRIER;
3141 info = "oops: unknown card";
3145 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3146 pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3147 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3148 btv->tuner_type = TUNER_MT2032;
3152 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3153 #define LM1882_SYNC_DRIVE 0x200000L
3155 static void init_ids_eagle(struct bttv *btv)
3157 gpio_inout(0xffffff,0xFFFF37);
3158 gpio_write(0x200020);
3160 /* flash strobe inverter ?! */
3161 gpio_write(0x200024);
3163 /* switch sync drive off */
3164 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3166 /* set BT848 muxel to 2 */
3167 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3170 /* Muxsel helper for the IDS Eagle.
3171 * the eagles does not use the standard muxsel-bits but
3172 * has its own multiplexer */
3173 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3175 gpio_bits(3, input & 3);
3178 /* set chroma ADC to sleep */
3179 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3180 /* set to composite video */
3181 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3182 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3184 /* switch sync drive off */
3185 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3188 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3190 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3191 gpio_write(masks[input%4]);
3194 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3197 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3198 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3200 IN - sensor inputs, INx - sensor inputs and TI XORed together
3201 O1,O2,O3 - alarm outputs (relays)
3203 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3207 static void init_lmlbt4x(struct bttv *btv)
3209 pr_debug("LMLBT4x init\n");
3210 btwrite(0x000000, BT848_GPIO_REG_INP);
3211 gpio_inout(0xffffff, 0x0006C0);
3212 gpio_write(0x000000);
3215 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3217 unsigned int inmux = input % 8;
3218 gpio_inout( 0xf, 0xf );
3219 gpio_bits( 0xf, inmux );
3222 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3224 unsigned int inmux = input % 4;
3225 gpio_inout( 3<<9, 3<<9 );
3226 gpio_bits( 3<<9, inmux<<9 );
3229 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3231 unsigned int inmux = input % 16;
3232 gpio_inout(0xf, 0xf);
3233 gpio_bits(0xf, inmux);
3237 * The TD3116 has 2 74HC4051 muxes wired to the MUX0 input of a bt878.
3238 * The first 74HC4051 has the lower 8 inputs, the second one the higher 8.
3239 * The muxes are controlled via a 74HC373 latch which is connected to
3240 * GPIOs 0-7. GPIO 18 is connected to the LE signal of the latch.
3241 * Q0 of the latch is connected to the Enable (~E) input of the first
3242 * 74HC4051. Q1 - Q3 are connected to S0 - S2 of the same 74HC4051.
3243 * Q4 - Q7 are connected to the second 74HC4051 in the same way.
3246 static void td3116_latch_value(struct bttv *btv, u32 value)
3248 gpio_bits((1<<18) | 0xff, value);
3249 gpio_bits((1<<18) | 0xff, (1<<18) | value);
3251 gpio_bits((1<<18) | 0xff, value);
3254 static void td3116_muxsel(struct bttv *btv, unsigned int input)
3259 highbit = (input & 0x8) >> 3 ;
3261 /* Disable outputs and set value in the mux */
3262 value = 0x11; /* Disable outputs */
3263 value |= ((input & 0x7) << 1) << (4 * highbit);
3264 td3116_latch_value(btv, value);
3266 /* Enable the correct output */
3268 value |= ((highbit ^ 0x1) << 4) | highbit;
3269 td3116_latch_value(btv, value);
3272 /* ----------------------------------------------------------------------- */
3274 static void bttv_reset_audio(struct bttv *btv)
3277 * BT878A has a audio-reset register.
3278 * 1. This register is an audio reset function but it is in
3279 * function-0 (video capture) address space.
3280 * 2. It is enough to do this once per power-up of the card.
3281 * 3. There is a typo in the Conexant doc -- it is not at
3282 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3283 * --//Shrikumar 030609
3289 pr_debug("%d: BT878A ARESET\n", btv->c.nr);
3290 btwrite((1<<7), 0x058);
3295 /* initialization part one -- before registering i2c bus */
3296 void bttv_init_card1(struct bttv *btv)
3298 switch (btv->c.type) {
3299 case BTTV_BOARD_HAUPPAUGE:
3300 case BTTV_BOARD_HAUPPAUGE878:
3301 boot_msp34xx(btv,5);
3303 case BTTV_BOARD_VOODOOTV_200:
3304 case BTTV_BOARD_VOODOOTV_FM:
3305 boot_msp34xx(btv,20);
3307 case BTTV_BOARD_AVERMEDIA98:
3308 boot_msp34xx(btv,11);
3310 case BTTV_BOARD_HAUPPAUGEPVR:
3313 case BTTV_BOARD_TWINHAN_DST:
3314 case BTTV_BOARD_AVDVBT_771:
3315 case BTTV_BOARD_PINNACLESAT:
3316 btv->use_i2c_hw = 1;
3318 case BTTV_BOARD_ADLINK_RTV24:
3321 case BTTV_BOARD_PCI_8604PW:
3322 init_PCI8604PW(btv);
3326 if (!bttv_tvcards[btv->c.type].has_dvb)
3327 bttv_reset_audio(btv);
3330 /* initialization part two -- after registering i2c bus */
3331 void bttv_init_card2(struct bttv *btv)
3333 btv->tuner_type = UNSET;
3335 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3336 bttv_readee(btv,eeprom_data,0xa0);
3337 identify_by_eeprom(btv,eeprom_data);
3340 switch (btv->c.type) {
3341 case BTTV_BOARD_MIRO:
3342 case BTTV_BOARD_MIROPRO:
3343 case BTTV_BOARD_PINNACLE:
3344 case BTTV_BOARD_PINNACLEPRO:
3346 miro_pinnacle_gpio(btv);
3348 case BTTV_BOARD_FLYVIDEO_98:
3349 case BTTV_BOARD_MAXI:
3350 case BTTV_BOARD_LIFE_FLYKIT:
3351 case BTTV_BOARD_FLYVIDEO:
3352 case BTTV_BOARD_TYPHOON_TVIEW:
3353 case BTTV_BOARD_CHRONOS_VS2:
3354 case BTTV_BOARD_FLYVIDEO_98FM:
3355 case BTTV_BOARD_FLYVIDEO2000:
3356 case BTTV_BOARD_FLYVIDEO98EZ:
3357 case BTTV_BOARD_CONFERENCETV:
3358 case BTTV_BOARD_LIFETEC_9415:
3361 case BTTV_BOARD_HAUPPAUGE:
3362 case BTTV_BOARD_HAUPPAUGE878:
3363 case BTTV_BOARD_HAUPPAUGEPVR:
3364 /* pick up some config infos from the eeprom */
3365 bttv_readee(btv,eeprom_data,0xa0);
3366 hauppauge_eeprom(btv);
3368 case BTTV_BOARD_AVERMEDIA98:
3369 case BTTV_BOARD_AVPHONE98:
3370 bttv_readee(btv,eeprom_data,0xa0);
3371 avermedia_eeprom(btv);
3373 case BTTV_BOARD_PXC200:
3376 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3377 picolo_tetra_init(btv);
3379 case BTTV_BOARD_VHX:
3381 btv->has_tea575x = 1;
3382 btv->tea_gpio.wren = 5;
3383 btv->tea_gpio.most = 6;
3384 btv->tea_gpio.clk = 3;
3385 btv->tea_gpio.data = 4;
3388 case BTTV_BOARD_VOBIS_BOOSTAR:
3389 case BTTV_BOARD_TERRATV:
3390 terratec_active_radio_upgrade(btv);
3392 case BTTV_BOARD_MAGICTVIEW061:
3393 if (btv->cardid == 0x3002144f) {
3395 pr_info("%d: radio detected by subsystem id (CPH05x)\n",
3399 case BTTV_BOARD_STB2:
3400 if (btv->cardid == 0x3060121a) {
3401 /* Fix up entry for 3DFX VoodooTV 100,
3402 which is an OEM STB card variant. */
3404 btv->tuner_type=TUNER_TEMIC_NTSC;
3407 case BTTV_BOARD_OSPREY1x0:
3408 case BTTV_BOARD_OSPREY1x0_848:
3409 case BTTV_BOARD_OSPREY101_848:
3410 case BTTV_BOARD_OSPREY1x1:
3411 case BTTV_BOARD_OSPREY1x1_SVID:
3412 case BTTV_BOARD_OSPREY2xx:
3413 case BTTV_BOARD_OSPREY2x0_SVID:
3414 case BTTV_BOARD_OSPREY2x0:
3415 case BTTV_BOARD_OSPREY440:
3416 case BTTV_BOARD_OSPREY500:
3417 case BTTV_BOARD_OSPREY540:
3418 case BTTV_BOARD_OSPREY2000:
3419 bttv_readee(btv,eeprom_data,0xa0);
3420 osprey_eeprom(btv, eeprom_data);
3422 case BTTV_BOARD_IDS_EAGLE:
3423 init_ids_eagle(btv);
3425 case BTTV_BOARD_MODTEC_205:
3426 bttv_readee(btv,eeprom_data,0xa0);
3429 case BTTV_BOARD_LMLBT4:
3432 case BTTV_BOARD_TIBET_CS16:
3433 tibetCS16_init(btv);
3435 case BTTV_BOARD_KODICOM_4400R:
3436 kodicom4400r_init(btv);
3438 case BTTV_BOARD_GEOVISION_GV800S:
3443 /* pll configuration */
3444 if (!(btv->id==848 && btv->revision==0x11)) {
3445 /* defaults from card list */
3446 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3447 btv->pll.pll_ifreq=28636363;
3448 btv->pll.pll_crystal=BT848_IFORM_XT0;
3450 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3451 btv->pll.pll_ifreq=35468950;
3452 btv->pll.pll_crystal=BT848_IFORM_XT1;
3454 if (PLL_14 == bttv_tvcards[btv->c.type].pll) {
3455 btv->pll.pll_ifreq = 14318181;
3456 btv->pll.pll_crystal = BT848_IFORM_XT0;
3458 /* insmod options can override */
3459 switch (pll[btv->c.nr]) {
3461 btv->pll.pll_crystal = 0;
3462 btv->pll.pll_ifreq = 0;
3463 btv->pll.pll_ofreq = 0;
3465 case 1: /* 28 MHz */
3467 btv->pll.pll_ifreq = 28636363;
3468 btv->pll.pll_ofreq = 0;
3469 btv->pll.pll_crystal = BT848_IFORM_XT0;
3471 case 2: /* 35 MHz */
3473 btv->pll.pll_ifreq = 35468950;
3474 btv->pll.pll_ofreq = 0;
3475 btv->pll.pll_crystal = BT848_IFORM_XT1;
3477 case 3: /* 14 MHz */
3479 btv->pll.pll_ifreq = 14318181;
3480 btv->pll.pll_ofreq = 0;
3481 btv->pll.pll_crystal = BT848_IFORM_XT0;
3485 btv->pll.pll_current = -1;
3487 /* tuner configuration (from card list / autodetect / insmod option) */
3488 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3489 if (UNSET == btv->tuner_type)
3490 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3491 if (UNSET != tuner[btv->c.nr])
3492 btv->tuner_type = tuner[btv->c.nr];
3494 if (btv->tuner_type == TUNER_ABSENT)
3495 pr_info("%d: tuner absent\n", btv->c.nr);
3496 else if (btv->tuner_type == UNSET)
3497 pr_warn("%d: tuner type unset\n", btv->c.nr);
3499 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3501 if (autoload != UNSET) {
3502 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
3503 pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3507 if (UNSET == btv->tuner_type)
3508 btv->tuner_type = TUNER_ABSENT;
3510 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3511 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3512 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3513 UNSET : bttv_tvcards[btv->c.type].svhs;
3514 if (svhs[btv->c.nr] != UNSET)
3515 btv->svhs = svhs[btv->c.nr];
3516 if (remote[btv->c.nr] != UNSET)
3517 btv->has_remote = remote[btv->c.nr];
3519 if (bttv_tvcards[btv->c.type].has_radio)
3521 if (bttv_tvcards[btv->c.type].has_remote)
3522 btv->has_remote = 1;
3523 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3525 if (bttv_tvcards[btv->c.type].volume_gpio)
3526 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3527 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3528 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3530 if (btv->tuner_type == TUNER_ABSENT)
3531 return; /* no tuner or related drivers to load */
3533 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3534 /* Probe for RDS receiver chip */
3535 static const unsigned short addrs[] = {
3540 struct v4l2_subdev *sd;
3542 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3543 &btv->c.i2c_adap, "saa6588", 0, addrs);
3544 btv->has_saa6588 = (sd != NULL);
3547 /* try to detect audio/fader chips */
3549 /* First check if the user specified the audio chip via a module
3552 switch (audiodev[btv->c.nr]) {
3554 return; /* do not load any audio module */
3556 case 0: /* autodetect */
3560 /* The user specified that we should probe for msp3400 */
3561 static const unsigned short addrs[] = {
3562 I2C_ADDR_MSP3400 >> 1,
3563 I2C_ADDR_MSP3400_ALT >> 1,
3567 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3568 &btv->c.i2c_adap, "msp3400", 0, addrs);
3569 if (btv->sd_msp34xx)
3575 /* The user specified that we should probe for tda7432 */
3576 static const unsigned short addrs[] = {
3577 I2C_ADDR_TDA7432 >> 1,
3581 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3582 &btv->c.i2c_adap, "tda7432", 0, addrs))
3588 /* The user specified that we should probe for tvaudio */
3589 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3590 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3591 if (btv->sd_tvaudio)
3597 pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
3601 /* There were no overrides, so now we try to discover this through the
3604 /* probe for msp3400 first: this driver can detect whether or not
3605 it really is a msp3400, so it will return NULL when the device
3606 found is really something else (e.g. a tea6300). */
3607 if (!bttv_tvcards[btv->c.type].no_msp34xx) {
3608 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3609 &btv->c.i2c_adap, "msp3400",
3610 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
3611 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
3612 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3613 &btv->c.i2c_adap, "msp3400",
3614 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
3617 /* If we found a msp34xx, then we're done. */
3618 if (btv->sd_msp34xx)
3621 /* Now see if we can find one of the tvaudio devices. */
3622 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3623 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3624 if (btv->sd_tvaudio) {
3625 /* There may be two tvaudio chips on the card, so try to
3627 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3628 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3631 /* it might also be a tda7432. */
3632 if (!bttv_tvcards[btv->c.type].no_tda7432) {
3633 static const unsigned short addrs[] = {
3634 I2C_ADDR_TDA7432 >> 1,
3638 btv->sd_tda7432 = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3639 &btv->c.i2c_adap, "tda7432", 0, addrs);
3640 if (btv->sd_tda7432)
3643 if (btv->sd_tvaudio)
3647 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
3651 /* initialize the tuner */
3652 void bttv_init_tuner(struct bttv *btv)
3654 int addr = ADDR_UNSET;
3656 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3657 addr = bttv_tvcards[btv->c.type].tuner_addr;
3659 if (btv->tuner_type != TUNER_ABSENT) {
3660 struct tuner_setup tun_setup;
3662 /* Load tuner module before issuing tuner config call! */
3664 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3665 &btv->c.i2c_adap, "tuner",
3666 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3667 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3668 &btv->c.i2c_adap, "tuner",
3669 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3670 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3671 &btv->c.i2c_adap, "tuner",
3672 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3674 tun_setup.mode_mask = T_ANALOG_TV;
3675 tun_setup.type = btv->tuner_type;
3676 tun_setup.addr = addr;
3679 tun_setup.mode_mask |= T_RADIO;
3681 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3684 if (btv->tda9887_conf) {
3685 struct v4l2_priv_tun_config tda9887_cfg;
3687 tda9887_cfg.tuner = TUNER_TDA9887;
3688 tda9887_cfg.priv = &btv->tda9887_conf;
3690 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3694 /* ----------------------------------------------------------------------- */
3696 static void modtec_eeprom(struct bttv *btv)
3698 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3699 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3700 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3701 btv->c.nr, &eeprom_data[0x1e]);
3702 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3703 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3704 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3705 btv->c.nr, &eeprom_data[0x1e]);
3706 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3707 btv->tuner_type=TUNER_PHILIPS_NTSC;
3708 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3709 btv->c.nr, &eeprom_data[0x1e]);
3711 pr_info("%d: Modtec: Unknown TunerString: %s\n",
3712 btv->c.nr, &eeprom_data[0x1e]);
3716 static void hauppauge_eeprom(struct bttv *btv)
3720 tveeprom_hauppauge_analog(&tv, eeprom_data);
3721 btv->tuner_type = tv.tuner_type;
3722 btv->has_radio = tv.has_radio;
3724 pr_info("%d: Hauppauge eeprom indicates model#%d\n",
3725 btv->c.nr, tv.model);
3728 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3729 * type based on model #.
3731 if(tv.model == 64900) {
3732 pr_info("%d: Switching board type from %s to %s\n",
3734 bttv_tvcards[btv->c.type].name,
3735 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3736 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3739 /* The 61334 needs the msp3410 to do the radio demod to get sound */
3740 if (tv.model == 61334)
3741 btv->radio_uses_msp_demodulator = 1;
3744 /* ----------------------------------------------------------------------- */
3746 static void bttv_tea575x_set_pins(struct snd_tea575x *tea, u8 pins)
3748 struct bttv *btv = tea->private_data;
3749 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3752 val |= (pins & TEA575X_DATA) ? (1 << gpio.data) : 0;
3753 val |= (pins & TEA575X_CLK) ? (1 << gpio.clk) : 0;
3754 val |= (pins & TEA575X_WREN) ? (1 << gpio.wren) : 0;
3756 gpio_bits((1 << gpio.data) | (1 << gpio.clk) | (1 << gpio.wren), val);
3757 if (btv->mbox_ior) {
3758 /* IOW and CSEL active */
3759 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3762 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3763 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3767 static u8 bttv_tea575x_get_pins(struct snd_tea575x *tea)
3769 struct bttv *btv = tea->private_data;
3770 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3774 if (btv->mbox_ior) {
3775 /* IOR and CSEL active */
3776 gpio_bits(btv->mbox_ior | btv->mbox_csel, 0);
3780 if (btv->mbox_ior) {
3782 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3783 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3786 if (val & (1 << gpio.data))
3787 ret |= TEA575X_DATA;
3788 if (val & (1 << gpio.most))
3789 ret |= TEA575X_MOST;
3794 static void bttv_tea575x_set_direction(struct snd_tea575x *tea, bool output)
3796 struct bttv *btv = tea->private_data;
3797 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3798 u32 mask = (1 << gpio.clk) | (1 << gpio.wren) | (1 << gpio.data) |
3802 gpio_inout(mask, (1 << gpio.data) | (1 << gpio.clk) |
3805 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));
3808 static const struct snd_tea575x_ops bttv_tea_ops = {
3809 .set_pins = bttv_tea575x_set_pins,
3810 .get_pins = bttv_tea575x_get_pins,
3811 .set_direction = bttv_tea575x_set_direction,
3814 static int tea575x_init(struct bttv *btv)
3816 btv->tea.private_data = btv;
3817 btv->tea.ops = &bttv_tea_ops;
3818 if (!snd_tea575x_hw_init(&btv->tea)) {
3819 pr_info("%d: detected TEA575x radio\n", btv->c.nr);
3820 btv->tea.mute = false;
3824 btv->has_tea575x = 0;
3830 /* ----------------------------------------------------------------------- */
3832 static int terratec_active_radio_upgrade(struct bttv *btv)
3835 btv->has_tea575x = 1;
3836 btv->tea_gpio.wren = 4;
3837 btv->tea_gpio.most = 5;
3838 btv->tea_gpio.clk = 3;
3839 btv->tea_gpio.data = 2;
3841 btv->mbox_iow = 1 << 8;
3842 btv->mbox_ior = 1 << 9;
3843 btv->mbox_csel = 1 << 10;
3845 if (!tea575x_init(btv)) {
3846 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3847 btv->has_saa6588 = 1;
3854 /* ----------------------------------------------------------------------- */
3857 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3860 #define PVR_GPIO_DELAY 10
3862 #define BTTV_ALT_DATA 0x000001
3863 #define BTTV_ALT_DCLK 0x100000
3864 #define BTTV_ALT_NCONFIG 0x800000
3866 static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen)
3872 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3874 udelay(PVR_GPIO_DELAY);
3876 gpio_write(BTTV_ALT_NCONFIG);
3877 udelay(PVR_GPIO_DELAY);
3879 for (n = 0; n < microlen; n++) {
3881 for (i = 0 ; i < 8 ; i++) {
3882 gpio_bits(BTTV_ALT_DCLK,0);
3884 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3886 gpio_bits(BTTV_ALT_DATA,0);
3887 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3891 gpio_bits(BTTV_ALT_DCLK,0);
3892 udelay(PVR_GPIO_DELAY);
3894 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3895 for (i = 0 ; i < 30 ; i++) {
3896 gpio_bits(BTTV_ALT_DCLK,0);
3897 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3899 gpio_bits(BTTV_ALT_DCLK,0);
3903 static int pvr_boot(struct bttv *btv)
3905 const struct firmware *fw_entry;
3908 rc = reject_firmware(&fw_entry, "/*(DEBLOBBED)*/", &btv->c.pci->dev);
3910 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
3913 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3914 pr_info("%d: altera firmware upload %s\n",
3915 btv->c.nr, (rc < 0) ? "failed" : "ok");
3916 release_firmware(fw_entry);
3920 /* ----------------------------------------------------------------------- */
3921 /* some osprey specific stuff */
3923 static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
3929 /* This code will nevery actually get called in this case.... */
3930 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3931 /* this might be an antique... check for MMAC label in eeprom */
3932 if (!strncmp(ee, "MMAC", 4)) {
3934 for (i = 0; i < 21; i++)
3936 if (checksum != ee[21])
3938 cardid = BTTV_BOARD_OSPREY1x0_848;
3939 for (i = 12; i < 21; i++)
3940 serial *= 10, serial += ee[i] - '0';
3943 unsigned short type;
3945 for (i = 4 * 16; i < 8 * 16; i += 16) {
3946 u16 checksum = (__force u16)ip_compute_csum(ee + i, 16);
3948 if ((checksum & 0xff) + (checksum >> 8) == 0xff)
3955 /* found a valid descriptor */
3956 type = get_unaligned_be16((__be16 *)(ee+4));
3961 cardid = BTTV_BOARD_OSPREY1x0_848;
3964 cardid = BTTV_BOARD_OSPREY101_848;
3970 cardid = BTTV_BOARD_OSPREY1x0;
3974 cardid = BTTV_BOARD_OSPREY1x1;
3979 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3985 cardid = BTTV_BOARD_OSPREY2xx;
3989 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3992 cardid = BTTV_BOARD_OSPREY500;
3996 cardid = BTTV_BOARD_OSPREY540;
3997 /* bttv_osprey_540_init(btv); */
4002 cardid = BTTV_BOARD_OSPREY2x0;
4003 /* enable output on select control lines */
4004 gpio_inout(0xffffff,0x000303);
4007 cardid = BTTV_BOARD_OSPREY440;
4010 /* unknown...leave generic, but get serial # */
4011 pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
4015 serial = get_unaligned_be32((__be32 *)(ee+6));
4018 pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
4020 cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
4022 if (cardid<0 || btv->c.type == cardid)
4025 /* card type isn't set correctly */
4026 if (card[btv->c.nr] < bttv_num_tvcards) {
4027 pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
4030 pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
4031 btv->c.nr, btv->c.type, cardid);
4032 btv->c.type = cardid;
4036 /* ----------------------------------------------------------------------- */
4037 /* AVermedia specific stuff, from bktr_card.c */
4039 static int tuner_0_table[] = {
4040 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
4041 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
4042 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
4043 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
4044 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
4045 TUNER_PHILIPS_FM1216ME_MK3 };
4047 static int tuner_1_table[] = {
4048 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
4049 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4050 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4051 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
4052 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
4054 static void avermedia_eeprom(struct bttv *btv)
4056 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
4058 tuner_make = (eeprom_data[0x41] & 0x7);
4059 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
4060 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
4061 btv->has_remote = (eeprom_data[0x42] & 0x01);
4063 if (tuner_make == 0 || tuner_make == 2)
4064 if (tuner_format <= 0x0a)
4065 tuner_type = tuner_0_table[tuner_format];
4066 if (tuner_make == 1)
4067 if (tuner_format <= 9)
4068 tuner_type = tuner_1_table[tuner_format];
4070 if (tuner_make == 4)
4071 if (tuner_format == 0x09)
4072 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
4074 pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
4075 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
4077 btv->tuner_type = tuner_type;
4078 pr_cont("%d", tuner_type);
4080 pr_cont("Unknown type");
4081 pr_cont(" radio:%s remote control:%s\n",
4082 tuner_tv_fm ? "yes" : "no",
4083 btv->has_remote ? "yes" : "no");
4087 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
4088 * analog demod, which is not I2C controlled like the newer and more common
4089 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
4090 * that control the IF for the video and audio. Apparently, bttv GPIO
4091 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
4092 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
4094 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
4097 if (btv->audio_input == TVAUDIO_INPUT_TUNER) {
4098 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
4099 gpiobits |= 0x10000;
4101 gpiobits &= ~0x10000;
4104 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
4110 * reset/enable the MSP on some Hauppauge cards
4111 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
4116 static void boot_msp34xx(struct bttv *btv, int pin)
4118 int mask = (1 << pin);
4120 gpio_inout(mask,mask);
4124 gpio_bits(mask,mask);
4127 bttv_gpio_tracking(btv,"msp34xx");
4129 pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
4133 /* ----------------------------------------------------------------------- */
4134 /* Imagenation L-Model PXC200 Framegrabber */
4135 /* This is basically the same procedure as
4136 * used by Alessandro Rubini in his pxc200
4137 * driver, but using BTTV functions */
4139 static void init_PXC200(struct bttv *btv)
4141 static int vals[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 0x01, 0x02,
4142 0x03, 0x04, 0x05, 0x06, 0x00 };
4147 /* Initialise GPIO-connevted stuff */
4148 gpio_inout(0xffffff, (1<<13));
4152 /* GPIO inputs are pulled up, so no need to drive
4153 * reset pin any longer */
4154 gpio_bits(0xffffff, 0);
4156 bttv_gpio_tracking(btv,"pxc200");
4158 /* we could/should try and reset/control the AD pots? but
4159 right now we simply turned off the crushing. Without
4160 this the AGC drifts drifts
4161 remember the EN is reverse logic -->
4162 setting BT848_ADC_AGC_EN disable the AGC
4163 tboult@eecs.lehigh.edu
4166 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4168 /* Initialise MAX517 DAC */
4169 pr_info("Setting DAC reference voltage level ...\n");
4170 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4172 /* Initialise 12C508 PIC */
4173 /* The I2CWrite and I2CRead commmands are actually to the
4174 * same chips - but the R/W bit is included in the address
4175 * argument so the numbers are different */
4178 pr_info("Initialising 12C508 PIC chip ...\n");
4180 /* First of all, enable the clock line. This is used in the PXC200-F */
4181 val = btread(BT848_GPIO_DMA_CTL);
4182 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4183 btwrite(val, BT848_GPIO_DMA_CTL);
4185 /* Then, push to 0 the reset pin long enough to reset the *
4186 * device same as above for the reset line, but not the same
4187 * value sent to the GPIO-connected stuff
4188 * which one is the good one? */
4189 gpio_inout(0xffffff,(1<<2));
4194 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4195 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4197 pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4198 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4202 pr_info("PXC200 Initialised\n");
4207 /* ----------------------------------------------------------------------- */
4209 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4210 * it. This apparently involves the following procedure for each 878 chip:
4212 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4214 * 2) write to GPIO_DATA
4220 * read from GPIO_DATA into buf (uint_32)
4221 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4222 * error. ERROR_CPLD_Check_Failed stop.
4224 * 3) write to GPIO_DATA
4225 * - write 0x4400 + 0x0E
4227 * - write 0x4410 + 0x0E
4230 * read from GPIO_DATA into buf (uint_32)
4231 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4232 * error. ERROR_CPLD_Check_Failed.
4234 /* ----------------------------------------------------------------------- */
4236 init_RTV24 (struct bttv *btv)
4238 uint32_t dataRead = 0;
4239 long watchdog_value = 0x0E;
4241 pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
4244 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4246 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4248 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4250 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4252 dataRead = btread (BT848_GPIO_DATA);
4254 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4255 pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4256 btv->c.nr, dataRead);
4259 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4261 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4263 btwrite (watchdog_value, BT848_GPIO_DATA);
4265 dataRead = btread (BT848_GPIO_DATA);
4267 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4268 pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4269 btv->c.nr, dataRead);
4274 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4279 /* ----------------------------------------------------------------------- */
4281 * The PCI-8604PW contains a CPLD, probably an ispMACH 4A, that filters
4282 * the PCI REQ signals comming from the four BT878 chips. After power
4283 * up, the CPLD does not forward requests to the bus, which prevents
4284 * the BT878 from fetching RISC instructions from memory. While the
4285 * CPLD is connected to most of the GPIOs of PCI device 0xD, only
4286 * five appear to play a role in unlocking the REQ signal. The following
4287 * sequence has been determined by trial and error without access to the
4290 * Eight GPIOs of device 0xC are provided on connector CN4 (4 in, 4 out).
4291 * Devices 0xE and 0xF do not appear to have anything connected to their
4294 * The correct GPIO_OUT_EN value might have some more bits set. It should
4295 * be possible to derive it from a boundary scan of the CPLD. Its JTAG
4296 * pins are routed to test points.
4299 /* ----------------------------------------------------------------------- */
4301 init_PCI8604PW(struct bttv *btv)
4305 if ((PCI_SLOT(btv->c.pci->devfn) & ~3) != 0xC) {
4306 pr_warn("This is not a PCI-8604PW\n");
4310 if (PCI_SLOT(btv->c.pci->devfn) != 0xD)
4313 btwrite(0x080002, BT848_GPIO_OUT_EN);
4315 state = (btread(BT848_GPIO_DATA) >> 21) & 7;
4323 pr_debug("PCI-8604PW in state %i, toggling pin\n",
4325 btwrite(0x080000, BT848_GPIO_DATA);
4327 btwrite(0x000000, BT848_GPIO_DATA);
4331 pr_info("PCI-8604PW unlocked\n");
4334 /* FIXME: If we are in state 7 and toggle GPIO[19] one
4335 more time, the CPLD goes into state 0, where PCI bus
4336 mastering is inhibited again. We have not managed to
4337 get out of that state. */
4339 pr_err("PCI-8604PW locked until reset\n");
4342 pr_err("PCI-8604PW in unknown state %i\n", state);
4346 state = (state << 4) | ((btread(BT848_GPIO_DATA) >> 21) & 7);
4353 /* The transition from state 7 to state 0 is, as explained
4354 above, valid but undesired and with this code impossible
4355 as we exit as soon as we are in state 7.
4359 pr_err("PCI-8604PW invalid transition %i -> %i\n",
4360 state >> 4, state & 7);
4367 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4369 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4370 * switch instead (CD22M3494E). This IC can have multiple active connections
4371 * between Xn (input) and Yn (output) pins. We need to clear any existing
4372 * connection prior to establish a new one, pulsing the STROBE pin.
4374 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4375 * GPIO pins are wired as:
4376 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4377 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4378 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4379 * GPIO[8] - - P3[5] (microcontroller)
4380 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4381 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4382 * GPINTR - - P3[4] (microcontroller)
4384 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4385 * configuration either directly (as we are doing) or using the microcontroller
4386 * which is also wired to I2C interface. I have no further info on the
4387 * microcontroller features, one would need to disassembly the firmware.
4388 * note: the vendor refused to give any information on this product, all
4389 * that stuff was found using a multimeter! :)
4391 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4393 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4394 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4396 gpio_bits(0x07f, muxgpio[input]);
4398 /* reset all conections */
4399 gpio_bits(0x200,0x200);
4401 gpio_bits(0x200,0x000);
4404 /* create a new connection */
4405 gpio_bits(0x480,0x480);
4407 gpio_bits(0x480,0x080);
4411 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4413 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4414 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
4415 * chips, ten eight input analog multiplexors, a not chip and a few
4418 * 16 inputs on a secondary bracket are provided and can be selected
4419 * from each of the four capture chips. Two of the eight input
4420 * multiplexors are used to select from any of the 16 input signals.
4422 * Unsupported hardware capabilities:
4423 * . A video output monitor on the secondary bracket can be selected from
4424 * one of the 878A chips.
4425 * . Another passthrough but I haven't spent any time investigating it.
4426 * . Digital I/O (logic level connected to GPIO) is available from an
4429 * The on chip input mux should always be set to 2.
4430 * GPIO[16:19] - Video input selection
4431 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4432 * GPIO[?:?] - Digital I/O.
4434 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4435 * determined what function (if any) it provides. With the microcontroller
4436 * and sync separator chips a guess is that it might have to do with video
4437 * switching and maybe some digital I/O.
4439 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4442 gpio_bits(0x0f0000, input << 16);
4445 static void tibetCS16_init(struct bttv *btv)
4447 /* enable gpio bits, mask obtained via btSpy */
4448 gpio_inout(0xffffff, 0x0f7fff);
4449 gpio_write(0x0f7fff);
4453 * The following routines for the Kodicom-4400r get a little mind-twisting.
4454 * There is a "master" controller and three "slave" controllers, together
4455 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4456 * The analog switch is controlled by the "master", but the detection order
4457 * of the four BT878A chips is in an order which I just don't understand.
4458 * The "master" is actually the second controller to be detected. The
4459 * logic on the board uses logical numbers for the 4 controllers, but
4460 * those numbers are different from the detection sequence. When working
4461 * with the analog switch, we need to "map" from the detection sequence
4462 * over to the board's logical controller number. This mapping sequence
4463 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4464 * unit 3, the second (which is the master) is logical unit 0, etc.
4465 * We need to maintain the status of the analog switch (which of the 16
4466 * cameras is connected to which of the 4 controllers) in sw_status array.
4470 * First a routine to set the analog switch, which controls which camera
4471 * is routed to which controller. The switch comprises an X-address
4472 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4473 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4474 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4475 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4476 * specified address. The idea is to set the address and data, then bring
4477 * STROBE high, and finally bring STROBE back to low.
4479 static void kodicom4400r_write(struct bttv *btv,
4480 unsigned char xaddr,
4481 unsigned char yaddr,
4482 unsigned char data) {
4485 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4486 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4487 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4488 gpio_bits(0x1ff, udata); /* strobe low */
4492 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4493 * use this routine. The routine finds the "master" for the card, maps
4494 * the controller number from the detected position over to the logical
4495 * number, writes the appropriate data to the analog switch, and housekeeps
4496 * the local copy of the switch information. The parameter 'input' is the
4497 * requested camera number (0 - 15).
4499 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4503 static unsigned char map[4] = {3, 0, 2, 1};
4505 mctlr = master[btv->c.nr];
4506 if (mctlr == NULL) { /* ignore if master not yet detected */
4509 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4511 xaddr = input & 0xf;
4512 /* Check if the controller/camera pair has changed, else ignore */
4513 if (mctlr->sw_status[yaddr] != xaddr)
4515 /* "open" the old switch, "close" the new one, save the new */
4516 kodicom4400r_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4517 mctlr->sw_status[yaddr] = xaddr;
4518 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4523 * During initialisation, we need to reset the analog switch. We
4524 * also preset the switch to map the 4 connectors on the card to the
4525 * *user's* (see above description of kodicom4400r_muxsel) channels
4528 static void kodicom4400r_init(struct bttv *btv)
4532 gpio_inout(0x0003ff, 0x0003ff);
4533 gpio_write(1 << 9); /* reset MUX */
4535 /* Preset camera 0 to the 4 controllers */
4536 for (ix = 0; ix < 4; ix++) {
4537 btv->sw_status[ix] = ix;
4538 kodicom4400r_write(btv, ix, ix, 1);
4541 * Since this is the "master", we need to set up the
4542 * other three controller chips' pointers to this structure
4543 * for later use in the muxsel routine.
4545 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4547 master[btv->c.nr-1] = btv;
4548 master[btv->c.nr] = btv;
4549 master[btv->c.nr+1] = btv;
4550 master[btv->c.nr+2] = btv;
4553 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4554 * video multiplexers to provide up to 16 video inputs. These
4555 * multiplexers are controlled by the lower 8 GPIO pins of the
4556 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4558 * xxx0 is pin xxx of multiplexer U5,
4559 * yyy1 is pin yyy of multiplexer U2
4571 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4573 static const int masks[] = {
4574 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4575 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4576 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4577 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4579 gpio_write(masks[input%16]);
4581 static void picolo_tetra_init(struct bttv *btv)
4583 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4584 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4585 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4587 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4590 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4591 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4592 /*GPIO[20]&GPIO[21] used to choose the right input*/
4593 btwrite (input<<20,BT848_GPIO_DATA);
4598 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4600 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4601 * swichers to provide 16 channels to MUX0. The TDA8540's have
4602 * 4 independent outputs and as such the IVC120G also has the
4603 * optional "Monitor Out" bus. This allows the card to be looking
4604 * at one input while the monitor is looking at another.
4606 * Since I've couldn't be bothered figuring out how to add an
4607 * independent muxsel for the monitor bus, I've just set it to
4608 * whatever the card is looking at.
4610 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4611 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4613 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4614 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4615 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4616 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4620 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4621 #define I2C_TDA8540 0x90
4622 #define I2C_TDA8540_ALT1 0x92
4623 #define I2C_TDA8540_ALT2 0x94
4624 #define I2C_TDA8540_ALT3 0x96
4625 #define I2C_TDA8540_ALT4 0x98
4626 #define I2C_TDA8540_ALT5 0x9a
4627 #define I2C_TDA8540_ALT6 0x9c
4629 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4632 int key = input % 4;
4633 int matrix = input / 4;
4635 dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4636 btv->c.nr, input, matrix, key);
4638 /* Handles the input selection on the TDA8540's */
4639 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4640 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4641 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4642 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4643 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4644 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4645 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4646 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4648 /* Handles the output enables on the TDA8540's */
4649 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4650 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4651 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4652 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4653 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4654 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4655 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4656 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4658 /* 878's MUX0 is already selected for input via muxsel values */
4662 /* PXC200 muxsel helper
4663 * luke@syseng.anu.edu.au
4664 * another transplant
4665 * from Alessandro Rubini (rubini@linux.it)
4667 * There are 4 kinds of cards:
4668 * PXC200L which is bt848
4669 * PXC200F which is bt848 with PIC controlling mux
4670 * PXC200AL which is bt878
4671 * PXC200AF which is bt878 with PIC controlling mux
4673 #define PX_CFG_PXC200F 0x01
4674 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4675 #define PX_I2C_PIC 0x0f
4676 #define PX_PXC200A_CARDID 0x200a1295
4677 #define PX_I2C_CMD_CFG 0x00
4679 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4684 unsigned char buf[2];
4686 /* Read PIC config to determine if this is a PXC200F */
4690 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4692 pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
4694 /* not PXC ? do nothing */
4698 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4699 if (!(rc & PX_CFG_PXC200F)) {
4700 pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
4706 /* The multiplexer in the 200F is handled by the GPIO port */
4707 /* get correct mapping between inputs */
4708 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4709 /* ** not needed!? */
4712 /* make sure output pins are enabled */
4713 /* bitmask=0x30f; */
4715 /* check whether we have a PXC200A */
4716 if (btv->cardid == PX_PXC200A_CARDID) {
4717 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4718 bitmask |= 7<<4; /* the DAC */
4720 btwrite(bitmask, BT848_GPIO_OUT_EN);
4722 bitmask = btread(BT848_GPIO_DATA);
4723 if (btv->cardid == PX_PXC200A_CARDID)
4724 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4725 else /* older device */
4726 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4727 btwrite(bitmask,BT848_GPIO_DATA);
4730 * Was "to be safe, set the bt848 to input 0"
4731 * Actually, since it's ok at load time, better not messing
4732 * with these bits (on PXC200AF you need to set mux 2 here)
4734 * needed because bttv-driver sets mux before calling this function
4736 if (btv->cardid == PX_PXC200A_CARDID)
4737 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4738 else /* older device */
4739 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4741 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
4744 static void phytec_muxsel(struct bttv *btv, unsigned int input)
4746 unsigned int mux = input % 4;
4748 if (input == btv->svhs)
4751 gpio_bits(0x3, mux);
4755 * GeoVision GV-800(S) functions
4756 * Bruno Christo <bchristo@inf.ufsm.br>
4759 /* This is a function to control the analog switch, which determines which
4760 * camera is routed to which controller. The switch comprises an X-address
4761 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4762 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4763 * A data value (gpio bit 18) of '1' enables the switch, and '0' disables
4764 * the switch. A STROBE bit (gpio bit 17) latches the data value into the
4765 * specified address. There is also a chip select (gpio bit 16).
4766 * The idea is to set the address and chip select together, bring
4767 * STROBE high, write the data, and finally bring STROBE back to low.
4769 static void gv800s_write(struct bttv *btv,
4770 unsigned char xaddr,
4771 unsigned char yaddr,
4772 unsigned char data) {
4773 /* On the "master" 878A:
4774 * GPIO bits 0-9 are used for the analog switch:
4775 * 00 - 03: camera selector
4776 * 04 - 06: 878A (controller) selector
4779 * 18: data (1->on, 0->off)
4782 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4783 const u32 CSELECT = 1<<16;
4784 const u32 STROBE = 1<<17;
4785 const u32 DATA = data<<18;
4787 gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */
4788 gpio_bits(0x20000, STROBE); /* STROBE high */
4789 gpio_bits(0x40000, DATA); /* write DATA */
4790 gpio_bits(0x20000, ~STROBE); /* STROBE low */
4794 * GeoVision GV-800(S) muxsel
4796 * Each of the 4 cards (controllers) use this function.
4797 * The controller using this function selects the input through the GPIO pins
4798 * of the "master" card. A pointer to this card is stored in master[btv->c.nr].
4800 * The parameter 'input' is the requested camera number (0-4) on the controller.
4801 * The map array has the address of each input. Note that the addresses in the
4802 * array are in the sequence the original GeoVision driver uses, that is, set
4803 * every controller to input 0, then to input 1, 2, 3, repeat. This means that
4804 * the physical "camera 1" connector corresponds to controller 0 input 0,
4805 * "camera 2" corresponds to controller 1 input 0, and so on.
4807 * After getting the input address, the function then writes the appropriate
4808 * data to the analog switch, and housekeeps the local copy of the switch
4811 static void gv800s_muxsel(struct bttv *btv, unsigned int input)
4815 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4816 { 0x1, 0x5, 0xb, 0x7 },
4817 { 0x2, 0x8, 0xc, 0xe },
4818 { 0x3, 0x9, 0xd, 0xf } };
4820 mctlr = master[btv->c.nr];
4821 if (mctlr == NULL) {
4822 /* do nothing until the "master" is detected */
4825 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4826 xaddr = map[yaddr][input] & 0xf;
4828 /* Check if the controller/camera pair has changed, ignore otherwise */
4829 if (mctlr->sw_status[yaddr] != xaddr) {
4830 /* disable the old switch, enable the new one and save status */
4831 gv800s_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4832 mctlr->sw_status[yaddr] = xaddr;
4833 gv800s_write(mctlr, xaddr, yaddr, 1);
4837 /* GeoVision GV-800(S) "master" chip init */
4838 static void gv800s_init(struct bttv *btv)
4842 gpio_inout(0xf107f, 0xf107f);
4843 gpio_write(1<<19); /* reset the analog MUX */
4846 /* Preset camera 0 to the 4 controllers */
4847 for (ix = 0; ix < 4; ix++) {
4848 btv->sw_status[ix] = ix;
4849 gv800s_write(btv, ix, ix, 1);
4852 /* Inputs on the "master" controller need this brightness fix */
4853 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
4855 if (btv->c.nr > BTTV_MAX-4)
4858 * Store the "master" controller pointer in the master
4859 * array for later use in the muxsel function.
4861 master[btv->c.nr] = btv;
4862 master[btv->c.nr+1] = btv;
4863 master[btv->c.nr+2] = btv;
4864 master[btv->c.nr+3] = btv;
4867 /* ----------------------------------------------------------------------- */
4868 /* motherboard chipset specific stuff */
4870 void __init bttv_check_chipset(void)
4872 int pcipci_fail = 0;
4873 struct pci_dev *dev = NULL;
4875 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4877 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4879 if (pci_pci_problems & PCIPCI_VSFX)
4881 #ifdef PCIPCI_ALIMAGIK
4882 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4887 /* print warnings about any quirks found */
4889 pr_info("Host bridge needs ETBF enabled\n");
4891 pr_info("Host bridge needs VSFX enabled\n");
4893 pr_info("bttv and your chipset may not work together\n");
4895 pr_info("overlay will be disabled\n");
4898 pr_info("overlay forced. Use this option at your own risk.\n");
4901 if (UNSET != latency)
4902 pr_info("pci latency fixup [%d]\n", latency);
4903 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4904 PCI_DEVICE_ID_INTEL_82441, dev))) {
4906 pci_read_config_byte(dev, 0x53, &b);
4908 pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4913 int bttv_handle_chipset(struct bttv *btv)
4915 unsigned char command;
4917 if (!triton1 && !vsfx && UNSET == latency)
4922 pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
4924 if (vsfx && btv->id >= 878)
4925 pr_info("%d: enabling VSFX\n", btv->c.nr);
4926 if (UNSET != latency)
4927 pr_info("%d: setting pci timer to %d\n",
4928 btv->c.nr, latency);
4931 if (btv->id < 878) {
4932 /* bt848 (mis)uses a bit in the irq mask for etbf */
4934 btv->triton1 = BT848_INT_ETBF;
4936 /* bt878 has a bit in the pci config space for it */
4937 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4939 command |= BT878_EN_TBFX;
4941 command |= BT878_EN_VSFX;
4942 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4944 if (UNSET != latency)
4945 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);