5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <linux/delay.h>
29 #include <linux/module.h>
30 #include <linux/moduleparam.h>
31 #include <linux/kmod.h>
32 #include <linux/init.h>
33 #include <linux/pci.h>
34 #include <linux/vmalloc.h>
35 #include <linux/firmware.h>
36 #include <net/checksum.h>
41 #include <media/v4l2-common.h>
42 #include <media/tvaudio.h>
45 static void boot_msp34xx(struct bttv *btv, int pin);
46 static void boot_bt832(struct bttv *btv);
47 static void hauppauge_eeprom(struct bttv *btv);
48 static void avermedia_eeprom(struct bttv *btv);
49 static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
50 static void modtec_eeprom(struct bttv *btv);
51 static void init_PXC200(struct bttv *btv);
52 static void init_RTV24(struct bttv *btv);
54 static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
55 static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
56 static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
58 static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
60 static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
61 static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
62 static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
63 static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
64 static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
65 static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
66 static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
67 static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
68 static void rv605_muxsel(struct bttv *btv, unsigned int input);
69 static void eagle_muxsel(struct bttv *btv, unsigned int input);
70 static void xguard_muxsel(struct bttv *btv, unsigned int input);
71 static void ivc120_muxsel(struct bttv *btv, unsigned int input);
72 static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
74 static void PXC200_muxsel(struct bttv *btv, unsigned int input);
76 static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
77 static void picolo_tetra_init(struct bttv *btv);
79 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
80 static void tibetCS16_init(struct bttv *btv);
82 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
83 static void kodicom4400r_init(struct bttv *btv);
85 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
86 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
88 static int terratec_active_radio_upgrade(struct bttv *btv);
89 static int tea5757_read(struct bttv *btv);
90 static int tea5757_write(struct bttv *btv, int value);
91 static void identify_by_eeprom(struct bttv *btv,
92 unsigned char eeprom_data[256]);
93 static int __devinit pvr_boot(struct bttv *btv);
95 /* config variables */
96 static unsigned int triton1;
97 static unsigned int vsfx;
98 static unsigned int latency = UNSET;
101 static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102 static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103 static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104 static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105 static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
106 static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
108 static unsigned int autoload = 1;
110 static unsigned int autoload;
112 static unsigned int gpiomask = UNSET;
113 static unsigned int audioall = UNSET;
114 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
117 module_param(triton1, int, 0444);
118 module_param(vsfx, int, 0444);
119 module_param(no_overlay, int, 0444);
120 module_param(latency, int, 0444);
121 module_param(gpiomask, int, 0444);
122 module_param(audioall, int, 0444);
123 module_param(autoload, int, 0444);
125 module_param_array(card, int, NULL, 0444);
126 module_param_array(pll, int, NULL, 0444);
127 module_param_array(tuner, int, NULL, 0444);
128 module_param_array(svhs, int, NULL, 0444);
129 module_param_array(remote, int, NULL, 0444);
130 module_param_array(audiomux, int, NULL, 0444);
132 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
133 "[enable bug compatibility for triton1 + others]");
134 MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
135 "[yet another chipset flaw workaround]");
136 MODULE_PARM_DESC(latency,"pci latency timer");
137 MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
138 MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
139 MODULE_PARM_DESC(tuner,"specify installed tuner type");
140 MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
141 MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
142 " [some VIA/SIS chipsets are known to have problem with overlay]");
144 /* ----------------------------------------------------------------------- */
145 /* list of card IDs for bt878+ cards */
151 } cards[] __devinitdata = {
152 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
153 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
154 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
155 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
156 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
157 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
158 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
159 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
160 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
162 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
163 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
165 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
166 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
167 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
168 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
170 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
171 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
172 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
173 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
175 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
176 /* some cards ship with byteswapped IDs ... */
177 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
179 /* this seems to happen as well ... */
180 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
182 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
183 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
184 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
186 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
187 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
188 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
189 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
190 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
191 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
192 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
194 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
196 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
197 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
198 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
200 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
201 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
202 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
203 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
205 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
206 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
207 /* clashes with FlyVideo
208 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
209 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
210 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
211 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
212 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
214 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
220 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
221 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
222 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
223 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
224 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
226 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
227 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
228 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
229 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
231 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
232 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
233 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
234 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
236 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
237 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
263 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
265 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
267 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
268 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
269 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
270 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
272 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
273 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
275 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
276 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
278 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
279 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
280 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
281 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
282 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
283 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
285 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
286 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
288 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
289 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
290 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
291 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
293 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
295 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
296 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
298 /* likely broken, vendor id doesn't match the other magic views ...
299 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
301 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
302 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
304 /* DVB cards (using pci function .1 for mpeg data xfer) */
305 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
306 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
307 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
308 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
309 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
310 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
311 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
312 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
313 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
314 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
315 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
316 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
317 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
322 /* ----------------------------------------------------------------------- */
323 /* array with description for bt848 / bt878 tv/grabber cards */
325 struct tvcard bttv_tvcards[] = {
326 /* ---- card 0x00 ---------------------------------- */
327 [BTTV_BOARD_UNKNOWN] = {
328 .name = " *** UNKNOWN/GENERIC *** ",
333 .muxsel = { 2, 3, 1, 0 },
335 .tuner_addr = ADDR_UNSET,
336 .radio_addr = ADDR_UNSET,
338 [BTTV_BOARD_MIRO] = {
345 .muxsel = { 2, 3, 1, 1 },
346 .gpiomux = { 2, 0, 0, 0 },
350 .tuner_addr = ADDR_UNSET,
351 .radio_addr = ADDR_UNSET,
353 [BTTV_BOARD_HAUPPAUGE] = {
354 .name = "Hauppauge (bt848)",
360 .muxsel = { 2, 3, 1, 1 },
361 .gpiomux = { 0, 1, 2, 3 },
365 .tuner_addr = ADDR_UNSET,
366 .radio_addr = ADDR_UNSET,
369 .name = "STB, Gateway P/N 6000699 (bt848)",
375 .muxsel = { 2, 3, 1, 1 },
376 .gpiomux = { 4, 0, 2, 3 },
380 .tuner_type = TUNER_PHILIPS_NTSC,
381 .tuner_addr = ADDR_UNSET,
382 .radio_addr = ADDR_UNSET,
387 /* ---- card 0x04 ---------------------------------- */
388 [BTTV_BOARD_INTEL] = {
389 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
395 .muxsel = { 2, 3, 1, 1 },
398 .tuner_type = TUNER_ABSENT,
399 .tuner_addr = ADDR_UNSET,
400 .radio_addr = ADDR_UNSET,
402 [BTTV_BOARD_DIAMOND] = {
403 .name = "Diamond DTV2000",
409 .muxsel = { 2, 3, 1, 0 },
410 .gpiomux = { 0, 1, 0, 1 },
414 .tuner_addr = ADDR_UNSET,
415 .radio_addr = ADDR_UNSET,
417 [BTTV_BOARD_AVERMEDIA] = {
418 .name = "AVerMedia TVPhone",
423 .muxsel = { 2, 3, 1, 1 },
425 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
426 /* 0x04 for some cards ?? */
429 .tuner_addr = ADDR_UNSET,
430 .radio_addr = ADDR_UNSET,
431 .audio_hook = avermedia_tvphone_audio,
434 [BTTV_BOARD_MATRIX_VISION] = {
435 .name = "MATRIX-Vision MV-Delta",
441 .muxsel = { 2, 3, 1, 0, 0 },
445 .tuner_addr = ADDR_UNSET,
446 .radio_addr = ADDR_UNSET,
449 /* ---- card 0x08 ---------------------------------- */
450 [BTTV_BOARD_FLYVIDEO] = {
451 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
457 .muxsel = { 2, 3, 1, 1 },
458 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
463 .tuner_addr = ADDR_UNSET,
464 .radio_addr = ADDR_UNSET,
466 [BTTV_BOARD_TURBOTV] = {
467 .name = "IMS/IXmicro TurboTV",
473 .muxsel = { 2, 3, 1, 1 },
474 .gpiomux = { 1, 1, 2, 3 },
477 .tuner_type = TUNER_TEMIC_PAL,
478 .tuner_addr = ADDR_UNSET,
479 .radio_addr = ADDR_UNSET,
481 [BTTV_BOARD_HAUPPAUGE878] = {
482 .name = "Hauppauge (bt878)",
487 .gpiomask = 0x0f, /* old: 7 */
488 .muxsel = { 2, 0, 1, 1 },
489 .gpiomux = { 0, 1, 2, 3 },
494 .tuner_addr = ADDR_UNSET,
495 .radio_addr = ADDR_UNSET,
497 [BTTV_BOARD_MIROPRO] = {
498 .name = "MIRO PCTV pro",
504 .muxsel = { 2, 3, 1, 1 },
505 .gpiomux = { 0x20001,0x10001, 0, 0 },
509 .tuner_addr = ADDR_UNSET,
510 .radio_addr = ADDR_UNSET,
513 /* ---- card 0x0c ---------------------------------- */
514 [BTTV_BOARD_ADSTECH_TV] = {
515 .name = "ADS Technologies Channel Surfer TV (bt848)",
521 .muxsel = { 2, 3, 1, 1 },
522 .gpiomux = { 13, 14, 11, 7 },
525 .tuner_addr = ADDR_UNSET,
526 .radio_addr = ADDR_UNSET,
528 [BTTV_BOARD_AVERMEDIA98] = {
529 .name = "AVerMedia TVCapture 98",
535 .muxsel = { 2, 3, 1, 1 },
536 .gpiomux = { 13, 14, 11, 7 },
540 .tuner_type = TUNER_PHILIPS_PAL,
541 .tuner_addr = ADDR_UNSET,
542 .radio_addr = ADDR_UNSET,
543 .audio_hook = avermedia_tv_stereo_audio,
547 .name = "Aimslab Video Highway Xtreme (VHX)",
553 .muxsel = { 2, 3, 1, 1 },
554 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
559 .tuner_addr = ADDR_UNSET,
560 .radio_addr = ADDR_UNSET,
562 [BTTV_BOARD_ZOLTRIX] = {
563 .name = "Zoltrix TV-Max",
569 .muxsel = { 2, 3, 1, 1 },
570 .gpiomux = { 0, 0, 1, 0 },
574 .tuner_addr = ADDR_UNSET,
575 .radio_addr = ADDR_UNSET,
578 /* ---- card 0x10 ---------------------------------- */
579 [BTTV_BOARD_PIXVIEWPLAYTV] = {
580 .name = "Prolink Pixelview PlayTV (bt878)",
585 .gpiomask = 0x01fe00,
586 .muxsel = { 2, 3, 1, 1 },
587 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
588 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
589 .gpiomute = 0x002000,
594 [BTTV_BOARD_WINVIEW_601] = {
595 .name = "Leadtek WinView 601",
600 .gpiomask = 0x8300f8,
601 .muxsel = { 2, 3, 1, 1,0 },
602 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
603 .gpiomute = 0xcfa007,
606 .tuner_addr = ADDR_UNSET,
607 .radio_addr = ADDR_UNSET,
608 .audio_hook = winview_audio,
611 [BTTV_BOARD_AVEC_INTERCAP] = {
612 .name = "AVEC Intercapture",
618 .muxsel = { 2, 3, 1, 1 },
619 .gpiomux = { 1, 0, 0, 0 },
622 .tuner_addr = ADDR_UNSET,
623 .radio_addr = ADDR_UNSET,
625 [BTTV_BOARD_LIFE_FLYKIT] = {
626 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
631 .gpiomask = 0x8dff00,
632 .muxsel = { 2, 3, 1, 1 },
636 .tuner_addr = ADDR_UNSET,
637 .radio_addr = ADDR_UNSET,
640 /* ---- card 0x14 ---------------------------------- */
641 [BTTV_BOARD_CEI_RAFFLES] = {
642 .name = "CEI Raffles Card",
647 .muxsel = { 2, 3, 1, 1 },
649 .tuner_addr = ADDR_UNSET,
650 .radio_addr = ADDR_UNSET,
652 [BTTV_BOARD_CONFERENCETV] = {
653 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
655 .audio_inputs = 2, /* tuner, line in */
659 .muxsel = { 2, 3, 1, 1 },
660 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
663 .tuner_type = TUNER_PHILIPS_PAL_I,
664 .tuner_addr = ADDR_UNSET,
665 .radio_addr = ADDR_UNSET,
667 [BTTV_BOARD_PHOEBE_TVMAS] = {
668 .name = "Askey CPH050/ Phoebe Tv Master + FM",
674 .muxsel = { 2, 3, 1, 1 },
675 .gpiomux = { 0, 1, 0x800, 0x400 },
680 .tuner_addr = ADDR_UNSET,
681 .radio_addr = ADDR_UNSET,
683 [BTTV_BOARD_MODTEC_205] = {
684 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
690 .muxsel = { 2, 3, -1 },
691 .digital_mode = DIGITAL_MODE_CAMERA,
692 .gpiomux = { 0, 0, 0, 0 },
695 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
696 .tuner_addr = ADDR_UNSET,
697 .radio_addr = ADDR_UNSET,
700 /* ---- card 0x18 ---------------------------------- */
701 [BTTV_BOARD_MAGICTVIEW061] = {
702 .name = "Askey CPH05X/06X (bt878) [many vendors]",
708 .muxsel = { 2, 3, 1, 1 },
709 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
714 .tuner_addr = ADDR_UNSET,
715 .radio_addr = ADDR_UNSET,
718 [BTTV_BOARD_VOBIS_BOOSTAR] = {
719 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
724 .gpiomask = 0x1f0fff,
725 .muxsel = { 2, 3, 1, 1 },
726 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
729 .tuner_type = TUNER_PHILIPS_PAL,
730 .tuner_addr = ADDR_UNSET,
731 .radio_addr = ADDR_UNSET,
732 .audio_hook = terratv_audio,
734 [BTTV_BOARD_HAUPPAUG_WCAM] = {
735 .name = "Hauppauge WinCam newer (bt878)",
741 .muxsel = { 2, 0, 1, 1 },
742 .gpiomux = { 0, 1, 2, 3 },
746 .tuner_addr = ADDR_UNSET,
747 .radio_addr = ADDR_UNSET,
749 [BTTV_BOARD_MAXI] = {
750 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
756 .muxsel = { 2, 3, 1, 1 },
757 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
760 .tuner_type = TUNER_PHILIPS_SECAM,
761 .tuner_addr = ADDR_UNSET,
762 .radio_addr = ADDR_UNSET,
765 /* ---- card 0x1c ---------------------------------- */
766 [BTTV_BOARD_TERRATV] = {
767 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
772 .gpiomask = 0x1f0fff,
773 .muxsel = { 2, 3, 1, 1 },
774 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
777 .tuner_type = TUNER_PHILIPS_PAL,
778 .tuner_addr = ADDR_UNSET,
779 .radio_addr = ADDR_UNSET,
780 .audio_hook = terratv_audio,
782 External 20 pin connector (for Active Radio Upgrade board)
788 gpio05: om5610-stereo
792 gpio09+10: nIOR, nSEL ?? (bt878)
796 gpio16: u2-A0 (1st 4052bt)
799 gpio19: u4-A0 (2nd 4052)
803 00000 : Cdrom (internal audio input)
804 10000 : ext. Video audio input
813 [BTTV_BOARD_PXC200] = {
814 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
815 .name = "Imagenation PXC200",
819 .svhs = 1, /* was: 4 */
821 .muxsel = { 2, 3, 1, 0, 0},
825 .tuner_addr = ADDR_UNSET,
826 .radio_addr = ADDR_UNSET,
827 .muxsel_hook = PXC200_muxsel,
830 [BTTV_BOARD_FLYVIDEO_98] = {
831 .name = "Lifeview FlyVideo 98 LR50",
836 .gpiomask = 0x1800, /* 0x8dfe00 */
837 .muxsel = { 2, 3, 1, 1 },
838 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
842 .tuner_addr = ADDR_UNSET,
843 .radio_addr = ADDR_UNSET,
845 [BTTV_BOARD_IPROTV] = {
846 .name = "Formac iProTV, Formac ProTV I (bt848)",
852 .muxsel = { 2, 3, 1, 1 },
853 .gpiomux = { 1, 0, 0, 0 },
855 .tuner_type = TUNER_PHILIPS_PAL,
856 .tuner_addr = ADDR_UNSET,
857 .radio_addr = ADDR_UNSET,
860 /* ---- card 0x20 ---------------------------------- */
861 [BTTV_BOARD_INTEL_C_S_PCI] = {
862 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
868 .muxsel = { 2, 3, 1, 1 },
871 .tuner_type = TUNER_ABSENT,
872 .tuner_addr = ADDR_UNSET,
873 .radio_addr = ADDR_UNSET,
875 [BTTV_BOARD_TERRATVALUE] = {
876 .name = "Terratec TerraTValue Version Bt878",
881 .gpiomask = 0xffff00,
882 .muxsel = { 2, 3, 1, 1 },
883 .gpiomux = { 0x500, 0, 0x300, 0x900 },
887 .tuner_type = TUNER_PHILIPS_PAL,
888 .tuner_addr = ADDR_UNSET,
889 .radio_addr = ADDR_UNSET,
891 [BTTV_BOARD_WINFAST2000] = {
892 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
897 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
898 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
899 .gpiomask = 0xb33000,
900 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
901 .gpiomute = 0x800000,
902 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
903 gpio23 -- hef4052:nEnable (0x800000)
906 0x0000: external audio
910 Note: There exists another variant "Winfast 2000" with tv stereo !?
911 Note: eeprom only contains FF and pci subsystem id 107d:6606
916 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
917 .tuner_addr = ADDR_UNSET,
918 .radio_addr = ADDR_UNSET,
919 .audio_hook = winfast2000_audio,
922 [BTTV_BOARD_CHRONOS_VS2] = {
923 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
929 .muxsel = { 2, 3, 1, 1 },
930 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
934 .tuner_addr = ADDR_UNSET,
935 .radio_addr = ADDR_UNSET,
938 /* ---- card 0x24 ---------------------------------- */
939 [BTTV_BOARD_TYPHOON_TVIEW] = {
940 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
946 .muxsel = { 2, 3, 1, 1 },
947 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
951 .tuner_addr = ADDR_UNSET,
952 .radio_addr = ADDR_UNSET,
955 [BTTV_BOARD_PXELVWPLTVPRO] = {
956 .name = "Prolink PixelView PlayTV pro",
962 .muxsel = { 2, 3, 1, 1 },
963 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
968 .tuner_addr = ADDR_UNSET,
969 .radio_addr = ADDR_UNSET,
971 [BTTV_BOARD_MAGICTVIEW063] = {
972 .name = "Askey CPH06X TView99",
977 .gpiomask = 0x551e00,
978 .muxsel = { 2, 3, 1, 0 },
979 .gpiomux = { 0x551400, 0x551200, 0, 0 },
980 .gpiomute = 0x551c00,
983 .tuner_type = TUNER_PHILIPS_PAL_I,
984 .tuner_addr = ADDR_UNSET,
985 .radio_addr = ADDR_UNSET,
988 [BTTV_BOARD_PINNACLE] = {
989 .name = "Pinnacle PCTV Studio/Rave",
994 .gpiomask = 0x03000F,
995 .muxsel = { 2, 3, 1, 1 },
996 .gpiomux = { 2, 0xd0001, 0, 0 },
1000 .tuner_type = UNSET,
1001 .tuner_addr = ADDR_UNSET,
1002 .radio_addr = ADDR_UNSET,
1005 /* ---- card 0x28 ---------------------------------- */
1006 [BTTV_BOARD_STB2] = {
1007 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1013 .muxsel = { 2, 3, 1, 1 },
1014 .gpiomux = { 4, 0, 2, 3 },
1018 .tuner_type = TUNER_PHILIPS_NTSC,
1019 .tuner_addr = ADDR_UNSET,
1020 .radio_addr = ADDR_UNSET,
1024 [BTTV_BOARD_AVPHONE98] = {
1025 .name = "AVerMedia TVPhone 98",
1031 .muxsel = { 2, 3, 1, 1 },
1032 .gpiomux = { 13, 4, 11, 7 },
1035 .tuner_type = UNSET,
1036 .tuner_addr = ADDR_UNSET,
1037 .radio_addr = ADDR_UNSET,
1039 .audio_hook = avermedia_tvphone_audio,
1041 [BTTV_BOARD_PV951] = {
1042 .name = "ProVideo PV951", /* pic16c54 */
1048 .muxsel = { 2, 3, 1, 1},
1049 .gpiomux = { 0, 0, 0, 0},
1053 .tuner_type = TUNER_PHILIPS_PAL_I,
1054 .tuner_addr = ADDR_UNSET,
1055 .radio_addr = ADDR_UNSET,
1057 [BTTV_BOARD_ONAIR_TV] = {
1058 .name = "Little OnAir TV",
1064 .muxsel = { 2, 3, 1, 1 },
1065 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1066 .gpiomute = 0xff3ffc,
1068 .tuner_type = UNSET,
1069 .tuner_addr = ADDR_UNSET,
1070 .radio_addr = ADDR_UNSET,
1073 /* ---- card 0x2c ---------------------------------- */
1074 [BTTV_BOARD_SIGMA_TVII_FM] = {
1075 .name = "Sigma TVII-FM",
1081 .muxsel = { 2, 3, 1, 1 },
1082 .gpiomux = { 1, 1, 0, 2 },
1086 .tuner_type = UNSET,
1087 .tuner_addr = ADDR_UNSET,
1088 .radio_addr = ADDR_UNSET,
1090 [BTTV_BOARD_MATRIX_VISION2] = {
1091 .name = "MATRIX-Vision MV-Delta 2",
1097 .muxsel = { 2, 3, 1, 0, 0 },
1101 .tuner_type = UNSET,
1102 .tuner_addr = ADDR_UNSET,
1103 .radio_addr = ADDR_UNSET,
1105 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1106 .name = "Zoltrix Genie TV/FM",
1111 .gpiomask = 0xbcf03f,
1112 .muxsel = { 2, 3, 1, 1 },
1113 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1114 .gpiomute = 0xbcb03f,
1117 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1118 .tuner_addr = ADDR_UNSET,
1119 .radio_addr = ADDR_UNSET,
1121 [BTTV_BOARD_TERRATVRADIO] = {
1122 .name = "Terratec TV/Radio+",
1127 .gpiomask = 0x70000,
1128 .muxsel = { 2, 3, 1, 1 },
1129 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1130 .gpiomute = 0x40000,
1134 .tuner_type = TUNER_PHILIPS_PAL_I,
1135 .tuner_addr = ADDR_UNSET,
1136 .radio_addr = ADDR_UNSET,
1140 /* ---- card 0x30 ---------------------------------- */
1141 [BTTV_BOARD_DYNALINK] = {
1142 .name = "Askey CPH03x/ Dynalink Magic TView",
1148 .muxsel = { 2, 3, 1, 1 },
1149 .gpiomux = {2,0,0,0 },
1153 .tuner_type = UNSET,
1154 .tuner_addr = ADDR_UNSET,
1155 .radio_addr = ADDR_UNSET,
1157 [BTTV_BOARD_GVBCTV3PCI] = {
1158 .name = "IODATA GV-BCTV3/PCI",
1163 .gpiomask = 0x010f00,
1164 .muxsel = {2, 3, 0, 0 },
1165 .gpiomux = {0x10000, 0, 0x10000, 0 },
1168 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1169 .tuner_addr = ADDR_UNSET,
1170 .radio_addr = ADDR_UNSET,
1171 .audio_hook = gvbctv3pci_audio,
1173 [BTTV_BOARD_PXELVWPLTVPAK] = {
1174 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1179 .gpiomask = 0xAA0000,
1180 .muxsel = { 2,3,1,1,-1 },
1181 .digital_mode = DIGITAL_MODE_CAMERA,
1182 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1183 .gpiomute = 0xa8000,
1186 .tuner_type = TUNER_PHILIPS_PAL_I,
1187 .tuner_addr = ADDR_UNSET,
1188 .radio_addr = ADDR_UNSET,
1190 /* GPIO wiring: (different from Rev.4C !)
1191 GPIO17: U4.A0 (first hef4052bt)
1193 GPIO20: U5.A1 (second hef4052bt)
1195 GPIO22: BT832 Reset Line
1196 GPIO23: A5,A0, U5,nEN
1197 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1200 [BTTV_BOARD_EAGLE] = {
1201 .name = "Eagle Wireless Capricorn2 (bt878A)",
1207 .muxsel = { 2, 0, 1, 1 },
1208 .gpiomux = { 0, 1, 2, 3 },
1211 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
1212 .tuner_addr = ADDR_UNSET,
1213 .radio_addr = ADDR_UNSET,
1216 /* ---- card 0x34 ---------------------------------- */
1217 [BTTV_BOARD_PINNACLEPRO] = {
1218 /* David Härdeman <david@2gen.com> */
1219 .name = "Pinnacle PCTV Studio Pro",
1224 .gpiomask = 0x03000F,
1225 .muxsel = { 2, 3, 1, 1 },
1226 .gpiomux = { 1, 0xd0001, 0, 0 },
1228 /* sound path (5 sources):
1229 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1232 2= Mono TV sound from Tuner
1234 MUX2 (mask 0x30000):
1236 1= FM stereo Radio from Tuner */
1239 .tuner_type = UNSET,
1240 .tuner_addr = ADDR_UNSET,
1241 .radio_addr = ADDR_UNSET,
1243 [BTTV_BOARD_TVIEW_RDS_FM] = {
1244 /* Claas Langbehn <claas@bigfoot.com>,
1245 Sven Grothklags <sven@upb.de> */
1246 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1252 .muxsel = { 2, 3, 1, 1 },
1253 .gpiomux = { 0, 0, 0x10, 8 },
1257 .tuner_type = TUNER_PHILIPS_PAL,
1258 .tuner_addr = ADDR_UNSET,
1259 .radio_addr = ADDR_UNSET,
1262 [BTTV_BOARD_LIFETEC_9415] = {
1263 /* Tim Röstermundt <rosterm@uni-muenster.de>
1264 in de.comp.os.unix.linux.hardware:
1265 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1266 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1267 options tuner type=5 */
1268 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1274 .muxsel = { 2, 3, 1, 1 },
1275 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1277 /* For cards with tda9820/tda9821:
1278 0x0000: Tuner normal stereo
1279 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1280 0x0880: Tuner A2 stereo */
1282 .tuner_type = UNSET,
1283 .tuner_addr = ADDR_UNSET,
1284 .radio_addr = ADDR_UNSET,
1286 [BTTV_BOARD_BESTBUY_EASYTV] = {
1287 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1288 old Easy TV BT848 version (model CPH031) */
1289 .name = "Askey CPH031/ BESTBUY Easy TV",
1295 .muxsel = { 2, 3, 1, 0 },
1296 .gpiomux = { 2, 0, 0, 0 },
1300 .tuner_type = TUNER_TEMIC_PAL,
1301 .tuner_addr = ADDR_UNSET,
1302 .radio_addr = ADDR_UNSET,
1305 /* ---- card 0x38 ---------------------------------- */
1306 [BTTV_BOARD_FLYVIDEO_98FM] = {
1307 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1308 .name = "Lifeview FlyVideo 98FM LR50",
1314 .muxsel = { 2, 3, 1, 1 },
1315 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1318 .tuner_type = TUNER_PHILIPS_PAL,
1319 .tuner_addr = ADDR_UNSET,
1320 .radio_addr = ADDR_UNSET,
1322 /* This is the ultimate cheapo capture card
1323 * just a BT848A on a small PCB!
1324 * Steve Hosgood <steve@equiinet.com> */
1325 [BTTV_BOARD_GRANDTEC] = {
1326 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1337 .tuner_type = UNSET,
1338 .tuner_addr = ADDR_UNSET,
1339 .radio_addr = ADDR_UNSET,
1341 [BTTV_BOARD_ASKEY_CPH060] = {
1342 /* Daniel Herrington <daniel.herrington@home.com> */
1343 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1349 .muxsel = { 2, 3, 1, 1},
1350 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1354 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1355 .tuner_addr = ADDR_UNSET,
1356 .radio_addr = ADDR_UNSET,
1358 [BTTV_BOARD_ASKEY_CPH03X] = {
1359 /* Matti Mottus <mottus@physic.ut.ee> */
1360 .name = "Askey CPH03x TV Capturer",
1365 .gpiomask = 0x03000F,
1366 .muxsel = { 2, 3, 1, 0 },
1367 .gpiomux = { 2, 0, 0, 0 },
1370 .tuner_type = TUNER_TEMIC_PAL,
1371 .tuner_addr = ADDR_UNSET,
1372 .radio_addr = ADDR_UNSET,
1375 /* ---- card 0x3c ---------------------------------- */
1376 [BTTV_BOARD_MM100PCTV] = {
1377 /* Philip Blundell <philb@gnu.org> */
1378 .name = "Modular Technology MM100PCTV",
1384 .muxsel = { 2, 3, 1, 1 },
1385 .gpiomux = { 2, 0, 0, 1 },
1388 .tuner_type = TUNER_TEMIC_PAL,
1389 .tuner_addr = ADDR_UNSET,
1390 .radio_addr = ADDR_UNSET,
1392 [BTTV_BOARD_GMV1] = {
1393 /* Adrian Cox <adrian@humboldt.co.uk */
1394 .name = "AG Electronics GMV1",
1405 .tuner_type = UNSET,
1406 .tuner_addr = ADDR_UNSET,
1407 .radio_addr = ADDR_UNSET,
1409 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1410 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1411 new Easy TV BT878 version (model CPH061)
1412 special thanks to Informatica Mieres for providing the card */
1413 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1419 .muxsel = { 2, 3, 1, 0 },
1420 .gpiomux = { 1, 0, 4, 4 },
1424 .tuner_type = TUNER_PHILIPS_PAL,
1425 .tuner_addr = ADDR_UNSET,
1426 .radio_addr = ADDR_UNSET,
1428 [BTTV_BOARD_ATI_TVWONDER] = {
1429 /* Lukas Gebauer <geby@volny.cz> */
1430 .name = "ATI TV-Wonder",
1436 .muxsel = { 2, 3, 1, 0 },
1437 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1440 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1441 .tuner_addr = ADDR_UNSET,
1442 .radio_addr = ADDR_UNSET,
1445 /* ---- card 0x40 ---------------------------------- */
1446 [BTTV_BOARD_ATI_TVWONDERVE] = {
1447 /* Lukas Gebauer <geby@volny.cz> */
1448 .name = "ATI TV-Wonder VE",
1454 .muxsel = { 2, 3, 0, 1 },
1455 .gpiomux = { 0, 0, 1, 0 },
1458 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1459 .tuner_addr = ADDR_UNSET,
1460 .radio_addr = ADDR_UNSET,
1462 [BTTV_BOARD_FLYVIDEO2000] = {
1463 /* DeeJay <deejay@westel900.net (2000S) */
1464 .name = "Lifeview FlyVideo 2000S LR90",
1470 .muxsel = { 2, 3, 0, 1 },
1471 /* Radio changed from 1e80 to 0x800 to make
1472 FlyVideo2000S in .hu happy (gm)*/
1473 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1474 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1476 .audio_hook = fv2000s_audio,
1481 .tuner_type = TUNER_PHILIPS_PAL,
1482 .tuner_addr = ADDR_UNSET,
1483 .radio_addr = ADDR_UNSET,
1485 [BTTV_BOARD_TERRATVALUER] = {
1486 .name = "Terratec TValueRadio",
1491 .gpiomask = 0xffff00,
1492 .muxsel = { 2, 3, 1, 1 },
1493 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1497 .tuner_type = TUNER_PHILIPS_PAL,
1498 .tuner_addr = ADDR_UNSET,
1499 .radio_addr = ADDR_UNSET,
1502 [BTTV_BOARD_GVBCTV4PCI] = {
1503 /* TANAKA Kei <peg00625@nifty.com> */
1504 .name = "IODATA GV-BCTV4/PCI",
1509 .gpiomask = 0x010f00,
1510 .muxsel = {2, 3, 0, 0 },
1511 .gpiomux = {0x10000, 0, 0x10000, 0 },
1514 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1515 .tuner_addr = ADDR_UNSET,
1516 .radio_addr = ADDR_UNSET,
1517 .audio_hook = gvbctv3pci_audio,
1520 /* ---- card 0x44 ---------------------------------- */
1521 [BTTV_BOARD_VOODOOTV_FM] = {
1522 .name = "3Dfx VoodooTV FM (Euro)",
1523 /* try "insmod msp3400 simple=0" if you have
1524 * sound problems with this card. */
1529 .gpiomask = 0x4f8a00,
1530 /* 0x100000: 1=MSP enabled (0=disable again)
1531 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1532 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1533 .gpiomute = 0x947fff,
1534 /* tvtuner, radio, external,internal, mute, stereo
1535 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1536 .muxsel = { 2, 3 ,0 ,1 },
1537 .tuner_type = TUNER_MT2032,
1538 .tuner_addr = ADDR_UNSET,
1539 .radio_addr = ADDR_UNSET,
1543 [BTTV_BOARD_VOODOOTV_200] = {
1544 .name = "VoodooTV 200 (USA)",
1545 /* try "insmod msp3400 simple=0" if you have
1546 * sound problems with this card. */
1551 .gpiomask = 0x4f8a00,
1552 /* 0x100000: 1=MSP enabled (0=disable again)
1553 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1554 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1555 .gpiomute = 0x947fff,
1556 /* tvtuner, radio, external,internal, mute, stereo
1557 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1558 .muxsel = { 2, 3 ,0 ,1 },
1559 .tuner_type = TUNER_MT2032,
1560 .tuner_addr = ADDR_UNSET,
1561 .radio_addr = ADDR_UNSET,
1565 [BTTV_BOARD_AIMMS] = {
1566 /* Philip Blundell <pb@nexus.co.uk> */
1567 .name = "Active Imaging AIMMS",
1571 .tuner_type = UNSET,
1572 .tuner_addr = ADDR_UNSET,
1573 .radio_addr = ADDR_UNSET,
1578 [BTTV_BOARD_PV_BT878P_PLUS] = {
1579 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1580 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1586 .muxsel = { 2, 3, 1, 1 },
1587 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1591 .tuner_type = TUNER_LG_PAL_I_FM,
1592 .tuner_addr = ADDR_UNSET,
1593 .radio_addr = ADDR_UNSET,
1596 GPIO0: U4.A0 (hef4052bt)
1598 GPIO2: U4.A1 (second hef4052bt)
1599 GPIO3: U4.nEN, U5.A0, A5.nEN
1603 [BTTV_BOARD_FLYVIDEO98EZ] = {
1604 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1609 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1612 .tuner_type = UNSET,
1613 .tuner_addr = ADDR_UNSET,
1614 .radio_addr = ADDR_UNSET,
1617 /* ---- card 0x48 ---------------------------------- */
1618 [BTTV_BOARD_PV_BT878P_9B] = {
1619 /* Dariusz Kowalewski <darekk@automex.pl> */
1620 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1626 .muxsel = { 2, 3, 1, 1 },
1627 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1633 .tuner_type = TUNER_PHILIPS_PAL,
1634 .tuner_addr = ADDR_UNSET,
1635 .radio_addr = ADDR_UNSET,
1636 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1637 .has_radio = 1, /* Note: not all cards have radio */
1644 GPIO20,22,23: R30,R29,R28
1647 [BTTV_BOARD_SENSORAY311] = {
1648 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1649 /* you must jumper JP5 for the card to work */
1650 .name = "Sensoray 311",
1656 .muxsel = { 2, 3, 1, 0, 0 },
1659 .tuner_type = UNSET,
1660 .tuner_addr = ADDR_UNSET,
1661 .radio_addr = ADDR_UNSET,
1663 [BTTV_BOARD_RV605] = {
1664 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1665 .name = "RemoteVision MX (RV605)",
1671 .gpiomask2 = 0x07ff,
1672 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1673 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1676 .tuner_type = UNSET,
1677 .tuner_addr = ADDR_UNSET,
1678 .radio_addr = ADDR_UNSET,
1679 .muxsel_hook = rv605_muxsel,
1681 [BTTV_BOARD_POWERCLR_MTV878] = {
1682 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1687 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1688 .muxsel = { 2, 1, 1, },
1689 .gpiomux = { 0, 1, 2, 2 },
1692 .tuner_type = TUNER_PHILIPS_PAL,
1693 .tuner_addr = ADDR_UNSET,
1694 .radio_addr = ADDR_UNSET,
1699 /* ---- card 0x4c ---------------------------------- */
1700 [BTTV_BOARD_WINDVR] = {
1701 /* Masaki Suzuki <masaki@btree.org> */
1702 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1707 .gpiomask = 0x140007,
1708 .muxsel = { 2, 3, 1, 1 },
1709 .gpiomux = { 0, 1, 2, 3 },
1711 .tuner_type = TUNER_PHILIPS_NTSC,
1712 .tuner_addr = ADDR_UNSET,
1713 .radio_addr = ADDR_UNSET,
1714 .audio_hook = windvr_audio,
1716 [BTTV_BOARD_GRANDTEC_MULTI] = {
1717 .name = "GrandTec Multi Capture Card (Bt878)",
1723 .muxsel = { 2, 3, 1, 0 },
1728 .tuner_type = UNSET,
1729 .tuner_addr = ADDR_UNSET,
1730 .radio_addr = ADDR_UNSET,
1732 [BTTV_BOARD_KWORLD] = {
1733 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1739 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1740 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
1741 * This card lacks external Audio In, so we mute it on Ext. & Int.
1742 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1743 * This card lacks PCI subsystem ID, sigh.
1744 * gpiomux =1: lower volume, 2+3: mute
1745 * btwincap uses 0x80000/0x80003
1751 .tuner_type = TUNER_PHILIPS_PAL,
1752 .tuner_addr = ADDR_UNSET,
1753 .radio_addr = ADDR_UNSET,
1754 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1755 radio signal strength indicators work fine. */
1758 GPIO0,1: HEF4052 A0,A1
1759 GPIO2: HEF4052 nENABLE
1761 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1765 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1767 [BTTV_BOARD_DSP_TCVIDEO] = {
1768 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1769 .name = "DSP Design TCVIDEO",
1772 .muxsel = { 2, 3, 1, 0 },
1774 .tuner_type = UNSET,
1775 .tuner_addr = ADDR_UNSET,
1776 .radio_addr = ADDR_UNSET,
1779 /* ---- card 0x50 ---------------------------------- */
1780 [BTTV_BOARD_HAUPPAUGEPVR] = {
1781 .name = "Hauppauge WinTV PVR",
1786 .muxsel = { 2, 0, 1, 1 },
1789 .tuner_type = UNSET,
1790 .tuner_addr = ADDR_UNSET,
1791 .radio_addr = ADDR_UNSET,
1796 [BTTV_BOARD_GVBCTV5PCI] = {
1797 .name = "IODATA GV-BCTV5/PCI",
1802 .gpiomask = 0x0f0f80,
1803 .muxsel = {2, 3, 1, 0 },
1804 .gpiomux = {0x030000, 0x010000, 0, 0 },
1805 .gpiomute = 0x020000,
1808 .tuner_type = TUNER_PHILIPS_NTSC_M,
1809 .tuner_addr = ADDR_UNSET,
1810 .radio_addr = ADDR_UNSET,
1811 .audio_hook = gvbctv5pci_audio,
1814 [BTTV_BOARD_OSPREY1x0] = {
1815 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1816 .video_inputs = 4, /* id-inputs-clock */
1820 .muxsel = { 3, 2, 0, 1 },
1822 .tuner_type = UNSET,
1823 .tuner_addr = ADDR_UNSET,
1824 .radio_addr = ADDR_UNSET,
1829 [BTTV_BOARD_OSPREY1x0_848] = {
1830 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1835 .muxsel = { 2, 3, 1 },
1837 .tuner_type = UNSET,
1838 .tuner_addr = ADDR_UNSET,
1839 .radio_addr = ADDR_UNSET,
1845 /* ---- card 0x54 ---------------------------------- */
1846 [BTTV_BOARD_OSPREY101_848] = {
1847 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1854 .tuner_type = UNSET,
1855 .tuner_addr = ADDR_UNSET,
1856 .radio_addr = ADDR_UNSET,
1861 [BTTV_BOARD_OSPREY1x1] = {
1862 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1869 .tuner_type = UNSET,
1870 .tuner_addr = ADDR_UNSET,
1871 .radio_addr = ADDR_UNSET,
1876 [BTTV_BOARD_OSPREY1x1_SVID] = {
1877 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1884 .tuner_type = UNSET,
1885 .tuner_addr = ADDR_UNSET,
1886 .radio_addr = ADDR_UNSET,
1891 [BTTV_BOARD_OSPREY2xx] = {
1892 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1899 .tuner_type = UNSET,
1900 .tuner_addr = ADDR_UNSET,
1901 .radio_addr = ADDR_UNSET,
1907 /* ---- card 0x58 ---------------------------------- */
1908 [BTTV_BOARD_OSPREY2x0_SVID] = {
1909 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1916 .tuner_type = UNSET,
1917 .tuner_addr = ADDR_UNSET,
1918 .radio_addr = ADDR_UNSET,
1923 [BTTV_BOARD_OSPREY2x0] = {
1924 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
1931 .tuner_type = UNSET,
1932 .tuner_addr = ADDR_UNSET,
1933 .radio_addr = ADDR_UNSET,
1938 [BTTV_BOARD_OSPREY500] = {
1939 .name = "Osprey 500", /* 500 */
1946 .tuner_type = UNSET,
1947 .tuner_addr = ADDR_UNSET,
1948 .radio_addr = ADDR_UNSET,
1953 [BTTV_BOARD_OSPREY540] = {
1954 .name = "Osprey 540", /* 540 */
1959 .tuner_type = UNSET,
1960 .tuner_addr = ADDR_UNSET,
1961 .radio_addr = ADDR_UNSET,
1967 /* ---- card 0x5C ---------------------------------- */
1968 [BTTV_BOARD_OSPREY2000] = {
1969 .name = "Osprey 2000", /* 2000 */
1976 .tuner_type = UNSET,
1977 .tuner_addr = ADDR_UNSET,
1978 .radio_addr = ADDR_UNSET,
1981 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1983 [BTTV_BOARD_IDS_EAGLE] = {
1984 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1985 .name = "IDS Eagle",
1989 .tuner_type = UNSET,
1990 .tuner_addr = ADDR_UNSET,
1991 .radio_addr = ADDR_UNSET,
1994 .muxsel = { 0, 1, 2, 3 },
1995 .muxsel_hook = eagle_muxsel,
2000 [BTTV_BOARD_PINNACLESAT] = {
2001 .name = "Pinnacle PCTV Sat",
2006 .tuner_type = UNSET,
2007 .tuner_addr = ADDR_UNSET,
2008 .radio_addr = ADDR_UNSET,
2017 [BTTV_BOARD_FORMAC_PROTV] = {
2018 .name = "Formac ProTV II (bt878)",
2024 /* TV, Comp1, Composite over SVID con, SVID */
2025 .muxsel = { 2, 3, 1, 1 },
2026 .gpiomux = { 2, 2, 0, 0 },
2029 .tuner_type = TUNER_PHILIPS_PAL,
2030 .tuner_addr = ADDR_UNSET,
2031 .radio_addr = ADDR_UNSET,
2033 GPIO=0x00,0x01,0x03: mute (?)
2034 0x02: both TV and radio (tuner: FM1216/I)
2035 The card has onboard audio connectors labeled "cdrom" and "board",
2036 not soldered here, though unknown wiring.
2037 Card lacks: external audio in, pci subsystem id.
2041 /* ---- card 0x60 ---------------------------------- */
2042 [BTTV_BOARD_MACHTV] = {
2049 .muxsel = { 2, 3, 1, 1},
2050 .gpiomux = { 0, 1, 2, 3},
2053 .tuner_type = TUNER_PHILIPS_PAL,
2054 .tuner_addr = ADDR_UNSET,
2055 .radio_addr = ADDR_UNSET,
2058 [BTTV_BOARD_EURESYS_PICOLO] = {
2059 .name = "Euresys Picolo",
2068 .muxsel = { 2, 0, 1},
2070 .tuner_type = UNSET,
2071 .tuner_addr = ADDR_UNSET,
2072 .radio_addr = ADDR_UNSET,
2074 [BTTV_BOARD_PV150] = {
2075 /* Luc Van Hoeylandt <luc@e-magic.be> */
2076 .name = "ProVideo PV150", /* 0x4f */
2087 .tuner_type = UNSET,
2088 .tuner_addr = ADDR_UNSET,
2089 .radio_addr = ADDR_UNSET,
2091 [BTTV_BOARD_AD_TVK503] = {
2092 /* Hiroshi Takekawa <sian@big.or.jp> */
2093 /* This card lacks subsystem ID */
2094 .name = "AD-TVK503", /* 0x63 */
2099 .gpiomask = 0x001e8007,
2100 .muxsel = { 2, 3, 1, 0 },
2101 /* Tuner, Radio, external, internal, off, on */
2102 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2107 .tuner_type = TUNER_PHILIPS_NTSC,
2108 .tuner_addr = ADDR_UNSET,
2109 .radio_addr = ADDR_UNSET,
2110 .audio_hook = adtvk503_audio,
2113 /* ---- card 0x64 ---------------------------------- */
2114 [BTTV_BOARD_HERCULES_SM_TV] = {
2115 .name = "Hercules Smart TV Stereo",
2121 .muxsel = { 2, 3, 1, 1 },
2125 .tuner_type = TUNER_PHILIPS_PAL,
2126 .tuner_addr = ADDR_UNSET,
2127 .radio_addr = ADDR_UNSET,
2129 - card lacks subsystem ID
2130 - stereo variant w/ daughter board with tda9874a @0xb0
2132 always from tda9874 independent of GPIO (?)
2133 external line in: unknown
2134 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2135 hef4053 (instead 4052) for unknown function
2138 [BTTV_BOARD_PACETV] = {
2139 .name = "Pace TV & Radio Card",
2144 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
2148 .tuner_type = TUNER_PHILIPS_PAL_I,
2149 .tuner_addr = ADDR_UNSET,
2150 .radio_addr = ADDR_UNSET,
2153 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2154 only internal line out: (4pin header) RGGL
2155 Radio must be decoded by msp3410d (not routed through)*/
2157 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2160 [BTTV_BOARD_IVC200] = {
2161 /* Chris Willing <chris@vislab.usyd.edu.au> */
2166 .tuner_type = UNSET,
2167 .tuner_addr = ADDR_UNSET,
2168 .radio_addr = ADDR_UNSET,
2174 [BTTV_BOARD_XGUARD] = {
2175 .name = "Grand X-Guard / Trust 814PCI",
2180 .tuner_type = TUNER_ABSENT,
2181 .tuner_addr = ADDR_UNSET,
2182 .radio_addr = ADDR_UNSET,
2184 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2185 .muxsel_hook = xguard_muxsel,
2192 /* ---- card 0x68 ---------------------------------- */
2193 [BTTV_BOARD_NEBULA_DIGITV] = {
2194 .name = "Nebula Electronics DigiTV",
2198 .muxsel = { 2, 3, 1, 0 },
2203 .tuner_type = UNSET,
2204 .tuner_addr = ADDR_UNSET,
2205 .radio_addr = ADDR_UNSET,
2211 [BTTV_BOARD_PV143] = {
2212 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2213 .name = "ProVideo PV143",
2219 .muxsel = { 2, 3, 1, 0 },
2224 .tuner_type = UNSET,
2225 .tuner_addr = ADDR_UNSET,
2226 .radio_addr = ADDR_UNSET,
2228 [BTTV_BOARD_VD009X1_MINIDIN] = {
2229 /* M.Klahr@phytec.de */
2230 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2233 .tuner = UNSET, /* card has no tuner */
2236 .muxsel = { 2, 3, 1, 0 },
2237 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2240 .tuner_type = UNSET,
2241 .tuner_addr = ADDR_UNSET,
2242 .radio_addr = ADDR_UNSET,
2244 [BTTV_BOARD_VD009X1_COMBI] = {
2245 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2248 .tuner = UNSET, /* card has no tuner */
2251 .muxsel = { 2, 3, 1, 1 },
2252 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2255 .tuner_type = UNSET,
2256 .tuner_addr = ADDR_UNSET,
2257 .radio_addr = ADDR_UNSET,
2260 /* ---- card 0x6c ---------------------------------- */
2261 [BTTV_BOARD_VD009_MINIDIN] = {
2262 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2265 .tuner = UNSET, /* card has no tuner */
2268 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2269 via the upper nibble of muxsel. here: used for
2270 xternal video-mux */
2271 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2272 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2275 .tuner_type = UNSET,
2276 .tuner_addr = ADDR_UNSET,
2277 .radio_addr = ADDR_UNSET,
2279 [BTTV_BOARD_VD009_COMBI] = {
2280 .name = "PHYTEC VD-009 Combi (bt878)",
2283 .tuner = UNSET, /* card has no tuner */
2286 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2287 via the upper nibble of muxsel. here: used for
2288 xternal video-mux */
2289 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2290 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2293 .tuner_type = UNSET,
2294 .tuner_addr = ADDR_UNSET,
2295 .radio_addr = ADDR_UNSET,
2297 [BTTV_BOARD_IVC100] = {
2302 .tuner_type = UNSET,
2303 .tuner_addr = ADDR_UNSET,
2304 .radio_addr = ADDR_UNSET,
2307 .muxsel = { 2, 3, 1, 0 },
2310 [BTTV_BOARD_IVC120] = {
2311 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2314 .audio_inputs = 0, /* card has no audio */
2315 .tuner = UNSET, /* card has no tuner */
2316 .tuner_type = UNSET,
2317 .tuner_addr = ADDR_UNSET,
2318 .radio_addr = ADDR_UNSET,
2319 .svhs = UNSET, /* card has no svhs */
2325 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2326 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2327 .muxsel_hook = ivc120_muxsel,
2331 /* ---- card 0x70 ---------------------------------- */
2332 [BTTV_BOARD_PC_HDTV] = {
2333 .name = "pcHDTV HD-2000 TV",
2338 .muxsel = { 2, 3, 1, 0 },
2339 .tuner_type = TUNER_PHILIPS_ATSC,
2340 .tuner_addr = ADDR_UNSET,
2341 .radio_addr = ADDR_UNSET,
2344 [BTTV_BOARD_TWINHAN_DST] = {
2345 .name = "Twinhan DST + clones",
2349 .tuner_type = TUNER_ABSENT,
2350 .tuner_addr = ADDR_UNSET,
2351 .radio_addr = ADDR_UNSET,
2355 [BTTV_BOARD_WINFASTVC100] = {
2356 .name = "Winfast VC100",
2361 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
2365 .tuner_type = TUNER_ABSENT,
2366 .tuner_addr = ADDR_UNSET,
2367 .radio_addr = ADDR_UNSET,
2370 [BTTV_BOARD_TEV560] = {
2371 .name = "Teppro TEV-560/InterVision IV-560",
2377 .muxsel = { 2, 3, 1, 1 },
2378 .gpiomux = { 1, 1, 1, 1 },
2380 .tuner_type = TUNER_PHILIPS_PAL,
2381 .tuner_addr = ADDR_UNSET,
2382 .radio_addr = ADDR_UNSET,
2386 /* ---- card 0x74 ---------------------------------- */
2387 [BTTV_BOARD_SIMUS_GVC1100] = {
2388 .name = "SIMUS GVC1100",
2393 .tuner_type = UNSET,
2394 .tuner_addr = ADDR_UNSET,
2395 .radio_addr = ADDR_UNSET,
2397 .muxsel = { 2, 2, 2, 2 },
2399 .muxsel_hook = gvc1100_muxsel,
2401 [BTTV_BOARD_NGSTV_PLUS] = {
2402 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2403 .name = "NGS NGSTV+",
2407 .gpiomask = 0x008007,
2408 .muxsel = { 2, 3, 0, 0 },
2409 .gpiomux = { 0, 0, 0, 0 },
2410 .gpiomute = 0x000003,
2412 .tuner_type = TUNER_PHILIPS_PAL,
2413 .tuner_addr = ADDR_UNSET,
2414 .radio_addr = ADDR_UNSET,
2417 [BTTV_BOARD_LMLBT4] = {
2418 /* http://linuxmedialabs.com */
2420 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2424 .muxsel = { 2, 3, 1, 0 },
2429 .tuner_type = UNSET,
2430 .tuner_addr = ADDR_UNSET,
2431 .radio_addr = ADDR_UNSET,
2433 [BTTV_BOARD_TEKRAM_M205] = {
2434 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2435 .name = "Tekram M205 PRO",
2439 .tuner_type = TUNER_PHILIPS_PAL,
2440 .tuner_addr = ADDR_UNSET,
2441 .radio_addr = ADDR_UNSET,
2445 .muxsel = { 2, 3, 1 },
2446 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2450 /* ---- card 0x78 ---------------------------------- */
2451 [BTTV_BOARD_CONTVFMI] = {
2452 /* Javier Cendan Ares <jcendan@lycos.es> */
2453 /* bt878 TV + FM without subsystem ID */
2454 .name = "Conceptronic CONTVFMi",
2459 .gpiomask = 0x008007,
2460 .muxsel = { 2, 3, 1, 1 },
2461 .gpiomux = { 0, 1, 2, 2 },
2465 .tuner_type = TUNER_PHILIPS_PAL,
2466 .tuner_addr = ADDR_UNSET,
2467 .radio_addr = ADDR_UNSET,
2471 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2472 /*Eric DEBIEF <debief@telemsa.com>*/
2473 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2474 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2476 .name = "Euresys Picolo Tetra",
2482 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2486 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2487 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2490 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2491 .tuner_type = UNSET,
2492 .tuner_addr = ADDR_UNSET,
2493 .radio_addr = ADDR_UNSET,
2495 [BTTV_BOARD_SPIRIT_TV] = {
2496 /* Spirit TV Tuner from http://spiritmodems.com.au */
2497 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2498 .name = "Spirit TV Tuner",
2503 .gpiomask = 0x0000000f,
2504 .muxsel = { 2, 1, 1 },
2505 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2506 .tuner_type = TUNER_TEMIC_PAL,
2507 .tuner_addr = ADDR_UNSET,
2508 .radio_addr = ADDR_UNSET,
2512 [BTTV_BOARD_AVDVBT_771] = {
2513 /* Wolfram Joost <wojo@frokaschwei.de> */
2514 .name = "AVerMedia AVerTV DVB-T 771",
2518 .tuner_type = TUNER_ABSENT,
2519 .tuner_addr = ADDR_UNSET,
2520 .radio_addr = ADDR_UNSET,
2521 .muxsel = { 3 , 3 },
2530 /* ---- card 0x7c ---------------------------------- */
2531 [BTTV_BOARD_AVDVBT_761] = {
2532 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2533 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2534 .name = "AverMedia AverTV DVB-T 761",
2538 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
2543 .tuner_type = UNSET,
2544 .tuner_addr = ADDR_UNSET,
2545 .radio_addr = ADDR_UNSET,
2550 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2551 /* andre.schwarz@matrix-vision.de */
2552 .name = "MATRIX Vision Sigma-SQ",
2558 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2559 3, 3, 3, 3, 3, 3, 3, 3 },
2560 .muxsel_hook = sigmaSQ_muxsel,
2564 .tuner_type = UNSET,
2565 .tuner_addr = ADDR_UNSET,
2566 .radio_addr = ADDR_UNSET,
2568 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2569 /* andre.schwarz@matrix-vision.de */
2570 .name = "MATRIX Vision Sigma-SLC",
2576 .muxsel = { 2, 2, 2, 2 },
2577 .muxsel_hook = sigmaSLC_muxsel,
2581 .tuner_type = UNSET,
2582 .tuner_addr = ADDR_UNSET,
2583 .radio_addr = ADDR_UNSET,
2585 /* BTTV_BOARD_APAC_VIEWCOMP */
2586 [BTTV_BOARD_APAC_VIEWCOMP] = {
2587 /* Attila Kondoros <attila.kondoros@chello.hu> */
2588 /* bt878 TV + FM 0x00000000 subsystem ID */
2589 .name = "APAC Viewcomp 878(AMAX)",
2595 .muxsel = { 2, 3, 1, 1 },
2596 .gpiomux = { 2, 0, 0, 0 },
2600 .tuner_type = TUNER_PHILIPS_PAL,
2601 .tuner_addr = ADDR_UNSET,
2602 .radio_addr = ADDR_UNSET,
2603 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2604 .has_radio = 1, /* not every card has radio */
2607 /* ---- card 0x80 ---------------------------------- */
2608 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2609 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2610 .name = "DViCO FusionHDTV DVB-T Lite",
2618 .tuner_type = UNSET,
2619 .tuner_addr = ADDR_UNSET,
2620 .radio_addr = ADDR_UNSET,
2622 [BTTV_BOARD_VGEAR_MYVCD] = {
2623 /* Steven <photon38@pchome.com.tw> */
2624 .name = "V-Gear MyVCD",
2630 .muxsel = {2, 3, 1, 0 },
2631 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2635 .tuner_type = TUNER_PHILIPS_NTSC_M,
2636 .tuner_addr = ADDR_UNSET,
2637 .radio_addr = ADDR_UNSET,
2640 [BTTV_BOARD_SUPER_TV] = {
2641 /* Rick C <cryptdragoon@gmail.com> */
2642 .name = "Super TV Tuner",
2647 .muxsel = { 2, 3, 1, 0 },
2648 .tuner_type = TUNER_PHILIPS_NTSC,
2649 .tuner_addr = ADDR_UNSET,
2650 .radio_addr = ADDR_UNSET,
2651 .gpiomask = 0x008007,
2652 .gpiomux = { 0, 0x000001,0,0 },
2656 [BTTV_BOARD_TIBET_CS16] = {
2657 /* Chris Fanning <video4linux@haydon.net> */
2658 .name = "Tibet Systems 'Progress DVR' CS16",
2663 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2668 .tuner_type = UNSET,
2669 .tuner_addr = ADDR_UNSET,
2670 .radio_addr = ADDR_UNSET,
2671 .muxsel_hook = tibetCS16_muxsel,
2673 [BTTV_BOARD_KODICOM_4400R] = {
2674 /* Bill Brack <wbrack@mmm.com.hk> */
2676 * Note that, because of the card's wiring, the "master"
2677 * BT878A chip (i.e. the one which controls the analog switch
2678 * and must use this card type) is the 2nd one detected. The
2679 * other 3 chips should use card type 0x85, whose description
2680 * follows this one. There is a EEPROM on the card (which is
2681 * connected to the I2C of one of those other chips), but is
2682 * not currently handled. There is also a facility for a
2683 * "monitor", which is also not currently implemented.
2685 .name = "Kodicom 4400R (master)",
2689 .tuner_type = UNSET,
2690 .tuner_addr = ADDR_UNSET,
2691 .radio_addr = ADDR_UNSET,
2693 /* GPIO bits 0-9 used for analog switch:
2694 * 00 - 03: camera selector
2695 * 04 - 06: channel (controller) selector
2696 * 07: data (1->on, 0->off)
2699 * bit 16 is input from sync separator for the channel
2701 .gpiomask = 0x0003ff,
2703 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2708 .muxsel_hook = kodicom4400r_muxsel,
2710 [BTTV_BOARD_KODICOM_4400R_SL] = {
2711 /* Bill Brack <wbrack@mmm.com.hk> */
2712 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2713 * one which controls the analog switch, and must use the card type)
2714 * is the 2nd one detected. The other 3 chips should use this card
2717 .name = "Kodicom 4400R (slave)",
2721 .tuner_type = UNSET,
2722 .tuner_addr = ADDR_UNSET,
2723 .radio_addr = ADDR_UNSET,
2725 .gpiomask = 0x010000,
2727 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2732 .muxsel_hook = kodicom4400r_muxsel,
2734 /* ---- card 0x86---------------------------------- */
2735 [BTTV_BOARD_ADLINK_RTV24] = {
2736 /* Michael Henson <mhenson@clarityvi.com> */
2737 /* Adlink RTV24 with special unlock codes */
2738 .name = "Adlink RTV24",
2743 .muxsel = { 2, 3, 1, 0 },
2744 .tuner_type = UNSET,
2745 .tuner_addr = ADDR_UNSET,
2746 .radio_addr = ADDR_UNSET,
2749 /* ---- card 0x87---------------------------------- */
2750 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2751 /* Michael Krufky <mkrufky@m1k.net> */
2752 .name = "DViCO FusionHDTV 5 Lite",
2754 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2755 .tuner_addr = ADDR_UNSET,
2756 .radio_addr = ADDR_UNSET,
2760 .muxsel = { 2, 3, 1 },
2761 .gpiomask = 0x00e00007,
2762 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2763 .gpiomute = 0x00c00007,
2769 /* ---- card 0x88---------------------------------- */
2770 [BTTV_BOARD_ACORP_Y878F] = {
2771 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2772 .name = "Acorp Y878F",
2777 .gpiomask = 0x01fe00,
2778 .muxsel = { 2, 3, 1, 1 },
2779 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2780 .gpiomute = 0x002000,
2783 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2784 .tuner_addr = 0xc1 >>1,
2785 .radio_addr = 0xc1 >>1,
2788 /* ---- card 0x89 ---------------------------------- */
2789 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2790 .name = "Conceptronic CTVFMi v2",
2795 .gpiomask = 0x001c0007,
2796 .muxsel = { 2, 3, 1, 1 },
2797 .gpiomux = { 0, 1, 2, 2 },
2801 .tuner_type = TUNER_TENA_9533_DI,
2802 .tuner_addr = ADDR_UNSET,
2803 .radio_addr = ADDR_UNSET,
2807 /* ---- card 0x8a ---------------------------------- */
2808 [BTTV_BOARD_PV_BT878P_2E] = {
2809 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2814 .gpiomask = 0x01fe00,
2815 .muxsel = { 2,3,1,1,-1 },
2816 .digital_mode = DIGITAL_MODE_CAMERA,
2817 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2818 .gpiomute = 0x12400,
2821 .tuner_type = TUNER_LG_PAL_FM,
2822 .tuner_addr = ADDR_UNSET,
2823 .radio_addr = ADDR_UNSET,
2826 /* ---- card 0x8b ---------------------------------- */
2827 [BTTV_BOARD_PV_M4900] = {
2828 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2829 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2835 .muxsel = { 2, 3, 1, 1 },
2836 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2840 .tuner_type = TUNER_YMEC_TVF_5533MF,
2841 .tuner_addr = ADDR_UNSET,
2842 .radio_addr = ADDR_UNSET,
2846 /* ---- card 0x8c ---------------------------------- */
2847 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2848 one external BNC composite input (mux 2)
2849 three internal composite inputs (unknown muxes)
2850 an 18-bit stereo A/D (CS5331A), which has:
2851 one external stereo unblanced (RCA) audio connection
2852 one (or 3?) internal stereo balanced (XLR) audio connection
2853 input is selected via gpio to a 14052B mux
2854 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2855 gain is controlled via an X9221A chip on the I2C bus @0x28
2856 sample rate is controlled via gpio to an MK1413S
2857 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2858 There is neither a tuner nor an svideo input. */
2859 [BTTV_BOARD_OSPREY440] = {
2860 .name = "Osprey 440",
2862 .audio_inputs = 2, /* this is meaningless */
2865 .muxsel = { 2, 3, 0, 1 }, /* 3,0,1 are guesses */
2867 .gpiomute = 0x000, /* int + 32kHz */
2868 .gpiomux = { 0, 0, 0x000, 0x100},
2870 .tuner_type = UNSET,
2871 .tuner_addr = ADDR_UNSET,
2872 .radio_addr = ADDR_UNSET,
2877 /* ---- card 0x8d ---------------------------------- */
2878 [BTTV_BOARD_ASOUND_SKYEYE] = {
2879 .name = "Asound Skyeye PCTV",
2885 .muxsel = { 2, 3, 1, 1 },
2886 .gpiomux = { 2, 0, 0, 0 },
2890 .tuner_type = TUNER_PHILIPS_NTSC,
2891 .tuner_addr = ADDR_UNSET,
2892 .radio_addr = ADDR_UNSET,
2894 /* ---- card 0x8e ---------------------------------- */
2895 [BTTV_BOARD_SABRENT_TVFM] = {
2896 .name = "Sabrent TV-FM (bttv version)",
2901 .gpiomask = 0x108007,
2902 .muxsel = { 2, 3, 1, 1 },
2903 .gpiomux = { 100000, 100002, 100002, 100000 },
2908 .tuner_type = TUNER_TNF_5335MF,
2909 .tuner_addr = ADDR_UNSET,
2912 /* ---- card 0x8f ---------------------------------- */
2913 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2914 .name = "Hauppauge ImpactVCB (bt878)",
2919 .gpiomask = 0x0f, /* old: 7 */
2920 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
2924 .tuner_type = UNSET,
2925 .tuner_addr = ADDR_UNSET,
2926 .radio_addr = ADDR_UNSET,
2928 [BTTV_BOARD_MACHTV_MAGICTV] = {
2929 /* Julian Calaby <julian.calaby@gmail.com>
2930 * Slightly different from original MachTV definition (0x60)
2932 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2933 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2934 * properly (methinks) causing no keyup bits being set */
2936 .name = "MagicTV", /* rebranded MachTV */
2942 .muxsel = { 2, 3, 1, 1 },
2943 .gpiomux = { 0, 1, 2, 3 },
2945 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2946 .tuner_addr = ADDR_UNSET,
2947 .radio_addr = ADDR_UNSET,
2952 [BTTV_BOARD_SSAI_SECURITY] = {
2953 .name = "SSAI Security Video Interface",
2958 .muxsel = { 0, 1, 2, 3 },
2959 .tuner_type = UNSET,
2960 .tuner_addr = ADDR_UNSET,
2961 .radio_addr = ADDR_UNSET,
2963 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2964 .name = "SSAI Ultrasound Video Interface",
2969 .muxsel = { 2, 0, 1, 3 },
2970 .tuner_type = UNSET,
2971 .tuner_addr = ADDR_UNSET,
2972 .radio_addr = ADDR_UNSET,
2974 /* ---- card 0x94---------------------------------- */
2975 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2976 .name = "DViCO FusionHDTV 2",
2978 .tuner_type = TUNER_PHILIPS_ATSC, /* FCV1236D */
2979 .tuner_addr = ADDR_UNSET,
2980 .radio_addr = ADDR_UNSET,
2984 .muxsel = { 2, 3, 1 },
2985 .gpiomask = 0x00e00007,
2986 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2987 .gpiomute = 0x00c00007,
2994 static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2996 /* ----------------------------------------------------------------------- */
2998 static unsigned char eeprom_data[256];
3003 void __devinit bttv_idcard(struct bttv *btv)
3005 unsigned int gpiobits;
3009 /* read PCI subsystem ID */
3010 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
3011 btv->cardid = tmp << 16;
3012 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
3015 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
3016 /* look for the card */
3017 for (type = -1, i = 0; cards[i].id != 0; i++)
3018 if (cards[i].id == btv->cardid)
3023 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
3024 "PCI subsystem ID is %04x:%04x\n",
3025 btv->c.nr,cards[type].name,cards[type].cardnr,
3026 btv->cardid & 0xffff,
3027 (btv->cardid >> 16) & 0xffff);
3028 btv->c.type = cards[type].cardnr;
3031 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
3032 btv->c.nr, btv->cardid & 0xffff,
3033 (btv->cardid >> 16) & 0xffff);
3034 printk(KERN_DEBUG "please mail id, board name and "
3035 "the correct card= insmod option to video4linux-list@redhat.com\n");
3039 /* let the user override the autodetected type */
3040 if (card[btv->c.nr] < bttv_num_tvcards)
3041 btv->c.type=card[btv->c.nr];
3043 /* print which card config we are using */
3044 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
3045 bttv_tvcards[btv->c.type].name, btv->c.type,
3046 card[btv->c.nr] < bttv_num_tvcards
3047 ? "insmod option" : "autodetected");
3049 /* overwrite gpio stuff ?? */
3050 if (UNSET == audioall && UNSET == audiomux[0])
3053 if (UNSET != audiomux[0]) {
3055 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3056 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
3057 gpiobits |= audiomux[i];
3060 gpiobits = audioall;
3061 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3062 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
3065 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3066 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3067 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
3068 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
3069 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
3075 * (most) board specific initialisations goes here
3078 /* Some Modular Technology cards have an eeprom, but no subsystem ID */
3079 static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
3083 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
3084 type = BTTV_BOARD_MODTEC_205;
3085 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
3086 type = BTTV_BOARD_EURESYS_PICOLO;
3087 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
3088 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
3092 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3093 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3097 static void flyvideo_gpio(struct bttv *btv)
3099 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3100 int tuner=UNSET,ttype;
3102 gpio_inout(0xffffff, 0);
3103 udelay(8); /* without this we would see the 0x1800 mask */
3105 /* FIXME: must restore OUR_EN ??? */
3107 /* all cards provide GPIO info, some have an additional eeprom
3108 * LR50: GPIO coding can be found lower right CP1 .. CP9
3109 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3111 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
3113 * lowest 3 bytes are remote control codes (no handshake needed)
3114 * xxxFFF: No remote control chip soldered
3115 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3116 * Note: Some bits are Audio_Mask !
3118 ttype=(gpio&0x0f0000)>>16;
3120 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
3122 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
3124 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
3126 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
3128 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
3131 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3134 has_remote = gpio & 0x800000;
3135 has_radio = gpio & 0x400000;
3136 /* unknown 0x200000;
3137 * unknown2 0x100000; */
3138 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
3139 has_tda9820_tda9821 = !(gpio & 0x004000);
3140 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3142 * gpio & 0x001000 output bit for audio routing */
3145 tuner = TUNER_ABSENT; /* No tuner present */
3147 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3148 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3149 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3150 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3151 is_capture_only?"yes":"no ");
3153 if (tuner != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3154 btv->tuner_type = tuner;
3155 btv->has_radio = has_radio;
3157 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3158 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3159 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
3160 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
3161 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
3164 static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3165 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3166 static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3167 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3169 static void miro_pinnacle_gpio(struct bttv *btv)
3174 gpio_inout(0xffffff, 0);
3176 id = ((gpio>>10) & 63) -1;
3177 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3179 btv->tuner_type = miro_tunermap[id];
3180 if (0 == (gpio & 0x20)) {
3182 if (!miro_fmtuner[id]) {
3183 btv->has_matchbox = 1;
3184 btv->mbox_we = (1<<6);
3185 btv->mbox_most = (1<<7);
3186 btv->mbox_clk = (1<<8);
3187 btv->mbox_data = (1<<9);
3188 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3194 if (btv->c.type == BTTV_BOARD_MIRO)
3195 btv->c.type = BTTV_BOARD_MIROPRO;
3196 if (btv->c.type == BTTV_BOARD_PINNACLE)
3197 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3200 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3201 btv->c.nr, id+1, btv->tuner_type,
3202 !btv->has_radio ? "no" :
3203 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3204 (-1 == msp) ? "no" : "yes");
3206 /* new cards with microtune tuner */
3211 info = "PAL / mono";
3212 btv->tda9887_conf = TDA9887_INTERCARRIER;
3215 info = "PAL+SECAM / stereo";
3217 btv->tda9887_conf = TDA9887_QSS;
3220 info = "NTSC / stereo";
3222 btv->tda9887_conf = TDA9887_QSS;
3225 info = "PAL+SECAM / mono";
3226 btv->tda9887_conf = TDA9887_QSS;
3229 info = "NTSC / mono";
3230 btv->tda9887_conf = TDA9887_INTERCARRIER;
3233 info = "NTSC / stereo";
3234 btv->tda9887_conf = TDA9887_INTERCARRIER;
3237 info = "PAL / stereo";
3238 btv->tda9887_conf = TDA9887_INTERCARRIER;
3241 info = "oops: unknown card";
3245 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3247 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3248 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3249 btv->tuner_type = TUNER_MT2032;
3253 /* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3254 #define LM1882_SYNC_DRIVE 0x200000L
3256 static void init_ids_eagle(struct bttv *btv)
3258 gpio_inout(0xffffff,0xFFFF37);
3259 gpio_write(0x200020);
3261 /* flash strobe inverter ?! */
3262 gpio_write(0x200024);
3264 /* switch sync drive off */
3265 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3267 /* set BT848 muxel to 2 */
3268 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3271 /* Muxsel helper for the IDS Eagle.
3272 * the eagles does not use the standard muxsel-bits but
3273 * has its own multiplexer */
3274 static void eagle_muxsel(struct bttv *btv, unsigned int input)
3276 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3277 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3280 /* set chroma ADC to sleep */
3281 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3282 /* set to composite video */
3283 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3284 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3286 /* switch sync drive off */
3287 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3290 static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3292 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3293 gpio_write(masks[input%4]);
3296 /* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3299 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3300 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3302 IN - sensor inputs, INx - sensor inputs and TI XORed together
3303 O1,O2,O3 - alarm outputs (relays)
3305 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3309 static void init_lmlbt4x(struct bttv *btv)
3311 printk(KERN_DEBUG "LMLBT4x init\n");
3312 btwrite(0x000000, BT848_GPIO_REG_INP);
3313 gpio_inout(0xffffff, 0x0006C0);
3314 gpio_write(0x000000);
3317 static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3319 unsigned int inmux = input % 8;
3320 gpio_inout( 0xf, 0xf );
3321 gpio_bits( 0xf, inmux );
3324 static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3326 unsigned int inmux = input % 4;
3327 gpio_inout( 3<<9, 3<<9 );
3328 gpio_bits( 3<<9, inmux<<9 );
3331 /* ----------------------------------------------------------------------- */
3333 static void bttv_reset_audio(struct bttv *btv)
3336 * BT878A has a audio-reset register.
3337 * 1. This register is an audio reset function but it is in
3338 * function-0 (video capture) address space.
3339 * 2. It is enough to do this once per power-up of the card.
3340 * 3. There is a typo in the Conexant doc -- it is not at
3341 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3342 * --//Shrikumar 030609
3348 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3349 btwrite((1<<7), 0x058);
3354 /* initialization part one -- before registering i2c bus */
3355 void __devinit bttv_init_card1(struct bttv *btv)
3357 switch (btv->c.type) {
3358 case BTTV_BOARD_HAUPPAUGE:
3359 case BTTV_BOARD_HAUPPAUGE878:
3360 boot_msp34xx(btv,5);
3362 case BTTV_BOARD_VOODOOTV_200:
3363 case BTTV_BOARD_VOODOOTV_FM:
3364 boot_msp34xx(btv,20);
3366 case BTTV_BOARD_AVERMEDIA98:
3367 boot_msp34xx(btv,11);
3369 case BTTV_BOARD_HAUPPAUGEPVR:
3372 case BTTV_BOARD_TWINHAN_DST:
3373 case BTTV_BOARD_AVDVBT_771:
3374 case BTTV_BOARD_PINNACLESAT:
3375 btv->use_i2c_hw = 1;
3377 case BTTV_BOARD_ADLINK_RTV24:
3382 if (!bttv_tvcards[btv->c.type].has_dvb)
3383 bttv_reset_audio(btv);
3386 /* initialization part two -- after registering i2c bus */
3387 void __devinit bttv_init_card2(struct bttv *btv)
3389 int addr=ADDR_UNSET;
3391 btv->tuner_type = UNSET;
3393 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3394 bttv_readee(btv,eeprom_data,0xa0);
3395 identify_by_eeprom(btv,eeprom_data);
3398 switch (btv->c.type) {
3399 case BTTV_BOARD_MIRO:
3400 case BTTV_BOARD_MIROPRO:
3401 case BTTV_BOARD_PINNACLE:
3402 case BTTV_BOARD_PINNACLEPRO:
3404 miro_pinnacle_gpio(btv);
3406 case BTTV_BOARD_FLYVIDEO_98:
3407 case BTTV_BOARD_MAXI:
3408 case BTTV_BOARD_LIFE_FLYKIT:
3409 case BTTV_BOARD_FLYVIDEO:
3410 case BTTV_BOARD_TYPHOON_TVIEW:
3411 case BTTV_BOARD_CHRONOS_VS2:
3412 case BTTV_BOARD_FLYVIDEO_98FM:
3413 case BTTV_BOARD_FLYVIDEO2000:
3414 case BTTV_BOARD_FLYVIDEO98EZ:
3415 case BTTV_BOARD_CONFERENCETV:
3416 case BTTV_BOARD_LIFETEC_9415:
3419 case BTTV_BOARD_HAUPPAUGE:
3420 case BTTV_BOARD_HAUPPAUGE878:
3421 case BTTV_BOARD_HAUPPAUGEPVR:
3422 /* pick up some config infos from the eeprom */
3423 bttv_readee(btv,eeprom_data,0xa0);
3424 hauppauge_eeprom(btv);
3426 case BTTV_BOARD_AVERMEDIA98:
3427 case BTTV_BOARD_AVPHONE98:
3428 bttv_readee(btv,eeprom_data,0xa0);
3429 avermedia_eeprom(btv);
3431 case BTTV_BOARD_PXC200:
3434 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3435 picolo_tetra_init(btv);
3437 case BTTV_BOARD_VHX:
3439 btv->has_matchbox = 1;
3440 btv->mbox_we = 0x20;
3442 btv->mbox_clk = 0x08;
3443 btv->mbox_data = 0x10;
3444 btv->mbox_mask = 0x38;
3446 case BTTV_BOARD_VOBIS_BOOSTAR:
3447 case BTTV_BOARD_TERRATV:
3448 terratec_active_radio_upgrade(btv);
3450 case BTTV_BOARD_MAGICTVIEW061:
3451 if (btv->cardid == 0x3002144f) {
3453 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3456 case BTTV_BOARD_STB2:
3457 if (btv->cardid == 0x3060121a) {
3458 /* Fix up entry for 3DFX VoodooTV 100,
3459 which is an OEM STB card variant. */
3461 btv->tuner_type=TUNER_TEMIC_NTSC;
3464 case BTTV_BOARD_OSPREY1x0:
3465 case BTTV_BOARD_OSPREY1x0_848:
3466 case BTTV_BOARD_OSPREY101_848:
3467 case BTTV_BOARD_OSPREY1x1:
3468 case BTTV_BOARD_OSPREY1x1_SVID:
3469 case BTTV_BOARD_OSPREY2xx:
3470 case BTTV_BOARD_OSPREY2x0_SVID:
3471 case BTTV_BOARD_OSPREY2x0:
3472 case BTTV_BOARD_OSPREY440:
3473 case BTTV_BOARD_OSPREY500:
3474 case BTTV_BOARD_OSPREY540:
3475 case BTTV_BOARD_OSPREY2000:
3476 bttv_readee(btv,eeprom_data,0xa0);
3477 osprey_eeprom(btv, eeprom_data);
3479 case BTTV_BOARD_IDS_EAGLE:
3480 init_ids_eagle(btv);
3482 case BTTV_BOARD_MODTEC_205:
3483 bttv_readee(btv,eeprom_data,0xa0);
3486 case BTTV_BOARD_LMLBT4:
3489 case BTTV_BOARD_TIBET_CS16:
3490 tibetCS16_init(btv);
3492 case BTTV_BOARD_KODICOM_4400R:
3493 kodicom4400r_init(btv);
3497 /* pll configuration */
3498 if (!(btv->id==848 && btv->revision==0x11)) {
3499 /* defaults from card list */
3500 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3501 btv->pll.pll_ifreq=28636363;
3502 btv->pll.pll_crystal=BT848_IFORM_XT0;
3504 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3505 btv->pll.pll_ifreq=35468950;
3506 btv->pll.pll_crystal=BT848_IFORM_XT1;
3508 /* insmod options can override */
3509 switch (pll[btv->c.nr]) {
3511 btv->pll.pll_crystal = 0;
3512 btv->pll.pll_ifreq = 0;
3513 btv->pll.pll_ofreq = 0;
3515 case 1: /* 28 MHz */
3517 btv->pll.pll_ifreq = 28636363;
3518 btv->pll.pll_ofreq = 0;
3519 btv->pll.pll_crystal = BT848_IFORM_XT0;
3521 case 2: /* 35 MHz */
3523 btv->pll.pll_ifreq = 35468950;
3524 btv->pll.pll_ofreq = 0;
3525 btv->pll.pll_crystal = BT848_IFORM_XT1;
3529 btv->pll.pll_current = -1;
3531 /* tuner configuration (from card list / autodetect / insmod option) */
3532 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3533 addr = bttv_tvcards[btv->c.type].tuner_addr;
3535 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3536 if(UNSET == btv->tuner_type)
3537 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3538 if (UNSET != tuner[btv->c.nr])
3539 btv->tuner_type = tuner[btv->c.nr];
3541 if (btv->tuner_type == TUNER_ABSENT ||
3542 bttv_tvcards[btv->c.type].tuner == UNSET)
3543 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3544 else if(btv->tuner_type == UNSET)
3545 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3547 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3550 if (btv->tuner_type != UNSET) {
3551 struct tuner_setup tun_setup;
3553 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
3554 tun_setup.type = btv->tuner_type;
3555 tun_setup.addr = addr;
3557 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3560 if (btv->tda9887_conf) {
3561 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3562 &btv->tda9887_conf);
3565 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3566 if (svhs[btv->c.nr] != UNSET)
3567 btv->svhs = svhs[btv->c.nr];
3568 if (remote[btv->c.nr] != UNSET)
3569 btv->has_remote = remote[btv->c.nr];
3571 if (bttv_tvcards[btv->c.type].has_radio)
3573 if (bttv_tvcards[btv->c.type].has_remote)
3575 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3577 if (bttv_tvcards[btv->c.type].audio_hook)
3578 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3580 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3581 /* detect Bt832 chip for quartzsight digital camera */
3582 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3583 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
3590 if (bttv_tvcards[btv->c.type].tuner == UNSET)
3591 return; /* no tuner or related drivers to load */
3593 /* try to detect audio/fader chips */
3594 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3595 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
3596 request_module("msp3400");
3598 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3599 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3600 request_module("msp3400");
3602 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3603 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
3604 request_module("tda9875");
3606 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3607 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
3608 request_module("tda7432");
3610 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3611 request_module("tvaudio");
3613 if (btv->tuner_type != UNSET && btv->tuner_type != TUNER_ABSENT)
3614 request_module("tuner");
3618 /* ----------------------------------------------------------------------- */
3620 static void modtec_eeprom(struct bttv *btv)
3622 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3623 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3624 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3625 btv->c.nr,&eeprom_data[0x1e]);
3626 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3627 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3628 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3629 btv->c.nr,&eeprom_data[0x1e]);
3630 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3631 btv->tuner_type=TUNER_PHILIPS_NTSC;
3632 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3633 btv->c.nr,&eeprom_data[0x1e]);
3635 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3636 btv->c.nr,&eeprom_data[0x1e]);
3640 static void __devinit hauppauge_eeprom(struct bttv *btv)
3644 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
3645 btv->tuner_type = tv.tuner_type;
3646 btv->has_radio = tv.has_radio;
3648 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3649 btv->c.nr, tv.model);
3652 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3653 * type based on model #.
3655 if(tv.model == 64900) {
3656 printk("bttv%d: Switching board type from %s to %s\n",
3658 bttv_tvcards[btv->c.type].name,
3659 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3660 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3664 static int terratec_active_radio_upgrade(struct bttv *btv)
3669 btv->has_matchbox = 1;
3670 btv->mbox_we = 0x10;
3671 btv->mbox_most = 0x20;
3672 btv->mbox_clk = 0x08;
3673 btv->mbox_data = 0x04;
3674 btv->mbox_mask = 0x3c;
3676 btv->mbox_iow = 1 << 8;
3677 btv->mbox_ior = 1 << 9;
3678 btv->mbox_csel = 1 << 10;
3681 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
3682 if (0x1ed8 == tea5757_read(btv)) {
3683 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3686 btv->has_matchbox = 1;
3689 btv->has_matchbox = 0;
3695 /* ----------------------------------------------------------------------- */
3698 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3700 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3701 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3702 * unpacked with unzip).
3704 #define PVR_GPIO_DELAY 10
3706 #define BTTV_ALT_DATA 0x000001
3707 #define BTTV_ALT_DCLK 0x100000
3708 #define BTTV_ALT_NCONFIG 0x800000
3710 static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3716 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3718 udelay(PVR_GPIO_DELAY);
3720 gpio_write(BTTV_ALT_NCONFIG);
3721 udelay(PVR_GPIO_DELAY);
3723 for (n = 0; n < microlen; n++) {
3725 for (i = 0 ; i < 8 ; i++) {
3726 gpio_bits(BTTV_ALT_DCLK,0);
3728 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3730 gpio_bits(BTTV_ALT_DATA,0);
3731 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3735 gpio_bits(BTTV_ALT_DCLK,0);
3736 udelay(PVR_GPIO_DELAY);
3738 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3739 for (i = 0 ; i < 30 ; i++) {
3740 gpio_bits(BTTV_ALT_DCLK,0);
3741 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3743 gpio_bits(BTTV_ALT_DCLK,0);
3747 static int __devinit pvr_boot(struct bttv *btv)
3749 const struct firmware *fw_entry;
3752 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3754 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3758 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3759 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3760 btv->c.nr, (rc < 0) ? "failed" : "ok");
3761 release_firmware(fw_entry);
3765 /* ----------------------------------------------------------------------- */
3766 /* some osprey specific stuff */
3768 static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
3774 /* This code will nevery actually get called in this case.... */
3775 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3776 /* this might be an antique... check for MMAC label in eeprom */
3777 if (!strncmp(ee, "MMAC", 4)) {
3779 for (i = 0; i < 21; i++)
3781 if (checksum != ee[21])
3783 cardid = BTTV_BOARD_OSPREY1x0_848;
3784 for (i = 12; i < 21; i++)
3785 serial *= 10, serial += ee[i] - '0';
3788 unsigned short type;
3790 for (i = 4*16; i < 8*16; i += 16) {
3791 u16 checksum = ip_compute_csum(ee + i, 16);
3793 if ((checksum&0xff) + (checksum>>8) == 0xff)
3800 /* found a valid descriptor */
3801 type = be16_to_cpup((u16*)(ee+4));
3806 cardid = BTTV_BOARD_OSPREY1x0_848;
3809 cardid = BTTV_BOARD_OSPREY101_848;
3815 cardid = BTTV_BOARD_OSPREY1x0;
3819 cardid = BTTV_BOARD_OSPREY1x1;
3824 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3830 cardid = BTTV_BOARD_OSPREY2xx;
3834 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3837 cardid = BTTV_BOARD_OSPREY500;
3841 cardid = BTTV_BOARD_OSPREY540;
3842 /* bttv_osprey_540_init(btv); */
3847 cardid = BTTV_BOARD_OSPREY2x0;
3848 /* enable output on select control lines */
3849 gpio_inout(0xffffff,0x000303);
3852 cardid = BTTV_BOARD_OSPREY440;
3855 /* unknown...leave generic, but get serial # */
3856 printk(KERN_INFO "bttv%d: "
3857 "osprey eeprom: unknown card type 0x%04x\n",
3861 serial = be32_to_cpup((u32*)(ee+6));
3864 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
3866 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3868 if (cardid<0 || btv->c.type == cardid)
3871 /* card type isn't set correctly */
3872 if (card[btv->c.nr] < bttv_num_tvcards) {
3873 printk(KERN_WARNING "bttv%d: osprey eeprom: "
3874 "Not overriding user specified card type\n", btv->c.nr);
3876 printk(KERN_INFO "bttv%d: osprey eeprom: "
3877 "Changing card type from %d to %d\n", btv->c.nr,
3878 btv->c.type, cardid);
3879 btv->c.type = cardid;
3883 /* ----------------------------------------------------------------------- */
3884 /* AVermedia specific stuff, from bktr_card.c */
3886 static int tuner_0_table[] = {
3887 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3888 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3889 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3890 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3891 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3892 TUNER_PHILIPS_FM1216ME_MK3 };
3894 static int tuner_1_table[] = {
3895 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3896 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3897 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3898 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3899 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3901 static void __devinit avermedia_eeprom(struct bttv *btv)
3903 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3905 tuner_make = (eeprom_data[0x41] & 0x7);
3906 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3907 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3908 btv->has_remote = (eeprom_data[0x42] & 0x01);
3910 if (tuner_make == 0 || tuner_make == 2)
3911 if(tuner_format <=0x0a)
3912 tuner = tuner_0_table[tuner_format];
3913 if (tuner_make == 1)
3914 if(tuner_format <=9)
3915 tuner = tuner_1_table[tuner_format];
3917 if (tuner_make == 4)
3918 if(tuner_format == 0x09)
3919 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
3921 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3922 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3924 btv->tuner_type=tuner;
3927 printk("Unknown type");
3928 printk(" radio:%s remote control:%s\n",
3929 tuner_tv_fm ? "yes" : "no",
3930 btv->has_remote ? "yes" : "no");
3933 /* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3934 void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3936 /* fix up our card entry */
3937 if(norm==VIDEO_MODE_NTSC) {
3938 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3939 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
3940 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3941 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x957fff;
3942 dprintk("bttv_tda9880_setnorm to NTSC\n");
3945 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3946 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
3947 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3948 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x947fff;
3949 dprintk("bttv_tda9880_setnorm to PAL\n");
3951 /* set GPIO according */
3952 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3953 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
3958 * reset/enable the MSP on some Hauppauge cards
3959 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3964 static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3966 int mask = (1 << pin);
3968 gpio_inout(mask,mask);
3971 gpio_bits(mask,mask);
3974 bttv_gpio_tracking(btv,"msp34xx");
3976 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3977 "init [%d]\n", btv->c.nr, pin);
3980 static void __devinit boot_bt832(struct bttv *btv)
3984 /* ----------------------------------------------------------------------- */
3985 /* Imagenation L-Model PXC200 Framegrabber */
3986 /* This is basically the same procedure as
3987 * used by Alessandro Rubini in his pxc200
3988 * driver, but using BTTV functions */
3990 static void __devinit init_PXC200(struct bttv *btv)
3992 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3993 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3999 /* Initialise GPIO-connevted stuff */
4000 gpio_inout(0xffffff, (1<<13));
4004 /* GPIO inputs are pulled up, so no need to drive
4005 * reset pin any longer */
4006 gpio_bits(0xffffff, 0);
4008 bttv_gpio_tracking(btv,"pxc200");
4010 /* we could/should try and reset/control the AD pots? but
4011 right now we simply turned off the crushing. Without
4012 this the AGC drifts drifts
4013 remember the EN is reverse logic -->
4014 setting BT848_ADC_AGC_EN disable the AGC
4015 tboult@eecs.lehigh.edu
4018 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4020 /* Initialise MAX517 DAC */
4021 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
4022 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4024 /* Initialise 12C508 PIC */
4025 /* The I2CWrite and I2CRead commmands are actually to the
4026 * same chips - but the R/W bit is included in the address
4027 * argument so the numbers are different */
4030 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
4032 /* First of all, enable the clock line. This is used in the PXC200-F */
4033 val = btread(BT848_GPIO_DMA_CTL);
4034 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4035 btwrite(val, BT848_GPIO_DMA_CTL);
4037 /* Then, push to 0 the reset pin long enough to reset the *
4038 * device same as above for the reset line, but not the same
4039 * value sent to the GPIO-connected stuff
4040 * which one is the good one? */
4041 gpio_inout(0xffffff,(1<<2));
4046 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4047 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4050 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4051 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4055 printk(KERN_INFO "PXC200 Initialised.\n");
4060 /* ----------------------------------------------------------------------- */
4062 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4063 * it. This apparently involves the following procedure for each 878 chip:
4065 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4067 * 2) write to GPIO_DATA
4073 * read from GPIO_DATA into buf (uint_32)
4074 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4075 * error. ERROR_CPLD_Check_Failed stop.
4077 * 3) write to GPIO_DATA
4078 * - write 0x4400 + 0x0E
4080 * - write 0x4410 + 0x0E
4083 * read from GPIO_DATA into buf (uint_32)
4084 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
4085 * error. ERROR_CPLD_Check_Failed.
4087 /* ----------------------------------------------------------------------- */
4089 init_RTV24 (struct bttv *btv)
4091 uint32_t dataRead = 0;
4092 long watchdog_value = 0x0E;
4095 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
4098 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4100 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4102 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4104 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4106 dataRead = btread (BT848_GPIO_DATA);
4108 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4110 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4111 btv->c.nr, dataRead);
4114 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4116 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4118 btwrite (watchdog_value, BT848_GPIO_DATA);
4120 dataRead = btread (BT848_GPIO_DATA);
4122 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4124 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4125 btv->c.nr, dataRead);
4131 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
4136 /* ----------------------------------------------------------------------- */
4137 /* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4139 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4140 * This code is placed under the terms of the GNU General Public License
4142 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4145 static void bus_low(struct bttv *btv, int bit)
4147 if (btv->mbox_ior) {
4148 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4149 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4156 if (btv->mbox_ior) {
4157 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4162 static void bus_high(struct bttv *btv, int bit)
4164 if (btv->mbox_ior) {
4165 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4166 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4173 if (btv->mbox_ior) {
4174 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4179 static int bus_in(struct bttv *btv, int bit)
4181 if (btv->mbox_ior) {
4182 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4183 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4186 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4189 return gpio_read() & (bit);
4192 /* TEA5757 register bits */
4193 #define TEA_FREQ 0:14
4194 #define TEA_BUFFER 15:15
4196 #define TEA_SIGNAL_STRENGTH 16:17
4198 #define TEA_PORT1 18:18
4199 #define TEA_PORT0 19:19
4201 #define TEA_BAND 20:21
4202 #define TEA_BAND_FM 0
4203 #define TEA_BAND_MW 1
4204 #define TEA_BAND_LW 2
4205 #define TEA_BAND_SW 3
4207 #define TEA_MONO 22:22
4208 #define TEA_ALLOW_STEREO 0
4209 #define TEA_FORCE_MONO 1
4211 #define TEA_SEARCH_DIRECTION 23:23
4212 #define TEA_SEARCH_DOWN 0
4213 #define TEA_SEARCH_UP 1
4215 #define TEA_STATUS 24:24
4216 #define TEA_STATUS_TUNED 0
4217 #define TEA_STATUS_SEARCHING 1
4219 /* Low-level stuff */
4220 static int tea5757_read(struct bttv *btv)
4222 unsigned long timeout;
4226 /* better safe than sorry */
4227 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4229 if (btv->mbox_ior) {
4230 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4231 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4236 bttv_gpio_tracking(btv,"tea5757 read");
4238 bus_low(btv,btv->mbox_we);
4239 bus_low(btv,btv->mbox_clk);
4242 timeout= jiffies + msecs_to_jiffies(1000);
4244 /* wait for DATA line to go low; error if it doesn't */
4245 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4247 if (bus_in(btv,btv->mbox_data)) {
4248 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4252 dprintk("bttv%d: tea5757:",btv->c.nr);
4253 for (i = 0; i < 24; i++) {
4255 bus_high(btv,btv->mbox_clk);
4257 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4258 bus_low(btv,btv->mbox_clk);
4260 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4261 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4263 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4267 static int tea5757_write(struct bttv *btv, int value)
4272 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4274 if (btv->mbox_ior) {
4275 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4276 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4280 bttv_gpio_tracking(btv,"tea5757 write");
4282 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4283 bus_low(btv,btv->mbox_clk);
4284 bus_high(btv,btv->mbox_we);
4285 for (i = 0; i < 25; i++) {
4286 if (reg & 0x1000000)
4287 bus_high(btv,btv->mbox_data);
4289 bus_low(btv,btv->mbox_data);
4291 bus_high(btv,btv->mbox_clk);
4293 bus_low(btv,btv->mbox_clk);
4296 bus_low(btv,btv->mbox_we); /* unmute !!! */
4300 void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4302 dprintk("tea5757_set_freq %d\n",freq);
4303 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
4307 /* ----------------------------------------------------------------------- */
4310 static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4312 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4313 int bits_out, loops, vol, data;
4316 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4317 v->flags |= VIDEO_AUDIO_VOLUME;
4321 /* 32 levels logarithmic */
4322 vol = 32 - ((v->volume>>11));
4324 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4326 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4327 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4329 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4330 WINVIEW_PT2254_STROBE);
4331 for (loops = 17; loops >= 0 ; loops--) {
4332 if (bits_out & (1<<loops))
4333 data |= WINVIEW_PT2254_DATA;
4335 data &= ~WINVIEW_PT2254_DATA;
4338 data |= WINVIEW_PT2254_CLK;
4341 data &= ~WINVIEW_PT2254_CLK;
4344 data |= WINVIEW_PT2254_STROBE;
4345 data &= ~WINVIEW_PT2254_DATA;
4348 data &= ~WINVIEW_PT2254_STROBE;
4352 /* ----------------------------------------------------------------------- */
4353 /* mono/stereo control for various cards (which don't use i2c chips but */
4354 /* connect something to the GPIO pins */
4357 gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4359 unsigned int con = 0;
4362 gpio_inout(0x300, 0x300);
4363 if (v->mode & VIDEO_SOUND_LANG1)
4365 if (v->mode & VIDEO_SOUND_LANG2)
4367 if (v->mode & VIDEO_SOUND_STEREO)
4369 /* if (v->mode & VIDEO_SOUND_MONO)
4371 gpio_bits(0x300, con);
4373 v->mode = VIDEO_SOUND_STEREO |
4374 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4379 gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4381 unsigned int val, con;
4383 if (btv->radio_user)
4389 if (v->mode & VIDEO_SOUND_LANG2) {
4390 if (v->mode & VIDEO_SOUND_LANG1) {
4399 if (con != (val & 0x300)) {
4400 gpio_bits(0x300, con);
4402 bttv_gpio_tracking(btv,"gvbctv5pci");
4405 switch (val & 0x70) {
4407 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4410 v->mode = VIDEO_SOUND_LANG2;
4413 v->mode = VIDEO_SOUND_LANG1;
4416 v->mode = VIDEO_SOUND_STEREO;
4419 v->mode = VIDEO_SOUND_MONO;
4422 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4423 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4429 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4430 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4431 * 0xdde enables mono and 0xccd enables sap
4433 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4434 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4435 * input/output sound connection, so both must be set for output mode.
4437 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4438 * handles this with a tda9840
4442 avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4447 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4449 if (v->mode & VIDEO_SOUND_STEREO)
4452 gpio_bits(0x03,val);
4454 bttv_gpio_tracking(btv,"avermedia");
4457 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4464 avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4469 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4471 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4473 btaor(val, ~0x03, BT848_GPIO_DATA);
4475 bttv_gpio_tracking(btv,"avermedia");
4477 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4478 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4483 /* Lifetec 9415 handling */
4485 lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4489 if (gpio_read() & 0x4000) {
4490 v->mode = VIDEO_SOUND_MONO;
4495 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4497 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4499 if ((v->mode & VIDEO_SOUND_LANG1) ||
4500 (v->mode & VIDEO_SOUND_MONO))
4502 gpio_bits(0x0880, val);
4504 bttv_gpio_tracking(btv,"lt9415");
4506 /* autodetect doesn't work with this card :-( */
4507 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4508 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4513 /* TDA9821 on TerraTV+ Bt848, Bt878 */
4515 terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4517 unsigned int con = 0;
4520 gpio_inout(0x180000,0x180000);
4521 if (v->mode & VIDEO_SOUND_LANG2)
4523 if (v->mode & VIDEO_SOUND_STEREO)
4525 gpio_bits(0x180000, con);
4527 bttv_gpio_tracking(btv,"terratv");
4529 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4530 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4535 winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4537 unsigned long val = 0;
4540 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4541 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4543 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4545 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4547 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4550 gpio_bits(0x430000, val);
4552 bttv_gpio_tracking(btv,"winfast2000");
4555 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4556 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4561 * Dariusz Kowalewski <darekk@automex.pl>
4562 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4563 * revision 9B has on-board TDA9874A sound decoder).
4565 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4566 * will mute this cards.
4569 pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4571 unsigned int val = 0;
4573 if (btv->radio_user)
4577 if (v->mode & VIDEO_SOUND_MONO) {
4580 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4581 || (v->mode & VIDEO_SOUND_STEREO)) {
4585 gpio_bits(0x03,val);
4587 bttv_gpio_tracking(btv,"pvbt878p9b");
4590 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4591 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4596 * Dariusz Kowalewski <darekk@automex.pl>
4597 * sound control for FlyVideo 2000S (with tda9874 decoder)
4598 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4601 fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4603 unsigned int val = 0xffff;
4605 if (btv->radio_user)
4608 if (v->mode & VIDEO_SOUND_MONO) {
4611 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4612 || (v->mode & VIDEO_SOUND_STEREO)) {
4613 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
4615 if (val != 0xffff) {
4616 gpio_bits(0x1800, val);
4618 bttv_gpio_tracking(btv,"fv2000s");
4621 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4622 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4627 * sound control for Canopus WinDVR PCI
4628 * Masaki Suzuki <masaki@btree.org>
4631 windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4633 unsigned long val = 0;
4636 if (v->mode & VIDEO_SOUND_MONO)
4638 if (v->mode & VIDEO_SOUND_LANG1)
4640 if (v->mode & VIDEO_SOUND_LANG2)
4642 if (v->mode & VIDEO_SOUND_STEREO)
4645 gpio_bits(0x140000, val);
4647 bttv_gpio_tracking(btv,"windvr");
4650 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4651 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4656 * sound control for AD-TVK503
4657 * Hiroshi Takekawa <sian@big.or.jp>
4660 adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4662 unsigned int con = 0xffffff;
4664 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
4667 /* btor(***, BT848_GPIO_OUT_EN); */
4668 if (v->mode & VIDEO_SOUND_LANG1)
4670 if (v->mode & VIDEO_SOUND_LANG2)
4672 if (v->mode & VIDEO_SOUND_STEREO)
4674 if (v->mode & VIDEO_SOUND_MONO)
4676 if (con != 0xffffff) {
4677 gpio_bits(0x1e0000,con);
4679 bttv_gpio_tracking(btv, "adtvk503");
4682 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4683 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4687 /* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4689 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4690 * switch instead (CD22M3494E). This IC can have multiple active connections
4691 * between Xn (input) and Yn (output) pins. We need to clear any existing
4692 * connection prior to establish a new one, pulsing the STROBE pin.
4694 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4695 * GPIO pins are wired as:
4696 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4697 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4698 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4699 * GPIO[8] - - P3[5] (microcontroler)
4700 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4701 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4702 * GPINTR - - P3[4] (microcontroler)
4704 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4705 * configuration either directly (as we are doing) or using the microcontroler
4706 * which is also wired to I2C interface. I have no further info on the
4707 * microcontroler features, one would need to disassembly the firmware.
4708 * note: the vendor refused to give any information on this product, all
4709 * that stuff was found using a multimeter! :)
4711 static void rv605_muxsel(struct bttv *btv, unsigned int input)
4713 /* reset all conections */
4714 gpio_bits(0x200,0x200);
4716 gpio_bits(0x200,0x000);
4719 /* create a new conection */
4720 gpio_bits(0x480,0x080);
4721 gpio_bits(0x480,0x480);
4723 gpio_bits(0x480,0x080);
4727 /* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4729 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4730 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4731 * chips, ten eight input analog multiplexors, a not chip and a few
4734 * 16 inputs on a secondary bracket are provided and can be selected
4735 * from each of the four capture chips. Two of the eight input
4736 * multiplexors are used to select from any of the 16 input signals.
4738 * Unsupported hardware capabilities:
4739 * . A video output monitor on the secondary bracket can be selected from
4740 * one of the 878A chips.
4741 * . Another passthrough but I haven't spent any time investigating it.
4742 * . Digital I/O (logic level connected to GPIO) is available from an
4745 * The on chip input mux should always be set to 2.
4746 * GPIO[16:19] - Video input selection
4747 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4748 * GPIO[?:?] - Digital I/O.
4750 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4751 * determined what function (if any) it provides. With the microcontroller
4752 * and sync seperator chips a guess is that it might have to do with video
4753 * switching and maybe some digital I/O.
4755 static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4758 gpio_bits(0x0f0000, input << 16);
4761 static void tibetCS16_init(struct bttv *btv)
4763 /* enable gpio bits, mask obtained via btSpy */
4764 gpio_inout(0xffffff, 0x0f7fff);
4765 gpio_write(0x0f7fff);
4769 * The following routines for the Kodicom-4400r get a little mind-twisting.
4770 * There is a "master" controller and three "slave" controllers, together
4771 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4772 * The analog switch is controlled by the "master", but the detection order
4773 * of the four BT878A chips is in an order which I just don't understand.
4774 * The "master" is actually the second controller to be detected. The
4775 * logic on the board uses logical numbers for the 4 controlers, but
4776 * those numbers are different from the detection sequence. When working
4777 * with the analog switch, we need to "map" from the detection sequence
4778 * over to the board's logical controller number. This mapping sequence
4779 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4780 * unit 3, the second (which is the master) is logical unit 0, etc.
4781 * We need to maintain the status of the analog switch (which of the 16
4782 * cameras is connected to which of the 4 controllers). Rather than
4783 * add to the bttv structure for this, we use the data reserved for
4784 * the mbox (unused for this card type).
4788 * First a routine to set the analog switch, which controls which camera
4789 * is routed to which controller. The switch comprises an X-address
4790 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4791 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4792 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4793 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4794 * specified address. The idea is to set the address and data, then bring
4795 * STROBE high, and finally bring STROBE back to low.
4797 static void kodicom4400r_write(struct bttv *btv,
4798 unsigned char xaddr,
4799 unsigned char yaddr,
4800 unsigned char data) {
4803 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4804 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4805 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4806 gpio_bits(0x1ff, udata); /* strobe low */
4810 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4811 * use this routine. The routine finds the "master" for the card, maps
4812 * the controller number from the detected position over to the logical
4813 * number, writes the appropriate data to the analog switch, and housekeeps
4814 * the local copy of the switch information. The parameter 'input' is the
4815 * requested camera number (0 - 15).
4817 static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4822 static unsigned char map[4] = {3, 0, 2, 1};
4824 mctlr = master[btv->c.nr];
4825 if (mctlr == NULL) { /* ignore if master not yet detected */
4828 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4830 sw_status = (char *)(&mctlr->mbox_we);
4831 xaddr = input & 0xf;
4832 /* Check if the controller/camera pair has changed, else ignore */
4833 if (sw_status[yaddr] != xaddr)
4835 /* "open" the old switch, "close" the new one, save the new */
4836 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4837 sw_status[yaddr] = xaddr;
4838 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4843 * During initialisation, we need to reset the analog switch. We
4844 * also preset the switch to map the 4 connectors on the card to the
4845 * *user's* (see above description of kodicom4400r_muxsel) channels
4848 static void kodicom4400r_init(struct bttv *btv)
4850 char *sw_status = (char *)(&btv->mbox_we);
4853 gpio_inout(0x0003ff, 0x0003ff);
4854 gpio_write(1 << 9); /* reset MUX */
4856 /* Preset camera 0 to the 4 controllers */
4857 for (ix = 0; ix < 4; ix++) {
4859 kodicom4400r_write(btv, ix, ix, 1);
4862 * Since this is the "master", we need to set up the
4863 * other three controller chips' pointers to this structure
4864 * for later use in the muxsel routine.
4866 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4868 master[btv->c.nr-1] = btv;
4869 master[btv->c.nr] = btv;
4870 master[btv->c.nr+1] = btv;
4871 master[btv->c.nr+2] = btv;
4874 /* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4875 * video multiplexers to provide up to 16 video inputs. These
4876 * multiplexers are controlled by the lower 8 GPIO pins of the
4877 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
4879 * xxx0 is pin xxx of multiplexer U5,
4880 * yyy1 is pin yyy of multiplexer U2
4892 static void xguard_muxsel(struct bttv *btv, unsigned int input)
4894 static const int masks[] = {
4895 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4896 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4897 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4898 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4900 gpio_write(masks[input%16]);
4902 static void picolo_tetra_init(struct bttv *btv)
4904 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4905 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4906 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4908 static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4911 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4912 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4913 /*GPIO[20]&GPIO[21] used to choose the right input*/
4914 btwrite (input<<20,BT848_GPIO_DATA);
4919 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4921 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4922 * swichers to provide 16 channels to MUX0. The TDA8540's have
4923 * 4 independent outputs and as such the IVC120G also has the
4924 * optional "Monitor Out" bus. This allows the card to be looking
4925 * at one input while the monitor is looking at another.
4927 * Since I've couldn't be bothered figuring out how to add an
4928 * independant muxsel for the monitor bus, I've just set it to
4929 * whatever the card is looking at.
4931 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4932 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4934 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4935 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4936 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4937 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4941 /* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4942 #define I2C_TDA8540 0x90
4943 #define I2C_TDA8540_ALT1 0x92
4944 #define I2C_TDA8540_ALT2 0x94
4945 #define I2C_TDA8540_ALT3 0x96
4946 #define I2C_TDA8540_ALT4 0x98
4947 #define I2C_TDA8540_ALT5 0x9a
4948 #define I2C_TDA8540_ALT6 0x9c
4950 static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4953 int key = input % 4;
4954 int matrix = input / 4;
4956 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4957 btv->c.nr, input, matrix, key);
4959 /* Handles the input selection on the TDA8540's */
4960 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4961 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4962 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4963 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4964 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4965 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4966 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4967 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4969 /* Handles the output enables on the TDA8540's */
4970 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4971 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
4972 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4973 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
4974 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4975 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
4976 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4977 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
4979 /* Selects MUX0 for input on the 878 */
4980 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4984 /* PXC200 muxsel helper
4985 * luke@syseng.anu.edu.au
4986 * another transplant
4987 * from Alessandro Rubini (rubini@linux.it)
4989 * There are 4 kinds of cards:
4990 * PXC200L which is bt848
4991 * PXC200F which is bt848 with PIC controlling mux
4992 * PXC200AL which is bt878
4993 * PXC200AF which is bt878 with PIC controlling mux
4995 #define PX_CFG_PXC200F 0x01
4996 #define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4997 #define PX_I2C_PIC 0x0f
4998 #define PX_PXC200A_CARDID 0x200a1295
4999 #define PX_I2C_CMD_CFG 0x00
5001 static void PXC200_muxsel(struct bttv *btv, unsigned int input)
5006 unsigned char buf[2];
5008 /* Read PIC config to determine if this is a PXC200F */
5012 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
5014 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
5015 /* not PXC ? do nothing */
5019 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
5020 if (!(rc & PX_CFG_PXC200F)) {
5021 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
5026 /* The multiplexer in the 200F is handled by the GPIO port */
5027 /* get correct mapping between inputs */
5028 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
5029 /* ** not needed!? */
5032 /* make sure output pins are enabled */
5033 /* bitmask=0x30f; */
5035 /* check whether we have a PXC200A */
5036 if (btv->cardid == PX_PXC200A_CARDID) {
5037 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
5038 bitmask |= 7<<4; /* the DAC */
5040 btwrite(bitmask, BT848_GPIO_OUT_EN);
5042 bitmask = btread(BT848_GPIO_DATA);
5043 if (btv->cardid == PX_PXC200A_CARDID)
5044 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
5045 else /* older device */
5046 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
5047 btwrite(bitmask,BT848_GPIO_DATA);
5050 * Was "to be safe, set the bt848 to input 0"
5051 * Actually, since it's ok at load time, better not messing
5052 * with these bits (on PXC200AF you need to set mux 2 here)
5054 * needed because bttv-driver sets mux before calling this function
5056 if (btv->cardid == PX_PXC200A_CARDID)
5057 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
5058 else /* older device */
5059 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
5061 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
5064 /* ----------------------------------------------------------------------- */
5065 /* motherboard chipset specific stuff */
5067 void __devinit bttv_check_chipset(void)
5069 int pcipci_fail = 0;
5070 struct pci_dev *dev = NULL;
5072 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
5074 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
5076 if (pci_pci_problems & PCIPCI_VSFX)
5078 #ifdef PCIPCI_ALIMAGIK
5079 if (pci_pci_problems & PCIPCI_ALIMAGIK)
5084 /* print warnings about any quirks found */
5086 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
5088 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
5090 printk(KERN_INFO "bttv: bttv and your chipset may not work "
5093 printk(KERN_INFO "bttv: overlay will be disabled.\n");
5096 printk(KERN_INFO "bttv: overlay forced. Use this "
5097 "option at your own risk.\n");
5100 if (UNSET != latency)
5101 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
5102 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
5103 PCI_DEVICE_ID_INTEL_82441, dev))) {
5105 pci_read_config_byte(dev, 0x53, &b);
5107 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5108 "bufcon=0x%02x\n",b);
5112 int __devinit bttv_handle_chipset(struct bttv *btv)
5114 unsigned char command;
5116 if (!triton1 && !vsfx && UNSET == latency)
5121 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5122 if (vsfx && btv->id >= 878)
5123 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5124 if (UNSET != latency)
5125 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5129 if (btv->id < 878) {
5130 /* bt848 (mis)uses a bit in the irq mask for etbf */
5132 btv->triton1 = BT848_INT_ETBF;
5134 /* bt878 has a bit in the pci config space for it */
5135 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
5137 command |= BT878_EN_TBFX;
5139 command |= BT878_EN_VSFX;
5140 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5142 if (UNSET != latency)
5143 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);