blob: e94bffbedfdd7be44c7555b69ace535259ce8d18 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3 bttv-cards.c
4
5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
7
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>
11
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.
16
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.
21
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.
25
26*/
27
28#include <linux/config.h>
29#include <linux/delay.h>
30#include <linux/module.h>
31#include <linux/moduleparam.h>
32#include <linux/kmod.h>
33#include <linux/init.h>
34#include <linux/pci.h>
35#include <linux/vmalloc.h>
36#include <linux/firmware.h>
37
38#include <asm/io.h>
39
40#include "bttvp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42/* fwd decl */
43static void boot_msp34xx(struct bttv *btv, int pin);
44static void boot_bt832(struct bttv *btv);
45static void hauppauge_eeprom(struct bttv *btv);
46static void avermedia_eeprom(struct bttv *btv);
47static void osprey_eeprom(struct bttv *btv);
48static void modtec_eeprom(struct bttv *btv);
49static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070050static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
52static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
53static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
54static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
55 int set);
56static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
57 int set);
58static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
59static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
60static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
61static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
62static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
63static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
64static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
65static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
66static void rv605_muxsel(struct bttv *btv, unsigned int input);
67static void eagle_muxsel(struct bttv *btv, unsigned int input);
68static void xguard_muxsel(struct bttv *btv, unsigned int input);
69static void ivc120_muxsel(struct bttv *btv, unsigned int input);
70static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
71
72static void PXC200_muxsel(struct bttv *btv, unsigned int input);
73
74static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
75static void picolo_tetra_init(struct bttv *btv);
76
77static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
78static void tibetCS16_init(struct bttv *btv);
79
80static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
81static void kodicom4400r_init(struct bttv *btv);
82
83static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
84static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
85
86static int terratec_active_radio_upgrade(struct bttv *btv);
87static int tea5757_read(struct bttv *btv);
88static int tea5757_write(struct bttv *btv, int value);
89static void identify_by_eeprom(struct bttv *btv,
90 unsigned char eeprom_data[256]);
91static int __devinit pvr_boot(struct bttv *btv);
92
93/* config variables */
94static unsigned int triton1=0;
95static unsigned int vsfx=0;
96static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070097int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
99static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
105#ifdef MODULE
106static unsigned int autoload = 1;
107#else
108static unsigned int autoload = 0;
109#endif
110static unsigned int gpiomask = UNSET;
111static unsigned int audioall = UNSET;
112static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
113
114/* insmod options */
115module_param(triton1, int, 0444);
116module_param(vsfx, int, 0444);
117module_param(no_overlay, int, 0444);
118module_param(latency, int, 0444);
119module_param(gpiomask, int, 0444);
120module_param(audioall, int, 0444);
121module_param(autoload, int, 0444);
122
123module_param_array(card, int, NULL, 0444);
124module_param_array(pll, int, NULL, 0444);
125module_param_array(tuner, int, NULL, 0444);
126module_param_array(svhs, int, NULL, 0444);
127module_param_array(remote, int, NULL, 0444);
128module_param_array(audiomux, int, NULL, 0444);
129
130MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
131 "[enable bug compatibility for triton1 + others]");
132MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
133 "[yet another chipset flaw workaround]");
134MODULE_PARM_DESC(latency,"pci latency timer");
135MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
136MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
137MODULE_PARM_DESC(tuner,"specify installed tuner type");
138MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
139
140/* ----------------------------------------------------------------------- */
141/* list of card IDs for bt878+ cards */
142
143static struct CARD {
144 unsigned id;
145 int cardnr;
146 char *name;
147} cards[] __devinitdata = {
148 { 0x13eb0070, BTTV_HAUPPAUGE878, "Hauppauge WinTV" },
149 { 0x39000070, BTTV_HAUPPAUGE878, "Hauppauge WinTV-D" },
150 { 0x45000070, BTTV_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
151 { 0xff000070, BTTV_OSPREY1x0, "Osprey-100" },
152 { 0xff010070, BTTV_OSPREY2x0_SVID,"Osprey-200" },
153 { 0xff020070, BTTV_OSPREY500, "Osprey-500" },
154 { 0xff030070, BTTV_OSPREY2000, "Osprey-2000" },
155 { 0xff040070, BTTV_OSPREY540, "Osprey-540" },
156
157 { 0x00011002, BTTV_ATI_TVWONDER, "ATI TV Wonder" },
158 { 0x00031002, BTTV_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
159
160 { 0x6606107d, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
161 { 0x6607107d, BTTV_WINFASTVC100, "Leadtek WinFast VC 100" },
162 { 0x6609107d, BTTV_WINFAST2000, "Leadtek TV 2000 XP" },
163 { 0x263610b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
164 { 0x264510b4, BTTV_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x402010fc, BTTV_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
166 { 0x405010fc, BTTV_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
167 { 0x407010fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
168 { 0xd01810fc, BTTV_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169
170 { 0x001211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700171 /* some cards ship with byteswapped IDs ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172 { 0x1200bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
173 { 0xff00bd11, BTTV_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700174 /* this seems to happen as well ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 { 0xff1211bd, BTTV_PINNACLE, "Pinnacle PCTV" },
176
177 { 0x3000121a, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
178 { 0x263710b4, BTTV_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x3060121a, BTTV_STB2, "3Dfx VoodooTV 100/ STB OEM" },
180
181 { 0x3000144f, BTTV_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
182 { 0xa005144f, BTTV_MAGICTVIEW063, "CPH06X TView99-Card" },
183 { 0x3002144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
184 { 0x3005144f, BTTV_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
185 { 0x5000144f, BTTV_MAGICTVIEW061, "Askey CPH050" },
186 { 0x300014ff, BTTV_MAGICTVIEW061, "TView 99 (CPH061)" },
187 { 0x300214ff, BTTV_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
188
189 { 0x00011461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
190 { 0x00021461, BTTV_AVERMEDIA98, "AVermedia TVCapture 98" },
191 { 0x00031461, BTTV_AVPHONE98, "AVerMedia TVPhone98" },
192 { 0x00041461, BTTV_AVERMEDIA98, "AVerMedia TVCapture 98" },
193 { 0x03001461, BTTV_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
194
195 { 0x1117153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
196 { 0x1118153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
197 { 0x1119153b, BTTV_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
198 { 0x111a153b, BTTV_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
199
200 { 0x1123153b, BTTV_TERRATVRADIO, "Terratec TV Radio+" },
201 { 0x1127153b, BTTV_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700202 /* clashes with FlyVideo
203 *{ 0x18521852, BTTV_TERRATV, "Terratec TV+ (V1.10)" }, */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 { 0x1134153b, BTTV_TERRATVALUE, "Terratec TValue (LR102)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700205 { 0x1135153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
206 { 0x5018153b, BTTV_TERRATVALUE, "Terratec TValue" }, /* ?? */
207 { 0xff3b153b, BTTV_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
209 { 0x400015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
210 { 0x400a15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400d15b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
212 { 0x401015b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401615b0, BTTV_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214
215 { 0x1430aa00, BTTV_PV143, "Provideo PV143A" },
216 { 0x1431aa00, BTTV_PV143, "Provideo PV143B" },
217 { 0x1432aa00, BTTV_PV143, "Provideo PV143C" },
218 { 0x1433aa00, BTTV_PV143, "Provideo PV143D" },
219 { 0x1433aa03, BTTV_PV143, "Security Eyes" },
220
221 { 0x1460aa00, BTTV_PV150, "Provideo PV150A-1" },
222 { 0x1461aa01, BTTV_PV150, "Provideo PV150A-2" },
223 { 0x1462aa02, BTTV_PV150, "Provideo PV150A-3" },
224 { 0x1463aa03, BTTV_PV150, "Provideo PV150A-4" },
225
226 { 0x1464aa04, BTTV_PV150, "Provideo PV150B-1" },
227 { 0x1465aa05, BTTV_PV150, "Provideo PV150B-2" },
228 { 0x1466aa06, BTTV_PV150, "Provideo PV150B-3" },
229 { 0x1467aa07, BTTV_PV150, "Provideo PV150B-4" },
230
231 { 0xa132ff00, BTTV_IVC100, "IVC-100" },
232 { 0xa1550000, BTTV_IVC200, "IVC-200" },
233 { 0xa1550001, BTTV_IVC200, "IVC-200" },
234 { 0xa1550002, BTTV_IVC200, "IVC-200" },
235 { 0xa1550003, BTTV_IVC200, "IVC-200" },
236 { 0xa1550100, BTTV_IVC200, "IVC-200G" },
237 { 0xa1550101, BTTV_IVC200, "IVC-200G" },
238 { 0xa1550102, BTTV_IVC200, "IVC-200G" },
239 { 0xa1550103, BTTV_IVC200, "IVC-200G" },
240 { 0xa182ff00, BTTV_IVC120, "IVC-120G" },
241 { 0xa182ff01, BTTV_IVC120, "IVC-120G" },
242 { 0xa182ff02, BTTV_IVC120, "IVC-120G" },
243 { 0xa182ff03, BTTV_IVC120, "IVC-120G" },
244 { 0xa182ff04, BTTV_IVC120, "IVC-120G" },
245 { 0xa182ff05, BTTV_IVC120, "IVC-120G" },
246 { 0xa182ff06, BTTV_IVC120, "IVC-120G" },
247 { 0xa182ff07, BTTV_IVC120, "IVC-120G" },
248 { 0xa182ff08, BTTV_IVC120, "IVC-120G" },
249 { 0xa182ff09, BTTV_IVC120, "IVC-120G" },
250 { 0xa182ff0a, BTTV_IVC120, "IVC-120G" },
251 { 0xa182ff0b, BTTV_IVC120, "IVC-120G" },
252 { 0xa182ff0c, BTTV_IVC120, "IVC-120G" },
253 { 0xa182ff0d, BTTV_IVC120, "IVC-120G" },
254 { 0xa182ff0e, BTTV_IVC120, "IVC-120G" },
255 { 0xa182ff0f, BTTV_IVC120, "IVC-120G" },
256
257 { 0x41424344, BTTV_GRANDTEC, "GrandTec Multi Capture" },
258 { 0x01020304, BTTV_XGUARD, "Grandtec Grand X-Guard" },
259
260 { 0x18501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
261 { 0xa0501851, BTTV_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0x18511851, BTTV_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
263 { 0x18521852, BTTV_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
264 { 0x41a0a051, BTTV_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
265 { 0x18501f7f, BTTV_FLYVIDEO_98, "Lifeview Flyvideo 98" },
266
267 { 0x010115cb, BTTV_GMV1, "AG GMV1" },
268 { 0x010114c7, BTTV_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
269
270 { 0x10b42636, BTTV_HAUPPAUGE878, "STB ???" },
271 { 0x217d6606, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
272 { 0xfff6f6ff, BTTV_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0x03116000, BTTV_SENSORAY311, "Sensoray 311" },
274 { 0x00790e11, BTTV_WINDVR, "Canopus WinDVR PCI" },
275 { 0xa0fca1a0, BTTV_ZOLTRIX, "Face to Face Tvmax" },
276 { 0x20007063, BTTV_PC_HDTV, "pcHDTV HD-2000 TV"},
277 { 0x82b2aa6a, BTTV_SIMUS_GVC1100, "SIMUS GVC1100" },
278 { 0x146caa0c, BTTV_PV951, "ituner spectra8" },
279 { 0x200a1295, BTTV_PXC200, "ImageNation PXC200A" },
280
281 { 0x40111554, BTTV_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
282 { 0x17de0a01, BTTV_KWORLD, "Mecer TV/FM/Video Tuner" },
283
284 { 0x01051805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
285 { 0x01061805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
286 { 0x01071805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
287 { 0x01081805, BTTV_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
288
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700289 { 0x15409511, BTTV_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700291 /* likely broken, vendor id doesn't match the other magic views ...
292 * { 0xa0fca04f, BTTV_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
293
294 /* DVB cards (using pci function .1 for mpeg data xfer) */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 { 0x01010071, BTTV_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
296 { 0x07611461, BTTV_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
297 { 0x001c11bd, BTTV_PINNACLESAT, "Pinnacle PCTV Sat" },
298 { 0x002611bd, BTTV_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
299 { 0x00011822, BTTV_TWINHAN_DST, "Twinhan VisionPlus DVB" },
300 { 0xfc00270f, BTTV_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
301 { 0x07711461, BTTV_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
Mauro Carvalho Chehab33ac6b52005-09-09 13:03:56 -0700302 { 0xdb1018ac, BTTV_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
303 { 0xd50018ac, BTTV_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304
305 { 0, -1, NULL }
306};
307
308/* ----------------------------------------------------------------------- */
309/* array with description for bt848 / bt878 tv/grabber cards */
310
311struct tvcard bttv_tvcards[] = {
312{
313/* ---- card 0x00 ---------------------------------- */
314 .name = " *** UNKNOWN/GENERIC *** ",
315 .video_inputs = 4,
316 .audio_inputs = 1,
317 .tuner = 0,
318 .svhs = 2,
319 .muxsel = { 2, 3, 1, 0},
320 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700321 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700322},{
323 .name = "MIRO PCTV",
324 .video_inputs = 4,
325 .audio_inputs = 1,
326 .tuner = 0,
327 .svhs = 2,
328 .gpiomask = 15,
329 .muxsel = { 2, 3, 1, 1},
330 .audiomux = { 2, 0, 0, 0, 10},
331 .needs_tvaudio = 1,
332 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700333 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334},{
335 .name = "Hauppauge (bt848)",
336 .video_inputs = 4,
337 .audio_inputs = 1,
338 .tuner = 0,
339 .svhs = 2,
340 .gpiomask = 7,
341 .muxsel = { 2, 3, 1, 1},
342 .audiomux = { 0, 1, 2, 3, 4},
343 .needs_tvaudio = 1,
344 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700345 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346},{
347 .name = "STB, Gateway P/N 6000699 (bt848)",
348 .video_inputs = 3,
349 .audio_inputs = 1,
350 .tuner = 0,
351 .svhs = 2,
352 .gpiomask = 7,
353 .muxsel = { 2, 3, 1, 1},
354 .audiomux = { 4, 0, 2, 3, 1},
355 .no_msp34xx = 1,
356 .needs_tvaudio = 1,
357 .tuner_type = TUNER_PHILIPS_NTSC,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700358 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700359 .pll = PLL_28,
360 .has_radio = 1,
361},{
362
363/* ---- card 0x04 ---------------------------------- */
364 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
365 .video_inputs = 4,
366 .audio_inputs = 0,
367 .tuner = -1,
368 .svhs = 2,
369 .gpiomask = 0,
370 .muxsel = { 2, 3, 1, 1},
371 .audiomux = { 0 },
372 .needs_tvaudio = 0,
373 .tuner_type = 4,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700374 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375},{
376 .name = "Diamond DTV2000",
377 .video_inputs = 4,
378 .audio_inputs = 1,
379 .tuner = 0,
380 .svhs = 2,
381 .gpiomask = 3,
382 .muxsel = { 2, 3, 1, 0},
383 .audiomux = { 0, 1, 0, 1, 3},
384 .needs_tvaudio = 1,
385 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700386 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387},{
388 .name = "AVerMedia TVPhone",
389 .video_inputs = 3,
390 .audio_inputs = 1,
391 .tuner = 0,
392 .svhs = 3,
393 .muxsel = { 2, 3, 1, 1},
394 .gpiomask = 0x0f,
395 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
396 /* 0x04 for some cards ?? */
397 .needs_tvaudio = 1,
398 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700399 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 .audio_hook = avermedia_tvphone_audio,
401 .has_remote = 1,
402},{
403 .name = "MATRIX-Vision MV-Delta",
404 .video_inputs = 5,
405 .audio_inputs = 1,
406 .tuner = -1,
407 .svhs = 3,
408 .gpiomask = 0,
409 .muxsel = { 2, 3, 1, 0, 0},
410 .audiomux = {0 },
411 .needs_tvaudio = 1,
412 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700413 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414},{
415
416/* ---- card 0x08 ---------------------------------- */
417 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
418 .video_inputs = 4,
419 .audio_inputs = 1,
420 .tuner = 0,
421 .svhs = 2,
422 .gpiomask = 0xc00,
423 .muxsel = { 2, 3, 1, 1},
424 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
425 .needs_tvaudio = 1,
426 .pll = PLL_28,
427 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700428 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429},{
430 .name = "IMS/IXmicro TurboTV",
431 .video_inputs = 3,
432 .audio_inputs = 1,
433 .tuner = 0,
434 .svhs = 2,
435 .gpiomask = 3,
436 .muxsel = { 2, 3, 1, 1},
437 .audiomux = { 1, 1, 2, 3, 0},
438 .needs_tvaudio = 0,
439 .pll = PLL_28,
440 .tuner_type = TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700441 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442},{
443 .name = "Hauppauge (bt878)",
444 .video_inputs = 4,
445 .audio_inputs = 1,
446 .tuner = 0,
447 .svhs = 2,
448 .gpiomask = 0x0f, /* old: 7 */
449 .muxsel = { 2, 0, 1, 1},
450 .audiomux = { 0, 1, 2, 3, 4},
451 .needs_tvaudio = 1,
452 .pll = PLL_28,
453 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700454 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455},{
456 .name = "MIRO PCTV pro",
457 .video_inputs = 3,
458 .audio_inputs = 1,
459 .tuner = 0,
460 .svhs = 2,
461 .gpiomask = 0x3014f,
462 .muxsel = { 2, 3, 1, 1},
463 .audiomux = { 0x20001,0x10001, 0, 0,10},
464 .needs_tvaudio = 1,
465 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700466 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467},{
468
469/* ---- card 0x0c ---------------------------------- */
470 .name = "ADS Technologies Channel Surfer TV (bt848)",
471 .video_inputs = 3,
472 .audio_inputs = 1,
473 .tuner = 0,
474 .svhs = 2,
475 .gpiomask = 15,
476 .muxsel = { 2, 3, 1, 1},
477 .audiomux = { 13, 14, 11, 7, 0, 0},
478 .needs_tvaudio = 1,
479 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700480 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481},{
482 .name = "AVerMedia TVCapture 98",
483 .video_inputs = 3,
484 .audio_inputs = 4,
485 .tuner = 0,
486 .svhs = 2,
487 .gpiomask = 15,
488 .muxsel = { 2, 3, 1, 1},
489 .audiomux = { 13, 14, 11, 7, 0, 0},
490 .needs_tvaudio = 1,
491 .msp34xx_alt = 1,
492 .pll = PLL_28,
493 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700494 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495 .audio_hook = avermedia_tv_stereo_audio,
496},{
497 .name = "Aimslab Video Highway Xtreme (VHX)",
498 .video_inputs = 3,
499 .audio_inputs = 1,
500 .tuner = 0,
501 .svhs = 2,
502 .gpiomask = 7,
503 .muxsel = { 2, 3, 1, 1},
504 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
505 .needs_tvaudio = 1,
506 .pll = PLL_28,
507 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700508 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509},{
510 .name = "Zoltrix TV-Max",
511 .video_inputs = 3,
512 .audio_inputs = 1,
513 .tuner = 0,
514 .svhs = 2,
515 .gpiomask = 15,
516 .muxsel = { 2, 3, 1, 1},
517 .audiomux = {0 , 0, 1 , 0, 10},
518 .needs_tvaudio = 1,
519 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700520 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700521},{
522
523/* ---- card 0x10 ---------------------------------- */
524 .name = "Prolink Pixelview PlayTV (bt878)",
525 .video_inputs = 3,
526 .audio_inputs = 1,
527 .tuner = 0,
528 .svhs = 2,
529 .gpiomask = 0x01fe00,
530 .muxsel = { 2, 3, 1, 1},
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700531 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 .needs_tvaudio = 1,
534 .pll = PLL_28,
535 .tuner_type = -1,
536},{
537 .name = "Leadtek WinView 601",
538 .video_inputs = 3,
539 .audio_inputs = 1,
540 .tuner = 0,
541 .svhs = 2,
542 .gpiomask = 0x8300f8,
543 .muxsel = { 2, 3, 1, 1,0},
544 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
545 .needs_tvaudio = 1,
546 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700547 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700548 .audio_hook = winview_audio,
549 .has_radio = 1,
550},{
551 .name = "AVEC Intercapture",
552 .video_inputs = 3,
553 .audio_inputs = 2,
554 .tuner = 0,
555 .svhs = 2,
556 .gpiomask = 0,
557 .muxsel = {2, 3, 1, 1},
558 .audiomux = {1, 0, 0, 0, 0},
559 .needs_tvaudio = 1,
560 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700561 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700562},{
563 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
564 .video_inputs = 4,
565 .audio_inputs = 1,
566 .tuner = -1,
567 .svhs = -1,
568 .gpiomask = 0x8dff00,
569 .muxsel = { 2, 3, 1, 1},
570 .audiomux = { 0 },
571 .no_msp34xx = 1,
572 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700573 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574},{
575
576/* ---- card 0x14 ---------------------------------- */
577 .name = "CEI Raffles Card",
578 .video_inputs = 3,
579 .audio_inputs = 3,
580 .tuner = 0,
581 .svhs = 2,
582 .muxsel = {2, 3, 1, 1},
583 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700584 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700585},{
586 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
587 .video_inputs = 4,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700588 .audio_inputs = 2, /* tuner, line in */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700589 .tuner = 0,
590 .svhs = 2,
591 .gpiomask = 0x1800,
592 .muxsel = { 2, 3, 1, 1},
593 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
594 .pll = PLL_28,
595 .tuner_type = TUNER_PHILIPS_PAL_I,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700596 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700597},{
598 .name = "Askey CPH050/ Phoebe Tv Master + FM",
599 .video_inputs = 3,
600 .audio_inputs = 1,
601 .tuner = 0,
602 .svhs = 2,
603 .gpiomask = 0xc00,
604 .muxsel = { 2, 3, 1, 1},
605 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
606 .needs_tvaudio = 1,
607 .pll = PLL_28,
608 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700609 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610},{
611 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
612 .video_inputs = 3,
613 .audio_inputs = 1,
614 .tuner = 0,
615 .svhs = -1,
616 .gpiomask = 7,
617 .muxsel = { 2, 3, -1 },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700618 .digital_mode = DIGITAL_MODE_CAMERA,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619 .audiomux = { 0, 0, 0, 0, 0 },
620 .no_msp34xx = 1,
621 .pll = PLL_28,
622 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700623 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624},{
625
626/* ---- card 0x18 ---------------------------------- */
627 .name = "Askey CPH05X/06X (bt878) [many vendors]",
628 .video_inputs = 3,
629 .audio_inputs = 1,
630 .tuner = 0,
631 .svhs = 2,
632 .gpiomask = 0xe00,
633 .muxsel = { 2, 3, 1, 1},
634 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
635 .needs_tvaudio = 1,
636 .pll = PLL_28,
637 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700638 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639 .has_remote = 1,
640},{
641 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
642 .video_inputs = 3,
643 .audio_inputs = 1,
644 .tuner = 0,
645 .svhs = 2,
646 .gpiomask = 0x1f0fff,
647 .muxsel = { 2, 3, 1, 1},
648 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
649 .needs_tvaudio = 0,
650 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700651 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 .audio_hook = terratv_audio,
653},{
654 .name = "Hauppauge WinCam newer (bt878)",
655 .video_inputs = 4,
656 .audio_inputs = 1,
657 .tuner = 0,
658 .svhs = 3,
659 .gpiomask = 7,
660 .muxsel = { 2, 0, 1, 1},
661 .audiomux = { 0, 1, 2, 3, 4},
662 .needs_tvaudio = 1,
663 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700664 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665},{
666 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
667 .video_inputs = 4,
668 .audio_inputs = 2,
669 .tuner = 0,
670 .svhs = 2,
671 .gpiomask = 0x1800,
672 .muxsel = { 2, 3, 1, 1},
673 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
674 .pll = PLL_28,
675 .tuner_type = TUNER_PHILIPS_SECAM,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700676 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677},{
678
679/* ---- card 0x1c ---------------------------------- */
680 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
681 .video_inputs = 3,
682 .audio_inputs = 1,
683 .tuner = 0,
684 .svhs = 2,
685 .gpiomask = 0x1f0fff,
686 .muxsel = { 2, 3, 1, 1},
687 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
688 .needs_tvaudio = 0,
689 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700690 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700691 .audio_hook = terratv_audio,
692 /* GPIO wiring:
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700693 External 20 pin connector (for Active Radio Upgrade board)
694 gpio00: i2c-sda
695 gpio01: i2c-scl
696 gpio02: om5610-data
697 gpio03: om5610-clk
698 gpio04: om5610-wre
699 gpio05: om5610-stereo
700 gpio06: rds6588-davn
701 gpio07: Pin 7 n.c.
702 gpio08: nIOW
703 gpio09+10: nIOR, nSEL ?? (bt878)
704 gpio09: nIOR (bt848)
705 gpio10: nSEL (bt848)
706 Sound Routing:
707 gpio16: u2-A0 (1st 4052bt)
708 gpio17: u2-A1
709 gpio18: u2-nEN
710 gpio19: u4-A0 (2nd 4052)
711 gpio20: u4-A1
712 u4-nEN - GND
713 Btspy:
714 00000 : Cdrom (internal audio input)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715 10000 : ext. Video audio input
716 20000 : TV Mono
717 a0000 : TV Mono/2
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700718 1a0000 : TV Stereo
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719 30000 : Radio
720 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700721*/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722
723},{
724 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
725 .name = "Imagenation PXC200",
726 .video_inputs = 5,
727 .audio_inputs = 1,
728 .tuner = -1,
729 .svhs = 1, /* was: 4 */
730 .gpiomask = 0,
731 .muxsel = { 2, 3, 1, 0, 0},
732 .audiomux = { 0 },
733 .needs_tvaudio = 1,
734 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700735 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736 .muxsel_hook = PXC200_muxsel,
737
738},{
739 .name = "Lifeview FlyVideo 98 LR50",
740 .video_inputs = 4,
741 .audio_inputs = 1,
742 .tuner = 0,
743 .svhs = 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700744 .gpiomask = 0x1800, /* 0x8dfe00 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745 .muxsel = { 2, 3, 1, 1},
746 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
747 .pll = PLL_28,
748 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700749 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700750},{
751 .name = "Formac iProTV, Formac ProTV I (bt848)",
752 .video_inputs = 4,
753 .audio_inputs = 1,
754 .tuner = 0,
755 .svhs = 3,
756 .gpiomask = 1,
757 .muxsel = { 2, 3, 1, 1},
758 .audiomux = { 1, 0, 0, 0, 0 },
759 .pll = PLL_28,
760 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700761 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762},{
763
764/* ---- card 0x20 ---------------------------------- */
765 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
766 .video_inputs = 4,
767 .audio_inputs = 0,
768 .tuner = -1,
769 .svhs = 2,
770 .gpiomask = 0,
771 .muxsel = { 2, 3, 1, 1},
772 .audiomux = { 0 },
773 .needs_tvaudio = 0,
774 .tuner_type = 4,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700775 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700776},{
777 .name = "Terratec TerraTValue Version Bt878",
778 .video_inputs = 3,
779 .audio_inputs = 1,
780 .tuner = 0,
781 .svhs = 2,
782 .gpiomask = 0xffff00,
783 .muxsel = { 2, 3, 1, 1},
784 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
785 .needs_tvaudio = 1,
786 .pll = PLL_28,
787 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700788 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789},{
790 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
791 .video_inputs = 4,
792 .audio_inputs = 1,
793 .tuner = 0,
794 .svhs = 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700795 .muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
797 .gpiomask = 0xb33000,
798 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
800 gpio23 -- hef4052:nEnable (0x800000)
801 gpio12 -- hef4052:A1
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700802 gpio13 -- hef4052:A0
803 0x0000: external audio
804 0x1000: FM
805 0x2000: TV
806 0x3000: n.c.
807 Note: There exists another variant "Winfast 2000" with tv stereo !?
808 Note: eeprom only contains FF and pci subsystem id 107d:6606
809 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810 .needs_tvaudio = 0,
811 .pll = PLL_28,
812 .has_radio = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700813 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
814 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815 .audio_hook = winfast2000_audio,
816 .has_remote = 1,
817},{
818 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
819 .video_inputs = 4,
820 .audio_inputs = 3,
821 .tuner = 0,
822 .svhs = 2,
823 .gpiomask = 0x1800,
824 .muxsel = { 2, 3, 1, 1},
825 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
826 .pll = PLL_28,
827 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700828 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829},{
830
831/* ---- card 0x24 ---------------------------------- */
832 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
833 .video_inputs = 4,
834 .audio_inputs = 3,
835 .tuner = 0,
836 .svhs = 2,
837 .gpiomask = 0x1800,
838 .muxsel = { 2, 3, 1, 1},
839 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
840 .pll = PLL_28,
841 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700842 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843 .has_radio = 1,
844},{
845 .name = "Prolink PixelView PlayTV pro",
846 .video_inputs = 3,
847 .audio_inputs = 1,
848 .tuner = 0,
849 .svhs = 2,
850 .gpiomask = 0xff,
851 .muxsel = { 2, 3, 1, 1 },
852 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
853 .no_msp34xx = 1,
854 .pll = PLL_28,
855 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700856 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857},{
858 .name = "Askey CPH06X TView99",
859 .video_inputs = 4,
860 .audio_inputs = 1,
861 .tuner = 0,
862 .svhs = 2,
863 .gpiomask = 0x551e00,
864 .muxsel = { 2, 3, 1, 0},
865 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
866 .needs_tvaudio = 1,
867 .pll = PLL_28,
868 .tuner_type = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700869 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700870 .has_remote = 1,
871},{
872 .name = "Pinnacle PCTV Studio/Rave",
873 .video_inputs = 3,
874 .audio_inputs = 1,
875 .tuner = 0,
876 .svhs = 2,
877 .gpiomask = 0x03000F,
878 .muxsel = { 2, 3, 1, 1},
879 .audiomux = { 2, 0xd0001, 0, 0, 1},
880 .needs_tvaudio = 0,
881 .pll = PLL_28,
882 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700883 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700884},{
885
886/* ---- card 0x28 ---------------------------------- */
887 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
888 .video_inputs = 3,
889 .audio_inputs = 1,
890 .tuner = 0,
891 .svhs = 2,
892 .gpiomask = 7,
893 .muxsel = { 2, 3, 1, 1},
894 .audiomux = { 4, 0, 2, 3, 1},
895 .no_msp34xx = 1,
896 .needs_tvaudio = 1,
897 .tuner_type = TUNER_PHILIPS_NTSC,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700898 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700899 .pll = PLL_28,
900 .has_radio = 1,
901},{
902 .name = "AVerMedia TVPhone 98",
903 .video_inputs = 3,
904 .audio_inputs = 4,
905 .tuner = 0,
906 .svhs = 2,
907 .gpiomask = 15,
908 .muxsel = { 2, 3, 1, 1},
909 .audiomux = { 13, 4, 11, 7, 0, 0},
910 .needs_tvaudio = 1,
911 .pll = PLL_28,
912 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700913 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700914 .has_radio = 1,
915 .audio_hook = avermedia_tvphone_audio,
916},{
917 .name = "ProVideo PV951", /* pic16c54 */
918 .video_inputs = 3,
919 .audio_inputs = 1,
920 .tuner = 0,
921 .svhs = 2,
922 .gpiomask = 0,
923 .muxsel = { 2, 3, 1, 1},
924 .audiomux = { 0, 0, 0, 0, 0},
925 .needs_tvaudio = 1,
926 .no_msp34xx = 1,
927 .pll = PLL_28,
928 .tuner_type = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700929 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700930},{
931 .name = "Little OnAir TV",
932 .video_inputs = 3,
933 .audio_inputs = 1,
934 .tuner = 0,
935 .svhs = 2,
936 .gpiomask = 0xe00b,
937 .muxsel = {2, 3, 1, 1},
938 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
939 .no_msp34xx = 1,
940 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700941 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700942},{
943
944/* ---- card 0x2c ---------------------------------- */
945 .name = "Sigma TVII-FM",
946 .video_inputs = 2,
947 .audio_inputs = 1,
948 .tuner = 0,
949 .svhs = -1,
950 .gpiomask = 3,
951 .muxsel = {2, 3, 1, 1},
952 .audiomux = {1, 1, 0, 2, 3},
953 .no_msp34xx = 1,
954 .pll = PLL_NONE,
955 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700956 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700957},{
958 .name = "MATRIX-Vision MV-Delta 2",
959 .video_inputs = 5,
960 .audio_inputs = 1,
961 .tuner = -1,
962 .svhs = 3,
963 .gpiomask = 0,
964 .muxsel = { 2, 3, 1, 0, 0},
965 .audiomux = {0 },
966 .no_msp34xx = 1,
967 .pll = PLL_28,
968 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700969 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970},{
971 .name = "Zoltrix Genie TV/FM",
972 .video_inputs = 3,
973 .audio_inputs = 1,
974 .tuner = 0,
975 .svhs = 2,
976 .gpiomask = 0xbcf03f,
977 .muxsel = { 2, 3, 1, 1},
978 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
979 .no_msp34xx = 1,
980 .pll = PLL_28,
981 .tuner_type = 21,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700982 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700983},{
984 .name = "Terratec TV/Radio+",
985 .video_inputs = 3,
986 .audio_inputs = 1,
987 .tuner = 0,
988 .svhs = 2,
989 .gpiomask = 0x70000,
990 .muxsel = { 2, 3, 1, 1},
991 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
992 .needs_tvaudio = 1,
993 .no_msp34xx = 1,
994 .pll = PLL_35,
995 .tuner_type = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700996 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 .has_radio = 1,
998},{
999
1000/* ---- card 0x30 ---------------------------------- */
1001 .name = "Askey CPH03x/ Dynalink Magic TView",
1002 .video_inputs = 3,
1003 .audio_inputs = 1,
1004 .tuner = 0,
1005 .svhs = 2,
1006 .gpiomask = 15,
1007 .muxsel = { 2, 3, 1, 1},
1008 .audiomux = {2,0,0,0,1},
1009 .needs_tvaudio = 1,
1010 .pll = PLL_28,
1011 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001012 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001013},{
1014 .name = "IODATA GV-BCTV3/PCI",
1015 .video_inputs = 3,
1016 .audio_inputs = 1,
1017 .tuner = 0,
1018 .svhs = 2,
1019 .gpiomask = 0x010f00,
1020 .muxsel = {2, 3, 0, 0},
1021 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1022 .no_msp34xx = 1,
1023 .pll = PLL_28,
1024 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001025 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001026 .audio_hook = gvbctv3pci_audio,
1027},{
1028 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1029 .video_inputs = 5,
1030 .audio_inputs = 1,
1031 .tuner = 0,
1032 .svhs = 3,
1033 .gpiomask = 0xAA0000,
1034 .muxsel = { 2,3,1,1,-1 },
1035 .digital_mode = DIGITAL_MODE_CAMERA,
1036 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1037 .no_msp34xx = 1,
1038 .pll = PLL_28,
1039 .tuner_type = TUNER_PHILIPS_PAL_I,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001040 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001041 .has_remote = 1,
1042 /* GPIO wiring: (different from Rev.4C !)
1043 GPIO17: U4.A0 (first hef4052bt)
1044 GPIO19: U4.A1
1045 GPIO20: U5.A1 (second hef4052bt)
1046 GPIO21: U4.nEN
1047 GPIO22: BT832 Reset Line
1048 GPIO23: A5,A0, U5,nEN
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001049 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1050 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001051},{
1052 .name = "Eagle Wireless Capricorn2 (bt878A)",
1053 .video_inputs = 4,
1054 .audio_inputs = 1,
1055 .tuner = 0,
1056 .svhs = 2,
1057 .gpiomask = 7,
1058 .muxsel = { 2, 0, 1, 1},
1059 .audiomux = { 0, 1, 2, 3, 4},
1060 .pll = PLL_28,
1061 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001062 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001063},{
1064
1065/* ---- card 0x34 ---------------------------------- */
1066 /* David Härdeman <david@2gen.com> */
1067 .name = "Pinnacle PCTV Studio Pro",
1068 .video_inputs = 4,
1069 .audio_inputs = 1,
1070 .tuner = 0,
1071 .svhs = 3,
1072 .gpiomask = 0x03000F,
1073 .muxsel = { 2, 3, 1, 1},
1074 .audiomux = { 1, 0xd0001, 0, 0, 10},
1075 /* sound path (5 sources):
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001076 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
Linus Torvalds1da177e2005-04-16 15:20:36 -07001077 0= ext. Audio IN
1078 1= from MUX2
1079 2= Mono TV sound from Tuner
1080 3= not connected
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001081 MUX2 (mask 0x30000):
Linus Torvalds1da177e2005-04-16 15:20:36 -07001082 0,2,3= from MSP34xx
1083 1= FM stereo Radio from Tuner */
1084 .needs_tvaudio = 0,
1085 .pll = PLL_28,
1086 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001087 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001088},{
1089 /* Claas Langbehn <claas@bigfoot.com>,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001090 Sven Grothklags <sven@upb.de> */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001091 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1092 .video_inputs = 4,
1093 .audio_inputs = 3,
1094 .tuner = 0,
1095 .svhs = 2,
1096 .gpiomask = 0x1c,
1097 .muxsel = { 2, 3, 1, 1},
1098 .audiomux = { 0, 0, 0x10, 8, 4 },
1099 .needs_tvaudio = 1,
1100 .pll = PLL_28,
1101 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001102 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001103 .has_radio = 1,
1104},{
1105 /* Tim Röstermundt <rosterm@uni-muenster.de>
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001106 in de.comp.os.unix.linux.hardware:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001107 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1108 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1109 options tuner type=5 */
1110 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1111 .video_inputs = 4,
1112 .audio_inputs = 1,
1113 .tuner = 0,
1114 .svhs = 2,
1115 .gpiomask = 0x18e0,
1116 .muxsel = { 2, 3, 1, 1},
1117 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001118 /* For cards with tda9820/tda9821:
1119 0x0000: Tuner normal stereo
1120 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1121 0x0880: Tuner A2 stereo */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001122 .pll = PLL_28,
1123 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001124 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001125},{
1126 /* Miguel Angel Alvarez <maacruz@navegalia.com>
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001127 old Easy TV BT848 version (model CPH031) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001128 .name = "Askey CPH031/ BESTBUY Easy TV",
1129 .video_inputs = 4,
1130 .audio_inputs = 1,
1131 .tuner = 0,
1132 .svhs = 2,
1133 .gpiomask = 0xF,
1134 .muxsel = { 2, 3, 1, 0},
1135 .audiomux = { 2, 0, 0, 0, 10},
1136 .needs_tvaudio = 0,
1137 .pll = PLL_28,
1138 .tuner_type = TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001139 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001140},{
1141
1142/* ---- card 0x38 ---------------------------------- */
1143 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1144 .name = "Lifeview FlyVideo 98FM LR50",
1145 .video_inputs = 4,
1146 .audio_inputs = 3,
1147 .tuner = 0,
1148 .svhs = 2,
1149 .gpiomask = 0x1800,
1150 .muxsel = { 2, 3, 1, 1},
1151 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1152 .pll = PLL_28,
1153 .tuner_type = 5,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001154 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001155},{
1156 /* This is the ultimate cheapo capture card
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001157 * just a BT848A on a small PCB!
1158 * Steve Hosgood <steve@equiinet.com> */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001159 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1160 .video_inputs = 2,
1161 .audio_inputs = 0,
1162 .tuner = -1,
1163 .svhs = 1,
1164 .gpiomask = 0,
1165 .muxsel = { 3, 1 },
1166 .audiomux = { 0 },
1167 .needs_tvaudio = 0,
1168 .no_msp34xx = 1,
1169 .pll = PLL_35,
1170 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001171 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001172},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001173 /* Daniel Herrington <daniel.herrington@home.com> */
1174 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1175 .video_inputs = 3,
1176 .audio_inputs = 1,
1177 .tuner = 0,
1178 .svhs = 2,
1179 .gpiomask = 0xe00,
1180 .muxsel = { 2, 3, 1, 1},
1181 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1182 .needs_tvaudio = 1,
1183 .pll = PLL_28,
1184 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1185 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001186},{
1187 /* Matti Mottus <mottus@physic.ut.ee> */
1188 .name = "Askey CPH03x TV Capturer",
1189 .video_inputs = 4,
1190 .audio_inputs = 1,
1191 .tuner = 0,
1192 .svhs = 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001193 .gpiomask = 0x03000F,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001194 .muxsel = { 2, 3, 1, 0},
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001195 .audiomux = { 2,0,0,0,1 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001196 .pll = PLL_28,
1197 .tuner_type = 0,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001198 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001199},{
1200
1201/* ---- card 0x3c ---------------------------------- */
1202 /* Philip Blundell <philb@gnu.org> */
1203 .name = "Modular Technology MM100PCTV",
1204 .video_inputs = 2,
1205 .audio_inputs = 2,
1206 .tuner = 0,
1207 .svhs = -1,
1208 .gpiomask = 11,
1209 .muxsel = { 2, 3, 1, 1},
1210 .audiomux = { 2, 0, 0, 1, 8},
1211 .pll = PLL_35,
1212 .tuner_type = TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001213 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001214},{
1215 /* Adrian Cox <adrian@humboldt.co.uk */
1216 .name = "AG Electronics GMV1",
1217 .video_inputs = 2,
1218 .audio_inputs = 0,
1219 .tuner = -1,
1220 .svhs = 1,
1221 .gpiomask = 0xF,
1222 .muxsel = { 2, 2},
1223 .audiomux = { },
1224 .no_msp34xx = 1,
1225 .needs_tvaudio = 0,
1226 .pll = PLL_28,
1227 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001228 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001229},{
1230 /* Miguel Angel Alvarez <maacruz@navegalia.com>
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001231 new Easy TV BT878 version (model CPH061)
1232 special thanks to Informatica Mieres for providing the card */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001233 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1234 .video_inputs = 3,
1235 .audio_inputs = 2,
1236 .tuner = 0,
1237 .svhs = 2,
1238 .gpiomask = 0xFF,
1239 .muxsel = { 2, 3, 1, 0},
1240 .audiomux = { 1, 0, 4, 4, 9},
1241 .needs_tvaudio = 0,
1242 .pll = PLL_28,
1243 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001244 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001245},{
1246 /* Lukas Gebauer <geby@volny.cz> */
1247 .name = "ATI TV-Wonder",
1248 .video_inputs = 3,
1249 .audio_inputs = 1,
1250 .tuner = 0,
1251 .svhs = 2,
1252 .gpiomask = 0xf03f,
1253 .muxsel = { 2, 3, 1, 0 },
1254 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1255 .pll = PLL_28,
1256 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001257 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001258},{
1259
1260/* ---- card 0x40 ---------------------------------- */
1261 /* Lukas Gebauer <geby@volny.cz> */
1262 .name = "ATI TV-Wonder VE",
1263 .video_inputs = 2,
1264 .audio_inputs = 1,
1265 .tuner = 0,
1266 .svhs = -1,
1267 .gpiomask = 1,
1268 .muxsel = { 2, 3, 0, 1},
1269 .audiomux = { 0, 0, 1, 0, 0},
1270 .no_msp34xx = 1,
1271 .pll = PLL_28,
1272 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001273 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001274},{
1275 /* DeeJay <deejay@westel900.net (2000S) */
1276 .name = "Lifeview FlyVideo 2000S LR90",
1277 .video_inputs = 3,
1278 .audio_inputs = 3,
1279 .tuner = 0,
1280 .svhs = 2,
1281 .gpiomask = 0x18e0,
1282 .muxsel = { 2, 3, 0, 1},
1283 /* Radio changed from 1e80 to 0x800 to make
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001284 FlyVideo2000S in .hu happy (gm)*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001285 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1286 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1287 .audio_hook = fv2000s_audio,
1288 .no_msp34xx = 1,
1289 .no_tda9875 = 1,
1290 .needs_tvaudio = 1,
1291 .pll = PLL_28,
1292 .tuner_type = 5,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001293 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001294},{
1295 .name = "Terratec TValueRadio",
1296 .video_inputs = 3,
1297 .audio_inputs = 1,
1298 .tuner = 0,
1299 .svhs = 2,
1300 .gpiomask = 0xffff00,
1301 .muxsel = { 2, 3, 1, 1},
1302 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1303 .needs_tvaudio = 1,
1304 .pll = PLL_28,
1305 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001306 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001307 .has_radio = 1,
1308},{
1309 /* TANAKA Kei <peg00625@nifty.com> */
1310 .name = "IODATA GV-BCTV4/PCI",
1311 .video_inputs = 3,
1312 .audio_inputs = 1,
1313 .tuner = 0,
1314 .svhs = 2,
1315 .gpiomask = 0x010f00,
1316 .muxsel = {2, 3, 0, 0},
1317 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1318 .no_msp34xx = 1,
1319 .pll = PLL_28,
1320 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001321 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001322 .audio_hook = gvbctv3pci_audio,
1323},{
1324
1325/* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001326 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1327 /* try "insmod msp3400 simple=0" if you have
1328 * sound problems with this card. */
1329 .video_inputs = 4,
1330 .audio_inputs = 1,
1331 .tuner = 0,
1332 .svhs = -1,
1333 .gpiomask = 0x4f8a00,
1334 /* 0x100000: 1=MSP enabled (0=disable again)
1335 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1336 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1337 /* tvtuner, radio, external,internal, mute, stereo
1338 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1339 .muxsel = { 2, 3 ,0 ,1},
1340 .tuner_type = TUNER_MT2032,
1341 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001342 .pll = PLL_28,
1343 .has_radio = 1,
1344},{
1345 /* Philip Blundell <pb@nexus.co.uk> */
1346 .name = "Active Imaging AIMMS",
1347 .video_inputs = 1,
1348 .audio_inputs = 0,
1349 .tuner = -1,
1350 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001351 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001352 .pll = PLL_28,
1353 .muxsel = { 2 },
1354 .gpiomask = 0
1355},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001356 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1357 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1358 .video_inputs = 3,
1359 .audio_inputs = 4,
1360 .tuner = 0,
1361 .svhs = 2,
1362 .gpiomask = 15,
1363 .muxsel = { 2, 3, 1, 1},
1364 .audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
1365 .needs_tvaudio = 1,
1366 .pll = PLL_28,
1367 .tuner_type = 25,
1368 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001369 .has_remote = 1,
1370 /* GPIO wiring:
1371 GPIO0: U4.A0 (hef4052bt)
1372 GPIO1: U4.A1
1373 GPIO2: U4.A1 (second hef4052bt)
1374 GPIO3: U4.nEN, U5.A0, A5.nEN
1375 GPIO8-15: vrd866b ?
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001376 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001377},{
1378 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1379 .video_inputs = 4,
1380 .audio_inputs = 0,
1381 .tuner = -1,
1382 .svhs = 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001383 .muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001384 .pll = PLL_28,
1385 .no_msp34xx = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001386 .tuner_type = UNSET,
1387 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001388},{
1389
1390/* ---- card 0x48 ---------------------------------- */
1391 /* Dariusz Kowalewski <darekk@automex.pl> */
1392 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1393 .video_inputs = 4,
1394 .audio_inputs = 1,
1395 .tuner = 0,
1396 .svhs = 2,
1397 .gpiomask = 0x3f,
1398 .muxsel = { 2, 3, 1, 1 },
1399 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1400 .needs_tvaudio = 1,
1401 .no_msp34xx = 1,
1402 .no_tda9875 = 1,
1403 .pll = PLL_28,
1404 .tuner_type = 5,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001405 .tuner_addr = ADDR_UNSET,
1406 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1407 .has_radio = 1, /* Note: not all cards have radio */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001408 .has_remote = 1,
1409 /* GPIO wiring:
1410 GPIO0: A0 hef4052
1411 GPIO1: A1 hef4052
1412 GPIO3: nEN hef4052
1413 GPIO8-15: vrd866b
1414 GPIO20,22,23: R30,R29,R28
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001415 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001416},{
1417 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1418 /* you must jumper JP5 for the card to work */
1419 .name = "Sensoray 311",
1420 .video_inputs = 5,
1421 .audio_inputs = 0,
1422 .tuner = -1,
1423 .svhs = 4,
1424 .gpiomask = 0,
1425 .muxsel = { 2, 3, 1, 0, 0},
1426 .audiomux = { 0 },
1427 .needs_tvaudio = 0,
1428 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001429 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001430},{
1431 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1432 .name = "RemoteVision MX (RV605)",
1433 .video_inputs = 16,
1434 .audio_inputs = 0,
1435 .tuner = -1,
1436 .svhs = -1,
1437 .gpiomask = 0x00,
1438 .gpiomask2 = 0x07ff,
1439 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001440 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001441 .no_msp34xx = 1,
1442 .no_tda9875 = 1,
1443 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001444 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001445 .muxsel_hook = rv605_muxsel,
1446},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001447 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1448 .video_inputs = 3,
1449 .audio_inputs = 2,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001450 .tuner = 0,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001451 .svhs = 2,
1452 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1453 .muxsel = { 2, 1, 1, },
1454 .audiomux = { 0, 1, 2, 2, 4 },
1455 .needs_tvaudio = 0,
1456 .tuner_type = TUNER_PHILIPS_PAL,
1457 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001458 .pll = PLL_28,
1459 .has_radio = 1,
1460},{
1461
1462/* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001463 /* Masaki Suzuki <masaki@btree.org> */
1464 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1465 .video_inputs = 3,
1466 .audio_inputs = 1,
1467 .tuner = 0,
1468 .svhs = 2,
1469 .gpiomask = 0x140007,
1470 .muxsel = { 2, 3, 1, 1 },
1471 .audiomux = { 0, 1, 2, 3, 4, 0 },
1472 .tuner_type = TUNER_PHILIPS_NTSC,
1473 .tuner_addr = ADDR_UNSET,
1474 .audio_hook = windvr_audio,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001475},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001476 .name = "GrandTec Multi Capture Card (Bt878)",
1477 .video_inputs = 4,
1478 .audio_inputs = 0,
1479 .tuner = -1,
1480 .svhs = -1,
1481 .gpiomask = 0,
1482 .muxsel = { 2, 3, 1, 0 },
1483 .audiomux = { 0 },
1484 .needs_tvaudio = 0,
1485 .no_msp34xx = 1,
1486 .pll = PLL_28,
1487 .tuner_type = -1,
1488 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001489},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001490 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1491 .video_inputs = 4,
1492 .audio_inputs = 3,
1493 .tuner = 0,
1494 .svhs = 2,
1495 .gpiomask = 7,
1496 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1497 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1498 * This card lacks external Audio In, so we mute it on Ext. & Int.
1499 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1500 * This card lacks PCI subsystem ID, sigh.
1501 * audiomux=1: lower volume, 2+3: mute
1502 * btwincap uses 0x80000/0x80003
1503 */
1504 .needs_tvaudio = 0,
1505 .no_msp34xx = 1,
1506 .pll = PLL_28,
1507 .tuner_type = 5,
1508 .tuner_addr = ADDR_UNSET,
1509 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1510 radio signal strength indicators work fine. */
1511 .has_radio = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001512 /* GPIO Info:
1513 GPIO0,1: HEF4052 A0,A1
1514 GPIO2: HEF4052 nENABLE
1515 GPIO3-7: n.c.
1516 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1517 GPIO14,15: ??
1518 GPIO16-21: n.c.
1519 GPIO22,23: ??
1520 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1521},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001522 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1523 .name = "DSP Design TCVIDEO",
1524 .video_inputs = 4,
1525 .svhs = -1,
1526 .muxsel = { 2, 3, 1, 0},
1527 .pll = PLL_28,
1528 .tuner_type = -1,
1529 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001530},{
1531
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001532 /* ---- card 0x50 ---------------------------------- */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001533 .name = "Hauppauge WinTV PVR",
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001534 .video_inputs = 4,
1535 .audio_inputs = 1,
1536 .tuner = 0,
1537 .svhs = 2,
1538 .muxsel = { 2, 0, 1, 1},
1539 .needs_tvaudio = 1,
1540 .pll = PLL_28,
1541 .tuner_type = -1,
1542 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001543
1544 .gpiomask = 7,
1545 .audiomux = {7},
1546},{
1547 .name = "IODATA GV-BCTV5/PCI",
1548 .video_inputs = 3,
1549 .audio_inputs = 1,
1550 .tuner = 0,
1551 .svhs = 2,
1552 .gpiomask = 0x0f0f80,
1553 .muxsel = {2, 3, 1, 0},
1554 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1555 .no_msp34xx = 1,
1556 .pll = PLL_28,
1557 .tuner_type = TUNER_PHILIPS_NTSC_M,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001558 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001559 .audio_hook = gvbctv5pci_audio,
1560 .has_radio = 1,
1561},{
1562 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1563 .video_inputs = 4, /* id-inputs-clock */
1564 .audio_inputs = 0,
1565 .tuner = -1,
1566 .svhs = 3,
1567 .muxsel = { 3, 2, 0, 1 },
1568 .pll = PLL_28,
1569 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001570 .tuner_addr = ADDR_UNSET,
1571 .no_msp34xx = 1,
1572 .no_tda9875 = 1,
1573 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001574},{
1575 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1576 .video_inputs = 3,
1577 .audio_inputs = 0,
1578 .tuner = -1,
1579 .svhs = 2,
1580 .muxsel = { 2, 3, 1 },
1581 .pll = PLL_28,
1582 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001583 .tuner_addr = ADDR_UNSET,
1584 .no_msp34xx = 1,
1585 .no_tda9875 = 1,
1586 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001587},{
1588
1589 /* ---- card 0x54 ---------------------------------- */
1590 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1591 .video_inputs = 2,
1592 .audio_inputs = 0,
1593 .tuner = -1,
1594 .svhs = 1,
1595 .muxsel = { 3, 1 },
1596 .pll = PLL_28,
1597 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001598 .tuner_addr = ADDR_UNSET,
1599 .no_msp34xx = 1,
1600 .no_tda9875 = 1,
1601 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001602},{
1603 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1604 .video_inputs = 1,
1605 .audio_inputs = 0,
1606 .tuner = -1,
1607 .svhs = -1,
1608 .muxsel = { 0 },
1609 .pll = PLL_28,
1610 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001611 .tuner_addr = ADDR_UNSET,
1612 .no_msp34xx = 1,
1613 .no_tda9875 = 1,
1614 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001615},{
1616 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1617 .video_inputs = 2,
1618 .audio_inputs = 0,
1619 .tuner = -1,
1620 .svhs = 1,
1621 .muxsel = { 0, 1 },
1622 .pll = PLL_28,
1623 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001624 .tuner_addr = ADDR_UNSET,
1625 .no_msp34xx = 1,
1626 .no_tda9875 = 1,
1627 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001628},{
1629 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1630 .video_inputs = 1,
1631 .audio_inputs = 1,
1632 .tuner = -1,
1633 .svhs = -1,
1634 .muxsel = { 0 },
1635 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001636 .tuner_type = UNSET,
1637 .tuner_addr = ADDR_UNSET,
1638 .no_msp34xx = 1,
1639 .no_tda9875 = 1,
1640 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001641},{
1642
1643 /* ---- card 0x58 ---------------------------------- */
1644 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1645 .video_inputs = 2,
1646 .audio_inputs = 1,
1647 .tuner = -1,
1648 .svhs = 1,
1649 .muxsel = { 0, 1 },
1650 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001651 .tuner_type = UNSET,
1652 .tuner_addr = ADDR_UNSET,
1653 .no_msp34xx = 1,
1654 .no_tda9875 = 1,
1655 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001656},{
1657 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1658 .video_inputs = 2,
1659 .audio_inputs = 1,
1660 .tuner = -1,
1661 .svhs = 1,
1662 .muxsel = { 2, 3 },
1663 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001664 .tuner_type = UNSET,
1665 .tuner_addr = ADDR_UNSET,
1666 .no_msp34xx = 1,
1667 .no_tda9875 = 1,
1668 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001669},{
1670 .name = "Osprey 500", /* 500 */
1671 .video_inputs = 2,
1672 .audio_inputs = 1,
1673 .tuner = -1,
1674 .svhs = 1,
1675 .muxsel = { 2, 3 },
1676 .pll = PLL_28,
1677 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001678 .tuner_addr = ADDR_UNSET,
1679 .no_msp34xx = 1,
1680 .no_tda9875 = 1,
1681 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001682},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001683 .name = "Osprey 540", /* 540 */
1684 .video_inputs = 4,
1685 .audio_inputs = 1,
1686 .tuner = -1,
1687 .pll = PLL_28,
1688 .tuner_type = -1,
1689 .tuner_addr = ADDR_UNSET,
1690 .no_msp34xx = 1,
1691 .no_tda9875 = 1,
1692 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001693},{
1694
1695 /* ---- card 0x5C ---------------------------------- */
1696 .name = "Osprey 2000", /* 2000 */
1697 .video_inputs = 2,
1698 .audio_inputs = 1,
1699 .tuner = -1,
1700 .svhs = 1,
1701 .muxsel = { 2, 3 },
1702 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001703 .tuner_type = UNSET,
1704 .tuner_addr = ADDR_UNSET,
1705 .no_msp34xx = 1,
1706 .no_tda9875 = 1,
1707 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001708},{
1709 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1710 .name = "IDS Eagle",
1711 .video_inputs = 4,
1712 .audio_inputs = 0,
1713 .tuner = -1,
1714 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001715 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001716 .svhs = -1,
1717 .gpiomask = 0,
1718 .muxsel = { 0, 1, 2, 3 },
1719 .muxsel_hook = eagle_muxsel,
1720 .no_msp34xx = 1,
1721 .no_tda9875 = 1,
1722 .pll = PLL_28,
1723},{
1724 .name = "Pinnacle PCTV Sat",
1725 .video_inputs = 2,
1726 .audio_inputs = 0,
1727 .svhs = 1,
1728 .tuner = -1,
1729 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001730 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001731 .no_msp34xx = 1,
1732 .no_tda9875 = 1,
1733 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001734 .muxsel = { 3, 0, 1, 2},
Linus Torvalds1da177e2005-04-16 15:20:36 -07001735 .pll = PLL_28,
1736 .no_gpioirq = 1,
1737 .has_dvb = 1,
1738},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001739 .name = "Formac ProTV II (bt878)",
1740 .video_inputs = 4,
1741 .audio_inputs = 1,
1742 .tuner = 0,
1743 .svhs = 3,
1744 .gpiomask = 2,
1745 /* TV, Comp1, Composite over SVID con, SVID */
1746 .muxsel = { 2, 3, 1, 1},
1747 .audiomux = { 2, 2, 0, 0, 0 },
1748 .pll = PLL_28,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001749 .has_radio = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001750 .tuner_type = TUNER_PHILIPS_PAL,
1751 .tuner_addr = ADDR_UNSET,
1752/* sound routing:
1753 GPIO=0x00,0x01,0x03: mute (?)
1754 0x02: both TV and radio (tuner: FM1216/I)
1755 The card has onboard audio connectors labeled "cdrom" and "board",
1756 not soldered here, though unknown wiring.
1757 Card lacks: external audio in, pci subsystem id.
1758*/
Linus Torvalds1da177e2005-04-16 15:20:36 -07001759},{
1760
1761 /* ---- card 0x60 ---------------------------------- */
1762 .name = "MachTV",
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001763 .video_inputs = 3,
1764 .audio_inputs = 1,
1765 .tuner = 0,
1766 .svhs = -1,
1767 .gpiomask = 7,
1768 .muxsel = { 2, 3, 1, 1},
1769 .audiomux = { 0, 1, 2, 3, 4},
1770 .needs_tvaudio = 1,
1771 .tuner_type = 5,
1772 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001773 .pll = 1,
1774},{
1775 .name = "Euresys Picolo",
1776 .video_inputs = 3,
1777 .audio_inputs = 0,
1778 .tuner = -1,
1779 .svhs = 2,
1780 .gpiomask = 0,
1781 .no_msp34xx = 1,
1782 .no_tda9875 = 1,
1783 .no_tda7432 = 1,
1784 .muxsel = { 2, 0, 1},
1785 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001786 .tuner_type = UNSET,
1787 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001788},{
1789 /* Luc Van Hoeylandt <luc@e-magic.be> */
1790 .name = "ProVideo PV150", /* 0x4f */
1791 .video_inputs = 2,
1792 .audio_inputs = 0,
1793 .tuner = -1,
1794 .svhs = -1,
1795 .gpiomask = 0,
1796 .muxsel = { 2, 3 },
1797 .audiomux = { 0 },
1798 .needs_tvaudio = 0,
1799 .no_msp34xx = 1,
1800 .pll = PLL_28,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001801 .tuner_type = UNSET,
1802 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001803},{
1804 /* Hiroshi Takekawa <sian@big.or.jp> */
1805 /* This card lacks subsystem ID */
1806 .name = "AD-TVK503", /* 0x63 */
1807 .video_inputs = 4,
1808 .audio_inputs = 1,
1809 .tuner = 0,
1810 .svhs = 2,
1811 .gpiomask = 0x001e8007,
1812 .muxsel = { 2, 3, 1, 0 },
1813 /* Tuner, Radio, external, internal, off, on */
1814 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
1815 .needs_tvaudio = 0,
1816 .no_msp34xx = 1,
1817 .pll = PLL_28,
1818 .tuner_type = 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001819 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001820 .audio_hook = adtvk503_audio,
1821},{
1822
1823 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001824 .name = "Hercules Smart TV Stereo",
1825 .video_inputs = 4,
1826 .audio_inputs = 1,
1827 .tuner = 0,
1828 .svhs = 2,
1829 .gpiomask = 0x00,
1830 .muxsel = { 2, 3, 1, 1 },
1831 .needs_tvaudio = 1,
1832 .no_msp34xx = 1,
1833 .pll = PLL_28,
1834 .tuner_type = 5,
1835 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001836 /* Notes:
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001837 - card lacks subsystem ID
1838 - stereo variant w/ daughter board with tda9874a @0xb0
1839 - Audio Routing:
Linus Torvalds1da177e2005-04-16 15:20:36 -07001840 always from tda9874 independent of GPIO (?)
1841 external line in: unknown
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001842 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1843 hef4053 (instead 4052) for unknown function
Linus Torvalds1da177e2005-04-16 15:20:36 -07001844 */
1845},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001846 .name = "Pace TV & Radio Card",
1847 .video_inputs = 4,
1848 .audio_inputs = 1,
1849 .tuner = 0,
1850 .svhs = 2,
1851 .muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
1852 .gpiomask = 0,
1853 .no_tda9875 = 1,
1854 .no_tda7432 = 1,
1855 .tuner_type = 1,
1856 .tuner_addr = ADDR_UNSET,
1857 .has_radio = 1,
1858 .pll = PLL_28,
1859 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1860 only internal line out: (4pin header) RGGL
1861 Radio must be decoded by msp3410d (not routed through)*/
1862 /*
1863 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1864 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001865},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001866 /* Chris Willing <chris@vislab.usyd.edu.au> */
1867 .name = "IVC-200",
1868 .video_inputs = 1,
1869 .audio_inputs = 0,
1870 .tuner = -1,
1871 .tuner_type = -1,
1872 .tuner_addr = ADDR_UNSET,
1873 .svhs = -1,
1874 .gpiomask = 0xdf,
1875 .muxsel = { 2 },
1876 .pll = PLL_28,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001877},{
1878 .name = "Grand X-Guard / Trust 814PCI",
1879 .video_inputs = 16,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001880 .audio_inputs = 0,
1881 .tuner = -1,
1882 .svhs = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001883 .tuner_type = 4,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001884 .tuner_addr = ADDR_UNSET,
1885 .gpiomask2 = 0xff,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001886 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
1887 .muxsel_hook = xguard_muxsel,
1888 .no_msp34xx = 1,
1889 .no_tda9875 = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001890 .no_tda7432 = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001891 .pll = PLL_28,
1892},{
1893
1894 /* ---- card 0x68 ---------------------------------- */
1895 .name = "Nebula Electronics DigiTV",
1896 .video_inputs = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001897 .tuner = -1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001898 .svhs = -1,
1899 .muxsel = { 2, 3, 1, 0},
1900 .no_msp34xx = 1,
1901 .no_tda9875 = 1,
1902 .no_tda7432 = 1,
1903 .pll = PLL_28,
1904 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001905 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001906 .has_dvb = 1,
1907 .no_gpioirq = 1,
1908},{
1909 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
1910 .name = "ProVideo PV143",
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001911 .video_inputs = 4,
1912 .audio_inputs = 0,
1913 .tuner = -1,
1914 .svhs = -1,
1915 .gpiomask = 0,
1916 .muxsel = { 2, 3, 1, 0 },
1917 .audiomux = { 0 },
1918 .needs_tvaudio = 0,
1919 .no_msp34xx = 1,
1920 .pll = PLL_28,
1921 .tuner_type = -1,
1922 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001923},{
1924 /* M.Klahr@phytec.de */
1925 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
1926 .video_inputs = 4,
1927 .audio_inputs = 0,
1928 .tuner = -1, /* card has no tuner */
1929 .svhs = 3,
1930 .gpiomask = 0x00,
1931 .muxsel = { 2, 3, 1, 0},
1932 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1933 .needs_tvaudio = 1,
1934 .pll = PLL_28,
1935 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001936 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001937},{
1938 .name = "PHYTEC VD-009-X1 Combi (bt878)",
1939 .video_inputs = 4,
1940 .audio_inputs = 0,
1941 .tuner = -1, /* card has no tuner */
1942 .svhs = 3,
1943 .gpiomask = 0x00,
1944 .muxsel = { 2, 3, 1, 1},
1945 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1946 .needs_tvaudio = 1,
1947 .pll = PLL_28,
1948 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001949 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001950},{
1951
1952 /* ---- card 0x6c ---------------------------------- */
1953 .name = "PHYTEC VD-009 MiniDIN (bt878)",
1954 .video_inputs = 10,
1955 .audio_inputs = 0,
1956 .tuner = -1, /* card has no tuner */
1957 .svhs = 9,
1958 .gpiomask = 0x00,
1959 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001960 via the upper nibble of muxsel. here: used for
1961 xternal video-mux */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001962 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
1963 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1964 .needs_tvaudio = 1,
1965 .pll = PLL_28,
1966 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001967 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001968},{
1969 .name = "PHYTEC VD-009 Combi (bt878)",
1970 .video_inputs = 10,
1971 .audio_inputs = 0,
1972 .tuner = -1, /* card has no tuner */
1973 .svhs = 9,
1974 .gpiomask = 0x00,
1975 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001976 via the upper nibble of muxsel. here: used for
1977 xternal video-mux */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001978 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
1979 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
1980 .needs_tvaudio = 1,
1981 .pll = PLL_28,
1982 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001983 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001984},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001985 .name = "IVC-100",
1986 .video_inputs = 4,
1987 .audio_inputs = 0,
1988 .tuner = -1,
1989 .tuner_type = -1,
1990 .tuner_addr = ADDR_UNSET,
1991 .svhs = -1,
1992 .gpiomask = 0xdf,
1993 .muxsel = { 2, 3, 1, 0 },
1994 .pll = PLL_28,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001995},{
1996 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
1997 .name = "IVC-120G",
1998 .video_inputs = 16,
1999 .audio_inputs = 0, /* card has no audio */
2000 .tuner = -1, /* card has no tuner */
2001 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002002 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002003 .svhs = -1, /* card has no svhs */
2004 .needs_tvaudio = 0,
2005 .no_msp34xx = 1,
2006 .no_tda9875 = 1,
2007 .no_tda7432 = 1,
2008 .gpiomask = 0x00,
2009 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002010 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002011 .muxsel_hook = ivc120_muxsel,
2012 .pll = PLL_28,
2013},{
2014
2015 /* ---- card 0x70 ---------------------------------- */
2016 .name = "pcHDTV HD-2000 TV",
2017 .video_inputs = 4,
2018 .audio_inputs = 1,
2019 .tuner = 0,
2020 .svhs = 2,
2021 .muxsel = { 2, 3, 1, 0},
2022 .tuner_type = TUNER_PHILIPS_ATSC,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002023 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002024 .has_dvb = 1,
2025},{
2026 .name = "Twinhan DST + clones",
2027 .no_msp34xx = 1,
2028 .no_tda9875 = 1,
2029 .no_tda7432 = 1,
2030 .tuner_type = TUNER_ABSENT,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002031 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002032 .no_video = 1,
2033 .has_dvb = 1,
2034},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002035 .name = "Winfast VC100",
Linus Torvalds1da177e2005-04-16 15:20:36 -07002036 .video_inputs = 3,
2037 .audio_inputs = 0,
2038 .svhs = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002039 .tuner = -1,
2040 .muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
2041 .no_msp34xx = 1,
2042 .no_tda9875 = 1,
2043 .no_tda7432 = 1,
2044 .tuner_type = TUNER_ABSENT,
2045 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002046 .pll = PLL_28,
2047},{
2048 .name = "Teppro TEV-560/InterVision IV-560",
2049 .video_inputs = 3,
2050 .audio_inputs = 1,
2051 .tuner = 0,
2052 .svhs = 2,
2053 .gpiomask = 3,
2054 .muxsel = { 2, 3, 1, 1},
2055 .audiomux = { 1, 1, 1, 1, 0},
2056 .needs_tvaudio = 1,
2057 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002058 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002059 .pll = PLL_35,
2060},{
2061
2062 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002063 .name = "SIMUS GVC1100",
2064 .video_inputs = 4,
2065 .audio_inputs = 0,
2066 .tuner = -1,
2067 .svhs = -1,
2068 .tuner_type = -1,
2069 .tuner_addr = ADDR_UNSET,
2070 .pll = PLL_28,
2071 .muxsel = { 2, 2, 2, 2},
2072 .gpiomask = 0x3F,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002073 .muxsel_hook = gvc1100_muxsel,
2074},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002075 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2076 .name = "NGS NGSTV+",
2077 .video_inputs = 3,
2078 .tuner = 0,
2079 .svhs = 2,
2080 .gpiomask = 0x008007,
2081 .muxsel = {2, 3, 0, 0},
2082 .audiomux = {0, 0, 0, 0, 0x000003, 0},
2083 .pll = PLL_28,
2084 .tuner_type = TUNER_PHILIPS_PAL,
2085 .tuner_addr = ADDR_UNSET,
2086 .has_remote = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002087},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002088 /* http://linuxmedialabs.com */
2089 .name = "LMLBT4",
2090 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2091 .audio_inputs = 0,
2092 .tuner = -1,
2093 .svhs = -1,
2094 .muxsel = { 2, 3, 1, 0 },
2095 .no_msp34xx = 1,
2096 .no_tda9875 = 1,
2097 .no_tda7432 = 1,
2098 .needs_tvaudio = 0,
2099 .tuner_type = -1,
2100 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002101},{
2102 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2103 .name = "Tekram M205 PRO",
2104 .video_inputs = 3,
2105 .audio_inputs = 1,
2106 .tuner = 0,
2107 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002108 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002109 .svhs = 2,
2110 .needs_tvaudio = 0,
2111 .gpiomask = 0x68,
2112 .muxsel = { 2, 3, 1},
2113 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2114 .pll = PLL_28,
2115},{
2116
2117 /* ---- card 0x78 ---------------------------------- */
2118 /* Javier Cendan Ares <jcendan@lycos.es> */
2119 /* bt878 TV + FM without subsystem ID */
2120 .name = "Conceptronic CONTVFMi",
2121 .video_inputs = 3,
2122 .audio_inputs = 1,
2123 .tuner = 0,
2124 .svhs = 2,
2125 .gpiomask = 0x008007,
2126 .muxsel = { 2, 3, 1, 1 },
2127 .audiomux = { 0, 1, 2, 2, 3 },
2128 .needs_tvaudio = 0,
2129 .pll = PLL_28,
2130 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002131 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002132 .has_remote = 1,
2133 .has_radio = 1,
2134},{
2135 /*Eric DEBIEF <debief@telemsa.com>*/
2136 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
2137 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_PICOLO_TETRA_CHIP*/
2138 /*0x79 in bttv.h*/
2139 .name = "Euresys Picolo Tetra",
2140 .video_inputs = 4,
2141 .audio_inputs = 0,
2142 .tuner = -1,
2143 .svhs = -1,
2144 .gpiomask = 0,
2145 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2146 .no_msp34xx = 1,
2147 .no_tda9875 = 1,
2148 .no_tda7432 = 1,
2149 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2150 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2151 .pll = PLL_28,
2152 .needs_tvaudio = 0,
2153 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002154 .tuner_type = -1,
2155 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002156},{
2157 /* Spirit TV Tuner from http://spiritmodems.com.au */
2158 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2159 .name = "Spirit TV Tuner",
2160 .video_inputs = 3,
2161 .audio_inputs = 1,
2162 .tuner = 0,
2163 .svhs = 2,
2164 .gpiomask = 0x0000000f,
2165 .muxsel = { 2, 1, 1 },
2166 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2167 .tuner_type = TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002168 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002169 .no_msp34xx = 1,
2170 .no_tda9875 = 1,
2171},{
2172 /* Wolfram Joost <wojo@frokaschwei.de> */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002173 .name = "AVerMedia AVerTV DVB-T 771",
2174 .video_inputs = 2,
2175 .svhs = 1,
2176 .tuner = -1,
2177 .tuner_type = TUNER_ABSENT,
2178 .tuner_addr = ADDR_UNSET,
2179 .muxsel = { 3 , 3 },
2180 .no_msp34xx = 1,
2181 .no_tda9875 = 1,
2182 .no_tda7432 = 1,
2183 .pll = PLL_28,
2184 .has_dvb = 1,
2185 .no_gpioirq = 1,
2186 .has_remote = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002187},{
2188 /* ---- card 0x7c ---------------------------------- */
2189 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
2190 /* Based on the Nebula card data - added remote and new card number - BTTV_AVDVBT_761, see also ir-kbd-gpio.c */
2191 .name = "AverMedia AverTV DVB-T 761",
2192 .video_inputs = 2,
2193 .tuner = -1,
2194 .svhs = 1,
2195 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2196 .no_msp34xx = 1,
2197 .no_tda9875 = 1,
2198 .no_tda7432 = 1,
2199 .pll = PLL_28,
2200 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002201 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002202 .has_dvb = 1,
2203 .no_gpioirq = 1,
2204 .has_remote = 1,
2205},{
2206 /* andre.schwarz@matrix-vision.de */
2207 .name = "MATRIX Vision Sigma-SQ",
2208 .video_inputs = 16,
2209 .audio_inputs = 0,
2210 .tuner = -1,
2211 .svhs = -1,
2212 .gpiomask = 0x0,
2213 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002214 3, 3, 3, 3, 3, 3, 3, 3 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002215 .muxsel_hook = sigmaSQ_muxsel,
2216 .audiomux = { 0 },
2217 .no_msp34xx = 1,
2218 .pll = PLL_28,
2219 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002220 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002221},{
2222 /* andre.schwarz@matrix-vision.de */
2223 .name = "MATRIX Vision Sigma-SLC",
2224 .video_inputs = 4,
2225 .audio_inputs = 0,
2226 .tuner = -1,
2227 .svhs = -1,
2228 .gpiomask = 0x0,
2229 .muxsel = { 2, 2, 2, 2 },
2230 .muxsel_hook = sigmaSLC_muxsel,
2231 .audiomux = { 0 },
2232 .no_msp34xx = 1,
2233 .pll = PLL_28,
2234 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002235 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002236},{
2237 /* BTTV_APAC_VIEWCOMP */
2238 /* Attila Kondoros <attila.kondoros@chello.hu> */
2239 /* bt878 TV + FM 0x00000000 subsystem ID */
2240 .name = "APAC Viewcomp 878(AMAX)",
2241 .video_inputs = 2,
2242 .audio_inputs = 1,
2243 .tuner = 0,
2244 .svhs = -1,
2245 .gpiomask = 0xFF,
2246 .muxsel = { 2, 3, 1, 1},
2247 .audiomux = { 2, 0, 0, 0, 10},
2248 .needs_tvaudio = 0,
2249 .pll = PLL_28,
2250 .tuner_type = TUNER_PHILIPS_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002251 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002252 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2253 .has_radio = 1, /* not every card has radio */
2254},{
2255
2256 /* ---- card 0x80 ---------------------------------- */
2257 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
Mauro Carvalho Chehab10c35cf2005-09-09 13:03:52 -07002258 .name = "DViCO FusionHDTV DVB-T Lite",
Linus Torvalds1da177e2005-04-16 15:20:36 -07002259 .tuner = -1,
2260 .no_msp34xx = 1,
2261 .no_tda9875 = 1,
2262 .no_tda7432 = 1,
2263 .pll = PLL_28,
2264 .no_video = 1,
2265 .has_dvb = 1,
2266 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002267 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002268},{
2269 /* Steven <photon38@pchome.com.tw> */
2270 .name = "V-Gear MyVCD",
2271 .video_inputs = 3,
2272 .audio_inputs = 1,
2273 .tuner = 0,
2274 .svhs = 2,
2275 .gpiomask = 0x3f,
2276 .muxsel = {2, 3, 1, 0},
2277 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2278 .no_msp34xx = 1,
2279 .pll = PLL_28,
2280 .tuner_type = TUNER_PHILIPS_NTSC_M,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002281 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002282 .has_radio = 0,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002283},{
2284 /* Rick C <cryptdragoon@gmail.com> */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002285 .name = "Super TV Tuner",
2286 .video_inputs = 4,
2287 .audio_inputs = 1,
2288 .tuner = 0,
2289 .svhs = 2,
2290 .muxsel = { 2, 3, 1, 0},
2291 .tuner_type = TUNER_PHILIPS_NTSC,
2292 .tuner_addr = ADDR_UNSET,
2293 .gpiomask = 0x008007,
2294 .audiomux = { 0, 0x000001,0,0, 0},
2295 .needs_tvaudio = 1,
2296 .has_radio = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002297},{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002298 /* Chris Fanning <video4linux@haydon.net> */
2299 .name = "Tibet Systems 'Progress DVR' CS16",
2300 .video_inputs = 16,
2301 .audio_inputs = 0,
2302 .tuner = -1,
2303 .svhs = -1,
2304 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2305 .pll = PLL_28,
2306 .no_msp34xx = 1,
2307 .no_tda9875 = 1,
2308 .no_tda7432 = 1,
2309 .tuner_type = -1,
2310 .tuner_addr = ADDR_UNSET,
2311 .muxsel_hook = tibetCS16_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002312},
2313{
2314 /* Bill Brack <wbrack@mmm.com.hk> */
2315 /*
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002316 * Note that, because of the card's wiring, the "master"
2317 * BT878A chip (i.e. the one which controls the analog switch
2318 * and must use this card type) is the 2nd one detected. The
2319 * other 3 chips should use card type 0x85, whose description
2320 * follows this one. There is a EEPROM on the card (which is
2321 * connected to the I2C of one of those other chips), but is
2322 * not currently handled. There is also a facility for a
2323 * "monitor", which is also not currently implemented.
2324 */
2325 .name = "Kodicom 4400R (master)",
Linus Torvalds1da177e2005-04-16 15:20:36 -07002326 .video_inputs = 16,
2327 .audio_inputs = 0,
2328 .tuner = -1,
2329 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002330 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002331 .svhs = -1,
2332 /* GPIO bits 0-9 used for analog switch:
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002333 * 00 - 03: camera selector
2334 * 04 - 06: channel (controller) selector
2335 * 07: data (1->on, 0->off)
2336 * 08: strobe
2337 * 09: reset
2338 * bit 16 is input from sync separator for the channel
2339 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002340 .gpiomask = 0x0003ff,
2341 .no_gpioirq = 1,
2342 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2343 .pll = PLL_28,
2344 .no_msp34xx = 1,
2345 .no_tda7432 = 1,
2346 .no_tda9875 = 1,
2347 .muxsel_hook = kodicom4400r_muxsel,
2348},
2349{
2350 /* Bill Brack <wbrack@mmm.com.hk> */
2351 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002352 * one which controls the analog switch, and must use the card type)
2353 * is the 2nd one detected. The other 3 chips should use this card
2354 * type
2355 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002356 .name = "Kodicom 4400R (slave)",
2357 .video_inputs = 16,
2358 .audio_inputs = 0,
2359 .tuner = -1,
2360 .tuner_type = -1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002361 .tuner_addr = ADDR_UNSET,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002362 .svhs = -1,
2363 .gpiomask = 0x010000,
2364 .no_gpioirq = 1,
2365 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2366 .pll = PLL_28,
2367 .no_msp34xx = 1,
2368 .no_tda7432 = 1,
2369 .no_tda9875 = 1,
2370 .muxsel_hook = kodicom4400r_muxsel,
Peter Skipworth93b43f12005-06-23 22:04:45 -07002371},
2372{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002373 /* ---- card 0x86---------------------------------- */
2374 /* Michael Henson <mhenson@clarityvi.com> */
2375 /* Adlink RTV24 with special unlock codes */
2376 .name = "Adlink RTV24",
2377 .video_inputs = 4,
2378 .audio_inputs = 1,
2379 .tuner = 0,
2380 .svhs = 2,
2381 .muxsel = { 2, 3, 1, 0},
2382 .tuner_type = -1,
2383 .tuner_addr = ADDR_UNSET,
2384 .pll = PLL_28,
2385},
2386{
2387 /* ---- card 0x87---------------------------------- */
2388 /* Michael Krufky <mkrufky@m1k.net> */
Mauro Carvalho Chehab10c35cf2005-09-09 13:03:52 -07002389 .name = "DViCO FusionHDTV 5 Lite",
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002390 .tuner = 0,
2391 .tuner_type = TUNER_LG_TDVS_H062F,
2392 .tuner_addr = ADDR_UNSET,
Michael Krufkyd3089792005-10-11 09:28:24 -07002393 .video_inputs = 3,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002394 .audio_inputs = 1,
2395 .svhs = 2,
Michael Krufkyd3089792005-10-11 09:28:24 -07002396 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002397 .gpiomask = 0x00e00007,
Michael Krufky79dfa4a2005-09-30 11:58:58 -07002398 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002399 .no_msp34xx = 1,
2400 .no_tda9875 = 1,
2401 .no_tda7432 = 1,
Michael Krufky99d6c342005-11-08 21:36:26 -08002402 .has_dvb = 1,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002403},{
2404 /* ---- card 0x88---------------------------------- */
2405 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2406 .name = "Acorp Y878F",
2407 .video_inputs = 3,
2408 .audio_inputs = 1,
2409 .tuner = 0,
2410 .svhs = 2,
2411 .gpiomask = 0x01fe00,
2412 .muxsel = { 2, 3, 1, 1},
2413 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2414 .needs_tvaudio = 1,
2415 .pll = PLL_28,
2416 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2417 .tuner_addr = 0xc1 >>1,
2418 .has_radio = 1,
Ricardo Cerqueiracc9d8d42005-11-08 21:36:20 -08002419},{
2420 /* ---- card 0x89 ---------------------------------- */
2421 .name = "Conceptronic CTVFMi v2",
2422 .video_inputs = 3,
2423 .audio_inputs = 1,
2424 .tuner = 0,
2425 .svhs = 2,
2426 .gpiomask = 0x001c0007,
2427 .muxsel = { 2, 3, 1, 1 },
2428 .audiomux = { 0, 1, 2, 2, 3 },
2429 .needs_tvaudio = 0,
2430 .pll = PLL_28,
2431 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2432 .tuner_addr = ADDR_UNSET,
2433 .has_remote = 1,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002434}};
2435
2436static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2437
2438/* ----------------------------------------------------------------------- */
2439
2440static unsigned char eeprom_data[256];
2441
2442/*
2443 * identify card
2444 */
2445void __devinit bttv_idcard(struct bttv *btv)
2446{
2447 unsigned int gpiobits;
2448 int i,type;
2449 unsigned short tmp;
2450
2451 /* read PCI subsystem ID */
2452 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2453 btv->cardid = tmp << 16;
2454 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2455 btv->cardid |= tmp;
2456
2457 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2458 /* look for the card */
2459 for (type = -1, i = 0; cards[i].id != 0; i++)
2460 if (cards[i].id == btv->cardid)
2461 type = i;
2462
2463 if (type != -1) {
2464 /* found it */
2465 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2466 "PCI subsystem ID is %04x:%04x\n",
2467 btv->c.nr,cards[type].name,cards[type].cardnr,
2468 btv->cardid & 0xffff,
2469 (btv->cardid >> 16) & 0xffff);
2470 btv->c.type = cards[type].cardnr;
2471 } else {
2472 /* 404 */
2473 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2474 btv->c.nr, btv->cardid & 0xffff,
2475 (btv->cardid >> 16) & 0xffff);
2476 printk(KERN_DEBUG "please mail id, board name and "
2477 "the correct card= insmod option to kraxel@bytesex.org\n");
2478 }
2479 }
2480
2481 /* let the user override the autodetected type */
2482 if (card[btv->c.nr] < bttv_num_tvcards)
2483 btv->c.type=card[btv->c.nr];
2484
2485 /* print which card config we are using */
2486 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2487 bttv_tvcards[btv->c.type].name, btv->c.type,
2488 card[btv->c.nr] < bttv_num_tvcards
2489 ? "insmod option" : "autodetected");
2490
2491 /* overwrite gpio stuff ?? */
2492 if (UNSET == audioall && UNSET == audiomux[0])
2493 return;
2494
2495 if (UNSET != audiomux[0]) {
2496 gpiobits = 0;
2497 for (i = 0; i < 5; i++) {
2498 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2499 gpiobits |= audiomux[i];
2500 }
2501 } else {
2502 gpiobits = audioall;
2503 for (i = 0; i < 5; i++) {
2504 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2505 }
2506 }
2507 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2508 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2509 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2510 for (i = 0; i < 5; i++) {
2511 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2512 }
2513 printk("\n");
2514}
2515
2516/*
2517 * (most) board specific initialisations goes here
2518 */
2519
2520/* Some Modular Technology cards have an eeprom, but no subsystem ID */
2521void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2522{
2523 int type = -1;
2524
2525 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2526 type = BTTV_MODTEC_205;
2527 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2528 type = BTTV_EURESYS_PICOLO;
2529 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2530 type = BTTV_HAUPPAUGE; /* old bt848 */
2531
2532 if (-1 != type) {
2533 btv->c.type = type;
2534 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2535 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2536 }
2537}
2538
2539static void flyvideo_gpio(struct bttv *btv)
2540{
2541 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2542 int tuner=-1,ttype;
2543
2544 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002545 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002546 gpio = gpio_read();
2547 /* FIXME: must restore OUR_EN ??? */
2548
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002549 /* all cards provide GPIO info, some have an additional eeprom
2550 * LR50: GPIO coding can be found lower right CP1 .. CP9
2551 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2552 * GPIO14-12: n.c.
2553 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002554
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002555 * lowest 3 bytes are remote control codes (no handshake needed)
2556 * xxxFFF: No remote control chip soldered
2557 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2558 * Note: Some bits are Audio_Mask !
2559 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002560 ttype=(gpio&0x0f0000)>>16;
2561 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002562 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002563 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002564 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002565 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002566 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002567 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002568 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002569 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002570 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002571 break;
2572 default:
2573 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2574 }
2575
2576 has_remote = gpio & 0x800000;
2577 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002578 /* unknown 0x200000;
2579 * unknown2 0x100000; */
2580 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002581 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002582 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2583 /*
2584 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002585
2586 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002587 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002588
2589 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2590 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2591 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2592 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2593 is_capture_only?"yes":"no ");
2594
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002595 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002596 btv->tuner_type = tuner;
2597 btv->has_radio = has_radio;
2598
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002599 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2600 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2601 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002602 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002603 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002604}
2605
2606static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2607 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2608static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2609 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2610
2611static void miro_pinnacle_gpio(struct bttv *btv)
2612{
2613 int id,msp,gpio;
2614 char *info;
2615
2616 gpio_inout(0xffffff, 0);
2617 gpio = gpio_read();
2618 id = ((gpio>>10) & 63) -1;
2619 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2620 if (id < 32) {
2621 btv->tuner_type = miro_tunermap[id];
2622 if (0 == (gpio & 0x20)) {
2623 btv->has_radio = 1;
2624 if (!miro_fmtuner[id]) {
2625 btv->has_matchbox = 1;
2626 btv->mbox_we = (1<<6);
2627 btv->mbox_most = (1<<7);
2628 btv->mbox_clk = (1<<8);
2629 btv->mbox_data = (1<<9);
2630 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
2631 }
2632 } else {
2633 btv->has_radio = 0;
2634 }
2635 if (-1 != msp) {
2636 if (btv->c.type == BTTV_MIRO)
2637 btv->c.type = BTTV_MIROPRO;
2638 if (btv->c.type == BTTV_PINNACLE)
2639 btv->c.type = BTTV_PINNACLEPRO;
2640 }
2641 printk(KERN_INFO
2642 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
2643 btv->c.nr, id+1, btv->tuner_type,
2644 !btv->has_radio ? "no" :
2645 (btv->has_matchbox ? "matchbox" : "fmtuner"),
2646 (-1 == msp) ? "no" : "yes");
2647 } else {
2648 /* new cards with microtune tuner */
2649 id = 63 - id;
2650 btv->has_radio = 0;
2651 switch (id) {
2652 case 1:
2653 info = "PAL / mono";
2654 break;
2655 case 2:
2656 info = "PAL+SECAM / stereo";
2657 btv->has_radio = 1;
2658 break;
2659 case 3:
2660 info = "NTSC / stereo";
2661 btv->has_radio = 1;
2662 break;
2663 case 4:
2664 info = "PAL+SECAM / mono";
2665 break;
2666 case 5:
2667 info = "NTSC / mono";
2668 break;
2669 case 6:
2670 info = "NTSC / stereo";
2671 break;
2672 case 7:
2673 info = "PAL / stereo";
2674 break;
2675 default:
2676 info = "oops: unknown card";
2677 break;
2678 }
2679 if (-1 != msp)
2680 btv->c.type = BTTV_PINNACLEPRO;
2681 printk(KERN_INFO
2682 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
2683 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
2684 btv->tuner_type = 33;
2685 btv->pinnacle_id = id;
2686 }
2687}
2688
2689/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
2690#define LM1882_SYNC_DRIVE 0x200000L
2691
2692static void init_ids_eagle(struct bttv *btv)
2693{
2694 gpio_inout(0xffffff,0xFFFF37);
2695 gpio_write(0x200020);
2696
2697 /* flash strobe inverter ?! */
2698 gpio_write(0x200024);
2699
2700 /* switch sync drive off */
2701 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
2702
2703 /* set BT848 muxel to 2 */
2704 btaor((2)<<5, ~(2<<5), BT848_IFORM);
2705}
2706
2707/* Muxsel helper for the IDS Eagle.
2708 * the eagles does not use the standard muxsel-bits but
2709 * has its own multiplexer */
2710static void eagle_muxsel(struct bttv *btv, unsigned int input)
2711{
2712 btaor((2)<<5, ~(3<<5), BT848_IFORM);
2713 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
2714
Linus Torvalds1da177e2005-04-16 15:20:36 -07002715 /* composite */
2716 /* set chroma ADC to sleep */
2717 btor(BT848_ADC_C_SLEEP, BT848_ADC);
2718 /* set to composite video */
2719 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
2720 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002721
2722 /* switch sync drive off */
2723 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
2724}
2725
2726static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
2727{
2728 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
2729 gpio_write(masks[input%4]);
2730}
2731
2732/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
2733 alarms output
2734
2735 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
2736 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
2737
2738 IN - sensor inputs, INx - sensor inputs and TI XORed together
2739 O1,O2,O3 - alarm outputs (relays)
2740
2741 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
2742
2743*/
2744
2745static void init_lmlbt4x(struct bttv *btv)
2746{
2747 printk(KERN_DEBUG "LMLBT4x init\n");
2748 btwrite(0x000000, BT848_GPIO_REG_INP);
2749 gpio_inout(0xffffff, 0x0006C0);
2750 gpio_write(0x000000);
2751}
2752
2753static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
2754{
2755 unsigned int inmux = input % 8;
2756 gpio_inout( 0xf, 0xf );
2757 gpio_bits( 0xf, inmux );
2758}
2759
2760static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
2761{
2762 unsigned int inmux = input % 4;
2763 gpio_inout( 3<<9, 3<<9 );
2764 gpio_bits( 3<<9, inmux<<9 );
2765}
2766
2767/* ----------------------------------------------------------------------- */
2768
2769static void bttv_reset_audio(struct bttv *btv)
2770{
2771 /*
2772 * BT878A has a audio-reset register.
2773 * 1. This register is an audio reset function but it is in
2774 * function-0 (video capture) address space.
2775 * 2. It is enough to do this once per power-up of the card.
2776 * 3. There is a typo in the Conexant doc -- it is not at
2777 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
2778 * --//Shrikumar 030609
2779 */
2780 if (btv->id != 878)
2781 return;
2782
2783 if (bttv_debug)
2784 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
2785 btwrite((1<<7), 0x058);
2786 udelay(10);
2787 btwrite( 0, 0x058);
2788}
2789
2790/* initialization part one -- before registering i2c bus */
2791void __devinit bttv_init_card1(struct bttv *btv)
2792{
2793 switch (btv->c.type) {
2794 case BTTV_HAUPPAUGE:
2795 case BTTV_HAUPPAUGE878:
2796 boot_msp34xx(btv,5);
2797 break;
2798 case BTTV_VOODOOTV_FM:
2799 boot_msp34xx(btv,20);
2800 break;
2801 case BTTV_AVERMEDIA98:
2802 boot_msp34xx(btv,11);
2803 break;
2804 case BTTV_HAUPPAUGEPVR:
2805 pvr_boot(btv);
2806 break;
2807 case BTTV_TWINHAN_DST:
2808 case BTTV_AVDVBT_771:
Michael Krufky7c08fb02005-11-08 21:36:21 -08002809 case BTTV_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07002810 btv->use_i2c_hw = 1;
2811 break;
Michael Krufky7c08fb02005-11-08 21:36:21 -08002812 case BTTV_ADLINK_RTV24:
2813 init_RTV24( btv );
2814 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07002815
Linus Torvalds1da177e2005-04-16 15:20:36 -07002816 }
2817 if (!bttv_tvcards[btv->c.type].has_dvb)
2818 bttv_reset_audio(btv);
2819}
2820
2821/* initialization part two -- after registering i2c bus */
2822void __devinit bttv_init_card2(struct bttv *btv)
2823{
2824 int tda9887;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002825 int addr=ADDR_UNSET;
2826
Linus Torvalds1da177e2005-04-16 15:20:36 -07002827 btv->tuner_type = -1;
2828
2829 if (BTTV_UNKNOWN == btv->c.type) {
2830 bttv_readee(btv,eeprom_data,0xa0);
2831 identify_by_eeprom(btv,eeprom_data);
2832 }
2833
2834 switch (btv->c.type) {
2835 case BTTV_MIRO:
2836 case BTTV_MIROPRO:
2837 case BTTV_PINNACLE:
2838 case BTTV_PINNACLEPRO:
2839 /* miro/pinnacle */
2840 miro_pinnacle_gpio(btv);
2841 break;
2842 case BTTV_FLYVIDEO_98:
2843 case BTTV_MAXI:
2844 case BTTV_LIFE_FLYKIT:
2845 case BTTV_FLYVIDEO:
2846 case BTTV_TYPHOON_TVIEW:
2847 case BTTV_CHRONOS_VS2:
2848 case BTTV_FLYVIDEO_98FM:
2849 case BTTV_FLYVIDEO2000:
2850 case BTTV_FLYVIDEO98EZ:
2851 case BTTV_CONFERENCETV:
2852 case BTTV_LIFETEC_9415:
2853 flyvideo_gpio(btv);
2854 break;
2855 case BTTV_HAUPPAUGE:
2856 case BTTV_HAUPPAUGE878:
2857 case BTTV_HAUPPAUGEPVR:
2858 /* pick up some config infos from the eeprom */
2859 bttv_readee(btv,eeprom_data,0xa0);
2860 hauppauge_eeprom(btv);
2861 break;
2862 case BTTV_AVERMEDIA98:
2863 case BTTV_AVPHONE98:
2864 bttv_readee(btv,eeprom_data,0xa0);
2865 avermedia_eeprom(btv);
2866 break;
2867 case BTTV_PXC200:
2868 init_PXC200(btv);
2869 break;
2870 case BTTV_PICOLO_TETRA_CHIP:
2871 picolo_tetra_init(btv);
2872 break;
2873 case BTTV_VHX:
2874 btv->has_radio = 1;
2875 btv->has_matchbox = 1;
2876 btv->mbox_we = 0x20;
2877 btv->mbox_most = 0;
2878 btv->mbox_clk = 0x08;
2879 btv->mbox_data = 0x10;
2880 btv->mbox_mask = 0x38;
2881 break;
2882 case BTTV_VOBIS_BOOSTAR:
2883 case BTTV_TERRATV:
2884 terratec_active_radio_upgrade(btv);
2885 break;
2886 case BTTV_MAGICTVIEW061:
2887 if (btv->cardid == 0x3002144f) {
2888 btv->has_radio=1;
2889 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
2890 }
2891 break;
2892 case BTTV_STB2:
2893 if (btv->cardid == 0x3060121a) {
2894 /* Fix up entry for 3DFX VoodooTV 100,
2895 which is an OEM STB card variant. */
2896 btv->has_radio=0;
2897 btv->tuner_type=TUNER_TEMIC_NTSC;
2898 }
2899 break;
2900 case BTTV_OSPREY1x0:
2901 case BTTV_OSPREY1x0_848:
2902 case BTTV_OSPREY101_848:
2903 case BTTV_OSPREY1x1:
2904 case BTTV_OSPREY1x1_SVID:
2905 case BTTV_OSPREY2xx:
2906 case BTTV_OSPREY2x0_SVID:
2907 case BTTV_OSPREY2x0:
2908 case BTTV_OSPREY500:
2909 case BTTV_OSPREY540:
2910 case BTTV_OSPREY2000:
2911 bttv_readee(btv,eeprom_data,0xa0);
2912 osprey_eeprom(btv);
2913 break;
2914 case BTTV_IDS_EAGLE:
2915 init_ids_eagle(btv);
2916 break;
2917 case BTTV_MODTEC_205:
2918 bttv_readee(btv,eeprom_data,0xa0);
2919 modtec_eeprom(btv);
2920 break;
2921 case BTTV_LMLBT4:
2922 init_lmlbt4x(btv);
2923 break;
2924 case BTTV_TIBET_CS16:
2925 tibetCS16_init(btv);
2926 break;
2927 case BTTV_KODICOM_4400R:
2928 kodicom4400r_init(btv);
2929 break;
2930 }
2931
2932 /* pll configuration */
2933 if (!(btv->id==848 && btv->revision==0x11)) {
2934 /* defaults from card list */
2935 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
2936 btv->pll.pll_ifreq=28636363;
2937 btv->pll.pll_crystal=BT848_IFORM_XT0;
2938 }
2939 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
2940 btv->pll.pll_ifreq=35468950;
2941 btv->pll.pll_crystal=BT848_IFORM_XT1;
2942 }
2943 /* insmod options can override */
2944 switch (pll[btv->c.nr]) {
2945 case 0: /* none */
2946 btv->pll.pll_crystal = 0;
2947 btv->pll.pll_ifreq = 0;
2948 btv->pll.pll_ofreq = 0;
2949 break;
2950 case 1: /* 28 MHz */
2951 case 28:
2952 btv->pll.pll_ifreq = 28636363;
2953 btv->pll.pll_ofreq = 0;
2954 btv->pll.pll_crystal = BT848_IFORM_XT0;
2955 break;
2956 case 2: /* 35 MHz */
2957 case 35:
2958 btv->pll.pll_ifreq = 35468950;
2959 btv->pll.pll_ofreq = 0;
2960 btv->pll.pll_crystal = BT848_IFORM_XT1;
2961 break;
2962 }
2963 }
2964 btv->pll.pll_current = -1;
2965
Linus Torvalds1da177e2005-04-16 15:20:36 -07002966 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002967 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
2968 addr = bttv_tvcards[btv->c.type].tuner_addr;
2969
2970 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002971 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002972 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002973 if (UNSET != tuner[btv->c.nr])
2974 btv->tuner_type = tuner[btv->c.nr];
2975 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
2976 if (btv->pinnacle_id != UNSET)
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07002977 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07002978 &btv->pinnacle_id);
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07002979 if (btv->tuner_type != UNSET) {
2980 struct tuner_setup tun_setup;
2981
2982 tun_setup.mode_mask = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
2983 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002984 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07002985
2986 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
2987 }
2988
Linus Torvalds1da177e2005-04-16 15:20:36 -07002989 btv->svhs = bttv_tvcards[btv->c.type].svhs;
2990 if (svhs[btv->c.nr] != UNSET)
2991 btv->svhs = svhs[btv->c.nr];
2992 if (remote[btv->c.nr] != UNSET)
2993 btv->has_remote = remote[btv->c.nr];
2994
2995 if (bttv_tvcards[btv->c.type].has_radio)
2996 btv->has_radio=1;
2997 if (bttv_tvcards[btv->c.type].has_remote)
2998 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08002999 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3000 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003001 if (bttv_tvcards[btv->c.type].audio_hook)
3002 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3003
3004 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3005 /* detect Bt832 chip for quartzsight digital camera */
3006 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
3007 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
3008 boot_bt832(btv);
3009 }
3010
3011 if (!autoload)
3012 return;
3013
3014 /* try to detect audio/fader chips */
3015 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3016 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
3017 request_module("msp3400");
3018
3019 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3020 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3021 request_module("msp3400");
3022
3023 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3024 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
3025 request_module("tda9875");
3026
3027 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3028 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
3029 request_module("tda7432");
3030
3031 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3032 request_module("tvaudio");
3033
3034 /* tuner modules */
3035 tda9887 = 0;
3036 if (btv->pinnacle_id != UNSET)
3037 tda9887 = 1;
3038 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3039 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
3040 tda9887 = 1;
3041 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3042 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3043 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3044 tda9887)
3045 request_module("tda9887");
3046 if (btv->tuner_type != UNSET)
3047 request_module("tuner");
3048}
3049
3050
3051/* ----------------------------------------------------------------------- */
3052
3053static void modtec_eeprom(struct bttv *btv)
3054{
3055 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3056 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3057 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3058 btv->c.nr,&eeprom_data[0x1e]);
3059 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3060 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3061 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3062 btv->c.nr,&eeprom_data[0x1e]);
3063 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3064 btv->tuner_type=TUNER_PHILIPS_NTSC;
3065 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3066 btv->c.nr,&eeprom_data[0x1e]);
3067 } else {
3068 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3069 btv->c.nr,&eeprom_data[0x1e]);
3070 }
3071}
3072
3073static void __devinit hauppauge_eeprom(struct bttv *btv)
3074{
3075 struct tveeprom tv;
3076
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003077 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003078 btv->tuner_type = tv.tuner_type;
3079 btv->has_radio = tv.has_radio;
3080}
3081
3082static int terratec_active_radio_upgrade(struct bttv *btv)
3083{
3084 int freq;
3085
3086 btv->has_radio = 1;
3087 btv->has_matchbox = 1;
3088 btv->mbox_we = 0x10;
3089 btv->mbox_most = 0x20;
3090 btv->mbox_clk = 0x08;
3091 btv->mbox_data = 0x04;
3092 btv->mbox_mask = 0x3c;
3093
3094 btv->mbox_iow = 1 << 8;
3095 btv->mbox_ior = 1 << 9;
3096 btv->mbox_csel = 1 << 10;
3097
3098 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003099 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003100 if (0x1ed8 == tea5757_read(btv)) {
3101 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3102 btv->c.nr);
3103 btv->has_radio = 1;
3104 btv->has_matchbox = 1;
3105 } else {
3106 btv->has_radio = 0;
3107 btv->has_matchbox = 0;
3108 }
3109 return 0;
3110}
3111
3112
3113/* ----------------------------------------------------------------------- */
3114
3115/*
3116 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3117 *
3118 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3119 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3120 * unpacked with unzip).
3121 */
3122#define PVR_GPIO_DELAY 10
3123
3124#define BTTV_ALT_DATA 0x000001
3125#define BTTV_ALT_DCLK 0x100000
3126#define BTTV_ALT_NCONFIG 0x800000
3127
3128static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3129{
3130 u32 n;
3131 u8 bits;
3132 int i;
3133
3134 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3135 gpio_write(0);
3136 udelay(PVR_GPIO_DELAY);
3137
3138 gpio_write(BTTV_ALT_NCONFIG);
3139 udelay(PVR_GPIO_DELAY);
3140
3141 for (n = 0; n < microlen; n++) {
3142 bits = micro[n];
3143 for ( i = 0 ; i < 8 ; i++ ) {
3144 gpio_bits(BTTV_ALT_DCLK,0);
3145 if (bits & 0x01)
3146 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3147 else
3148 gpio_bits(BTTV_ALT_DATA,0);
3149 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3150 bits >>= 1;
3151 }
3152 }
3153 gpio_bits(BTTV_ALT_DCLK,0);
3154 udelay(PVR_GPIO_DELAY);
3155
3156 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3157 for (i = 0 ; i < 30 ; i++) {
3158 gpio_bits(BTTV_ALT_DCLK,0);
3159 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3160 }
3161 gpio_bits(BTTV_ALT_DCLK,0);
3162 return 0;
3163}
3164
3165static int __devinit pvr_boot(struct bttv *btv)
3166{
3167 const struct firmware *fw_entry;
3168 int rc;
3169
3170 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3171 if (rc != 0) {
3172 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3173 btv->c.nr);
3174 return rc;
3175 }
3176 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3177 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3178 btv->c.nr, (rc < 0) ? "failed" : "ok");
3179 release_firmware(fw_entry);
3180 return rc;
3181}
3182
3183/* ----------------------------------------------------------------------- */
3184/* some osprey specific stuff */
3185
3186static void __devinit osprey_eeprom(struct bttv *btv)
3187{
3188 int i = 0;
3189 unsigned char *ee = eeprom_data;
3190 unsigned long serial = 0;
3191
3192 if (btv->c.type == 0) {
3193 /* this might be an antique... check for MMAC label in eeprom */
3194 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3195 unsigned char checksum = 0;
3196 for (i =0; i<21; i++)
3197 checksum += ee[i];
3198 if (checksum != ee[21])
3199 return;
3200 btv->c.type = BTTV_OSPREY1x0_848;
3201 for (i = 12; i < 21; i++)
3202 serial *= 10, serial += ee[i] - '0';
3203 }
3204 } else {
3205 unsigned short type;
3206 int offset = 4*16;
3207
3208 for(; offset < 8*16; offset += 16) {
3209 unsigned short checksum = 0;
3210 /* verify the checksum */
3211 for(i = 0; i<14; i++) checksum += ee[i+offset];
3212 checksum = ~checksum; /* no idea why */
3213 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3214 ((checksum & 0x0FF) == ee[offset+15])) {
3215 break;
3216 }
3217 }
3218
3219 if (offset >= 8*16)
3220 return;
3221
3222 /* found a valid descriptor */
3223 type = (ee[offset+4]<<8) | (ee[offset+5]);
3224
3225 switch(type) {
3226
3227 /* 848 based */
3228 case 0x0004:
3229 btv->c.type = BTTV_OSPREY1x0_848;
3230 break;
3231 case 0x0005:
3232 btv->c.type = BTTV_OSPREY101_848;
3233 break;
3234
3235 /* 878 based */
3236 case 0x0012:
3237 case 0x0013:
3238 btv->c.type = BTTV_OSPREY1x0;
3239 break;
3240 case 0x0014:
3241 case 0x0015:
3242 btv->c.type = BTTV_OSPREY1x1;
3243 break;
3244 case 0x0016:
3245 case 0x0017:
3246 case 0x0020:
3247 btv->c.type = BTTV_OSPREY1x1_SVID;
3248 break;
3249 case 0x0018:
3250 case 0x0019:
3251 case 0x001E:
3252 case 0x001F:
3253 btv->c.type = BTTV_OSPREY2xx;
3254 break;
3255 case 0x001A:
3256 case 0x001B:
3257 btv->c.type = BTTV_OSPREY2x0_SVID;
3258 break;
3259 case 0x0040:
3260 btv->c.type = BTTV_OSPREY500;
3261 break;
3262 case 0x0050:
3263 case 0x0056:
3264 btv->c.type = BTTV_OSPREY540;
3265 /* bttv_osprey_540_init(btv); */
3266 break;
3267 case 0x0060:
3268 case 0x0070:
3269 btv->c.type = BTTV_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003270 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003271 gpio_inout(0xffffff,0x000303);
3272 break;
3273 default:
3274 /* unknown...leave generic, but get serial # */
3275 break;
3276 }
3277 serial = (ee[offset+6] << 24)
3278 | (ee[offset+7] << 16)
3279 | (ee[offset+8] << 8)
3280 | (ee[offset+9]);
3281 }
3282
3283 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3284 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3285}
3286
3287/* ----------------------------------------------------------------------- */
3288/* AVermedia specific stuff, from bktr_card.c */
3289
3290static int tuner_0_table[] = {
3291 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3292 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3293 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3294 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3295 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3296 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003297
3298static int tuner_1_table[] = {
3299 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3300 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3301 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003302 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003303 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3304
3305static void __devinit avermedia_eeprom(struct bttv *btv)
3306{
3307 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3308
3309 tuner_make = (eeprom_data[0x41] & 0x7);
3310 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3311 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3312 btv->has_remote = (eeprom_data[0x42] & 0x01);
3313
3314 if (tuner_make == 0 || tuner_make == 2)
3315 if(tuner_format <=0x0a)
3316 tuner = tuner_0_table[tuner_format];
3317 if (tuner_make == 1)
3318 if(tuner_format <=9)
3319 tuner = tuner_1_table[tuner_format];
3320
3321 if (tuner_make == 4)
3322 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003323 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003324
3325 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3326 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3327 if(tuner) {
3328 btv->tuner_type=tuner;
3329 printk("%d",tuner);
3330 } else
3331 printk("Unknown type");
3332 printk(" radio:%s remote control:%s\n",
3333 tuner_tv_fm ? "yes" : "no",
3334 btv->has_remote ? "yes" : "no");
3335}
3336
3337/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3338void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3339{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003340 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003341 if(norm==VIDEO_MODE_NTSC) {
3342 bttv_tvcards[BTTV_VOODOOTV_FM].audiomux[0]=0x957fff;
3343 bttv_tvcards[BTTV_VOODOOTV_FM].audiomux[4]=0x957fff;
3344 dprintk("bttv_tda9880_setnorm to NTSC\n");
3345 }
3346 else {
3347 bttv_tvcards[BTTV_VOODOOTV_FM].audiomux[0]=0x947fff;
3348 bttv_tvcards[BTTV_VOODOOTV_FM].audiomux[4]=0x947fff;
3349 dprintk("bttv_tda9880_setnorm to PAL\n");
3350 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003351 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003352 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3353 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3354}
3355
3356
3357/*
3358 * reset/enable the MSP on some Hauppauge cards
3359 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
3360 *
3361 * Hauppauge: pin 5
3362 * Voodoo: pin 20
3363 */
3364static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3365{
3366 int mask = (1 << pin);
3367
3368 gpio_inout(mask,mask);
3369 gpio_bits(mask,0);
3370 udelay(2500);
3371 gpio_bits(mask,mask);
3372
3373 if (bttv_gpio)
3374 bttv_gpio_tracking(btv,"msp34xx");
3375 if (bttv_verbose)
3376 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3377 "init [%d]\n", btv->c.nr, pin);
3378}
3379
3380static void __devinit boot_bt832(struct bttv *btv)
3381{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003382}
3383
3384/* ----------------------------------------------------------------------- */
3385/* Imagenation L-Model PXC200 Framegrabber */
3386/* This is basically the same procedure as
3387 * used by Alessandro Rubini in his pxc200
3388 * driver, but using BTTV functions */
3389
3390static void __devinit init_PXC200(struct bttv *btv)
3391{
3392 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3393 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3394 0x00 };
3395 unsigned int i;
3396 int tmp;
3397 u32 val;
3398
3399 /* Initialise GPIO-connevted stuff */
3400 gpio_inout(0xffffff, (1<<13));
3401 gpio_write(0);
3402 udelay(3);
3403 gpio_write(1<<13);
3404 /* GPIO inputs are pulled up, so no need to drive
3405 * reset pin any longer */
3406 gpio_bits(0xffffff, 0);
3407 if (bttv_gpio)
3408 bttv_gpio_tracking(btv,"pxc200");
3409
3410 /* we could/should try and reset/control the AD pots? but
3411 right now we simply turned off the crushing. Without
3412 this the AGC drifts drifts
3413 remember the EN is reverse logic -->
3414 setting BT848_ADC_AGC_EN disable the AGC
3415 tboult@eecs.lehigh.edu
3416 */
3417
3418 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3419
3420 /* Initialise MAX517 DAC */
3421 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3422 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3423
3424 /* Initialise 12C508 PIC */
3425 /* The I2CWrite and I2CRead commmands are actually to the
3426 * same chips - but the R/W bit is included in the address
3427 * argument so the numbers are different */
3428
3429
3430 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3431
3432 /* First of all, enable the clock line. This is used in the PXC200-F */
3433 val = btread(BT848_GPIO_DMA_CTL);
3434 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3435 btwrite(val, BT848_GPIO_DMA_CTL);
3436
3437 /* Then, push to 0 the reset pin long enough to reset the *
3438 * device same as above for the reset line, but not the same
3439 * value sent to the GPIO-connected stuff
3440 * which one is the good one? */
3441 gpio_inout(0xffffff,(1<<2));
3442 gpio_write(0);
3443 udelay(10);
3444 gpio_write(1<<2);
3445
3446 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3447 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3448 if (tmp != -1) {
3449 printk(KERN_INFO
3450 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3451 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3452 }
3453 }
3454
3455 printk(KERN_INFO "PXC200 Initialised.\n");
3456}
3457
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003458
3459
Peter Skipworth93b43f12005-06-23 22:04:45 -07003460/* ----------------------------------------------------------------------- */
3461/*
3462 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3463 * it. This apparently involves the following procedure for each 878 chip:
3464 *
3465 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3466 *
3467 * 2) write to GPIO_DATA
3468 * - 0x0E
3469 * - sleep 1ms
3470 * - 0x10 + 0x0E
3471 * - sleep 10ms
3472 * - 0x0E
3473 * read from GPIO_DATA into buf (uint_32)
3474 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3475 * error. ERROR_CPLD_Check_Failed stop.
3476 *
3477 * 3) write to GPIO_DATA
3478 * - write 0x4400 + 0x0E
3479 * - sleep 10ms
3480 * - write 0x4410 + 0x0E
3481 * - sleep 1ms
3482 * - write 0x0E
3483 * read from GPIO_DATA into buf (uint_32)
3484 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3485 * error. ERROR_CPLD_Check_Failed.
3486 */
3487/* ----------------------------------------------------------------------- */
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003488void
3489init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003490{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003491 uint32_t dataRead = 0;
3492 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003493
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003494 printk (KERN_INFO
3495 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003496 btv->c.nr);
3497
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003498 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003499
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003500 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3501 msleep (1);
3502 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3503 msleep (10);
3504 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003505
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003506 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003507
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003508 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3509 printk (KERN_INFO
3510 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3511 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003512 }
3513
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003514 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3515 msleep (10);
3516 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3517 msleep (1);
3518 btwrite (watchdog_value, BT848_GPIO_DATA);
3519 msleep (1);
3520 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003521
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003522 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3523 printk (KERN_INFO
3524 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3525 btv->c.nr, dataRead);
3526
Peter Skipworth93b43f12005-06-23 22:04:45 -07003527 return;
3528 }
3529
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003530 printk (KERN_INFO
3531 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003532}
Linus Torvalds1da177e2005-04-16 15:20:36 -07003533
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003534
3535
Linus Torvalds1da177e2005-04-16 15:20:36 -07003536/* ----------------------------------------------------------------------- */
3537/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3538/*
3539 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3540 * This code is placed under the terms of the GNU General Public License
3541 *
3542 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3543 */
3544
3545static void bus_low(struct bttv *btv, int bit)
3546{
3547 if (btv->mbox_ior) {
3548 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3549 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3550 udelay(5);
3551 }
3552
3553 gpio_bits(bit,0);
3554 udelay(5);
3555
3556 if (btv->mbox_ior) {
3557 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3558 udelay(5);
3559 }
3560}
3561
3562static void bus_high(struct bttv *btv, int bit)
3563{
3564 if (btv->mbox_ior) {
3565 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3566 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3567 udelay(5);
3568 }
3569
3570 gpio_bits(bit,bit);
3571 udelay(5);
3572
3573 if (btv->mbox_ior) {
3574 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3575 udelay(5);
3576 }
3577}
3578
3579static int bus_in(struct bttv *btv, int bit)
3580{
3581 if (btv->mbox_ior) {
3582 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3583 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3584 udelay(5);
3585
3586 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3587 udelay(5);
3588 }
3589 return gpio_read() & (bit);
3590}
3591
3592/* TEA5757 register bits */
3593#define TEA_FREQ 0:14
3594#define TEA_BUFFER 15:15
3595
3596#define TEA_SIGNAL_STRENGTH 16:17
3597
3598#define TEA_PORT1 18:18
3599#define TEA_PORT0 19:19
3600
3601#define TEA_BAND 20:21
3602#define TEA_BAND_FM 0
3603#define TEA_BAND_MW 1
3604#define TEA_BAND_LW 2
3605#define TEA_BAND_SW 3
3606
3607#define TEA_MONO 22:22
3608#define TEA_ALLOW_STEREO 0
3609#define TEA_FORCE_MONO 1
3610
3611#define TEA_SEARCH_DIRECTION 23:23
3612#define TEA_SEARCH_DOWN 0
3613#define TEA_SEARCH_UP 1
3614
3615#define TEA_STATUS 24:24
3616#define TEA_STATUS_TUNED 0
3617#define TEA_STATUS_SEARCHING 1
3618
3619/* Low-level stuff */
3620static int tea5757_read(struct bttv *btv)
3621{
3622 unsigned long timeout;
3623 int value = 0;
3624 int i;
3625
3626 /* better safe than sorry */
3627 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
3628
3629 if (btv->mbox_ior) {
3630 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3631 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3632 udelay(5);
3633 }
3634
3635 if (bttv_gpio)
3636 bttv_gpio_tracking(btv,"tea5757 read");
3637
3638 bus_low(btv,btv->mbox_we);
3639 bus_low(btv,btv->mbox_clk);
3640
3641 udelay(10);
3642 timeout= jiffies + HZ;
3643
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003644 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003645 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
3646 schedule();
3647 if (bus_in(btv,btv->mbox_data)) {
3648 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
3649 return -1;
3650 }
3651
3652 dprintk("bttv%d: tea5757:",btv->c.nr);
3653 for(i = 0; i < 24; i++)
3654 {
3655 udelay(5);
3656 bus_high(btv,btv->mbox_clk);
3657 udelay(5);
3658 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
3659 bus_low(btv,btv->mbox_clk);
3660 value <<= 1;
3661 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
3662 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
3663 }
3664 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
3665 return value;
3666}
3667
3668static int tea5757_write(struct bttv *btv, int value)
3669{
3670 int i;
3671 int reg = value;
3672
3673 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
3674
3675 if (btv->mbox_ior) {
3676 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3677 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3678 udelay(5);
3679 }
3680 if (bttv_gpio)
3681 bttv_gpio_tracking(btv,"tea5757 write");
3682
3683 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
3684 bus_low(btv,btv->mbox_clk);
3685 bus_high(btv,btv->mbox_we);
3686 for(i = 0; i < 25; i++)
3687 {
3688 if (reg & 0x1000000)
3689 bus_high(btv,btv->mbox_data);
3690 else
3691 bus_low(btv,btv->mbox_data);
3692 reg <<= 1;
3693 bus_high(btv,btv->mbox_clk);
3694 udelay(10);
3695 bus_low(btv,btv->mbox_clk);
3696 udelay(10);
3697 }
3698 bus_low(btv,btv->mbox_we); /* unmute !!! */
3699 return 0;
3700}
3701
3702void tea5757_set_freq(struct bttv *btv, unsigned short freq)
3703{
3704 dprintk("tea5757_set_freq %d\n",freq);
3705 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003706}
3707
3708
3709/* ----------------------------------------------------------------------- */
3710/* winview */
3711
3712void winview_audio(struct bttv *btv, struct video_audio *v, int set)
3713{
3714 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
3715 int bits_out, loops, vol, data;
3716
3717 if (!set) {
3718 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
3719 v->flags |= VIDEO_AUDIO_VOLUME;
3720 return;
3721 }
3722
3723 /* 32 levels logarithmic */
3724 vol = 32 - ((v->volume>>11));
3725 /* units */
3726 bits_out = (PT2254_DBS_IN_2>>(vol%5));
3727 /* tens */
3728 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
3729 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
3730 data = gpio_read();
3731 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
3732 WINVIEW_PT2254_STROBE);
3733 for (loops = 17; loops >= 0 ; loops--) {
3734 if (bits_out & (1<<loops))
3735 data |= WINVIEW_PT2254_DATA;
3736 else
3737 data &= ~WINVIEW_PT2254_DATA;
3738 gpio_write(data);
3739 udelay(5);
3740 data |= WINVIEW_PT2254_CLK;
3741 gpio_write(data);
3742 udelay(5);
3743 data &= ~WINVIEW_PT2254_CLK;
3744 gpio_write(data);
3745 }
3746 data |= WINVIEW_PT2254_STROBE;
3747 data &= ~WINVIEW_PT2254_DATA;
3748 gpio_write(data);
3749 udelay(10);
3750 data &= ~WINVIEW_PT2254_STROBE;
3751 gpio_write(data);
3752}
3753
3754/* ----------------------------------------------------------------------- */
3755/* mono/stereo control for various cards (which don't use i2c chips but */
3756/* connect something to the GPIO pins */
3757
3758static void
3759gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
3760{
3761 unsigned int con = 0;
3762
3763 if (set) {
3764 gpio_inout(0x300, 0x300);
3765 if (v->mode & VIDEO_SOUND_LANG1)
3766 con = 0x000;
3767 if (v->mode & VIDEO_SOUND_LANG2)
3768 con = 0x300;
3769 if (v->mode & VIDEO_SOUND_STEREO)
3770 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003771/* if (v->mode & VIDEO_SOUND_MONO)
3772 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003773 gpio_bits(0x300, con);
3774 } else {
3775 v->mode = VIDEO_SOUND_STEREO |
3776 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3777 }
3778}
3779
3780static void
3781gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
3782{
3783 unsigned int val, con;
3784
Linus Torvalds1da177e2005-04-16 15:20:36 -07003785 if (btv->radio_user)
3786 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003787
3788 val = gpio_read();
3789 if (set) {
3790 con = 0x000;
3791 if (v->mode & VIDEO_SOUND_LANG2) {
3792 if (v->mode & VIDEO_SOUND_LANG1) {
3793 /* LANG1 + LANG2 */
3794 con = 0x100;
3795 }
3796 else {
3797 /* LANG2 */
3798 con = 0x300;
3799 }
3800 }
3801 if (con != (val & 0x300)) {
3802 gpio_bits(0x300, con);
3803 if (bttv_gpio)
3804 bttv_gpio_tracking(btv,"gvbctv5pci");
3805 }
3806 } else {
3807 switch (val & 0x70) {
3808 case 0x10:
3809 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3810 break;
3811 case 0x30:
3812 v->mode = VIDEO_SOUND_LANG2;
3813 break;
3814 case 0x50:
3815 v->mode = VIDEO_SOUND_LANG1;
3816 break;
3817 case 0x60:
3818 v->mode = VIDEO_SOUND_STEREO;
3819 break;
3820 case 0x70:
3821 v->mode = VIDEO_SOUND_MONO;
3822 break;
3823 default:
3824 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3825 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3826 }
3827 }
3828}
3829
3830/*
3831 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
3832 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
3833 * 0xdde enables mono and 0xccd enables sap
3834 *
3835 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
3836 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
3837 * input/output sound connection, so both must be set for output mode.
3838 *
3839 * Looks like it's needed only for the "tvphone", the "tvphone 98"
3840 * handles this with a tda9840
3841 *
3842 */
3843static void
3844avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
3845{
3846 int val = 0;
3847
3848 if (set) {
3849 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
3850 val = 0x02;
3851 if (v->mode & VIDEO_SOUND_STEREO)
3852 val = 0x01;
3853 if (val) {
3854 gpio_bits(0x03,val);
3855 if (bttv_gpio)
3856 bttv_gpio_tracking(btv,"avermedia");
3857 }
3858 } else {
3859 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3860 VIDEO_SOUND_LANG1;
3861 return;
3862 }
3863}
3864
3865static void
3866avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
3867{
3868 int val = 0;
3869
3870 if (set) {
3871 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
3872 val = 0x01;
3873 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
3874 val = 0x02;
3875 btaor(val, ~0x03, BT848_GPIO_DATA);
3876 if (bttv_gpio)
3877 bttv_gpio_tracking(btv,"avermedia");
3878 } else {
3879 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3880 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3881 return;
3882 }
3883}
3884
3885/* Lifetec 9415 handling */
3886static void
3887lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
3888{
3889 int val = 0;
3890
3891 if (gpio_read() & 0x4000) {
3892 v->mode = VIDEO_SOUND_MONO;
3893 return;
3894 }
3895
3896 if (set) {
3897 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
3898 val = 0x0080;
3899 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
3900 val = 0x0880;
3901 if ((v->mode & VIDEO_SOUND_LANG1) ||
3902 (v->mode & VIDEO_SOUND_MONO))
3903 val = 0;
3904 gpio_bits(0x0880, val);
3905 if (bttv_gpio)
3906 bttv_gpio_tracking(btv,"lt9415");
3907 } else {
3908 /* autodetect doesn't work with this card :-( */
3909 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3910 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3911 return;
3912 }
3913}
3914
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003915/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003916static void
3917terratv_audio(struct bttv *btv, struct video_audio *v, int set)
3918{
3919 unsigned int con = 0;
3920
3921 if (set) {
3922 gpio_inout(0x180000,0x180000);
3923 if (v->mode & VIDEO_SOUND_LANG2)
3924 con = 0x080000;
3925 if (v->mode & VIDEO_SOUND_STEREO)
3926 con = 0x180000;
3927 gpio_bits(0x180000, con);
3928 if (bttv_gpio)
3929 bttv_gpio_tracking(btv,"terratv");
3930 } else {
3931 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3932 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3933 }
3934}
3935
3936static void
3937winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
3938{
3939 unsigned long val = 0;
3940
3941 if (set) {
3942 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
3943 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
3944 val = 0x420000;
3945 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
3946 val = 0x420000;
3947 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
3948 val = 0x410000;
3949 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
3950 val = 0x020000;
3951 if (val) {
3952 gpio_bits(0x430000, val);
3953 if (bttv_gpio)
3954 bttv_gpio_tracking(btv,"winfast2000");
3955 }
3956 } else {
3957 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3958 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3959 }
3960}
3961
3962/*
3963 * Dariusz Kowalewski <darekk@automex.pl>
3964 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
3965 * revision 9B has on-board TDA9874A sound decoder).
3966 *
3967 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
3968 * will mute this cards.
3969 */
3970static void
3971pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
3972{
3973 unsigned int val = 0;
3974
Linus Torvalds1da177e2005-04-16 15:20:36 -07003975 if (btv->radio_user)
3976 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003977
3978 if (set) {
3979 if (v->mode & VIDEO_SOUND_MONO) {
3980 val = 0x01;
3981 }
3982 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
3983 || (v->mode & VIDEO_SOUND_STEREO)) {
3984 val = 0x02;
3985 }
3986 if (val) {
3987 gpio_bits(0x03,val);
3988 if (bttv_gpio)
3989 bttv_gpio_tracking(btv,"pvbt878p9b");
3990 }
3991 } else {
3992 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
3993 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
3994 }
3995}
3996
3997/*
3998 * Dariusz Kowalewski <darekk@automex.pl>
3999 * sound control for FlyVideo 2000S (with tda9874 decoder)
4000 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4001 */
4002static void
4003fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4004{
4005 unsigned int val = 0xffff;
4006
Linus Torvalds1da177e2005-04-16 15:20:36 -07004007 if (btv->radio_user)
4008 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004009 if (set) {
4010 if (v->mode & VIDEO_SOUND_MONO) {
4011 val = 0x0000;
4012 }
4013 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4014 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004015 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004016 }
4017 if (val != 0xffff) {
4018 gpio_bits(0x1800, val);
4019 if (bttv_gpio)
4020 bttv_gpio_tracking(btv,"fv2000s");
4021 }
4022 } else {
4023 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4024 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4025 }
4026}
4027
4028/*
4029 * sound control for Canopus WinDVR PCI
4030 * Masaki Suzuki <masaki@btree.org>
4031 */
4032static void
4033windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4034{
4035 unsigned long val = 0;
4036
4037 if (set) {
4038 if (v->mode & VIDEO_SOUND_MONO)
4039 val = 0x040000;
4040 if (v->mode & VIDEO_SOUND_LANG1)
4041 val = 0;
4042 if (v->mode & VIDEO_SOUND_LANG2)
4043 val = 0x100000;
4044 if (v->mode & VIDEO_SOUND_STEREO)
4045 val = 0;
4046 if (val) {
4047 gpio_bits(0x140000, val);
4048 if (bttv_gpio)
4049 bttv_gpio_tracking(btv,"windvr");
4050 }
4051 } else {
4052 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4053 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4054 }
4055}
4056
4057/*
4058 * sound control for AD-TVK503
4059 * Hiroshi Takekawa <sian@big.or.jp>
4060 */
4061static void
4062adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4063{
4064 unsigned int con = 0xffffff;
4065
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004066 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004067
4068 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004069 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004070 if (v->mode & VIDEO_SOUND_LANG1)
4071 con = 0x00000000;
4072 if (v->mode & VIDEO_SOUND_LANG2)
4073 con = 0x00180000;
4074 if (v->mode & VIDEO_SOUND_STEREO)
4075 con = 0x00000000;
4076 if (v->mode & VIDEO_SOUND_MONO)
4077 con = 0x00060000;
4078 if (con != 0xffffff) {
4079 gpio_bits(0x1e0000,con);
4080 if (bttv_gpio)
4081 bttv_gpio_tracking(btv, "adtvk503");
4082 }
4083 } else {
4084 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4085 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4086 }
4087}
4088
4089/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4090 *
4091 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4092 * switch instead (CD22M3494E). This IC can have multiple active connections
4093 * between Xn (input) and Yn (output) pins. We need to clear any existing
4094 * connection prior to establish a new one, pulsing the STROBE pin.
4095 *
4096 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4097 * GPIO pins are wired as:
4098 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4099 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4100 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4101 * GPIO[8] - - P3[5] (microcontroler)
4102 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4103 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4104 * GPINTR - - P3[4] (microcontroler)
4105 *
4106 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4107 * configuration either directly (as we are doing) or using the microcontroler
4108 * which is also wired to I2C interface. I have no further info on the
4109 * microcontroler features, one would need to disassembly the firmware.
4110 * note: the vendor refused to give any information on this product, all
4111 * that stuff was found using a multimeter! :)
4112 */
4113static void rv605_muxsel(struct bttv *btv, unsigned int input)
4114{
4115 /* reset all conections */
4116 gpio_bits(0x200,0x200);
4117 mdelay(1);
4118 gpio_bits(0x200,0x000);
4119 mdelay(1);
4120
4121 /* create a new conection */
4122 gpio_bits(0x480,0x080);
4123 gpio_bits(0x480,0x480);
4124 mdelay(1);
4125 gpio_bits(0x480,0x080);
4126 mdelay(1);
4127}
4128
4129/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4130 *
4131 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4132 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4133 * chips, ten eight input analog multiplexors, a not chip and a few
4134 * other components.
4135 *
4136 * 16 inputs on a secondary bracket are provided and can be selected
4137 * from each of the four capture chips. Two of the eight input
4138 * multiplexors are used to select from any of the 16 input signals.
4139 *
4140 * Unsupported hardware capabilities:
4141 * . A video output monitor on the secondary bracket can be selected from
4142 * one of the 878A chips.
4143 * . Another passthrough but I haven't spent any time investigating it.
4144 * . Digital I/O (logic level connected to GPIO) is available from an
4145 * onboard header.
4146 *
4147 * The on chip input mux should always be set to 2.
4148 * GPIO[16:19] - Video input selection
4149 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4150 * GPIO[?:?] - Digital I/O.
4151 *
4152 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4153 * determined what function (if any) it provides. With the microcontroller
4154 * and sync seperator chips a guess is that it might have to do with video
4155 * switching and maybe some digital I/O.
4156 */
4157static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4158{
4159 /* video mux */
4160 gpio_bits(0x0f0000, input << 16);
4161}
4162
4163static void tibetCS16_init(struct bttv *btv)
4164{
4165 /* enable gpio bits, mask obtained via btSpy */
4166 gpio_inout(0xffffff, 0x0f7fff);
4167 gpio_write(0x0f7fff);
4168}
4169
4170/*
4171 * The following routines for the Kodicom-4400r get a little mind-twisting.
4172 * There is a "master" controller and three "slave" controllers, together
4173 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4174 * The analog switch is controlled by the "master", but the detection order
4175 * of the four BT878A chips is in an order which I just don't understand.
4176 * The "master" is actually the second controller to be detected. The
4177 * logic on the board uses logical numbers for the 4 controlers, but
4178 * those numbers are different from the detection sequence. When working
4179 * with the analog switch, we need to "map" from the detection sequence
4180 * over to the board's logical controller number. This mapping sequence
4181 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4182 * unit 3, the second (which is the master) is logical unit 0, etc.
4183 * We need to maintain the status of the analog switch (which of the 16
4184 * cameras is connected to which of the 4 controllers). Rather than
4185 * add to the bttv structure for this, we use the data reserved for
4186 * the mbox (unused for this card type).
4187 */
4188
4189/*
4190 * First a routine to set the analog switch, which controls which camera
4191 * is routed to which controller. The switch comprises an X-address
4192 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4193 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4194 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4195 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4196 * specified address. The idea is to set the address and data, then bring
4197 * STROBE high, and finally bring STROBE back to low.
4198 */
4199static void kodicom4400r_write(struct bttv *btv,
4200 unsigned char xaddr,
4201 unsigned char yaddr,
4202 unsigned char data) {
4203 unsigned int udata;
4204
4205 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4206 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4207 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4208 gpio_bits(0x1ff, udata); /* strobe low */
4209}
4210
4211/*
4212 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4213 * use this routine. The routine finds the "master" for the card, maps
4214 * the controller number from the detected position over to the logical
4215 * number, writes the appropriate data to the analog switch, and housekeeps
4216 * the local copy of the switch information. The parameter 'input' is the
4217 * requested camera number (0 - 15).
4218 */
4219static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4220{
4221 char *sw_status;
4222 int xaddr, yaddr;
4223 struct bttv *mctlr;
4224 static unsigned char map[4] = {3, 0, 2, 1};
4225
4226 mctlr = master[btv->c.nr];
4227 if (mctlr == NULL) { /* ignore if master not yet detected */
4228 return;
4229 }
4230 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4231 yaddr = map[yaddr];
4232 sw_status = (char *)(&mctlr->mbox_we);
4233 xaddr = input & 0xf;
4234 /* Check if the controller/camera pair has changed, else ignore */
4235 if (sw_status[yaddr] != xaddr)
4236 {
4237 /* "open" the old switch, "close" the new one, save the new */
4238 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4239 sw_status[yaddr] = xaddr;
4240 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4241 }
4242}
4243
4244/*
4245 * During initialisation, we need to reset the analog switch. We
4246 * also preset the switch to map the 4 connectors on the card to the
4247 * *user's* (see above description of kodicom4400r_muxsel) channels
4248 * 0 through 3
4249 */
4250static void kodicom4400r_init(struct bttv *btv)
4251{
4252 char *sw_status = (char *)(&btv->mbox_we);
4253 int ix;
4254
4255 gpio_inout(0x0003ff, 0x0003ff);
4256 gpio_write(1 << 9); /* reset MUX */
4257 gpio_write(0);
4258 /* Preset camera 0 to the 4 controllers */
4259 for (ix=0; ix<4; ix++) {
4260 sw_status[ix] = ix;
4261 kodicom4400r_write(btv, ix, ix, 1);
4262 }
4263 /*
4264 * Since this is the "master", we need to set up the
4265 * other three controller chips' pointers to this structure
4266 * for later use in the muxsel routine.
4267 */
4268 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4269 return;
4270 master[btv->c.nr-1] = btv;
4271 master[btv->c.nr] = btv;
4272 master[btv->c.nr+1] = btv;
4273 master[btv->c.nr+2] = btv;
4274}
4275
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004276/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4277 * video multiplexers to provide up to 16 video inputs. These
4278 * multiplexers are controlled by the lower 8 GPIO pins of the
4279 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004280
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004281 * xxx0 is pin xxx of multiplexer U5,
4282 * yyy1 is pin yyy of multiplexer U2
4283 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004284#define ENA0 0x01
4285#define ENB0 0x02
4286#define ENA1 0x04
4287#define ENB1 0x08
4288
4289#define IN10 0x10
4290#define IN00 0x20
4291#define IN11 0x40
4292#define IN01 0x80
4293
4294static void xguard_muxsel(struct bttv *btv, unsigned int input)
4295{
4296 static const int masks[] = {
4297 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4298 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4299 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4300 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4301 };
4302 gpio_write(masks[input%16]);
4303}
4304static void picolo_tetra_init(struct bttv *btv)
4305{
4306 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4307 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4308 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4309}
4310static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4311{
4312
4313 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4314 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4315 /*GPIO[20]&GPIO[21] used to choose the right input*/
4316 btwrite (input<<20,BT848_GPIO_DATA);
4317
4318}
4319
4320/*
4321 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4322 *
4323 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4324 * swichers to provide 16 channels to MUX0. The TDA8540's have
4325 * 4 indepedant outputs and as such the IVC120G also has the
4326 * optional "Monitor Out" bus. This allows the card to be looking
4327 * at one input while the monitor is looking at another.
4328 *
4329 * Since I've couldn't be bothered figuring out how to add an
4330 * independant muxsel for the monitor bus, I've just set it to
4331 * whatever the card is looking at.
4332 *
4333 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4334 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4335 *
4336 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4337 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4338 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4339 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4340 *
4341 */
4342
4343/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4344#define I2C_TDA8540 0x90
4345#define I2C_TDA8540_ALT1 0x92
4346#define I2C_TDA8540_ALT2 0x94
4347#define I2C_TDA8540_ALT3 0x96
4348#define I2C_TDA8540_ALT4 0x98
4349#define I2C_TDA8540_ALT5 0x9a
4350#define I2C_TDA8540_ALT6 0x9c
4351
4352static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4353{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004354 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004355 int key = input % 4;
4356 int matrix = input / 4;
4357
4358 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4359 btv->c.nr, input, matrix, key);
4360
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004361 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004362 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4363 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4364 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4365 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4366 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4367 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4368 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4369 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4370
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004371 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004372 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004373 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004374 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004375 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004376 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004377 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004378 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004379 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004380
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004381 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004382 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4383}
4384
4385
4386/* PXC200 muxsel helper
4387 * luke@syseng.anu.edu.au
4388 * another transplant
4389 * from Alessandro Rubini (rubini@linux.it)
4390 *
4391 * There are 4 kinds of cards:
4392 * PXC200L which is bt848
4393 * PXC200F which is bt848 with PIC controlling mux
4394 * PXC200AL which is bt878
4395 * PXC200AF which is bt878 with PIC controlling mux
4396 */
4397#define PX_CFG_PXC200F 0x01
4398#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4399#define PX_I2C_PIC 0x0f
4400#define PX_PXC200A_CARDID 0x200a1295
4401#define PX_I2C_CMD_CFG 0x00
4402
4403static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4404{
4405 int rc;
4406 long mux;
4407 int bitmask;
4408 unsigned char buf[2];
4409
4410 /* Read PIC config to determine if this is a PXC200F */
4411 /* PX_I2C_CMD_CFG*/
4412 buf[0]=0;
4413 buf[1]=0;
4414 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4415 if (rc) {
4416 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4417 /* not PXC ? do nothing */
4418 return;
4419 }
4420
4421 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4422 if (!(rc & PX_CFG_PXC200F)) {
4423 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4424 return;
4425 }
4426
4427
4428 /* The multiplexer in the 200F is handled by the GPIO port */
4429 /* get correct mapping between inputs */
4430 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4431 /* ** not needed!? */
4432 mux = input;
4433
4434 /* make sure output pins are enabled */
4435 /* bitmask=0x30f; */
4436 bitmask=0x302;
4437 /* check whether we have a PXC200A */
4438 if (btv->cardid == PX_PXC200A_CARDID) {
4439 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4440 bitmask |= 7<<4; /* the DAC */
4441 }
4442 btwrite(bitmask, BT848_GPIO_OUT_EN);
4443
4444 bitmask = btread(BT848_GPIO_DATA);
4445 if (btv->cardid == PX_PXC200A_CARDID)
4446 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4447 else /* older device */
4448 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4449 btwrite(bitmask,BT848_GPIO_DATA);
4450
4451 /*
4452 * Was "to be safe, set the bt848 to input 0"
4453 * Actually, since it's ok at load time, better not messing
4454 * with these bits (on PXC200AF you need to set mux 2 here)
4455 *
4456 * needed because bttv-driver sets mux before calling this function
4457 */
4458 if (btv->cardid == PX_PXC200A_CARDID)
4459 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4460 else /* older device */
4461 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4462
4463 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4464}
4465
4466/* ----------------------------------------------------------------------- */
4467/* motherboard chipset specific stuff */
4468
4469void __devinit bttv_check_chipset(void)
4470{
4471 int pcipci_fail = 0;
4472 struct pci_dev *dev = NULL;
4473
4474 if (pci_pci_problems & PCIPCI_FAIL)
4475 pcipci_fail = 1;
4476 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4477 triton1 = 1;
4478 if (pci_pci_problems & PCIPCI_VSFX)
4479 vsfx = 1;
4480#ifdef PCIPCI_ALIMAGIK
4481 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4482 latency = 0x0A;
4483#endif
4484
Linus Torvalds1da177e2005-04-16 15:20:36 -07004485
4486 /* print warnings about any quirks found */
4487 if (triton1)
4488 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4489 if (vsfx)
4490 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4491 if (pcipci_fail) {
4492 printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004493 if (!no_overlay) {
4494 printk(KERN_WARNING "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004495 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004496 } else {
4497 printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004498 }
4499 }
4500 if (UNSET != latency)
4501 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07004502
Linus Torvalds1da177e2005-04-16 15:20:36 -07004503 while ((dev = pci_find_device(PCI_VENDOR_ID_INTEL,
4504 PCI_DEVICE_ID_INTEL_82441, dev))) {
4505 unsigned char b;
4506 pci_read_config_byte(dev, 0x53, &b);
4507 if (bttv_debug)
4508 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4509 "bufcon=0x%02x\n",b);
4510 }
4511}
4512
4513int __devinit bttv_handle_chipset(struct bttv *btv)
4514{
4515 unsigned char command;
4516
4517 if (!triton1 && !vsfx && UNSET == latency)
4518 return 0;
4519
4520 if (bttv_verbose) {
4521 if (triton1)
4522 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4523 if (vsfx && btv->id >= 878)
4524 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4525 if (UNSET != latency)
4526 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4527 btv->c.nr,latency);
4528 }
4529
4530 if (btv->id < 878) {
4531 /* bt848 (mis)uses a bit in the irq mask for etbf */
4532 if (triton1)
4533 btv->triton1 = BT848_INT_ETBF;
4534 } else {
4535 /* bt878 has a bit in the pci config space for it */
4536 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4537 if (triton1)
4538 command |= BT878_EN_TBFX;
4539 if (vsfx)
4540 command |= BT878_EN_VSFX;
4541 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4542 }
4543 if (UNSET != latency)
4544 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4545 return 0;
4546}
4547
4548
4549/*
4550 * Local variables:
4551 * c-basic-offset: 8
4552 * End:
4553 */