blob: e869bfbab3789608987cccd8892c8a3460d1e2fb [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)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08009 & Marcus Metzler (mocm@thp.uni-koeln.de)
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 (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"
Michael Krufky5e453dc2006-01-09 15:32:31 -020041#include <media/v4l2-common.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43/* fwd decl */
44static void boot_msp34xx(struct bttv *btv, int pin);
45static void boot_bt832(struct bttv *btv);
46static void hauppauge_eeprom(struct bttv *btv);
47static void avermedia_eeprom(struct bttv *btv);
48static void osprey_eeprom(struct bttv *btv);
49static void modtec_eeprom(struct bttv *btv);
50static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070051static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
54static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
55static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
56 int set);
57static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
58 int set);
59static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
60static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
61static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
62static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
63static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
64static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
65static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
66static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
67static void rv605_muxsel(struct bttv *btv, unsigned int input);
68static void eagle_muxsel(struct bttv *btv, unsigned int input);
69static void xguard_muxsel(struct bttv *btv, unsigned int input);
70static void ivc120_muxsel(struct bttv *btv, unsigned int input);
71static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
72
73static void PXC200_muxsel(struct bttv *btv, unsigned int input);
74
75static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
76static void picolo_tetra_init(struct bttv *btv);
77
78static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
79static void tibetCS16_init(struct bttv *btv);
80
81static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
82static void kodicom4400r_init(struct bttv *btv);
83
84static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
85static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
86
87static int terratec_active_radio_upgrade(struct bttv *btv);
88static int tea5757_read(struct bttv *btv);
89static int tea5757_write(struct bttv *btv, int value);
90static void identify_by_eeprom(struct bttv *btv,
91 unsigned char eeprom_data[256]);
92static int __devinit pvr_boot(struct bttv *btv);
93
94/* config variables */
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -020095static unsigned int triton1;
96static unsigned int vsfx;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070098int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
100static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
106#ifdef MODULE
107static unsigned int autoload = 1;
108#else
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -0200109static unsigned int autoload;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110#endif
111static unsigned int gpiomask = UNSET;
112static unsigned int audioall = UNSET;
113static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
114
115/* insmod options */
116module_param(triton1, int, 0444);
117module_param(vsfx, int, 0444);
118module_param(no_overlay, int, 0444);
119module_param(latency, int, 0444);
120module_param(gpiomask, int, 0444);
121module_param(audioall, int, 0444);
122module_param(autoload, int, 0444);
123
124module_param_array(card, int, NULL, 0444);
125module_param_array(pll, int, NULL, 0444);
126module_param_array(tuner, int, NULL, 0444);
127module_param_array(svhs, int, NULL, 0444);
128module_param_array(remote, int, NULL, 0444);
129module_param_array(audiomux, int, NULL, 0444);
130
131MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
132 "[enable bug compatibility for triton1 + others]");
133MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
134 "[yet another chipset flaw workaround]");
135MODULE_PARM_DESC(latency,"pci latency timer");
136MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
137MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138MODULE_PARM_DESC(tuner,"specify installed tuner type");
139MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -0300140MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
141 " [some VIA/SIS chipsets are known to have problem with overlay]");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
143/* ----------------------------------------------------------------------- */
144/* list of card IDs for bt878+ cards */
145
146static struct CARD {
147 unsigned id;
148 int cardnr;
149 char *name;
150} cards[] __devinitdata = {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800151 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
155 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
156 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
157 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
158 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
Kenth Anderssonf718e6e2005-11-08 21:37:02 -0800159 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800161 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
162 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800164 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
165 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
166 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
167 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800169 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800170 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
171 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800172 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800174 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700175 /* some cards ship with byteswapped IDs ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800176 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
177 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700178 /* this seems to happen as well ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800179 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800181 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800185 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
186 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
187 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
188 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
189 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
190 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
191 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800193 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
194 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
195 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
196 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
197 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800199 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
200 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
201 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
202 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800204 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
205 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700206 /* clashes with FlyVideo
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800207 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
208 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
209 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
210 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
211 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800213 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
214 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800219 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
220 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
221 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
222 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
223 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800225 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
226 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
227 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
228 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800230 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
231 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
232 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
233 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800235 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
236 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800261 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
262 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800264 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
265 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
267 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
268 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
269 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800271 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
272 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800274 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
275 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
276 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
278 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
279 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800280 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
281 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800282 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800284 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
285 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800287 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
288 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
289 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
290 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800292 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700294 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800295 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700296
Steven Tothcd1257d2006-01-09 15:25:01 -0200297 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
298 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
299
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700300 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800301 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
Michael Krufky2af35572006-01-23 17:11:06 -0200302 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
303 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800304 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
305 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
306 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
307 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
Michael Krufky2af35572006-01-23 17:11:06 -0200308 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800309 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
310 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700311
312 { 0, -1, NULL }
313};
314
315/* ----------------------------------------------------------------------- */
316/* array with description for bt848 / bt878 tv/grabber cards */
317
318struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800319 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800320 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800321 .name = " *** UNKNOWN/GENERIC *** ",
322 .video_inputs = 4,
323 .audio_inputs = 1,
324 .tuner = 0,
325 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200326 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800327 .tuner_type = -1,
328 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800329 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800330 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800331 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800332 .name = "MIRO PCTV",
333 .video_inputs = 4,
334 .audio_inputs = 1,
335 .tuner = 0,
336 .svhs = 2,
337 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200338 .muxsel = { 2, 3, 1, 1 },
339 .audiomux = { 2, 0, 0, 0, 10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800340 .needs_tvaudio = 1,
341 .tuner_type = -1,
342 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800343 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800344 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800345 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800346 .name = "Hauppauge (bt848)",
347 .video_inputs = 4,
348 .audio_inputs = 1,
349 .tuner = 0,
350 .svhs = 2,
351 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200352 .muxsel = { 2, 3, 1, 1 },
353 .audiomux = { 0, 1, 2, 3, 4 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800354 .needs_tvaudio = 1,
355 .tuner_type = -1,
356 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800357 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800358 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800359 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800360 .name = "STB, Gateway P/N 6000699 (bt848)",
361 .video_inputs = 3,
362 .audio_inputs = 1,
363 .tuner = 0,
364 .svhs = 2,
365 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200366 .muxsel = { 2, 3, 1, 1 },
367 .audiomux = { 4, 0, 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800368 .no_msp34xx = 1,
369 .needs_tvaudio = 1,
370 .tuner_type = TUNER_PHILIPS_NTSC,
371 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800372 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800373 .pll = PLL_28,
374 .has_radio = 1,
375 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800377 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800378 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800379 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
380 .video_inputs = 4,
381 .audio_inputs = 0,
382 .tuner = -1,
383 .svhs = 2,
384 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200385 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800386 .audiomux = { 0 },
387 .needs_tvaudio = 0,
388 .tuner_type = 4,
389 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800390 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800391 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800392 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800393 .name = "Diamond DTV2000",
394 .video_inputs = 4,
395 .audio_inputs = 1,
396 .tuner = 0,
397 .svhs = 2,
398 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200399 .muxsel = { 2, 3, 1, 0 },
400 .audiomux = { 0, 1, 0, 1, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800401 .needs_tvaudio = 1,
402 .tuner_type = -1,
403 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800404 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800405 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800406 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800407 .name = "AVerMedia TVPhone",
408 .video_inputs = 3,
409 .audio_inputs = 1,
410 .tuner = 0,
411 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200412 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800413 .gpiomask = 0x0f,
Michael Krufkybc286362006-01-11 19:40:17 -0200414 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800415 /* 0x04 for some cards ?? */
416 .needs_tvaudio = 1,
417 .tuner_type = -1,
418 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800419 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800420 .audio_hook = avermedia_tvphone_audio,
421 .has_remote = 1,
422 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800423 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800424 .name = "MATRIX-Vision MV-Delta",
425 .video_inputs = 5,
426 .audio_inputs = 1,
427 .tuner = -1,
428 .svhs = 3,
429 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200430 .muxsel = { 2, 3, 1, 0, 0 },
431 .audiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800432 .needs_tvaudio = 1,
433 .tuner_type = -1,
434 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800435 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800436 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800438 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800439 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800440 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
441 .video_inputs = 4,
442 .audio_inputs = 1,
443 .tuner = 0,
444 .svhs = 2,
445 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200446 .muxsel = { 2, 3, 1, 1 },
447 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800448 .needs_tvaudio = 1,
449 .pll = PLL_28,
450 .tuner_type = -1,
451 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800452 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800453 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800454 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800455 .name = "IMS/IXmicro TurboTV",
456 .video_inputs = 3,
457 .audio_inputs = 1,
458 .tuner = 0,
459 .svhs = 2,
460 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200461 .muxsel = { 2, 3, 1, 1 },
462 .audiomux = { 1, 1, 2, 3, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800463 .needs_tvaudio = 0,
464 .pll = PLL_28,
465 .tuner_type = TUNER_TEMIC_PAL,
466 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800467 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800468 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800469 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800470 .name = "Hauppauge (bt878)",
471 .video_inputs = 4,
472 .audio_inputs = 1,
473 .tuner = 0,
474 .svhs = 2,
475 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200476 .muxsel = { 2, 0, 1, 1 },
477 .audiomux = { 0, 1, 2, 3, 4 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800478 .needs_tvaudio = 1,
479 .pll = PLL_28,
480 .tuner_type = -1,
481 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800482 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800483 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800484 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800485 .name = "MIRO PCTV pro",
486 .video_inputs = 3,
487 .audio_inputs = 1,
488 .tuner = 0,
489 .svhs = 2,
490 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200491 .muxsel = { 2, 3, 1, 1 },
492 .audiomux = { 0x20001,0x10001, 0, 0,10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800493 .needs_tvaudio = 1,
494 .tuner_type = -1,
495 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800496 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800497 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800499 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800500 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800501 .name = "ADS Technologies Channel Surfer TV (bt848)",
502 .video_inputs = 3,
503 .audio_inputs = 1,
504 .tuner = 0,
505 .svhs = 2,
506 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200507 .muxsel = { 2, 3, 1, 1 },
508 .audiomux = { 13, 14, 11, 7, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800509 .needs_tvaudio = 1,
510 .tuner_type = -1,
511 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800512 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800513 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800514 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800515 .name = "AVerMedia TVCapture 98",
516 .video_inputs = 3,
517 .audio_inputs = 4,
518 .tuner = 0,
519 .svhs = 2,
520 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200521 .muxsel = { 2, 3, 1, 1 },
522 .audiomux = { 13, 14, 11, 7, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800523 .needs_tvaudio = 1,
524 .msp34xx_alt = 1,
525 .pll = PLL_28,
526 .tuner_type = TUNER_PHILIPS_PAL,
527 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800528 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800529 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800530 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800531 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800532 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800533 .name = "Aimslab Video Highway Xtreme (VHX)",
534 .video_inputs = 3,
535 .audio_inputs = 1,
536 .tuner = 0,
537 .svhs = 2,
538 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200539 .muxsel = { 2, 3, 1, 1 },
540 .audiomux = { 0, 2, 1, 3, 4 }, /* old: {0, 1, 2, 3, 4} */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800541 .needs_tvaudio = 1,
542 .pll = PLL_28,
543 .tuner_type = -1,
544 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800545 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800546 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800547 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800548 .name = "Zoltrix TV-Max",
549 .video_inputs = 3,
550 .audio_inputs = 1,
551 .tuner = 0,
552 .svhs = 2,
553 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200554 .muxsel = { 2, 3, 1, 1 },
555 .audiomux = { 0 , 0, 1 , 0, 10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800556 .needs_tvaudio = 1,
557 .tuner_type = -1,
558 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800559 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800560 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700561
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800562 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800563 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800564 .name = "Prolink Pixelview PlayTV (bt878)",
565 .video_inputs = 3,
566 .audio_inputs = 1,
567 .tuner = 0,
568 .svhs = 2,
569 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200570 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800571 #if 0
572 /* old */
573 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
574 #else
575 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
576 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
577 #endif
578 .needs_tvaudio = 1,
579 .pll = PLL_28,
580 .tuner_type = -1,
581 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800582 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800583 .name = "Leadtek WinView 601",
584 .video_inputs = 3,
585 .audio_inputs = 1,
586 .tuner = 0,
587 .svhs = 2,
588 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200589 .muxsel = { 2, 3, 1, 1,0 },
590 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800591 .needs_tvaudio = 1,
592 .tuner_type = -1,
593 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800594 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800595 .audio_hook = winview_audio,
596 .has_radio = 1,
597 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800598 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800599 .name = "AVEC Intercapture",
600 .video_inputs = 3,
601 .audio_inputs = 2,
602 .tuner = 0,
603 .svhs = 2,
604 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200605 .muxsel = { 2, 3, 1, 1 },
606 .audiomux = { 1, 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800607 .needs_tvaudio = 1,
608 .tuner_type = -1,
609 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800610 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800611 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800612 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800613 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
614 .video_inputs = 4,
615 .audio_inputs = 1,
616 .tuner = -1,
617 .svhs = -1,
618 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200619 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800620 .audiomux = { 0 },
621 .no_msp34xx = 1,
622 .tuner_type = -1,
623 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800624 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800625 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800627 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800628 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800629 .name = "CEI Raffles Card",
630 .video_inputs = 3,
631 .audio_inputs = 3,
632 .tuner = 0,
633 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200634 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800635 .tuner_type = -1,
636 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800637 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800638 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800639 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800640 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
641 .video_inputs = 4,
642 .audio_inputs = 2, /* tuner, line in */
643 .tuner = 0,
644 .svhs = 2,
645 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200646 .muxsel = { 2, 3, 1, 1 },
647 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800648 .pll = PLL_28,
649 .tuner_type = TUNER_PHILIPS_PAL_I,
650 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800651 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800652 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800653 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800654 .name = "Askey CPH050/ Phoebe Tv Master + FM",
655 .video_inputs = 3,
656 .audio_inputs = 1,
657 .tuner = 0,
658 .svhs = 2,
659 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200660 .muxsel = { 2, 3, 1, 1 },
661 .audiomux = { 0, 1, 0x800, 0x400, 0xc00, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800662 .needs_tvaudio = 1,
663 .pll = PLL_28,
664 .tuner_type = -1,
665 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800666 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800667 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800668 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800669 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
670 .video_inputs = 3,
671 .audio_inputs = 1,
672 .tuner = 0,
673 .svhs = -1,
674 .gpiomask = 7,
675 .muxsel = { 2, 3, -1 },
676 .digital_mode = DIGITAL_MODE_CAMERA,
677 .audiomux = { 0, 0, 0, 0, 0 },
678 .no_msp34xx = 1,
679 .pll = PLL_28,
680 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
681 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800682 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800683 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700684
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800685 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800686 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800687 .name = "Askey CPH05X/06X (bt878) [many vendors]",
688 .video_inputs = 3,
689 .audio_inputs = 1,
690 .tuner = 0,
691 .svhs = 2,
692 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200693 .muxsel = { 2, 3, 1, 1 },
694 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800695 .needs_tvaudio = 1,
696 .pll = PLL_28,
697 .tuner_type = -1,
698 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800699 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800700 .has_remote = 1,
701 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800702 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800703 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
704 .video_inputs = 3,
705 .audio_inputs = 1,
706 .tuner = 0,
707 .svhs = 2,
708 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200709 .muxsel = { 2, 3, 1, 1 },
710 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800711 .needs_tvaudio = 0,
712 .tuner_type = TUNER_PHILIPS_PAL,
713 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800714 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800715 .audio_hook = terratv_audio,
716 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800717 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800718 .name = "Hauppauge WinCam newer (bt878)",
719 .video_inputs = 4,
720 .audio_inputs = 1,
721 .tuner = 0,
722 .svhs = 3,
723 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200724 .muxsel = { 2, 0, 1, 1 },
725 .audiomux = { 0, 1, 2, 3, 4 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800726 .needs_tvaudio = 1,
727 .tuner_type = -1,
728 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800729 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800730 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800731 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800732 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
733 .video_inputs = 4,
734 .audio_inputs = 2,
735 .tuner = 0,
736 .svhs = 2,
737 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200738 .muxsel = { 2, 3, 1, 1 },
739 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800740 .pll = PLL_28,
741 .tuner_type = TUNER_PHILIPS_SECAM,
742 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800743 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800744 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800746 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800747 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800748 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
749 .video_inputs = 3,
750 .audio_inputs = 1,
751 .tuner = 0,
752 .svhs = 2,
753 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200754 .muxsel = { 2, 3, 1, 1 },
755 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800756 .needs_tvaudio = 0,
757 .tuner_type = TUNER_PHILIPS_PAL,
758 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800759 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800760 .audio_hook = terratv_audio,
761 /* GPIO wiring:
762 External 20 pin connector (for Active Radio Upgrade board)
763 gpio00: i2c-sda
764 gpio01: i2c-scl
765 gpio02: om5610-data
766 gpio03: om5610-clk
767 gpio04: om5610-wre
768 gpio05: om5610-stereo
769 gpio06: rds6588-davn
770 gpio07: Pin 7 n.c.
771 gpio08: nIOW
772 gpio09+10: nIOR, nSEL ?? (bt878)
773 gpio09: nIOR (bt848)
774 gpio10: nSEL (bt848)
775 Sound Routing:
776 gpio16: u2-A0 (1st 4052bt)
777 gpio17: u2-A1
778 gpio18: u2-nEN
779 gpio19: u4-A0 (2nd 4052)
780 gpio20: u4-A1
781 u4-nEN - GND
782 Btspy:
783 00000 : Cdrom (internal audio input)
784 10000 : ext. Video audio input
785 20000 : TV Mono
786 a0000 : TV Mono/2
787 1a0000 : TV Stereo
788 30000 : Radio
789 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700790 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700791
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800792 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800793 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800794 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
795 .name = "Imagenation PXC200",
796 .video_inputs = 5,
797 .audio_inputs = 1,
798 .tuner = -1,
799 .svhs = 1, /* was: 4 */
800 .gpiomask = 0,
801 .muxsel = { 2, 3, 1, 0, 0},
802 .audiomux = { 0 },
803 .needs_tvaudio = 1,
804 .tuner_type = -1,
805 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800806 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800807 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800809 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800810 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800811 .name = "Lifeview FlyVideo 98 LR50",
812 .video_inputs = 4,
813 .audio_inputs = 1,
814 .tuner = 0,
815 .svhs = 2,
816 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200817 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800818 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
819 .pll = PLL_28,
820 .tuner_type = -1,
821 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800822 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800823 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800824 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800825 .name = "Formac iProTV, Formac ProTV I (bt848)",
826 .video_inputs = 4,
827 .audio_inputs = 1,
828 .tuner = 0,
829 .svhs = 3,
830 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200831 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800832 .audiomux = { 1, 0, 0, 0, 0 },
833 .pll = PLL_28,
834 .tuner_type = TUNER_PHILIPS_PAL,
835 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800836 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800837 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700838
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800839 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800840 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800841 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
842 .video_inputs = 4,
843 .audio_inputs = 0,
844 .tuner = -1,
845 .svhs = 2,
846 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200847 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800848 .audiomux = { 0 },
849 .needs_tvaudio = 0,
850 .tuner_type = 4,
851 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800852 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800853 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800854 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800855 .name = "Terratec TerraTValue Version Bt878",
856 .video_inputs = 3,
857 .audio_inputs = 1,
858 .tuner = 0,
859 .svhs = 2,
860 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200861 .muxsel = { 2, 3, 1, 1 },
862 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800863 .needs_tvaudio = 1,
864 .pll = PLL_28,
865 .tuner_type = TUNER_PHILIPS_PAL,
866 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800867 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800868 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800869 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800870 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
871 .video_inputs = 4,
872 .audio_inputs = 1,
873 .tuner = 0,
874 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200875 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800876 #if 0
877 .gpiomask = 0xc33000,
878 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
879 #else
880 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
881 .gpiomask = 0xb33000,
882 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
883 #endif
884 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
885 gpio23 -- hef4052:nEnable (0x800000)
886 gpio12 -- hef4052:A1
887 gpio13 -- hef4052:A0
888 0x0000: external audio
889 0x1000: FM
890 0x2000: TV
891 0x3000: n.c.
892 Note: There exists another variant "Winfast 2000" with tv stereo !?
893 Note: eeprom only contains FF and pci subsystem id 107d:6606
894 */
895 .needs_tvaudio = 0,
896 .pll = PLL_28,
897 .has_radio = 1,
898 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
899 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800900 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800901 .audio_hook = winfast2000_audio,
902 .has_remote = 1,
903 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800904 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800905 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
906 .video_inputs = 4,
907 .audio_inputs = 3,
908 .tuner = 0,
909 .svhs = 2,
910 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200911 .muxsel = { 2, 3, 1, 1 },
912 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800913 .pll = PLL_28,
914 .tuner_type = -1,
915 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800916 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800917 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700918
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800919 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800920 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800921 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
922 .video_inputs = 4,
923 .audio_inputs = 3,
924 .tuner = 0,
925 .svhs = 2,
926 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200927 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800928 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
929 .pll = PLL_28,
930 .tuner_type = -1,
931 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800932 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800933 .has_radio = 1,
934 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800935 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800936 .name = "Prolink PixelView PlayTV pro",
937 .video_inputs = 3,
938 .audio_inputs = 1,
939 .tuner = 0,
940 .svhs = 2,
941 .gpiomask = 0xff,
942 .muxsel = { 2, 3, 1, 1 },
943 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
944 .no_msp34xx = 1,
945 .pll = PLL_28,
946 .tuner_type = -1,
947 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800948 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800949 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800950 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800951 .name = "Askey CPH06X TView99",
952 .video_inputs = 4,
953 .audio_inputs = 1,
954 .tuner = 0,
955 .svhs = 2,
956 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200957 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800958 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
959 .needs_tvaudio = 1,
960 .pll = PLL_28,
961 .tuner_type = 1,
962 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800963 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800964 .has_remote = 1,
965 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800966 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800967 .name = "Pinnacle PCTV Studio/Rave",
968 .video_inputs = 3,
969 .audio_inputs = 1,
970 .tuner = 0,
971 .svhs = 2,
972 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -0200973 .muxsel = { 2, 3, 1, 1 },
974 .audiomux = { 2, 0xd0001, 0, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800975 .needs_tvaudio = 0,
976 .pll = PLL_28,
977 .tuner_type = -1,
978 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800979 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800980 },
981
982 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800983 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800984 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
985 .video_inputs = 3,
986 .audio_inputs = 1,
987 .tuner = 0,
988 .svhs = 2,
989 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200990 .muxsel = { 2, 3, 1, 1 },
991 .audiomux = { 4, 0, 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800992 .no_msp34xx = 1,
993 .needs_tvaudio = 1,
994 .tuner_type = TUNER_PHILIPS_NTSC,
995 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800996 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800997 .pll = PLL_28,
998 .has_radio = 1,
999 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001000 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001001 .name = "AVerMedia TVPhone 98",
1002 .video_inputs = 3,
1003 .audio_inputs = 4,
1004 .tuner = 0,
1005 .svhs = 2,
1006 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001007 .muxsel = { 2, 3, 1, 1 },
1008 .audiomux = { 13, 4, 11, 7, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001009 .needs_tvaudio = 1,
1010 .pll = PLL_28,
1011 .tuner_type = -1,
1012 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001013 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001014 .has_radio = 1,
1015 .audio_hook = avermedia_tvphone_audio,
1016 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001017 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001018 .name = "ProVideo PV951", /* pic16c54 */
1019 .video_inputs = 3,
1020 .audio_inputs = 1,
1021 .tuner = 0,
1022 .svhs = 2,
1023 .gpiomask = 0,
1024 .muxsel = { 2, 3, 1, 1},
1025 .audiomux = { 0, 0, 0, 0, 0},
1026 .needs_tvaudio = 1,
1027 .no_msp34xx = 1,
1028 .pll = PLL_28,
1029 .tuner_type = 1,
1030 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001031 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001032 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001033 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001034 .name = "Little OnAir TV",
1035 .video_inputs = 3,
1036 .audio_inputs = 1,
1037 .tuner = 0,
1038 .svhs = 2,
1039 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001040 .muxsel = { 2, 3, 1, 1 },
1041 .audiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001042 .no_msp34xx = 1,
1043 .tuner_type = -1,
1044 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001045 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001046 },
1047
1048 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001049 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001050 .name = "Sigma TVII-FM",
1051 .video_inputs = 2,
1052 .audio_inputs = 1,
1053 .tuner = 0,
1054 .svhs = -1,
1055 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001056 .muxsel = { 2, 3, 1, 1 },
1057 .audiomux = { 1, 1, 0, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001058 .no_msp34xx = 1,
1059 .pll = PLL_NONE,
1060 .tuner_type = -1,
1061 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001062 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001063 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001064 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001065 .name = "MATRIX-Vision MV-Delta 2",
1066 .video_inputs = 5,
1067 .audio_inputs = 1,
1068 .tuner = -1,
1069 .svhs = 3,
1070 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001071 .muxsel = { 2, 3, 1, 0, 0 },
1072 .audiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001073 .no_msp34xx = 1,
1074 .pll = PLL_28,
1075 .tuner_type = -1,
1076 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001077 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001078 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001079 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001080 .name = "Zoltrix Genie TV/FM",
1081 .video_inputs = 3,
1082 .audio_inputs = 1,
1083 .tuner = 0,
1084 .svhs = 2,
1085 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001086 .muxsel = { 2, 3, 1, 1 },
1087 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001088 .no_msp34xx = 1,
1089 .pll = PLL_28,
1090 .tuner_type = 21,
1091 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001092 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001093 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001094 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001095 .name = "Terratec TV/Radio+",
1096 .video_inputs = 3,
1097 .audio_inputs = 1,
1098 .tuner = 0,
1099 .svhs = 2,
1100 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001101 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001102 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1103 .needs_tvaudio = 1,
1104 .no_msp34xx = 1,
1105 .pll = PLL_35,
1106 .tuner_type = 1,
1107 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001108 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001109 .has_radio = 1,
1110 },
1111
1112 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001113 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001114 .name = "Askey CPH03x/ Dynalink Magic TView",
1115 .video_inputs = 3,
1116 .audio_inputs = 1,
1117 .tuner = 0,
1118 .svhs = 2,
1119 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001120 .muxsel = { 2, 3, 1, 1 },
1121 .audiomux = {2,0,0,0,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001122 .needs_tvaudio = 1,
1123 .pll = PLL_28,
1124 .tuner_type = -1,
1125 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001126 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001127 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001128 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001129 .name = "IODATA GV-BCTV3/PCI",
1130 .video_inputs = 3,
1131 .audio_inputs = 1,
1132 .tuner = 0,
1133 .svhs = 2,
1134 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001135 .muxsel = {2, 3, 0, 0 },
1136 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001137 .no_msp34xx = 1,
1138 .pll = PLL_28,
1139 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1140 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001141 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001142 .audio_hook = gvbctv3pci_audio,
1143 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001144 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001145 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1146 .video_inputs = 5,
1147 .audio_inputs = 1,
1148 .tuner = 0,
1149 .svhs = 3,
1150 .gpiomask = 0xAA0000,
1151 .muxsel = { 2,3,1,1,-1 },
1152 .digital_mode = DIGITAL_MODE_CAMERA,
1153 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1154 .no_msp34xx = 1,
1155 .pll = PLL_28,
1156 .tuner_type = TUNER_PHILIPS_PAL_I,
1157 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001158 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001159 .has_remote = 1,
1160 /* GPIO wiring: (different from Rev.4C !)
1161 GPIO17: U4.A0 (first hef4052bt)
1162 GPIO19: U4.A1
1163 GPIO20: U5.A1 (second hef4052bt)
1164 GPIO21: U4.nEN
1165 GPIO22: BT832 Reset Line
1166 GPIO23: A5,A0, U5,nEN
1167 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1168 */
1169 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001170 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001171 .name = "Eagle Wireless Capricorn2 (bt878A)",
1172 .video_inputs = 4,
1173 .audio_inputs = 1,
1174 .tuner = 0,
1175 .svhs = 2,
1176 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001177 .muxsel = { 2, 0, 1, 1 },
1178 .audiomux = { 0, 1, 2, 3, 4 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001179 .pll = PLL_28,
1180 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1181 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001182 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001183 },
1184
1185 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001186 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001187 /* David Härdeman <david@2gen.com> */
1188 .name = "Pinnacle PCTV Studio Pro",
1189 .video_inputs = 4,
1190 .audio_inputs = 1,
1191 .tuner = 0,
1192 .svhs = 3,
1193 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001194 .muxsel = { 2, 3, 1, 1 },
1195 .audiomux = { 1, 0xd0001, 0, 0, 10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001196 /* sound path (5 sources):
1197 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1198 0= ext. Audio IN
1199 1= from MUX2
1200 2= Mono TV sound from Tuner
1201 3= not connected
1202 MUX2 (mask 0x30000):
1203 0,2,3= from MSP34xx
1204 1= FM stereo Radio from Tuner */
1205 .needs_tvaudio = 0,
1206 .pll = PLL_28,
1207 .tuner_type = -1,
1208 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001209 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001210 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001211 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001212 /* Claas Langbehn <claas@bigfoot.com>,
1213 Sven Grothklags <sven@upb.de> */
1214 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1215 .video_inputs = 4,
1216 .audio_inputs = 3,
1217 .tuner = 0,
1218 .svhs = 2,
1219 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001220 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001221 .audiomux = { 0, 0, 0x10, 8, 4 },
1222 .needs_tvaudio = 1,
1223 .pll = PLL_28,
1224 .tuner_type = TUNER_PHILIPS_PAL,
1225 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001226 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001227 .has_radio = 1,
1228 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001229 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001230 /* Tim Röstermundt <rosterm@uni-muenster.de>
1231 in de.comp.os.unix.linux.hardware:
1232 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1233 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1234 options tuner type=5 */
1235 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1236 .video_inputs = 4,
1237 .audio_inputs = 1,
1238 .tuner = 0,
1239 .svhs = 2,
1240 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001241 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001242 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1243 /* For cards with tda9820/tda9821:
1244 0x0000: Tuner normal stereo
1245 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1246 0x0880: Tuner A2 stereo */
1247 .pll = PLL_28,
1248 .tuner_type = -1,
1249 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001250 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001251 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001252 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001253 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1254 old Easy TV BT848 version (model CPH031) */
1255 .name = "Askey CPH031/ BESTBUY Easy TV",
1256 .video_inputs = 4,
1257 .audio_inputs = 1,
1258 .tuner = 0,
1259 .svhs = 2,
1260 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001261 .muxsel = { 2, 3, 1, 0 },
1262 .audiomux = { 2, 0, 0, 0, 10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001263 .needs_tvaudio = 0,
1264 .pll = PLL_28,
1265 .tuner_type = TUNER_TEMIC_PAL,
1266 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001267 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001268 },
1269
1270 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001271 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001272 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1273 .name = "Lifeview FlyVideo 98FM LR50",
1274 .video_inputs = 4,
1275 .audio_inputs = 3,
1276 .tuner = 0,
1277 .svhs = 2,
1278 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001279 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001280 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1281 .pll = PLL_28,
1282 .tuner_type = 5,
1283 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001284 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001285 },
1286 /* This is the ultimate cheapo capture card
1287 * just a BT848A on a small PCB!
1288 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001289 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001290 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1291 .video_inputs = 2,
1292 .audio_inputs = 0,
1293 .tuner = -1,
1294 .svhs = 1,
1295 .gpiomask = 0,
1296 .muxsel = { 3, 1 },
1297 .audiomux = { 0 },
1298 .needs_tvaudio = 0,
1299 .no_msp34xx = 1,
1300 .pll = PLL_35,
1301 .tuner_type = -1,
1302 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001303 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001304 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001305 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001306 /* Daniel Herrington <daniel.herrington@home.com> */
1307 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1308 .video_inputs = 3,
1309 .audio_inputs = 1,
1310 .tuner = 0,
1311 .svhs = 2,
1312 .gpiomask = 0xe00,
1313 .muxsel = { 2, 3, 1, 1},
1314 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1315 .needs_tvaudio = 1,
1316 .pll = PLL_28,
1317 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1318 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001319 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001320 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001321 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001322 /* Matti Mottus <mottus@physic.ut.ee> */
1323 .name = "Askey CPH03x TV Capturer",
1324 .video_inputs = 4,
1325 .audio_inputs = 1,
1326 .tuner = 0,
1327 .svhs = 2,
1328 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001329 .muxsel = { 2, 3, 1, 0 },
1330 .audiomux = { 2, 0, 0, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001331 .pll = PLL_28,
1332 .tuner_type = 0,
1333 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001334 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001335 },
1336
1337 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001338 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001339 /* Philip Blundell <philb@gnu.org> */
1340 .name = "Modular Technology MM100PCTV",
1341 .video_inputs = 2,
1342 .audio_inputs = 2,
1343 .tuner = 0,
1344 .svhs = -1,
1345 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001346 .muxsel = { 2, 3, 1, 1 },
1347 .audiomux = { 2, 0, 0, 1, 8 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001348 .pll = PLL_35,
1349 .tuner_type = TUNER_TEMIC_PAL,
1350 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001351 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001352 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001353 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001354 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001355 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001356 .video_inputs = 2,
1357 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001358 .tuner = -1,
1359 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001360 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001361 .muxsel = { 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001362 .audiomux = { },
1363 .no_msp34xx = 1,
1364 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001365 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001366 .tuner_type = -1,
1367 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001368 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001369 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001370 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001371 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1372 new Easy TV BT878 version (model CPH061)
1373 special thanks to Informatica Mieres for providing the card */
1374 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1375 .video_inputs = 3,
1376 .audio_inputs = 2,
1377 .tuner = 0,
1378 .svhs = 2,
1379 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001380 .muxsel = { 2, 3, 1, 0 },
1381 .audiomux = { 1, 0, 4, 4, 9 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001382 .needs_tvaudio = 0,
1383 .pll = PLL_28,
1384 .tuner_type = TUNER_PHILIPS_PAL,
1385 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001386 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001387 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001388 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001389 /* Lukas Gebauer <geby@volny.cz> */
1390 .name = "ATI TV-Wonder",
1391 .video_inputs = 3,
1392 .audio_inputs = 1,
1393 .tuner = 0,
1394 .svhs = 2,
1395 .gpiomask = 0xf03f,
1396 .muxsel = { 2, 3, 1, 0 },
Michael Krufkybc286362006-01-11 19:40:17 -02001397 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001398 .pll = PLL_28,
1399 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1400 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001401 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001402 },
1403
1404 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001405 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001406 /* Lukas Gebauer <geby@volny.cz> */
1407 .name = "ATI TV-Wonder VE",
1408 .video_inputs = 2,
1409 .audio_inputs = 1,
1410 .tuner = 0,
1411 .svhs = -1,
1412 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001413 .muxsel = { 2, 3, 0, 1 },
1414 .audiomux = { 0, 0, 1, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001415 .no_msp34xx = 1,
1416 .pll = PLL_28,
1417 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1418 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001419 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001420 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001421 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001422 /* DeeJay <deejay@westel900.net (2000S) */
1423 .name = "Lifeview FlyVideo 2000S LR90",
1424 .video_inputs = 3,
1425 .audio_inputs = 3,
1426 .tuner = 0,
1427 .svhs = 2,
1428 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001429 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001430 /* Radio changed from 1e80 to 0x800 to make
1431 FlyVideo2000S in .hu happy (gm)*/
1432 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1433 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1434 .audio_hook = fv2000s_audio,
1435 .no_msp34xx = 1,
1436 .no_tda9875 = 1,
1437 .needs_tvaudio = 1,
1438 .pll = PLL_28,
1439 .tuner_type = 5,
1440 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001441 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001442 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001443 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001444 .name = "Terratec TValueRadio",
1445 .video_inputs = 3,
1446 .audio_inputs = 1,
1447 .tuner = 0,
1448 .svhs = 2,
1449 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001450 .muxsel = { 2, 3, 1, 1 },
1451 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001452 .needs_tvaudio = 1,
1453 .pll = PLL_28,
1454 .tuner_type = TUNER_PHILIPS_PAL,
1455 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001456 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001457 .has_radio = 1,
1458 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001459 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001460 /* TANAKA Kei <peg00625@nifty.com> */
1461 .name = "IODATA GV-BCTV4/PCI",
1462 .video_inputs = 3,
1463 .audio_inputs = 1,
1464 .tuner = 0,
1465 .svhs = 2,
1466 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001467 .muxsel = {2, 3, 0, 0 },
1468 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001469 .no_msp34xx = 1,
1470 .pll = PLL_28,
1471 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1472 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001473 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001474 .audio_hook = gvbctv3pci_audio,
1475 },
1476
1477 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001478 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001479 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1480 /* try "insmod msp3400 simple=0" if you have
1481 * sound problems with this card. */
1482 .video_inputs = 4,
1483 .audio_inputs = 1,
1484 .tuner = 0,
1485 .svhs = -1,
1486 .gpiomask = 0x4f8a00,
1487 /* 0x100000: 1=MSP enabled (0=disable again)
1488 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1489 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1490 /* tvtuner, radio, external,internal, mute, stereo
1491 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001492 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001493 .tuner_type = TUNER_MT2032,
1494 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001495 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001496 .pll = PLL_28,
1497 .has_radio = 1,
1498 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001499 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001500 /* Philip Blundell <pb@nexus.co.uk> */
1501 .name = "Active Imaging AIMMS",
1502 .video_inputs = 1,
1503 .audio_inputs = 0,
1504 .tuner = -1,
1505 .tuner_type = -1,
1506 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001507 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001508 .pll = PLL_28,
1509 .muxsel = { 2 },
1510 .gpiomask = 0
1511 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001512 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001513 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1514 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1515 .video_inputs = 3,
1516 .audio_inputs = 4,
1517 .tuner = 0,
1518 .svhs = 2,
1519 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001520 .muxsel = { 2, 3, 1, 1 },
1521 .audiomux = { 0, 0, 11, 7, 13, 0 }, /* TV and Radio with same GPIO ! */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001522 .needs_tvaudio = 1,
1523 .pll = PLL_28,
1524 .tuner_type = 25,
1525 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001526 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001527 .has_remote = 1,
1528 /* GPIO wiring:
1529 GPIO0: U4.A0 (hef4052bt)
1530 GPIO1: U4.A1
1531 GPIO2: U4.A1 (second hef4052bt)
1532 GPIO3: U4.nEN, U5.A0, A5.nEN
1533 GPIO8-15: vrd866b ?
1534 */
1535 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001536 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001537 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1538 .video_inputs = 4,
1539 .audio_inputs = 0,
1540 .tuner = -1,
1541 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001542 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001543 .pll = PLL_28,
1544 .no_msp34xx = 1,
1545 .tuner_type = UNSET,
1546 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001547 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001548 },
1549
1550 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001551 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001552 /* Dariusz Kowalewski <darekk@automex.pl> */
1553 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1554 .video_inputs = 4,
1555 .audio_inputs = 1,
1556 .tuner = 0,
1557 .svhs = 2,
1558 .gpiomask = 0x3f,
1559 .muxsel = { 2, 3, 1, 1 },
1560 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1561 .needs_tvaudio = 1,
1562 .no_msp34xx = 1,
1563 .no_tda9875 = 1,
1564 .pll = PLL_28,
1565 .tuner_type = 5,
1566 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001567 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001568 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1569 .has_radio = 1, /* Note: not all cards have radio */
1570 .has_remote = 1,
1571 /* GPIO wiring:
1572 GPIO0: A0 hef4052
1573 GPIO1: A1 hef4052
1574 GPIO3: nEN hef4052
1575 GPIO8-15: vrd866b
1576 GPIO20,22,23: R30,R29,R28
1577 */
1578 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001579 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001580 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1581 /* you must jumper JP5 for the card to work */
1582 .name = "Sensoray 311",
1583 .video_inputs = 5,
1584 .audio_inputs = 0,
1585 .tuner = -1,
1586 .svhs = 4,
1587 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001588 .muxsel = { 2, 3, 1, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001589 .audiomux = { 0 },
1590 .needs_tvaudio = 0,
1591 .tuner_type = -1,
1592 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001593 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001594 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001595 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001596 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1597 .name = "RemoteVision MX (RV605)",
1598 .video_inputs = 16,
1599 .audio_inputs = 0,
1600 .tuner = -1,
1601 .svhs = -1,
1602 .gpiomask = 0x00,
1603 .gpiomask2 = 0x07ff,
1604 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1605 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1606 .no_msp34xx = 1,
1607 .no_tda9875 = 1,
1608 .tuner_type = -1,
1609 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001610 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001611 .muxsel_hook = rv605_muxsel,
1612 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001613 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001614 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1615 .video_inputs = 3,
1616 .audio_inputs = 2,
1617 .tuner = 0,
1618 .svhs = 2,
1619 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1620 .muxsel = { 2, 1, 1, },
1621 .audiomux = { 0, 1, 2, 2, 4 },
1622 .needs_tvaudio = 0,
1623 .tuner_type = TUNER_PHILIPS_PAL,
1624 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001625 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001626 .pll = PLL_28,
1627 .has_radio = 1,
1628 },
1629
1630 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001631 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001632 /* Masaki Suzuki <masaki@btree.org> */
1633 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1634 .video_inputs = 3,
1635 .audio_inputs = 1,
1636 .tuner = 0,
1637 .svhs = 2,
1638 .gpiomask = 0x140007,
1639 .muxsel = { 2, 3, 1, 1 },
1640 .audiomux = { 0, 1, 2, 3, 4, 0 },
1641 .tuner_type = TUNER_PHILIPS_NTSC,
1642 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001643 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001644 .audio_hook = windvr_audio,
1645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001646 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001647 .name = "GrandTec Multi Capture Card (Bt878)",
1648 .video_inputs = 4,
1649 .audio_inputs = 0,
1650 .tuner = -1,
1651 .svhs = -1,
1652 .gpiomask = 0,
1653 .muxsel = { 2, 3, 1, 0 },
1654 .audiomux = { 0 },
1655 .needs_tvaudio = 0,
1656 .no_msp34xx = 1,
1657 .pll = PLL_28,
1658 .tuner_type = -1,
1659 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001660 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001661 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001662 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001663 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1664 .video_inputs = 4,
1665 .audio_inputs = 3,
1666 .tuner = 0,
1667 .svhs = 2,
1668 .gpiomask = 7,
1669 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1670 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1671 * This card lacks external Audio In, so we mute it on Ext. & Int.
1672 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1673 * This card lacks PCI subsystem ID, sigh.
1674 * audiomux=1: lower volume, 2+3: mute
1675 * btwincap uses 0x80000/0x80003
1676 */
1677 .needs_tvaudio = 0,
1678 .no_msp34xx = 1,
1679 .pll = PLL_28,
1680 .tuner_type = 5,
1681 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001682 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001683 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1684 radio signal strength indicators work fine. */
1685 .has_radio = 1,
1686 /* GPIO Info:
1687 GPIO0,1: HEF4052 A0,A1
1688 GPIO2: HEF4052 nENABLE
1689 GPIO3-7: n.c.
1690 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1691 GPIO14,15: ??
1692 GPIO16-21: n.c.
1693 GPIO22,23: ??
1694 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1695 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001696 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001697 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1698 .name = "DSP Design TCVIDEO",
1699 .video_inputs = 4,
1700 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001701 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001702 .pll = PLL_28,
1703 .tuner_type = -1,
1704 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001705 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001706 },
1707
1708 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001709 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001710 .name = "Hauppauge WinTV PVR",
1711 .video_inputs = 4,
1712 .audio_inputs = 1,
1713 .tuner = 0,
1714 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001715 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001716 .needs_tvaudio = 1,
1717 .pll = PLL_28,
1718 .tuner_type = -1,
1719 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001720 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001721
1722 .gpiomask = 7,
1723 .audiomux = {7},
1724 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001725 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001726 .name = "IODATA GV-BCTV5/PCI",
1727 .video_inputs = 3,
1728 .audio_inputs = 1,
1729 .tuner = 0,
1730 .svhs = 2,
1731 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001732 .muxsel = {2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001733 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1734 .no_msp34xx = 1,
1735 .pll = PLL_28,
1736 .tuner_type = TUNER_PHILIPS_NTSC_M,
1737 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001738 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001739 .audio_hook = gvbctv5pci_audio,
1740 .has_radio = 1,
1741 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001742 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001743 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1744 .video_inputs = 4, /* id-inputs-clock */
1745 .audio_inputs = 0,
1746 .tuner = -1,
1747 .svhs = 3,
1748 .muxsel = { 3, 2, 0, 1 },
1749 .pll = PLL_28,
1750 .tuner_type = -1,
1751 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001752 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001753 .no_msp34xx = 1,
1754 .no_tda9875 = 1,
1755 .no_tda7432 = 1,
1756 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001757 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001758 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1759 .video_inputs = 3,
1760 .audio_inputs = 0,
1761 .tuner = -1,
1762 .svhs = 2,
1763 .muxsel = { 2, 3, 1 },
1764 .pll = PLL_28,
1765 .tuner_type = -1,
1766 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001767 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001768 .no_msp34xx = 1,
1769 .no_tda9875 = 1,
1770 .no_tda7432 = 1,
1771 },
1772
1773 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001774 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001775 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1776 .video_inputs = 2,
1777 .audio_inputs = 0,
1778 .tuner = -1,
1779 .svhs = 1,
1780 .muxsel = { 3, 1 },
1781 .pll = PLL_28,
1782 .tuner_type = -1,
1783 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001784 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001785 .no_msp34xx = 1,
1786 .no_tda9875 = 1,
1787 .no_tda7432 = 1,
1788 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001789 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001790 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1791 .video_inputs = 1,
1792 .audio_inputs = 0,
1793 .tuner = -1,
1794 .svhs = -1,
1795 .muxsel = { 0 },
1796 .pll = PLL_28,
1797 .tuner_type = -1,
1798 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001799 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001800 .no_msp34xx = 1,
1801 .no_tda9875 = 1,
1802 .no_tda7432 = 1,
1803 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001804 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001805 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1806 .video_inputs = 2,
1807 .audio_inputs = 0,
1808 .tuner = -1,
1809 .svhs = 1,
1810 .muxsel = { 0, 1 },
1811 .pll = PLL_28,
1812 .tuner_type = -1,
1813 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001814 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001815 .no_msp34xx = 1,
1816 .no_tda9875 = 1,
1817 .no_tda7432 = 1,
1818 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001819 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001820 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1821 .video_inputs = 1,
1822 .audio_inputs = 1,
1823 .tuner = -1,
1824 .svhs = -1,
1825 .muxsel = { 0 },
1826 .pll = PLL_28,
1827 .tuner_type = UNSET,
1828 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001829 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001830 .no_msp34xx = 1,
1831 .no_tda9875 = 1,
1832 .no_tda7432 = 1,
1833 },
1834
1835 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001836 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001837 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1838 .video_inputs = 2,
1839 .audio_inputs = 1,
1840 .tuner = -1,
1841 .svhs = 1,
1842 .muxsel = { 0, 1 },
1843 .pll = PLL_28,
1844 .tuner_type = UNSET,
1845 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001846 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001847 .no_msp34xx = 1,
1848 .no_tda9875 = 1,
1849 .no_tda7432 = 1,
1850 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001851 [BTTV_BOARD_OSPREY2x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001852 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1853 .video_inputs = 2,
1854 .audio_inputs = 1,
1855 .tuner = -1,
1856 .svhs = 1,
1857 .muxsel = { 2, 3 },
1858 .pll = PLL_28,
1859 .tuner_type = UNSET,
1860 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001861 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001862 .no_msp34xx = 1,
1863 .no_tda9875 = 1,
1864 .no_tda7432 = 1,
1865 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001866 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001867 .name = "Osprey 500", /* 500 */
1868 .video_inputs = 2,
1869 .audio_inputs = 1,
1870 .tuner = -1,
1871 .svhs = 1,
1872 .muxsel = { 2, 3 },
1873 .pll = PLL_28,
1874 .tuner_type = -1,
1875 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001876 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001877 .no_msp34xx = 1,
1878 .no_tda9875 = 1,
1879 .no_tda7432 = 1,
1880 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001881 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001882 .name = "Osprey 540", /* 540 */
1883 .video_inputs = 4,
1884 .audio_inputs = 1,
1885 .tuner = -1,
1886 #if 0 /* TODO ... */
1887 .svhs = OSPREY540_SVID_ANALOG,
1888 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1889 [OSPREY540_SVID_ANALOG] = 3, },
1890 #endif
1891 .pll = PLL_28,
1892 .tuner_type = -1,
1893 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001894 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001895 .no_msp34xx = 1,
1896 .no_tda9875 = 1,
1897 .no_tda7432 = 1,
1898 #if 0 /* TODO ... */
1899 .muxsel_hook = osprey_540_muxsel,
1900 .picture_hook = osprey_540_set_picture,
1901 #endif
1902 },
1903
1904 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001905 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001906 .name = "Osprey 2000", /* 2000 */
1907 .video_inputs = 2,
1908 .audio_inputs = 1,
1909 .tuner = -1,
1910 .svhs = 1,
1911 .muxsel = { 2, 3 },
1912 .pll = PLL_28,
1913 .tuner_type = UNSET,
1914 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001915 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001916 .no_msp34xx = 1,
1917 .no_tda9875 = 1,
1918 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1919 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001920 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001921 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1922 .name = "IDS Eagle",
1923 .video_inputs = 4,
1924 .audio_inputs = 0,
1925 .tuner = -1,
1926 .tuner_type = -1,
1927 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001928 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001929 .svhs = -1,
1930 .gpiomask = 0,
1931 .muxsel = { 0, 1, 2, 3 },
1932 .muxsel_hook = eagle_muxsel,
1933 .no_msp34xx = 1,
1934 .no_tda9875 = 1,
1935 .pll = PLL_28,
1936 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001937 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001938 .name = "Pinnacle PCTV Sat",
1939 .video_inputs = 2,
1940 .audio_inputs = 0,
1941 .svhs = 1,
1942 .tuner = -1,
1943 .tuner_type = -1,
1944 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001945 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001946 .no_msp34xx = 1,
1947 .no_tda9875 = 1,
1948 .no_tda7432 = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001949 .muxsel = { 3, 0, 1, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001950 .pll = PLL_28,
1951 .no_gpioirq = 1,
1952 .has_dvb = 1,
1953 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001954 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001955 .name = "Formac ProTV II (bt878)",
1956 .video_inputs = 4,
1957 .audio_inputs = 1,
1958 .tuner = 0,
1959 .svhs = 3,
1960 .gpiomask = 2,
1961 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02001962 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001963 .audiomux = { 2, 2, 0, 0, 0 },
1964 .pll = PLL_28,
1965 .has_radio = 1,
1966 .tuner_type = TUNER_PHILIPS_PAL,
1967 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001968 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001969 /* sound routing:
1970 GPIO=0x00,0x01,0x03: mute (?)
1971 0x02: both TV and radio (tuner: FM1216/I)
1972 The card has onboard audio connectors labeled "cdrom" and "board",
1973 not soldered here, though unknown wiring.
1974 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001975 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001976 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001977
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001978 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001979 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001980 .name = "MachTV",
1981 .video_inputs = 3,
1982 .audio_inputs = 1,
1983 .tuner = 0,
1984 .svhs = -1,
1985 .gpiomask = 7,
1986 .muxsel = { 2, 3, 1, 1},
1987 .audiomux = { 0, 1, 2, 3, 4},
1988 .needs_tvaudio = 1,
1989 .tuner_type = 5,
1990 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001991 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08001992 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001993 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001994 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001995 .name = "Euresys Picolo",
1996 .video_inputs = 3,
1997 .audio_inputs = 0,
1998 .tuner = -1,
1999 .svhs = 2,
2000 .gpiomask = 0,
2001 .no_msp34xx = 1,
2002 .no_tda9875 = 1,
2003 .no_tda7432 = 1,
2004 .muxsel = { 2, 0, 1},
2005 .pll = PLL_28,
2006 .tuner_type = UNSET,
2007 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002008 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002009 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002010 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002011 /* Luc Van Hoeylandt <luc@e-magic.be> */
2012 .name = "ProVideo PV150", /* 0x4f */
2013 .video_inputs = 2,
2014 .audio_inputs = 0,
2015 .tuner = -1,
2016 .svhs = -1,
2017 .gpiomask = 0,
2018 .muxsel = { 2, 3 },
2019 .audiomux = { 0 },
2020 .needs_tvaudio = 0,
2021 .no_msp34xx = 1,
2022 .pll = PLL_28,
2023 .tuner_type = UNSET,
2024 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002025 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002026 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002027 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002028 /* Hiroshi Takekawa <sian@big.or.jp> */
2029 /* This card lacks subsystem ID */
2030 .name = "AD-TVK503", /* 0x63 */
2031 .video_inputs = 4,
2032 .audio_inputs = 1,
2033 .tuner = 0,
2034 .svhs = 2,
2035 .gpiomask = 0x001e8007,
2036 .muxsel = { 2, 3, 1, 0 },
2037 /* Tuner, Radio, external, internal, off, on */
2038 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2039 .needs_tvaudio = 0,
2040 .no_msp34xx = 1,
2041 .pll = PLL_28,
2042 .tuner_type = 2,
2043 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002044 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002045 .audio_hook = adtvk503_audio,
2046 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002047
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002048 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002049 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002050 .name = "Hercules Smart TV Stereo",
2051 .video_inputs = 4,
2052 .audio_inputs = 1,
2053 .tuner = 0,
2054 .svhs = 2,
2055 .gpiomask = 0x00,
2056 .muxsel = { 2, 3, 1, 1 },
2057 .needs_tvaudio = 1,
2058 .no_msp34xx = 1,
2059 .pll = PLL_28,
2060 .tuner_type = 5,
2061 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002062 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002063 /* Notes:
2064 - card lacks subsystem ID
2065 - stereo variant w/ daughter board with tda9874a @0xb0
2066 - Audio Routing:
2067 always from tda9874 independent of GPIO (?)
2068 external line in: unknown
2069 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2070 hef4053 (instead 4052) for unknown function
2071 */
2072 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002073 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002074 .name = "Pace TV & Radio Card",
2075 .video_inputs = 4,
2076 .audio_inputs = 1,
2077 .tuner = 0,
2078 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002079 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002080 .gpiomask = 0,
2081 .no_tda9875 = 1,
2082 .no_tda7432 = 1,
2083 .tuner_type = 1,
2084 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002085 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002086 .has_radio = 1,
2087 .pll = PLL_28,
2088 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2089 only internal line out: (4pin header) RGGL
2090 Radio must be decoded by msp3410d (not routed through)*/
2091 /*
2092 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2093 */
2094 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002095 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002096 /* Chris Willing <chris@vislab.usyd.edu.au> */
2097 .name = "IVC-200",
2098 .video_inputs = 1,
2099 .audio_inputs = 0,
2100 .tuner = -1,
2101 .tuner_type = -1,
2102 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002103 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002104 .svhs = -1,
2105 .gpiomask = 0xdf,
2106 .muxsel = { 2 },
2107 .pll = PLL_28,
2108 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002109 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002110 .name = "Grand X-Guard / Trust 814PCI",
2111 .video_inputs = 16,
2112 .audio_inputs = 0,
2113 .tuner = -1,
2114 .svhs = -1,
2115 .tuner_type = 4,
2116 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002117 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002118 .gpiomask2 = 0xff,
2119 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2120 .muxsel_hook = xguard_muxsel,
2121 .no_msp34xx = 1,
2122 .no_tda9875 = 1,
2123 .no_tda7432 = 1,
2124 .pll = PLL_28,
2125 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002126
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002127 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002128 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002129 .name = "Nebula Electronics DigiTV",
2130 .video_inputs = 1,
2131 .tuner = -1,
2132 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002133 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002134 .no_msp34xx = 1,
2135 .no_tda9875 = 1,
2136 .no_tda7432 = 1,
2137 .pll = PLL_28,
2138 .tuner_type = -1,
2139 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002140 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002141 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002142 .has_remote = 1,
2143 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002144 .no_gpioirq = 1,
2145 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002146 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002147 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2148 .name = "ProVideo PV143",
2149 .video_inputs = 4,
2150 .audio_inputs = 0,
2151 .tuner = -1,
2152 .svhs = -1,
2153 .gpiomask = 0,
2154 .muxsel = { 2, 3, 1, 0 },
2155 .audiomux = { 0 },
2156 .needs_tvaudio = 0,
2157 .no_msp34xx = 1,
2158 .pll = PLL_28,
2159 .tuner_type = -1,
2160 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002161 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002162 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002163 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002164 /* M.Klahr@phytec.de */
2165 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2166 .video_inputs = 4,
2167 .audio_inputs = 0,
2168 .tuner = -1, /* card has no tuner */
2169 .svhs = 3,
2170 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002171 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002172 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2173 .needs_tvaudio = 1,
2174 .pll = PLL_28,
2175 .tuner_type = -1,
2176 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002177 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002178 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002179 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002180 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2181 .video_inputs = 4,
2182 .audio_inputs = 0,
2183 .tuner = -1, /* card has no tuner */
2184 .svhs = 3,
2185 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002186 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002187 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2188 .needs_tvaudio = 1,
2189 .pll = PLL_28,
2190 .tuner_type = -1,
2191 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002192 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002193 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002194
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002195 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002196 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002197 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2198 .video_inputs = 10,
2199 .audio_inputs = 0,
2200 .tuner = -1, /* card has no tuner */
2201 .svhs = 9,
2202 .gpiomask = 0x00,
2203 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2204 via the upper nibble of muxsel. here: used for
2205 xternal video-mux */
2206 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2207 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2208 .needs_tvaudio = 1,
2209 .pll = PLL_28,
2210 .tuner_type = -1,
2211 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002212 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002213 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002214 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002215 .name = "PHYTEC VD-009 Combi (bt878)",
2216 .video_inputs = 10,
2217 .audio_inputs = 0,
2218 .tuner = -1, /* card has no tuner */
2219 .svhs = 9,
2220 .gpiomask = 0x00,
2221 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2222 via the upper nibble of muxsel. here: used for
2223 xternal video-mux */
2224 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2225 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2226 .needs_tvaudio = 1,
2227 .pll = PLL_28,
2228 .tuner_type = -1,
2229 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002230 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002231 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002232 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002233 .name = "IVC-100",
2234 .video_inputs = 4,
2235 .audio_inputs = 0,
2236 .tuner = -1,
2237 .tuner_type = -1,
2238 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002239 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002240 .svhs = -1,
2241 .gpiomask = 0xdf,
2242 .muxsel = { 2, 3, 1, 0 },
2243 .pll = PLL_28,
2244 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002245 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002246 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2247 .name = "IVC-120G",
2248 .video_inputs = 16,
2249 .audio_inputs = 0, /* card has no audio */
2250 .tuner = -1, /* card has no tuner */
2251 .tuner_type = -1,
2252 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002253 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002254 .svhs = -1, /* card has no svhs */
2255 .needs_tvaudio = 0,
2256 .no_msp34xx = 1,
2257 .no_tda9875 = 1,
2258 .no_tda7432 = 1,
2259 .gpiomask = 0x00,
2260 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2261 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2262 .muxsel_hook = ivc120_muxsel,
2263 .pll = PLL_28,
2264 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002265
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002266 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002267 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002268 .name = "pcHDTV HD-2000 TV",
2269 .video_inputs = 4,
2270 .audio_inputs = 1,
2271 .tuner = 0,
2272 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002273 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002274 .tuner_type = TUNER_PHILIPS_ATSC,
2275 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002276 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002277 .has_dvb = 1,
2278 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002279 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002280 .name = "Twinhan DST + clones",
2281 .no_msp34xx = 1,
2282 .no_tda9875 = 1,
2283 .no_tda7432 = 1,
2284 .tuner_type = TUNER_ABSENT,
2285 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002286 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002287 .no_video = 1,
2288 .has_dvb = 1,
2289 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002290 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002291 .name = "Winfast VC100",
2292 .video_inputs = 3,
2293 .audio_inputs = 0,
2294 .svhs = 1,
2295 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002296 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002297 .no_msp34xx = 1,
2298 .no_tda9875 = 1,
2299 .no_tda7432 = 1,
2300 .tuner_type = TUNER_ABSENT,
2301 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002302 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002303 .pll = PLL_28,
2304 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002305 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002306 .name = "Teppro TEV-560/InterVision IV-560",
2307 .video_inputs = 3,
2308 .audio_inputs = 1,
2309 .tuner = 0,
2310 .svhs = 2,
2311 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002312 .muxsel = { 2, 3, 1, 1 },
2313 .audiomux = { 1, 1, 1, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002314 .needs_tvaudio = 1,
2315 .tuner_type = TUNER_PHILIPS_PAL,
2316 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002317 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002318 .pll = PLL_35,
2319 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002320
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002321 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002322 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002323 .name = "SIMUS GVC1100",
2324 .video_inputs = 4,
2325 .audio_inputs = 0,
2326 .tuner = -1,
2327 .svhs = -1,
2328 .tuner_type = -1,
2329 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002330 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002331 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002332 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002333 .gpiomask = 0x3F,
2334 .muxsel_hook = gvc1100_muxsel,
2335 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002336 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002337 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2338 .name = "NGS NGSTV+",
2339 .video_inputs = 3,
2340 .tuner = 0,
2341 .svhs = 2,
2342 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002343 .muxsel = { 2, 3, 0, 0 },
2344 .audiomux = { 0, 0, 0, 0, 0x000003, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002345 .pll = PLL_28,
2346 .tuner_type = TUNER_PHILIPS_PAL,
2347 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002348 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002349 .has_remote = 1,
2350 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002351 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002352 /* http://linuxmedialabs.com */
2353 .name = "LMLBT4",
2354 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2355 .audio_inputs = 0,
2356 .tuner = -1,
2357 .svhs = -1,
2358 .muxsel = { 2, 3, 1, 0 },
2359 .no_msp34xx = 1,
2360 .no_tda9875 = 1,
2361 .no_tda7432 = 1,
2362 .needs_tvaudio = 0,
2363 .tuner_type = -1,
2364 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002365 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002366 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002367 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002368 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2369 .name = "Tekram M205 PRO",
2370 .video_inputs = 3,
2371 .audio_inputs = 1,
2372 .tuner = 0,
2373 .tuner_type = TUNER_PHILIPS_PAL,
2374 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002375 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002376 .svhs = 2,
2377 .needs_tvaudio = 0,
2378 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002379 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002380 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2381 .pll = PLL_28,
2382 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002383
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002384 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002385 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002386 /* Javier Cendan Ares <jcendan@lycos.es> */
2387 /* bt878 TV + FM without subsystem ID */
2388 .name = "Conceptronic CONTVFMi",
2389 .video_inputs = 3,
2390 .audio_inputs = 1,
2391 .tuner = 0,
2392 .svhs = 2,
2393 .gpiomask = 0x008007,
2394 .muxsel = { 2, 3, 1, 1 },
2395 .audiomux = { 0, 1, 2, 2, 3 },
2396 .needs_tvaudio = 0,
2397 .pll = PLL_28,
2398 .tuner_type = TUNER_PHILIPS_PAL,
2399 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002400 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002401 .has_remote = 1,
2402 .has_radio = 1,
2403 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002404 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002405 /*Eric DEBIEF <debief@telemsa.com>*/
2406 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002407 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002408 /*0x79 in bttv.h*/
2409 .name = "Euresys Picolo Tetra",
2410 .video_inputs = 4,
2411 .audio_inputs = 0,
2412 .tuner = -1,
2413 .svhs = -1,
2414 .gpiomask = 0,
2415 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2416 .no_msp34xx = 1,
2417 .no_tda9875 = 1,
2418 .no_tda7432 = 1,
2419 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2420 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2421 .pll = PLL_28,
2422 .needs_tvaudio = 0,
2423 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2424 .tuner_type = -1,
2425 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002426 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002427 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002428 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002429 /* Spirit TV Tuner from http://spiritmodems.com.au */
2430 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2431 .name = "Spirit TV Tuner",
2432 .video_inputs = 3,
2433 .audio_inputs = 1,
2434 .tuner = 0,
2435 .svhs = 2,
2436 .gpiomask = 0x0000000f,
2437 .muxsel = { 2, 1, 1 },
Michael Krufkybc286362006-01-11 19:40:17 -02002438 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002439 .tuner_type = TUNER_TEMIC_PAL,
2440 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002441 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002442 .no_msp34xx = 1,
2443 .no_tda9875 = 1,
2444 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002445 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002446 /* Wolfram Joost <wojo@frokaschwei.de> */
2447 .name = "AVerMedia AVerTV DVB-T 771",
2448 .video_inputs = 2,
2449 .svhs = 1,
2450 .tuner = -1,
2451 .tuner_type = TUNER_ABSENT,
2452 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002453 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002454 .muxsel = { 3 , 3 },
2455 .no_msp34xx = 1,
2456 .no_tda9875 = 1,
2457 .no_tda7432 = 1,
2458 .pll = PLL_28,
2459 .has_dvb = 1,
2460 .no_gpioirq = 1,
2461 .has_remote = 1,
2462 },
2463 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002464 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002465 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002466 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002467 .name = "AverMedia AverTV DVB-T 761",
2468 .video_inputs = 2,
2469 .tuner = -1,
2470 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002471 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002472 .no_msp34xx = 1,
2473 .no_tda9875 = 1,
2474 .no_tda7432 = 1,
2475 .pll = PLL_28,
2476 .tuner_type = -1,
2477 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002478 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002479 .has_dvb = 1,
2480 .no_gpioirq = 1,
2481 .has_remote = 1,
2482 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002483 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002484 /* andre.schwarz@matrix-vision.de */
2485 .name = "MATRIX Vision Sigma-SQ",
2486 .video_inputs = 16,
2487 .audio_inputs = 0,
2488 .tuner = -1,
2489 .svhs = -1,
2490 .gpiomask = 0x0,
2491 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2492 3, 3, 3, 3, 3, 3, 3, 3 },
2493 .muxsel_hook = sigmaSQ_muxsel,
2494 .audiomux = { 0 },
2495 .no_msp34xx = 1,
2496 .pll = PLL_28,
2497 .tuner_type = -1,
2498 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002499 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002500 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002501 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002502 /* andre.schwarz@matrix-vision.de */
2503 .name = "MATRIX Vision Sigma-SLC",
2504 .video_inputs = 4,
2505 .audio_inputs = 0,
2506 .tuner = -1,
2507 .svhs = -1,
2508 .gpiomask = 0x0,
2509 .muxsel = { 2, 2, 2, 2 },
2510 .muxsel_hook = sigmaSLC_muxsel,
2511 .audiomux = { 0 },
2512 .no_msp34xx = 1,
2513 .pll = PLL_28,
2514 .tuner_type = -1,
2515 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002516 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002517 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002518 /* BTTV_BOARD_APAC_VIEWCOMP */
2519 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002520 /* Attila Kondoros <attila.kondoros@chello.hu> */
2521 /* bt878 TV + FM 0x00000000 subsystem ID */
2522 .name = "APAC Viewcomp 878(AMAX)",
2523 .video_inputs = 2,
2524 .audio_inputs = 1,
2525 .tuner = 0,
2526 .svhs = -1,
2527 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002528 .muxsel = { 2, 3, 1, 1 },
2529 .audiomux = { 2, 0, 0, 0, 10 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002530 .needs_tvaudio = 0,
2531 .pll = PLL_28,
2532 .tuner_type = TUNER_PHILIPS_PAL,
2533 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002534 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002535 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2536 .has_radio = 1, /* not every card has radio */
2537 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002538
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002539 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002540 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002541 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2542 .name = "DViCO FusionHDTV DVB-T Lite",
2543 .tuner = -1,
2544 .no_msp34xx = 1,
2545 .no_tda9875 = 1,
2546 .no_tda7432 = 1,
2547 .pll = PLL_28,
2548 .no_video = 1,
2549 .has_dvb = 1,
2550 .tuner_type = -1,
2551 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002552 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002553 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002554 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002555 /* Steven <photon38@pchome.com.tw> */
2556 .name = "V-Gear MyVCD",
2557 .video_inputs = 3,
2558 .audio_inputs = 1,
2559 .tuner = 0,
2560 .svhs = 2,
2561 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002562 .muxsel = {2, 3, 1, 0 },
2563 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002564 .no_msp34xx = 1,
2565 .pll = PLL_28,
2566 .tuner_type = TUNER_PHILIPS_NTSC_M,
2567 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002568 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002569 .has_radio = 0,
2570 #if 0
2571 .has_remote = 1,
2572 #endif
2573 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002574 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002575 /* Rick C <cryptdragoon@gmail.com> */
2576 .name = "Super TV Tuner",
2577 .video_inputs = 4,
2578 .audio_inputs = 1,
2579 .tuner = 0,
2580 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002581 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002582 .tuner_type = TUNER_PHILIPS_NTSC,
2583 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002584 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002585 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002586 .audiomux = { 0, 0x000001,0,0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002587 .needs_tvaudio = 1,
2588 .has_radio = 1,
2589 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002590 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002591 /* Chris Fanning <video4linux@haydon.net> */
2592 .name = "Tibet Systems 'Progress DVR' CS16",
2593 .video_inputs = 16,
2594 .audio_inputs = 0,
2595 .tuner = -1,
2596 .svhs = -1,
2597 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2598 .pll = PLL_28,
2599 .no_msp34xx = 1,
2600 .no_tda9875 = 1,
2601 .no_tda7432 = 1,
2602 .tuner_type = -1,
2603 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002604 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002605 .muxsel_hook = tibetCS16_muxsel,
2606 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002607 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002608 /* Bill Brack <wbrack@mmm.com.hk> */
2609 /*
2610 * Note that, because of the card's wiring, the "master"
2611 * BT878A chip (i.e. the one which controls the analog switch
2612 * and must use this card type) is the 2nd one detected. The
2613 * other 3 chips should use card type 0x85, whose description
2614 * follows this one. There is a EEPROM on the card (which is
2615 * connected to the I2C of one of those other chips), but is
2616 * not currently handled. There is also a facility for a
2617 * "monitor", which is also not currently implemented.
2618 */
2619 .name = "Kodicom 4400R (master)",
2620 .video_inputs = 16,
2621 .audio_inputs = 0,
2622 .tuner = -1,
2623 .tuner_type = -1,
2624 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002625 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002626 .svhs = -1,
2627 /* GPIO bits 0-9 used for analog switch:
2628 * 00 - 03: camera selector
2629 * 04 - 06: channel (controller) selector
2630 * 07: data (1->on, 0->off)
2631 * 08: strobe
2632 * 09: reset
2633 * bit 16 is input from sync separator for the channel
2634 */
2635 .gpiomask = 0x0003ff,
2636 .no_gpioirq = 1,
2637 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2638 .pll = PLL_28,
2639 .no_msp34xx = 1,
2640 .no_tda7432 = 1,
2641 .no_tda9875 = 1,
2642 .muxsel_hook = kodicom4400r_muxsel,
2643 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002644 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002645 /* Bill Brack <wbrack@mmm.com.hk> */
2646 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2647 * one which controls the analog switch, and must use the card type)
2648 * is the 2nd one detected. The other 3 chips should use this card
2649 * type
2650 */
2651 .name = "Kodicom 4400R (slave)",
2652 .video_inputs = 16,
2653 .audio_inputs = 0,
2654 .tuner = -1,
2655 .tuner_type = -1,
2656 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002657 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002658 .svhs = -1,
2659 .gpiomask = 0x010000,
2660 .no_gpioirq = 1,
2661 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2662 .pll = PLL_28,
2663 .no_msp34xx = 1,
2664 .no_tda7432 = 1,
2665 .no_tda9875 = 1,
2666 .muxsel_hook = kodicom4400r_muxsel,
2667 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002668 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002669 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002670 /* Michael Henson <mhenson@clarityvi.com> */
2671 /* Adlink RTV24 with special unlock codes */
2672 .name = "Adlink RTV24",
2673 .video_inputs = 4,
2674 .audio_inputs = 1,
2675 .tuner = 0,
2676 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002677 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002678 .tuner_type = -1,
2679 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002680 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002681 .pll = PLL_28,
2682 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002683 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002684 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002685 /* Michael Krufky <mkrufky@m1k.net> */
2686 .name = "DViCO FusionHDTV 5 Lite",
2687 .tuner = 0,
2688 .tuner_type = TUNER_LG_TDVS_H062F,
2689 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002690 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002691 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002692 .audio_inputs = 1,
2693 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002694 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002695 .gpiomask = 0x00e00007,
2696 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2697 .no_msp34xx = 1,
2698 .no_tda9875 = 1,
2699 .no_tda7432 = 1,
2700 .has_dvb = 1,
2701 },
2702 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002703 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002704 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2705 .name = "Acorp Y878F",
2706 .video_inputs = 3,
2707 .audio_inputs = 1,
2708 .tuner = 0,
2709 .svhs = 2,
2710 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002711 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002712 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2713 .needs_tvaudio = 1,
2714 .pll = PLL_28,
2715 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2716 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002717 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002718 .has_radio = 1,
2719 },
2720 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002721 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002722 .name = "Conceptronic CTVFMi v2",
2723 .video_inputs = 3,
2724 .audio_inputs = 1,
2725 .tuner = 0,
2726 .svhs = 2,
2727 .gpiomask = 0x001c0007,
2728 .muxsel = { 2, 3, 1, 1 },
2729 .audiomux = { 0, 1, 2, 2, 3 },
2730 .needs_tvaudio = 0,
2731 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002732 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002733 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002734 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002735 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002736 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002737 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002738 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002739 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002740 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2741 .video_inputs = 5,
2742 .audio_inputs = 1,
2743 .tuner = 0,
2744 .svhs = 3,
2745 .gpiomask = 0x01fe00,
2746 .muxsel = { 2,3,1,1,-1 },
2747 .digital_mode = DIGITAL_MODE_CAMERA,
2748 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2749 .no_msp34xx = 1,
2750 .pll = PLL_28,
2751 .tuner_type = TUNER_LG_PAL_FM,
2752 .tuner_addr = ADDR_UNSET,
2753 .radio_addr = ADDR_UNSET,
2754 .has_remote = 1,
2755 },
2756 /* ---- card 0x8b ---------------------------------- */
2757 [BTTV_BOARD_PV_M4900] = {
2758 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2759 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2760 .video_inputs = 3,
2761 .audio_inputs = 1,
2762 .tuner = 0,
2763 .svhs = 2,
2764 .gpiomask = 0x3f,
2765 .muxsel = { 2, 3, 1, 1 },
2766 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2767 .no_msp34xx = 1,
2768 .pll = PLL_28,
2769 .tuner_type = TUNER_YMEC_TVF_5533MF,
2770 .tuner_addr = ADDR_UNSET,
2771 .radio_addr = ADDR_UNSET,
2772 .has_radio = 1,
2773 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002774 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002775 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002776 [BTTV_BOARD_OSPREY440] = {
2777 .name = "Osprey 440",
2778 .video_inputs = 1,
2779 .audio_inputs = 1,
2780 .tuner = -1,
2781 .svhs = 1,
2782 .muxsel = { 2 },
2783 .pll = PLL_28,
2784 .tuner_type = UNSET,
2785 .tuner_addr = ADDR_UNSET,
2786 .radio_addr = ADDR_UNSET,
2787 .no_msp34xx = 1,
2788 .no_tda9875 = 1,
2789 .no_tda7432 = 1,
2790 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002791 /* ---- card 0x8d ---------------------------------- */
2792 [BTTV_BOARD_ASOUND_SKYEYE] = {
2793 .name = "Asound Skyeye PCTV",
2794 .video_inputs = 3,
2795 .audio_inputs = 1,
2796 .tuner = 0,
2797 .svhs = 2,
2798 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002799 .muxsel = { 2, 3, 1, 1 },
Michael Krufkyca08ca02006-01-11 19:40:25 -02002800 .audiomux = { 2, 0, 0, 0, 1 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002801 .needs_tvaudio = 1,
2802 .pll = PLL_28,
2803 .tuner_type = 2,
2804 .tuner_addr = ADDR_UNSET,
2805 .radio_addr = ADDR_UNSET,
2806 },
Bill Pechter633323f2005-11-13 16:07:50 -08002807 /* ---- card 0x8e ---------------------------------- */
2808 [BTTV_BOARD_SABRENT_TVFM] = {
2809 .name = "Sabrent TV-FM (bttv version)",
2810 .video_inputs = 3,
2811 .audio_inputs = 1,
2812 .tuner = 0,
2813 .svhs = 2,
2814 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002815 .muxsel = { 2, 3, 1, 1 },
2816 .audiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002817 .no_msp34xx = 1,
2818 .no_tda9875 = 1,
2819 .no_tda7432 = 1,
2820 .pll = PLL_28,
2821 .tuner_type = TUNER_TNF_5335MF,
2822 .tuner_addr = ADDR_UNSET,
2823 .has_radio = 1,
2824 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002825 /* ---- card 0x8f ---------------------------------- */
2826 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2827 .name = "Hauppauge ImpactVCB (bt878)",
2828 .video_inputs = 4,
2829 .audio_inputs = 0,
2830 .tuner = -1,
2831 .svhs = -1,
2832 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002833 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002834 .no_msp34xx = 1,
2835 .no_tda9875 = 1,
2836 .no_tda7432 = 1,
2837 .tuner_type = -1,
2838 .tuner_addr = ADDR_UNSET,
2839 .radio_addr = ADDR_UNSET,
2840 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002841 [BTTV_BOARD_MACHTV_MAGICTV] = {
2842 /* Julian Calaby <julian.calaby@gmail.com>
2843 * Slightly different from original MachTV definition (0x60)
2844
2845 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2846 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2847 * properly (methinks) causing no keyup bits being set */
2848
2849 .name = "MagicTV", /* rebranded MachTV */
2850 .video_inputs = 3,
2851 .audio_inputs = 1,
2852 .tuner = 0,
2853 .svhs = 2,
2854 .gpiomask = 7,
2855 .muxsel = { 2, 3, 1, 1 },
2856 .audiomux = { 0, 1, 2, 3, 4 },
2857 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2858 .tuner_addr = ADDR_UNSET,
2859 .radio_addr = ADDR_UNSET,
2860 .pll = PLL_28,
2861 .has_radio = 1,
2862 .has_remote = 1,
2863 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002864};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002865
2866static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2867
2868/* ----------------------------------------------------------------------- */
2869
2870static unsigned char eeprom_data[256];
2871
2872/*
2873 * identify card
2874 */
2875void __devinit bttv_idcard(struct bttv *btv)
2876{
2877 unsigned int gpiobits;
2878 int i,type;
2879 unsigned short tmp;
2880
2881 /* read PCI subsystem ID */
2882 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2883 btv->cardid = tmp << 16;
2884 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2885 btv->cardid |= tmp;
2886
2887 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2888 /* look for the card */
2889 for (type = -1, i = 0; cards[i].id != 0; i++)
2890 if (cards[i].id == btv->cardid)
2891 type = i;
2892
2893 if (type != -1) {
2894 /* found it */
2895 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2896 "PCI subsystem ID is %04x:%04x\n",
2897 btv->c.nr,cards[type].name,cards[type].cardnr,
2898 btv->cardid & 0xffff,
2899 (btv->cardid >> 16) & 0xffff);
2900 btv->c.type = cards[type].cardnr;
2901 } else {
2902 /* 404 */
2903 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2904 btv->c.nr, btv->cardid & 0xffff,
2905 (btv->cardid >> 16) & 0xffff);
2906 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002907 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002908 }
2909 }
2910
2911 /* let the user override the autodetected type */
2912 if (card[btv->c.nr] < bttv_num_tvcards)
2913 btv->c.type=card[btv->c.nr];
2914
2915 /* print which card config we are using */
2916 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2917 bttv_tvcards[btv->c.type].name, btv->c.type,
2918 card[btv->c.nr] < bttv_num_tvcards
2919 ? "insmod option" : "autodetected");
2920
2921 /* overwrite gpio stuff ?? */
2922 if (UNSET == audioall && UNSET == audiomux[0])
2923 return;
2924
2925 if (UNSET != audiomux[0]) {
2926 gpiobits = 0;
2927 for (i = 0; i < 5; i++) {
2928 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2929 gpiobits |= audiomux[i];
2930 }
2931 } else {
2932 gpiobits = audioall;
2933 for (i = 0; i < 5; i++) {
2934 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2935 }
2936 }
2937 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2938 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2939 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2940 for (i = 0; i < 5; i++) {
2941 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2942 }
2943 printk("\n");
2944}
2945
2946/*
2947 * (most) board specific initialisations goes here
2948 */
2949
2950/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08002951static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07002952{
2953 int type = -1;
2954
2955 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002956 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002957 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002958 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002959 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08002960 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002961
2962 if (-1 != type) {
2963 btv->c.type = type;
2964 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2965 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2966 }
2967}
2968
2969static void flyvideo_gpio(struct bttv *btv)
2970{
2971 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2972 int tuner=-1,ttype;
2973
2974 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002975 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002976 gpio = gpio_read();
2977 /* FIXME: must restore OUR_EN ??? */
2978
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002979 /* all cards provide GPIO info, some have an additional eeprom
2980 * LR50: GPIO coding can be found lower right CP1 .. CP9
2981 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2982 * GPIO14-12: n.c.
2983 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002984
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002985 * lowest 3 bytes are remote control codes (no handshake needed)
2986 * xxxFFF: No remote control chip soldered
2987 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2988 * Note: Some bits are Audio_Mask !
2989 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002990 ttype=(gpio&0x0f0000)>>16;
2991 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002992 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002993 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08002994 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002995 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002996 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002997 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002998 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002999 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003000 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003001 break;
3002 default:
3003 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3004 }
3005
3006 has_remote = gpio & 0x800000;
3007 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003008 /* unknown 0x200000;
3009 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003010 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003011 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003012 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3013 /*
3014 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003015
3016 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003017 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003018
3019 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3020 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3021 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3022 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3023 is_capture_only?"yes":"no ");
3024
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003025 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003026 btv->tuner_type = tuner;
3027 btv->has_radio = has_radio;
3028
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003029 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3030 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3031 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003032 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003033 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003034}
3035
3036static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3037 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3038static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3039 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3040
3041static void miro_pinnacle_gpio(struct bttv *btv)
3042{
3043 int id,msp,gpio;
3044 char *info;
3045
3046 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003047 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003048 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003049 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003050 if (id < 32) {
3051 btv->tuner_type = miro_tunermap[id];
3052 if (0 == (gpio & 0x20)) {
3053 btv->has_radio = 1;
3054 if (!miro_fmtuner[id]) {
3055 btv->has_matchbox = 1;
3056 btv->mbox_we = (1<<6);
3057 btv->mbox_most = (1<<7);
3058 btv->mbox_clk = (1<<8);
3059 btv->mbox_data = (1<<9);
3060 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3061 }
3062 } else {
3063 btv->has_radio = 0;
3064 }
3065 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003066 if (btv->c.type == BTTV_BOARD_MIRO)
3067 btv->c.type = BTTV_BOARD_MIROPRO;
3068 if (btv->c.type == BTTV_BOARD_PINNACLE)
3069 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003070 }
3071 printk(KERN_INFO
3072 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3073 btv->c.nr, id+1, btv->tuner_type,
3074 !btv->has_radio ? "no" :
3075 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3076 (-1 == msp) ? "no" : "yes");
3077 } else {
3078 /* new cards with microtune tuner */
3079 id = 63 - id;
3080 btv->has_radio = 0;
3081 switch (id) {
3082 case 1:
3083 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003084 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003085 break;
3086 case 2:
3087 info = "PAL+SECAM / stereo";
3088 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003089 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003090 break;
3091 case 3:
3092 info = "NTSC / stereo";
3093 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003094 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003095 break;
3096 case 4:
3097 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003098 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003099 break;
3100 case 5:
3101 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003102 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003103 break;
3104 case 6:
3105 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003106 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003107 break;
3108 case 7:
3109 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003110 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003111 break;
3112 default:
3113 info = "oops: unknown card";
3114 break;
3115 }
3116 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003117 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003118 printk(KERN_INFO
3119 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3120 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003121 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003122 }
3123}
3124
3125/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3126#define LM1882_SYNC_DRIVE 0x200000L
3127
3128static void init_ids_eagle(struct bttv *btv)
3129{
3130 gpio_inout(0xffffff,0xFFFF37);
3131 gpio_write(0x200020);
3132
3133 /* flash strobe inverter ?! */
3134 gpio_write(0x200024);
3135
3136 /* switch sync drive off */
3137 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3138
3139 /* set BT848 muxel to 2 */
3140 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3141}
3142
3143/* Muxsel helper for the IDS Eagle.
3144 * the eagles does not use the standard muxsel-bits but
3145 * has its own multiplexer */
3146static void eagle_muxsel(struct bttv *btv, unsigned int input)
3147{
3148 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3149 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3150
Linus Torvalds1da177e2005-04-16 15:20:36 -07003151 /* composite */
3152 /* set chroma ADC to sleep */
3153 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3154 /* set to composite video */
3155 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3156 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003157
3158 /* switch sync drive off */
3159 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3160}
3161
3162static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3163{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003164 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003165 gpio_write(masks[input%4]);
3166}
3167
3168/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3169 alarms output
3170
3171 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3172 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3173
3174 IN - sensor inputs, INx - sensor inputs and TI XORed together
3175 O1,O2,O3 - alarm outputs (relays)
3176
3177 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3178
3179*/
3180
3181static void init_lmlbt4x(struct bttv *btv)
3182{
3183 printk(KERN_DEBUG "LMLBT4x init\n");
3184 btwrite(0x000000, BT848_GPIO_REG_INP);
3185 gpio_inout(0xffffff, 0x0006C0);
3186 gpio_write(0x000000);
3187}
3188
3189static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3190{
3191 unsigned int inmux = input % 8;
3192 gpio_inout( 0xf, 0xf );
3193 gpio_bits( 0xf, inmux );
3194}
3195
3196static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3197{
3198 unsigned int inmux = input % 4;
3199 gpio_inout( 3<<9, 3<<9 );
3200 gpio_bits( 3<<9, inmux<<9 );
3201}
3202
3203/* ----------------------------------------------------------------------- */
3204
3205static void bttv_reset_audio(struct bttv *btv)
3206{
3207 /*
3208 * BT878A has a audio-reset register.
3209 * 1. This register is an audio reset function but it is in
3210 * function-0 (video capture) address space.
3211 * 2. It is enough to do this once per power-up of the card.
3212 * 3. There is a typo in the Conexant doc -- it is not at
3213 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3214 * --//Shrikumar 030609
3215 */
3216 if (btv->id != 878)
3217 return;
3218
3219 if (bttv_debug)
3220 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3221 btwrite((1<<7), 0x058);
3222 udelay(10);
3223 btwrite( 0, 0x058);
3224}
3225
3226/* initialization part one -- before registering i2c bus */
3227void __devinit bttv_init_card1(struct bttv *btv)
3228{
3229 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003230 case BTTV_BOARD_HAUPPAUGE:
3231 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003232 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003233 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003234 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003235 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003236 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003237 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003238 boot_msp34xx(btv,11);
3239 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003240 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003241 pvr_boot(btv);
3242 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003243 case BTTV_BOARD_TWINHAN_DST:
3244 case BTTV_BOARD_AVDVBT_771:
3245 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003246 btv->use_i2c_hw = 1;
3247 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003248 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003249 init_RTV24( btv );
3250 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003251
Linus Torvalds1da177e2005-04-16 15:20:36 -07003252 }
3253 if (!bttv_tvcards[btv->c.type].has_dvb)
3254 bttv_reset_audio(btv);
3255}
3256
3257/* initialization part two -- after registering i2c bus */
3258void __devinit bttv_init_card2(struct bttv *btv)
3259{
3260 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003261 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003262
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003263 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003264
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003265 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003266 bttv_readee(btv,eeprom_data,0xa0);
3267 identify_by_eeprom(btv,eeprom_data);
3268 }
3269
3270 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003271 case BTTV_BOARD_MIRO:
3272 case BTTV_BOARD_MIROPRO:
3273 case BTTV_BOARD_PINNACLE:
3274 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003275 /* miro/pinnacle */
3276 miro_pinnacle_gpio(btv);
3277 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003278 case BTTV_BOARD_FLYVIDEO_98:
3279 case BTTV_BOARD_MAXI:
3280 case BTTV_BOARD_LIFE_FLYKIT:
3281 case BTTV_BOARD_FLYVIDEO:
3282 case BTTV_BOARD_TYPHOON_TVIEW:
3283 case BTTV_BOARD_CHRONOS_VS2:
3284 case BTTV_BOARD_FLYVIDEO_98FM:
3285 case BTTV_BOARD_FLYVIDEO2000:
3286 case BTTV_BOARD_FLYVIDEO98EZ:
3287 case BTTV_BOARD_CONFERENCETV:
3288 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003289 flyvideo_gpio(btv);
3290 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003291 case BTTV_BOARD_HAUPPAUGE:
3292 case BTTV_BOARD_HAUPPAUGE878:
3293 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003294 /* pick up some config infos from the eeprom */
3295 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003296 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003297 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003298 case BTTV_BOARD_AVERMEDIA98:
3299 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003300 bttv_readee(btv,eeprom_data,0xa0);
3301 avermedia_eeprom(btv);
3302 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003303 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003304 init_PXC200(btv);
3305 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003306 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003307 picolo_tetra_init(btv);
3308 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003309 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003310 btv->has_radio = 1;
3311 btv->has_matchbox = 1;
3312 btv->mbox_we = 0x20;
3313 btv->mbox_most = 0;
3314 btv->mbox_clk = 0x08;
3315 btv->mbox_data = 0x10;
3316 btv->mbox_mask = 0x38;
3317 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003318 case BTTV_BOARD_VOBIS_BOOSTAR:
3319 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003320 terratec_active_radio_upgrade(btv);
3321 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003322 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003323 if (btv->cardid == 0x3002144f) {
3324 btv->has_radio=1;
3325 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3326 }
3327 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003328 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003329 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003330 /* Fix up entry for 3DFX VoodooTV 100,
3331 which is an OEM STB card variant. */
3332 btv->has_radio=0;
3333 btv->tuner_type=TUNER_TEMIC_NTSC;
3334 }
3335 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003336 case BTTV_BOARD_OSPREY1x0:
3337 case BTTV_BOARD_OSPREY1x0_848:
3338 case BTTV_BOARD_OSPREY101_848:
3339 case BTTV_BOARD_OSPREY1x1:
3340 case BTTV_BOARD_OSPREY1x1_SVID:
3341 case BTTV_BOARD_OSPREY2xx:
3342 case BTTV_BOARD_OSPREY2x0_SVID:
3343 case BTTV_BOARD_OSPREY2x0:
3344 case BTTV_BOARD_OSPREY500:
3345 case BTTV_BOARD_OSPREY540:
3346 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003347 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003348 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003349 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003350 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003351 init_ids_eagle(btv);
3352 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003353 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003354 bttv_readee(btv,eeprom_data,0xa0);
3355 modtec_eeprom(btv);
3356 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003357 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003358 init_lmlbt4x(btv);
3359 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003360 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003361 tibetCS16_init(btv);
3362 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003363 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003364 kodicom4400r_init(btv);
3365 break;
3366 }
3367
3368 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003369 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003370 /* defaults from card list */
3371 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3372 btv->pll.pll_ifreq=28636363;
3373 btv->pll.pll_crystal=BT848_IFORM_XT0;
3374 }
3375 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3376 btv->pll.pll_ifreq=35468950;
3377 btv->pll.pll_crystal=BT848_IFORM_XT1;
3378 }
3379 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003380 switch (pll[btv->c.nr]) {
3381 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003382 btv->pll.pll_crystal = 0;
3383 btv->pll.pll_ifreq = 0;
3384 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003385 break;
3386 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003387 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003388 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003389 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003390 btv->pll.pll_crystal = BT848_IFORM_XT0;
3391 break;
3392 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003393 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003394 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003395 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003396 btv->pll.pll_crystal = BT848_IFORM_XT1;
3397 break;
3398 }
3399 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003400 btv->pll.pll_current = -1;
3401
Linus Torvalds1da177e2005-04-16 15:20:36 -07003402 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003403 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3404 addr = bttv_tvcards[btv->c.type].tuner_addr;
3405
3406 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003407 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003408 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003409 if (UNSET != tuner[btv->c.nr])
3410 btv->tuner_type = tuner[btv->c.nr];
3411 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003412
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003413 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003414 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003415
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003416 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003417 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003418 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003419
3420 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3421 }
3422
Hans Verkuil39e8f402006-01-09 15:25:16 -02003423 if (btv->tda9887_conf) {
3424 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3425 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003426 }
3427
Linus Torvalds1da177e2005-04-16 15:20:36 -07003428 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3429 if (svhs[btv->c.nr] != UNSET)
3430 btv->svhs = svhs[btv->c.nr];
3431 if (remote[btv->c.nr] != UNSET)
3432 btv->has_remote = remote[btv->c.nr];
3433
3434 if (bttv_tvcards[btv->c.type].has_radio)
3435 btv->has_radio=1;
3436 if (bttv_tvcards[btv->c.type].has_remote)
3437 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003438 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3439 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003440 if (bttv_tvcards[btv->c.type].audio_hook)
3441 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3442
3443 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3444 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003445 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3446 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003447 boot_bt832(btv);
3448 }
3449
3450 if (!autoload)
3451 return;
3452
3453 /* try to detect audio/fader chips */
3454 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003455 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003456 request_module("msp3400");
3457
3458 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003459 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003460 request_module("msp3400");
3461
3462 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003463 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003464 request_module("tda9875");
3465
3466 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003467 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003468 request_module("tda7432");
3469
3470 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3471 request_module("tvaudio");
3472
3473 /* tuner modules */
3474 tda9887 = 0;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003475 if (btv->tda9887_conf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003476 tda9887 = 1;
3477 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003478 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003479 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003480 /* Hybrid DVB card, DOES have a tda9887 */
3481 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3482 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003483 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3484 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3485 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3486 tda9887)
3487 request_module("tda9887");
3488 if (btv->tuner_type != UNSET)
3489 request_module("tuner");
3490}
3491
3492
3493/* ----------------------------------------------------------------------- */
3494
3495static void modtec_eeprom(struct bttv *btv)
3496{
3497 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3498 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3499 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3500 btv->c.nr,&eeprom_data[0x1e]);
3501 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3502 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3503 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003504 btv->c.nr,&eeprom_data[0x1e]);
3505 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3506 btv->tuner_type=TUNER_PHILIPS_NTSC;
3507 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3508 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003509 } else {
3510 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3511 btv->c.nr,&eeprom_data[0x1e]);
3512 }
3513}
3514
3515static void __devinit hauppauge_eeprom(struct bttv *btv)
3516{
3517 struct tveeprom tv;
3518
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003519 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003520 btv->tuner_type = tv.tuner_type;
3521 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003522
3523 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3524 btv->c.nr, tv.model);
3525
3526 /*
3527 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3528 * type based on model #.
3529 */
3530 if(tv.model == 64900) {
3531 printk("bttv%d: Switching board type from %s to %s\n",
3532 btv->c.nr,
3533 bttv_tvcards[btv->c.type].name,
3534 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3535 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3536 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003537}
3538
3539static int terratec_active_radio_upgrade(struct bttv *btv)
3540{
3541 int freq;
3542
3543 btv->has_radio = 1;
3544 btv->has_matchbox = 1;
3545 btv->mbox_we = 0x10;
3546 btv->mbox_most = 0x20;
3547 btv->mbox_clk = 0x08;
3548 btv->mbox_data = 0x04;
3549 btv->mbox_mask = 0x3c;
3550
3551 btv->mbox_iow = 1 << 8;
3552 btv->mbox_ior = 1 << 9;
3553 btv->mbox_csel = 1 << 10;
3554
3555 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003556 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003557 if (0x1ed8 == tea5757_read(btv)) {
3558 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3559 btv->c.nr);
3560 btv->has_radio = 1;
3561 btv->has_matchbox = 1;
3562 } else {
3563 btv->has_radio = 0;
3564 btv->has_matchbox = 0;
3565 }
3566 return 0;
3567}
3568
3569
3570/* ----------------------------------------------------------------------- */
3571
3572/*
3573 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3574 *
3575 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3576 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3577 * unpacked with unzip).
3578 */
3579#define PVR_GPIO_DELAY 10
3580
3581#define BTTV_ALT_DATA 0x000001
3582#define BTTV_ALT_DCLK 0x100000
3583#define BTTV_ALT_NCONFIG 0x800000
3584
3585static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3586{
3587 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003588 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003589 int i;
3590
3591 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3592 gpio_write(0);
3593 udelay(PVR_GPIO_DELAY);
3594
3595 gpio_write(BTTV_ALT_NCONFIG);
3596 udelay(PVR_GPIO_DELAY);
3597
3598 for (n = 0; n < microlen; n++) {
3599 bits = micro[n];
3600 for ( i = 0 ; i < 8 ; i++ ) {
3601 gpio_bits(BTTV_ALT_DCLK,0);
3602 if (bits & 0x01)
3603 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3604 else
3605 gpio_bits(BTTV_ALT_DATA,0);
3606 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3607 bits >>= 1;
3608 }
3609 }
3610 gpio_bits(BTTV_ALT_DCLK,0);
3611 udelay(PVR_GPIO_DELAY);
3612
3613 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3614 for (i = 0 ; i < 30 ; i++) {
3615 gpio_bits(BTTV_ALT_DCLK,0);
3616 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3617 }
3618 gpio_bits(BTTV_ALT_DCLK,0);
3619 return 0;
3620}
3621
3622static int __devinit pvr_boot(struct bttv *btv)
3623{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003624 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003625 int rc;
3626
3627 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3628 if (rc != 0) {
3629 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3630 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003631 return rc;
3632 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003633 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3634 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3635 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003636 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003637 return rc;
3638}
3639
3640/* ----------------------------------------------------------------------- */
3641/* some osprey specific stuff */
3642
3643static void __devinit osprey_eeprom(struct bttv *btv)
3644{
3645 int i = 0;
3646 unsigned char *ee = eeprom_data;
3647 unsigned long serial = 0;
3648
3649 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003650 /* this might be an antique... check for MMAC label in eeprom */
3651 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3652 unsigned char checksum = 0;
3653 for (i =0; i<21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003654 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003655 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003656 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003657 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003658 for (i = 12; i < 21; i++)
3659 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003660 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003661 } else {
3662 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003663 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003664
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003665 for(; offset < 8*16; offset += 16) {
3666 unsigned short checksum = 0;
3667 /* verify the checksum */
3668 for(i = 0; i<14; i++) checksum += ee[i+offset];
3669 checksum = ~checksum; /* no idea why */
3670 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003671 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003672 break;
3673 }
3674 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003675
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003676 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003677 return;
3678
3679 /* found a valid descriptor */
3680 type = (ee[offset+4]<<8) | (ee[offset+5]);
3681
3682 switch(type) {
3683
3684 /* 848 based */
3685 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003686 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003687 break;
3688 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003689 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003690 break;
3691
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003692 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003693 case 0x0012:
3694 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003695 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003696 break;
3697 case 0x0014:
3698 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003699 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003700 break;
3701 case 0x0016:
3702 case 0x0017:
3703 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003704 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003705 break;
3706 case 0x0018:
3707 case 0x0019:
3708 case 0x001E:
3709 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003710 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003711 break;
3712 case 0x001A:
3713 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003714 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003715 break;
3716 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003717 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003718 break;
3719 case 0x0050:
3720 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003721 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003722 /* bttv_osprey_540_init(btv); */
3723 break;
3724 case 0x0060:
3725 case 0x0070:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003726 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003727 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003728 gpio_inout(0xffffff,0x000303);
3729 break;
3730 default:
3731 /* unknown...leave generic, but get serial # */
3732 break;
3733 }
3734 serial = (ee[offset+6] << 24)
3735 | (ee[offset+7] << 16)
3736 | (ee[offset+8] << 8)
3737 | (ee[offset+9]);
3738 }
3739
3740 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3741 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3742}
3743
3744/* ----------------------------------------------------------------------- */
3745/* AVermedia specific stuff, from bktr_card.c */
3746
3747static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003748 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3749 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3750 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3751 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3752 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003753 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003754
3755static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003756 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003757 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3758 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003759 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3760 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003761
3762static void __devinit avermedia_eeprom(struct bttv *btv)
3763{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003764 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003765
3766 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003767 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3768 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003769 btv->has_remote = (eeprom_data[0x42] & 0x01);
3770
3771 if (tuner_make == 0 || tuner_make == 2)
3772 if(tuner_format <=0x0a)
3773 tuner = tuner_0_table[tuner_format];
3774 if (tuner_make == 1)
3775 if(tuner_format <=9)
3776 tuner = tuner_1_table[tuner_format];
3777
3778 if (tuner_make == 4)
3779 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003780 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003781
3782 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3783 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3784 if(tuner) {
3785 btv->tuner_type=tuner;
3786 printk("%d",tuner);
3787 } else
3788 printk("Unknown type");
3789 printk(" radio:%s remote control:%s\n",
3790 tuner_tv_fm ? "yes" : "no",
3791 btv->has_remote ? "yes" : "no");
3792}
3793
3794/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3795void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3796{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003797 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003798 if(norm==VIDEO_MODE_NTSC) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003799 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff;
3800 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003801 dprintk("bttv_tda9880_setnorm to NTSC\n");
3802 }
3803 else {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003804 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3805 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003806 dprintk("bttv_tda9880_setnorm to PAL\n");
3807 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003808 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003809 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3810 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3811}
3812
3813
3814/*
3815 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003816 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003817 *
3818 * Hauppauge: pin 5
3819 * Voodoo: pin 20
3820 */
3821static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3822{
3823 int mask = (1 << pin);
3824
3825 gpio_inout(mask,mask);
3826 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003827 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003828 gpio_bits(mask,mask);
3829
3830 if (bttv_gpio)
3831 bttv_gpio_tracking(btv,"msp34xx");
3832 if (bttv_verbose)
3833 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3834 "init [%d]\n", btv->c.nr, pin);
3835}
3836
3837static void __devinit boot_bt832(struct bttv *btv)
3838{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003839}
3840
3841/* ----------------------------------------------------------------------- */
3842/* Imagenation L-Model PXC200 Framegrabber */
3843/* This is basically the same procedure as
3844 * used by Alessandro Rubini in his pxc200
3845 * driver, but using BTTV functions */
3846
3847static void __devinit init_PXC200(struct bttv *btv)
3848{
3849 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3850 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3851 0x00 };
3852 unsigned int i;
3853 int tmp;
3854 u32 val;
3855
3856 /* Initialise GPIO-connevted stuff */
3857 gpio_inout(0xffffff, (1<<13));
3858 gpio_write(0);
3859 udelay(3);
3860 gpio_write(1<<13);
3861 /* GPIO inputs are pulled up, so no need to drive
3862 * reset pin any longer */
3863 gpio_bits(0xffffff, 0);
3864 if (bttv_gpio)
3865 bttv_gpio_tracking(btv,"pxc200");
3866
3867 /* we could/should try and reset/control the AD pots? but
3868 right now we simply turned off the crushing. Without
3869 this the AGC drifts drifts
3870 remember the EN is reverse logic -->
3871 setting BT848_ADC_AGC_EN disable the AGC
3872 tboult@eecs.lehigh.edu
3873 */
3874
3875 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3876
3877 /* Initialise MAX517 DAC */
3878 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3879 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3880
3881 /* Initialise 12C508 PIC */
3882 /* The I2CWrite and I2CRead commmands are actually to the
3883 * same chips - but the R/W bit is included in the address
3884 * argument so the numbers are different */
3885
3886
3887 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3888
3889 /* First of all, enable the clock line. This is used in the PXC200-F */
3890 val = btread(BT848_GPIO_DMA_CTL);
3891 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3892 btwrite(val, BT848_GPIO_DMA_CTL);
3893
3894 /* Then, push to 0 the reset pin long enough to reset the *
3895 * device same as above for the reset line, but not the same
3896 * value sent to the GPIO-connected stuff
3897 * which one is the good one? */
3898 gpio_inout(0xffffff,(1<<2));
3899 gpio_write(0);
3900 udelay(10);
3901 gpio_write(1<<2);
3902
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003903 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003904 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3905 if (tmp != -1) {
3906 printk(KERN_INFO
3907 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3908 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3909 }
3910 }
3911
3912 printk(KERN_INFO "PXC200 Initialised.\n");
3913}
3914
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003915
3916
Peter Skipworth93b43f12005-06-23 22:04:45 -07003917/* ----------------------------------------------------------------------- */
3918/*
3919 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3920 * it. This apparently involves the following procedure for each 878 chip:
3921 *
3922 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3923 *
3924 * 2) write to GPIO_DATA
3925 * - 0x0E
3926 * - sleep 1ms
3927 * - 0x10 + 0x0E
3928 * - sleep 10ms
3929 * - 0x0E
3930 * read from GPIO_DATA into buf (uint_32)
3931 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3932 * error. ERROR_CPLD_Check_Failed stop.
3933 *
3934 * 3) write to GPIO_DATA
3935 * - write 0x4400 + 0x0E
3936 * - sleep 10ms
3937 * - write 0x4410 + 0x0E
3938 * - sleep 1ms
3939 * - write 0x0E
3940 * read from GPIO_DATA into buf (uint_32)
3941 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3942 * error. ERROR_CPLD_Check_Failed.
3943 */
3944/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08003945static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003946init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003947{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003948 uint32_t dataRead = 0;
3949 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003950
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003951 printk (KERN_INFO
3952 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003953 btv->c.nr);
3954
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003955 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003956
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003957 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3958 msleep (1);
3959 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3960 msleep (10);
3961 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003962
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003963 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003964
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003965 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3966 printk (KERN_INFO
3967 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3968 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003969 }
3970
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003971 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3972 msleep (10);
3973 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3974 msleep (1);
3975 btwrite (watchdog_value, BT848_GPIO_DATA);
3976 msleep (1);
3977 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003978
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003979 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3980 printk (KERN_INFO
3981 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3982 btv->c.nr, dataRead);
3983
Peter Skipworth93b43f12005-06-23 22:04:45 -07003984 return;
3985 }
3986
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003987 printk (KERN_INFO
3988 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003989}
Linus Torvalds1da177e2005-04-16 15:20:36 -07003990
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003991
3992
Linus Torvalds1da177e2005-04-16 15:20:36 -07003993/* ----------------------------------------------------------------------- */
3994/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3995/*
3996 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3997 * This code is placed under the terms of the GNU General Public License
3998 *
3999 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4000 */
4001
4002static void bus_low(struct bttv *btv, int bit)
4003{
4004 if (btv->mbox_ior) {
4005 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4006 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4007 udelay(5);
4008 }
4009
4010 gpio_bits(bit,0);
4011 udelay(5);
4012
4013 if (btv->mbox_ior) {
4014 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4015 udelay(5);
4016 }
4017}
4018
4019static void bus_high(struct bttv *btv, int bit)
4020{
4021 if (btv->mbox_ior) {
4022 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4023 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4024 udelay(5);
4025 }
4026
4027 gpio_bits(bit,bit);
4028 udelay(5);
4029
4030 if (btv->mbox_ior) {
4031 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4032 udelay(5);
4033 }
4034}
4035
4036static int bus_in(struct bttv *btv, int bit)
4037{
4038 if (btv->mbox_ior) {
4039 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4040 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4041 udelay(5);
4042
4043 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4044 udelay(5);
4045 }
4046 return gpio_read() & (bit);
4047}
4048
4049/* TEA5757 register bits */
4050#define TEA_FREQ 0:14
4051#define TEA_BUFFER 15:15
4052
4053#define TEA_SIGNAL_STRENGTH 16:17
4054
4055#define TEA_PORT1 18:18
4056#define TEA_PORT0 19:19
4057
4058#define TEA_BAND 20:21
4059#define TEA_BAND_FM 0
4060#define TEA_BAND_MW 1
4061#define TEA_BAND_LW 2
4062#define TEA_BAND_SW 3
4063
4064#define TEA_MONO 22:22
4065#define TEA_ALLOW_STEREO 0
4066#define TEA_FORCE_MONO 1
4067
4068#define TEA_SEARCH_DIRECTION 23:23
4069#define TEA_SEARCH_DOWN 0
4070#define TEA_SEARCH_UP 1
4071
4072#define TEA_STATUS 24:24
4073#define TEA_STATUS_TUNED 0
4074#define TEA_STATUS_SEARCHING 1
4075
4076/* Low-level stuff */
4077static int tea5757_read(struct bttv *btv)
4078{
4079 unsigned long timeout;
4080 int value = 0;
4081 int i;
4082
4083 /* better safe than sorry */
4084 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4085
4086 if (btv->mbox_ior) {
4087 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4088 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4089 udelay(5);
4090 }
4091
4092 if (bttv_gpio)
4093 bttv_gpio_tracking(btv,"tea5757 read");
4094
4095 bus_low(btv,btv->mbox_we);
4096 bus_low(btv,btv->mbox_clk);
4097
4098 udelay(10);
4099 timeout= jiffies + HZ;
4100
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004101 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004102 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4103 schedule();
4104 if (bus_in(btv,btv->mbox_data)) {
4105 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4106 return -1;
4107 }
4108
4109 dprintk("bttv%d: tea5757:",btv->c.nr);
4110 for(i = 0; i < 24; i++)
4111 {
4112 udelay(5);
4113 bus_high(btv,btv->mbox_clk);
4114 udelay(5);
4115 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4116 bus_low(btv,btv->mbox_clk);
4117 value <<= 1;
4118 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4119 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4120 }
4121 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4122 return value;
4123}
4124
4125static int tea5757_write(struct bttv *btv, int value)
4126{
4127 int i;
4128 int reg = value;
4129
4130 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4131
4132 if (btv->mbox_ior) {
4133 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4134 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4135 udelay(5);
4136 }
4137 if (bttv_gpio)
4138 bttv_gpio_tracking(btv,"tea5757 write");
4139
4140 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4141 bus_low(btv,btv->mbox_clk);
4142 bus_high(btv,btv->mbox_we);
4143 for(i = 0; i < 25; i++)
4144 {
4145 if (reg & 0x1000000)
4146 bus_high(btv,btv->mbox_data);
4147 else
4148 bus_low(btv,btv->mbox_data);
4149 reg <<= 1;
4150 bus_high(btv,btv->mbox_clk);
4151 udelay(10);
4152 bus_low(btv,btv->mbox_clk);
4153 udelay(10);
4154 }
4155 bus_low(btv,btv->mbox_we); /* unmute !!! */
4156 return 0;
4157}
4158
4159void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4160{
4161 dprintk("tea5757_set_freq %d\n",freq);
4162 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004163}
4164
4165
4166/* ----------------------------------------------------------------------- */
4167/* winview */
4168
Adrian Bunk943a4902005-12-01 00:51:35 -08004169static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004170{
4171 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4172 int bits_out, loops, vol, data;
4173
4174 if (!set) {
4175 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4176 v->flags |= VIDEO_AUDIO_VOLUME;
4177 return;
4178 }
4179
4180 /* 32 levels logarithmic */
4181 vol = 32 - ((v->volume>>11));
4182 /* units */
4183 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4184 /* tens */
4185 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4186 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4187 data = gpio_read();
4188 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4189 WINVIEW_PT2254_STROBE);
4190 for (loops = 17; loops >= 0 ; loops--) {
4191 if (bits_out & (1<<loops))
4192 data |= WINVIEW_PT2254_DATA;
4193 else
4194 data &= ~WINVIEW_PT2254_DATA;
4195 gpio_write(data);
4196 udelay(5);
4197 data |= WINVIEW_PT2254_CLK;
4198 gpio_write(data);
4199 udelay(5);
4200 data &= ~WINVIEW_PT2254_CLK;
4201 gpio_write(data);
4202 }
4203 data |= WINVIEW_PT2254_STROBE;
4204 data &= ~WINVIEW_PT2254_DATA;
4205 gpio_write(data);
4206 udelay(10);
4207 data &= ~WINVIEW_PT2254_STROBE;
4208 gpio_write(data);
4209}
4210
4211/* ----------------------------------------------------------------------- */
4212/* mono/stereo control for various cards (which don't use i2c chips but */
4213/* connect something to the GPIO pins */
4214
4215static void
4216gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4217{
4218 unsigned int con = 0;
4219
4220 if (set) {
4221 gpio_inout(0x300, 0x300);
4222 if (v->mode & VIDEO_SOUND_LANG1)
4223 con = 0x000;
4224 if (v->mode & VIDEO_SOUND_LANG2)
4225 con = 0x300;
4226 if (v->mode & VIDEO_SOUND_STEREO)
4227 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004228/* if (v->mode & VIDEO_SOUND_MONO)
4229 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004230 gpio_bits(0x300, con);
4231 } else {
4232 v->mode = VIDEO_SOUND_STEREO |
4233 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4234 }
4235}
4236
4237static void
4238gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4239{
4240 unsigned int val, con;
4241
Linus Torvalds1da177e2005-04-16 15:20:36 -07004242 if (btv->radio_user)
4243 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004244
4245 val = gpio_read();
4246 if (set) {
4247 con = 0x000;
4248 if (v->mode & VIDEO_SOUND_LANG2) {
4249 if (v->mode & VIDEO_SOUND_LANG1) {
4250 /* LANG1 + LANG2 */
4251 con = 0x100;
4252 }
4253 else {
4254 /* LANG2 */
4255 con = 0x300;
4256 }
4257 }
4258 if (con != (val & 0x300)) {
4259 gpio_bits(0x300, con);
4260 if (bttv_gpio)
4261 bttv_gpio_tracking(btv,"gvbctv5pci");
4262 }
4263 } else {
4264 switch (val & 0x70) {
4265 case 0x10:
4266 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4267 break;
4268 case 0x30:
4269 v->mode = VIDEO_SOUND_LANG2;
4270 break;
4271 case 0x50:
4272 v->mode = VIDEO_SOUND_LANG1;
4273 break;
4274 case 0x60:
4275 v->mode = VIDEO_SOUND_STEREO;
4276 break;
4277 case 0x70:
4278 v->mode = VIDEO_SOUND_MONO;
4279 break;
4280 default:
4281 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4282 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4283 }
4284 }
4285}
4286
4287/*
4288 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4289 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4290 * 0xdde enables mono and 0xccd enables sap
4291 *
4292 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4293 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4294 * input/output sound connection, so both must be set for output mode.
4295 *
4296 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4297 * handles this with a tda9840
4298 *
4299 */
4300static void
4301avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4302{
4303 int val = 0;
4304
4305 if (set) {
4306 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4307 val = 0x02;
4308 if (v->mode & VIDEO_SOUND_STEREO)
4309 val = 0x01;
4310 if (val) {
4311 gpio_bits(0x03,val);
4312 if (bttv_gpio)
4313 bttv_gpio_tracking(btv,"avermedia");
4314 }
4315 } else {
4316 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4317 VIDEO_SOUND_LANG1;
4318 return;
4319 }
4320}
4321
4322static void
4323avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4324{
4325 int val = 0;
4326
4327 if (set) {
4328 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4329 val = 0x01;
4330 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4331 val = 0x02;
4332 btaor(val, ~0x03, BT848_GPIO_DATA);
4333 if (bttv_gpio)
4334 bttv_gpio_tracking(btv,"avermedia");
4335 } else {
4336 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4337 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4338 return;
4339 }
4340}
4341
4342/* Lifetec 9415 handling */
4343static void
4344lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4345{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004346 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004347
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004348 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004349 v->mode = VIDEO_SOUND_MONO;
4350 return;
4351 }
4352
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004353 if (set) {
4354 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4355 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004356 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004357 val = 0x0880;
4358 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004359 (v->mode & VIDEO_SOUND_MONO))
4360 val = 0;
4361 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004362 if (bttv_gpio)
4363 bttv_gpio_tracking(btv,"lt9415");
4364 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004365 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004366 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004367 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004368 return;
4369 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004370}
4371
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004372/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004373static void
4374terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4375{
4376 unsigned int con = 0;
4377
4378 if (set) {
4379 gpio_inout(0x180000,0x180000);
4380 if (v->mode & VIDEO_SOUND_LANG2)
4381 con = 0x080000;
4382 if (v->mode & VIDEO_SOUND_STEREO)
4383 con = 0x180000;
4384 gpio_bits(0x180000, con);
4385 if (bttv_gpio)
4386 bttv_gpio_tracking(btv,"terratv");
4387 } else {
4388 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4389 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4390 }
4391}
4392
4393static void
4394winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4395{
4396 unsigned long val = 0;
4397
4398 if (set) {
4399 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4400 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4401 val = 0x420000;
4402 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4403 val = 0x420000;
4404 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4405 val = 0x410000;
4406 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4407 val = 0x020000;
4408 if (val) {
4409 gpio_bits(0x430000, val);
4410 if (bttv_gpio)
4411 bttv_gpio_tracking(btv,"winfast2000");
4412 }
4413 } else {
4414 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4415 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4416 }
4417}
4418
4419/*
4420 * Dariusz Kowalewski <darekk@automex.pl>
4421 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4422 * revision 9B has on-board TDA9874A sound decoder).
4423 *
4424 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4425 * will mute this cards.
4426 */
4427static void
4428pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4429{
4430 unsigned int val = 0;
4431
Linus Torvalds1da177e2005-04-16 15:20:36 -07004432 if (btv->radio_user)
4433 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004434
4435 if (set) {
4436 if (v->mode & VIDEO_SOUND_MONO) {
4437 val = 0x01;
4438 }
4439 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4440 || (v->mode & VIDEO_SOUND_STEREO)) {
4441 val = 0x02;
4442 }
4443 if (val) {
4444 gpio_bits(0x03,val);
4445 if (bttv_gpio)
4446 bttv_gpio_tracking(btv,"pvbt878p9b");
4447 }
4448 } else {
4449 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4450 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4451 }
4452}
4453
4454/*
4455 * Dariusz Kowalewski <darekk@automex.pl>
4456 * sound control for FlyVideo 2000S (with tda9874 decoder)
4457 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4458 */
4459static void
4460fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4461{
4462 unsigned int val = 0xffff;
4463
Linus Torvalds1da177e2005-04-16 15:20:36 -07004464 if (btv->radio_user)
4465 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004466 if (set) {
4467 if (v->mode & VIDEO_SOUND_MONO) {
4468 val = 0x0000;
4469 }
4470 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4471 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004472 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004473 }
4474 if (val != 0xffff) {
4475 gpio_bits(0x1800, val);
4476 if (bttv_gpio)
4477 bttv_gpio_tracking(btv,"fv2000s");
4478 }
4479 } else {
4480 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4481 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4482 }
4483}
4484
4485/*
4486 * sound control for Canopus WinDVR PCI
4487 * Masaki Suzuki <masaki@btree.org>
4488 */
4489static void
4490windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4491{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004492 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004493
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004494 if (set) {
4495 if (v->mode & VIDEO_SOUND_MONO)
4496 val = 0x040000;
4497 if (v->mode & VIDEO_SOUND_LANG1)
4498 val = 0;
4499 if (v->mode & VIDEO_SOUND_LANG2)
4500 val = 0x100000;
4501 if (v->mode & VIDEO_SOUND_STEREO)
4502 val = 0;
4503 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004504 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004505 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004506 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004507 }
4508 } else {
4509 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4510 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4511 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004512}
4513
4514/*
4515 * sound control for AD-TVK503
4516 * Hiroshi Takekawa <sian@big.or.jp>
4517 */
4518static void
4519adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4520{
4521 unsigned int con = 0xffffff;
4522
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004523 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004524
4525 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004526 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004527 if (v->mode & VIDEO_SOUND_LANG1)
4528 con = 0x00000000;
4529 if (v->mode & VIDEO_SOUND_LANG2)
4530 con = 0x00180000;
4531 if (v->mode & VIDEO_SOUND_STEREO)
4532 con = 0x00000000;
4533 if (v->mode & VIDEO_SOUND_MONO)
4534 con = 0x00060000;
4535 if (con != 0xffffff) {
4536 gpio_bits(0x1e0000,con);
4537 if (bttv_gpio)
4538 bttv_gpio_tracking(btv, "adtvk503");
4539 }
4540 } else {
4541 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4542 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4543 }
4544}
4545
4546/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4547 *
4548 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4549 * switch instead (CD22M3494E). This IC can have multiple active connections
4550 * between Xn (input) and Yn (output) pins. We need to clear any existing
4551 * connection prior to establish a new one, pulsing the STROBE pin.
4552 *
4553 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4554 * GPIO pins are wired as:
4555 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4556 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4557 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4558 * GPIO[8] - - P3[5] (microcontroler)
4559 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4560 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4561 * GPINTR - - P3[4] (microcontroler)
4562 *
4563 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4564 * configuration either directly (as we are doing) or using the microcontroler
4565 * which is also wired to I2C interface. I have no further info on the
4566 * microcontroler features, one would need to disassembly the firmware.
4567 * note: the vendor refused to give any information on this product, all
4568 * that stuff was found using a multimeter! :)
4569 */
4570static void rv605_muxsel(struct bttv *btv, unsigned int input)
4571{
4572 /* reset all conections */
4573 gpio_bits(0x200,0x200);
4574 mdelay(1);
4575 gpio_bits(0x200,0x000);
4576 mdelay(1);
4577
4578 /* create a new conection */
4579 gpio_bits(0x480,0x080);
4580 gpio_bits(0x480,0x480);
4581 mdelay(1);
4582 gpio_bits(0x480,0x080);
4583 mdelay(1);
4584}
4585
4586/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4587 *
4588 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4589 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4590 * chips, ten eight input analog multiplexors, a not chip and a few
4591 * other components.
4592 *
4593 * 16 inputs on a secondary bracket are provided and can be selected
4594 * from each of the four capture chips. Two of the eight input
4595 * multiplexors are used to select from any of the 16 input signals.
4596 *
4597 * Unsupported hardware capabilities:
4598 * . A video output monitor on the secondary bracket can be selected from
4599 * one of the 878A chips.
4600 * . Another passthrough but I haven't spent any time investigating it.
4601 * . Digital I/O (logic level connected to GPIO) is available from an
4602 * onboard header.
4603 *
4604 * The on chip input mux should always be set to 2.
4605 * GPIO[16:19] - Video input selection
4606 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4607 * GPIO[?:?] - Digital I/O.
4608 *
4609 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4610 * determined what function (if any) it provides. With the microcontroller
4611 * and sync seperator chips a guess is that it might have to do with video
4612 * switching and maybe some digital I/O.
4613 */
4614static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4615{
4616 /* video mux */
4617 gpio_bits(0x0f0000, input << 16);
4618}
4619
4620static void tibetCS16_init(struct bttv *btv)
4621{
4622 /* enable gpio bits, mask obtained via btSpy */
4623 gpio_inout(0xffffff, 0x0f7fff);
4624 gpio_write(0x0f7fff);
4625}
4626
4627/*
4628 * The following routines for the Kodicom-4400r get a little mind-twisting.
4629 * There is a "master" controller and three "slave" controllers, together
4630 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4631 * The analog switch is controlled by the "master", but the detection order
4632 * of the four BT878A chips is in an order which I just don't understand.
4633 * The "master" is actually the second controller to be detected. The
4634 * logic on the board uses logical numbers for the 4 controlers, but
4635 * those numbers are different from the detection sequence. When working
4636 * with the analog switch, we need to "map" from the detection sequence
4637 * over to the board's logical controller number. This mapping sequence
4638 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4639 * unit 3, the second (which is the master) is logical unit 0, etc.
4640 * We need to maintain the status of the analog switch (which of the 16
4641 * cameras is connected to which of the 4 controllers). Rather than
4642 * add to the bttv structure for this, we use the data reserved for
4643 * the mbox (unused for this card type).
4644 */
4645
4646/*
4647 * First a routine to set the analog switch, which controls which camera
4648 * is routed to which controller. The switch comprises an X-address
4649 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4650 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4651 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4652 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4653 * specified address. The idea is to set the address and data, then bring
4654 * STROBE high, and finally bring STROBE back to low.
4655 */
4656static void kodicom4400r_write(struct bttv *btv,
4657 unsigned char xaddr,
4658 unsigned char yaddr,
4659 unsigned char data) {
4660 unsigned int udata;
4661
4662 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4663 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4664 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4665 gpio_bits(0x1ff, udata); /* strobe low */
4666}
4667
4668/*
4669 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4670 * use this routine. The routine finds the "master" for the card, maps
4671 * the controller number from the detected position over to the logical
4672 * number, writes the appropriate data to the analog switch, and housekeeps
4673 * the local copy of the switch information. The parameter 'input' is the
4674 * requested camera number (0 - 15).
4675 */
4676static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4677{
4678 char *sw_status;
4679 int xaddr, yaddr;
4680 struct bttv *mctlr;
4681 static unsigned char map[4] = {3, 0, 2, 1};
4682
4683 mctlr = master[btv->c.nr];
4684 if (mctlr == NULL) { /* ignore if master not yet detected */
4685 return;
4686 }
4687 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4688 yaddr = map[yaddr];
4689 sw_status = (char *)(&mctlr->mbox_we);
4690 xaddr = input & 0xf;
4691 /* Check if the controller/camera pair has changed, else ignore */
4692 if (sw_status[yaddr] != xaddr)
4693 {
4694 /* "open" the old switch, "close" the new one, save the new */
4695 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4696 sw_status[yaddr] = xaddr;
4697 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4698 }
4699}
4700
4701/*
4702 * During initialisation, we need to reset the analog switch. We
4703 * also preset the switch to map the 4 connectors on the card to the
4704 * *user's* (see above description of kodicom4400r_muxsel) channels
4705 * 0 through 3
4706 */
4707static void kodicom4400r_init(struct bttv *btv)
4708{
4709 char *sw_status = (char *)(&btv->mbox_we);
4710 int ix;
4711
4712 gpio_inout(0x0003ff, 0x0003ff);
4713 gpio_write(1 << 9); /* reset MUX */
4714 gpio_write(0);
4715 /* Preset camera 0 to the 4 controllers */
4716 for (ix=0; ix<4; ix++) {
4717 sw_status[ix] = ix;
4718 kodicom4400r_write(btv, ix, ix, 1);
4719 }
4720 /*
4721 * Since this is the "master", we need to set up the
4722 * other three controller chips' pointers to this structure
4723 * for later use in the muxsel routine.
4724 */
4725 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4726 return;
4727 master[btv->c.nr-1] = btv;
4728 master[btv->c.nr] = btv;
4729 master[btv->c.nr+1] = btv;
4730 master[btv->c.nr+2] = btv;
4731}
4732
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004733/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4734 * video multiplexers to provide up to 16 video inputs. These
4735 * multiplexers are controlled by the lower 8 GPIO pins of the
4736 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004737
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004738 * xxx0 is pin xxx of multiplexer U5,
4739 * yyy1 is pin yyy of multiplexer U2
4740 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004741#define ENA0 0x01
4742#define ENB0 0x02
4743#define ENA1 0x04
4744#define ENB1 0x08
4745
4746#define IN10 0x10
4747#define IN00 0x20
4748#define IN11 0x40
4749#define IN01 0x80
4750
4751static void xguard_muxsel(struct bttv *btv, unsigned int input)
4752{
4753 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004754 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4755 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4756 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4757 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004758 };
4759 gpio_write(masks[input%16]);
4760}
4761static void picolo_tetra_init(struct bttv *btv)
4762{
4763 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4764 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4765 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4766}
4767static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4768{
4769
4770 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4771 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4772 /*GPIO[20]&GPIO[21] used to choose the right input*/
4773 btwrite (input<<20,BT848_GPIO_DATA);
4774
4775}
4776
4777/*
4778 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4779 *
4780 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4781 * swichers to provide 16 channels to MUX0. The TDA8540's have
4782 * 4 indepedant outputs and as such the IVC120G also has the
4783 * optional "Monitor Out" bus. This allows the card to be looking
4784 * at one input while the monitor is looking at another.
4785 *
4786 * Since I've couldn't be bothered figuring out how to add an
4787 * independant muxsel for the monitor bus, I've just set it to
4788 * whatever the card is looking at.
4789 *
4790 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4791 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4792 *
4793 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4794 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4795 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4796 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4797 *
4798 */
4799
4800/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4801#define I2C_TDA8540 0x90
4802#define I2C_TDA8540_ALT1 0x92
4803#define I2C_TDA8540_ALT2 0x94
4804#define I2C_TDA8540_ALT3 0x96
4805#define I2C_TDA8540_ALT4 0x98
4806#define I2C_TDA8540_ALT5 0x9a
4807#define I2C_TDA8540_ALT6 0x9c
4808
4809static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4810{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004811 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004812 int key = input % 4;
4813 int matrix = input / 4;
4814
4815 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4816 btv->c.nr, input, matrix, key);
4817
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004818 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004819 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4820 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4821 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4822 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4823 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4824 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4825 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4826 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4827
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004828 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004829 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004830 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004831 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004832 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004833 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004834 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004835 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004836 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004837
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004838 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004839 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4840}
4841
4842
4843/* PXC200 muxsel helper
4844 * luke@syseng.anu.edu.au
4845 * another transplant
4846 * from Alessandro Rubini (rubini@linux.it)
4847 *
4848 * There are 4 kinds of cards:
4849 * PXC200L which is bt848
4850 * PXC200F which is bt848 with PIC controlling mux
4851 * PXC200AL which is bt878
4852 * PXC200AF which is bt878 with PIC controlling mux
4853 */
4854#define PX_CFG_PXC200F 0x01
4855#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4856#define PX_I2C_PIC 0x0f
4857#define PX_PXC200A_CARDID 0x200a1295
4858#define PX_I2C_CMD_CFG 0x00
4859
4860static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4861{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004862 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004863 long mux;
4864 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004865 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004866
4867 /* Read PIC config to determine if this is a PXC200F */
4868 /* PX_I2C_CMD_CFG*/
4869 buf[0]=0;
4870 buf[1]=0;
4871 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4872 if (rc) {
4873 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4874 /* not PXC ? do nothing */
4875 return;
4876 }
4877
4878 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4879 if (!(rc & PX_CFG_PXC200F)) {
4880 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4881 return;
4882 }
4883
4884
4885 /* The multiplexer in the 200F is handled by the GPIO port */
4886 /* get correct mapping between inputs */
4887 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4888 /* ** not needed!? */
4889 mux = input;
4890
4891 /* make sure output pins are enabled */
4892 /* bitmask=0x30f; */
4893 bitmask=0x302;
4894 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004895 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004896 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4897 bitmask |= 7<<4; /* the DAC */
4898 }
4899 btwrite(bitmask, BT848_GPIO_OUT_EN);
4900
4901 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004902 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004903 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4904 else /* older device */
4905 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4906 btwrite(bitmask,BT848_GPIO_DATA);
4907
4908 /*
4909 * Was "to be safe, set the bt848 to input 0"
4910 * Actually, since it's ok at load time, better not messing
4911 * with these bits (on PXC200AF you need to set mux 2 here)
4912 *
4913 * needed because bttv-driver sets mux before calling this function
4914 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004915 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004916 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4917 else /* older device */
4918 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4919
4920 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4921}
4922
4923/* ----------------------------------------------------------------------- */
4924/* motherboard chipset specific stuff */
4925
4926void __devinit bttv_check_chipset(void)
4927{
4928 int pcipci_fail = 0;
4929 struct pci_dev *dev = NULL;
4930
4931 if (pci_pci_problems & PCIPCI_FAIL)
4932 pcipci_fail = 1;
4933 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4934 triton1 = 1;
4935 if (pci_pci_problems & PCIPCI_VSFX)
4936 vsfx = 1;
4937#ifdef PCIPCI_ALIMAGIK
4938 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4939 latency = 0x0A;
4940#endif
4941
Linus Torvalds1da177e2005-04-16 15:20:36 -07004942
4943 /* print warnings about any quirks found */
4944 if (triton1)
4945 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4946 if (vsfx)
4947 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4948 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004949 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4950 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004951 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004952 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004953 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004954 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004955 printk(KERN_INFO "bttv: overlay forced. Use this "
4956 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004957 }
4958 }
4959 if (UNSET != latency)
4960 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08004961 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004962 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004963 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004964 pci_read_config_byte(dev, 0x53, &b);
4965 if (bttv_debug)
4966 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4967 "bufcon=0x%02x\n",b);
4968 }
4969}
4970
4971int __devinit bttv_handle_chipset(struct bttv *btv)
4972{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004973 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004974
4975 if (!triton1 && !vsfx && UNSET == latency)
4976 return 0;
4977
4978 if (bttv_verbose) {
4979 if (triton1)
4980 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4981 if (vsfx && btv->id >= 878)
4982 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4983 if (UNSET != latency)
4984 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4985 btv->c.nr,latency);
4986 }
4987
4988 if (btv->id < 878) {
4989 /* bt848 (mis)uses a bit in the irq mask for etbf */
4990 if (triton1)
4991 btv->triton1 = BT848_INT_ETBF;
4992 } else {
4993 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004994 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004995 if (triton1)
4996 command |= BT878_EN_TBFX;
4997 if (vsfx)
4998 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004999 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5000 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005001 if (UNSET != latency)
5002 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5003 return 0;
5004}
5005
5006
5007/*
5008 * Local variables:
5009 * c-basic-offset: 8
5010 * End:
5011 */