blob: 8544a8fa2a5cfff752158c5775899688db42fd32 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3 bttv-cards.c
4
5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
7
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
9 & Marcus Metzler (mocm@thp.uni-koeln.de)
10 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
26*/
27
28#include <linux/config.h>
29#include <linux/delay.h>
30#include <linux/module.h>
31#include <linux/moduleparam.h>
32#include <linux/kmod.h>
33#include <linux/init.h>
34#include <linux/pci.h>
35#include <linux/vmalloc.h>
36#include <linux/firmware.h>
37
38#include <asm/io.h>
39
40#include "bttvp.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42/* fwd decl */
43static void boot_msp34xx(struct bttv *btv, int pin);
44static void boot_bt832(struct bttv *btv);
45static void hauppauge_eeprom(struct bttv *btv);
46static void avermedia_eeprom(struct bttv *btv);
47static void osprey_eeprom(struct bttv *btv);
48static void modtec_eeprom(struct bttv *btv);
49static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070050static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
52static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
53static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
54static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
55 int set);
56static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
57 int set);
58static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
59static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
60static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
61static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
62static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
63static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
64static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
65static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
66static void rv605_muxsel(struct bttv *btv, unsigned int input);
67static void eagle_muxsel(struct bttv *btv, unsigned int input);
68static void xguard_muxsel(struct bttv *btv, unsigned int input);
69static void ivc120_muxsel(struct bttv *btv, unsigned int input);
70static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
71
72static void PXC200_muxsel(struct bttv *btv, unsigned int input);
73
74static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
75static void picolo_tetra_init(struct bttv *btv);
76
77static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
78static void tibetCS16_init(struct bttv *btv);
79
80static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
81static void kodicom4400r_init(struct bttv *btv);
82
83static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
84static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
85
86static int terratec_active_radio_upgrade(struct bttv *btv);
87static int tea5757_read(struct bttv *btv);
88static int tea5757_write(struct bttv *btv, int value);
89static void identify_by_eeprom(struct bttv *btv,
90 unsigned char eeprom_data[256]);
91static int __devinit pvr_boot(struct bttv *btv);
92
93/* config variables */
94static unsigned int triton1=0;
95static unsigned int vsfx=0;
96static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070097int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
99static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
105#ifdef MODULE
106static unsigned int autoload = 1;
107#else
108static unsigned int autoload = 0;
109#endif
110static unsigned int gpiomask = UNSET;
111static unsigned int audioall = UNSET;
112static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
113
114/* insmod options */
115module_param(triton1, int, 0444);
116module_param(vsfx, int, 0444);
117module_param(no_overlay, int, 0444);
118module_param(latency, int, 0444);
119module_param(gpiomask, int, 0444);
120module_param(audioall, int, 0444);
121module_param(autoload, int, 0444);
122
123module_param_array(card, int, NULL, 0444);
124module_param_array(pll, int, NULL, 0444);
125module_param_array(tuner, int, NULL, 0444);
126module_param_array(svhs, int, NULL, 0444);
127module_param_array(remote, int, NULL, 0444);
128module_param_array(audiomux, int, NULL, 0444);
129
130MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
131 "[enable bug compatibility for triton1 + others]");
132MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
133 "[yet another chipset flaw workaround]");
134MODULE_PARM_DESC(latency,"pci latency timer");
135MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
136MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
137MODULE_PARM_DESC(tuner,"specify installed tuner type");
138MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
139
140/* ----------------------------------------------------------------------- */
141/* list of card IDs for bt878+ cards */
142
143static struct CARD {
144 unsigned id;
145 int cardnr;
146 char *name;
147} cards[] __devinitdata = {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800148 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
149 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
150 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
151 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
152 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
153 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
154 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
155 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
Kenth Anderssonf718e6e2005-11-08 21:37:02 -0800156 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800158 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
159 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800161 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
162 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700172 /* some cards ship with byteswapped IDs ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800173 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
174 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700175 /* this seems to happen as well ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800176 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800178 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
180 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800182 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
183 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
184 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
185 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
186 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
187 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
188 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800190 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
191 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
192 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
194 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800196 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
197 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
198 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
199 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800201 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
202 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700203 /* clashes with FlyVideo
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800204 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
205 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
206 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
207 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
208 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800210 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
212 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800216 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
217 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
218 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
219 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
220 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800222 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
223 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
224 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
225 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800227 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
228 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
229 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
230 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800232 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
233 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
234 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
235 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
236 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
238 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
239 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
240 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
242 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
243 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
244 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800258 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
259 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800261 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
263 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
264 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
265 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
266 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800268 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
269 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800271 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
272 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
274 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
275 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
276 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800285 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
286 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
287 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
288 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800290 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700292 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800293 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700294
295 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800296 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
297 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
298 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
299 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
300 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
301 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
302 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
303 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
304 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305
306 { 0, -1, NULL }
307};
308
309/* ----------------------------------------------------------------------- */
310/* array with description for bt848 / bt878 tv/grabber cards */
311
312struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800313 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800314 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800315 .name = " *** UNKNOWN/GENERIC *** ",
316 .video_inputs = 4,
317 .audio_inputs = 1,
318 .tuner = 0,
319 .svhs = 2,
320 .muxsel = { 2, 3, 1, 0},
321 .tuner_type = -1,
322 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800323 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800324 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800325 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800326 .name = "MIRO PCTV",
327 .video_inputs = 4,
328 .audio_inputs = 1,
329 .tuner = 0,
330 .svhs = 2,
331 .gpiomask = 15,
332 .muxsel = { 2, 3, 1, 1},
333 .audiomux = { 2, 0, 0, 0, 10},
334 .needs_tvaudio = 1,
335 .tuner_type = -1,
336 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800337 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800338 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800339 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800340 .name = "Hauppauge (bt848)",
341 .video_inputs = 4,
342 .audio_inputs = 1,
343 .tuner = 0,
344 .svhs = 2,
345 .gpiomask = 7,
346 .muxsel = { 2, 3, 1, 1},
347 .audiomux = { 0, 1, 2, 3, 4},
348 .needs_tvaudio = 1,
349 .tuner_type = -1,
350 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800351 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800352 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800353 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800354 .name = "STB, Gateway P/N 6000699 (bt848)",
355 .video_inputs = 3,
356 .audio_inputs = 1,
357 .tuner = 0,
358 .svhs = 2,
359 .gpiomask = 7,
360 .muxsel = { 2, 3, 1, 1},
361 .audiomux = { 4, 0, 2, 3, 1},
362 .no_msp34xx = 1,
363 .needs_tvaudio = 1,
364 .tuner_type = TUNER_PHILIPS_NTSC,
365 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800366 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800367 .pll = PLL_28,
368 .has_radio = 1,
369 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800371 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800372 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800373 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
374 .video_inputs = 4,
375 .audio_inputs = 0,
376 .tuner = -1,
377 .svhs = 2,
378 .gpiomask = 0,
379 .muxsel = { 2, 3, 1, 1},
380 .audiomux = { 0 },
381 .needs_tvaudio = 0,
382 .tuner_type = 4,
383 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800384 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800385 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800386 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800387 .name = "Diamond DTV2000",
388 .video_inputs = 4,
389 .audio_inputs = 1,
390 .tuner = 0,
391 .svhs = 2,
392 .gpiomask = 3,
393 .muxsel = { 2, 3, 1, 0},
394 .audiomux = { 0, 1, 0, 1, 3},
395 .needs_tvaudio = 1,
396 .tuner_type = -1,
397 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800398 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800399 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800400 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800401 .name = "AVerMedia TVPhone",
402 .video_inputs = 3,
403 .audio_inputs = 1,
404 .tuner = 0,
405 .svhs = 3,
406 .muxsel = { 2, 3, 1, 1},
407 .gpiomask = 0x0f,
408 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
409 /* 0x04 for some cards ?? */
410 .needs_tvaudio = 1,
411 .tuner_type = -1,
412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800414 .audio_hook = avermedia_tvphone_audio,
415 .has_remote = 1,
416 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800417 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800418 .name = "MATRIX-Vision MV-Delta",
419 .video_inputs = 5,
420 .audio_inputs = 1,
421 .tuner = -1,
422 .svhs = 3,
423 .gpiomask = 0,
424 .muxsel = { 2, 3, 1, 0, 0},
425 .audiomux = {0 },
426 .needs_tvaudio = 1,
427 .tuner_type = -1,
428 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800429 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800430 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800432 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800433 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800434 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
435 .video_inputs = 4,
436 .audio_inputs = 1,
437 .tuner = 0,
438 .svhs = 2,
439 .gpiomask = 0xc00,
440 .muxsel = { 2, 3, 1, 1},
441 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
442 .needs_tvaudio = 1,
443 .pll = PLL_28,
444 .tuner_type = -1,
445 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800446 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800447 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800448 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800449 .name = "IMS/IXmicro TurboTV",
450 .video_inputs = 3,
451 .audio_inputs = 1,
452 .tuner = 0,
453 .svhs = 2,
454 .gpiomask = 3,
455 .muxsel = { 2, 3, 1, 1},
456 .audiomux = { 1, 1, 2, 3, 0},
457 .needs_tvaudio = 0,
458 .pll = PLL_28,
459 .tuner_type = TUNER_TEMIC_PAL,
460 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800461 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800462 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800463 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800464 .name = "Hauppauge (bt878)",
465 .video_inputs = 4,
466 .audio_inputs = 1,
467 .tuner = 0,
468 .svhs = 2,
469 .gpiomask = 0x0f, /* old: 7 */
470 .muxsel = { 2, 0, 1, 1},
471 .audiomux = { 0, 1, 2, 3, 4},
472 .needs_tvaudio = 1,
473 .pll = PLL_28,
474 .tuner_type = -1,
475 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800476 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800477 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800478 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800479 .name = "MIRO PCTV pro",
480 .video_inputs = 3,
481 .audio_inputs = 1,
482 .tuner = 0,
483 .svhs = 2,
484 .gpiomask = 0x3014f,
485 .muxsel = { 2, 3, 1, 1},
486 .audiomux = { 0x20001,0x10001, 0, 0,10},
487 .needs_tvaudio = 1,
488 .tuner_type = -1,
489 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800490 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800491 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800493 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800494 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800495 .name = "ADS Technologies Channel Surfer TV (bt848)",
496 .video_inputs = 3,
497 .audio_inputs = 1,
498 .tuner = 0,
499 .svhs = 2,
500 .gpiomask = 15,
501 .muxsel = { 2, 3, 1, 1},
502 .audiomux = { 13, 14, 11, 7, 0, 0},
503 .needs_tvaudio = 1,
504 .tuner_type = -1,
505 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800506 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800507 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800508 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800509 .name = "AVerMedia TVCapture 98",
510 .video_inputs = 3,
511 .audio_inputs = 4,
512 .tuner = 0,
513 .svhs = 2,
514 .gpiomask = 15,
515 .muxsel = { 2, 3, 1, 1},
516 .audiomux = { 13, 14, 11, 7, 0, 0},
517 .needs_tvaudio = 1,
518 .msp34xx_alt = 1,
519 .pll = PLL_28,
520 .tuner_type = TUNER_PHILIPS_PAL,
521 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800522 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800523 .audio_hook = avermedia_tv_stereo_audio,
524 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800525 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800526 .name = "Aimslab Video Highway Xtreme (VHX)",
527 .video_inputs = 3,
528 .audio_inputs = 1,
529 .tuner = 0,
530 .svhs = 2,
531 .gpiomask = 7,
532 .muxsel = { 2, 3, 1, 1},
533 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
534 .needs_tvaudio = 1,
535 .pll = PLL_28,
536 .tuner_type = -1,
537 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800538 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800539 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800540 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800541 .name = "Zoltrix TV-Max",
542 .video_inputs = 3,
543 .audio_inputs = 1,
544 .tuner = 0,
545 .svhs = 2,
546 .gpiomask = 15,
547 .muxsel = { 2, 3, 1, 1},
548 .audiomux = {0 , 0, 1 , 0, 10},
549 .needs_tvaudio = 1,
550 .tuner_type = -1,
551 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800552 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800553 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800555 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800556 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800557 .name = "Prolink Pixelview PlayTV (bt878)",
558 .video_inputs = 3,
559 .audio_inputs = 1,
560 .tuner = 0,
561 .svhs = 2,
562 .gpiomask = 0x01fe00,
563 .muxsel = { 2, 3, 1, 1},
564 #if 0
565 /* old */
566 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
567 #else
568 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
569 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
570 #endif
571 .needs_tvaudio = 1,
572 .pll = PLL_28,
573 .tuner_type = -1,
574 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800575 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800576 .name = "Leadtek WinView 601",
577 .video_inputs = 3,
578 .audio_inputs = 1,
579 .tuner = 0,
580 .svhs = 2,
581 .gpiomask = 0x8300f8,
582 .muxsel = { 2, 3, 1, 1,0},
583 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
584 .needs_tvaudio = 1,
585 .tuner_type = -1,
586 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800587 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800588 .audio_hook = winview_audio,
589 .has_radio = 1,
590 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800591 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800592 .name = "AVEC Intercapture",
593 .video_inputs = 3,
594 .audio_inputs = 2,
595 .tuner = 0,
596 .svhs = 2,
597 .gpiomask = 0,
598 .muxsel = {2, 3, 1, 1},
599 .audiomux = {1, 0, 0, 0, 0},
600 .needs_tvaudio = 1,
601 .tuner_type = -1,
602 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800603 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800604 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800605 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800606 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
607 .video_inputs = 4,
608 .audio_inputs = 1,
609 .tuner = -1,
610 .svhs = -1,
611 .gpiomask = 0x8dff00,
612 .muxsel = { 2, 3, 1, 1},
613 .audiomux = { 0 },
614 .no_msp34xx = 1,
615 .tuner_type = -1,
616 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800617 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800618 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800620 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800621 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800622 .name = "CEI Raffles Card",
623 .video_inputs = 3,
624 .audio_inputs = 3,
625 .tuner = 0,
626 .svhs = 2,
627 .muxsel = {2, 3, 1, 1},
628 .tuner_type = -1,
629 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800630 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800631 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800632 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800633 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
634 .video_inputs = 4,
635 .audio_inputs = 2, /* tuner, line in */
636 .tuner = 0,
637 .svhs = 2,
638 .gpiomask = 0x1800,
639 .muxsel = { 2, 3, 1, 1},
640 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
641 .pll = PLL_28,
642 .tuner_type = TUNER_PHILIPS_PAL_I,
643 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800644 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800646 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800647 .name = "Askey CPH050/ Phoebe Tv Master + FM",
648 .video_inputs = 3,
649 .audio_inputs = 1,
650 .tuner = 0,
651 .svhs = 2,
652 .gpiomask = 0xc00,
653 .muxsel = { 2, 3, 1, 1},
654 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
655 .needs_tvaudio = 1,
656 .pll = PLL_28,
657 .tuner_type = -1,
658 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800659 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800660 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800661 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800662 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
663 .video_inputs = 3,
664 .audio_inputs = 1,
665 .tuner = 0,
666 .svhs = -1,
667 .gpiomask = 7,
668 .muxsel = { 2, 3, -1 },
669 .digital_mode = DIGITAL_MODE_CAMERA,
670 .audiomux = { 0, 0, 0, 0, 0 },
671 .no_msp34xx = 1,
672 .pll = PLL_28,
673 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
674 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800675 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800676 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800678 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800679 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800680 .name = "Askey CPH05X/06X (bt878) [many vendors]",
681 .video_inputs = 3,
682 .audio_inputs = 1,
683 .tuner = 0,
684 .svhs = 2,
685 .gpiomask = 0xe00,
686 .muxsel = { 2, 3, 1, 1},
687 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
688 .needs_tvaudio = 1,
689 .pll = PLL_28,
690 .tuner_type = -1,
691 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800692 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800693 .has_remote = 1,
694 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800695 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800696 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
697 .video_inputs = 3,
698 .audio_inputs = 1,
699 .tuner = 0,
700 .svhs = 2,
701 .gpiomask = 0x1f0fff,
702 .muxsel = { 2, 3, 1, 1},
703 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
704 .needs_tvaudio = 0,
705 .tuner_type = TUNER_PHILIPS_PAL,
706 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800707 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800708 .audio_hook = terratv_audio,
709 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800710 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800711 .name = "Hauppauge WinCam newer (bt878)",
712 .video_inputs = 4,
713 .audio_inputs = 1,
714 .tuner = 0,
715 .svhs = 3,
716 .gpiomask = 7,
717 .muxsel = { 2, 0, 1, 1},
718 .audiomux = { 0, 1, 2, 3, 4},
719 .needs_tvaudio = 1,
720 .tuner_type = -1,
721 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800722 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800723 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800724 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800725 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
726 .video_inputs = 4,
727 .audio_inputs = 2,
728 .tuner = 0,
729 .svhs = 2,
730 .gpiomask = 0x1800,
731 .muxsel = { 2, 3, 1, 1},
732 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
733 .pll = PLL_28,
734 .tuner_type = TUNER_PHILIPS_SECAM,
735 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800736 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800737 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800739 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800740 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800741 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
742 .video_inputs = 3,
743 .audio_inputs = 1,
744 .tuner = 0,
745 .svhs = 2,
746 .gpiomask = 0x1f0fff,
747 .muxsel = { 2, 3, 1, 1},
748 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
749 .needs_tvaudio = 0,
750 .tuner_type = TUNER_PHILIPS_PAL,
751 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800752 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800753 .audio_hook = terratv_audio,
754 /* GPIO wiring:
755 External 20 pin connector (for Active Radio Upgrade board)
756 gpio00: i2c-sda
757 gpio01: i2c-scl
758 gpio02: om5610-data
759 gpio03: om5610-clk
760 gpio04: om5610-wre
761 gpio05: om5610-stereo
762 gpio06: rds6588-davn
763 gpio07: Pin 7 n.c.
764 gpio08: nIOW
765 gpio09+10: nIOR, nSEL ?? (bt878)
766 gpio09: nIOR (bt848)
767 gpio10: nSEL (bt848)
768 Sound Routing:
769 gpio16: u2-A0 (1st 4052bt)
770 gpio17: u2-A1
771 gpio18: u2-nEN
772 gpio19: u4-A0 (2nd 4052)
773 gpio20: u4-A1
774 u4-nEN - GND
775 Btspy:
776 00000 : Cdrom (internal audio input)
777 10000 : ext. Video audio input
778 20000 : TV Mono
779 a0000 : TV Mono/2
780 1a0000 : TV Stereo
781 30000 : Radio
782 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700783 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800785 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800786 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800787 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
788 .name = "Imagenation PXC200",
789 .video_inputs = 5,
790 .audio_inputs = 1,
791 .tuner = -1,
792 .svhs = 1, /* was: 4 */
793 .gpiomask = 0,
794 .muxsel = { 2, 3, 1, 0, 0},
795 .audiomux = { 0 },
796 .needs_tvaudio = 1,
797 .tuner_type = -1,
798 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800799 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800800 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700801
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800802 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800803 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800804 .name = "Lifeview FlyVideo 98 LR50",
805 .video_inputs = 4,
806 .audio_inputs = 1,
807 .tuner = 0,
808 .svhs = 2,
809 .gpiomask = 0x1800, /* 0x8dfe00 */
810 .muxsel = { 2, 3, 1, 1},
811 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
812 .pll = PLL_28,
813 .tuner_type = -1,
814 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800815 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800816 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800817 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800818 .name = "Formac iProTV, Formac ProTV I (bt848)",
819 .video_inputs = 4,
820 .audio_inputs = 1,
821 .tuner = 0,
822 .svhs = 3,
823 .gpiomask = 1,
824 .muxsel = { 2, 3, 1, 1},
825 .audiomux = { 1, 0, 0, 0, 0 },
826 .pll = PLL_28,
827 .tuner_type = TUNER_PHILIPS_PAL,
828 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800829 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800830 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800832 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800833 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800834 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
835 .video_inputs = 4,
836 .audio_inputs = 0,
837 .tuner = -1,
838 .svhs = 2,
839 .gpiomask = 0,
840 .muxsel = { 2, 3, 1, 1},
841 .audiomux = { 0 },
842 .needs_tvaudio = 0,
843 .tuner_type = 4,
844 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800845 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800846 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800847 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800848 .name = "Terratec TerraTValue Version Bt878",
849 .video_inputs = 3,
850 .audio_inputs = 1,
851 .tuner = 0,
852 .svhs = 2,
853 .gpiomask = 0xffff00,
854 .muxsel = { 2, 3, 1, 1},
855 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
856 .needs_tvaudio = 1,
857 .pll = PLL_28,
858 .tuner_type = TUNER_PHILIPS_PAL,
859 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800860 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800861 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800862 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800863 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
864 .video_inputs = 4,
865 .audio_inputs = 1,
866 .tuner = 0,
867 .svhs = 2,
868 .muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
869 #if 0
870 .gpiomask = 0xc33000,
871 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
872 #else
873 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
874 .gpiomask = 0xb33000,
875 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
876 #endif
877 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
878 gpio23 -- hef4052:nEnable (0x800000)
879 gpio12 -- hef4052:A1
880 gpio13 -- hef4052:A0
881 0x0000: external audio
882 0x1000: FM
883 0x2000: TV
884 0x3000: n.c.
885 Note: There exists another variant "Winfast 2000" with tv stereo !?
886 Note: eeprom only contains FF and pci subsystem id 107d:6606
887 */
888 .needs_tvaudio = 0,
889 .pll = PLL_28,
890 .has_radio = 1,
891 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
892 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800893 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800894 .audio_hook = winfast2000_audio,
895 .has_remote = 1,
896 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800897 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800898 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
899 .video_inputs = 4,
900 .audio_inputs = 3,
901 .tuner = 0,
902 .svhs = 2,
903 .gpiomask = 0x1800,
904 .muxsel = { 2, 3, 1, 1},
905 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
906 .pll = PLL_28,
907 .tuner_type = -1,
908 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800909 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800910 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800912 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800913 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800914 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
915 .video_inputs = 4,
916 .audio_inputs = 3,
917 .tuner = 0,
918 .svhs = 2,
919 .gpiomask = 0x1800,
920 .muxsel = { 2, 3, 1, 1},
921 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
922 .pll = PLL_28,
923 .tuner_type = -1,
924 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800925 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800926 .has_radio = 1,
927 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800928 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800929 .name = "Prolink PixelView PlayTV pro",
930 .video_inputs = 3,
931 .audio_inputs = 1,
932 .tuner = 0,
933 .svhs = 2,
934 .gpiomask = 0xff,
935 .muxsel = { 2, 3, 1, 1 },
936 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
937 .no_msp34xx = 1,
938 .pll = PLL_28,
939 .tuner_type = -1,
940 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800941 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800942 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800943 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800944 .name = "Askey CPH06X TView99",
945 .video_inputs = 4,
946 .audio_inputs = 1,
947 .tuner = 0,
948 .svhs = 2,
949 .gpiomask = 0x551e00,
950 .muxsel = { 2, 3, 1, 0},
951 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
952 .needs_tvaudio = 1,
953 .pll = PLL_28,
954 .tuner_type = 1,
955 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800956 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800957 .has_remote = 1,
958 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800959 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800960 .name = "Pinnacle PCTV Studio/Rave",
961 .video_inputs = 3,
962 .audio_inputs = 1,
963 .tuner = 0,
964 .svhs = 2,
965 .gpiomask = 0x03000F,
966 .muxsel = { 2, 3, 1, 1},
967 .audiomux = { 2, 0xd0001, 0, 0, 1},
968 .needs_tvaudio = 0,
969 .pll = PLL_28,
970 .tuner_type = -1,
971 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800972 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800973 },
974
975 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800976 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800977 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
978 .video_inputs = 3,
979 .audio_inputs = 1,
980 .tuner = 0,
981 .svhs = 2,
982 .gpiomask = 7,
983 .muxsel = { 2, 3, 1, 1},
984 .audiomux = { 4, 0, 2, 3, 1},
985 .no_msp34xx = 1,
986 .needs_tvaudio = 1,
987 .tuner_type = TUNER_PHILIPS_NTSC,
988 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800989 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800990 .pll = PLL_28,
991 .has_radio = 1,
992 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800993 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800994 .name = "AVerMedia TVPhone 98",
995 .video_inputs = 3,
996 .audio_inputs = 4,
997 .tuner = 0,
998 .svhs = 2,
999 .gpiomask = 15,
1000 .muxsel = { 2, 3, 1, 1},
1001 .audiomux = { 13, 4, 11, 7, 0, 0},
1002 .needs_tvaudio = 1,
1003 .pll = PLL_28,
1004 .tuner_type = -1,
1005 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001006 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001007 .has_radio = 1,
1008 .audio_hook = avermedia_tvphone_audio,
1009 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001010 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001011 .name = "ProVideo PV951", /* pic16c54 */
1012 .video_inputs = 3,
1013 .audio_inputs = 1,
1014 .tuner = 0,
1015 .svhs = 2,
1016 .gpiomask = 0,
1017 .muxsel = { 2, 3, 1, 1},
1018 .audiomux = { 0, 0, 0, 0, 0},
1019 .needs_tvaudio = 1,
1020 .no_msp34xx = 1,
1021 .pll = PLL_28,
1022 .tuner_type = 1,
1023 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001024 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001025 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001026 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001027 .name = "Little OnAir TV",
1028 .video_inputs = 3,
1029 .audio_inputs = 1,
1030 .tuner = 0,
1031 .svhs = 2,
1032 .gpiomask = 0xe00b,
1033 .muxsel = {2, 3, 1, 1},
1034 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
1035 .no_msp34xx = 1,
1036 .tuner_type = -1,
1037 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001038 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001039 },
1040
1041 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001042 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001043 .name = "Sigma TVII-FM",
1044 .video_inputs = 2,
1045 .audio_inputs = 1,
1046 .tuner = 0,
1047 .svhs = -1,
1048 .gpiomask = 3,
1049 .muxsel = {2, 3, 1, 1},
1050 .audiomux = {1, 1, 0, 2, 3},
1051 .no_msp34xx = 1,
1052 .pll = PLL_NONE,
1053 .tuner_type = -1,
1054 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001055 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001056 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001057 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001058 .name = "MATRIX-Vision MV-Delta 2",
1059 .video_inputs = 5,
1060 .audio_inputs = 1,
1061 .tuner = -1,
1062 .svhs = 3,
1063 .gpiomask = 0,
1064 .muxsel = { 2, 3, 1, 0, 0},
1065 .audiomux = {0 },
1066 .no_msp34xx = 1,
1067 .pll = PLL_28,
1068 .tuner_type = -1,
1069 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001070 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001071 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001072 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001073 .name = "Zoltrix Genie TV/FM",
1074 .video_inputs = 3,
1075 .audio_inputs = 1,
1076 .tuner = 0,
1077 .svhs = 2,
1078 .gpiomask = 0xbcf03f,
1079 .muxsel = { 2, 3, 1, 1},
1080 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
1081 .no_msp34xx = 1,
1082 .pll = PLL_28,
1083 .tuner_type = 21,
1084 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001085 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001086 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001087 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001088 .name = "Terratec TV/Radio+",
1089 .video_inputs = 3,
1090 .audio_inputs = 1,
1091 .tuner = 0,
1092 .svhs = 2,
1093 .gpiomask = 0x70000,
1094 .muxsel = { 2, 3, 1, 1},
1095 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1096 .needs_tvaudio = 1,
1097 .no_msp34xx = 1,
1098 .pll = PLL_35,
1099 .tuner_type = 1,
1100 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001101 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001102 .has_radio = 1,
1103 },
1104
1105 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001106 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001107 .name = "Askey CPH03x/ Dynalink Magic TView",
1108 .video_inputs = 3,
1109 .audio_inputs = 1,
1110 .tuner = 0,
1111 .svhs = 2,
1112 .gpiomask = 15,
1113 .muxsel = { 2, 3, 1, 1},
1114 .audiomux = {2,0,0,0,1},
1115 .needs_tvaudio = 1,
1116 .pll = PLL_28,
1117 .tuner_type = -1,
1118 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001119 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001120 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001121 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001122 .name = "IODATA GV-BCTV3/PCI",
1123 .video_inputs = 3,
1124 .audio_inputs = 1,
1125 .tuner = 0,
1126 .svhs = 2,
1127 .gpiomask = 0x010f00,
1128 .muxsel = {2, 3, 0, 0},
1129 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1130 .no_msp34xx = 1,
1131 .pll = PLL_28,
1132 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1133 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001134 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001135 .audio_hook = gvbctv3pci_audio,
1136 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001137 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001138 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1139 .video_inputs = 5,
1140 .audio_inputs = 1,
1141 .tuner = 0,
1142 .svhs = 3,
1143 .gpiomask = 0xAA0000,
1144 .muxsel = { 2,3,1,1,-1 },
1145 .digital_mode = DIGITAL_MODE_CAMERA,
1146 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1147 .no_msp34xx = 1,
1148 .pll = PLL_28,
1149 .tuner_type = TUNER_PHILIPS_PAL_I,
1150 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001151 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001152 .has_remote = 1,
1153 /* GPIO wiring: (different from Rev.4C !)
1154 GPIO17: U4.A0 (first hef4052bt)
1155 GPIO19: U4.A1
1156 GPIO20: U5.A1 (second hef4052bt)
1157 GPIO21: U4.nEN
1158 GPIO22: BT832 Reset Line
1159 GPIO23: A5,A0, U5,nEN
1160 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1161 */
1162 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001163 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001164 .name = "Eagle Wireless Capricorn2 (bt878A)",
1165 .video_inputs = 4,
1166 .audio_inputs = 1,
1167 .tuner = 0,
1168 .svhs = 2,
1169 .gpiomask = 7,
1170 .muxsel = { 2, 0, 1, 1},
1171 .audiomux = { 0, 1, 2, 3, 4},
1172 .pll = PLL_28,
1173 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1174 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001175 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001176 },
1177
1178 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001179 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001180 /* David Härdeman <david@2gen.com> */
1181 .name = "Pinnacle PCTV Studio Pro",
1182 .video_inputs = 4,
1183 .audio_inputs = 1,
1184 .tuner = 0,
1185 .svhs = 3,
1186 .gpiomask = 0x03000F,
1187 .muxsel = { 2, 3, 1, 1},
1188 .audiomux = { 1, 0xd0001, 0, 0, 10},
1189 /* sound path (5 sources):
1190 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1191 0= ext. Audio IN
1192 1= from MUX2
1193 2= Mono TV sound from Tuner
1194 3= not connected
1195 MUX2 (mask 0x30000):
1196 0,2,3= from MSP34xx
1197 1= FM stereo Radio from Tuner */
1198 .needs_tvaudio = 0,
1199 .pll = PLL_28,
1200 .tuner_type = -1,
1201 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001202 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001203 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001204 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001205 /* Claas Langbehn <claas@bigfoot.com>,
1206 Sven Grothklags <sven@upb.de> */
1207 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1208 .video_inputs = 4,
1209 .audio_inputs = 3,
1210 .tuner = 0,
1211 .svhs = 2,
1212 .gpiomask = 0x1c,
1213 .muxsel = { 2, 3, 1, 1},
1214 .audiomux = { 0, 0, 0x10, 8, 4 },
1215 .needs_tvaudio = 1,
1216 .pll = PLL_28,
1217 .tuner_type = TUNER_PHILIPS_PAL,
1218 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001219 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001220 .has_radio = 1,
1221 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001222 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001223 /* Tim Röstermundt <rosterm@uni-muenster.de>
1224 in de.comp.os.unix.linux.hardware:
1225 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1226 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1227 options tuner type=5 */
1228 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1229 .video_inputs = 4,
1230 .audio_inputs = 1,
1231 .tuner = 0,
1232 .svhs = 2,
1233 .gpiomask = 0x18e0,
1234 .muxsel = { 2, 3, 1, 1},
1235 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1236 /* For cards with tda9820/tda9821:
1237 0x0000: Tuner normal stereo
1238 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1239 0x0880: Tuner A2 stereo */
1240 .pll = PLL_28,
1241 .tuner_type = -1,
1242 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001243 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001244 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001245 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001246 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1247 old Easy TV BT848 version (model CPH031) */
1248 .name = "Askey CPH031/ BESTBUY Easy TV",
1249 .video_inputs = 4,
1250 .audio_inputs = 1,
1251 .tuner = 0,
1252 .svhs = 2,
1253 .gpiomask = 0xF,
1254 .muxsel = { 2, 3, 1, 0},
1255 .audiomux = { 2, 0, 0, 0, 10},
1256 .needs_tvaudio = 0,
1257 .pll = PLL_28,
1258 .tuner_type = TUNER_TEMIC_PAL,
1259 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001260 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001261 },
1262
1263 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001264 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001265 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1266 .name = "Lifeview FlyVideo 98FM LR50",
1267 .video_inputs = 4,
1268 .audio_inputs = 3,
1269 .tuner = 0,
1270 .svhs = 2,
1271 .gpiomask = 0x1800,
1272 .muxsel = { 2, 3, 1, 1},
1273 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1274 .pll = PLL_28,
1275 .tuner_type = 5,
1276 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001277 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001278 },
1279 /* This is the ultimate cheapo capture card
1280 * just a BT848A on a small PCB!
1281 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001282 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001283 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1284 .video_inputs = 2,
1285 .audio_inputs = 0,
1286 .tuner = -1,
1287 .svhs = 1,
1288 .gpiomask = 0,
1289 .muxsel = { 3, 1 },
1290 .audiomux = { 0 },
1291 .needs_tvaudio = 0,
1292 .no_msp34xx = 1,
1293 .pll = PLL_35,
1294 .tuner_type = -1,
1295 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001296 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001297 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001298 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001299 /* Daniel Herrington <daniel.herrington@home.com> */
1300 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1301 .video_inputs = 3,
1302 .audio_inputs = 1,
1303 .tuner = 0,
1304 .svhs = 2,
1305 .gpiomask = 0xe00,
1306 .muxsel = { 2, 3, 1, 1},
1307 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1308 .needs_tvaudio = 1,
1309 .pll = PLL_28,
1310 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1311 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001312 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001313 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001314 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001315 /* Matti Mottus <mottus@physic.ut.ee> */
1316 .name = "Askey CPH03x TV Capturer",
1317 .video_inputs = 4,
1318 .audio_inputs = 1,
1319 .tuner = 0,
1320 .svhs = 2,
1321 .gpiomask = 0x03000F,
1322 .muxsel = { 2, 3, 1, 0},
1323 .audiomux = { 2,0,0,0,1 },
1324 .pll = PLL_28,
1325 .tuner_type = 0,
1326 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001327 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001328 },
1329
1330 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001331 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001332 /* Philip Blundell <philb@gnu.org> */
1333 .name = "Modular Technology MM100PCTV",
1334 .video_inputs = 2,
1335 .audio_inputs = 2,
1336 .tuner = 0,
1337 .svhs = -1,
1338 .gpiomask = 11,
1339 .muxsel = { 2, 3, 1, 1},
1340 .audiomux = { 2, 0, 0, 1, 8},
1341 .pll = PLL_35,
1342 .tuner_type = TUNER_TEMIC_PAL,
1343 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001344 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001345 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001346 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001347 /* Adrian Cox <adrian@humboldt.co.uk */
1348 .name = "AG Electronics GMV1",
1349 .video_inputs = 2,
1350 .audio_inputs = 0,
1351 .tuner = -1,
1352 .svhs = 1,
1353 .gpiomask = 0xF,
1354 .muxsel = { 2, 2},
1355 .audiomux = { },
1356 .no_msp34xx = 1,
1357 .needs_tvaudio = 0,
1358 .pll = PLL_28,
1359 .tuner_type = -1,
1360 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001361 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001362 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001363 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001364 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1365 new Easy TV BT878 version (model CPH061)
1366 special thanks to Informatica Mieres for providing the card */
1367 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1368 .video_inputs = 3,
1369 .audio_inputs = 2,
1370 .tuner = 0,
1371 .svhs = 2,
1372 .gpiomask = 0xFF,
1373 .muxsel = { 2, 3, 1, 0},
1374 .audiomux = { 1, 0, 4, 4, 9},
1375 .needs_tvaudio = 0,
1376 .pll = PLL_28,
1377 .tuner_type = TUNER_PHILIPS_PAL,
1378 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001379 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001380 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001381 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001382 /* Lukas Gebauer <geby@volny.cz> */
1383 .name = "ATI TV-Wonder",
1384 .video_inputs = 3,
1385 .audio_inputs = 1,
1386 .tuner = 0,
1387 .svhs = 2,
1388 .gpiomask = 0xf03f,
1389 .muxsel = { 2, 3, 1, 0 },
1390 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1391 .pll = PLL_28,
1392 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1393 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001394 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001395 },
1396
1397 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001398 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001399 /* Lukas Gebauer <geby@volny.cz> */
1400 .name = "ATI TV-Wonder VE",
1401 .video_inputs = 2,
1402 .audio_inputs = 1,
1403 .tuner = 0,
1404 .svhs = -1,
1405 .gpiomask = 1,
1406 .muxsel = { 2, 3, 0, 1},
1407 .audiomux = { 0, 0, 1, 0, 0},
1408 .no_msp34xx = 1,
1409 .pll = PLL_28,
1410 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1411 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001412 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001413 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001414 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001415 /* DeeJay <deejay@westel900.net (2000S) */
1416 .name = "Lifeview FlyVideo 2000S LR90",
1417 .video_inputs = 3,
1418 .audio_inputs = 3,
1419 .tuner = 0,
1420 .svhs = 2,
1421 .gpiomask = 0x18e0,
1422 .muxsel = { 2, 3, 0, 1},
1423 /* Radio changed from 1e80 to 0x800 to make
1424 FlyVideo2000S in .hu happy (gm)*/
1425 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1426 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1427 .audio_hook = fv2000s_audio,
1428 .no_msp34xx = 1,
1429 .no_tda9875 = 1,
1430 .needs_tvaudio = 1,
1431 .pll = PLL_28,
1432 .tuner_type = 5,
1433 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001434 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001435 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001436 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001437 .name = "Terratec TValueRadio",
1438 .video_inputs = 3,
1439 .audio_inputs = 1,
1440 .tuner = 0,
1441 .svhs = 2,
1442 .gpiomask = 0xffff00,
1443 .muxsel = { 2, 3, 1, 1},
1444 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1445 .needs_tvaudio = 1,
1446 .pll = PLL_28,
1447 .tuner_type = TUNER_PHILIPS_PAL,
1448 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001449 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001450 .has_radio = 1,
1451 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001452 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001453 /* TANAKA Kei <peg00625@nifty.com> */
1454 .name = "IODATA GV-BCTV4/PCI",
1455 .video_inputs = 3,
1456 .audio_inputs = 1,
1457 .tuner = 0,
1458 .svhs = 2,
1459 .gpiomask = 0x010f00,
1460 .muxsel = {2, 3, 0, 0},
1461 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1462 .no_msp34xx = 1,
1463 .pll = PLL_28,
1464 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1465 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001466 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001467 .audio_hook = gvbctv3pci_audio,
1468 },
1469
1470 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001471 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001472 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1473 /* try "insmod msp3400 simple=0" if you have
1474 * sound problems with this card. */
1475 .video_inputs = 4,
1476 .audio_inputs = 1,
1477 .tuner = 0,
1478 .svhs = -1,
1479 .gpiomask = 0x4f8a00,
1480 /* 0x100000: 1=MSP enabled (0=disable again)
1481 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1482 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1483 /* tvtuner, radio, external,internal, mute, stereo
1484 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1485 .muxsel = { 2, 3 ,0 ,1},
1486 .tuner_type = TUNER_MT2032,
1487 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001488 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001489 .pll = PLL_28,
1490 .has_radio = 1,
1491 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001492 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001493 /* Philip Blundell <pb@nexus.co.uk> */
1494 .name = "Active Imaging AIMMS",
1495 .video_inputs = 1,
1496 .audio_inputs = 0,
1497 .tuner = -1,
1498 .tuner_type = -1,
1499 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001500 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001501 .pll = PLL_28,
1502 .muxsel = { 2 },
1503 .gpiomask = 0
1504 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001505 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001506 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1507 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1508 .video_inputs = 3,
1509 .audio_inputs = 4,
1510 .tuner = 0,
1511 .svhs = 2,
1512 .gpiomask = 15,
1513 .muxsel = { 2, 3, 1, 1},
1514 .audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
1515 .needs_tvaudio = 1,
1516 .pll = PLL_28,
1517 .tuner_type = 25,
1518 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001519 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001520 .has_remote = 1,
1521 /* GPIO wiring:
1522 GPIO0: U4.A0 (hef4052bt)
1523 GPIO1: U4.A1
1524 GPIO2: U4.A1 (second hef4052bt)
1525 GPIO3: U4.nEN, U5.A0, A5.nEN
1526 GPIO8-15: vrd866b ?
1527 */
1528 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001529 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001530 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1531 .video_inputs = 4,
1532 .audio_inputs = 0,
1533 .tuner = -1,
1534 .svhs = 2,
1535 .muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1536 .pll = PLL_28,
1537 .no_msp34xx = 1,
1538 .tuner_type = UNSET,
1539 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001540 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001541 },
1542
1543 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001544 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001545 /* Dariusz Kowalewski <darekk@automex.pl> */
1546 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1547 .video_inputs = 4,
1548 .audio_inputs = 1,
1549 .tuner = 0,
1550 .svhs = 2,
1551 .gpiomask = 0x3f,
1552 .muxsel = { 2, 3, 1, 1 },
1553 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1554 .needs_tvaudio = 1,
1555 .no_msp34xx = 1,
1556 .no_tda9875 = 1,
1557 .pll = PLL_28,
1558 .tuner_type = 5,
1559 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001560 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001561 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1562 .has_radio = 1, /* Note: not all cards have radio */
1563 .has_remote = 1,
1564 /* GPIO wiring:
1565 GPIO0: A0 hef4052
1566 GPIO1: A1 hef4052
1567 GPIO3: nEN hef4052
1568 GPIO8-15: vrd866b
1569 GPIO20,22,23: R30,R29,R28
1570 */
1571 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001572 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001573 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1574 /* you must jumper JP5 for the card to work */
1575 .name = "Sensoray 311",
1576 .video_inputs = 5,
1577 .audio_inputs = 0,
1578 .tuner = -1,
1579 .svhs = 4,
1580 .gpiomask = 0,
1581 .muxsel = { 2, 3, 1, 0, 0},
1582 .audiomux = { 0 },
1583 .needs_tvaudio = 0,
1584 .tuner_type = -1,
1585 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001586 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001587 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001588 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001589 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1590 .name = "RemoteVision MX (RV605)",
1591 .video_inputs = 16,
1592 .audio_inputs = 0,
1593 .tuner = -1,
1594 .svhs = -1,
1595 .gpiomask = 0x00,
1596 .gpiomask2 = 0x07ff,
1597 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1598 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1599 .no_msp34xx = 1,
1600 .no_tda9875 = 1,
1601 .tuner_type = -1,
1602 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001603 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001604 .muxsel_hook = rv605_muxsel,
1605 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001606 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001607 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1608 .video_inputs = 3,
1609 .audio_inputs = 2,
1610 .tuner = 0,
1611 .svhs = 2,
1612 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1613 .muxsel = { 2, 1, 1, },
1614 .audiomux = { 0, 1, 2, 2, 4 },
1615 .needs_tvaudio = 0,
1616 .tuner_type = TUNER_PHILIPS_PAL,
1617 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001618 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001619 .pll = PLL_28,
1620 .has_radio = 1,
1621 },
1622
1623 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001624 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001625 /* Masaki Suzuki <masaki@btree.org> */
1626 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1627 .video_inputs = 3,
1628 .audio_inputs = 1,
1629 .tuner = 0,
1630 .svhs = 2,
1631 .gpiomask = 0x140007,
1632 .muxsel = { 2, 3, 1, 1 },
1633 .audiomux = { 0, 1, 2, 3, 4, 0 },
1634 .tuner_type = TUNER_PHILIPS_NTSC,
1635 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001636 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001637 .audio_hook = windvr_audio,
1638 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001639 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001640 .name = "GrandTec Multi Capture Card (Bt878)",
1641 .video_inputs = 4,
1642 .audio_inputs = 0,
1643 .tuner = -1,
1644 .svhs = -1,
1645 .gpiomask = 0,
1646 .muxsel = { 2, 3, 1, 0 },
1647 .audiomux = { 0 },
1648 .needs_tvaudio = 0,
1649 .no_msp34xx = 1,
1650 .pll = PLL_28,
1651 .tuner_type = -1,
1652 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001653 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001654 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001655 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001656 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1657 .video_inputs = 4,
1658 .audio_inputs = 3,
1659 .tuner = 0,
1660 .svhs = 2,
1661 .gpiomask = 7,
1662 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1663 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1664 * This card lacks external Audio In, so we mute it on Ext. & Int.
1665 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1666 * This card lacks PCI subsystem ID, sigh.
1667 * audiomux=1: lower volume, 2+3: mute
1668 * btwincap uses 0x80000/0x80003
1669 */
1670 .needs_tvaudio = 0,
1671 .no_msp34xx = 1,
1672 .pll = PLL_28,
1673 .tuner_type = 5,
1674 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001675 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001676 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1677 radio signal strength indicators work fine. */
1678 .has_radio = 1,
1679 /* GPIO Info:
1680 GPIO0,1: HEF4052 A0,A1
1681 GPIO2: HEF4052 nENABLE
1682 GPIO3-7: n.c.
1683 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1684 GPIO14,15: ??
1685 GPIO16-21: n.c.
1686 GPIO22,23: ??
1687 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1688 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001689 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001690 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1691 .name = "DSP Design TCVIDEO",
1692 .video_inputs = 4,
1693 .svhs = -1,
1694 .muxsel = { 2, 3, 1, 0},
1695 .pll = PLL_28,
1696 .tuner_type = -1,
1697 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001698 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001699 },
1700
1701 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001702 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001703 .name = "Hauppauge WinTV PVR",
1704 .video_inputs = 4,
1705 .audio_inputs = 1,
1706 .tuner = 0,
1707 .svhs = 2,
1708 .muxsel = { 2, 0, 1, 1},
1709 .needs_tvaudio = 1,
1710 .pll = PLL_28,
1711 .tuner_type = -1,
1712 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001713 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001714
1715 .gpiomask = 7,
1716 .audiomux = {7},
1717 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001718 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001719 .name = "IODATA GV-BCTV5/PCI",
1720 .video_inputs = 3,
1721 .audio_inputs = 1,
1722 .tuner = 0,
1723 .svhs = 2,
1724 .gpiomask = 0x0f0f80,
1725 .muxsel = {2, 3, 1, 0},
1726 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1727 .no_msp34xx = 1,
1728 .pll = PLL_28,
1729 .tuner_type = TUNER_PHILIPS_NTSC_M,
1730 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001731 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001732 .audio_hook = gvbctv5pci_audio,
1733 .has_radio = 1,
1734 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001735 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001736 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1737 .video_inputs = 4, /* id-inputs-clock */
1738 .audio_inputs = 0,
1739 .tuner = -1,
1740 .svhs = 3,
1741 .muxsel = { 3, 2, 0, 1 },
1742 .pll = PLL_28,
1743 .tuner_type = -1,
1744 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001745 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001746 .no_msp34xx = 1,
1747 .no_tda9875 = 1,
1748 .no_tda7432 = 1,
1749 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001750 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001751 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1752 .video_inputs = 3,
1753 .audio_inputs = 0,
1754 .tuner = -1,
1755 .svhs = 2,
1756 .muxsel = { 2, 3, 1 },
1757 .pll = PLL_28,
1758 .tuner_type = -1,
1759 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001760 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001761 .no_msp34xx = 1,
1762 .no_tda9875 = 1,
1763 .no_tda7432 = 1,
1764 },
1765
1766 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001767 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001768 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1769 .video_inputs = 2,
1770 .audio_inputs = 0,
1771 .tuner = -1,
1772 .svhs = 1,
1773 .muxsel = { 3, 1 },
1774 .pll = PLL_28,
1775 .tuner_type = -1,
1776 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001777 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001778 .no_msp34xx = 1,
1779 .no_tda9875 = 1,
1780 .no_tda7432 = 1,
1781 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001782 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001783 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1784 .video_inputs = 1,
1785 .audio_inputs = 0,
1786 .tuner = -1,
1787 .svhs = -1,
1788 .muxsel = { 0 },
1789 .pll = PLL_28,
1790 .tuner_type = -1,
1791 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001792 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001793 .no_msp34xx = 1,
1794 .no_tda9875 = 1,
1795 .no_tda7432 = 1,
1796 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001797 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001798 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1799 .video_inputs = 2,
1800 .audio_inputs = 0,
1801 .tuner = -1,
1802 .svhs = 1,
1803 .muxsel = { 0, 1 },
1804 .pll = PLL_28,
1805 .tuner_type = -1,
1806 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001807 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001808 .no_msp34xx = 1,
1809 .no_tda9875 = 1,
1810 .no_tda7432 = 1,
1811 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001812 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001813 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1814 .video_inputs = 1,
1815 .audio_inputs = 1,
1816 .tuner = -1,
1817 .svhs = -1,
1818 .muxsel = { 0 },
1819 .pll = PLL_28,
1820 .tuner_type = UNSET,
1821 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001822 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001823 .no_msp34xx = 1,
1824 .no_tda9875 = 1,
1825 .no_tda7432 = 1,
1826 },
1827
1828 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001829 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001830 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1831 .video_inputs = 2,
1832 .audio_inputs = 1,
1833 .tuner = -1,
1834 .svhs = 1,
1835 .muxsel = { 0, 1 },
1836 .pll = PLL_28,
1837 .tuner_type = UNSET,
1838 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001839 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001840 .no_msp34xx = 1,
1841 .no_tda9875 = 1,
1842 .no_tda7432 = 1,
1843 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001844 [BTTV_BOARD_OSPREY2x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001845 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1846 .video_inputs = 2,
1847 .audio_inputs = 1,
1848 .tuner = -1,
1849 .svhs = 1,
1850 .muxsel = { 2, 3 },
1851 .pll = PLL_28,
1852 .tuner_type = UNSET,
1853 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001854 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001855 .no_msp34xx = 1,
1856 .no_tda9875 = 1,
1857 .no_tda7432 = 1,
1858 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001859 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001860 .name = "Osprey 500", /* 500 */
1861 .video_inputs = 2,
1862 .audio_inputs = 1,
1863 .tuner = -1,
1864 .svhs = 1,
1865 .muxsel = { 2, 3 },
1866 .pll = PLL_28,
1867 .tuner_type = -1,
1868 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001869 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001870 .no_msp34xx = 1,
1871 .no_tda9875 = 1,
1872 .no_tda7432 = 1,
1873 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001874 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001875 .name = "Osprey 540", /* 540 */
1876 .video_inputs = 4,
1877 .audio_inputs = 1,
1878 .tuner = -1,
1879 #if 0 /* TODO ... */
1880 .svhs = OSPREY540_SVID_ANALOG,
1881 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1882 [OSPREY540_SVID_ANALOG] = 3, },
1883 #endif
1884 .pll = PLL_28,
1885 .tuner_type = -1,
1886 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001887 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001888 .no_msp34xx = 1,
1889 .no_tda9875 = 1,
1890 .no_tda7432 = 1,
1891 #if 0 /* TODO ... */
1892 .muxsel_hook = osprey_540_muxsel,
1893 .picture_hook = osprey_540_set_picture,
1894 #endif
1895 },
1896
1897 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001898 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001899 .name = "Osprey 2000", /* 2000 */
1900 .video_inputs = 2,
1901 .audio_inputs = 1,
1902 .tuner = -1,
1903 .svhs = 1,
1904 .muxsel = { 2, 3 },
1905 .pll = PLL_28,
1906 .tuner_type = UNSET,
1907 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001908 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001909 .no_msp34xx = 1,
1910 .no_tda9875 = 1,
1911 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1912 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001913 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001914 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1915 .name = "IDS Eagle",
1916 .video_inputs = 4,
1917 .audio_inputs = 0,
1918 .tuner = -1,
1919 .tuner_type = -1,
1920 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001921 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001922 .svhs = -1,
1923 .gpiomask = 0,
1924 .muxsel = { 0, 1, 2, 3 },
1925 .muxsel_hook = eagle_muxsel,
1926 .no_msp34xx = 1,
1927 .no_tda9875 = 1,
1928 .pll = PLL_28,
1929 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001930 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001931 .name = "Pinnacle PCTV Sat",
1932 .video_inputs = 2,
1933 .audio_inputs = 0,
1934 .svhs = 1,
1935 .tuner = -1,
1936 .tuner_type = -1,
1937 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001938 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001939 .no_msp34xx = 1,
1940 .no_tda9875 = 1,
1941 .no_tda7432 = 1,
1942 .muxsel = { 3, 0, 1, 2},
1943 .pll = PLL_28,
1944 .no_gpioirq = 1,
1945 .has_dvb = 1,
1946 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001947 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001948 .name = "Formac ProTV II (bt878)",
1949 .video_inputs = 4,
1950 .audio_inputs = 1,
1951 .tuner = 0,
1952 .svhs = 3,
1953 .gpiomask = 2,
1954 /* TV, Comp1, Composite over SVID con, SVID */
1955 .muxsel = { 2, 3, 1, 1},
1956 .audiomux = { 2, 2, 0, 0, 0 },
1957 .pll = PLL_28,
1958 .has_radio = 1,
1959 .tuner_type = TUNER_PHILIPS_PAL,
1960 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001961 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001962 /* sound routing:
1963 GPIO=0x00,0x01,0x03: mute (?)
1964 0x02: both TV and radio (tuner: FM1216/I)
1965 The card has onboard audio connectors labeled "cdrom" and "board",
1966 not soldered here, though unknown wiring.
1967 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001968 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001969 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001970
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001971 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001972 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001973 .name = "MachTV",
1974 .video_inputs = 3,
1975 .audio_inputs = 1,
1976 .tuner = 0,
1977 .svhs = -1,
1978 .gpiomask = 7,
1979 .muxsel = { 2, 3, 1, 1},
1980 .audiomux = { 0, 1, 2, 3, 4},
1981 .needs_tvaudio = 1,
1982 .tuner_type = 5,
1983 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001984 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08001985 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001986 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001987 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001988 .name = "Euresys Picolo",
1989 .video_inputs = 3,
1990 .audio_inputs = 0,
1991 .tuner = -1,
1992 .svhs = 2,
1993 .gpiomask = 0,
1994 .no_msp34xx = 1,
1995 .no_tda9875 = 1,
1996 .no_tda7432 = 1,
1997 .muxsel = { 2, 0, 1},
1998 .pll = PLL_28,
1999 .tuner_type = UNSET,
2000 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002001 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002002 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002003 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002004 /* Luc Van Hoeylandt <luc@e-magic.be> */
2005 .name = "ProVideo PV150", /* 0x4f */
2006 .video_inputs = 2,
2007 .audio_inputs = 0,
2008 .tuner = -1,
2009 .svhs = -1,
2010 .gpiomask = 0,
2011 .muxsel = { 2, 3 },
2012 .audiomux = { 0 },
2013 .needs_tvaudio = 0,
2014 .no_msp34xx = 1,
2015 .pll = PLL_28,
2016 .tuner_type = UNSET,
2017 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002018 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002019 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002020 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002021 /* Hiroshi Takekawa <sian@big.or.jp> */
2022 /* This card lacks subsystem ID */
2023 .name = "AD-TVK503", /* 0x63 */
2024 .video_inputs = 4,
2025 .audio_inputs = 1,
2026 .tuner = 0,
2027 .svhs = 2,
2028 .gpiomask = 0x001e8007,
2029 .muxsel = { 2, 3, 1, 0 },
2030 /* Tuner, Radio, external, internal, off, on */
2031 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2032 .needs_tvaudio = 0,
2033 .no_msp34xx = 1,
2034 .pll = PLL_28,
2035 .tuner_type = 2,
2036 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002037 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002038 .audio_hook = adtvk503_audio,
2039 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002040
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002041 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002042 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002043 .name = "Hercules Smart TV Stereo",
2044 .video_inputs = 4,
2045 .audio_inputs = 1,
2046 .tuner = 0,
2047 .svhs = 2,
2048 .gpiomask = 0x00,
2049 .muxsel = { 2, 3, 1, 1 },
2050 .needs_tvaudio = 1,
2051 .no_msp34xx = 1,
2052 .pll = PLL_28,
2053 .tuner_type = 5,
2054 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002055 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002056 /* Notes:
2057 - card lacks subsystem ID
2058 - stereo variant w/ daughter board with tda9874a @0xb0
2059 - Audio Routing:
2060 always from tda9874 independent of GPIO (?)
2061 external line in: unknown
2062 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2063 hef4053 (instead 4052) for unknown function
2064 */
2065 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002066 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002067 .name = "Pace TV & Radio Card",
2068 .video_inputs = 4,
2069 .audio_inputs = 1,
2070 .tuner = 0,
2071 .svhs = 2,
2072 .muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
2073 .gpiomask = 0,
2074 .no_tda9875 = 1,
2075 .no_tda7432 = 1,
2076 .tuner_type = 1,
2077 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002078 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002079 .has_radio = 1,
2080 .pll = PLL_28,
2081 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2082 only internal line out: (4pin header) RGGL
2083 Radio must be decoded by msp3410d (not routed through)*/
2084 /*
2085 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2086 */
2087 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002088 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002089 /* Chris Willing <chris@vislab.usyd.edu.au> */
2090 .name = "IVC-200",
2091 .video_inputs = 1,
2092 .audio_inputs = 0,
2093 .tuner = -1,
2094 .tuner_type = -1,
2095 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002096 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002097 .svhs = -1,
2098 .gpiomask = 0xdf,
2099 .muxsel = { 2 },
2100 .pll = PLL_28,
2101 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002102 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002103 .name = "Grand X-Guard / Trust 814PCI",
2104 .video_inputs = 16,
2105 .audio_inputs = 0,
2106 .tuner = -1,
2107 .svhs = -1,
2108 .tuner_type = 4,
2109 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002110 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002111 .gpiomask2 = 0xff,
2112 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2113 .muxsel_hook = xguard_muxsel,
2114 .no_msp34xx = 1,
2115 .no_tda9875 = 1,
2116 .no_tda7432 = 1,
2117 .pll = PLL_28,
2118 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002119
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002120 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002121 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002122 .name = "Nebula Electronics DigiTV",
2123 .video_inputs = 1,
2124 .tuner = -1,
2125 .svhs = -1,
2126 .muxsel = { 2, 3, 1, 0},
2127 .no_msp34xx = 1,
2128 .no_tda9875 = 1,
2129 .no_tda7432 = 1,
2130 .pll = PLL_28,
2131 .tuner_type = -1,
2132 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002133 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002134 .has_dvb = 1,
2135 .no_gpioirq = 1,
2136 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002137 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002138 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2139 .name = "ProVideo PV143",
2140 .video_inputs = 4,
2141 .audio_inputs = 0,
2142 .tuner = -1,
2143 .svhs = -1,
2144 .gpiomask = 0,
2145 .muxsel = { 2, 3, 1, 0 },
2146 .audiomux = { 0 },
2147 .needs_tvaudio = 0,
2148 .no_msp34xx = 1,
2149 .pll = PLL_28,
2150 .tuner_type = -1,
2151 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002152 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002153 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002154 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002155 /* M.Klahr@phytec.de */
2156 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2157 .video_inputs = 4,
2158 .audio_inputs = 0,
2159 .tuner = -1, /* card has no tuner */
2160 .svhs = 3,
2161 .gpiomask = 0x00,
2162 .muxsel = { 2, 3, 1, 0},
2163 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2164 .needs_tvaudio = 1,
2165 .pll = PLL_28,
2166 .tuner_type = -1,
2167 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002168 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002169 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002170 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002171 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2172 .video_inputs = 4,
2173 .audio_inputs = 0,
2174 .tuner = -1, /* card has no tuner */
2175 .svhs = 3,
2176 .gpiomask = 0x00,
2177 .muxsel = { 2, 3, 1, 1},
2178 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2179 .needs_tvaudio = 1,
2180 .pll = PLL_28,
2181 .tuner_type = -1,
2182 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002183 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002184 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002185
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002186 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002187 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002188 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2189 .video_inputs = 10,
2190 .audio_inputs = 0,
2191 .tuner = -1, /* card has no tuner */
2192 .svhs = 9,
2193 .gpiomask = 0x00,
2194 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2195 via the upper nibble of muxsel. here: used for
2196 xternal video-mux */
2197 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2198 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2199 .needs_tvaudio = 1,
2200 .pll = PLL_28,
2201 .tuner_type = -1,
2202 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002203 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002204 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002205 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002206 .name = "PHYTEC VD-009 Combi (bt878)",
2207 .video_inputs = 10,
2208 .audio_inputs = 0,
2209 .tuner = -1, /* card has no tuner */
2210 .svhs = 9,
2211 .gpiomask = 0x00,
2212 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2213 via the upper nibble of muxsel. here: used for
2214 xternal video-mux */
2215 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2216 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2217 .needs_tvaudio = 1,
2218 .pll = PLL_28,
2219 .tuner_type = -1,
2220 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002221 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002222 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002223 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002224 .name = "IVC-100",
2225 .video_inputs = 4,
2226 .audio_inputs = 0,
2227 .tuner = -1,
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 .svhs = -1,
2232 .gpiomask = 0xdf,
2233 .muxsel = { 2, 3, 1, 0 },
2234 .pll = PLL_28,
2235 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002236 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002237 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2238 .name = "IVC-120G",
2239 .video_inputs = 16,
2240 .audio_inputs = 0, /* card has no audio */
2241 .tuner = -1, /* card has no tuner */
2242 .tuner_type = -1,
2243 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002244 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002245 .svhs = -1, /* card has no svhs */
2246 .needs_tvaudio = 0,
2247 .no_msp34xx = 1,
2248 .no_tda9875 = 1,
2249 .no_tda7432 = 1,
2250 .gpiomask = 0x00,
2251 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2252 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2253 .muxsel_hook = ivc120_muxsel,
2254 .pll = PLL_28,
2255 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002256
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002257 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002258 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002259 .name = "pcHDTV HD-2000 TV",
2260 .video_inputs = 4,
2261 .audio_inputs = 1,
2262 .tuner = 0,
2263 .svhs = 2,
2264 .muxsel = { 2, 3, 1, 0},
2265 .tuner_type = TUNER_PHILIPS_ATSC,
2266 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002267 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002268 .has_dvb = 1,
2269 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002270 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002271 .name = "Twinhan DST + clones",
2272 .no_msp34xx = 1,
2273 .no_tda9875 = 1,
2274 .no_tda7432 = 1,
2275 .tuner_type = TUNER_ABSENT,
2276 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002277 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002278 .no_video = 1,
2279 .has_dvb = 1,
2280 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002281 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002282 .name = "Winfast VC100",
2283 .video_inputs = 3,
2284 .audio_inputs = 0,
2285 .svhs = 1,
2286 .tuner = -1,
2287 .muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
2288 .no_msp34xx = 1,
2289 .no_tda9875 = 1,
2290 .no_tda7432 = 1,
2291 .tuner_type = TUNER_ABSENT,
2292 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002293 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002294 .pll = PLL_28,
2295 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002296 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002297 .name = "Teppro TEV-560/InterVision IV-560",
2298 .video_inputs = 3,
2299 .audio_inputs = 1,
2300 .tuner = 0,
2301 .svhs = 2,
2302 .gpiomask = 3,
2303 .muxsel = { 2, 3, 1, 1},
2304 .audiomux = { 1, 1, 1, 1, 0},
2305 .needs_tvaudio = 1,
2306 .tuner_type = TUNER_PHILIPS_PAL,
2307 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002308 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002309 .pll = PLL_35,
2310 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002311
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002312 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002313 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002314 .name = "SIMUS GVC1100",
2315 .video_inputs = 4,
2316 .audio_inputs = 0,
2317 .tuner = -1,
2318 .svhs = -1,
2319 .tuner_type = -1,
2320 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002321 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002322 .pll = PLL_28,
2323 .muxsel = { 2, 2, 2, 2},
2324 .gpiomask = 0x3F,
2325 .muxsel_hook = gvc1100_muxsel,
2326 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002327 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002328 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2329 .name = "NGS NGSTV+",
2330 .video_inputs = 3,
2331 .tuner = 0,
2332 .svhs = 2,
2333 .gpiomask = 0x008007,
2334 .muxsel = {2, 3, 0, 0},
2335 .audiomux = {0, 0, 0, 0, 0x000003, 0},
2336 .pll = PLL_28,
2337 .tuner_type = TUNER_PHILIPS_PAL,
2338 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002339 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002340 .has_remote = 1,
2341 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002342 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002343 /* http://linuxmedialabs.com */
2344 .name = "LMLBT4",
2345 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2346 .audio_inputs = 0,
2347 .tuner = -1,
2348 .svhs = -1,
2349 .muxsel = { 2, 3, 1, 0 },
2350 .no_msp34xx = 1,
2351 .no_tda9875 = 1,
2352 .no_tda7432 = 1,
2353 .needs_tvaudio = 0,
2354 .tuner_type = -1,
2355 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002356 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002357 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002358 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002359 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2360 .name = "Tekram M205 PRO",
2361 .video_inputs = 3,
2362 .audio_inputs = 1,
2363 .tuner = 0,
2364 .tuner_type = TUNER_PHILIPS_PAL,
2365 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002366 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002367 .svhs = 2,
2368 .needs_tvaudio = 0,
2369 .gpiomask = 0x68,
2370 .muxsel = { 2, 3, 1},
2371 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2372 .pll = PLL_28,
2373 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002374
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002375 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002376 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002377 /* Javier Cendan Ares <jcendan@lycos.es> */
2378 /* bt878 TV + FM without subsystem ID */
2379 .name = "Conceptronic CONTVFMi",
2380 .video_inputs = 3,
2381 .audio_inputs = 1,
2382 .tuner = 0,
2383 .svhs = 2,
2384 .gpiomask = 0x008007,
2385 .muxsel = { 2, 3, 1, 1 },
2386 .audiomux = { 0, 1, 2, 2, 3 },
2387 .needs_tvaudio = 0,
2388 .pll = PLL_28,
2389 .tuner_type = TUNER_PHILIPS_PAL,
2390 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002391 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002392 .has_remote = 1,
2393 .has_radio = 1,
2394 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002395 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002396 /*Eric DEBIEF <debief@telemsa.com>*/
2397 /*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 -08002398 /* 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 -08002399 /*0x79 in bttv.h*/
2400 .name = "Euresys Picolo Tetra",
2401 .video_inputs = 4,
2402 .audio_inputs = 0,
2403 .tuner = -1,
2404 .svhs = -1,
2405 .gpiomask = 0,
2406 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2407 .no_msp34xx = 1,
2408 .no_tda9875 = 1,
2409 .no_tda7432 = 1,
2410 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2411 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2412 .pll = PLL_28,
2413 .needs_tvaudio = 0,
2414 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2415 .tuner_type = -1,
2416 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002417 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002418 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002419 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002420 /* Spirit TV Tuner from http://spiritmodems.com.au */
2421 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2422 .name = "Spirit TV Tuner",
2423 .video_inputs = 3,
2424 .audio_inputs = 1,
2425 .tuner = 0,
2426 .svhs = 2,
2427 .gpiomask = 0x0000000f,
2428 .muxsel = { 2, 1, 1 },
2429 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2430 .tuner_type = TUNER_TEMIC_PAL,
2431 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002432 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002433 .no_msp34xx = 1,
2434 .no_tda9875 = 1,
2435 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002436 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002437 /* Wolfram Joost <wojo@frokaschwei.de> */
2438 .name = "AVerMedia AVerTV DVB-T 771",
2439 .video_inputs = 2,
2440 .svhs = 1,
2441 .tuner = -1,
2442 .tuner_type = TUNER_ABSENT,
2443 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002444 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002445 .muxsel = { 3 , 3 },
2446 .no_msp34xx = 1,
2447 .no_tda9875 = 1,
2448 .no_tda7432 = 1,
2449 .pll = PLL_28,
2450 .has_dvb = 1,
2451 .no_gpioirq = 1,
2452 .has_remote = 1,
2453 },
2454 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002455 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002456 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002457 /* 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 -08002458 .name = "AverMedia AverTV DVB-T 761",
2459 .video_inputs = 2,
2460 .tuner = -1,
2461 .svhs = 1,
2462 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2463 .no_msp34xx = 1,
2464 .no_tda9875 = 1,
2465 .no_tda7432 = 1,
2466 .pll = PLL_28,
2467 .tuner_type = -1,
2468 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002469 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002470 .has_dvb = 1,
2471 .no_gpioirq = 1,
2472 .has_remote = 1,
2473 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002474 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002475 /* andre.schwarz@matrix-vision.de */
2476 .name = "MATRIX Vision Sigma-SQ",
2477 .video_inputs = 16,
2478 .audio_inputs = 0,
2479 .tuner = -1,
2480 .svhs = -1,
2481 .gpiomask = 0x0,
2482 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2483 3, 3, 3, 3, 3, 3, 3, 3 },
2484 .muxsel_hook = sigmaSQ_muxsel,
2485 .audiomux = { 0 },
2486 .no_msp34xx = 1,
2487 .pll = PLL_28,
2488 .tuner_type = -1,
2489 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002490 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002491 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002492 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002493 /* andre.schwarz@matrix-vision.de */
2494 .name = "MATRIX Vision Sigma-SLC",
2495 .video_inputs = 4,
2496 .audio_inputs = 0,
2497 .tuner = -1,
2498 .svhs = -1,
2499 .gpiomask = 0x0,
2500 .muxsel = { 2, 2, 2, 2 },
2501 .muxsel_hook = sigmaSLC_muxsel,
2502 .audiomux = { 0 },
2503 .no_msp34xx = 1,
2504 .pll = PLL_28,
2505 .tuner_type = -1,
2506 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002507 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002508 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002509 /* BTTV_BOARD_APAC_VIEWCOMP */
2510 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002511 /* Attila Kondoros <attila.kondoros@chello.hu> */
2512 /* bt878 TV + FM 0x00000000 subsystem ID */
2513 .name = "APAC Viewcomp 878(AMAX)",
2514 .video_inputs = 2,
2515 .audio_inputs = 1,
2516 .tuner = 0,
2517 .svhs = -1,
2518 .gpiomask = 0xFF,
2519 .muxsel = { 2, 3, 1, 1},
2520 .audiomux = { 2, 0, 0, 0, 10},
2521 .needs_tvaudio = 0,
2522 .pll = PLL_28,
2523 .tuner_type = TUNER_PHILIPS_PAL,
2524 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002525 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002526 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2527 .has_radio = 1, /* not every card has radio */
2528 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002529
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002530 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002531 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002532 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2533 .name = "DViCO FusionHDTV DVB-T Lite",
2534 .tuner = -1,
2535 .no_msp34xx = 1,
2536 .no_tda9875 = 1,
2537 .no_tda7432 = 1,
2538 .pll = PLL_28,
2539 .no_video = 1,
2540 .has_dvb = 1,
2541 .tuner_type = -1,
2542 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002543 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002544 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002545 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002546 /* Steven <photon38@pchome.com.tw> */
2547 .name = "V-Gear MyVCD",
2548 .video_inputs = 3,
2549 .audio_inputs = 1,
2550 .tuner = 0,
2551 .svhs = 2,
2552 .gpiomask = 0x3f,
2553 .muxsel = {2, 3, 1, 0},
2554 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2555 .no_msp34xx = 1,
2556 .pll = PLL_28,
2557 .tuner_type = TUNER_PHILIPS_NTSC_M,
2558 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002559 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002560 .has_radio = 0,
2561 #if 0
2562 .has_remote = 1,
2563 #endif
2564 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002565 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002566 /* Rick C <cryptdragoon@gmail.com> */
2567 .name = "Super TV Tuner",
2568 .video_inputs = 4,
2569 .audio_inputs = 1,
2570 .tuner = 0,
2571 .svhs = 2,
2572 .muxsel = { 2, 3, 1, 0},
2573 .tuner_type = TUNER_PHILIPS_NTSC,
2574 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002575 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002576 .gpiomask = 0x008007,
2577 .audiomux = { 0, 0x000001,0,0, 0},
2578 .needs_tvaudio = 1,
2579 .has_radio = 1,
2580 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002581 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002582 /* Chris Fanning <video4linux@haydon.net> */
2583 .name = "Tibet Systems 'Progress DVR' CS16",
2584 .video_inputs = 16,
2585 .audio_inputs = 0,
2586 .tuner = -1,
2587 .svhs = -1,
2588 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2589 .pll = PLL_28,
2590 .no_msp34xx = 1,
2591 .no_tda9875 = 1,
2592 .no_tda7432 = 1,
2593 .tuner_type = -1,
2594 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002595 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002596 .muxsel_hook = tibetCS16_muxsel,
2597 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002598 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002599 /* Bill Brack <wbrack@mmm.com.hk> */
2600 /*
2601 * Note that, because of the card's wiring, the "master"
2602 * BT878A chip (i.e. the one which controls the analog switch
2603 * and must use this card type) is the 2nd one detected. The
2604 * other 3 chips should use card type 0x85, whose description
2605 * follows this one. There is a EEPROM on the card (which is
2606 * connected to the I2C of one of those other chips), but is
2607 * not currently handled. There is also a facility for a
2608 * "monitor", which is also not currently implemented.
2609 */
2610 .name = "Kodicom 4400R (master)",
2611 .video_inputs = 16,
2612 .audio_inputs = 0,
2613 .tuner = -1,
2614 .tuner_type = -1,
2615 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002616 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002617 .svhs = -1,
2618 /* GPIO bits 0-9 used for analog switch:
2619 * 00 - 03: camera selector
2620 * 04 - 06: channel (controller) selector
2621 * 07: data (1->on, 0->off)
2622 * 08: strobe
2623 * 09: reset
2624 * bit 16 is input from sync separator for the channel
2625 */
2626 .gpiomask = 0x0003ff,
2627 .no_gpioirq = 1,
2628 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2629 .pll = PLL_28,
2630 .no_msp34xx = 1,
2631 .no_tda7432 = 1,
2632 .no_tda9875 = 1,
2633 .muxsel_hook = kodicom4400r_muxsel,
2634 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002635 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002636 /* Bill Brack <wbrack@mmm.com.hk> */
2637 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2638 * one which controls the analog switch, and must use the card type)
2639 * is the 2nd one detected. The other 3 chips should use this card
2640 * type
2641 */
2642 .name = "Kodicom 4400R (slave)",
2643 .video_inputs = 16,
2644 .audio_inputs = 0,
2645 .tuner = -1,
2646 .tuner_type = -1,
2647 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002648 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002649 .svhs = -1,
2650 .gpiomask = 0x010000,
2651 .no_gpioirq = 1,
2652 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2653 .pll = PLL_28,
2654 .no_msp34xx = 1,
2655 .no_tda7432 = 1,
2656 .no_tda9875 = 1,
2657 .muxsel_hook = kodicom4400r_muxsel,
2658 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002659 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002660 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002661 /* Michael Henson <mhenson@clarityvi.com> */
2662 /* Adlink RTV24 with special unlock codes */
2663 .name = "Adlink RTV24",
2664 .video_inputs = 4,
2665 .audio_inputs = 1,
2666 .tuner = 0,
2667 .svhs = 2,
2668 .muxsel = { 2, 3, 1, 0},
2669 .tuner_type = -1,
2670 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002671 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002672 .pll = PLL_28,
2673 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002674 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002675 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002676 /* Michael Krufky <mkrufky@m1k.net> */
2677 .name = "DViCO FusionHDTV 5 Lite",
2678 .tuner = 0,
2679 .tuner_type = TUNER_LG_TDVS_H062F,
2680 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002681 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002682 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002683 .audio_inputs = 1,
2684 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002685 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002686 .gpiomask = 0x00e00007,
2687 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2688 .no_msp34xx = 1,
2689 .no_tda9875 = 1,
2690 .no_tda7432 = 1,
2691 .has_dvb = 1,
2692 },
2693 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002694 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002695 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2696 .name = "Acorp Y878F",
2697 .video_inputs = 3,
2698 .audio_inputs = 1,
2699 .tuner = 0,
2700 .svhs = 2,
2701 .gpiomask = 0x01fe00,
2702 .muxsel = { 2, 3, 1, 1},
2703 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2704 .needs_tvaudio = 1,
2705 .pll = PLL_28,
2706 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2707 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002708 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002709 .has_radio = 1,
2710 },
2711 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002712 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002713 .name = "Conceptronic CTVFMi v2",
2714 .video_inputs = 3,
2715 .audio_inputs = 1,
2716 .tuner = 0,
2717 .svhs = 2,
2718 .gpiomask = 0x001c0007,
2719 .muxsel = { 2, 3, 1, 1 },
2720 .audiomux = { 0, 1, 2, 2, 3 },
2721 .needs_tvaudio = 0,
2722 .pll = PLL_28,
2723 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2724 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002725 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002726 .has_remote = 1,
2727 #if 0
2728 .has_radio = 1,
2729 #endif
2730 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002731 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002732 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002733 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2734 .video_inputs = 5,
2735 .audio_inputs = 1,
2736 .tuner = 0,
2737 .svhs = 3,
2738 .gpiomask = 0x01fe00,
2739 .muxsel = { 2,3,1,1,-1 },
2740 .digital_mode = DIGITAL_MODE_CAMERA,
2741 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2742 .no_msp34xx = 1,
2743 .pll = PLL_28,
2744 .tuner_type = TUNER_LG_PAL_FM,
2745 .tuner_addr = ADDR_UNSET,
2746 .radio_addr = ADDR_UNSET,
2747 .has_remote = 1,
2748 },
2749 /* ---- card 0x8b ---------------------------------- */
2750 [BTTV_BOARD_PV_M4900] = {
2751 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2752 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2753 .video_inputs = 3,
2754 .audio_inputs = 1,
2755 .tuner = 0,
2756 .svhs = 2,
2757 .gpiomask = 0x3f,
2758 .muxsel = { 2, 3, 1, 1 },
2759 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2760 .no_msp34xx = 1,
2761 .pll = PLL_28,
2762 .tuner_type = TUNER_YMEC_TVF_5533MF,
2763 .tuner_addr = ADDR_UNSET,
2764 .radio_addr = ADDR_UNSET,
2765 .has_radio = 1,
2766 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002767 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002768 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002769 [BTTV_BOARD_OSPREY440] = {
2770 .name = "Osprey 440",
2771 .video_inputs = 1,
2772 .audio_inputs = 1,
2773 .tuner = -1,
2774 .svhs = 1,
2775 .muxsel = { 2 },
2776 .pll = PLL_28,
2777 .tuner_type = UNSET,
2778 .tuner_addr = ADDR_UNSET,
2779 .radio_addr = ADDR_UNSET,
2780 .no_msp34xx = 1,
2781 .no_tda9875 = 1,
2782 .no_tda7432 = 1,
2783 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002784 /* ---- card 0x8d ---------------------------------- */
2785 [BTTV_BOARD_ASOUND_SKYEYE] = {
2786 .name = "Asound Skyeye PCTV",
2787 .video_inputs = 3,
2788 .audio_inputs = 1,
2789 .tuner = 0,
2790 .svhs = 2,
2791 .gpiomask = 15,
2792 .muxsel = { 2, 3, 1, 1},
2793 .audiomux = {2,0,0,0,1},
2794 .needs_tvaudio = 1,
2795 .pll = PLL_28,
2796 .tuner_type = 2,
2797 .tuner_addr = ADDR_UNSET,
2798 .radio_addr = ADDR_UNSET,
2799 },
2800
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002801};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002802
2803static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2804
2805/* ----------------------------------------------------------------------- */
2806
2807static unsigned char eeprom_data[256];
2808
2809/*
2810 * identify card
2811 */
2812void __devinit bttv_idcard(struct bttv *btv)
2813{
2814 unsigned int gpiobits;
2815 int i,type;
2816 unsigned short tmp;
2817
2818 /* read PCI subsystem ID */
2819 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2820 btv->cardid = tmp << 16;
2821 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2822 btv->cardid |= tmp;
2823
2824 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2825 /* look for the card */
2826 for (type = -1, i = 0; cards[i].id != 0; i++)
2827 if (cards[i].id == btv->cardid)
2828 type = i;
2829
2830 if (type != -1) {
2831 /* found it */
2832 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2833 "PCI subsystem ID is %04x:%04x\n",
2834 btv->c.nr,cards[type].name,cards[type].cardnr,
2835 btv->cardid & 0xffff,
2836 (btv->cardid >> 16) & 0xffff);
2837 btv->c.type = cards[type].cardnr;
2838 } else {
2839 /* 404 */
2840 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2841 btv->c.nr, btv->cardid & 0xffff,
2842 (btv->cardid >> 16) & 0xffff);
2843 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002844 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002845 }
2846 }
2847
2848 /* let the user override the autodetected type */
2849 if (card[btv->c.nr] < bttv_num_tvcards)
2850 btv->c.type=card[btv->c.nr];
2851
2852 /* print which card config we are using */
2853 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2854 bttv_tvcards[btv->c.type].name, btv->c.type,
2855 card[btv->c.nr] < bttv_num_tvcards
2856 ? "insmod option" : "autodetected");
2857
2858 /* overwrite gpio stuff ?? */
2859 if (UNSET == audioall && UNSET == audiomux[0])
2860 return;
2861
2862 if (UNSET != audiomux[0]) {
2863 gpiobits = 0;
2864 for (i = 0; i < 5; i++) {
2865 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2866 gpiobits |= audiomux[i];
2867 }
2868 } else {
2869 gpiobits = audioall;
2870 for (i = 0; i < 5; i++) {
2871 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2872 }
2873 }
2874 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2875 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2876 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2877 for (i = 0; i < 5; i++) {
2878 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2879 }
2880 printk("\n");
2881}
2882
2883/*
2884 * (most) board specific initialisations goes here
2885 */
2886
2887/* Some Modular Technology cards have an eeprom, but no subsystem ID */
2888void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2889{
2890 int type = -1;
2891
2892 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002893 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002894 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002895 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002896 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002897 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002898
2899 if (-1 != type) {
2900 btv->c.type = type;
2901 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2902 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2903 }
2904}
2905
2906static void flyvideo_gpio(struct bttv *btv)
2907{
2908 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2909 int tuner=-1,ttype;
2910
2911 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002912 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002913 gpio = gpio_read();
2914 /* FIXME: must restore OUR_EN ??? */
2915
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002916 /* all cards provide GPIO info, some have an additional eeprom
2917 * LR50: GPIO coding can be found lower right CP1 .. CP9
2918 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2919 * GPIO14-12: n.c.
2920 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002921
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002922 * lowest 3 bytes are remote control codes (no handshake needed)
2923 * xxxFFF: No remote control chip soldered
2924 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2925 * Note: Some bits are Audio_Mask !
2926 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002927 ttype=(gpio&0x0f0000)>>16;
2928 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002929 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002930 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002931 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002932 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002933 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002934 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002935 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002936 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002937 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002938 break;
2939 default:
2940 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2941 }
2942
2943 has_remote = gpio & 0x800000;
2944 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002945 /* unknown 0x200000;
2946 * unknown2 0x100000; */
2947 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002948 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002949 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2950 /*
2951 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002952
2953 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002954 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002955
2956 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2957 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2958 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2959 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2960 is_capture_only?"yes":"no ");
2961
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002962 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002963 btv->tuner_type = tuner;
2964 btv->has_radio = has_radio;
2965
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002966 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2967 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2968 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002969 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002970 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002971}
2972
2973static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2974 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2975static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2976 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2977
2978static void miro_pinnacle_gpio(struct bttv *btv)
2979{
2980 int id,msp,gpio;
2981 char *info;
2982
2983 gpio_inout(0xffffff, 0);
2984 gpio = gpio_read();
2985 id = ((gpio>>10) & 63) -1;
2986 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
2987 if (id < 32) {
2988 btv->tuner_type = miro_tunermap[id];
2989 if (0 == (gpio & 0x20)) {
2990 btv->has_radio = 1;
2991 if (!miro_fmtuner[id]) {
2992 btv->has_matchbox = 1;
2993 btv->mbox_we = (1<<6);
2994 btv->mbox_most = (1<<7);
2995 btv->mbox_clk = (1<<8);
2996 btv->mbox_data = (1<<9);
2997 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
2998 }
2999 } else {
3000 btv->has_radio = 0;
3001 }
3002 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003003 if (btv->c.type == BTTV_BOARD_MIRO)
3004 btv->c.type = BTTV_BOARD_MIROPRO;
3005 if (btv->c.type == BTTV_BOARD_PINNACLE)
3006 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003007 }
3008 printk(KERN_INFO
3009 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3010 btv->c.nr, id+1, btv->tuner_type,
3011 !btv->has_radio ? "no" :
3012 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3013 (-1 == msp) ? "no" : "yes");
3014 } else {
3015 /* new cards with microtune tuner */
3016 id = 63 - id;
3017 btv->has_radio = 0;
3018 switch (id) {
3019 case 1:
3020 info = "PAL / mono";
3021 break;
3022 case 2:
3023 info = "PAL+SECAM / stereo";
3024 btv->has_radio = 1;
3025 break;
3026 case 3:
3027 info = "NTSC / stereo";
3028 btv->has_radio = 1;
3029 break;
3030 case 4:
3031 info = "PAL+SECAM / mono";
3032 break;
3033 case 5:
3034 info = "NTSC / mono";
3035 break;
3036 case 6:
3037 info = "NTSC / stereo";
3038 break;
3039 case 7:
3040 info = "PAL / stereo";
3041 break;
3042 default:
3043 info = "oops: unknown card";
3044 break;
3045 }
3046 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003047 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003048 printk(KERN_INFO
3049 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3050 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3051 btv->tuner_type = 33;
3052 btv->pinnacle_id = id;
3053 }
3054}
3055
3056/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3057#define LM1882_SYNC_DRIVE 0x200000L
3058
3059static void init_ids_eagle(struct bttv *btv)
3060{
3061 gpio_inout(0xffffff,0xFFFF37);
3062 gpio_write(0x200020);
3063
3064 /* flash strobe inverter ?! */
3065 gpio_write(0x200024);
3066
3067 /* switch sync drive off */
3068 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3069
3070 /* set BT848 muxel to 2 */
3071 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3072}
3073
3074/* Muxsel helper for the IDS Eagle.
3075 * the eagles does not use the standard muxsel-bits but
3076 * has its own multiplexer */
3077static void eagle_muxsel(struct bttv *btv, unsigned int input)
3078{
3079 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3080 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3081
Linus Torvalds1da177e2005-04-16 15:20:36 -07003082 /* composite */
3083 /* set chroma ADC to sleep */
3084 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3085 /* set to composite video */
3086 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3087 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003088
3089 /* switch sync drive off */
3090 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3091}
3092
3093static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3094{
3095 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3096 gpio_write(masks[input%4]);
3097}
3098
3099/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3100 alarms output
3101
3102 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3103 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3104
3105 IN - sensor inputs, INx - sensor inputs and TI XORed together
3106 O1,O2,O3 - alarm outputs (relays)
3107
3108 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3109
3110*/
3111
3112static void init_lmlbt4x(struct bttv *btv)
3113{
3114 printk(KERN_DEBUG "LMLBT4x init\n");
3115 btwrite(0x000000, BT848_GPIO_REG_INP);
3116 gpio_inout(0xffffff, 0x0006C0);
3117 gpio_write(0x000000);
3118}
3119
3120static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3121{
3122 unsigned int inmux = input % 8;
3123 gpio_inout( 0xf, 0xf );
3124 gpio_bits( 0xf, inmux );
3125}
3126
3127static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3128{
3129 unsigned int inmux = input % 4;
3130 gpio_inout( 3<<9, 3<<9 );
3131 gpio_bits( 3<<9, inmux<<9 );
3132}
3133
3134/* ----------------------------------------------------------------------- */
3135
3136static void bttv_reset_audio(struct bttv *btv)
3137{
3138 /*
3139 * BT878A has a audio-reset register.
3140 * 1. This register is an audio reset function but it is in
3141 * function-0 (video capture) address space.
3142 * 2. It is enough to do this once per power-up of the card.
3143 * 3. There is a typo in the Conexant doc -- it is not at
3144 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3145 * --//Shrikumar 030609
3146 */
3147 if (btv->id != 878)
3148 return;
3149
3150 if (bttv_debug)
3151 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3152 btwrite((1<<7), 0x058);
3153 udelay(10);
3154 btwrite( 0, 0x058);
3155}
3156
3157/* initialization part one -- before registering i2c bus */
3158void __devinit bttv_init_card1(struct bttv *btv)
3159{
3160 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003161 case BTTV_BOARD_HAUPPAUGE:
3162 case BTTV_BOARD_HAUPPAUGE878:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003163 boot_msp34xx(btv,5);
3164 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003165 case BTTV_BOARD_VOODOOTV_FM:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003166 boot_msp34xx(btv,20);
3167 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003168 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003169 boot_msp34xx(btv,11);
3170 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003171 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003172 pvr_boot(btv);
3173 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003174 case BTTV_BOARD_TWINHAN_DST:
3175 case BTTV_BOARD_AVDVBT_771:
3176 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003177 btv->use_i2c_hw = 1;
3178 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003179 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003180 init_RTV24( btv );
3181 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003182
Linus Torvalds1da177e2005-04-16 15:20:36 -07003183 }
3184 if (!bttv_tvcards[btv->c.type].has_dvb)
3185 bttv_reset_audio(btv);
3186}
3187
3188/* initialization part two -- after registering i2c bus */
3189void __devinit bttv_init_card2(struct bttv *btv)
3190{
3191 int tda9887;
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08003192 int addr=ADDR_UNSET, radio_addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003193
Linus Torvalds1da177e2005-04-16 15:20:36 -07003194 btv->tuner_type = -1;
3195
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003196 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003197 bttv_readee(btv,eeprom_data,0xa0);
3198 identify_by_eeprom(btv,eeprom_data);
3199 }
3200
3201 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003202 case BTTV_BOARD_MIRO:
3203 case BTTV_BOARD_MIROPRO:
3204 case BTTV_BOARD_PINNACLE:
3205 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003206 /* miro/pinnacle */
3207 miro_pinnacle_gpio(btv);
3208 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003209 case BTTV_BOARD_FLYVIDEO_98:
3210 case BTTV_BOARD_MAXI:
3211 case BTTV_BOARD_LIFE_FLYKIT:
3212 case BTTV_BOARD_FLYVIDEO:
3213 case BTTV_BOARD_TYPHOON_TVIEW:
3214 case BTTV_BOARD_CHRONOS_VS2:
3215 case BTTV_BOARD_FLYVIDEO_98FM:
3216 case BTTV_BOARD_FLYVIDEO2000:
3217 case BTTV_BOARD_FLYVIDEO98EZ:
3218 case BTTV_BOARD_CONFERENCETV:
3219 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003220 flyvideo_gpio(btv);
3221 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003222 case BTTV_BOARD_HAUPPAUGE:
3223 case BTTV_BOARD_HAUPPAUGE878:
3224 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003225 /* pick up some config infos from the eeprom */
3226 bttv_readee(btv,eeprom_data,0xa0);
3227 hauppauge_eeprom(btv);
3228 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003229 case BTTV_BOARD_AVERMEDIA98:
3230 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003231 bttv_readee(btv,eeprom_data,0xa0);
3232 avermedia_eeprom(btv);
3233 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003234 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003235 init_PXC200(btv);
3236 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003237 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003238 picolo_tetra_init(btv);
3239 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003240 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003241 btv->has_radio = 1;
3242 btv->has_matchbox = 1;
3243 btv->mbox_we = 0x20;
3244 btv->mbox_most = 0;
3245 btv->mbox_clk = 0x08;
3246 btv->mbox_data = 0x10;
3247 btv->mbox_mask = 0x38;
3248 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003249 case BTTV_BOARD_VOBIS_BOOSTAR:
3250 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003251 terratec_active_radio_upgrade(btv);
3252 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003253 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003254 if (btv->cardid == 0x3002144f) {
3255 btv->has_radio=1;
3256 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3257 }
3258 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003259 case BTTV_BOARD_STB2:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003260 if (btv->cardid == 0x3060121a) {
3261 /* Fix up entry for 3DFX VoodooTV 100,
3262 which is an OEM STB card variant. */
3263 btv->has_radio=0;
3264 btv->tuner_type=TUNER_TEMIC_NTSC;
3265 }
3266 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003267 case BTTV_BOARD_OSPREY1x0:
3268 case BTTV_BOARD_OSPREY1x0_848:
3269 case BTTV_BOARD_OSPREY101_848:
3270 case BTTV_BOARD_OSPREY1x1:
3271 case BTTV_BOARD_OSPREY1x1_SVID:
3272 case BTTV_BOARD_OSPREY2xx:
3273 case BTTV_BOARD_OSPREY2x0_SVID:
3274 case BTTV_BOARD_OSPREY2x0:
3275 case BTTV_BOARD_OSPREY500:
3276 case BTTV_BOARD_OSPREY540:
3277 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003278 bttv_readee(btv,eeprom_data,0xa0);
3279 osprey_eeprom(btv);
3280 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003281 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003282 init_ids_eagle(btv);
3283 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003284 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003285 bttv_readee(btv,eeprom_data,0xa0);
3286 modtec_eeprom(btv);
3287 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003288 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003289 init_lmlbt4x(btv);
3290 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003291 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003292 tibetCS16_init(btv);
3293 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003294 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003295 kodicom4400r_init(btv);
3296 break;
3297 }
3298
3299 /* pll configuration */
3300 if (!(btv->id==848 && btv->revision==0x11)) {
3301 /* defaults from card list */
3302 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3303 btv->pll.pll_ifreq=28636363;
3304 btv->pll.pll_crystal=BT848_IFORM_XT0;
3305 }
3306 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3307 btv->pll.pll_ifreq=35468950;
3308 btv->pll.pll_crystal=BT848_IFORM_XT1;
3309 }
3310 /* insmod options can override */
3311 switch (pll[btv->c.nr]) {
3312 case 0: /* none */
3313 btv->pll.pll_crystal = 0;
3314 btv->pll.pll_ifreq = 0;
3315 btv->pll.pll_ofreq = 0;
3316 break;
3317 case 1: /* 28 MHz */
3318 case 28:
3319 btv->pll.pll_ifreq = 28636363;
3320 btv->pll.pll_ofreq = 0;
3321 btv->pll.pll_crystal = BT848_IFORM_XT0;
3322 break;
3323 case 2: /* 35 MHz */
3324 case 35:
3325 btv->pll.pll_ifreq = 35468950;
3326 btv->pll.pll_ofreq = 0;
3327 btv->pll.pll_crystal = BT848_IFORM_XT1;
3328 break;
3329 }
3330 }
3331 btv->pll.pll_current = -1;
3332
Linus Torvalds1da177e2005-04-16 15:20:36 -07003333 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003334 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3335 addr = bttv_tvcards[btv->c.type].tuner_addr;
3336
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08003337 if (ADDR_UNSET != bttv_tvcards[btv->c.type].radio_addr)
3338 radio_addr = bttv_tvcards[btv->c.type].radio_addr;
3339
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003340 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003341 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003342 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003343 if (UNSET != tuner[btv->c.nr])
3344 btv->tuner_type = tuner[btv->c.nr];
3345 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
3346 if (btv->pinnacle_id != UNSET)
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003347 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003348 &btv->pinnacle_id);
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003349 if (btv->tuner_type != UNSET) {
3350 struct tuner_setup tun_setup;
3351
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08003352 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003353 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003354 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003355
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08003356 if (addr == radio_addr)
3357 tun_setup.mode_mask = T_RADIO;
3358
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003359 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3360 }
3361
Linus Torvalds1da177e2005-04-16 15:20:36 -07003362 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3363 if (svhs[btv->c.nr] != UNSET)
3364 btv->svhs = svhs[btv->c.nr];
3365 if (remote[btv->c.nr] != UNSET)
3366 btv->has_remote = remote[btv->c.nr];
3367
3368 if (bttv_tvcards[btv->c.type].has_radio)
3369 btv->has_radio=1;
3370 if (bttv_tvcards[btv->c.type].has_remote)
3371 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003372 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3373 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003374 if (bttv_tvcards[btv->c.type].audio_hook)
3375 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3376
3377 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3378 /* detect Bt832 chip for quartzsight digital camera */
3379 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
3380 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
3381 boot_bt832(btv);
3382 }
3383
3384 if (!autoload)
3385 return;
3386
3387 /* try to detect audio/fader chips */
3388 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3389 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
3390 request_module("msp3400");
3391
3392 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3393 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3394 request_module("msp3400");
3395
3396 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3397 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
3398 request_module("tda9875");
3399
3400 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3401 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
3402 request_module("tda7432");
3403
3404 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3405 request_module("tvaudio");
3406
3407 /* tuner modules */
3408 tda9887 = 0;
3409 if (btv->pinnacle_id != UNSET)
3410 tda9887 = 1;
3411 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3412 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
3413 tda9887 = 1;
3414 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3415 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3416 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3417 tda9887)
3418 request_module("tda9887");
3419 if (btv->tuner_type != UNSET)
3420 request_module("tuner");
3421}
3422
3423
3424/* ----------------------------------------------------------------------- */
3425
3426static void modtec_eeprom(struct bttv *btv)
3427{
3428 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3429 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3430 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3431 btv->c.nr,&eeprom_data[0x1e]);
3432 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3433 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3434 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3435 btv->c.nr,&eeprom_data[0x1e]);
3436 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3437 btv->tuner_type=TUNER_PHILIPS_NTSC;
3438 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3439 btv->c.nr,&eeprom_data[0x1e]);
3440 } else {
3441 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3442 btv->c.nr,&eeprom_data[0x1e]);
3443 }
3444}
3445
3446static void __devinit hauppauge_eeprom(struct bttv *btv)
3447{
3448 struct tveeprom tv;
3449
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003450 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003451 btv->tuner_type = tv.tuner_type;
3452 btv->has_radio = tv.has_radio;
3453}
3454
3455static int terratec_active_radio_upgrade(struct bttv *btv)
3456{
3457 int freq;
3458
3459 btv->has_radio = 1;
3460 btv->has_matchbox = 1;
3461 btv->mbox_we = 0x10;
3462 btv->mbox_most = 0x20;
3463 btv->mbox_clk = 0x08;
3464 btv->mbox_data = 0x04;
3465 btv->mbox_mask = 0x3c;
3466
3467 btv->mbox_iow = 1 << 8;
3468 btv->mbox_ior = 1 << 9;
3469 btv->mbox_csel = 1 << 10;
3470
3471 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003472 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003473 if (0x1ed8 == tea5757_read(btv)) {
3474 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3475 btv->c.nr);
3476 btv->has_radio = 1;
3477 btv->has_matchbox = 1;
3478 } else {
3479 btv->has_radio = 0;
3480 btv->has_matchbox = 0;
3481 }
3482 return 0;
3483}
3484
3485
3486/* ----------------------------------------------------------------------- */
3487
3488/*
3489 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3490 *
3491 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3492 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3493 * unpacked with unzip).
3494 */
3495#define PVR_GPIO_DELAY 10
3496
3497#define BTTV_ALT_DATA 0x000001
3498#define BTTV_ALT_DCLK 0x100000
3499#define BTTV_ALT_NCONFIG 0x800000
3500
3501static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3502{
3503 u32 n;
3504 u8 bits;
3505 int i;
3506
3507 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3508 gpio_write(0);
3509 udelay(PVR_GPIO_DELAY);
3510
3511 gpio_write(BTTV_ALT_NCONFIG);
3512 udelay(PVR_GPIO_DELAY);
3513
3514 for (n = 0; n < microlen; n++) {
3515 bits = micro[n];
3516 for ( i = 0 ; i < 8 ; i++ ) {
3517 gpio_bits(BTTV_ALT_DCLK,0);
3518 if (bits & 0x01)
3519 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3520 else
3521 gpio_bits(BTTV_ALT_DATA,0);
3522 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3523 bits >>= 1;
3524 }
3525 }
3526 gpio_bits(BTTV_ALT_DCLK,0);
3527 udelay(PVR_GPIO_DELAY);
3528
3529 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3530 for (i = 0 ; i < 30 ; i++) {
3531 gpio_bits(BTTV_ALT_DCLK,0);
3532 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3533 }
3534 gpio_bits(BTTV_ALT_DCLK,0);
3535 return 0;
3536}
3537
3538static int __devinit pvr_boot(struct bttv *btv)
3539{
3540 const struct firmware *fw_entry;
3541 int rc;
3542
3543 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3544 if (rc != 0) {
3545 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3546 btv->c.nr);
3547 return rc;
3548 }
3549 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3550 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3551 btv->c.nr, (rc < 0) ? "failed" : "ok");
3552 release_firmware(fw_entry);
3553 return rc;
3554}
3555
3556/* ----------------------------------------------------------------------- */
3557/* some osprey specific stuff */
3558
3559static void __devinit osprey_eeprom(struct bttv *btv)
3560{
3561 int i = 0;
3562 unsigned char *ee = eeprom_data;
3563 unsigned long serial = 0;
3564
3565 if (btv->c.type == 0) {
3566 /* this might be an antique... check for MMAC label in eeprom */
3567 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3568 unsigned char checksum = 0;
3569 for (i =0; i<21; i++)
3570 checksum += ee[i];
3571 if (checksum != ee[21])
3572 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003573 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003574 for (i = 12; i < 21; i++)
3575 serial *= 10, serial += ee[i] - '0';
3576 }
3577 } else {
3578 unsigned short type;
3579 int offset = 4*16;
3580
3581 for(; offset < 8*16; offset += 16) {
3582 unsigned short checksum = 0;
3583 /* verify the checksum */
3584 for(i = 0; i<14; i++) checksum += ee[i+offset];
3585 checksum = ~checksum; /* no idea why */
3586 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
3587 ((checksum & 0x0FF) == ee[offset+15])) {
3588 break;
3589 }
3590 }
3591
3592 if (offset >= 8*16)
3593 return;
3594
3595 /* found a valid descriptor */
3596 type = (ee[offset+4]<<8) | (ee[offset+5]);
3597
3598 switch(type) {
3599
3600 /* 848 based */
3601 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003602 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003603 break;
3604 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003605 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003606 break;
3607
3608 /* 878 based */
3609 case 0x0012:
3610 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003611 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003612 break;
3613 case 0x0014:
3614 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003615 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003616 break;
3617 case 0x0016:
3618 case 0x0017:
3619 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003620 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003621 break;
3622 case 0x0018:
3623 case 0x0019:
3624 case 0x001E:
3625 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003626 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003627 break;
3628 case 0x001A:
3629 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003630 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003631 break;
3632 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003633 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003634 break;
3635 case 0x0050:
3636 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003637 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003638 /* bttv_osprey_540_init(btv); */
3639 break;
3640 case 0x0060:
3641 case 0x0070:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003642 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003643 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003644 gpio_inout(0xffffff,0x000303);
3645 break;
3646 default:
3647 /* unknown...leave generic, but get serial # */
3648 break;
3649 }
3650 serial = (ee[offset+6] << 24)
3651 | (ee[offset+7] << 16)
3652 | (ee[offset+8] << 8)
3653 | (ee[offset+9]);
3654 }
3655
3656 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3657 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3658}
3659
3660/* ----------------------------------------------------------------------- */
3661/* AVermedia specific stuff, from bktr_card.c */
3662
3663static int tuner_0_table[] = {
3664 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3665 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3666 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3667 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3668 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
3669 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003670
3671static int tuner_1_table[] = {
3672 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
3673 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3674 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003675 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003676 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
3677
3678static void __devinit avermedia_eeprom(struct bttv *btv)
3679{
3680 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
3681
3682 tuner_make = (eeprom_data[0x41] & 0x7);
3683 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3684 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
3685 btv->has_remote = (eeprom_data[0x42] & 0x01);
3686
3687 if (tuner_make == 0 || tuner_make == 2)
3688 if(tuner_format <=0x0a)
3689 tuner = tuner_0_table[tuner_format];
3690 if (tuner_make == 1)
3691 if(tuner_format <=9)
3692 tuner = tuner_1_table[tuner_format];
3693
3694 if (tuner_make == 4)
3695 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003696 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003697
3698 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3699 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3700 if(tuner) {
3701 btv->tuner_type=tuner;
3702 printk("%d",tuner);
3703 } else
3704 printk("Unknown type");
3705 printk(" radio:%s remote control:%s\n",
3706 tuner_tv_fm ? "yes" : "no",
3707 btv->has_remote ? "yes" : "no");
3708}
3709
3710/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3711void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3712{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003713 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003714 if(norm==VIDEO_MODE_NTSC) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003715 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff;
3716 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003717 dprintk("bttv_tda9880_setnorm to NTSC\n");
3718 }
3719 else {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003720 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3721 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003722 dprintk("bttv_tda9880_setnorm to PAL\n");
3723 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003724 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003725 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3726 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3727}
3728
3729
3730/*
3731 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003732 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003733 *
3734 * Hauppauge: pin 5
3735 * Voodoo: pin 20
3736 */
3737static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3738{
3739 int mask = (1 << pin);
3740
3741 gpio_inout(mask,mask);
3742 gpio_bits(mask,0);
3743 udelay(2500);
3744 gpio_bits(mask,mask);
3745
3746 if (bttv_gpio)
3747 bttv_gpio_tracking(btv,"msp34xx");
3748 if (bttv_verbose)
3749 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3750 "init [%d]\n", btv->c.nr, pin);
3751}
3752
3753static void __devinit boot_bt832(struct bttv *btv)
3754{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003755}
3756
3757/* ----------------------------------------------------------------------- */
3758/* Imagenation L-Model PXC200 Framegrabber */
3759/* This is basically the same procedure as
3760 * used by Alessandro Rubini in his pxc200
3761 * driver, but using BTTV functions */
3762
3763static void __devinit init_PXC200(struct bttv *btv)
3764{
3765 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3766 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3767 0x00 };
3768 unsigned int i;
3769 int tmp;
3770 u32 val;
3771
3772 /* Initialise GPIO-connevted stuff */
3773 gpio_inout(0xffffff, (1<<13));
3774 gpio_write(0);
3775 udelay(3);
3776 gpio_write(1<<13);
3777 /* GPIO inputs are pulled up, so no need to drive
3778 * reset pin any longer */
3779 gpio_bits(0xffffff, 0);
3780 if (bttv_gpio)
3781 bttv_gpio_tracking(btv,"pxc200");
3782
3783 /* we could/should try and reset/control the AD pots? but
3784 right now we simply turned off the crushing. Without
3785 this the AGC drifts drifts
3786 remember the EN is reverse logic -->
3787 setting BT848_ADC_AGC_EN disable the AGC
3788 tboult@eecs.lehigh.edu
3789 */
3790
3791 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3792
3793 /* Initialise MAX517 DAC */
3794 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3795 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3796
3797 /* Initialise 12C508 PIC */
3798 /* The I2CWrite and I2CRead commmands are actually to the
3799 * same chips - but the R/W bit is included in the address
3800 * argument so the numbers are different */
3801
3802
3803 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3804
3805 /* First of all, enable the clock line. This is used in the PXC200-F */
3806 val = btread(BT848_GPIO_DMA_CTL);
3807 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3808 btwrite(val, BT848_GPIO_DMA_CTL);
3809
3810 /* Then, push to 0 the reset pin long enough to reset the *
3811 * device same as above for the reset line, but not the same
3812 * value sent to the GPIO-connected stuff
3813 * which one is the good one? */
3814 gpio_inout(0xffffff,(1<<2));
3815 gpio_write(0);
3816 udelay(10);
3817 gpio_write(1<<2);
3818
3819 for (i = 0; i < ARRAY_SIZE(vals); i++) {
3820 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3821 if (tmp != -1) {
3822 printk(KERN_INFO
3823 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3824 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3825 }
3826 }
3827
3828 printk(KERN_INFO "PXC200 Initialised.\n");
3829}
3830
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003831
3832
Peter Skipworth93b43f12005-06-23 22:04:45 -07003833/* ----------------------------------------------------------------------- */
3834/*
3835 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3836 * it. This apparently involves the following procedure for each 878 chip:
3837 *
3838 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3839 *
3840 * 2) write to GPIO_DATA
3841 * - 0x0E
3842 * - sleep 1ms
3843 * - 0x10 + 0x0E
3844 * - sleep 10ms
3845 * - 0x0E
3846 * read from GPIO_DATA into buf (uint_32)
3847 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3848 * error. ERROR_CPLD_Check_Failed stop.
3849 *
3850 * 3) write to GPIO_DATA
3851 * - write 0x4400 + 0x0E
3852 * - sleep 10ms
3853 * - write 0x4410 + 0x0E
3854 * - sleep 1ms
3855 * - write 0x0E
3856 * read from GPIO_DATA into buf (uint_32)
3857 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3858 * error. ERROR_CPLD_Check_Failed.
3859 */
3860/* ----------------------------------------------------------------------- */
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003861void
3862init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003863{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003864 uint32_t dataRead = 0;
3865 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003866
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003867 printk (KERN_INFO
3868 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003869 btv->c.nr);
3870
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003871 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003872
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003873 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3874 msleep (1);
3875 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3876 msleep (10);
3877 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003878
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003879 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003880
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003881 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3882 printk (KERN_INFO
3883 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3884 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003885 }
3886
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003887 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3888 msleep (10);
3889 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3890 msleep (1);
3891 btwrite (watchdog_value, BT848_GPIO_DATA);
3892 msleep (1);
3893 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003894
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003895 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3896 printk (KERN_INFO
3897 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3898 btv->c.nr, dataRead);
3899
Peter Skipworth93b43f12005-06-23 22:04:45 -07003900 return;
3901 }
3902
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003903 printk (KERN_INFO
3904 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003905}
Linus Torvalds1da177e2005-04-16 15:20:36 -07003906
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003907
3908
Linus Torvalds1da177e2005-04-16 15:20:36 -07003909/* ----------------------------------------------------------------------- */
3910/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3911/*
3912 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3913 * This code is placed under the terms of the GNU General Public License
3914 *
3915 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3916 */
3917
3918static void bus_low(struct bttv *btv, int bit)
3919{
3920 if (btv->mbox_ior) {
3921 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3922 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3923 udelay(5);
3924 }
3925
3926 gpio_bits(bit,0);
3927 udelay(5);
3928
3929 if (btv->mbox_ior) {
3930 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3931 udelay(5);
3932 }
3933}
3934
3935static void bus_high(struct bttv *btv, int bit)
3936{
3937 if (btv->mbox_ior) {
3938 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3939 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3940 udelay(5);
3941 }
3942
3943 gpio_bits(bit,bit);
3944 udelay(5);
3945
3946 if (btv->mbox_ior) {
3947 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3948 udelay(5);
3949 }
3950}
3951
3952static int bus_in(struct bttv *btv, int bit)
3953{
3954 if (btv->mbox_ior) {
3955 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3956 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3957 udelay(5);
3958
3959 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3960 udelay(5);
3961 }
3962 return gpio_read() & (bit);
3963}
3964
3965/* TEA5757 register bits */
3966#define TEA_FREQ 0:14
3967#define TEA_BUFFER 15:15
3968
3969#define TEA_SIGNAL_STRENGTH 16:17
3970
3971#define TEA_PORT1 18:18
3972#define TEA_PORT0 19:19
3973
3974#define TEA_BAND 20:21
3975#define TEA_BAND_FM 0
3976#define TEA_BAND_MW 1
3977#define TEA_BAND_LW 2
3978#define TEA_BAND_SW 3
3979
3980#define TEA_MONO 22:22
3981#define TEA_ALLOW_STEREO 0
3982#define TEA_FORCE_MONO 1
3983
3984#define TEA_SEARCH_DIRECTION 23:23
3985#define TEA_SEARCH_DOWN 0
3986#define TEA_SEARCH_UP 1
3987
3988#define TEA_STATUS 24:24
3989#define TEA_STATUS_TUNED 0
3990#define TEA_STATUS_SEARCHING 1
3991
3992/* Low-level stuff */
3993static int tea5757_read(struct bttv *btv)
3994{
3995 unsigned long timeout;
3996 int value = 0;
3997 int i;
3998
3999 /* better safe than sorry */
4000 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4001
4002 if (btv->mbox_ior) {
4003 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4004 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4005 udelay(5);
4006 }
4007
4008 if (bttv_gpio)
4009 bttv_gpio_tracking(btv,"tea5757 read");
4010
4011 bus_low(btv,btv->mbox_we);
4012 bus_low(btv,btv->mbox_clk);
4013
4014 udelay(10);
4015 timeout= jiffies + HZ;
4016
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004017 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004018 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4019 schedule();
4020 if (bus_in(btv,btv->mbox_data)) {
4021 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4022 return -1;
4023 }
4024
4025 dprintk("bttv%d: tea5757:",btv->c.nr);
4026 for(i = 0; i < 24; i++)
4027 {
4028 udelay(5);
4029 bus_high(btv,btv->mbox_clk);
4030 udelay(5);
4031 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4032 bus_low(btv,btv->mbox_clk);
4033 value <<= 1;
4034 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4035 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4036 }
4037 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4038 return value;
4039}
4040
4041static int tea5757_write(struct bttv *btv, int value)
4042{
4043 int i;
4044 int reg = value;
4045
4046 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4047
4048 if (btv->mbox_ior) {
4049 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4050 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4051 udelay(5);
4052 }
4053 if (bttv_gpio)
4054 bttv_gpio_tracking(btv,"tea5757 write");
4055
4056 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4057 bus_low(btv,btv->mbox_clk);
4058 bus_high(btv,btv->mbox_we);
4059 for(i = 0; i < 25; i++)
4060 {
4061 if (reg & 0x1000000)
4062 bus_high(btv,btv->mbox_data);
4063 else
4064 bus_low(btv,btv->mbox_data);
4065 reg <<= 1;
4066 bus_high(btv,btv->mbox_clk);
4067 udelay(10);
4068 bus_low(btv,btv->mbox_clk);
4069 udelay(10);
4070 }
4071 bus_low(btv,btv->mbox_we); /* unmute !!! */
4072 return 0;
4073}
4074
4075void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4076{
4077 dprintk("tea5757_set_freq %d\n",freq);
4078 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004079}
4080
4081
4082/* ----------------------------------------------------------------------- */
4083/* winview */
4084
4085void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4086{
4087 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4088 int bits_out, loops, vol, data;
4089
4090 if (!set) {
4091 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4092 v->flags |= VIDEO_AUDIO_VOLUME;
4093 return;
4094 }
4095
4096 /* 32 levels logarithmic */
4097 vol = 32 - ((v->volume>>11));
4098 /* units */
4099 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4100 /* tens */
4101 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4102 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4103 data = gpio_read();
4104 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4105 WINVIEW_PT2254_STROBE);
4106 for (loops = 17; loops >= 0 ; loops--) {
4107 if (bits_out & (1<<loops))
4108 data |= WINVIEW_PT2254_DATA;
4109 else
4110 data &= ~WINVIEW_PT2254_DATA;
4111 gpio_write(data);
4112 udelay(5);
4113 data |= WINVIEW_PT2254_CLK;
4114 gpio_write(data);
4115 udelay(5);
4116 data &= ~WINVIEW_PT2254_CLK;
4117 gpio_write(data);
4118 }
4119 data |= WINVIEW_PT2254_STROBE;
4120 data &= ~WINVIEW_PT2254_DATA;
4121 gpio_write(data);
4122 udelay(10);
4123 data &= ~WINVIEW_PT2254_STROBE;
4124 gpio_write(data);
4125}
4126
4127/* ----------------------------------------------------------------------- */
4128/* mono/stereo control for various cards (which don't use i2c chips but */
4129/* connect something to the GPIO pins */
4130
4131static void
4132gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4133{
4134 unsigned int con = 0;
4135
4136 if (set) {
4137 gpio_inout(0x300, 0x300);
4138 if (v->mode & VIDEO_SOUND_LANG1)
4139 con = 0x000;
4140 if (v->mode & VIDEO_SOUND_LANG2)
4141 con = 0x300;
4142 if (v->mode & VIDEO_SOUND_STEREO)
4143 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004144/* if (v->mode & VIDEO_SOUND_MONO)
4145 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004146 gpio_bits(0x300, con);
4147 } else {
4148 v->mode = VIDEO_SOUND_STEREO |
4149 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4150 }
4151}
4152
4153static void
4154gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4155{
4156 unsigned int val, con;
4157
Linus Torvalds1da177e2005-04-16 15:20:36 -07004158 if (btv->radio_user)
4159 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004160
4161 val = gpio_read();
4162 if (set) {
4163 con = 0x000;
4164 if (v->mode & VIDEO_SOUND_LANG2) {
4165 if (v->mode & VIDEO_SOUND_LANG1) {
4166 /* LANG1 + LANG2 */
4167 con = 0x100;
4168 }
4169 else {
4170 /* LANG2 */
4171 con = 0x300;
4172 }
4173 }
4174 if (con != (val & 0x300)) {
4175 gpio_bits(0x300, con);
4176 if (bttv_gpio)
4177 bttv_gpio_tracking(btv,"gvbctv5pci");
4178 }
4179 } else {
4180 switch (val & 0x70) {
4181 case 0x10:
4182 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4183 break;
4184 case 0x30:
4185 v->mode = VIDEO_SOUND_LANG2;
4186 break;
4187 case 0x50:
4188 v->mode = VIDEO_SOUND_LANG1;
4189 break;
4190 case 0x60:
4191 v->mode = VIDEO_SOUND_STEREO;
4192 break;
4193 case 0x70:
4194 v->mode = VIDEO_SOUND_MONO;
4195 break;
4196 default:
4197 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4198 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4199 }
4200 }
4201}
4202
4203/*
4204 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4205 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4206 * 0xdde enables mono and 0xccd enables sap
4207 *
4208 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4209 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4210 * input/output sound connection, so both must be set for output mode.
4211 *
4212 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4213 * handles this with a tda9840
4214 *
4215 */
4216static void
4217avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4218{
4219 int val = 0;
4220
4221 if (set) {
4222 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4223 val = 0x02;
4224 if (v->mode & VIDEO_SOUND_STEREO)
4225 val = 0x01;
4226 if (val) {
4227 gpio_bits(0x03,val);
4228 if (bttv_gpio)
4229 bttv_gpio_tracking(btv,"avermedia");
4230 }
4231 } else {
4232 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4233 VIDEO_SOUND_LANG1;
4234 return;
4235 }
4236}
4237
4238static void
4239avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4240{
4241 int val = 0;
4242
4243 if (set) {
4244 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4245 val = 0x01;
4246 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4247 val = 0x02;
4248 btaor(val, ~0x03, BT848_GPIO_DATA);
4249 if (bttv_gpio)
4250 bttv_gpio_tracking(btv,"avermedia");
4251 } else {
4252 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4253 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4254 return;
4255 }
4256}
4257
4258/* Lifetec 9415 handling */
4259static void
4260lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4261{
4262 int val = 0;
4263
4264 if (gpio_read() & 0x4000) {
4265 v->mode = VIDEO_SOUND_MONO;
4266 return;
4267 }
4268
4269 if (set) {
4270 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4271 val = 0x0080;
4272 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
4273 val = 0x0880;
4274 if ((v->mode & VIDEO_SOUND_LANG1) ||
4275 (v->mode & VIDEO_SOUND_MONO))
4276 val = 0;
4277 gpio_bits(0x0880, val);
4278 if (bttv_gpio)
4279 bttv_gpio_tracking(btv,"lt9415");
4280 } else {
4281 /* autodetect doesn't work with this card :-( */
4282 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4283 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4284 return;
4285 }
4286}
4287
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004288/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004289static void
4290terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4291{
4292 unsigned int con = 0;
4293
4294 if (set) {
4295 gpio_inout(0x180000,0x180000);
4296 if (v->mode & VIDEO_SOUND_LANG2)
4297 con = 0x080000;
4298 if (v->mode & VIDEO_SOUND_STEREO)
4299 con = 0x180000;
4300 gpio_bits(0x180000, con);
4301 if (bttv_gpio)
4302 bttv_gpio_tracking(btv,"terratv");
4303 } else {
4304 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4305 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4306 }
4307}
4308
4309static void
4310winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4311{
4312 unsigned long val = 0;
4313
4314 if (set) {
4315 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4316 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4317 val = 0x420000;
4318 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4319 val = 0x420000;
4320 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4321 val = 0x410000;
4322 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4323 val = 0x020000;
4324 if (val) {
4325 gpio_bits(0x430000, val);
4326 if (bttv_gpio)
4327 bttv_gpio_tracking(btv,"winfast2000");
4328 }
4329 } else {
4330 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4331 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4332 }
4333}
4334
4335/*
4336 * Dariusz Kowalewski <darekk@automex.pl>
4337 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4338 * revision 9B has on-board TDA9874A sound decoder).
4339 *
4340 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4341 * will mute this cards.
4342 */
4343static void
4344pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4345{
4346 unsigned int val = 0;
4347
Linus Torvalds1da177e2005-04-16 15:20:36 -07004348 if (btv->radio_user)
4349 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004350
4351 if (set) {
4352 if (v->mode & VIDEO_SOUND_MONO) {
4353 val = 0x01;
4354 }
4355 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4356 || (v->mode & VIDEO_SOUND_STEREO)) {
4357 val = 0x02;
4358 }
4359 if (val) {
4360 gpio_bits(0x03,val);
4361 if (bttv_gpio)
4362 bttv_gpio_tracking(btv,"pvbt878p9b");
4363 }
4364 } else {
4365 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4366 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4367 }
4368}
4369
4370/*
4371 * Dariusz Kowalewski <darekk@automex.pl>
4372 * sound control for FlyVideo 2000S (with tda9874 decoder)
4373 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4374 */
4375static void
4376fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4377{
4378 unsigned int val = 0xffff;
4379
Linus Torvalds1da177e2005-04-16 15:20:36 -07004380 if (btv->radio_user)
4381 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004382 if (set) {
4383 if (v->mode & VIDEO_SOUND_MONO) {
4384 val = 0x0000;
4385 }
4386 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4387 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004388 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004389 }
4390 if (val != 0xffff) {
4391 gpio_bits(0x1800, val);
4392 if (bttv_gpio)
4393 bttv_gpio_tracking(btv,"fv2000s");
4394 }
4395 } else {
4396 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4397 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4398 }
4399}
4400
4401/*
4402 * sound control for Canopus WinDVR PCI
4403 * Masaki Suzuki <masaki@btree.org>
4404 */
4405static void
4406windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4407{
4408 unsigned long val = 0;
4409
4410 if (set) {
4411 if (v->mode & VIDEO_SOUND_MONO)
4412 val = 0x040000;
4413 if (v->mode & VIDEO_SOUND_LANG1)
4414 val = 0;
4415 if (v->mode & VIDEO_SOUND_LANG2)
4416 val = 0x100000;
4417 if (v->mode & VIDEO_SOUND_STEREO)
4418 val = 0;
4419 if (val) {
4420 gpio_bits(0x140000, val);
4421 if (bttv_gpio)
4422 bttv_gpio_tracking(btv,"windvr");
4423 }
4424 } else {
4425 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4426 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4427 }
4428}
4429
4430/*
4431 * sound control for AD-TVK503
4432 * Hiroshi Takekawa <sian@big.or.jp>
4433 */
4434static void
4435adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4436{
4437 unsigned int con = 0xffffff;
4438
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004439 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004440
4441 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004442 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004443 if (v->mode & VIDEO_SOUND_LANG1)
4444 con = 0x00000000;
4445 if (v->mode & VIDEO_SOUND_LANG2)
4446 con = 0x00180000;
4447 if (v->mode & VIDEO_SOUND_STEREO)
4448 con = 0x00000000;
4449 if (v->mode & VIDEO_SOUND_MONO)
4450 con = 0x00060000;
4451 if (con != 0xffffff) {
4452 gpio_bits(0x1e0000,con);
4453 if (bttv_gpio)
4454 bttv_gpio_tracking(btv, "adtvk503");
4455 }
4456 } else {
4457 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4458 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4459 }
4460}
4461
4462/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4463 *
4464 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4465 * switch instead (CD22M3494E). This IC can have multiple active connections
4466 * between Xn (input) and Yn (output) pins. We need to clear any existing
4467 * connection prior to establish a new one, pulsing the STROBE pin.
4468 *
4469 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4470 * GPIO pins are wired as:
4471 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4472 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4473 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4474 * GPIO[8] - - P3[5] (microcontroler)
4475 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4476 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4477 * GPINTR - - P3[4] (microcontroler)
4478 *
4479 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4480 * configuration either directly (as we are doing) or using the microcontroler
4481 * which is also wired to I2C interface. I have no further info on the
4482 * microcontroler features, one would need to disassembly the firmware.
4483 * note: the vendor refused to give any information on this product, all
4484 * that stuff was found using a multimeter! :)
4485 */
4486static void rv605_muxsel(struct bttv *btv, unsigned int input)
4487{
4488 /* reset all conections */
4489 gpio_bits(0x200,0x200);
4490 mdelay(1);
4491 gpio_bits(0x200,0x000);
4492 mdelay(1);
4493
4494 /* create a new conection */
4495 gpio_bits(0x480,0x080);
4496 gpio_bits(0x480,0x480);
4497 mdelay(1);
4498 gpio_bits(0x480,0x080);
4499 mdelay(1);
4500}
4501
4502/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4503 *
4504 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4505 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4506 * chips, ten eight input analog multiplexors, a not chip and a few
4507 * other components.
4508 *
4509 * 16 inputs on a secondary bracket are provided and can be selected
4510 * from each of the four capture chips. Two of the eight input
4511 * multiplexors are used to select from any of the 16 input signals.
4512 *
4513 * Unsupported hardware capabilities:
4514 * . A video output monitor on the secondary bracket can be selected from
4515 * one of the 878A chips.
4516 * . Another passthrough but I haven't spent any time investigating it.
4517 * . Digital I/O (logic level connected to GPIO) is available from an
4518 * onboard header.
4519 *
4520 * The on chip input mux should always be set to 2.
4521 * GPIO[16:19] - Video input selection
4522 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4523 * GPIO[?:?] - Digital I/O.
4524 *
4525 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4526 * determined what function (if any) it provides. With the microcontroller
4527 * and sync seperator chips a guess is that it might have to do with video
4528 * switching and maybe some digital I/O.
4529 */
4530static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4531{
4532 /* video mux */
4533 gpio_bits(0x0f0000, input << 16);
4534}
4535
4536static void tibetCS16_init(struct bttv *btv)
4537{
4538 /* enable gpio bits, mask obtained via btSpy */
4539 gpio_inout(0xffffff, 0x0f7fff);
4540 gpio_write(0x0f7fff);
4541}
4542
4543/*
4544 * The following routines for the Kodicom-4400r get a little mind-twisting.
4545 * There is a "master" controller and three "slave" controllers, together
4546 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4547 * The analog switch is controlled by the "master", but the detection order
4548 * of the four BT878A chips is in an order which I just don't understand.
4549 * The "master" is actually the second controller to be detected. The
4550 * logic on the board uses logical numbers for the 4 controlers, but
4551 * those numbers are different from the detection sequence. When working
4552 * with the analog switch, we need to "map" from the detection sequence
4553 * over to the board's logical controller number. This mapping sequence
4554 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4555 * unit 3, the second (which is the master) is logical unit 0, etc.
4556 * We need to maintain the status of the analog switch (which of the 16
4557 * cameras is connected to which of the 4 controllers). Rather than
4558 * add to the bttv structure for this, we use the data reserved for
4559 * the mbox (unused for this card type).
4560 */
4561
4562/*
4563 * First a routine to set the analog switch, which controls which camera
4564 * is routed to which controller. The switch comprises an X-address
4565 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4566 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4567 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4568 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4569 * specified address. The idea is to set the address and data, then bring
4570 * STROBE high, and finally bring STROBE back to low.
4571 */
4572static void kodicom4400r_write(struct bttv *btv,
4573 unsigned char xaddr,
4574 unsigned char yaddr,
4575 unsigned char data) {
4576 unsigned int udata;
4577
4578 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4579 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4580 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4581 gpio_bits(0x1ff, udata); /* strobe low */
4582}
4583
4584/*
4585 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4586 * use this routine. The routine finds the "master" for the card, maps
4587 * the controller number from the detected position over to the logical
4588 * number, writes the appropriate data to the analog switch, and housekeeps
4589 * the local copy of the switch information. The parameter 'input' is the
4590 * requested camera number (0 - 15).
4591 */
4592static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4593{
4594 char *sw_status;
4595 int xaddr, yaddr;
4596 struct bttv *mctlr;
4597 static unsigned char map[4] = {3, 0, 2, 1};
4598
4599 mctlr = master[btv->c.nr];
4600 if (mctlr == NULL) { /* ignore if master not yet detected */
4601 return;
4602 }
4603 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4604 yaddr = map[yaddr];
4605 sw_status = (char *)(&mctlr->mbox_we);
4606 xaddr = input & 0xf;
4607 /* Check if the controller/camera pair has changed, else ignore */
4608 if (sw_status[yaddr] != xaddr)
4609 {
4610 /* "open" the old switch, "close" the new one, save the new */
4611 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4612 sw_status[yaddr] = xaddr;
4613 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4614 }
4615}
4616
4617/*
4618 * During initialisation, we need to reset the analog switch. We
4619 * also preset the switch to map the 4 connectors on the card to the
4620 * *user's* (see above description of kodicom4400r_muxsel) channels
4621 * 0 through 3
4622 */
4623static void kodicom4400r_init(struct bttv *btv)
4624{
4625 char *sw_status = (char *)(&btv->mbox_we);
4626 int ix;
4627
4628 gpio_inout(0x0003ff, 0x0003ff);
4629 gpio_write(1 << 9); /* reset MUX */
4630 gpio_write(0);
4631 /* Preset camera 0 to the 4 controllers */
4632 for (ix=0; ix<4; ix++) {
4633 sw_status[ix] = ix;
4634 kodicom4400r_write(btv, ix, ix, 1);
4635 }
4636 /*
4637 * Since this is the "master", we need to set up the
4638 * other three controller chips' pointers to this structure
4639 * for later use in the muxsel routine.
4640 */
4641 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4642 return;
4643 master[btv->c.nr-1] = btv;
4644 master[btv->c.nr] = btv;
4645 master[btv->c.nr+1] = btv;
4646 master[btv->c.nr+2] = btv;
4647}
4648
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004649/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4650 * video multiplexers to provide up to 16 video inputs. These
4651 * multiplexers are controlled by the lower 8 GPIO pins of the
4652 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004653
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004654 * xxx0 is pin xxx of multiplexer U5,
4655 * yyy1 is pin yyy of multiplexer U2
4656 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004657#define ENA0 0x01
4658#define ENB0 0x02
4659#define ENA1 0x04
4660#define ENB1 0x08
4661
4662#define IN10 0x10
4663#define IN00 0x20
4664#define IN11 0x40
4665#define IN01 0x80
4666
4667static void xguard_muxsel(struct bttv *btv, unsigned int input)
4668{
4669 static const int masks[] = {
4670 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4671 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4672 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4673 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4674 };
4675 gpio_write(masks[input%16]);
4676}
4677static void picolo_tetra_init(struct bttv *btv)
4678{
4679 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4680 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4681 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4682}
4683static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4684{
4685
4686 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4687 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4688 /*GPIO[20]&GPIO[21] used to choose the right input*/
4689 btwrite (input<<20,BT848_GPIO_DATA);
4690
4691}
4692
4693/*
4694 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4695 *
4696 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4697 * swichers to provide 16 channels to MUX0. The TDA8540's have
4698 * 4 indepedant outputs and as such the IVC120G also has the
4699 * optional "Monitor Out" bus. This allows the card to be looking
4700 * at one input while the monitor is looking at another.
4701 *
4702 * Since I've couldn't be bothered figuring out how to add an
4703 * independant muxsel for the monitor bus, I've just set it to
4704 * whatever the card is looking at.
4705 *
4706 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4707 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4708 *
4709 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4710 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4711 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4712 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4713 *
4714 */
4715
4716/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4717#define I2C_TDA8540 0x90
4718#define I2C_TDA8540_ALT1 0x92
4719#define I2C_TDA8540_ALT2 0x94
4720#define I2C_TDA8540_ALT3 0x96
4721#define I2C_TDA8540_ALT4 0x98
4722#define I2C_TDA8540_ALT5 0x9a
4723#define I2C_TDA8540_ALT6 0x9c
4724
4725static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4726{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004727 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004728 int key = input % 4;
4729 int matrix = input / 4;
4730
4731 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4732 btv->c.nr, input, matrix, key);
4733
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004734 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004735 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4736 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4737 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4738 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4739 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4740 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4741 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4742 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4743
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004744 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004745 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004746 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004747 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004748 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004749 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004750 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004751 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004752 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004753
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004754 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004755 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4756}
4757
4758
4759/* PXC200 muxsel helper
4760 * luke@syseng.anu.edu.au
4761 * another transplant
4762 * from Alessandro Rubini (rubini@linux.it)
4763 *
4764 * There are 4 kinds of cards:
4765 * PXC200L which is bt848
4766 * PXC200F which is bt848 with PIC controlling mux
4767 * PXC200AL which is bt878
4768 * PXC200AF which is bt878 with PIC controlling mux
4769 */
4770#define PX_CFG_PXC200F 0x01
4771#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4772#define PX_I2C_PIC 0x0f
4773#define PX_PXC200A_CARDID 0x200a1295
4774#define PX_I2C_CMD_CFG 0x00
4775
4776static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4777{
4778 int rc;
4779 long mux;
4780 int bitmask;
4781 unsigned char buf[2];
4782
4783 /* Read PIC config to determine if this is a PXC200F */
4784 /* PX_I2C_CMD_CFG*/
4785 buf[0]=0;
4786 buf[1]=0;
4787 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4788 if (rc) {
4789 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4790 /* not PXC ? do nothing */
4791 return;
4792 }
4793
4794 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4795 if (!(rc & PX_CFG_PXC200F)) {
4796 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4797 return;
4798 }
4799
4800
4801 /* The multiplexer in the 200F is handled by the GPIO port */
4802 /* get correct mapping between inputs */
4803 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4804 /* ** not needed!? */
4805 mux = input;
4806
4807 /* make sure output pins are enabled */
4808 /* bitmask=0x30f; */
4809 bitmask=0x302;
4810 /* check whether we have a PXC200A */
4811 if (btv->cardid == PX_PXC200A_CARDID) {
4812 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4813 bitmask |= 7<<4; /* the DAC */
4814 }
4815 btwrite(bitmask, BT848_GPIO_OUT_EN);
4816
4817 bitmask = btread(BT848_GPIO_DATA);
4818 if (btv->cardid == PX_PXC200A_CARDID)
4819 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4820 else /* older device */
4821 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4822 btwrite(bitmask,BT848_GPIO_DATA);
4823
4824 /*
4825 * Was "to be safe, set the bt848 to input 0"
4826 * Actually, since it's ok at load time, better not messing
4827 * with these bits (on PXC200AF you need to set mux 2 here)
4828 *
4829 * needed because bttv-driver sets mux before calling this function
4830 */
4831 if (btv->cardid == PX_PXC200A_CARDID)
4832 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4833 else /* older device */
4834 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4835
4836 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4837}
4838
4839/* ----------------------------------------------------------------------- */
4840/* motherboard chipset specific stuff */
4841
4842void __devinit bttv_check_chipset(void)
4843{
4844 int pcipci_fail = 0;
4845 struct pci_dev *dev = NULL;
4846
4847 if (pci_pci_problems & PCIPCI_FAIL)
4848 pcipci_fail = 1;
4849 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4850 triton1 = 1;
4851 if (pci_pci_problems & PCIPCI_VSFX)
4852 vsfx = 1;
4853#ifdef PCIPCI_ALIMAGIK
4854 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4855 latency = 0x0A;
4856#endif
4857
Linus Torvalds1da177e2005-04-16 15:20:36 -07004858
4859 /* print warnings about any quirks found */
4860 if (triton1)
4861 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4862 if (vsfx)
4863 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4864 if (pcipci_fail) {
4865 printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004866 if (!no_overlay) {
4867 printk(KERN_WARNING "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004868 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004869 } else {
4870 printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004871 }
4872 }
4873 if (UNSET != latency)
4874 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08004875 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004876 PCI_DEVICE_ID_INTEL_82441, dev))) {
4877 unsigned char b;
4878 pci_read_config_byte(dev, 0x53, &b);
4879 if (bttv_debug)
4880 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4881 "bufcon=0x%02x\n",b);
4882 }
4883}
4884
4885int __devinit bttv_handle_chipset(struct bttv *btv)
4886{
4887 unsigned char command;
4888
4889 if (!triton1 && !vsfx && UNSET == latency)
4890 return 0;
4891
4892 if (bttv_verbose) {
4893 if (triton1)
4894 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4895 if (vsfx && btv->id >= 878)
4896 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4897 if (UNSET != latency)
4898 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4899 btv->c.nr,latency);
4900 }
4901
4902 if (btv->id < 878) {
4903 /* bt848 (mis)uses a bit in the irq mask for etbf */
4904 if (triton1)
4905 btv->triton1 = BT848_INT_ETBF;
4906 } else {
4907 /* bt878 has a bit in the pci config space for it */
4908 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4909 if (triton1)
4910 command |= BT878_EN_TBFX;
4911 if (vsfx)
4912 command |= BT878_EN_VSFX;
4913 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4914 }
4915 if (UNSET != latency)
4916 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4917 return 0;
4918}
4919
4920
4921/*
4922 * Local variables:
4923 * c-basic-offset: 8
4924 * End:
4925 */