1 // SPDX-License-Identifier: GPL-2.0-or-later
6 this file has configuration information - card-specific stuff
7 like the big tvcards array for the most part
9 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
10 & Marcus Metzler (mocm@thp.uni-koeln.de)
11 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
16 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18 #include <linux/delay.h>
19 #include <linux/module.h>
20 #include <linux/kmod.h>
21 #include <linux/init.h>
22 #include <linux/pci.h>
23 #include <linux/vmalloc.h>
24 #include <linux/firmware.h>
25 #include <net/checksum.h>
27 #include <asm/unaligned.h>
31 #include <media/v4l2-common.h>
32 #include <media/i2c/tvaudio.h>
33 #include "bttv-audio-hook.h"
36 static void boot_msp34xx(struct bttv *btv, int pin);
37 static void hauppauge_eeprom(struct bttv *btv);
38 static void avermedia_eeprom(struct bttv *btv);
39 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
40 static void modtec_eeprom(struct bttv *btv);
41 static void init_PXC200(struct bttv *btv);
42 static void init_RTV24(struct bttv *btv);
43 static void init_PCI8604PW(struct bttv *btv);
45 static void rv605_muxsel(struct bttv *btv, unsigned int input);
46 static void eagle_muxsel(struct bttv *btv, unsigned int input);
47 static void xguard_muxsel(struct bttv *btv, unsigned int input);
48 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
49 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
51 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
53 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
54 static void picolo_tetra_init(struct bttv *btv);
56 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
57 static void tibetCS16_init(struct bttv *btv);
59 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
60 static void kodicom4400r_init(struct bttv *btv);
62 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
63 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
65 static void geovision_muxsel(struct bttv *btv, unsigned int input);
67 static void phytec_muxsel(struct bttv *btv, unsigned int input);
69 static void gv800s_muxsel(struct bttv *btv, unsigned int input);
70 static void gv800s_init(struct bttv *btv);
72 static void td3116_muxsel(struct bttv *btv, unsigned int input);
74 static int terratec_active_radio_upgrade(struct bttv *btv);
75 static int tea575x_init(struct bttv *btv);
76 static void identify_by_eeprom(struct bttv *btv,
77 unsigned char eeprom_data[256]);
78 static int pvr_boot(struct bttv *btv);
80 /* config variables */
81 static unsigned int triton1;
82 static unsigned int vsfx;
83 static unsigned int latency = UNSET;
86 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
87 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
88 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
89 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
90 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
91 static unsigned int audiodev[BTTV_MAX];
92 static unsigned int saa6588[BTTV_MAX];
93 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
94 static unsigned int autoload = UNSET;
95 static unsigned int gpiomask = UNSET;
96 static unsigned int audioall = UNSET;
97 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
100 module_param(triton1, int, 0444);
101 module_param(vsfx, int, 0444);
102 module_param(no_overlay, int, 0444);
103 module_param(latency, int, 0444);
104 module_param(gpiomask, int, 0444);
105 module_param(audioall, int, 0444);
106 module_param(autoload, int, 0444);
108 module_param_array(card, int, NULL, 0444);
109 module_param_array(pll, int, NULL, 0444);
110 module_param_array(tuner, int, NULL, 0444);
111 module_param_array(svhs, int, NULL, 0444);
112 module_param_array(remote, int, NULL, 0444);
113 module_param_array(audiodev, int, NULL, 0444);
114 module_param_array(audiomux, int, NULL, 0444);
116 MODULE_PARM_DESC(triton1, "set ETBF pci config bit [enable bug compatibility for triton1 + others]");
117 MODULE_PARM_DESC(vsfx, "set VSFX pci config bit [yet another chipset flaw workaround]");
118 MODULE_PARM_DESC(latency,"pci latency timer");
119 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
120 MODULE_PARM_DESC(pll, "specify installed crystal (0=none, 28=28 MHz, 35=35 MHz, 14=14 MHz)");
121 MODULE_PARM_DESC(tuner,"specify installed tuner type");
122 MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");
123 MODULE_PARM_DESC(audiodev, "specify audio device:\n"
124 "\t\t-1 = no audio\n"
125 "\t\t 0 = autodetect (default)\n"
129 MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
130 MODULE_PARM_DESC(no_overlay, "allow override overlay default (0 disables, 1 enables) [some VIA/SIS chipsets are known to have problem with overlay]");
133 /* I2C addresses list */
134 #define I2C_ADDR_TDA7432 0x8a
135 #define I2C_ADDR_MSP3400 0x80
136 #define I2C_ADDR_MSP3400_ALT 0x88
139 /* ----------------------------------------------------------------------- */
140 /* list of card IDs for bt878+ cards */
147 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
148 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
149 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
150 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
151 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
152 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
153 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
154 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
155 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
157 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
158 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
160 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
161 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
162 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
163 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
164 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
166 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
167 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
168 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
170 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
171 /* some cards ship with byteswapped IDs ... */
172 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
173 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
174 /* this seems to happen as well ... */
175 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
177 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
178 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
179 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
181 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
182 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
183 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
184 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
185 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
186 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
187 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
189 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
190 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
191 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
192 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
193 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
195 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
196 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
197 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
198 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
200 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
201 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
202 /* clashes with FlyVideo
203 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
204 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
205 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
206 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
207 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
209 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
210 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
212 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
215 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
216 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
217 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
218 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
219 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
221 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
222 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
223 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
224 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
226 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
227 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
228 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
229 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
231 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
232 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
233 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
234 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
235 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
236 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
237 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
238 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
239 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
240 { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
242 { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
243 { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
244 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
261 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
262 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
263 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
265 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
266 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
268 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
269 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
270 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
271 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
272 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
273 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
275 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
276 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
278 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
279 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
280 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
281 { 0x03116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 311" },
282 { 0x06116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 611" },
283 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
284 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
285 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
286 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
287 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
289 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
290 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
292 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
293 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
294 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
295 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
297 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
299 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
300 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
302 /* likely broken, vendor id doesn't match the other magic views ...
303 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
305 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
306 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
308 { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},
310 /* DVB cards (using pci function .1 for mpeg data xfer) */
311 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
312 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
313 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
314 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
315 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
316 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
317 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
318 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
319 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
320 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
321 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
322 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
323 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
324 { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
325 { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
326 { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },
327 { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
328 { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
329 { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
331 { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },
332 { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },
333 { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },
334 { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },
335 { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },
336 { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },
337 { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },
338 { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },
339 { 0x3116f200, BTTV_BOARD_TVT_TD3116, "Tongwei Video Technology TD-3116" },
340 { 0x02280279, BTTV_BOARD_APOSONIC_WDVR, "Aposonic W-DVR" },
344 /* ----------------------------------------------------------------------- */
345 /* array with description for bt848 / bt878 tv/grabber cards */
347 struct tvcard bttv_tvcards[] = {
348 /* ---- card 0x00 ---------------------------------- */
349 [BTTV_BOARD_UNKNOWN] = {
350 .name = " *** UNKNOWN/GENERIC *** ",
353 .muxsel = MUXSEL(2, 3, 1, 0),
355 .tuner_addr = ADDR_UNSET,
357 [BTTV_BOARD_MIRO] = {
360 /* .audio_inputs= 1, */
363 .muxsel = MUXSEL(2, 3, 1, 1),
364 .gpiomux = { 2, 0, 0, 0 },
367 .tuner_addr = ADDR_UNSET,
369 [BTTV_BOARD_HAUPPAUGE] = {
370 .name = "Hauppauge (bt848)",
372 /* .audio_inputs= 1, */
375 .muxsel = MUXSEL(2, 3, 1, 1),
376 .gpiomux = { 0, 1, 2, 3 },
379 .tuner_addr = ADDR_UNSET,
382 .name = "STB, Gateway P/N 6000699 (bt848)",
384 /* .audio_inputs= 1, */
387 .muxsel = MUXSEL(2, 3, 1, 1),
388 .gpiomux = { 4, 0, 2, 3 },
391 .tuner_type = TUNER_PHILIPS_NTSC,
392 .tuner_addr = ADDR_UNSET,
397 /* ---- card 0x04 ---------------------------------- */
398 [BTTV_BOARD_INTEL] = {
399 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
401 /* .audio_inputs= 0, */
404 .muxsel = MUXSEL(2, 3, 1, 1),
406 .tuner_type = TUNER_ABSENT,
407 .tuner_addr = ADDR_UNSET,
409 [BTTV_BOARD_DIAMOND] = {
410 .name = "Diamond DTV2000",
412 /* .audio_inputs= 1, */
415 .muxsel = MUXSEL(2, 3, 1, 0),
416 .gpiomux = { 0, 1, 0, 1 },
419 .tuner_addr = ADDR_UNSET,
421 [BTTV_BOARD_AVERMEDIA] = {
422 .name = "AVerMedia TVPhone",
424 /* .audio_inputs= 1, */
426 .muxsel = MUXSEL(2, 3, 1, 1),
428 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
429 /* 0x04 for some cards ?? */
431 .tuner_addr = ADDR_UNSET,
432 .audio_mode_gpio= avermedia_tvphone_audio,
435 [BTTV_BOARD_MATRIX_VISION] = {
436 .name = "MATRIX-Vision MV-Delta",
438 /* .audio_inputs= 1, */
441 .muxsel = MUXSEL(2, 3, 1, 0, 0),
443 .tuner_type = TUNER_ABSENT,
444 .tuner_addr = ADDR_UNSET,
447 /* ---- card 0x08 ---------------------------------- */
448 [BTTV_BOARD_FLYVIDEO] = {
449 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
451 /* .audio_inputs= 1, */
454 .muxsel = MUXSEL(2, 3, 1, 1),
455 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
459 .tuner_addr = ADDR_UNSET,
461 [BTTV_BOARD_TURBOTV] = {
462 .name = "IMS/IXmicro TurboTV",
464 /* .audio_inputs= 1, */
467 .muxsel = MUXSEL(2, 3, 1, 1),
468 .gpiomux = { 1, 1, 2, 3 },
470 .tuner_type = TUNER_TEMIC_PAL,
471 .tuner_addr = ADDR_UNSET,
473 [BTTV_BOARD_HAUPPAUGE878] = {
474 .name = "Hauppauge (bt878)",
476 /* .audio_inputs= 1, */
478 .gpiomask = 0x0f, /* old: 7 */
479 .muxsel = MUXSEL(2, 0, 1, 1),
480 .gpiomux = { 0, 1, 2, 3 },
484 .tuner_addr = ADDR_UNSET,
486 [BTTV_BOARD_MIROPRO] = {
487 .name = "MIRO PCTV pro",
489 /* .audio_inputs= 1, */
492 .muxsel = MUXSEL(2, 3, 1, 1),
493 .gpiomux = { 0x20001,0x10001, 0, 0 },
496 .tuner_addr = ADDR_UNSET,
499 /* ---- card 0x0c ---------------------------------- */
500 [BTTV_BOARD_ADSTECH_TV] = {
501 .name = "ADS Technologies Channel Surfer TV (bt848)",
503 /* .audio_inputs= 1, */
506 .muxsel = MUXSEL(2, 3, 1, 1),
507 .gpiomux = { 13, 14, 11, 7 },
509 .tuner_addr = ADDR_UNSET,
511 [BTTV_BOARD_AVERMEDIA98] = {
512 .name = "AVerMedia TVCapture 98",
514 /* .audio_inputs= 4, */
517 .muxsel = MUXSEL(2, 3, 1, 1),
518 .gpiomux = { 13, 14, 11, 7 },
521 .tuner_type = TUNER_PHILIPS_PAL,
522 .tuner_addr = ADDR_UNSET,
523 .audio_mode_gpio= avermedia_tv_stereo_audio,
527 .name = "Aimslab Video Highway Xtreme (VHX)",
529 /* .audio_inputs= 1, */
532 .muxsel = MUXSEL(2, 3, 1, 1),
533 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
537 .tuner_addr = ADDR_UNSET,
539 [BTTV_BOARD_ZOLTRIX] = {
540 .name = "Zoltrix TV-Max",
542 /* .audio_inputs= 1, */
545 .muxsel = MUXSEL(2, 3, 1, 1),
546 .gpiomux = { 0, 0, 1, 0 },
549 .tuner_addr = ADDR_UNSET,
552 /* ---- card 0x10 ---------------------------------- */
553 [BTTV_BOARD_PIXVIEWPLAYTV] = {
554 .name = "Prolink Pixelview PlayTV (bt878)",
556 /* .audio_inputs= 1, */
558 .gpiomask = 0x01fe00,
559 .muxsel = MUXSEL(2, 3, 1, 1),
560 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
561 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
562 .gpiomute = 0x002000,
565 .tuner_addr = ADDR_UNSET,
567 [BTTV_BOARD_WINVIEW_601] = {
568 .name = "Leadtek WinView 601",
570 /* .audio_inputs= 1, */
572 .gpiomask = 0x8300f8,
573 .muxsel = MUXSEL(2, 3, 1, 1, 0),
574 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
575 .gpiomute = 0xcfa007,
577 .tuner_addr = ADDR_UNSET,
578 .volume_gpio = winview_volume,
581 [BTTV_BOARD_AVEC_INTERCAP] = {
582 .name = "AVEC Intercapture",
584 /* .audio_inputs= 2, */
587 .muxsel = MUXSEL(2, 3, 1, 1),
588 .gpiomux = { 1, 0, 0, 0 },
590 .tuner_addr = ADDR_UNSET,
592 [BTTV_BOARD_LIFE_FLYKIT] = {
593 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
595 /* .audio_inputs= 1, */
597 .gpiomask = 0x8dff00,
598 .muxsel = MUXSEL(2, 3, 1, 1),
601 .tuner_type = TUNER_ABSENT,
602 .tuner_addr = ADDR_UNSET,
605 /* ---- card 0x14 ---------------------------------- */
606 [BTTV_BOARD_CEI_RAFFLES] = {
607 .name = "CEI Raffles Card",
609 /* .audio_inputs= 3, */
611 .muxsel = MUXSEL(2, 3, 1, 1),
613 .tuner_addr = ADDR_UNSET,
615 [BTTV_BOARD_CONFERENCETV] = {
616 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
618 /* .audio_inputs= 2, tuner, line in */
621 .muxsel = MUXSEL(2, 3, 1, 1),
622 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
625 .tuner_type = TUNER_PHILIPS_PAL_I,
626 .tuner_addr = ADDR_UNSET,
628 [BTTV_BOARD_PHOEBE_TVMAS] = {
629 .name = "Askey CPH050/ Phoebe Tv Master + FM",
631 /* .audio_inputs= 1, */
634 .muxsel = MUXSEL(2, 3, 1, 1),
635 .gpiomux = { 0, 1, 0x800, 0x400 },
639 .tuner_addr = ADDR_UNSET,
641 [BTTV_BOARD_MODTEC_205] = {
642 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
644 /* .audio_inputs= 1, */
648 .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */
649 /* .digital_mode= DIGITAL_MODE_CAMERA, */
650 .gpiomux = { 0, 0, 0, 0 },
653 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
654 .tuner_addr = ADDR_UNSET,
657 /* ---- card 0x18 ---------------------------------- */
658 [BTTV_BOARD_MAGICTVIEW061] = {
659 .name = "Askey CPH05X/06X (bt878) [many vendors]",
661 /* .audio_inputs= 1, */
664 .muxsel = MUXSEL(2, 3, 1, 1),
665 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
669 .tuner_addr = ADDR_UNSET,
671 .has_radio = 1, /* not every card has radio */
673 [BTTV_BOARD_VOBIS_BOOSTAR] = {
674 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
676 /* .audio_inputs= 1, */
678 .gpiomask = 0x1f0fff,
679 .muxsel = MUXSEL(2, 3, 1, 1),
680 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
682 .tuner_type = TUNER_PHILIPS_PAL,
683 .tuner_addr = ADDR_UNSET,
684 .audio_mode_gpio= terratv_audio,
686 [BTTV_BOARD_HAUPPAUG_WCAM] = {
687 .name = "Hauppauge WinCam newer (bt878)",
689 /* .audio_inputs= 1, */
692 .muxsel = MUXSEL(2, 0, 1, 1),
693 .gpiomux = { 0, 1, 2, 3 },
696 .tuner_addr = ADDR_UNSET,
698 [BTTV_BOARD_MAXI] = {
699 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
701 /* .audio_inputs= 2, */
704 .muxsel = MUXSEL(2, 3, 1, 1),
705 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
708 .tuner_type = TUNER_PHILIPS_SECAM,
709 .tuner_addr = ADDR_UNSET,
712 /* ---- card 0x1c ---------------------------------- */
713 [BTTV_BOARD_TERRATV] = {
714 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
716 /* .audio_inputs= 1, */
718 .gpiomask = 0x1f0fff,
719 .muxsel = MUXSEL(2, 3, 1, 1),
720 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
722 .tuner_type = TUNER_PHILIPS_PAL,
723 .tuner_addr = ADDR_UNSET,
724 .audio_mode_gpio= terratv_audio,
726 External 20 pin connector (for Active Radio Upgrade board)
732 gpio05: om5610-stereo
736 gpio09+10: nIOR, nSEL ?? (bt878)
740 gpio16: u2-A0 (1st 4052bt)
743 gpio19: u4-A0 (2nd 4052)
747 00000 : Cdrom (internal audio input)
748 10000 : ext. Video audio input
757 [BTTV_BOARD_PXC200] = {
758 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
759 .name = "Imagenation PXC200",
761 /* .audio_inputs= 1, */
762 .svhs = 1, /* was: 4 */
764 .muxsel = MUXSEL(2, 3, 1, 0, 0),
766 .tuner_type = TUNER_ABSENT,
767 .tuner_addr = ADDR_UNSET,
768 .muxsel_hook = PXC200_muxsel,
771 [BTTV_BOARD_FLYVIDEO_98] = {
772 .name = "Lifeview FlyVideo 98 LR50",
774 /* .audio_inputs= 1, */
776 .gpiomask = 0x1800, /* 0x8dfe00 */
777 .muxsel = MUXSEL(2, 3, 1, 1),
778 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
782 .tuner_addr = ADDR_UNSET,
784 [BTTV_BOARD_IPROTV] = {
785 .name = "Formac iProTV, Formac ProTV I (bt848)",
787 /* .audio_inputs= 1, */
790 .muxsel = MUXSEL(2, 3, 1, 1),
791 .gpiomux = { 1, 0, 0, 0 },
793 .tuner_type = TUNER_PHILIPS_PAL,
794 .tuner_addr = ADDR_UNSET,
797 /* ---- card 0x20 ---------------------------------- */
798 [BTTV_BOARD_INTEL_C_S_PCI] = {
799 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
801 /* .audio_inputs= 0, */
804 .muxsel = MUXSEL(2, 3, 1, 1),
806 .tuner_type = TUNER_ABSENT,
807 .tuner_addr = ADDR_UNSET,
809 [BTTV_BOARD_TERRATVALUE] = {
810 .name = "Terratec TerraTValue Version Bt878",
812 /* .audio_inputs= 1, */
814 .gpiomask = 0xffff00,
815 .muxsel = MUXSEL(2, 3, 1, 1),
816 .gpiomux = { 0x500, 0, 0x300, 0x900 },
819 .tuner_type = TUNER_PHILIPS_PAL,
820 .tuner_addr = ADDR_UNSET,
822 [BTTV_BOARD_WINFAST2000] = {
823 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
825 /* .audio_inputs= 1, */
827 /* TV, CVid, SVid, CVid over SVid connector */
828 .muxsel = MUXSEL(2, 3, 1, 1, 0),
829 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
830 .gpiomask = 0xb33000,
831 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
832 .gpiomute = 0x800000,
833 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
834 gpio23 -- hef4052:nEnable (0x800000)
837 0x0000: external audio
841 Note: There exists another variant "Winfast 2000" with tv stereo !?
842 Note: eeprom only contains FF and pci subsystem id 107d:6606
846 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
847 .tuner_addr = ADDR_UNSET,
848 .audio_mode_gpio= winfast2000_audio,
851 [BTTV_BOARD_CHRONOS_VS2] = {
852 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
854 /* .audio_inputs= 3, */
857 .muxsel = MUXSEL(2, 3, 1, 1),
858 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
862 .tuner_addr = ADDR_UNSET,
865 /* ---- card 0x24 ---------------------------------- */
866 [BTTV_BOARD_TYPHOON_TVIEW] = {
867 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
869 /* .audio_inputs= 3, */
872 .muxsel = MUXSEL(2, 3, 1, 1),
873 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
877 .tuner_addr = ADDR_UNSET,
880 [BTTV_BOARD_PXELVWPLTVPRO] = {
881 .name = "Prolink PixelView PlayTV pro",
883 /* .audio_inputs= 1, */
886 .muxsel = MUXSEL(2, 3, 1, 1),
887 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
892 .tuner_addr = ADDR_UNSET,
894 [BTTV_BOARD_MAGICTVIEW063] = {
895 .name = "Askey CPH06X TView99",
897 /* .audio_inputs= 1, */
899 .gpiomask = 0x551e00,
900 .muxsel = MUXSEL(2, 3, 1, 0),
901 .gpiomux = { 0x551400, 0x551200, 0, 0 },
902 .gpiomute = 0x551c00,
904 .tuner_type = TUNER_PHILIPS_PAL_I,
905 .tuner_addr = ADDR_UNSET,
908 [BTTV_BOARD_PINNACLE] = {
909 .name = "Pinnacle PCTV Studio/Rave",
911 /* .audio_inputs= 1, */
913 .gpiomask = 0x03000F,
914 .muxsel = MUXSEL(2, 3, 1, 1),
915 .gpiomux = { 2, 0xd0001, 0, 0 },
919 .tuner_addr = ADDR_UNSET,
922 /* ---- card 0x28 ---------------------------------- */
923 [BTTV_BOARD_STB2] = {
924 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
926 /* .audio_inputs= 1, */
929 .muxsel = MUXSEL(2, 3, 1, 1),
930 .gpiomux = { 4, 0, 2, 3 },
933 .tuner_type = TUNER_PHILIPS_NTSC,
934 .tuner_addr = ADDR_UNSET,
938 [BTTV_BOARD_AVPHONE98] = {
939 .name = "AVerMedia TVPhone 98",
941 /* .audio_inputs= 4, */
944 .muxsel = MUXSEL(2, 3, 1, 1),
945 .gpiomux = { 13, 4, 11, 7 },
948 .tuner_addr = ADDR_UNSET,
950 .audio_mode_gpio= avermedia_tvphone_audio,
952 [BTTV_BOARD_PV951] = {
953 .name = "ProVideo PV951", /* pic16c54 */
955 /* .audio_inputs= 1, */
958 .muxsel = MUXSEL(2, 3, 1, 1),
959 .gpiomux = { 0, 0, 0, 0},
962 .tuner_type = TUNER_PHILIPS_PAL_I,
963 .tuner_addr = ADDR_UNSET,
965 [BTTV_BOARD_ONAIR_TV] = {
966 .name = "Little OnAir TV",
968 /* .audio_inputs= 1, */
971 .muxsel = MUXSEL(2, 3, 1, 1),
972 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
973 .gpiomute = 0xff3ffc,
976 .tuner_addr = ADDR_UNSET,
979 /* ---- card 0x2c ---------------------------------- */
980 [BTTV_BOARD_SIGMA_TVII_FM] = {
981 .name = "Sigma TVII-FM",
983 /* .audio_inputs= 1, */
986 .muxsel = MUXSEL(2, 3, 1, 1),
987 .gpiomux = { 1, 1, 0, 2 },
992 .tuner_addr = ADDR_UNSET,
994 [BTTV_BOARD_MATRIX_VISION2] = {
995 .name = "MATRIX-Vision MV-Delta 2",
997 /* .audio_inputs= 1, */
1000 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1004 .tuner_type = TUNER_ABSENT,
1005 .tuner_addr = ADDR_UNSET,
1007 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1008 .name = "Zoltrix Genie TV/FM",
1010 /* .audio_inputs= 1, */
1012 .gpiomask = 0xbcf03f,
1013 .muxsel = MUXSEL(2, 3, 1, 1),
1014 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1015 .gpiomute = 0xbcb03f,
1018 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1019 .tuner_addr = ADDR_UNSET,
1021 [BTTV_BOARD_TERRATVRADIO] = {
1022 .name = "Terratec TV/Radio+",
1024 /* .audio_inputs= 1, */
1026 .gpiomask = 0x70000,
1027 .muxsel = MUXSEL(2, 3, 1, 1),
1028 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1029 .gpiomute = 0x40000,
1032 .tuner_type = TUNER_PHILIPS_PAL_I,
1033 .tuner_addr = ADDR_UNSET,
1037 /* ---- card 0x30 ---------------------------------- */
1038 [BTTV_BOARD_DYNALINK] = {
1039 .name = "Askey CPH03x/ Dynalink Magic TView",
1041 /* .audio_inputs= 1, */
1044 .muxsel = MUXSEL(2, 3, 1, 1),
1045 .gpiomux = {2,0,0,0 },
1048 .tuner_type = UNSET,
1049 .tuner_addr = ADDR_UNSET,
1051 [BTTV_BOARD_GVBCTV3PCI] = {
1052 .name = "IODATA GV-BCTV3/PCI",
1054 /* .audio_inputs= 1, */
1056 .gpiomask = 0x010f00,
1057 .muxsel = MUXSEL(2, 3, 0, 0),
1058 .gpiomux = {0x10000, 0, 0x10000, 0 },
1061 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1062 .tuner_addr = ADDR_UNSET,
1063 .audio_mode_gpio= gvbctv3pci_audio,
1065 [BTTV_BOARD_PXELVWPLTVPAK] = {
1066 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1068 /* .audio_inputs= 1, */
1071 .gpiomask = 0xAA0000,
1072 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
1073 /* .digital_mode= DIGITAL_MODE_CAMERA, */
1074 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1075 .gpiomute = 0xa8000,
1078 .tuner_type = TUNER_PHILIPS_PAL_I,
1079 .tuner_addr = ADDR_UNSET,
1081 /* GPIO wiring: (different from Rev.4C !)
1082 GPIO17: U4.A0 (first hef4052bt)
1084 GPIO20: U5.A1 (second hef4052bt)
1086 GPIO22: BT832 Reset Line
1087 GPIO23: A5,A0, U5,nEN
1088 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1091 [BTTV_BOARD_EAGLE] = {
1092 .name = "Eagle Wireless Capricorn2 (bt878A)",
1094 /* .audio_inputs= 1, */
1097 .muxsel = MUXSEL(2, 0, 1, 1),
1098 .gpiomux = { 0, 1, 2, 3 },
1101 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1102 .tuner_addr = ADDR_UNSET,
1105 /* ---- card 0x34 ---------------------------------- */
1106 [BTTV_BOARD_PINNACLEPRO] = {
1107 /* David Härdeman <david@2gen.com> */
1108 .name = "Pinnacle PCTV Studio Pro",
1110 /* .audio_inputs= 1, */
1112 .gpiomask = 0x03000F,
1113 .muxsel = MUXSEL(2, 3, 1, 1),
1114 .gpiomux = { 1, 0xd0001, 0, 0 },
1116 /* sound path (5 sources):
1117 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1120 2= Mono TV sound from Tuner
1122 MUX2 (mask 0x30000):
1124 1= FM stereo Radio from Tuner */
1126 .tuner_type = UNSET,
1127 .tuner_addr = ADDR_UNSET,
1129 [BTTV_BOARD_TVIEW_RDS_FM] = {
1130 /* Claas Langbehn <claas@bigfoot.com>,
1131 Sven Grothklags <sven@upb.de> */
1132 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1134 /* .audio_inputs= 3, */
1137 .muxsel = MUXSEL(2, 3, 1, 1),
1138 .gpiomux = { 0, 0, 0x10, 8 },
1141 .tuner_type = TUNER_PHILIPS_PAL,
1142 .tuner_addr = ADDR_UNSET,
1145 [BTTV_BOARD_LIFETEC_9415] = {
1146 /* Tim Röstermundt <rosterm@uni-muenster.de>
1147 in de.comp.os.unix.linux.hardware:
1148 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1149 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1150 options tuner type=5 */
1151 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1153 /* .audio_inputs= 1, */
1156 .muxsel = MUXSEL(2, 3, 1, 1),
1157 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1159 /* For cards with tda9820/tda9821:
1160 0x0000: Tuner normal stereo
1161 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1162 0x0880: Tuner A2 stereo */
1164 .tuner_type = UNSET,
1165 .tuner_addr = ADDR_UNSET,
1167 [BTTV_BOARD_BESTBUY_EASYTV] = {
1168 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1169 old Easy TV BT848 version (model CPH031) */
1170 .name = "Askey CPH031/ BESTBUY Easy TV",
1172 /* .audio_inputs= 1, */
1175 .muxsel = MUXSEL(2, 3, 1, 0),
1176 .gpiomux = { 2, 0, 0, 0 },
1179 .tuner_type = TUNER_TEMIC_PAL,
1180 .tuner_addr = ADDR_UNSET,
1183 /* ---- card 0x38 ---------------------------------- */
1184 [BTTV_BOARD_FLYVIDEO_98FM] = {
1185 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1186 .name = "Lifeview FlyVideo 98FM LR50",
1188 /* .audio_inputs= 3, */
1191 .muxsel = MUXSEL(2, 3, 1, 1),
1192 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1195 .tuner_type = TUNER_PHILIPS_PAL,
1196 .tuner_addr = ADDR_UNSET,
1198 /* This is the ultimate cheapo capture card
1199 * just a BT848A on a small PCB!
1200 * Steve Hosgood <steve@equiinet.com> */
1201 [BTTV_BOARD_GRANDTEC] = {
1202 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1204 /* .audio_inputs= 0, */
1207 .muxsel = MUXSEL(3, 1),
1211 .tuner_type = TUNER_ABSENT,
1212 .tuner_addr = ADDR_UNSET,
1214 [BTTV_BOARD_ASKEY_CPH060] = {
1215 /* Daniel Herrington <daniel.herrington@home.com> */
1216 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1218 /* .audio_inputs= 1, */
1221 .muxsel = MUXSEL(2, 3, 1, 1),
1222 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1225 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1226 .tuner_addr = ADDR_UNSET,
1228 [BTTV_BOARD_ASKEY_CPH03X] = {
1229 /* Matti Mottus <mottus@physic.ut.ee> */
1230 .name = "Askey CPH03x TV Capturer",
1232 /* .audio_inputs= 1, */
1234 .gpiomask = 0x03000F,
1235 .muxsel = MUXSEL(2, 3, 1, 0),
1236 .gpiomux = { 2, 0, 0, 0 },
1239 .tuner_type = TUNER_TEMIC_PAL,
1240 .tuner_addr = ADDR_UNSET,
1244 /* ---- card 0x3c ---------------------------------- */
1245 [BTTV_BOARD_MM100PCTV] = {
1246 /* Philip Blundell <philb@gnu.org> */
1247 .name = "Modular Technology MM100PCTV",
1249 /* .audio_inputs= 2, */
1252 .muxsel = MUXSEL(2, 3, 1, 1),
1253 .gpiomux = { 2, 0, 0, 1 },
1256 .tuner_type = TUNER_TEMIC_PAL,
1257 .tuner_addr = ADDR_UNSET,
1259 [BTTV_BOARD_GMV1] = {
1260 /* Adrian Cox <adrian@humboldt.co.uk */
1261 .name = "AG Electronics GMV1",
1263 /* .audio_inputs= 0, */
1266 .muxsel = MUXSEL(2, 2),
1270 .tuner_type = TUNER_ABSENT,
1271 .tuner_addr = ADDR_UNSET,
1273 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1274 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1275 new Easy TV BT878 version (model CPH061)
1276 special thanks to Informatica Mieres for providing the card */
1277 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1279 /* .audio_inputs= 2, */
1282 .muxsel = MUXSEL(2, 3, 1, 0),
1283 .gpiomux = { 1, 0, 4, 4 },
1286 .tuner_type = TUNER_PHILIPS_PAL,
1287 .tuner_addr = ADDR_UNSET,
1289 [BTTV_BOARD_ATI_TVWONDER] = {
1290 /* Lukas Gebauer <geby@volny.cz> */
1291 .name = "ATI TV-Wonder",
1293 /* .audio_inputs= 1, */
1296 .muxsel = MUXSEL(2, 3, 1, 0),
1297 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1300 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1301 .tuner_addr = ADDR_UNSET,
1304 /* ---- card 0x40 ---------------------------------- */
1305 [BTTV_BOARD_ATI_TVWONDERVE] = {
1306 /* Lukas Gebauer <geby@volny.cz> */
1307 .name = "ATI TV-Wonder VE",
1309 /* .audio_inputs= 1, */
1312 .muxsel = MUXSEL(2, 3, 0, 1),
1313 .gpiomux = { 0, 0, 1, 0 },
1316 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1317 .tuner_addr = ADDR_UNSET,
1319 [BTTV_BOARD_FLYVIDEO2000] = {
1320 /* DeeJay <deejay@westel900.net (2000S) */
1321 .name = "Lifeview FlyVideo 2000S LR90",
1323 /* .audio_inputs= 3, */
1326 .muxsel = MUXSEL(2, 3, 0, 1),
1327 /* Radio changed from 1e80 to 0x800 to make
1328 FlyVideo2000S in .hu happy (gm)*/
1329 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1330 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1332 .audio_mode_gpio= fv2000s_audio,
1335 .tuner_type = TUNER_PHILIPS_PAL,
1336 .tuner_addr = ADDR_UNSET,
1338 [BTTV_BOARD_TERRATVALUER] = {
1339 .name = "Terratec TValueRadio",
1341 /* .audio_inputs= 1, */
1343 .gpiomask = 0xffff00,
1344 .muxsel = MUXSEL(2, 3, 1, 1),
1345 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1348 .tuner_type = TUNER_PHILIPS_PAL,
1349 .tuner_addr = ADDR_UNSET,
1352 [BTTV_BOARD_GVBCTV4PCI] = {
1353 /* TANAKA Kei <peg00625@nifty.com> */
1354 .name = "IODATA GV-BCTV4/PCI",
1356 /* .audio_inputs= 1, */
1358 .gpiomask = 0x010f00,
1359 .muxsel = MUXSEL(2, 3, 0, 0),
1360 .gpiomux = {0x10000, 0, 0x10000, 0 },
1363 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1364 .tuner_addr = ADDR_UNSET,
1365 .audio_mode_gpio= gvbctv3pci_audio,
1368 /* ---- card 0x44 ---------------------------------- */
1369 [BTTV_BOARD_VOODOOTV_FM] = {
1370 .name = "3Dfx VoodooTV FM (Euro)",
1371 /* try "insmod msp3400 simple=0" if you have
1372 * sound problems with this card. */
1374 /* .audio_inputs= 1, */
1376 .gpiomask = 0x4f8a00,
1377 /* 0x100000: 1=MSP enabled (0=disable again)
1378 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1379 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1380 .gpiomute = 0x947fff,
1381 /* tvtuner, radio, external,internal, mute, stereo
1382 * tuner, Composite, SVid, Composite-on-Svid-adapter */
1383 .muxsel = MUXSEL(2, 3, 0, 1),
1384 .tuner_type = TUNER_MT2032,
1385 .tuner_addr = ADDR_UNSET,
1389 [BTTV_BOARD_VOODOOTV_200] = {
1390 .name = "VoodooTV 200 (USA)",
1391 /* try "insmod msp3400 simple=0" if you have
1392 * sound problems with this card. */
1394 /* .audio_inputs= 1, */
1396 .gpiomask = 0x4f8a00,
1397 /* 0x100000: 1=MSP enabled (0=disable again)
1398 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1399 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1400 .gpiomute = 0x947fff,
1401 /* tvtuner, radio, external,internal, mute, stereo
1402 * tuner, Composite, SVid, Composite-on-Svid-adapter */
1403 .muxsel = MUXSEL(2, 3, 0, 1),
1404 .tuner_type = TUNER_MT2032,
1405 .tuner_addr = ADDR_UNSET,
1409 [BTTV_BOARD_AIMMS] = {
1410 /* Philip Blundell <pb@nexus.co.uk> */
1411 .name = "Active Imaging AIMMS",
1413 /* .audio_inputs= 0, */
1414 .tuner_type = TUNER_ABSENT,
1415 .tuner_addr = ADDR_UNSET,
1417 .muxsel = MUXSEL(2),
1420 [BTTV_BOARD_PV_BT878P_PLUS] = {
1421 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1422 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1424 /* .audio_inputs= 4, */
1427 .muxsel = MUXSEL(2, 3, 1, 1),
1428 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1431 .tuner_type = TUNER_LG_PAL_I_FM,
1432 .tuner_addr = ADDR_UNSET,
1435 GPIO0: U4.A0 (hef4052bt)
1437 GPIO2: U4.A1 (second hef4052bt)
1438 GPIO3: U4.nEN, U5.A0, A5.nEN
1442 [BTTV_BOARD_FLYVIDEO98EZ] = {
1443 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1445 /* .audio_inputs= 0, */
1447 /* AV1, AV2, SVHS, CVid adapter on SVHS */
1448 .muxsel = MUXSEL(2, 3, 1, 1),
1451 .tuner_type = TUNER_ABSENT,
1452 .tuner_addr = ADDR_UNSET,
1455 /* ---- card 0x48 ---------------------------------- */
1456 [BTTV_BOARD_PV_BT878P_9B] = {
1457 /* Dariusz Kowalewski <darekk@automex.pl> */
1458 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1460 /* .audio_inputs= 1, */
1463 .muxsel = MUXSEL(2, 3, 1, 1),
1464 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1468 .tuner_type = TUNER_PHILIPS_PAL,
1469 .tuner_addr = ADDR_UNSET,
1470 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
1471 .has_radio = 1, /* Note: not all cards have radio */
1478 GPIO20,22,23: R30,R29,R28
1481 [BTTV_BOARD_SENSORAY311_611] = {
1482 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1483 /* you must jumper JP5 for the 311 card (PC/104+) to work */
1484 .name = "Sensoray 311/611",
1486 /* .audio_inputs= 0, */
1489 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1491 .tuner_type = TUNER_ABSENT,
1492 .tuner_addr = ADDR_UNSET,
1494 [BTTV_BOARD_RV605] = {
1495 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1496 .name = "RemoteVision MX (RV605)",
1498 /* .audio_inputs= 0, */
1501 .gpiomask2 = 0x07ff,
1502 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
1504 .tuner_type = TUNER_ABSENT,
1505 .tuner_addr = ADDR_UNSET,
1506 .muxsel_hook = rv605_muxsel,
1508 [BTTV_BOARD_POWERCLR_MTV878] = {
1509 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1511 /* .audio_inputs= 2, */
1513 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1514 .muxsel = MUXSEL(2, 1, 1),
1515 .gpiomux = { 0, 1, 2, 2 },
1517 .tuner_type = TUNER_PHILIPS_PAL,
1518 .tuner_addr = ADDR_UNSET,
1523 /* ---- card 0x4c ---------------------------------- */
1524 [BTTV_BOARD_WINDVR] = {
1525 /* Masaki Suzuki <masaki@btree.org> */
1526 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1528 /* .audio_inputs= 1, */
1530 .gpiomask = 0x140007,
1531 .muxsel = MUXSEL(2, 3, 1, 1),
1532 .gpiomux = { 0, 1, 2, 3 },
1534 .tuner_type = TUNER_PHILIPS_NTSC,
1535 .tuner_addr = ADDR_UNSET,
1536 .audio_mode_gpio= windvr_audio,
1538 [BTTV_BOARD_GRANDTEC_MULTI] = {
1539 .name = "GrandTec Multi Capture Card (Bt878)",
1541 /* .audio_inputs= 0, */
1544 .muxsel = MUXSEL(2, 3, 1, 0),
1548 .tuner_type = TUNER_ABSENT,
1549 .tuner_addr = ADDR_UNSET,
1551 [BTTV_BOARD_KWORLD] = {
1552 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1554 /* .audio_inputs= 3, */
1557 /* Tuner, SVid, SVHS, SVid to SVHS connector */
1558 .muxsel = MUXSEL(2, 3, 1, 1),
1559 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1560 * This card lacks external Audio In, so we mute it on Ext. & Int.
1561 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1562 * This card lacks PCI subsystem ID, sigh.
1563 * gpiomux =1: lower volume, 2+3: mute
1564 * btwincap uses 0x80000/0x80003
1569 .tuner_type = TUNER_PHILIPS_PAL,
1570 .tuner_addr = ADDR_UNSET,
1571 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1572 radio signal strength indicators work fine. */
1575 GPIO0,1: HEF4052 A0,A1
1576 GPIO2: HEF4052 nENABLE
1578 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1582 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1584 [BTTV_BOARD_DSP_TCVIDEO] = {
1585 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1586 .name = "DSP Design TCVIDEO",
1589 .muxsel = MUXSEL(2, 3, 1, 0),
1591 .tuner_type = UNSET,
1592 .tuner_addr = ADDR_UNSET,
1595 /* ---- card 0x50 ---------------------------------- */
1596 [BTTV_BOARD_HAUPPAUGEPVR] = {
1597 .name = "Hauppauge WinTV PVR",
1599 /* .audio_inputs= 1, */
1601 .muxsel = MUXSEL(2, 0, 1, 1),
1603 .tuner_type = UNSET,
1604 .tuner_addr = ADDR_UNSET,
1609 [BTTV_BOARD_GVBCTV5PCI] = {
1610 .name = "IODATA GV-BCTV5/PCI",
1612 /* .audio_inputs= 1, */
1614 .gpiomask = 0x0f0f80,
1615 .muxsel = MUXSEL(2, 3, 1, 0),
1616 .gpiomux = {0x030000, 0x010000, 0, 0 },
1617 .gpiomute = 0x020000,
1620 .tuner_type = TUNER_PHILIPS_NTSC_M,
1621 .tuner_addr = ADDR_UNSET,
1622 .audio_mode_gpio= gvbctv5pci_audio,
1625 [BTTV_BOARD_OSPREY1x0] = {
1626 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1627 .video_inputs = 4, /* id-inputs-clock */
1628 /* .audio_inputs= 0, */
1630 .muxsel = MUXSEL(3, 2, 0, 1),
1632 .tuner_type = TUNER_ABSENT,
1633 .tuner_addr = ADDR_UNSET,
1637 [BTTV_BOARD_OSPREY1x0_848] = {
1638 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1640 /* .audio_inputs= 0, */
1642 .muxsel = MUXSEL(2, 3, 1),
1644 .tuner_type = TUNER_ABSENT,
1645 .tuner_addr = ADDR_UNSET,
1650 /* ---- card 0x54 ---------------------------------- */
1651 [BTTV_BOARD_OSPREY101_848] = {
1652 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1654 /* .audio_inputs= 0, */
1656 .muxsel = MUXSEL(3, 1),
1658 .tuner_type = TUNER_ABSENT,
1659 .tuner_addr = ADDR_UNSET,
1663 [BTTV_BOARD_OSPREY1x1] = {
1664 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1666 /* .audio_inputs= 0, */
1668 .muxsel = MUXSEL(0),
1670 .tuner_type = TUNER_ABSENT,
1671 .tuner_addr = ADDR_UNSET,
1675 [BTTV_BOARD_OSPREY1x1_SVID] = {
1676 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1678 /* .audio_inputs= 0, */
1680 .muxsel = MUXSEL(0, 1),
1682 .tuner_type = TUNER_ABSENT,
1683 .tuner_addr = ADDR_UNSET,
1687 [BTTV_BOARD_OSPREY2xx] = {
1688 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1690 /* .audio_inputs= 1, */
1692 .muxsel = MUXSEL(0),
1694 .tuner_type = TUNER_ABSENT,
1695 .tuner_addr = ADDR_UNSET,
1700 /* ---- card 0x58 ---------------------------------- */
1701 [BTTV_BOARD_OSPREY2x0_SVID] = {
1702 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1704 /* .audio_inputs= 1, */
1706 .muxsel = MUXSEL(0, 1),
1708 .tuner_type = TUNER_ABSENT,
1709 .tuner_addr = ADDR_UNSET,
1713 [BTTV_BOARD_OSPREY2x0] = {
1714 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1716 /* .audio_inputs= 1, */
1718 .muxsel = MUXSEL(2, 3),
1720 .tuner_type = TUNER_ABSENT,
1721 .tuner_addr = ADDR_UNSET,
1725 [BTTV_BOARD_OSPREY500] = {
1726 .name = "Osprey 500", /* 500 */
1728 /* .audio_inputs= 1, */
1730 .muxsel = MUXSEL(2, 3),
1732 .tuner_type = TUNER_ABSENT,
1733 .tuner_addr = ADDR_UNSET,
1737 [BTTV_BOARD_OSPREY540] = {
1738 .name = "Osprey 540", /* 540 */
1740 /* .audio_inputs= 1, */
1742 .tuner_type = TUNER_ABSENT,
1743 .tuner_addr = ADDR_UNSET,
1748 /* ---- card 0x5C ---------------------------------- */
1749 [BTTV_BOARD_OSPREY2000] = {
1750 .name = "Osprey 2000", /* 2000 */
1752 /* .audio_inputs= 1, */
1754 .muxsel = MUXSEL(2, 3),
1756 .tuner_type = TUNER_ABSENT,
1757 .tuner_addr = ADDR_UNSET,
1759 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1761 [BTTV_BOARD_IDS_EAGLE] = {
1762 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1763 .name = "IDS Eagle",
1765 /* .audio_inputs= 0, */
1766 .tuner_type = TUNER_ABSENT,
1767 .tuner_addr = ADDR_UNSET,
1770 .muxsel = MUXSEL(2, 2, 2, 2),
1771 .muxsel_hook = eagle_muxsel,
1775 [BTTV_BOARD_PINNACLESAT] = {
1776 .name = "Pinnacle PCTV Sat",
1778 /* .audio_inputs= 0, */
1780 .tuner_type = TUNER_ABSENT,
1781 .tuner_addr = ADDR_UNSET,
1784 .muxsel = MUXSEL(3, 1),
1789 [BTTV_BOARD_FORMAC_PROTV] = {
1790 .name = "Formac ProTV II (bt878)",
1792 /* .audio_inputs= 1, */
1795 /* TV, Comp1, Composite over SVID con, SVID */
1796 .muxsel = MUXSEL(2, 3, 1, 1),
1797 .gpiomux = { 2, 2, 0, 0 },
1800 .tuner_type = TUNER_PHILIPS_PAL,
1801 .tuner_addr = ADDR_UNSET,
1803 GPIO=0x00,0x01,0x03: mute (?)
1804 0x02: both TV and radio (tuner: FM1216/I)
1805 The card has onboard audio connectors labeled "cdrom" and "board",
1806 not soldered here, though unknown wiring.
1807 Card lacks: external audio in, pci subsystem id.
1811 /* ---- card 0x60 ---------------------------------- */
1812 [BTTV_BOARD_MACHTV] = {
1815 /* .audio_inputs= 1, */
1818 .muxsel = MUXSEL(2, 3, 1, 1),
1819 .gpiomux = { 0, 1, 2, 3},
1821 .tuner_type = TUNER_PHILIPS_PAL,
1822 .tuner_addr = ADDR_UNSET,
1825 [BTTV_BOARD_EURESYS_PICOLO] = {
1826 .name = "Euresys Picolo",
1828 /* .audio_inputs= 0, */
1833 .muxsel = MUXSEL(2, 0, 1),
1835 .tuner_type = TUNER_ABSENT,
1836 .tuner_addr = ADDR_UNSET,
1838 [BTTV_BOARD_PV150] = {
1839 /* Luc Van Hoeylandt <luc@e-magic.be> */
1840 .name = "ProVideo PV150", /* 0x4f */
1842 /* .audio_inputs= 0, */
1845 .muxsel = MUXSEL(2, 3),
1849 .tuner_type = TUNER_ABSENT,
1850 .tuner_addr = ADDR_UNSET,
1852 [BTTV_BOARD_AD_TVK503] = {
1853 /* Hiroshi Takekawa <sian@big.or.jp> */
1854 /* This card lacks subsystem ID */
1855 .name = "AD-TVK503", /* 0x63 */
1857 /* .audio_inputs= 1, */
1859 .gpiomask = 0x001e8007,
1860 .muxsel = MUXSEL(2, 3, 1, 0),
1861 /* Tuner, Radio, external, internal, off, on */
1862 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1866 .tuner_type = TUNER_PHILIPS_NTSC,
1867 .tuner_addr = ADDR_UNSET,
1868 .audio_mode_gpio= adtvk503_audio,
1871 /* ---- card 0x64 ---------------------------------- */
1872 [BTTV_BOARD_HERCULES_SM_TV] = {
1873 .name = "Hercules Smart TV Stereo",
1875 /* .audio_inputs= 1, */
1878 .muxsel = MUXSEL(2, 3, 1, 1),
1881 .tuner_type = TUNER_PHILIPS_PAL,
1882 .tuner_addr = ADDR_UNSET,
1884 - card lacks subsystem ID
1885 - stereo variant w/ daughter board with tda9874a @0xb0
1887 always from tda9874 independent of GPIO (?)
1888 external line in: unknown
1889 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1890 hef4053 (instead 4052) for unknown function
1893 [BTTV_BOARD_PACETV] = {
1894 .name = "Pace TV & Radio Card",
1896 /* .audio_inputs= 1, */
1898 /* Tuner, CVid, SVid, CVid over SVid connector */
1899 .muxsel = MUXSEL(2, 3, 1, 1),
1902 .tuner_type = TUNER_PHILIPS_PAL_I,
1903 .tuner_addr = ADDR_UNSET,
1906 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1907 only internal line out: (4pin header) RGGL
1908 Radio must be decoded by msp3410d (not routed through)*/
1910 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1913 [BTTV_BOARD_IVC200] = {
1914 /* Chris Willing <chris@vislab.usyd.edu.au> */
1917 /* .audio_inputs= 0, */
1918 .tuner_type = TUNER_ABSENT,
1919 .tuner_addr = ADDR_UNSET,
1922 .muxsel = MUXSEL(2),
1925 [BTTV_BOARD_IVCE8784] = {
1926 .name = "IVCE-8784",
1928 /* .audio_inputs= 0, */
1929 .tuner_type = TUNER_ABSENT,
1930 .tuner_addr = ADDR_UNSET,
1933 .muxsel = MUXSEL(2),
1936 [BTTV_BOARD_XGUARD] = {
1937 .name = "Grand X-Guard / Trust 814PCI",
1939 /* .audio_inputs= 0, */
1941 .tuner_type = TUNER_ABSENT,
1942 .tuner_addr = ADDR_UNSET,
1944 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
1945 .muxsel_hook = xguard_muxsel,
1951 /* ---- card 0x68 ---------------------------------- */
1952 [BTTV_BOARD_NEBULA_DIGITV] = {
1953 .name = "Nebula Electronics DigiTV",
1956 .muxsel = MUXSEL(2, 3, 1, 0),
1960 .tuner_type = TUNER_ABSENT,
1961 .tuner_addr = ADDR_UNSET,
1967 [BTTV_BOARD_PV143] = {
1968 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
1969 .name = "ProVideo PV143",
1971 /* .audio_inputs= 0, */
1974 .muxsel = MUXSEL(2, 3, 1, 0),
1978 .tuner_type = TUNER_ABSENT,
1979 .tuner_addr = ADDR_UNSET,
1981 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
1982 /* M.Klahr@phytec.de */
1983 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
1985 /* .audio_inputs= 0, */
1988 .muxsel = MUXSEL(2, 3, 1, 0),
1989 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
1991 .tuner_type = TUNER_ABSENT,
1992 .tuner_addr = ADDR_UNSET,
1994 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
1995 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
1997 /* .audio_inputs= 0, */
2000 .muxsel = MUXSEL(2, 3, 1, 1),
2001 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2003 .tuner_type = TUNER_ABSENT,
2004 .tuner_addr = ADDR_UNSET,
2007 /* ---- card 0x6c ---------------------------------- */
2008 [BTTV_BOARD_VD009_MINIDIN] = {
2009 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2011 /* .audio_inputs= 0, */
2014 .gpiomask2 = 0x03, /* used for external vodeo mux */
2015 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2016 .muxsel_hook = phytec_muxsel,
2017 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2019 .tuner_type = TUNER_ABSENT,
2020 .tuner_addr = ADDR_UNSET,
2022 [BTTV_BOARD_VD009_COMBI] = {
2023 .name = "PHYTEC VD-009 Combi (bt878)",
2025 /* .audio_inputs= 0, */
2028 .gpiomask2 = 0x03, /* used for external vodeo mux */
2029 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2030 .muxsel_hook = phytec_muxsel,
2031 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2033 .tuner_type = TUNER_ABSENT,
2034 .tuner_addr = ADDR_UNSET,
2036 [BTTV_BOARD_IVC100] = {
2039 /* .audio_inputs= 0, */
2040 .tuner_type = TUNER_ABSENT,
2041 .tuner_addr = ADDR_UNSET,
2044 .muxsel = MUXSEL(2, 3, 1, 0),
2047 [BTTV_BOARD_IVC120] = {
2048 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2051 /* .audio_inputs= 0, */
2052 .tuner_type = TUNER_ABSENT,
2053 .tuner_addr = ADDR_UNSET,
2054 .svhs = NO_SVHS, /* card has no svhs */
2058 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2059 .muxsel_hook = ivc120_muxsel,
2063 /* ---- card 0x70 ---------------------------------- */
2064 [BTTV_BOARD_PC_HDTV] = {
2065 .name = "pcHDTV HD-2000 TV",
2067 /* .audio_inputs= 1, */
2069 .muxsel = MUXSEL(2, 3, 1, 0),
2070 .tuner_type = TUNER_PHILIPS_FCV1236D,
2071 .tuner_addr = ADDR_UNSET,
2074 [BTTV_BOARD_TWINHAN_DST] = {
2075 .name = "Twinhan DST + clones",
2078 .tuner_type = TUNER_ABSENT,
2079 .tuner_addr = ADDR_UNSET,
2083 [BTTV_BOARD_WINFASTVC100] = {
2084 .name = "Winfast VC100",
2086 /* .audio_inputs= 0, */
2088 /* Vid In, SVid In, Vid over SVid in connector */
2089 .muxsel = MUXSEL(3, 1, 1, 3),
2092 .tuner_type = TUNER_ABSENT,
2093 .tuner_addr = ADDR_UNSET,
2096 [BTTV_BOARD_TEV560] = {
2097 .name = "Teppro TEV-560/InterVision IV-560",
2099 /* .audio_inputs= 1, */
2102 .muxsel = MUXSEL(2, 3, 1, 1),
2103 .gpiomux = { 1, 1, 1, 1 },
2104 .tuner_type = TUNER_PHILIPS_PAL,
2105 .tuner_addr = ADDR_UNSET,
2109 /* ---- card 0x74 ---------------------------------- */
2110 [BTTV_BOARD_SIMUS_GVC1100] = {
2111 .name = "SIMUS GVC1100",
2113 /* .audio_inputs= 0, */
2115 .tuner_type = TUNER_ABSENT,
2116 .tuner_addr = ADDR_UNSET,
2118 .muxsel = MUXSEL(2, 2, 2, 2),
2120 .muxsel_hook = gvc1100_muxsel,
2122 [BTTV_BOARD_NGSTV_PLUS] = {
2123 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2124 .name = "NGS NGSTV+",
2127 .gpiomask = 0x008007,
2128 .muxsel = MUXSEL(2, 3, 0, 0),
2129 .gpiomux = { 0, 0, 0, 0 },
2130 .gpiomute = 0x000003,
2132 .tuner_type = TUNER_PHILIPS_PAL,
2133 .tuner_addr = ADDR_UNSET,
2136 [BTTV_BOARD_LMLBT4] = {
2137 /* http://linuxmedialabs.com */
2139 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2140 /* .audio_inputs= 0, */
2142 .muxsel = MUXSEL(2, 3, 1, 0),
2145 .tuner_type = TUNER_ABSENT,
2146 .tuner_addr = ADDR_UNSET,
2148 [BTTV_BOARD_TEKRAM_M205] = {
2149 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2150 .name = "Tekram M205 PRO",
2152 /* .audio_inputs= 1, */
2153 .tuner_type = TUNER_PHILIPS_PAL,
2154 .tuner_addr = ADDR_UNSET,
2157 .muxsel = MUXSEL(2, 3, 1),
2158 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2162 /* ---- card 0x78 ---------------------------------- */
2163 [BTTV_BOARD_CONTVFMI] = {
2164 /* Javier Cendan Ares <jcendan@lycos.es> */
2165 /* bt878 TV + FM without subsystem ID */
2166 .name = "Conceptronic CONTVFMi",
2168 /* .audio_inputs= 1, */
2170 .gpiomask = 0x008007,
2171 .muxsel = MUXSEL(2, 3, 1, 1),
2172 .gpiomux = { 0, 1, 2, 2 },
2175 .tuner_type = TUNER_PHILIPS_PAL,
2176 .tuner_addr = ADDR_UNSET,
2180 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2181 /*Eric DEBIEF <debief@telemsa.com>*/
2182 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/
2183 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2185 .name = "Euresys Picolo Tetra",
2187 /* .audio_inputs= 0, */
2190 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2193 /*878A input is always MUX0, see above.*/
2194 .muxsel = MUXSEL(2, 2, 2, 2),
2195 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2197 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2198 .tuner_type = TUNER_ABSENT,
2199 .tuner_addr = ADDR_UNSET,
2201 [BTTV_BOARD_SPIRIT_TV] = {
2202 /* Spirit TV Tuner from http://spiritmodems.com.au */
2203 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2204 .name = "Spirit TV Tuner",
2206 /* .audio_inputs= 1, */
2208 .gpiomask = 0x0000000f,
2209 .muxsel = MUXSEL(2, 1, 1),
2210 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2211 .tuner_type = TUNER_TEMIC_PAL,
2212 .tuner_addr = ADDR_UNSET,
2215 [BTTV_BOARD_AVDVBT_771] = {
2216 /* Wolfram Joost <wojo@frokaschwei.de> */
2217 .name = "AVerMedia AVerTV DVB-T 771",
2220 .tuner_type = TUNER_ABSENT,
2221 .tuner_addr = ADDR_UNSET,
2222 .muxsel = MUXSEL(3, 3),
2230 /* ---- card 0x7c ---------------------------------- */
2231 [BTTV_BOARD_AVDVBT_761] = {
2232 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2233 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2234 .name = "AverMedia AverTV DVB-T 761",
2237 .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
2241 .tuner_type = TUNER_ABSENT,
2242 .tuner_addr = ADDR_UNSET,
2247 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2248 /* andre.schwarz@matrix-vision.de */
2249 .name = "MATRIX Vision Sigma-SQ",
2251 /* .audio_inputs= 0, */
2254 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
2255 .muxsel_hook = sigmaSQ_muxsel,
2259 .tuner_type = TUNER_ABSENT,
2260 .tuner_addr = ADDR_UNSET,
2262 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2263 /* andre.schwarz@matrix-vision.de */
2264 .name = "MATRIX Vision Sigma-SLC",
2266 /* .audio_inputs= 0, */
2269 .muxsel = MUXSEL(2, 2, 2, 2),
2270 .muxsel_hook = sigmaSLC_muxsel,
2274 .tuner_type = TUNER_ABSENT,
2275 .tuner_addr = ADDR_UNSET,
2277 /* BTTV_BOARD_APAC_VIEWCOMP */
2278 [BTTV_BOARD_APAC_VIEWCOMP] = {
2279 /* Attila Kondoros <attila.kondoros@chello.hu> */
2280 /* bt878 TV + FM 0x00000000 subsystem ID */
2281 .name = "APAC Viewcomp 878(AMAX)",
2283 /* .audio_inputs= 1, */
2286 .muxsel = MUXSEL(2, 3, 1, 1),
2287 .gpiomux = { 2, 0, 0, 0 },
2290 .tuner_type = TUNER_PHILIPS_PAL,
2291 .tuner_addr = ADDR_UNSET,
2292 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2293 .has_radio = 1, /* not every card has radio */
2296 /* ---- card 0x80 ---------------------------------- */
2297 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2298 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2299 .name = "DViCO FusionHDTV DVB-T Lite",
2305 .tuner_type = TUNER_ABSENT,
2306 .tuner_addr = ADDR_UNSET,
2308 [BTTV_BOARD_VGEAR_MYVCD] = {
2309 /* Steven <photon38@pchome.com.tw> */
2310 .name = "V-Gear MyVCD",
2312 /* .audio_inputs= 1, */
2315 .muxsel = MUXSEL(2, 3, 1, 0),
2316 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2320 .tuner_type = TUNER_PHILIPS_NTSC_M,
2321 .tuner_addr = ADDR_UNSET,
2324 [BTTV_BOARD_SUPER_TV] = {
2325 /* Rick C <cryptdragoon@gmail.com> */
2326 .name = "Super TV Tuner",
2328 /* .audio_inputs= 1, */
2330 .muxsel = MUXSEL(2, 3, 1, 0),
2331 .tuner_type = TUNER_PHILIPS_NTSC,
2332 .tuner_addr = ADDR_UNSET,
2333 .gpiomask = 0x008007,
2334 .gpiomux = { 0, 0x000001,0,0 },
2337 [BTTV_BOARD_TIBET_CS16] = {
2338 /* Chris Fanning <video4linux@haydon.net> */
2339 .name = "Tibet Systems 'Progress DVR' CS16",
2341 /* .audio_inputs= 0, */
2343 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2347 .tuner_type = TUNER_ABSENT,
2348 .tuner_addr = ADDR_UNSET,
2349 .muxsel_hook = tibetCS16_muxsel,
2351 [BTTV_BOARD_KODICOM_4400R] = {
2352 /* Bill Brack <wbrack@mmm.com.hk> */
2354 * Note that, because of the card's wiring, the "master"
2355 * BT878A chip (i.e. the one which controls the analog switch
2356 * and must use this card type) is the 2nd one detected. The
2357 * other 3 chips should use card type 0x85, whose description
2358 * follows this one. There is a EEPROM on the card (which is
2359 * connected to the I2C of one of those other chips), but is
2360 * not currently handled. There is also a facility for a
2361 * "monitor", which is also not currently implemented.
2363 .name = "Kodicom 4400R (master)",
2365 /* .audio_inputs= 0, */
2366 .tuner_type = TUNER_ABSENT,
2367 .tuner_addr = ADDR_UNSET,
2369 /* GPIO bits 0-9 used for analog switch:
2370 * 00 - 03: camera selector
2371 * 04 - 06: channel (controller) selector
2372 * 07: data (1->on, 0->off)
2375 * bit 16 is input from sync separator for the channel
2377 .gpiomask = 0x0003ff,
2379 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2383 .muxsel_hook = kodicom4400r_muxsel,
2385 [BTTV_BOARD_KODICOM_4400R_SL] = {
2386 /* Bill Brack <wbrack@mmm.com.hk> */
2387 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2388 * one which controls the analog switch, and must use the card type)
2389 * is the 2nd one detected. The other 3 chips should use this card
2392 .name = "Kodicom 4400R (slave)",
2394 /* .audio_inputs= 0, */
2395 .tuner_type = TUNER_ABSENT,
2396 .tuner_addr = ADDR_UNSET,
2398 .gpiomask = 0x010000,
2400 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2404 .muxsel_hook = kodicom4400r_muxsel,
2406 /* ---- card 0x86---------------------------------- */
2407 [BTTV_BOARD_ADLINK_RTV24] = {
2408 /* Michael Henson <mhenson@clarityvi.com> */
2409 /* Adlink RTV24 with special unlock codes */
2410 .name = "Adlink RTV24",
2412 /* .audio_inputs= 1, */
2414 .muxsel = MUXSEL(2, 3, 1, 0),
2415 .tuner_type = UNSET,
2416 .tuner_addr = ADDR_UNSET,
2419 /* ---- card 0x87---------------------------------- */
2420 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2421 /* Michael Krufky <mkrufky@linuxtv.org> */
2422 .name = "DViCO FusionHDTV 5 Lite",
2423 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2424 .tuner_addr = ADDR_UNSET,
2426 /* .audio_inputs= 1, */
2428 .muxsel = MUXSEL(2, 3, 1),
2429 .gpiomask = 0x00e00007,
2430 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2431 .gpiomute = 0x00c00007,
2436 /* ---- card 0x88---------------------------------- */
2437 [BTTV_BOARD_ACORP_Y878F] = {
2438 /* Mauro Carvalho Chehab <mchehab@kernel.org> */
2439 .name = "Acorp Y878F",
2441 /* .audio_inputs= 1, */
2443 .gpiomask = 0x01fe00,
2444 .muxsel = MUXSEL(2, 3, 1, 1),
2445 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2446 .gpiomute = 0x002000,
2448 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2449 .tuner_addr = 0xc1 >>1,
2452 /* ---- card 0x89 ---------------------------------- */
2453 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2454 .name = "Conceptronic CTVFMi v2",
2456 /* .audio_inputs= 1, */
2458 .gpiomask = 0x001c0007,
2459 .muxsel = MUXSEL(2, 3, 1, 1),
2460 .gpiomux = { 0, 1, 2, 2 },
2463 .tuner_type = TUNER_TENA_9533_DI,
2464 .tuner_addr = ADDR_UNSET,
2468 /* ---- card 0x8a ---------------------------------- */
2469 [BTTV_BOARD_PV_BT878P_2E] = {
2470 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2472 /* .audio_inputs= 1, */
2475 .gpiomask = 0x01fe00,
2476 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
2477 /* .digital_mode= DIGITAL_MODE_CAMERA, */
2478 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2479 .gpiomute = 0x12400,
2482 .tuner_type = TUNER_LG_PAL_FM,
2483 .tuner_addr = ADDR_UNSET,
2486 /* ---- card 0x8b ---------------------------------- */
2487 [BTTV_BOARD_PV_M4900] = {
2488 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2489 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2491 /* .audio_inputs= 1, */
2494 .muxsel = MUXSEL(2, 3, 1, 1),
2495 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2499 .tuner_type = TUNER_YMEC_TVF_5533MF,
2500 .tuner_addr = ADDR_UNSET,
2504 /* ---- card 0x8c ---------------------------------- */
2505 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2506 one external BNC composite input (mux 2)
2507 three internal composite inputs (unknown muxes)
2508 an 18-bit stereo A/D (CS5331A), which has:
2509 one external stereo unblanced (RCA) audio connection
2510 one (or 3?) internal stereo balanced (XLR) audio connection
2511 input is selected via gpio to a 14052B mux
2512 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2513 gain is controlled via an X9221A chip on the I2C bus @0x28
2514 sample rate is controlled via gpio to an MK1413S
2515 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2516 There is neither a tuner nor an svideo input. */
2517 [BTTV_BOARD_OSPREY440] = {
2518 .name = "Osprey 440",
2520 /* .audio_inputs= 2, */
2522 .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */
2524 .gpiomute = 0x000, /* int + 32kHz */
2525 .gpiomux = { 0, 0, 0x000, 0x100},
2527 .tuner_type = TUNER_ABSENT,
2528 .tuner_addr = ADDR_UNSET,
2532 /* ---- card 0x8d ---------------------------------- */
2533 [BTTV_BOARD_ASOUND_SKYEYE] = {
2534 .name = "Asound Skyeye PCTV",
2536 /* .audio_inputs= 1, */
2539 .muxsel = MUXSEL(2, 3, 1, 1),
2540 .gpiomux = { 2, 0, 0, 0 },
2543 .tuner_type = TUNER_PHILIPS_NTSC,
2544 .tuner_addr = ADDR_UNSET,
2546 /* ---- card 0x8e ---------------------------------- */
2547 [BTTV_BOARD_SABRENT_TVFM] = {
2548 .name = "Sabrent TV-FM (bttv version)",
2550 /* .audio_inputs= 1, */
2552 .gpiomask = 0x108007,
2553 .muxsel = MUXSEL(2, 3, 1, 1),
2554 .gpiomux = { 100000, 100002, 100002, 100000 },
2558 .tuner_type = TUNER_TNF_5335MF,
2559 .tuner_addr = ADDR_UNSET,
2562 /* ---- card 0x8f ---------------------------------- */
2563 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2564 .name = "Hauppauge ImpactVCB (bt878)",
2566 /* .audio_inputs= 0, */
2568 .gpiomask = 0x0f, /* old: 7 */
2569 .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
2572 .tuner_type = TUNER_ABSENT,
2573 .tuner_addr = ADDR_UNSET,
2575 [BTTV_BOARD_MACHTV_MAGICTV] = {
2576 /* Julian Calaby <julian.calaby@gmail.com>
2577 * Slightly different from original MachTV definition (0x60)
2579 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2580 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2581 * properly (methinks) causing no keyup bits being set */
2583 .name = "MagicTV", /* rebranded MachTV */
2585 /* .audio_inputs= 1, */
2588 .muxsel = MUXSEL(2, 3, 1, 1),
2589 .gpiomux = { 0, 1, 2, 3 },
2591 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2592 .tuner_addr = ADDR_UNSET,
2597 [BTTV_BOARD_SSAI_SECURITY] = {
2598 .name = "SSAI Security Video Interface",
2600 /* .audio_inputs= 0, */
2602 .muxsel = MUXSEL(0, 1, 2, 3),
2603 .tuner_type = TUNER_ABSENT,
2604 .tuner_addr = ADDR_UNSET,
2606 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2607 .name = "SSAI Ultrasound Video Interface",
2609 /* .audio_inputs= 0, */
2611 .muxsel = MUXSEL(2, 0, 1, 3),
2612 .tuner_type = TUNER_ABSENT,
2613 .tuner_addr = ADDR_UNSET,
2615 /* ---- card 0x94---------------------------------- */
2616 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2617 .name = "DViCO FusionHDTV 2",
2618 .tuner_type = TUNER_PHILIPS_FCV1236D,
2619 .tuner_addr = ADDR_UNSET,
2621 /* .audio_inputs= 1, */
2623 .muxsel = MUXSEL(2, 3, 1),
2624 .gpiomask = 0x00e00007,
2625 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2626 .gpiomute = 0x00c00007,
2630 /* ---- card 0x95---------------------------------- */
2631 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2632 .name = "Typhoon TV-Tuner PCI (50684)",
2634 /* .audio_inputs= 1, */
2636 .gpiomask = 0x3014f,
2637 .muxsel = MUXSEL(2, 3, 1, 1),
2638 .gpiomux = { 0x20001,0x10001, 0, 0 },
2641 .tuner_type = TUNER_PHILIPS_PAL_I,
2642 .tuner_addr = ADDR_UNSET,
2644 [BTTV_BOARD_GEOVISION_GV600] = {
2646 .name = "Geovision GV-600",
2648 /* .audio_inputs= 0, */
2651 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2652 .muxsel_hook = geovision_muxsel,
2656 .tuner_type = TUNER_ABSENT,
2657 .tuner_addr = ADDR_UNSET,
2659 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2660 /* Mauro Lacy <mauro@lacy.com.ar>
2661 * Based on MagicTV and Conceptronic CONTVFMi */
2663 .name = "Kozumi KTV-01C",
2665 /* .audio_inputs= 1, */
2667 .gpiomask = 0x008007,
2668 .muxsel = MUXSEL(2, 3, 1, 1),
2669 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
2670 .gpiomute = 3, /* CONTVFMi */
2671 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2672 .tuner_addr = ADDR_UNSET,
2677 [BTTV_BOARD_ENLTV_FM_2] = {
2678 /* Encore TV Tuner Pro ENL TV-FM-2
2679 Mauro Carvalho Chehab <mchehab@kernel.org> */
2680 .name = "Encore ENL TV-FM-2",
2682 /* .audio_inputs= 1, */
2684 /* bit 6 -> IR disabled
2685 bit 18/17 = 00 -> mute
2686 01 -> enable external audio input
2687 10 -> internal audio input (mono?)
2688 11 -> internal audio input
2690 .gpiomask = 0x060040,
2691 .muxsel = MUXSEL(2, 3, 3),
2692 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2694 .tuner_type = TUNER_TCL_MF02GIP_5N,
2695 .tuner_addr = ADDR_UNSET,
2700 [BTTV_BOARD_VD012] = {
2701 /* D.Heer@Phytec.de */
2702 .name = "PHYTEC VD-012 (bt878)",
2704 /* .audio_inputs= 0, */
2707 .muxsel = MUXSEL(0, 2, 3, 1),
2708 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2710 .tuner_type = TUNER_ABSENT,
2711 .tuner_addr = ADDR_UNSET,
2713 [BTTV_BOARD_VD012_X1] = {
2714 /* D.Heer@Phytec.de */
2715 .name = "PHYTEC VD-012-X1 (bt878)",
2717 /* .audio_inputs= 0, */
2720 .muxsel = MUXSEL(2, 3, 1),
2721 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2723 .tuner_type = TUNER_ABSENT,
2724 .tuner_addr = ADDR_UNSET,
2726 [BTTV_BOARD_VD012_X2] = {
2727 /* D.Heer@Phytec.de */
2728 .name = "PHYTEC VD-012-X2 (bt878)",
2730 /* .audio_inputs= 0, */
2733 .muxsel = MUXSEL(3, 2, 1),
2734 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2736 .tuner_type = TUNER_ABSENT,
2737 .tuner_addr = ADDR_UNSET,
2739 [BTTV_BOARD_GEOVISION_GV800S] = {
2740 /* Bruno Christo <bchristo@inf.ufsm.br>
2742 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2743 * 1 audio input per BT878A = 4 audio inputs
2744 * 4 video inputs per BT878A = 16 video inputs
2745 * This is the first BT878A chip of the GV-800(S). It's the
2746 * "master" chip and it controls the video inputs through an
2747 * analog multiplexer (a CD22M3494) via some GPIO pins. The
2748 * slaves should use card type 0x9e (following this one).
2749 * There is a EEPROM on the card which is currently not handled.
2750 * The audio input is not working yet.
2752 .name = "Geovision GV-800(S) (master)",
2754 /* .audio_inputs= 1, */
2755 .tuner_type = TUNER_ABSENT,
2756 .tuner_addr = ADDR_UNSET,
2758 .gpiomask = 0xf107f,
2760 .muxsel = MUXSEL(2, 2, 2, 2),
2764 .muxsel_hook = gv800s_muxsel,
2766 [BTTV_BOARD_GEOVISION_GV800S_SL] = {
2767 /* Bruno Christo <bchristo@inf.ufsm.br>
2769 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2770 * 1 audio input per BT878A = 4 audio inputs
2771 * 4 video inputs per BT878A = 16 video inputs
2772 * The 3 other BT878A chips are "slave" chips of the GV-800(S)
2773 * and should use this card type.
2774 * The audio input is not working yet.
2776 .name = "Geovision GV-800(S) (slave)",
2778 /* .audio_inputs= 1, */
2779 .tuner_type = TUNER_ABSENT,
2780 .tuner_addr = ADDR_UNSET,
2784 .muxsel = MUXSEL(2, 2, 2, 2),
2788 .muxsel_hook = gv800s_muxsel,
2790 [BTTV_BOARD_PV183] = {
2791 .name = "ProVideo PV183", /* 0x9f */
2793 /* .audio_inputs= 0, */
2796 .muxsel = MUXSEL(2, 3),
2800 .tuner_type = TUNER_ABSENT,
2801 .tuner_addr = ADDR_UNSET,
2803 /* ---- card 0xa0---------------------------------- */
2804 [BTTV_BOARD_TVT_TD3116] = {
2805 .name = "Tongwei Video Technology TD-3116",
2807 .gpiomask = 0xc00ff,
2808 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2809 .muxsel_hook = td3116_muxsel,
2812 .tuner_type = TUNER_ABSENT,
2814 [BTTV_BOARD_APOSONIC_WDVR] = {
2815 .name = "Aposonic W-DVR",
2818 .muxsel = MUXSEL(2, 3, 1, 0),
2819 .tuner_type = TUNER_ABSENT,
2821 [BTTV_BOARD_ADLINK_MPG24] = {
2823 .name = "Adlink MPG24",
2825 /* .audio_inputs= 1, */
2827 .muxsel = MUXSEL(2, 2, 2, 2),
2828 .tuner_type = UNSET,
2829 .tuner_addr = ADDR_UNSET,
2832 [BTTV_BOARD_BT848_CAP_14] = {
2833 .name = "Bt848 Capture 14MHz",
2836 .muxsel = MUXSEL(2, 3, 1, 0),
2838 .tuner_type = TUNER_ABSENT,
2840 [BTTV_BOARD_CYBERVISION_CV06] = {
2841 .name = "CyberVision CV06 (SV)",
2843 /* .audio_inputs= 0, */
2845 .muxsel = MUXSEL(2, 3, 1, 0),
2847 .tuner_type = TUNER_ABSENT,
2848 .tuner_addr = ADDR_UNSET,
2850 [BTTV_BOARD_KWORLD_VSTREAM_XPERT] = {
2851 /* Pojar George <geoubuntu@gmail.com> */
2852 .name = "Kworld V-Stream Xpert TV PVR878",
2854 /* .audio_inputs= 1, */
2856 .gpiomask = 0x001c0007,
2857 .muxsel = MUXSEL(2, 3, 1, 1),
2858 .gpiomux = { 0, 1, 2, 2 },
2861 .tuner_type = TUNER_TENA_9533_DI,
2862 .tuner_addr = ADDR_UNSET,
2866 /* ---- card 0xa6---------------------------------- */
2867 [BTTV_BOARD_PCI_8604PW] = {
2868 /* PCI-8604PW with special unlock sequence */
2869 .name = "PCI-8604PW",
2871 /* .audio_inputs= 0, */
2873 /* The second input is available on CN4, if populated.
2874 * The other 5x2 header (CN2?) connects to the same inputs
2875 * as the on-board BNCs */
2876 .muxsel = MUXSEL(2, 3),
2877 .tuner_type = TUNER_ABSENT,
2884 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2886 /* ----------------------------------------------------------------------- */
2888 static unsigned char eeprom_data[256];
2893 void bttv_idcard(struct bttv *btv)
2895 unsigned int gpiobits;
2898 /* read PCI subsystem ID */
2899 btv->cardid = btv->c.pci->subsystem_device << 16;
2900 btv->cardid |= btv->c.pci->subsystem_vendor;
2902 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2903 /* look for the card */
2904 for (type = -1, i = 0; cards[i].id != 0; i++)
2905 if (cards[i].id == btv->cardid)
2910 pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2911 btv->c.nr, cards[type].name, cards[type].cardnr,
2912 btv->cardid & 0xffff,
2913 (btv->cardid >> 16) & 0xffff);
2914 btv->c.type = cards[type].cardnr;
2917 pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
2918 btv->c.nr, btv->cardid & 0xffff,
2919 (btv->cardid >> 16) & 0xffff);
2920 pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
2924 /* let the user override the autodetected type */
2925 if (card[btv->c.nr] < bttv_num_tvcards)
2926 btv->c.type=card[btv->c.nr];
2928 /* print which card config we are using */
2929 pr_info("%d: using: %s [card=%d,%s]\n",
2930 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
2931 card[btv->c.nr] < bttv_num_tvcards
2932 ? "insmod option" : "autodetected");
2934 /* overwrite gpio stuff ?? */
2935 if (UNSET == audioall && UNSET == audiomux[0])
2938 if (UNSET != audiomux[0]) {
2940 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2941 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2942 gpiobits |= audiomux[i];
2945 gpiobits = audioall;
2946 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2947 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2950 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2951 pr_info("%d: gpio config override: mask=0x%x, mux=",
2952 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
2953 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2955 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2961 * (most) board specific initialisations goes here
2964 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
2965 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2969 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2970 type = BTTV_BOARD_MODTEC_205;
2971 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2972 type = BTTV_BOARD_EURESYS_PICOLO;
2973 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2974 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
2978 pr_info("%d: detected by eeprom: %s [card=%d]\n",
2979 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2983 static void flyvideo_gpio(struct bttv *btv)
2985 int gpio, has_remote, has_radio, is_capture_only;
2986 int is_lr90, has_tda9820_tda9821;
2987 int tuner_type = UNSET, ttype;
2989 gpio_inout(0xffffff, 0);
2990 udelay(8); /* without this we would see the 0x1800 mask */
2992 /* FIXME: must restore OUR_EN ??? */
2994 /* all cards provide GPIO info, some have an additional eeprom
2995 * LR50: GPIO coding can be found lower right CP1 .. CP9
2996 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2998 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3000 * lowest 3 bytes are remote control codes (no handshake needed)
3001 * xxxFFF: No remote control chip soldered
3002 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3003 * Note: Some bits are Audio_Mask !
3005 ttype = (gpio & 0x0f0000) >> 16;
3008 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
3011 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
3014 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3017 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
3020 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3023 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
3027 has_remote = gpio & 0x800000;
3028 has_radio = gpio & 0x400000;
3029 /* unknown 0x200000;
3030 * unknown2 0x100000; */
3031 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3032 has_tda9820_tda9821 = !(gpio & 0x004000);
3033 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3035 * gpio & 0x001000 output bit for audio routing */
3037 if (is_capture_only)
3038 tuner_type = TUNER_ABSENT; /* No tuner present */
3040 pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3041 btv->c.nr, has_radio ? "yes" : "no",
3042 has_remote ? "yes" : "no", tuner_type, gpio);
3043 pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3044 btv->c.nr, is_lr90 ? "yes" : "no",
3045 has_tda9820_tda9821 ? "yes" : "no",
3046 is_capture_only ? "yes" : "no");
3048 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3049 btv->tuner_type = tuner_type;
3050 btv->has_radio = has_radio;
3052 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3053 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3054 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3055 if (has_tda9820_tda9821)
3056 btv->audio_mode_gpio = lt9415_audio;
3057 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
3060 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3061 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3062 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3063 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3065 static void miro_pinnacle_gpio(struct bttv *btv)
3070 gpio_inout(0xffffff, 0);
3072 id = ((gpio>>10) & 63) -1;
3073 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3075 btv->tuner_type = miro_tunermap[id];
3076 if (0 == (gpio & 0x20)) {
3078 if (!miro_fmtuner[id]) {
3079 btv->has_tea575x = 1;
3080 btv->tea_gpio.wren = 6;
3081 btv->tea_gpio.most = 7;
3082 btv->tea_gpio.clk = 8;
3083 btv->tea_gpio.data = 9;
3090 if (btv->c.type == BTTV_BOARD_MIRO)
3091 btv->c.type = BTTV_BOARD_MIROPRO;
3092 if (btv->c.type == BTTV_BOARD_PINNACLE)
3093 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3095 pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3096 btv->c.nr, id+1, btv->tuner_type,
3097 !btv->has_radio ? "no" :
3098 (btv->has_tea575x ? "tea575x" : "fmtuner"),
3099 (-1 == msp) ? "no" : "yes");
3101 /* new cards with microtune tuner */
3106 info = "PAL / mono";
3107 btv->tda9887_conf = TDA9887_INTERCARRIER;
3110 info = "PAL+SECAM / stereo";
3112 btv->tda9887_conf = TDA9887_QSS;
3115 info = "NTSC / stereo";
3117 btv->tda9887_conf = TDA9887_QSS;
3120 info = "PAL+SECAM / mono";
3121 btv->tda9887_conf = TDA9887_QSS;
3124 info = "NTSC / mono";
3125 btv->tda9887_conf = TDA9887_INTERCARRIER;
3128 info = "NTSC / stereo";
3129 btv->tda9887_conf = TDA9887_INTERCARRIER;
3132 info = "PAL / stereo";
3133 btv->tda9887_conf = TDA9887_INTERCARRIER;
3136 info = "oops: unknown card";
3140 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3141 pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3142 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3143 btv->tuner_type = TUNER_MT2032;
3147 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3148 #define LM1882_SYNC_DRIVE 0x200000L
3150 static void init_ids_eagle(struct bttv *btv)
3152 gpio_inout(0xffffff,0xFFFF37);
3153 gpio_write(0x200020);
3155 /* flash strobe inverter ?! */
3156 gpio_write(0x200024);
3158 /* switch sync drive off */
3159 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3161 /* set BT848 muxel to 2 */
3162 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3165 /* Muxsel helper for the IDS Eagle.
3166 * the eagles does not use the standard muxsel-bits but
3167 * has its own multiplexer */
3168 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3170 gpio_bits(3, input & 3);
3173 /* set chroma ADC to sleep */
3174 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3175 /* set to composite video */
3176 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3177 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3179 /* switch sync drive off */
3180 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3183 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3185 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3186 gpio_write(masks[input%4]);
3189 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3192 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3193 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3195 IN - sensor inputs, INx - sensor inputs and TI XORed together
3196 O1,O2,O3 - alarm outputs (relays)
3198 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3202 static void init_lmlbt4x(struct bttv *btv)
3204 pr_debug("LMLBT4x init\n");
3205 btwrite(0x000000, BT848_GPIO_REG_INP);
3206 gpio_inout(0xffffff, 0x0006C0);
3207 gpio_write(0x000000);
3210 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3212 unsigned int inmux = input % 8;
3213 gpio_inout( 0xf, 0xf );
3214 gpio_bits( 0xf, inmux );
3217 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3219 unsigned int inmux = input % 4;
3220 gpio_inout( 3<<9, 3<<9 );
3221 gpio_bits( 3<<9, inmux<<9 );
3224 static void geovision_muxsel(struct bttv *btv, unsigned int input)
3226 unsigned int inmux = input % 16;
3227 gpio_inout(0xf, 0xf);
3228 gpio_bits(0xf, inmux);
3232 * The TD3116 has 2 74HC4051 muxes wired to the MUX0 input of a bt878.
3233 * The first 74HC4051 has the lower 8 inputs, the second one the higher 8.
3234 * The muxes are controlled via a 74HC373 latch which is connected to
3235 * GPIOs 0-7. GPIO 18 is connected to the LE signal of the latch.
3236 * Q0 of the latch is connected to the Enable (~E) input of the first
3237 * 74HC4051. Q1 - Q3 are connected to S0 - S2 of the same 74HC4051.
3238 * Q4 - Q7 are connected to the second 74HC4051 in the same way.
3241 static void td3116_latch_value(struct bttv *btv, u32 value)
3243 gpio_bits((1<<18) | 0xff, value);
3244 gpio_bits((1<<18) | 0xff, (1<<18) | value);
3246 gpio_bits((1<<18) | 0xff, value);
3249 static void td3116_muxsel(struct bttv *btv, unsigned int input)
3254 highbit = (input & 0x8) >> 3 ;
3256 /* Disable outputs and set value in the mux */
3257 value = 0x11; /* Disable outputs */
3258 value |= ((input & 0x7) << 1) << (4 * highbit);
3259 td3116_latch_value(btv, value);
3261 /* Enable the correct output */
3263 value |= ((highbit ^ 0x1) << 4) | highbit;
3264 td3116_latch_value(btv, value);
3267 /* ----------------------------------------------------------------------- */
3269 static void bttv_reset_audio(struct bttv *btv)
3272 * BT878A has a audio-reset register.
3273 * 1. This register is an audio reset function but it is in
3274 * function-0 (video capture) address space.
3275 * 2. It is enough to do this once per power-up of the card.
3276 * 3. There is a typo in the Conexant doc -- it is not at
3277 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3278 * --//Shrikumar 030609
3284 pr_debug("%d: BT878A ARESET\n", btv->c.nr);
3285 btwrite((1<<7), 0x058);
3290 /* initialization part one -- before registering i2c bus */
3291 void bttv_init_card1(struct bttv *btv)
3293 switch (btv->c.type) {
3294 case BTTV_BOARD_HAUPPAUGE:
3295 case BTTV_BOARD_HAUPPAUGE878:
3296 boot_msp34xx(btv,5);
3298 case BTTV_BOARD_VOODOOTV_200:
3299 case BTTV_BOARD_VOODOOTV_FM:
3300 boot_msp34xx(btv,20);
3302 case BTTV_BOARD_AVERMEDIA98:
3303 boot_msp34xx(btv,11);
3305 case BTTV_BOARD_HAUPPAUGEPVR:
3308 case BTTV_BOARD_TWINHAN_DST:
3309 case BTTV_BOARD_AVDVBT_771:
3310 case BTTV_BOARD_PINNACLESAT:
3311 btv->use_i2c_hw = 1;
3313 case BTTV_BOARD_ADLINK_RTV24:
3316 case BTTV_BOARD_PCI_8604PW:
3317 init_PCI8604PW(btv);
3321 if (!bttv_tvcards[btv->c.type].has_dvb)
3322 bttv_reset_audio(btv);
3325 /* initialization part two -- after registering i2c bus */
3326 void bttv_init_card2(struct bttv *btv)
3328 btv->tuner_type = UNSET;
3330 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3331 bttv_readee(btv,eeprom_data,0xa0);
3332 identify_by_eeprom(btv,eeprom_data);
3335 switch (btv->c.type) {
3336 case BTTV_BOARD_MIRO:
3337 case BTTV_BOARD_MIROPRO:
3338 case BTTV_BOARD_PINNACLE:
3339 case BTTV_BOARD_PINNACLEPRO:
3341 miro_pinnacle_gpio(btv);
3343 case BTTV_BOARD_FLYVIDEO_98:
3344 case BTTV_BOARD_MAXI:
3345 case BTTV_BOARD_LIFE_FLYKIT:
3346 case BTTV_BOARD_FLYVIDEO:
3347 case BTTV_BOARD_TYPHOON_TVIEW:
3348 case BTTV_BOARD_CHRONOS_VS2:
3349 case BTTV_BOARD_FLYVIDEO_98FM:
3350 case BTTV_BOARD_FLYVIDEO2000:
3351 case BTTV_BOARD_FLYVIDEO98EZ:
3352 case BTTV_BOARD_CONFERENCETV:
3353 case BTTV_BOARD_LIFETEC_9415:
3356 case BTTV_BOARD_HAUPPAUGE:
3357 case BTTV_BOARD_HAUPPAUGE878:
3358 case BTTV_BOARD_HAUPPAUGEPVR:
3359 /* pick up some config infos from the eeprom */
3360 bttv_readee(btv,eeprom_data,0xa0);
3361 hauppauge_eeprom(btv);
3363 case BTTV_BOARD_AVERMEDIA98:
3364 case BTTV_BOARD_AVPHONE98:
3365 bttv_readee(btv,eeprom_data,0xa0);
3366 avermedia_eeprom(btv);
3368 case BTTV_BOARD_PXC200:
3371 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3372 picolo_tetra_init(btv);
3374 case BTTV_BOARD_VHX:
3376 btv->has_tea575x = 1;
3377 btv->tea_gpio.wren = 5;
3378 btv->tea_gpio.most = 6;
3379 btv->tea_gpio.clk = 3;
3380 btv->tea_gpio.data = 4;
3383 case BTTV_BOARD_VOBIS_BOOSTAR:
3384 case BTTV_BOARD_TERRATV:
3385 terratec_active_radio_upgrade(btv);
3387 case BTTV_BOARD_MAGICTVIEW061:
3388 if (btv->cardid == 0x3002144f) {
3390 pr_info("%d: radio detected by subsystem id (CPH05x)\n",
3394 case BTTV_BOARD_STB2:
3395 if (btv->cardid == 0x3060121a) {
3396 /* Fix up entry for 3DFX VoodooTV 100,
3397 which is an OEM STB card variant. */
3399 btv->tuner_type=TUNER_TEMIC_NTSC;
3402 case BTTV_BOARD_OSPREY1x0:
3403 case BTTV_BOARD_OSPREY1x0_848:
3404 case BTTV_BOARD_OSPREY101_848:
3405 case BTTV_BOARD_OSPREY1x1:
3406 case BTTV_BOARD_OSPREY1x1_SVID:
3407 case BTTV_BOARD_OSPREY2xx:
3408 case BTTV_BOARD_OSPREY2x0_SVID:
3409 case BTTV_BOARD_OSPREY2x0:
3410 case BTTV_BOARD_OSPREY440:
3411 case BTTV_BOARD_OSPREY500:
3412 case BTTV_BOARD_OSPREY540:
3413 case BTTV_BOARD_OSPREY2000:
3414 bttv_readee(btv,eeprom_data,0xa0);
3415 osprey_eeprom(btv, eeprom_data);
3417 case BTTV_BOARD_IDS_EAGLE:
3418 init_ids_eagle(btv);
3420 case BTTV_BOARD_MODTEC_205:
3421 bttv_readee(btv,eeprom_data,0xa0);
3424 case BTTV_BOARD_LMLBT4:
3427 case BTTV_BOARD_TIBET_CS16:
3428 tibetCS16_init(btv);
3430 case BTTV_BOARD_KODICOM_4400R:
3431 kodicom4400r_init(btv);
3433 case BTTV_BOARD_GEOVISION_GV800S:
3438 /* pll configuration */
3439 if (!(btv->id==848 && btv->revision==0x11)) {
3440 /* defaults from card list */
3441 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3442 btv->pll.pll_ifreq=28636363;
3443 btv->pll.pll_crystal=BT848_IFORM_XT0;
3445 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3446 btv->pll.pll_ifreq=35468950;
3447 btv->pll.pll_crystal=BT848_IFORM_XT1;
3449 if (PLL_14 == bttv_tvcards[btv->c.type].pll) {
3450 btv->pll.pll_ifreq = 14318181;
3451 btv->pll.pll_crystal = BT848_IFORM_XT0;
3453 /* insmod options can override */
3454 switch (pll[btv->c.nr]) {
3456 btv->pll.pll_crystal = 0;
3457 btv->pll.pll_ifreq = 0;
3458 btv->pll.pll_ofreq = 0;
3460 case 1: /* 28 MHz */
3462 btv->pll.pll_ifreq = 28636363;
3463 btv->pll.pll_ofreq = 0;
3464 btv->pll.pll_crystal = BT848_IFORM_XT0;
3466 case 2: /* 35 MHz */
3468 btv->pll.pll_ifreq = 35468950;
3469 btv->pll.pll_ofreq = 0;
3470 btv->pll.pll_crystal = BT848_IFORM_XT1;
3472 case 3: /* 14 MHz */
3474 btv->pll.pll_ifreq = 14318181;
3475 btv->pll.pll_ofreq = 0;
3476 btv->pll.pll_crystal = BT848_IFORM_XT0;
3480 btv->pll.pll_current = -1;
3482 /* tuner configuration (from card list / autodetect / insmod option) */
3483 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3484 if (UNSET == btv->tuner_type)
3485 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3486 if (UNSET != tuner[btv->c.nr])
3487 btv->tuner_type = tuner[btv->c.nr];
3489 if (btv->tuner_type == TUNER_ABSENT)
3490 pr_info("%d: tuner absent\n", btv->c.nr);
3491 else if (btv->tuner_type == UNSET)
3492 pr_warn("%d: tuner type unset\n", btv->c.nr);
3494 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3496 if (autoload != UNSET) {
3497 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
3498 pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3502 if (UNSET == btv->tuner_type)
3503 btv->tuner_type = TUNER_ABSENT;
3505 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3506 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3507 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3508 UNSET : bttv_tvcards[btv->c.type].svhs;
3509 if (svhs[btv->c.nr] != UNSET)
3510 btv->svhs = svhs[btv->c.nr];
3511 if (remote[btv->c.nr] != UNSET)
3512 btv->has_remote = remote[btv->c.nr];
3514 if (bttv_tvcards[btv->c.type].has_radio)
3516 if (bttv_tvcards[btv->c.type].has_remote)
3517 btv->has_remote = 1;
3518 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3520 if (bttv_tvcards[btv->c.type].volume_gpio)
3521 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3522 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3523 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3525 if (btv->tuner_type == TUNER_ABSENT)
3526 return; /* no tuner or related drivers to load */
3528 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3529 /* Probe for RDS receiver chip */
3530 static const unsigned short addrs[] = {
3535 struct v4l2_subdev *sd;
3537 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3538 &btv->c.i2c_adap, "saa6588", 0, addrs);
3539 btv->has_saa6588 = (sd != NULL);
3542 /* try to detect audio/fader chips */
3544 /* First check if the user specified the audio chip via a module
3547 switch (audiodev[btv->c.nr]) {
3549 return; /* do not load any audio module */
3551 case 0: /* autodetect */
3555 /* The user specified that we should probe for msp3400 */
3556 static const unsigned short addrs[] = {
3557 I2C_ADDR_MSP3400 >> 1,
3558 I2C_ADDR_MSP3400_ALT >> 1,
3562 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3563 &btv->c.i2c_adap, "msp3400", 0, addrs);
3564 if (btv->sd_msp34xx)
3570 /* The user specified that we should probe for tda7432 */
3571 static const unsigned short addrs[] = {
3572 I2C_ADDR_TDA7432 >> 1,
3576 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3577 &btv->c.i2c_adap, "tda7432", 0, addrs))
3583 /* The user specified that we should probe for tvaudio */
3584 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3585 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3586 if (btv->sd_tvaudio)
3592 pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
3596 /* There were no overrides, so now we try to discover this through the
3599 /* probe for msp3400 first: this driver can detect whether or not
3600 it really is a msp3400, so it will return NULL when the device
3601 found is really something else (e.g. a tea6300). */
3602 if (!bttv_tvcards[btv->c.type].no_msp34xx) {
3603 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3604 &btv->c.i2c_adap, "msp3400",
3605 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
3606 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
3607 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3608 &btv->c.i2c_adap, "msp3400",
3609 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
3612 /* If we found a msp34xx, then we're done. */
3613 if (btv->sd_msp34xx)
3616 /* Now see if we can find one of the tvaudio devices. */
3617 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3618 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3619 if (btv->sd_tvaudio) {
3620 /* There may be two tvaudio chips on the card, so try to
3622 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3623 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3626 /* it might also be a tda7432. */
3627 if (!bttv_tvcards[btv->c.type].no_tda7432) {
3628 static const unsigned short addrs[] = {
3629 I2C_ADDR_TDA7432 >> 1,
3633 btv->sd_tda7432 = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3634 &btv->c.i2c_adap, "tda7432", 0, addrs);
3635 if (btv->sd_tda7432)
3638 if (btv->sd_tvaudio)
3642 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
3646 /* initialize the tuner */
3647 void bttv_init_tuner(struct bttv *btv)
3649 int addr = ADDR_UNSET;
3651 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3652 addr = bttv_tvcards[btv->c.type].tuner_addr;
3654 if (btv->tuner_type != TUNER_ABSENT) {
3655 struct tuner_setup tun_setup;
3657 /* Load tuner module before issuing tuner config call! */
3659 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3660 &btv->c.i2c_adap, "tuner",
3661 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3662 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3663 &btv->c.i2c_adap, "tuner",
3664 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3665 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3666 &btv->c.i2c_adap, "tuner",
3667 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3669 tun_setup.mode_mask = T_ANALOG_TV;
3670 tun_setup.type = btv->tuner_type;
3671 tun_setup.addr = addr;
3674 tun_setup.mode_mask |= T_RADIO;
3676 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3679 if (btv->tda9887_conf) {
3680 struct v4l2_priv_tun_config tda9887_cfg;
3682 tda9887_cfg.tuner = TUNER_TDA9887;
3683 tda9887_cfg.priv = &btv->tda9887_conf;
3685 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3689 /* ----------------------------------------------------------------------- */
3691 static void modtec_eeprom(struct bttv *btv)
3693 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3694 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3695 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3696 btv->c.nr, &eeprom_data[0x1e]);
3697 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3698 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3699 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3700 btv->c.nr, &eeprom_data[0x1e]);
3701 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3702 btv->tuner_type=TUNER_PHILIPS_NTSC;
3703 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3704 btv->c.nr, &eeprom_data[0x1e]);
3706 pr_info("%d: Modtec: Unknown TunerString: %s\n",
3707 btv->c.nr, &eeprom_data[0x1e]);
3711 static void hauppauge_eeprom(struct bttv *btv)
3715 tveeprom_hauppauge_analog(&tv, eeprom_data);
3716 btv->tuner_type = tv.tuner_type;
3717 btv->has_radio = tv.has_radio;
3719 pr_info("%d: Hauppauge eeprom indicates model#%d\n",
3720 btv->c.nr, tv.model);
3723 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3724 * type based on model #.
3726 if(tv.model == 64900) {
3727 pr_info("%d: Switching board type from %s to %s\n",
3729 bttv_tvcards[btv->c.type].name,
3730 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3731 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3734 /* The 61334 needs the msp3410 to do the radio demod to get sound */
3735 if (tv.model == 61334)
3736 btv->radio_uses_msp_demodulator = 1;
3739 /* ----------------------------------------------------------------------- */
3741 static void bttv_tea575x_set_pins(struct snd_tea575x *tea, u8 pins)
3743 struct bttv *btv = tea->private_data;
3744 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3747 val |= (pins & TEA575X_DATA) ? (1 << gpio.data) : 0;
3748 val |= (pins & TEA575X_CLK) ? (1 << gpio.clk) : 0;
3749 val |= (pins & TEA575X_WREN) ? (1 << gpio.wren) : 0;
3751 gpio_bits((1 << gpio.data) | (1 << gpio.clk) | (1 << gpio.wren), val);
3752 if (btv->mbox_ior) {
3753 /* IOW and CSEL active */
3754 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3757 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3758 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3762 static u8 bttv_tea575x_get_pins(struct snd_tea575x *tea)
3764 struct bttv *btv = tea->private_data;
3765 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3769 if (btv->mbox_ior) {
3770 /* IOR and CSEL active */
3771 gpio_bits(btv->mbox_ior | btv->mbox_csel, 0);
3775 if (btv->mbox_ior) {
3777 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3778 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3781 if (val & (1 << gpio.data))
3782 ret |= TEA575X_DATA;
3783 if (val & (1 << gpio.most))
3784 ret |= TEA575X_MOST;
3789 static void bttv_tea575x_set_direction(struct snd_tea575x *tea, bool output)
3791 struct bttv *btv = tea->private_data;
3792 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3793 u32 mask = (1 << gpio.clk) | (1 << gpio.wren) | (1 << gpio.data) |
3797 gpio_inout(mask, (1 << gpio.data) | (1 << gpio.clk) |
3800 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));
3803 static const struct snd_tea575x_ops bttv_tea_ops = {
3804 .set_pins = bttv_tea575x_set_pins,
3805 .get_pins = bttv_tea575x_get_pins,
3806 .set_direction = bttv_tea575x_set_direction,
3809 static int tea575x_init(struct bttv *btv)
3811 btv->tea.private_data = btv;
3812 btv->tea.ops = &bttv_tea_ops;
3813 if (!snd_tea575x_hw_init(&btv->tea)) {
3814 pr_info("%d: detected TEA575x radio\n", btv->c.nr);
3815 btv->tea.mute = false;
3819 btv->has_tea575x = 0;
3825 /* ----------------------------------------------------------------------- */
3827 static int terratec_active_radio_upgrade(struct bttv *btv)
3830 btv->has_tea575x = 1;
3831 btv->tea_gpio.wren = 4;
3832 btv->tea_gpio.most = 5;
3833 btv->tea_gpio.clk = 3;
3834 btv->tea_gpio.data = 2;
3836 btv->mbox_iow = 1 << 8;
3837 btv->mbox_ior = 1 << 9;
3838 btv->mbox_csel = 1 << 10;
3840 if (!tea575x_init(btv)) {
3841 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3842 btv->has_saa6588 = 1;
3849 /* ----------------------------------------------------------------------- */
3852 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3855 #define PVR_GPIO_DELAY 10
3857 #define BTTV_ALT_DATA 0x000001
3858 #define BTTV_ALT_DCLK 0x100000
3859 #define BTTV_ALT_NCONFIG 0x800000
3861 static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen)
3867 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3869 udelay(PVR_GPIO_DELAY);
3871 gpio_write(BTTV_ALT_NCONFIG);
3872 udelay(PVR_GPIO_DELAY);
3874 for (n = 0; n < microlen; n++) {
3876 for (i = 0 ; i < 8 ; i++) {
3877 gpio_bits(BTTV_ALT_DCLK,0);
3879 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3881 gpio_bits(BTTV_ALT_DATA,0);
3882 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3886 gpio_bits(BTTV_ALT_DCLK,0);
3887 udelay(PVR_GPIO_DELAY);
3889 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3890 for (i = 0 ; i < 30 ; i++) {
3891 gpio_bits(BTTV_ALT_DCLK,0);
3892 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3894 gpio_bits(BTTV_ALT_DCLK,0);
3898 static int pvr_boot(struct bttv *btv)
3900 const struct firmware *fw_entry;
3903 rc = reject_firmware(&fw_entry, "/*(DEBLOBBED)*/", &btv->c.pci->dev);
3905 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
3908 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3909 pr_info("%d: altera firmware upload %s\n",
3910 btv->c.nr, (rc < 0) ? "failed" : "ok");
3911 release_firmware(fw_entry);
3915 /* ----------------------------------------------------------------------- */
3916 /* some osprey specific stuff */
3918 static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
3924 /* This code will nevery actually get called in this case.... */
3925 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3926 /* this might be an antique... check for MMAC label in eeprom */
3927 if (!strncmp(ee, "MMAC", 4)) {
3929 for (i = 0; i < 21; i++)
3931 if (checksum != ee[21])
3933 cardid = BTTV_BOARD_OSPREY1x0_848;
3934 for (i = 12; i < 21; i++)
3935 serial *= 10, serial += ee[i] - '0';
3938 unsigned short type;
3940 for (i = 4 * 16; i < 8 * 16; i += 16) {
3941 u16 checksum = (__force u16)ip_compute_csum(ee + i, 16);
3943 if ((checksum & 0xff) + (checksum >> 8) == 0xff)
3950 /* found a valid descriptor */
3951 type = get_unaligned_be16((__be16 *)(ee+4));
3956 cardid = BTTV_BOARD_OSPREY1x0_848;
3959 cardid = BTTV_BOARD_OSPREY101_848;
3965 cardid = BTTV_BOARD_OSPREY1x0;
3969 cardid = BTTV_BOARD_OSPREY1x1;
3974 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3980 cardid = BTTV_BOARD_OSPREY2xx;
3984 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3987 cardid = BTTV_BOARD_OSPREY500;
3991 cardid = BTTV_BOARD_OSPREY540;
3992 /* bttv_osprey_540_init(btv); */
3997 cardid = BTTV_BOARD_OSPREY2x0;
3998 /* enable output on select control lines */
3999 gpio_inout(0xffffff,0x000303);
4002 cardid = BTTV_BOARD_OSPREY440;
4005 /* unknown...leave generic, but get serial # */
4006 pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
4010 serial = get_unaligned_be32((__be32 *)(ee+6));
4013 pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
4015 cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
4017 if (cardid<0 || btv->c.type == cardid)
4020 /* card type isn't set correctly */
4021 if (card[btv->c.nr] < bttv_num_tvcards) {
4022 pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
4025 pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
4026 btv->c.nr, btv->c.type, cardid);
4027 btv->c.type = cardid;
4031 /* ----------------------------------------------------------------------- */
4032 /* AVermedia specific stuff, from bktr_card.c */
4034 static int tuner_0_table[] = {
4035 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
4036 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
4037 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
4038 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
4039 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
4040 TUNER_PHILIPS_FM1216ME_MK3 };
4042 static int tuner_1_table[] = {
4043 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
4044 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4045 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4046 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
4047 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
4049 static void avermedia_eeprom(struct bttv *btv)
4051 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
4053 tuner_make = (eeprom_data[0x41] & 0x7);
4054 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
4055 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
4056 btv->has_remote = (eeprom_data[0x42] & 0x01);
4058 if (tuner_make == 0 || tuner_make == 2)
4059 if (tuner_format <= 0x0a)
4060 tuner_type = tuner_0_table[tuner_format];
4061 if (tuner_make == 1)
4062 if (tuner_format <= 9)
4063 tuner_type = tuner_1_table[tuner_format];
4065 if (tuner_make == 4)
4066 if (tuner_format == 0x09)
4067 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
4069 pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
4070 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
4072 btv->tuner_type = tuner_type;
4073 pr_cont("%d", tuner_type);
4075 pr_cont("Unknown type");
4076 pr_cont(" radio:%s remote control:%s\n",
4077 tuner_tv_fm ? "yes" : "no",
4078 btv->has_remote ? "yes" : "no");
4082 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
4083 * analog demod, which is not I2C controlled like the newer and more common
4084 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
4085 * that control the IF for the video and audio. Apparently, bttv GPIO
4086 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
4087 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
4089 u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
4092 if (btv->audio_input == TVAUDIO_INPUT_TUNER) {
4093 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
4094 gpiobits |= 0x10000;
4096 gpiobits &= ~0x10000;
4099 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
4105 * reset/enable the MSP on some Hauppauge cards
4106 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
4111 static void boot_msp34xx(struct bttv *btv, int pin)
4113 int mask = (1 << pin);
4115 gpio_inout(mask,mask);
4119 gpio_bits(mask,mask);
4122 bttv_gpio_tracking(btv,"msp34xx");
4124 pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
4128 /* ----------------------------------------------------------------------- */
4129 /* Imagenation L-Model PXC200 Framegrabber */
4130 /* This is basically the same procedure as
4131 * used by Alessandro Rubini in his pxc200
4132 * driver, but using BTTV functions */
4134 static void init_PXC200(struct bttv *btv)
4136 static int vals[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 0x01, 0x02,
4137 0x03, 0x04, 0x05, 0x06, 0x00 };
4142 /* Initialise GPIO-connevted stuff */
4143 gpio_inout(0xffffff, (1<<13));
4147 /* GPIO inputs are pulled up, so no need to drive
4148 * reset pin any longer */
4149 gpio_bits(0xffffff, 0);
4151 bttv_gpio_tracking(btv,"pxc200");
4153 /* we could/should try and reset/control the AD pots? but
4154 right now we simply turned off the crushing. Without
4155 this the AGC drifts drifts
4156 remember the EN is reverse logic -->
4157 setting BT848_ADC_AGC_EN disable the AGC
4158 tboult@eecs.lehigh.edu
4161 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4163 /* Initialise MAX517 DAC */
4164 pr_info("Setting DAC reference voltage level ...\n");
4165 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4167 /* Initialise 12C508 PIC */
4168 /* The I2CWrite and I2CRead commands are actually to the
4169 * same chips - but the R/W bit is included in the address
4170 * argument so the numbers are different */
4173 pr_info("Initialising 12C508 PIC chip ...\n");
4175 /* First of all, enable the clock line. This is used in the PXC200-F */
4176 val = btread(BT848_GPIO_DMA_CTL);
4177 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4178 btwrite(val, BT848_GPIO_DMA_CTL);
4180 /* Then, push to 0 the reset pin long enough to reset the *
4181 * device same as above for the reset line, but not the same
4182 * value sent to the GPIO-connected stuff
4183 * which one is the good one? */
4184 gpio_inout(0xffffff,(1<<2));
4189 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4190 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4192 pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4193 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4197 pr_info("PXC200 Initialised\n");
4202 /* ----------------------------------------------------------------------- */
4204 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4205 * it. This apparently involves the following procedure for each 878 chip:
4207 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4209 * 2) write to GPIO_DATA
4215 * read from GPIO_DATA into buf (uint_32)
4216 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4217 * error. ERROR_CPLD_Check_Failed stop.
4219 * 3) write to GPIO_DATA
4220 * - write 0x4400 + 0x0E
4222 * - write 0x4410 + 0x0E
4225 * read from GPIO_DATA into buf (uint_32)
4226 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4227 * error. ERROR_CPLD_Check_Failed.
4229 /* ----------------------------------------------------------------------- */
4231 init_RTV24 (struct bttv *btv)
4233 uint32_t dataRead = 0;
4234 long watchdog_value = 0x0E;
4236 pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
4239 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4241 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4243 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4245 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4247 dataRead = btread (BT848_GPIO_DATA);
4249 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4250 pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4251 btv->c.nr, dataRead);
4254 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4256 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4258 btwrite (watchdog_value, BT848_GPIO_DATA);
4260 dataRead = btread (BT848_GPIO_DATA);
4262 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4263 pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4264 btv->c.nr, dataRead);
4269 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4274 /* ----------------------------------------------------------------------- */
4276 * The PCI-8604PW contains a CPLD, probably an ispMACH 4A, that filters
4277 * the PCI REQ signals coming from the four BT878 chips. After power
4278 * up, the CPLD does not forward requests to the bus, which prevents
4279 * the BT878 from fetching RISC instructions from memory. While the
4280 * CPLD is connected to most of the GPIOs of PCI device 0xD, only
4281 * five appear to play a role in unlocking the REQ signal. The following
4282 * sequence has been determined by trial and error without access to the
4285 * Eight GPIOs of device 0xC are provided on connector CN4 (4 in, 4 out).
4286 * Devices 0xE and 0xF do not appear to have anything connected to their
4289 * The correct GPIO_OUT_EN value might have some more bits set. It should
4290 * be possible to derive it from a boundary scan of the CPLD. Its JTAG
4291 * pins are routed to test points.
4294 /* ----------------------------------------------------------------------- */
4296 init_PCI8604PW(struct bttv *btv)
4300 if ((PCI_SLOT(btv->c.pci->devfn) & ~3) != 0xC) {
4301 pr_warn("This is not a PCI-8604PW\n");
4305 if (PCI_SLOT(btv->c.pci->devfn) != 0xD)
4308 btwrite(0x080002, BT848_GPIO_OUT_EN);
4310 state = (btread(BT848_GPIO_DATA) >> 21) & 7;
4318 pr_debug("PCI-8604PW in state %i, toggling pin\n",
4320 btwrite(0x080000, BT848_GPIO_DATA);
4322 btwrite(0x000000, BT848_GPIO_DATA);
4326 pr_info("PCI-8604PW unlocked\n");
4329 /* FIXME: If we are in state 7 and toggle GPIO[19] one
4330 more time, the CPLD goes into state 0, where PCI bus
4331 mastering is inhibited again. We have not managed to
4332 get out of that state. */
4334 pr_err("PCI-8604PW locked until reset\n");
4337 pr_err("PCI-8604PW in unknown state %i\n", state);
4341 state = (state << 4) | ((btread(BT848_GPIO_DATA) >> 21) & 7);
4348 /* The transition from state 7 to state 0 is, as explained
4349 above, valid but undesired and with this code impossible
4350 as we exit as soon as we are in state 7.
4354 pr_err("PCI-8604PW invalid transition %i -> %i\n",
4355 state >> 4, state & 7);
4362 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4364 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4365 * switch instead (CD22M3494E). This IC can have multiple active connections
4366 * between Xn (input) and Yn (output) pins. We need to clear any existing
4367 * connection prior to establish a new one, pulsing the STROBE pin.
4369 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4370 * GPIO pins are wired as:
4371 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4372 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4373 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4374 * GPIO[8] - - P3[5] (microcontroller)
4375 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4376 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4377 * GPINTR - - P3[4] (microcontroller)
4379 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4380 * configuration either directly (as we are doing) or using the microcontroller
4381 * which is also wired to I2C interface. I have no further info on the
4382 * microcontroller features, one would need to disassembly the firmware.
4383 * note: the vendor refused to give any information on this product, all
4384 * that stuff was found using a multimeter! :)
4386 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4388 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4389 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4391 gpio_bits(0x07f, muxgpio[input]);
4393 /* reset all connections */
4394 gpio_bits(0x200,0x200);
4396 gpio_bits(0x200,0x000);
4399 /* create a new connection */
4400 gpio_bits(0x480,0x480);
4402 gpio_bits(0x480,0x080);
4406 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4408 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4409 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
4410 * chips, ten eight input analog multiplexors, a not chip and a few
4413 * 16 inputs on a secondary bracket are provided and can be selected
4414 * from each of the four capture chips. Two of the eight input
4415 * multiplexors are used to select from any of the 16 input signals.
4417 * Unsupported hardware capabilities:
4418 * . A video output monitor on the secondary bracket can be selected from
4419 * one of the 878A chips.
4420 * . Another passthrough but I haven't spent any time investigating it.
4421 * . Digital I/O (logic level connected to GPIO) is available from an
4424 * The on chip input mux should always be set to 2.
4425 * GPIO[16:19] - Video input selection
4426 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4427 * GPIO[?:?] - Digital I/O.
4429 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4430 * determined what function (if any) it provides. With the microcontroller
4431 * and sync separator chips a guess is that it might have to do with video
4432 * switching and maybe some digital I/O.
4434 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4437 gpio_bits(0x0f0000, input << 16);
4440 static void tibetCS16_init(struct bttv *btv)
4442 /* enable gpio bits, mask obtained via btSpy */
4443 gpio_inout(0xffffff, 0x0f7fff);
4444 gpio_write(0x0f7fff);
4448 * The following routines for the Kodicom-4400r get a little mind-twisting.
4449 * There is a "master" controller and three "slave" controllers, together
4450 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4451 * The analog switch is controlled by the "master", but the detection order
4452 * of the four BT878A chips is in an order which I just don't understand.
4453 * The "master" is actually the second controller to be detected. The
4454 * logic on the board uses logical numbers for the 4 controllers, but
4455 * those numbers are different from the detection sequence. When working
4456 * with the analog switch, we need to "map" from the detection sequence
4457 * over to the board's logical controller number. This mapping sequence
4458 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4459 * unit 3, the second (which is the master) is logical unit 0, etc.
4460 * We need to maintain the status of the analog switch (which of the 16
4461 * cameras is connected to which of the 4 controllers) in sw_status array.
4465 * First a routine to set the analog switch, which controls which camera
4466 * is routed to which controller. The switch comprises an X-address
4467 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4468 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4469 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4470 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4471 * specified address. The idea is to set the address and data, then bring
4472 * STROBE high, and finally bring STROBE back to low.
4474 static void kodicom4400r_write(struct bttv *btv,
4475 unsigned char xaddr,
4476 unsigned char yaddr,
4477 unsigned char data) {
4480 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4481 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4482 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4483 gpio_bits(0x1ff, udata); /* strobe low */
4487 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4488 * use this routine. The routine finds the "master" for the card, maps
4489 * the controller number from the detected position over to the logical
4490 * number, writes the appropriate data to the analog switch, and housekeeps
4491 * the local copy of the switch information. The parameter 'input' is the
4492 * requested camera number (0 - 15).
4494 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4498 static unsigned char map[4] = {3, 0, 2, 1};
4500 mctlr = master[btv->c.nr];
4501 if (mctlr == NULL) { /* ignore if master not yet detected */
4504 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4506 xaddr = input & 0xf;
4507 /* Check if the controller/camera pair has changed, else ignore */
4508 if (mctlr->sw_status[yaddr] != xaddr)
4510 /* "open" the old switch, "close" the new one, save the new */
4511 kodicom4400r_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4512 mctlr->sw_status[yaddr] = xaddr;
4513 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4518 * During initialisation, we need to reset the analog switch. We
4519 * also preset the switch to map the 4 connectors on the card to the
4520 * *user's* (see above description of kodicom4400r_muxsel) channels
4523 static void kodicom4400r_init(struct bttv *btv)
4527 gpio_inout(0x0003ff, 0x0003ff);
4528 gpio_write(1 << 9); /* reset MUX */
4530 /* Preset camera 0 to the 4 controllers */
4531 for (ix = 0; ix < 4; ix++) {
4532 btv->sw_status[ix] = ix;
4533 kodicom4400r_write(btv, ix, ix, 1);
4536 * Since this is the "master", we need to set up the
4537 * other three controller chips' pointers to this structure
4538 * for later use in the muxsel routine.
4540 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4542 master[btv->c.nr-1] = btv;
4543 master[btv->c.nr] = btv;
4544 master[btv->c.nr+1] = btv;
4545 master[btv->c.nr+2] = btv;
4548 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4549 * video multiplexers to provide up to 16 video inputs. These
4550 * multiplexers are controlled by the lower 8 GPIO pins of the
4551 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4553 * xxx0 is pin xxx of multiplexer U5,
4554 * yyy1 is pin yyy of multiplexer U2
4566 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4568 static const int masks[] = {
4569 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4570 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4571 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4572 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4574 gpio_write(masks[input%16]);
4576 static void picolo_tetra_init(struct bttv *btv)
4578 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4579 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4580 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4582 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4585 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4586 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4587 /*GPIO[20]&GPIO[21] used to choose the right input*/
4588 btwrite (input<<20,BT848_GPIO_DATA);
4593 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4595 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4596 * swichers to provide 16 channels to MUX0. The TDA8540's have
4597 * 4 independent outputs and as such the IVC120G also has the
4598 * optional "Monitor Out" bus. This allows the card to be looking
4599 * at one input while the monitor is looking at another.
4601 * Since I've couldn't be bothered figuring out how to add an
4602 * independent muxsel for the monitor bus, I've just set it to
4603 * whatever the card is looking at.
4605 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4606 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4608 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4609 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4610 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4611 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4615 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4616 #define I2C_TDA8540 0x90
4617 #define I2C_TDA8540_ALT1 0x92
4618 #define I2C_TDA8540_ALT2 0x94
4619 #define I2C_TDA8540_ALT3 0x96
4620 #define I2C_TDA8540_ALT4 0x98
4621 #define I2C_TDA8540_ALT5 0x9a
4622 #define I2C_TDA8540_ALT6 0x9c
4624 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4627 int key = input % 4;
4628 int matrix = input / 4;
4630 dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4631 btv->c.nr, input, matrix, key);
4633 /* Handles the input selection on the TDA8540's */
4634 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4635 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4636 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4637 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4638 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4639 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4640 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4641 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4643 /* Handles the output enables on the TDA8540's */
4644 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4645 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4646 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4647 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4648 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4649 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4650 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4651 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4653 /* 878's MUX0 is already selected for input via muxsel values */
4657 /* PXC200 muxsel helper
4658 * luke@syseng.anu.edu.au
4659 * another transplant
4660 * from Alessandro Rubini (rubini@linux.it)
4662 * There are 4 kinds of cards:
4663 * PXC200L which is bt848
4664 * PXC200F which is bt848 with PIC controlling mux
4665 * PXC200AL which is bt878
4666 * PXC200AF which is bt878 with PIC controlling mux
4668 #define PX_CFG_PXC200F 0x01
4669 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4670 #define PX_I2C_PIC 0x0f
4671 #define PX_PXC200A_CARDID 0x200a1295
4672 #define PX_I2C_CMD_CFG 0x00
4674 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4679 unsigned char buf[2];
4681 /* Read PIC config to determine if this is a PXC200F */
4685 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4687 pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
4689 /* not PXC ? do nothing */
4693 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4694 if (!(rc & PX_CFG_PXC200F)) {
4695 pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
4701 /* The multiplexer in the 200F is handled by the GPIO port */
4702 /* get correct mapping between inputs */
4703 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4704 /* ** not needed!? */
4707 /* make sure output pins are enabled */
4708 /* bitmask=0x30f; */
4710 /* check whether we have a PXC200A */
4711 if (btv->cardid == PX_PXC200A_CARDID) {
4712 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4713 bitmask |= 7<<4; /* the DAC */
4715 btwrite(bitmask, BT848_GPIO_OUT_EN);
4717 bitmask = btread(BT848_GPIO_DATA);
4718 if (btv->cardid == PX_PXC200A_CARDID)
4719 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4720 else /* older device */
4721 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4722 btwrite(bitmask,BT848_GPIO_DATA);
4725 * Was "to be safe, set the bt848 to input 0"
4726 * Actually, since it's ok at load time, better not messing
4727 * with these bits (on PXC200AF you need to set mux 2 here)
4729 * needed because bttv-driver sets mux before calling this function
4731 if (btv->cardid == PX_PXC200A_CARDID)
4732 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4733 else /* older device */
4734 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4736 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
4739 static void phytec_muxsel(struct bttv *btv, unsigned int input)
4741 unsigned int mux = input % 4;
4743 if (input == btv->svhs)
4746 gpio_bits(0x3, mux);
4750 * GeoVision GV-800(S) functions
4751 * Bruno Christo <bchristo@inf.ufsm.br>
4754 /* This is a function to control the analog switch, which determines which
4755 * camera is routed to which controller. The switch comprises an X-address
4756 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4757 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4758 * A data value (gpio bit 18) of '1' enables the switch, and '0' disables
4759 * the switch. A STROBE bit (gpio bit 17) latches the data value into the
4760 * specified address. There is also a chip select (gpio bit 16).
4761 * The idea is to set the address and chip select together, bring
4762 * STROBE high, write the data, and finally bring STROBE back to low.
4764 static void gv800s_write(struct bttv *btv,
4765 unsigned char xaddr,
4766 unsigned char yaddr,
4767 unsigned char data) {
4768 /* On the "master" 878A:
4769 * GPIO bits 0-9 are used for the analog switch:
4770 * 00 - 03: camera selector
4771 * 04 - 06: 878A (controller) selector
4774 * 18: data (1->on, 0->off)
4777 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4778 const u32 CSELECT = 1<<16;
4779 const u32 STROBE = 1<<17;
4780 const u32 DATA = data<<18;
4782 gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */
4783 gpio_bits(0x20000, STROBE); /* STROBE high */
4784 gpio_bits(0x40000, DATA); /* write DATA */
4785 gpio_bits(0x20000, ~STROBE); /* STROBE low */
4789 * GeoVision GV-800(S) muxsel
4791 * Each of the 4 cards (controllers) use this function.
4792 * The controller using this function selects the input through the GPIO pins
4793 * of the "master" card. A pointer to this card is stored in master[btv->c.nr].
4795 * The parameter 'input' is the requested camera number (0-4) on the controller.
4796 * The map array has the address of each input. Note that the addresses in the
4797 * array are in the sequence the original GeoVision driver uses, that is, set
4798 * every controller to input 0, then to input 1, 2, 3, repeat. This means that
4799 * the physical "camera 1" connector corresponds to controller 0 input 0,
4800 * "camera 2" corresponds to controller 1 input 0, and so on.
4802 * After getting the input address, the function then writes the appropriate
4803 * data to the analog switch, and housekeeps the local copy of the switch
4806 static void gv800s_muxsel(struct bttv *btv, unsigned int input)
4810 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4811 { 0x1, 0x5, 0xb, 0x7 },
4812 { 0x2, 0x8, 0xc, 0xe },
4813 { 0x3, 0x9, 0xd, 0xf } };
4815 mctlr = master[btv->c.nr];
4816 if (mctlr == NULL) {
4817 /* do nothing until the "master" is detected */
4820 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4821 xaddr = map[yaddr][input] & 0xf;
4823 /* Check if the controller/camera pair has changed, ignore otherwise */
4824 if (mctlr->sw_status[yaddr] != xaddr) {
4825 /* disable the old switch, enable the new one and save status */
4826 gv800s_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4827 mctlr->sw_status[yaddr] = xaddr;
4828 gv800s_write(mctlr, xaddr, yaddr, 1);
4832 /* GeoVision GV-800(S) "master" chip init */
4833 static void gv800s_init(struct bttv *btv)
4837 gpio_inout(0xf107f, 0xf107f);
4838 gpio_write(1<<19); /* reset the analog MUX */
4841 /* Preset camera 0 to the 4 controllers */
4842 for (ix = 0; ix < 4; ix++) {
4843 btv->sw_status[ix] = ix;
4844 gv800s_write(btv, ix, ix, 1);
4847 /* Inputs on the "master" controller need this brightness fix */
4848 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
4850 if (btv->c.nr > BTTV_MAX-4)
4853 * Store the "master" controller pointer in the master
4854 * array for later use in the muxsel function.
4856 master[btv->c.nr] = btv;
4857 master[btv->c.nr+1] = btv;
4858 master[btv->c.nr+2] = btv;
4859 master[btv->c.nr+3] = btv;
4862 /* ----------------------------------------------------------------------- */
4863 /* motherboard chipset specific stuff */
4865 void __init bttv_check_chipset(void)
4867 int pcipci_fail = 0;
4868 struct pci_dev *dev = NULL;
4870 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
4872 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4874 if (pci_pci_problems & PCIPCI_VSFX)
4876 #ifdef PCIPCI_ALIMAGIK
4877 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4882 /* print warnings about any quirks found */
4884 pr_info("Host bridge needs ETBF enabled\n");
4886 pr_info("Host bridge needs VSFX enabled\n");
4888 pr_info("bttv and your chipset may not work together\n");
4890 pr_info("overlay will be disabled\n");
4893 pr_info("overlay forced. Use this option at your own risk.\n");
4896 if (UNSET != latency)
4897 pr_info("pci latency fixup [%d]\n", latency);
4898 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4899 PCI_DEVICE_ID_INTEL_82441, dev))) {
4901 pci_read_config_byte(dev, 0x53, &b);
4903 pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4908 int bttv_handle_chipset(struct bttv *btv)
4910 unsigned char command;
4912 if (!triton1 && !vsfx && UNSET == latency)
4917 pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
4919 if (vsfx && btv->id >= 878)
4920 pr_info("%d: enabling VSFX\n", btv->c.nr);
4921 if (UNSET != latency)
4922 pr_info("%d: setting pci timer to %d\n",
4923 btv->c.nr, latency);
4926 if (btv->id < 878) {
4927 /* bt848 (mis)uses a bit in the irq mask for etbf */
4929 btv->triton1 = BT848_INT_ETBF;
4931 /* bt878 has a bit in the pci config space for it */
4932 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4934 command |= BT878_EN_TBFX;
4936 command |= BT878_EN_VSFX;
4937 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4939 if (UNSET != latency)
4940 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);