]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - drivers/media/video/bt8xx/bttv-cards.c
Fix common misspellings
[mirror_ubuntu-bionic-kernel.git] / drivers / media / video / bt8xx / bttv-cards.c
CommitLineData
1da177e4 1/*
1da177e4
LT
2
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)
4ac97914 9 & Marcus Metzler (mocm@thp.uni-koeln.de)
1da177e4
LT
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
1da177e4
LT
28#include <linux/delay.h>
29#include <linux/module.h>
1da177e4
LT
30#include <linux/kmod.h>
31#include <linux/init.h>
32#include <linux/pci.h>
33#include <linux/vmalloc.h>
34#include <linux/firmware.h>
cf784d55 35#include <net/checksum.h>
1da177e4 36
c1c36f31 37#include <asm/unaligned.h>
1da177e4
LT
38#include <asm/io.h>
39
40#include "bttvp.h"
5e453dc7 41#include <media/v4l2-common.h>
8bf2f8e7 42#include <media/tvaudio.h>
c2806d03 43#include "bttv-audio-hook.h"
1da177e4
LT
44
45/* fwd decl */
46static void boot_msp34xx(struct bttv *btv, int pin);
1da177e4
LT
47static void hauppauge_eeprom(struct bttv *btv);
48static void avermedia_eeprom(struct bttv *btv);
cf784d55 49static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
1da177e4
LT
50static void modtec_eeprom(struct bttv *btv);
51static void init_PXC200(struct bttv *btv);
93b43f13 52static void init_RTV24(struct bttv *btv);
1da177e4 53
1da177e4
LT
54static void rv605_muxsel(struct bttv *btv, unsigned int input);
55static void eagle_muxsel(struct bttv *btv, unsigned int input);
56static void xguard_muxsel(struct bttv *btv, unsigned int input);
57static void ivc120_muxsel(struct bttv *btv, unsigned int input);
58static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
59
60static void PXC200_muxsel(struct bttv *btv, unsigned int input);
61
62static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
63static void picolo_tetra_init(struct bttv *btv);
64
65static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
66static void tibetCS16_init(struct bttv *btv);
67
68static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
69static void kodicom4400r_init(struct bttv *btv);
70
71static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
72static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
73
97275ac5
EHN
74static void geovision_muxsel(struct bttv *btv, unsigned int input);
75
15f8eeb2
TP
76static void phytec_muxsel(struct bttv *btv, unsigned int input);
77
0c5db425
BC
78static void gv800s_muxsel(struct bttv *btv, unsigned int input);
79static void gv800s_init(struct bttv *btv);
80
1da177e4
LT
81static int terratec_active_radio_upgrade(struct bttv *btv);
82static int tea5757_read(struct bttv *btv);
83static int tea5757_write(struct bttv *btv, int value);
84static void identify_by_eeprom(struct bttv *btv,
85 unsigned char eeprom_data[256]);
86static int __devinit pvr_boot(struct bttv *btv);
87
88/* config variables */
a5ed425c
MCC
89static unsigned int triton1;
90static unsigned int vsfx;
1da177e4 91static unsigned int latency = UNSET;
4dcef524 92int no_overlay=-1;
1da177e4
LT
93
94static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
95static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
96static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
97static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
98static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
859f0277
HV
99static unsigned int audiodev[BTTV_MAX];
100static unsigned int saa6588[BTTV_MAX];
1da177e4 101static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
859f0277 102static unsigned int autoload = UNSET;
1da177e4
LT
103static unsigned int gpiomask = UNSET;
104static unsigned int audioall = UNSET;
105static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
106
107/* insmod options */
108module_param(triton1, int, 0444);
109module_param(vsfx, int, 0444);
110module_param(no_overlay, int, 0444);
111module_param(latency, int, 0444);
112module_param(gpiomask, int, 0444);
113module_param(audioall, int, 0444);
114module_param(autoload, int, 0444);
115
116module_param_array(card, int, NULL, 0444);
117module_param_array(pll, int, NULL, 0444);
118module_param_array(tuner, int, NULL, 0444);
119module_param_array(svhs, int, NULL, 0444);
120module_param_array(remote, int, NULL, 0444);
859f0277 121module_param_array(audiodev, int, NULL, 0444);
1da177e4
LT
122module_param_array(audiomux, int, NULL, 0444);
123
124MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
125 "[enable bug compatibility for triton1 + others]");
126MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
127 "[yet another chipset flaw workaround]");
128MODULE_PARM_DESC(latency,"pci latency timer");
129MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
130MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
131MODULE_PARM_DESC(tuner,"specify installed tuner type");
859f0277
HV
132MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");
133MODULE_PARM_DESC(audiodev, "specify audio device:\n"
134 "\t\t-1 = no audio\n"
135 "\t\t 0 = autodetect (default)\n"
136 "\t\t 1 = msp3400\n"
137 "\t\t 2 = tda7432\n"
138 "\t\t 3 = tvaudio");
139MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
9050d942
MCC
140MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
141 " [some VIA/SIS chipsets are known to have problem with overlay]");
1da177e4
LT
142
143/* ----------------------------------------------------------------------- */
144/* list of card IDs for bt878+ cards */
145
146static struct CARD {
147 unsigned id;
148 int cardnr;
149 char *name;
150} cards[] __devinitdata = {
5a25e84b
MCC
151 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
155 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
156 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
157 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
158 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
f718e6e7 159 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
5a25e84b
MCC
160
161 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
162 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
163
164 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
165 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
166 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
167 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
4ac97914 169 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
5a25e84b
MCC
170 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
171 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
4ac97914 172 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
5a25e84b
MCC
173
174 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
24a70fdc 175 /* some cards ship with byteswapped IDs ... */
5a25e84b
MCC
176 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
177 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
24a70fdc 178 /* this seems to happen as well ... */
5a25e84b
MCC
179 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
180
434b2526
WB
181 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
5a25e84b
MCC
183 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
184
185 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
186 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
187 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
188 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
189 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
190 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
191 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
192
193 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
194 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
195 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
196 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
197 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
198
199 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
200 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
201 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
202 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
203
204 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
205 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
24a70fdc 206 /* clashes with FlyVideo
5a25e84b
MCC
207 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
208 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
209 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
210 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
211 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
212
213 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
214 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218
219 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
220 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
221 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
222 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
223 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
224
225 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
226 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
227 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
228 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
229
230 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
231 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
232 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
233 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
234
235 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
236 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
b7589ac4
KS
244 { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
245 { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
246 { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
247 { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
5a25e84b
MCC
248 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
261 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
263 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
ade0815c
DK
264 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
265 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
266 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
267 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
5a25e84b
MCC
268
269 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
270 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
271
272 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
273 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
274 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
275 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
276 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
277 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
278
657de3cd 279 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
5a25e84b
MCC
280 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
281
282 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
283 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
284 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
285 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
286 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
287 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
5a25e84b
MCC
288 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
289 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
4ac97914 290 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
5a25e84b
MCC
291
292 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
293 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
294
295 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
296 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
297 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
298 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
299
300 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
1da177e4 301
1ebba670
SA
302 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
303 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
304
24a70fdc 305 /* likely broken, vendor id doesn't match the other magic views ...
5a25e84b 306 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
24a70fdc 307
cd1257d8
ST
308 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
309 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
310
76ecf459
RM
311 { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},
312
24a70fdc 313 /* DVB cards (using pci function .1 for mpeg data xfer) */
5a25e84b 314 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
2af35577
MK
315 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
316 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
5a25e84b
MCC
317 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
318 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
319 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
320 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
2af35577 321 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
5a25e84b 322 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
19790db0 323 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
5a25e84b 324 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
442d15d5 325 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
27cb786f 326 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
97275ac5 327 { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
7d341a6a 328 { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
0c5db425
BC
329 { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },
330 { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
331 { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
332 { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
dceaddb9
AM
333
334 { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },
335 { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },
336 { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },
337 { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },
338 { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },
339 { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },
340 { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },
341 { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },
342
1da177e4
LT
343 { 0, -1, NULL }
344};
345
346/* ----------------------------------------------------------------------- */
347/* array with description for bt848 / bt878 tv/grabber cards */
348
349struct tvcard bttv_tvcards[] = {
2bfa1ac6 350 /* ---- card 0x00 ---------------------------------- */
5a25e84b 351 [BTTV_BOARD_UNKNOWN] = {
2bfa1ac6
MCC
352 .name = " *** UNKNOWN/GENERIC *** ",
353 .video_inputs = 4,
2bfa1ac6 354 .svhs = 2,
6f98700a 355 .muxsel = MUXSEL(2, 3, 1, 0),
8c2c0dfe 356 .tuner_type = UNSET,
2bfa1ac6
MCC
357 .tuner_addr = ADDR_UNSET,
358 },
5a25e84b 359 [BTTV_BOARD_MIRO] = {
2bfa1ac6
MCC
360 .name = "MIRO PCTV",
361 .video_inputs = 4,
4c548d4b 362 /* .audio_inputs= 1, */
2bfa1ac6
MCC
363 .svhs = 2,
364 .gpiomask = 15,
6f98700a 365 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
366 .gpiomux = { 2, 0, 0, 0 },
367 .gpiomute = 10,
2bfa1ac6 368 .needs_tvaudio = 1,
8c2c0dfe 369 .tuner_type = UNSET,
2bfa1ac6
MCC
370 .tuner_addr = ADDR_UNSET,
371 },
5a25e84b 372 [BTTV_BOARD_HAUPPAUGE] = {
2bfa1ac6
MCC
373 .name = "Hauppauge (bt848)",
374 .video_inputs = 4,
4c548d4b 375 /* .audio_inputs= 1, */
2bfa1ac6
MCC
376 .svhs = 2,
377 .gpiomask = 7,
6f98700a 378 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
379 .gpiomux = { 0, 1, 2, 3 },
380 .gpiomute = 4,
2bfa1ac6 381 .needs_tvaudio = 1,
8c2c0dfe 382 .tuner_type = UNSET,
2bfa1ac6
MCC
383 .tuner_addr = ADDR_UNSET,
384 },
5a25e84b 385 [BTTV_BOARD_STB] = {
2bfa1ac6
MCC
386 .name = "STB, Gateway P/N 6000699 (bt848)",
387 .video_inputs = 3,
4c548d4b 388 /* .audio_inputs= 1, */
2bfa1ac6
MCC
389 .svhs = 2,
390 .gpiomask = 7,
6f98700a 391 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
392 .gpiomux = { 4, 0, 2, 3 },
393 .gpiomute = 1,
2bfa1ac6
MCC
394 .no_msp34xx = 1,
395 .needs_tvaudio = 1,
396 .tuner_type = TUNER_PHILIPS_NTSC,
397 .tuner_addr = ADDR_UNSET,
398 .pll = PLL_28,
399 .has_radio = 1,
400 },
401
402 /* ---- card 0x04 ---------------------------------- */
5a25e84b 403 [BTTV_BOARD_INTEL] = {
2bfa1ac6
MCC
404 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
405 .video_inputs = 4,
4c548d4b 406 /* .audio_inputs= 0, */
2bfa1ac6
MCC
407 .svhs = 2,
408 .gpiomask = 0,
6f98700a 409 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 410 .gpiomux = { 0 },
2bfa1ac6 411 .needs_tvaudio = 0,
8c2c0dfe 412 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
413 .tuner_addr = ADDR_UNSET,
414 },
5a25e84b 415 [BTTV_BOARD_DIAMOND] = {
2bfa1ac6
MCC
416 .name = "Diamond DTV2000",
417 .video_inputs = 4,
4c548d4b 418 /* .audio_inputs= 1, */
2bfa1ac6
MCC
419 .svhs = 2,
420 .gpiomask = 3,
6f98700a 421 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
422 .gpiomux = { 0, 1, 0, 1 },
423 .gpiomute = 3,
2bfa1ac6 424 .needs_tvaudio = 1,
8c2c0dfe 425 .tuner_type = UNSET,
2bfa1ac6
MCC
426 .tuner_addr = ADDR_UNSET,
427 },
5a25e84b 428 [BTTV_BOARD_AVERMEDIA] = {
2bfa1ac6
MCC
429 .name = "AVerMedia TVPhone",
430 .video_inputs = 3,
4c548d4b 431 /* .audio_inputs= 1, */
2bfa1ac6 432 .svhs = 3,
6f98700a 433 .muxsel = MUXSEL(2, 3, 1, 1),
2bfa1ac6 434 .gpiomask = 0x0f,
8bf2f8e7 435 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
2bfa1ac6
MCC
436 /* 0x04 for some cards ?? */
437 .needs_tvaudio = 1,
8c2c0dfe 438 .tuner_type = UNSET,
2bfa1ac6 439 .tuner_addr = ADDR_UNSET,
4b9b936f 440 .audio_mode_gpio= avermedia_tvphone_audio,
2bfa1ac6
MCC
441 .has_remote = 1,
442 },
5a25e84b 443 [BTTV_BOARD_MATRIX_VISION] = {
2bfa1ac6
MCC
444 .name = "MATRIX-Vision MV-Delta",
445 .video_inputs = 5,
4c548d4b 446 /* .audio_inputs= 1, */
2bfa1ac6
MCC
447 .svhs = 3,
448 .gpiomask = 0,
6f98700a 449 .muxsel = MUXSEL(2, 3, 1, 0, 0),
8bf2f8e7 450 .gpiomux = { 0 },
2bfa1ac6 451 .needs_tvaudio = 1,
abb0362f 452 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
453 .tuner_addr = ADDR_UNSET,
454 },
455
456 /* ---- card 0x08 ---------------------------------- */
5a25e84b 457 [BTTV_BOARD_FLYVIDEO] = {
2bfa1ac6
MCC
458 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
459 .video_inputs = 4,
4c548d4b 460 /* .audio_inputs= 1, */
2bfa1ac6
MCC
461 .svhs = 2,
462 .gpiomask = 0xc00,
6f98700a 463 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
464 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
465 .gpiomute = 0xc00,
2bfa1ac6
MCC
466 .needs_tvaudio = 1,
467 .pll = PLL_28,
8c2c0dfe 468 .tuner_type = UNSET,
2bfa1ac6
MCC
469 .tuner_addr = ADDR_UNSET,
470 },
5a25e84b 471 [BTTV_BOARD_TURBOTV] = {
2bfa1ac6
MCC
472 .name = "IMS/IXmicro TurboTV",
473 .video_inputs = 3,
4c548d4b 474 /* .audio_inputs= 1, */
2bfa1ac6
MCC
475 .svhs = 2,
476 .gpiomask = 3,
6f98700a 477 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 478 .gpiomux = { 1, 1, 2, 3 },
2bfa1ac6
MCC
479 .needs_tvaudio = 0,
480 .pll = PLL_28,
481 .tuner_type = TUNER_TEMIC_PAL,
482 .tuner_addr = ADDR_UNSET,
483 },
5a25e84b 484 [BTTV_BOARD_HAUPPAUGE878] = {
2bfa1ac6
MCC
485 .name = "Hauppauge (bt878)",
486 .video_inputs = 4,
4c548d4b 487 /* .audio_inputs= 1, */
2bfa1ac6
MCC
488 .svhs = 2,
489 .gpiomask = 0x0f, /* old: 7 */
6f98700a 490 .muxsel = MUXSEL(2, 0, 1, 1),
8bf2f8e7
HV
491 .gpiomux = { 0, 1, 2, 3 },
492 .gpiomute = 4,
2bfa1ac6
MCC
493 .needs_tvaudio = 1,
494 .pll = PLL_28,
8c2c0dfe 495 .tuner_type = UNSET,
2bfa1ac6
MCC
496 .tuner_addr = ADDR_UNSET,
497 },
5a25e84b 498 [BTTV_BOARD_MIROPRO] = {
2bfa1ac6
MCC
499 .name = "MIRO PCTV pro",
500 .video_inputs = 3,
4c548d4b 501 /* .audio_inputs= 1, */
2bfa1ac6
MCC
502 .svhs = 2,
503 .gpiomask = 0x3014f,
6f98700a 504 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
505 .gpiomux = { 0x20001,0x10001, 0, 0 },
506 .gpiomute = 10,
2bfa1ac6 507 .needs_tvaudio = 1,
8c2c0dfe 508 .tuner_type = UNSET,
2bfa1ac6
MCC
509 .tuner_addr = ADDR_UNSET,
510 },
511
512 /* ---- card 0x0c ---------------------------------- */
5a25e84b 513 [BTTV_BOARD_ADSTECH_TV] = {
2bfa1ac6
MCC
514 .name = "ADS Technologies Channel Surfer TV (bt848)",
515 .video_inputs = 3,
4c548d4b 516 /* .audio_inputs= 1, */
2bfa1ac6
MCC
517 .svhs = 2,
518 .gpiomask = 15,
6f98700a 519 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 520 .gpiomux = { 13, 14, 11, 7 },
2bfa1ac6 521 .needs_tvaudio = 1,
8c2c0dfe 522 .tuner_type = UNSET,
2bfa1ac6
MCC
523 .tuner_addr = ADDR_UNSET,
524 },
5a25e84b 525 [BTTV_BOARD_AVERMEDIA98] = {
2bfa1ac6
MCC
526 .name = "AVerMedia TVCapture 98",
527 .video_inputs = 3,
4c548d4b 528 /* .audio_inputs= 4, */
2bfa1ac6
MCC
529 .svhs = 2,
530 .gpiomask = 15,
6f98700a 531 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 532 .gpiomux = { 13, 14, 11, 7 },
2bfa1ac6
MCC
533 .needs_tvaudio = 1,
534 .msp34xx_alt = 1,
535 .pll = PLL_28,
536 .tuner_type = TUNER_PHILIPS_PAL,
537 .tuner_addr = ADDR_UNSET,
4b9b936f 538 .audio_mode_gpio= avermedia_tv_stereo_audio,
a8900fc2 539 .no_gpioirq = 1,
2bfa1ac6 540 },
5a25e84b 541 [BTTV_BOARD_VHX] = {
2bfa1ac6
MCC
542 .name = "Aimslab Video Highway Xtreme (VHX)",
543 .video_inputs = 3,
4c548d4b 544 /* .audio_inputs= 1, */
2bfa1ac6
MCC
545 .svhs = 2,
546 .gpiomask = 7,
6f98700a 547 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
548 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
549 .gpiomute = 4,
2bfa1ac6
MCC
550 .needs_tvaudio = 1,
551 .pll = PLL_28,
8c2c0dfe 552 .tuner_type = UNSET,
2bfa1ac6
MCC
553 .tuner_addr = ADDR_UNSET,
554 },
5a25e84b 555 [BTTV_BOARD_ZOLTRIX] = {
2bfa1ac6
MCC
556 .name = "Zoltrix TV-Max",
557 .video_inputs = 3,
4c548d4b 558 /* .audio_inputs= 1, */
2bfa1ac6
MCC
559 .svhs = 2,
560 .gpiomask = 15,
6f98700a 561 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
562 .gpiomux = { 0, 0, 1, 0 },
563 .gpiomute = 10,
2bfa1ac6 564 .needs_tvaudio = 1,
8c2c0dfe 565 .tuner_type = UNSET,
2bfa1ac6
MCC
566 .tuner_addr = ADDR_UNSET,
567 },
568
569 /* ---- card 0x10 ---------------------------------- */
5a25e84b 570 [BTTV_BOARD_PIXVIEWPLAYTV] = {
2bfa1ac6
MCC
571 .name = "Prolink Pixelview PlayTV (bt878)",
572 .video_inputs = 3,
4c548d4b 573 /* .audio_inputs= 1, */
2bfa1ac6
MCC
574 .svhs = 2,
575 .gpiomask = 0x01fe00,
6f98700a 576 .muxsel = MUXSEL(2, 3, 1, 1),
2bfa1ac6 577 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
8bf2f8e7
HV
578 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
579 .gpiomute = 0x002000,
2bfa1ac6
MCC
580 .needs_tvaudio = 1,
581 .pll = PLL_28,
8c2c0dfe 582 .tuner_type = UNSET,
27dea3eb 583 .tuner_addr = ADDR_UNSET,
2bfa1ac6 584 },
5a25e84b 585 [BTTV_BOARD_WINVIEW_601] = {
2bfa1ac6
MCC
586 .name = "Leadtek WinView 601",
587 .video_inputs = 3,
4c548d4b 588 /* .audio_inputs= 1, */
2bfa1ac6
MCC
589 .svhs = 2,
590 .gpiomask = 0x8300f8,
6f98700a 591 .muxsel = MUXSEL(2, 3, 1, 1, 0),
8bf2f8e7
HV
592 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
593 .gpiomute = 0xcfa007,
2bfa1ac6 594 .needs_tvaudio = 1,
8c2c0dfe 595 .tuner_type = UNSET,
2bfa1ac6 596 .tuner_addr = ADDR_UNSET,
4b9b936f 597 .volume_gpio = winview_volume,
2bfa1ac6
MCC
598 .has_radio = 1,
599 },
5a25e84b 600 [BTTV_BOARD_AVEC_INTERCAP] = {
2bfa1ac6
MCC
601 .name = "AVEC Intercapture",
602 .video_inputs = 3,
4c548d4b 603 /* .audio_inputs= 2, */
2bfa1ac6
MCC
604 .svhs = 2,
605 .gpiomask = 0,
6f98700a 606 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 607 .gpiomux = { 1, 0, 0, 0 },
2bfa1ac6 608 .needs_tvaudio = 1,
8c2c0dfe 609 .tuner_type = UNSET,
2bfa1ac6
MCC
610 .tuner_addr = ADDR_UNSET,
611 },
5a25e84b 612 [BTTV_BOARD_LIFE_FLYKIT] = {
2bfa1ac6
MCC
613 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
614 .video_inputs = 4,
4c548d4b
TP
615 /* .audio_inputs= 1, */
616 .svhs = NO_SVHS,
2bfa1ac6 617 .gpiomask = 0x8dff00,
6f98700a 618 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 619 .gpiomux = { 0 },
2bfa1ac6 620 .no_msp34xx = 1,
abb0362f 621 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
622 .tuner_addr = ADDR_UNSET,
623 },
624
625 /* ---- card 0x14 ---------------------------------- */
5a25e84b 626 [BTTV_BOARD_CEI_RAFFLES] = {
2bfa1ac6
MCC
627 .name = "CEI Raffles Card",
628 .video_inputs = 3,
4c548d4b 629 /* .audio_inputs= 3, */
2bfa1ac6 630 .svhs = 2,
6f98700a 631 .muxsel = MUXSEL(2, 3, 1, 1),
8c2c0dfe 632 .tuner_type = UNSET,
2bfa1ac6
MCC
633 .tuner_addr = ADDR_UNSET,
634 },
5a25e84b 635 [BTTV_BOARD_CONFERENCETV] = {
2bfa1ac6
MCC
636 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
637 .video_inputs = 4,
4c548d4b 638 /* .audio_inputs= 2, tuner, line in */
2bfa1ac6
MCC
639 .svhs = 2,
640 .gpiomask = 0x1800,
6f98700a 641 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
642 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
643 .gpiomute = 0x1800,
2bfa1ac6
MCC
644 .pll = PLL_28,
645 .tuner_type = TUNER_PHILIPS_PAL_I,
646 .tuner_addr = ADDR_UNSET,
647 },
5a25e84b 648 [BTTV_BOARD_PHOEBE_TVMAS] = {
2bfa1ac6
MCC
649 .name = "Askey CPH050/ Phoebe Tv Master + FM",
650 .video_inputs = 3,
4c548d4b 651 /* .audio_inputs= 1, */
2bfa1ac6
MCC
652 .svhs = 2,
653 .gpiomask = 0xc00,
6f98700a 654 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
655 .gpiomux = { 0, 1, 0x800, 0x400 },
656 .gpiomute = 0xc00,
2bfa1ac6
MCC
657 .needs_tvaudio = 1,
658 .pll = PLL_28,
8c2c0dfe 659 .tuner_type = UNSET,
2bfa1ac6
MCC
660 .tuner_addr = ADDR_UNSET,
661 },
5a25e84b 662 [BTTV_BOARD_MODTEC_205] = {
2bfa1ac6
MCC
663 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
664 .video_inputs = 3,
4c548d4b
TP
665 /* .audio_inputs= 1, */
666 .svhs = NO_SVHS,
5221e21e 667 .has_dig_in = 1,
2bfa1ac6 668 .gpiomask = 7,
6f98700a 669 .muxsel = MUXSEL(2, 3, 0), /* input 2 is digital */
4c548d4b 670 /* .digital_mode= DIGITAL_MODE_CAMERA, */
8bf2f8e7 671 .gpiomux = { 0, 0, 0, 0 },
2bfa1ac6
MCC
672 .no_msp34xx = 1,
673 .pll = PLL_28,
674 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
675 .tuner_addr = ADDR_UNSET,
676 },
677
678 /* ---- card 0x18 ---------------------------------- */
5a25e84b 679 [BTTV_BOARD_MAGICTVIEW061] = {
2bfa1ac6
MCC
680 .name = "Askey CPH05X/06X (bt878) [many vendors]",
681 .video_inputs = 3,
4c548d4b 682 /* .audio_inputs= 1, */
2bfa1ac6
MCC
683 .svhs = 2,
684 .gpiomask = 0xe00,
6f98700a 685 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
686 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
687 .gpiomute = 0xc00,
2bfa1ac6
MCC
688 .needs_tvaudio = 1,
689 .pll = PLL_28,
8c2c0dfe 690 .tuner_type = UNSET,
2bfa1ac6
MCC
691 .tuner_addr = ADDR_UNSET,
692 .has_remote = 1,
693 },
5a25e84b 694 [BTTV_BOARD_VOBIS_BOOSTAR] = {
2bfa1ac6
MCC
695 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
696 .video_inputs = 3,
4c548d4b 697 /* .audio_inputs= 1, */
2bfa1ac6
MCC
698 .svhs = 2,
699 .gpiomask = 0x1f0fff,
6f98700a 700 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
701 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
702 .gpiomute = 0x40000,
2bfa1ac6
MCC
703 .needs_tvaudio = 0,
704 .tuner_type = TUNER_PHILIPS_PAL,
705 .tuner_addr = ADDR_UNSET,
4b9b936f 706 .audio_mode_gpio= terratv_audio,
2bfa1ac6 707 },
5a25e84b 708 [BTTV_BOARD_HAUPPAUG_WCAM] = {
2bfa1ac6
MCC
709 .name = "Hauppauge WinCam newer (bt878)",
710 .video_inputs = 4,
4c548d4b 711 /* .audio_inputs= 1, */
2bfa1ac6
MCC
712 .svhs = 3,
713 .gpiomask = 7,
6f98700a 714 .muxsel = MUXSEL(2, 0, 1, 1),
8bf2f8e7
HV
715 .gpiomux = { 0, 1, 2, 3 },
716 .gpiomute = 4,
2bfa1ac6 717 .needs_tvaudio = 1,
8c2c0dfe 718 .tuner_type = UNSET,
2bfa1ac6
MCC
719 .tuner_addr = ADDR_UNSET,
720 },
5a25e84b 721 [BTTV_BOARD_MAXI] = {
2bfa1ac6
MCC
722 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
723 .video_inputs = 4,
4c548d4b 724 /* .audio_inputs= 2, */
2bfa1ac6
MCC
725 .svhs = 2,
726 .gpiomask = 0x1800,
6f98700a 727 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
728 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
729 .gpiomute = 0x1800,
2bfa1ac6
MCC
730 .pll = PLL_28,
731 .tuner_type = TUNER_PHILIPS_SECAM,
732 .tuner_addr = ADDR_UNSET,
733 },
734
735 /* ---- card 0x1c ---------------------------------- */
5a25e84b 736 [BTTV_BOARD_TERRATV] = {
2bfa1ac6
MCC
737 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
738 .video_inputs = 3,
4c548d4b 739 /* .audio_inputs= 1, */
2bfa1ac6
MCC
740 .svhs = 2,
741 .gpiomask = 0x1f0fff,
6f98700a 742 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
743 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
744 .gpiomute = 0x40000,
2bfa1ac6
MCC
745 .needs_tvaudio = 0,
746 .tuner_type = TUNER_PHILIPS_PAL,
747 .tuner_addr = ADDR_UNSET,
4b9b936f 748 .audio_mode_gpio= terratv_audio,
2bfa1ac6
MCC
749 /* GPIO wiring:
750 External 20 pin connector (for Active Radio Upgrade board)
751 gpio00: i2c-sda
752 gpio01: i2c-scl
753 gpio02: om5610-data
754 gpio03: om5610-clk
755 gpio04: om5610-wre
756 gpio05: om5610-stereo
757 gpio06: rds6588-davn
758 gpio07: Pin 7 n.c.
759 gpio08: nIOW
760 gpio09+10: nIOR, nSEL ?? (bt878)
761 gpio09: nIOR (bt848)
762 gpio10: nSEL (bt848)
763 Sound Routing:
764 gpio16: u2-A0 (1st 4052bt)
765 gpio17: u2-A1
766 gpio18: u2-nEN
767 gpio19: u4-A0 (2nd 4052)
768 gpio20: u4-A1
769 u4-nEN - GND
770 Btspy:
771 00000 : Cdrom (internal audio input)
772 10000 : ext. Video audio input
773 20000 : TV Mono
774 a0000 : TV Mono/2
775 1a0000 : TV Stereo
776 30000 : Radio
777 40000 : Mute
24a70fdc 778 */
2bfa1ac6
MCC
779
780 },
5a25e84b 781 [BTTV_BOARD_PXC200] = {
2bfa1ac6
MCC
782 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
783 .name = "Imagenation PXC200",
784 .video_inputs = 5,
4c548d4b 785 /* .audio_inputs= 1, */
2bfa1ac6
MCC
786 .svhs = 1, /* was: 4 */
787 .gpiomask = 0,
6f98700a 788 .muxsel = MUXSEL(2, 3, 1, 0, 0),
8bf2f8e7 789 .gpiomux = { 0 },
2bfa1ac6 790 .needs_tvaudio = 1,
abb0362f 791 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
792 .tuner_addr = ADDR_UNSET,
793 .muxsel_hook = PXC200_muxsel,
794
795 },
5a25e84b 796 [BTTV_BOARD_FLYVIDEO_98] = {
2bfa1ac6
MCC
797 .name = "Lifeview FlyVideo 98 LR50",
798 .video_inputs = 4,
4c548d4b 799 /* .audio_inputs= 1, */
2bfa1ac6
MCC
800 .svhs = 2,
801 .gpiomask = 0x1800, /* 0x8dfe00 */
6f98700a 802 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
803 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
804 .gpiomute = 0x1800,
2bfa1ac6 805 .pll = PLL_28,
8c2c0dfe 806 .tuner_type = UNSET,
2bfa1ac6
MCC
807 .tuner_addr = ADDR_UNSET,
808 },
5a25e84b 809 [BTTV_BOARD_IPROTV] = {
2bfa1ac6
MCC
810 .name = "Formac iProTV, Formac ProTV I (bt848)",
811 .video_inputs = 4,
4c548d4b 812 /* .audio_inputs= 1, */
2bfa1ac6
MCC
813 .svhs = 3,
814 .gpiomask = 1,
6f98700a 815 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 816 .gpiomux = { 1, 0, 0, 0 },
2bfa1ac6
MCC
817 .pll = PLL_28,
818 .tuner_type = TUNER_PHILIPS_PAL,
819 .tuner_addr = ADDR_UNSET,
820 },
821
822 /* ---- card 0x20 ---------------------------------- */
5a25e84b 823 [BTTV_BOARD_INTEL_C_S_PCI] = {
2bfa1ac6
MCC
824 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
825 .video_inputs = 4,
4c548d4b 826 /* .audio_inputs= 0, */
2bfa1ac6
MCC
827 .svhs = 2,
828 .gpiomask = 0,
6f98700a 829 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 830 .gpiomux = { 0 },
2bfa1ac6 831 .needs_tvaudio = 0,
8c2c0dfe 832 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
833 .tuner_addr = ADDR_UNSET,
834 },
5a25e84b 835 [BTTV_BOARD_TERRATVALUE] = {
2bfa1ac6
MCC
836 .name = "Terratec TerraTValue Version Bt878",
837 .video_inputs = 3,
4c548d4b 838 /* .audio_inputs= 1, */
2bfa1ac6
MCC
839 .svhs = 2,
840 .gpiomask = 0xffff00,
6f98700a 841 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
842 .gpiomux = { 0x500, 0, 0x300, 0x900 },
843 .gpiomute = 0x900,
2bfa1ac6
MCC
844 .needs_tvaudio = 1,
845 .pll = PLL_28,
846 .tuner_type = TUNER_PHILIPS_PAL,
847 .tuner_addr = ADDR_UNSET,
848 },
5a25e84b 849 [BTTV_BOARD_WINFAST2000] = {
2bfa1ac6
MCC
850 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
851 .video_inputs = 4,
4c548d4b 852 /* .audio_inputs= 1, */
2bfa1ac6 853 .svhs = 2,
6f98700a
TP
854 /* TV, CVid, SVid, CVid over SVid connector */
855 .muxsel = MUXSEL(2, 3, 1, 1, 0),
2bfa1ac6
MCC
856 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
857 .gpiomask = 0xb33000,
8bf2f8e7
HV
858 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
859 .gpiomute = 0x800000,
2bfa1ac6
MCC
860 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
861 gpio23 -- hef4052:nEnable (0x800000)
862 gpio12 -- hef4052:A1
863 gpio13 -- hef4052:A0
864 0x0000: external audio
865 0x1000: FM
866 0x2000: TV
867 0x3000: n.c.
868 Note: There exists another variant "Winfast 2000" with tv stereo !?
869 Note: eeprom only contains FF and pci subsystem id 107d:6606
870 */
871 .needs_tvaudio = 0,
872 .pll = PLL_28,
873 .has_radio = 1,
8c2c0dfe 874 .tuner_type = TUNER_PHILIPS_PAL, /* default for now, gpio reads BFFF06 for Pal bg+dk */
2bfa1ac6 875 .tuner_addr = ADDR_UNSET,
4b9b936f 876 .audio_mode_gpio= winfast2000_audio,
2bfa1ac6
MCC
877 .has_remote = 1,
878 },
5a25e84b 879 [BTTV_BOARD_CHRONOS_VS2] = {
2bfa1ac6
MCC
880 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
881 .video_inputs = 4,
4c548d4b 882 /* .audio_inputs= 3, */
2bfa1ac6
MCC
883 .svhs = 2,
884 .gpiomask = 0x1800,
6f98700a 885 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
886 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
887 .gpiomute = 0x1800,
2bfa1ac6 888 .pll = PLL_28,
8c2c0dfe 889 .tuner_type = UNSET,
2bfa1ac6
MCC
890 .tuner_addr = ADDR_UNSET,
891 },
892
893 /* ---- card 0x24 ---------------------------------- */
5a25e84b 894 [BTTV_BOARD_TYPHOON_TVIEW] = {
2bfa1ac6
MCC
895 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
896 .video_inputs = 4,
4c548d4b 897 /* .audio_inputs= 3, */
2bfa1ac6
MCC
898 .svhs = 2,
899 .gpiomask = 0x1800,
6f98700a 900 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
901 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
902 .gpiomute = 0x1800,
2bfa1ac6 903 .pll = PLL_28,
8c2c0dfe 904 .tuner_type = UNSET,
2bfa1ac6
MCC
905 .tuner_addr = ADDR_UNSET,
906 .has_radio = 1,
907 },
5a25e84b 908 [BTTV_BOARD_PXELVWPLTVPRO] = {
2bfa1ac6
MCC
909 .name = "Prolink PixelView PlayTV pro",
910 .video_inputs = 3,
4c548d4b 911 /* .audio_inputs= 1, */
2bfa1ac6
MCC
912 .svhs = 2,
913 .gpiomask = 0xff,
6f98700a 914 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
915 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
916 .gpiomute = 0x29,
2bfa1ac6
MCC
917 .no_msp34xx = 1,
918 .pll = PLL_28,
8c2c0dfe 919 .tuner_type = UNSET,
2bfa1ac6
MCC
920 .tuner_addr = ADDR_UNSET,
921 },
5a25e84b 922 [BTTV_BOARD_MAGICTVIEW063] = {
2bfa1ac6
MCC
923 .name = "Askey CPH06X TView99",
924 .video_inputs = 4,
4c548d4b 925 /* .audio_inputs= 1, */
2bfa1ac6
MCC
926 .svhs = 2,
927 .gpiomask = 0x551e00,
6f98700a 928 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
929 .gpiomux = { 0x551400, 0x551200, 0, 0 },
930 .gpiomute = 0x551c00,
2bfa1ac6
MCC
931 .needs_tvaudio = 1,
932 .pll = PLL_28,
8c2c0dfe 933 .tuner_type = TUNER_PHILIPS_PAL_I,
2bfa1ac6
MCC
934 .tuner_addr = ADDR_UNSET,
935 .has_remote = 1,
936 },
5a25e84b 937 [BTTV_BOARD_PINNACLE] = {
2bfa1ac6
MCC
938 .name = "Pinnacle PCTV Studio/Rave",
939 .video_inputs = 3,
4c548d4b 940 /* .audio_inputs= 1, */
2bfa1ac6
MCC
941 .svhs = 2,
942 .gpiomask = 0x03000F,
6f98700a 943 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
944 .gpiomux = { 2, 0xd0001, 0, 0 },
945 .gpiomute = 1,
2bfa1ac6
MCC
946 .needs_tvaudio = 0,
947 .pll = PLL_28,
8c2c0dfe 948 .tuner_type = UNSET,
2bfa1ac6
MCC
949 .tuner_addr = ADDR_UNSET,
950 },
951
952 /* ---- card 0x28 ---------------------------------- */
5a25e84b 953 [BTTV_BOARD_STB2] = {
2bfa1ac6
MCC
954 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
955 .video_inputs = 3,
4c548d4b 956 /* .audio_inputs= 1, */
2bfa1ac6
MCC
957 .svhs = 2,
958 .gpiomask = 7,
6f98700a 959 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
960 .gpiomux = { 4, 0, 2, 3 },
961 .gpiomute = 1,
2bfa1ac6
MCC
962 .no_msp34xx = 1,
963 .needs_tvaudio = 1,
964 .tuner_type = TUNER_PHILIPS_NTSC,
965 .tuner_addr = ADDR_UNSET,
966 .pll = PLL_28,
967 .has_radio = 1,
968 },
5a25e84b 969 [BTTV_BOARD_AVPHONE98] = {
2bfa1ac6
MCC
970 .name = "AVerMedia TVPhone 98",
971 .video_inputs = 3,
4c548d4b 972 /* .audio_inputs= 4, */
2bfa1ac6
MCC
973 .svhs = 2,
974 .gpiomask = 15,
6f98700a 975 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 976 .gpiomux = { 13, 4, 11, 7 },
2bfa1ac6
MCC
977 .needs_tvaudio = 1,
978 .pll = PLL_28,
8c2c0dfe 979 .tuner_type = UNSET,
2bfa1ac6
MCC
980 .tuner_addr = ADDR_UNSET,
981 .has_radio = 1,
4b9b936f 982 .audio_mode_gpio= avermedia_tvphone_audio,
2bfa1ac6 983 },
5a25e84b 984 [BTTV_BOARD_PV951] = {
2bfa1ac6
MCC
985 .name = "ProVideo PV951", /* pic16c54 */
986 .video_inputs = 3,
4c548d4b 987 /* .audio_inputs= 1, */
2bfa1ac6
MCC
988 .svhs = 2,
989 .gpiomask = 0,
6f98700a 990 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 991 .gpiomux = { 0, 0, 0, 0},
2bfa1ac6
MCC
992 .needs_tvaudio = 1,
993 .no_msp34xx = 1,
994 .pll = PLL_28,
8c2c0dfe 995 .tuner_type = TUNER_PHILIPS_PAL_I,
2bfa1ac6
MCC
996 .tuner_addr = ADDR_UNSET,
997 },
5a25e84b 998 [BTTV_BOARD_ONAIR_TV] = {
2bfa1ac6
MCC
999 .name = "Little OnAir TV",
1000 .video_inputs = 3,
4c548d4b 1001 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1002 .svhs = 2,
1003 .gpiomask = 0xe00b,
6f98700a 1004 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1005 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1006 .gpiomute = 0xff3ffc,
2bfa1ac6 1007 .no_msp34xx = 1,
8c2c0dfe 1008 .tuner_type = UNSET,
2bfa1ac6
MCC
1009 .tuner_addr = ADDR_UNSET,
1010 },
1011
1012 /* ---- card 0x2c ---------------------------------- */
5a25e84b 1013 [BTTV_BOARD_SIGMA_TVII_FM] = {
2bfa1ac6
MCC
1014 .name = "Sigma TVII-FM",
1015 .video_inputs = 2,
4c548d4b
TP
1016 /* .audio_inputs= 1, */
1017 .svhs = NO_SVHS,
2bfa1ac6 1018 .gpiomask = 3,
6f98700a 1019 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1020 .gpiomux = { 1, 1, 0, 2 },
1021 .gpiomute = 3,
2bfa1ac6
MCC
1022 .no_msp34xx = 1,
1023 .pll = PLL_NONE,
8c2c0dfe 1024 .tuner_type = UNSET,
2bfa1ac6
MCC
1025 .tuner_addr = ADDR_UNSET,
1026 },
5a25e84b 1027 [BTTV_BOARD_MATRIX_VISION2] = {
2bfa1ac6
MCC
1028 .name = "MATRIX-Vision MV-Delta 2",
1029 .video_inputs = 5,
4c548d4b 1030 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1031 .svhs = 3,
1032 .gpiomask = 0,
6f98700a 1033 .muxsel = MUXSEL(2, 3, 1, 0, 0),
8bf2f8e7 1034 .gpiomux = { 0 },
2bfa1ac6
MCC
1035 .no_msp34xx = 1,
1036 .pll = PLL_28,
abb0362f 1037 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1038 .tuner_addr = ADDR_UNSET,
1039 },
5a25e84b 1040 [BTTV_BOARD_ZOLTRIX_GENIE] = {
2bfa1ac6
MCC
1041 .name = "Zoltrix Genie TV/FM",
1042 .video_inputs = 3,
4c548d4b 1043 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1044 .svhs = 2,
1045 .gpiomask = 0xbcf03f,
6f98700a 1046 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1047 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1048 .gpiomute = 0xbcb03f,
2bfa1ac6
MCC
1049 .no_msp34xx = 1,
1050 .pll = PLL_28,
8c2c0dfe 1051 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
2bfa1ac6
MCC
1052 .tuner_addr = ADDR_UNSET,
1053 },
5a25e84b 1054 [BTTV_BOARD_TERRATVRADIO] = {
2bfa1ac6
MCC
1055 .name = "Terratec TV/Radio+",
1056 .video_inputs = 3,
4c548d4b 1057 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1058 .svhs = 2,
1059 .gpiomask = 0x70000,
6f98700a 1060 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1061 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1062 .gpiomute = 0x40000,
2bfa1ac6
MCC
1063 .needs_tvaudio = 1,
1064 .no_msp34xx = 1,
1065 .pll = PLL_35,
8c2c0dfe 1066 .tuner_type = TUNER_PHILIPS_PAL_I,
2bfa1ac6
MCC
1067 .tuner_addr = ADDR_UNSET,
1068 .has_radio = 1,
1069 },
1070
1071 /* ---- card 0x30 ---------------------------------- */
5a25e84b 1072 [BTTV_BOARD_DYNALINK] = {
2bfa1ac6
MCC
1073 .name = "Askey CPH03x/ Dynalink Magic TView",
1074 .video_inputs = 3,
4c548d4b 1075 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1076 .svhs = 2,
1077 .gpiomask = 15,
6f98700a 1078 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1079 .gpiomux = {2,0,0,0 },
1080 .gpiomute = 1,
2bfa1ac6
MCC
1081 .needs_tvaudio = 1,
1082 .pll = PLL_28,
8c2c0dfe 1083 .tuner_type = UNSET,
2bfa1ac6
MCC
1084 .tuner_addr = ADDR_UNSET,
1085 },
5a25e84b 1086 [BTTV_BOARD_GVBCTV3PCI] = {
2bfa1ac6
MCC
1087 .name = "IODATA GV-BCTV3/PCI",
1088 .video_inputs = 3,
4c548d4b 1089 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1090 .svhs = 2,
1091 .gpiomask = 0x010f00,
6f98700a 1092 .muxsel = MUXSEL(2, 3, 0, 0),
8bf2f8e7 1093 .gpiomux = {0x10000, 0, 0x10000, 0 },
2bfa1ac6
MCC
1094 .no_msp34xx = 1,
1095 .pll = PLL_28,
1096 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1097 .tuner_addr = ADDR_UNSET,
4b9b936f 1098 .audio_mode_gpio= gvbctv3pci_audio,
2bfa1ac6 1099 },
5a25e84b 1100 [BTTV_BOARD_PXELVWPLTVPAK] = {
2bfa1ac6
MCC
1101 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1102 .video_inputs = 5,
4c548d4b 1103 /* .audio_inputs= 1, */
2bfa1ac6 1104 .svhs = 3,
5221e21e 1105 .has_dig_in = 1,
2bfa1ac6 1106 .gpiomask = 0xAA0000,
6f98700a 1107 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
4c548d4b 1108 /* .digital_mode= DIGITAL_MODE_CAMERA, */
8bf2f8e7
HV
1109 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1110 .gpiomute = 0xa8000,
2bfa1ac6
MCC
1111 .no_msp34xx = 1,
1112 .pll = PLL_28,
1113 .tuner_type = TUNER_PHILIPS_PAL_I,
1114 .tuner_addr = ADDR_UNSET,
1115 .has_remote = 1,
1116 /* GPIO wiring: (different from Rev.4C !)
1117 GPIO17: U4.A0 (first hef4052bt)
1118 GPIO19: U4.A1
1119 GPIO20: U5.A1 (second hef4052bt)
1120 GPIO21: U4.nEN
1121 GPIO22: BT832 Reset Line
1122 GPIO23: A5,A0, U5,nEN
1123 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1124 */
1125 },
5a25e84b 1126 [BTTV_BOARD_EAGLE] = {
2bfa1ac6
MCC
1127 .name = "Eagle Wireless Capricorn2 (bt878A)",
1128 .video_inputs = 4,
4c548d4b 1129 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1130 .svhs = 2,
1131 .gpiomask = 7,
6f98700a 1132 .muxsel = MUXSEL(2, 0, 1, 1),
8bf2f8e7
HV
1133 .gpiomux = { 0, 1, 2, 3 },
1134 .gpiomute = 4,
2bfa1ac6 1135 .pll = PLL_28,
8c2c0dfe 1136 .tuner_type = UNSET /* TUNER_ALPS_TMDH2_NTSC */,
2bfa1ac6
MCC
1137 .tuner_addr = ADDR_UNSET,
1138 },
1139
1140 /* ---- card 0x34 ---------------------------------- */
5a25e84b 1141 [BTTV_BOARD_PINNACLEPRO] = {
2bfa1ac6
MCC
1142 /* David Härdeman <david@2gen.com> */
1143 .name = "Pinnacle PCTV Studio Pro",
1144 .video_inputs = 4,
4c548d4b 1145 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1146 .svhs = 3,
1147 .gpiomask = 0x03000F,
6f98700a 1148 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1149 .gpiomux = { 1, 0xd0001, 0, 0 },
1150 .gpiomute = 10,
2bfa1ac6
MCC
1151 /* sound path (5 sources):
1152 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1153 0= ext. Audio IN
1154 1= from MUX2
1155 2= Mono TV sound from Tuner
1156 3= not connected
1157 MUX2 (mask 0x30000):
1158 0,2,3= from MSP34xx
1159 1= FM stereo Radio from Tuner */
1160 .needs_tvaudio = 0,
1161 .pll = PLL_28,
8c2c0dfe 1162 .tuner_type = UNSET,
2bfa1ac6
MCC
1163 .tuner_addr = ADDR_UNSET,
1164 },
5a25e84b 1165 [BTTV_BOARD_TVIEW_RDS_FM] = {
2bfa1ac6
MCC
1166 /* Claas Langbehn <claas@bigfoot.com>,
1167 Sven Grothklags <sven@upb.de> */
1168 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1169 .video_inputs = 4,
4c548d4b 1170 /* .audio_inputs= 3, */
2bfa1ac6
MCC
1171 .svhs = 2,
1172 .gpiomask = 0x1c,
6f98700a 1173 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1174 .gpiomux = { 0, 0, 0x10, 8 },
1175 .gpiomute = 4,
2bfa1ac6
MCC
1176 .needs_tvaudio = 1,
1177 .pll = PLL_28,
1178 .tuner_type = TUNER_PHILIPS_PAL,
1179 .tuner_addr = ADDR_UNSET,
1180 .has_radio = 1,
1181 },
5a25e84b 1182 [BTTV_BOARD_LIFETEC_9415] = {
96de0e25 1183 /* Tim Röstermundt <rosterm@uni-muenster.de>
2bfa1ac6
MCC
1184 in de.comp.os.unix.linux.hardware:
1185 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
8bf2f8e7 1186 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
2bfa1ac6
MCC
1187 options tuner type=5 */
1188 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1189 .video_inputs = 4,
4c548d4b 1190 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1191 .svhs = 2,
1192 .gpiomask = 0x18e0,
6f98700a 1193 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1194 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1195 .gpiomute = 0x18e0,
2bfa1ac6
MCC
1196 /* For cards with tda9820/tda9821:
1197 0x0000: Tuner normal stereo
1198 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1199 0x0880: Tuner A2 stereo */
1200 .pll = PLL_28,
8c2c0dfe 1201 .tuner_type = UNSET,
2bfa1ac6
MCC
1202 .tuner_addr = ADDR_UNSET,
1203 },
5a25e84b 1204 [BTTV_BOARD_BESTBUY_EASYTV] = {
2bfa1ac6
MCC
1205 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1206 old Easy TV BT848 version (model CPH031) */
1207 .name = "Askey CPH031/ BESTBUY Easy TV",
1208 .video_inputs = 4,
4c548d4b 1209 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1210 .svhs = 2,
1211 .gpiomask = 0xF,
6f98700a 1212 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
1213 .gpiomux = { 2, 0, 0, 0 },
1214 .gpiomute = 10,
2bfa1ac6
MCC
1215 .needs_tvaudio = 0,
1216 .pll = PLL_28,
1217 .tuner_type = TUNER_TEMIC_PAL,
1218 .tuner_addr = ADDR_UNSET,
1219 },
1220
1221 /* ---- card 0x38 ---------------------------------- */
5a25e84b 1222 [BTTV_BOARD_FLYVIDEO_98FM] = {
2bfa1ac6
MCC
1223 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1224 .name = "Lifeview FlyVideo 98FM LR50",
1225 .video_inputs = 4,
4c548d4b 1226 /* .audio_inputs= 3, */
2bfa1ac6
MCC
1227 .svhs = 2,
1228 .gpiomask = 0x1800,
6f98700a 1229 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1230 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1231 .gpiomute = 0x1800,
2bfa1ac6 1232 .pll = PLL_28,
8c2c0dfe 1233 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6
MCC
1234 .tuner_addr = ADDR_UNSET,
1235 },
1236 /* This is the ultimate cheapo capture card
1237 * just a BT848A on a small PCB!
1238 * Steve Hosgood <steve@equiinet.com> */
5a25e84b 1239 [BTTV_BOARD_GRANDTEC] = {
2bfa1ac6
MCC
1240 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1241 .video_inputs = 2,
4c548d4b 1242 /* .audio_inputs= 0, */
2bfa1ac6
MCC
1243 .svhs = 1,
1244 .gpiomask = 0,
6f98700a 1245 .muxsel = MUXSEL(3, 1),
8bf2f8e7 1246 .gpiomux = { 0 },
2bfa1ac6
MCC
1247 .needs_tvaudio = 0,
1248 .no_msp34xx = 1,
1249 .pll = PLL_35,
abb0362f 1250 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1251 .tuner_addr = ADDR_UNSET,
1252 },
5a25e84b 1253 [BTTV_BOARD_ASKEY_CPH060] = {
2bfa1ac6
MCC
1254 /* Daniel Herrington <daniel.herrington@home.com> */
1255 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1256 .video_inputs = 3,
4c548d4b 1257 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1258 .svhs = 2,
1259 .gpiomask = 0xe00,
6f98700a 1260 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1261 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1262 .gpiomute = 0x800,
2bfa1ac6
MCC
1263 .needs_tvaudio = 1,
1264 .pll = PLL_28,
1265 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1266 .tuner_addr = ADDR_UNSET,
1267 },
5a25e84b 1268 [BTTV_BOARD_ASKEY_CPH03X] = {
2bfa1ac6
MCC
1269 /* Matti Mottus <mottus@physic.ut.ee> */
1270 .name = "Askey CPH03x TV Capturer",
1271 .video_inputs = 4,
4c548d4b 1272 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1273 .svhs = 2,
1274 .gpiomask = 0x03000F,
6f98700a 1275 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
1276 .gpiomux = { 2, 0, 0, 0 },
1277 .gpiomute = 1,
2bfa1ac6 1278 .pll = PLL_28,
8c2c0dfe 1279 .tuner_type = TUNER_TEMIC_PAL,
2bfa1ac6 1280 .tuner_addr = ADDR_UNSET,
ed44f66e 1281 .has_remote = 1,
2bfa1ac6
MCC
1282 },
1283
1284 /* ---- card 0x3c ---------------------------------- */
5a25e84b 1285 [BTTV_BOARD_MM100PCTV] = {
2bfa1ac6
MCC
1286 /* Philip Blundell <philb@gnu.org> */
1287 .name = "Modular Technology MM100PCTV",
1288 .video_inputs = 2,
4c548d4b
TP
1289 /* .audio_inputs= 2, */
1290 .svhs = NO_SVHS,
2bfa1ac6 1291 .gpiomask = 11,
6f98700a 1292 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1293 .gpiomux = { 2, 0, 0, 1 },
1294 .gpiomute = 8,
2bfa1ac6
MCC
1295 .pll = PLL_35,
1296 .tuner_type = TUNER_TEMIC_PAL,
1297 .tuner_addr = ADDR_UNSET,
1298 },
5a25e84b 1299 [BTTV_BOARD_GMV1] = {
2bfa1ac6 1300 /* Adrian Cox <adrian@humboldt.co.uk */
4ac97914 1301 .name = "AG Electronics GMV1",
2bfa1ac6 1302 .video_inputs = 2,
4c548d4b 1303 /* .audio_inputs= 0, */
4ac97914 1304 .svhs = 1,
2bfa1ac6 1305 .gpiomask = 0xF,
6f98700a 1306 .muxsel = MUXSEL(2, 2),
8bf2f8e7 1307 .gpiomux = { },
2bfa1ac6
MCC
1308 .no_msp34xx = 1,
1309 .needs_tvaudio = 0,
4ac97914 1310 .pll = PLL_28,
abb0362f 1311 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1312 .tuner_addr = ADDR_UNSET,
1313 },
5a25e84b 1314 [BTTV_BOARD_BESTBUY_EASYTV2] = {
2bfa1ac6
MCC
1315 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1316 new Easy TV BT878 version (model CPH061)
1317 special thanks to Informatica Mieres for providing the card */
1318 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1319 .video_inputs = 3,
4c548d4b 1320 /* .audio_inputs= 2, */
2bfa1ac6
MCC
1321 .svhs = 2,
1322 .gpiomask = 0xFF,
6f98700a 1323 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
1324 .gpiomux = { 1, 0, 4, 4 },
1325 .gpiomute = 9,
2bfa1ac6
MCC
1326 .needs_tvaudio = 0,
1327 .pll = PLL_28,
1328 .tuner_type = TUNER_PHILIPS_PAL,
1329 .tuner_addr = ADDR_UNSET,
1330 },
5a25e84b 1331 [BTTV_BOARD_ATI_TVWONDER] = {
2bfa1ac6
MCC
1332 /* Lukas Gebauer <geby@volny.cz> */
1333 .name = "ATI TV-Wonder",
1334 .video_inputs = 3,
4c548d4b 1335 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1336 .svhs = 2,
1337 .gpiomask = 0xf03f,
6f98700a 1338 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
1339 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1340 .gpiomute = 0xbffe,
2bfa1ac6
MCC
1341 .pll = PLL_28,
1342 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1343 .tuner_addr = ADDR_UNSET,
1344 },
1345
1346 /* ---- card 0x40 ---------------------------------- */
5a25e84b 1347 [BTTV_BOARD_ATI_TVWONDERVE] = {
2bfa1ac6
MCC
1348 /* Lukas Gebauer <geby@volny.cz> */
1349 .name = "ATI TV-Wonder VE",
1350 .video_inputs = 2,
4c548d4b
TP
1351 /* .audio_inputs= 1, */
1352 .svhs = NO_SVHS,
2bfa1ac6 1353 .gpiomask = 1,
6f98700a 1354 .muxsel = MUXSEL(2, 3, 0, 1),
8bf2f8e7 1355 .gpiomux = { 0, 0, 1, 0 },
2bfa1ac6
MCC
1356 .no_msp34xx = 1,
1357 .pll = PLL_28,
1358 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1359 .tuner_addr = ADDR_UNSET,
1360 },
5a25e84b 1361 [BTTV_BOARD_FLYVIDEO2000] = {
2bfa1ac6
MCC
1362 /* DeeJay <deejay@westel900.net (2000S) */
1363 .name = "Lifeview FlyVideo 2000S LR90",
1364 .video_inputs = 3,
4c548d4b 1365 /* .audio_inputs= 3, */
2bfa1ac6
MCC
1366 .svhs = 2,
1367 .gpiomask = 0x18e0,
6f98700a 1368 .muxsel = MUXSEL(2, 3, 0, 1),
2bfa1ac6
MCC
1369 /* Radio changed from 1e80 to 0x800 to make
1370 FlyVideo2000S in .hu happy (gm)*/
1371 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
8bf2f8e7
HV
1372 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1373 .gpiomute = 0x1800,
4b9b936f 1374 .audio_mode_gpio= fv2000s_audio,
2bfa1ac6 1375 .no_msp34xx = 1,
2bfa1ac6
MCC
1376 .needs_tvaudio = 1,
1377 .pll = PLL_28,
8c2c0dfe 1378 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6
MCC
1379 .tuner_addr = ADDR_UNSET,
1380 },
5a25e84b 1381 [BTTV_BOARD_TERRATVALUER] = {
2bfa1ac6
MCC
1382 .name = "Terratec TValueRadio",
1383 .video_inputs = 3,
4c548d4b 1384 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1385 .svhs = 2,
1386 .gpiomask = 0xffff00,
6f98700a 1387 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1388 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1389 .gpiomute = 0x900,
2bfa1ac6
MCC
1390 .needs_tvaudio = 1,
1391 .pll = PLL_28,
1392 .tuner_type = TUNER_PHILIPS_PAL,
1393 .tuner_addr = ADDR_UNSET,
1394 .has_radio = 1,
1395 },
5a25e84b 1396 [BTTV_BOARD_GVBCTV4PCI] = {
2bfa1ac6
MCC
1397 /* TANAKA Kei <peg00625@nifty.com> */
1398 .name = "IODATA GV-BCTV4/PCI",
1399 .video_inputs = 3,
4c548d4b 1400 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1401 .svhs = 2,
1402 .gpiomask = 0x010f00,
6f98700a 1403 .muxsel = MUXSEL(2, 3, 0, 0),
8bf2f8e7 1404 .gpiomux = {0x10000, 0, 0x10000, 0 },
2bfa1ac6
MCC
1405 .no_msp34xx = 1,
1406 .pll = PLL_28,
1407 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1408 .tuner_addr = ADDR_UNSET,
4b9b936f 1409 .audio_mode_gpio= gvbctv3pci_audio,
2bfa1ac6
MCC
1410 },
1411
1412 /* ---- card 0x44 ---------------------------------- */
5a25e84b 1413 [BTTV_BOARD_VOODOOTV_FM] = {
434b2526
WB
1414 .name = "3Dfx VoodooTV FM (Euro)",
1415 /* try "insmod msp3400 simple=0" if you have
1416 * sound problems with this card. */
1417 .video_inputs = 4,
4c548d4b
TP
1418 /* .audio_inputs= 1, */
1419 .svhs = NO_SVHS,
434b2526
WB
1420 .gpiomask = 0x4f8a00,
1421 /* 0x100000: 1=MSP enabled (0=disable again)
1422 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1423 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1424 .gpiomute = 0x947fff,
1425 /* tvtuner, radio, external,internal, mute, stereo
1426 * tuner, Composit, SVid, Composit-on-Svid-adapter */
6f98700a 1427 .muxsel = MUXSEL(2, 3, 0, 1),
434b2526
WB
1428 .tuner_type = TUNER_MT2032,
1429 .tuner_addr = ADDR_UNSET,
434b2526
WB
1430 .pll = PLL_28,
1431 .has_radio = 1,
1432 },
1433 [BTTV_BOARD_VOODOOTV_200] = {
1434 .name = "VoodooTV 200 (USA)",
2bfa1ac6
MCC
1435 /* try "insmod msp3400 simple=0" if you have
1436 * sound problems with this card. */
1437 .video_inputs = 4,
4c548d4b
TP
1438 /* .audio_inputs= 1, */
1439 .svhs = NO_SVHS,
2bfa1ac6
MCC
1440 .gpiomask = 0x4f8a00,
1441 /* 0x100000: 1=MSP enabled (0=disable again)
1442 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
8bf2f8e7
HV
1443 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1444 .gpiomute = 0x947fff,
2bfa1ac6
MCC
1445 /* tvtuner, radio, external,internal, mute, stereo
1446 * tuner, Composit, SVid, Composit-on-Svid-adapter */
6f98700a 1447 .muxsel = MUXSEL(2, 3, 0, 1),
2bfa1ac6
MCC
1448 .tuner_type = TUNER_MT2032,
1449 .tuner_addr = ADDR_UNSET,
1450 .pll = PLL_28,
1451 .has_radio = 1,
1452 },
5a25e84b 1453 [BTTV_BOARD_AIMMS] = {
2bfa1ac6
MCC
1454 /* Philip Blundell <pb@nexus.co.uk> */
1455 .name = "Active Imaging AIMMS",
1456 .video_inputs = 1,
4c548d4b 1457 /* .audio_inputs= 0, */
abb0362f 1458 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1459 .tuner_addr = ADDR_UNSET,
1460 .pll = PLL_28,
6f98700a 1461 .muxsel = MUXSEL(2),
2bfa1ac6
MCC
1462 .gpiomask = 0
1463 },
5a25e84b 1464 [BTTV_BOARD_PV_BT878P_PLUS] = {
2bfa1ac6
MCC
1465 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1466 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1467 .video_inputs = 3,
4c548d4b 1468 /* .audio_inputs= 4, */
2bfa1ac6
MCC
1469 .svhs = 2,
1470 .gpiomask = 15,
6f98700a 1471 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1472 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1473 .gpiomute = 13,
2bfa1ac6
MCC
1474 .needs_tvaudio = 1,
1475 .pll = PLL_28,
8c2c0dfe 1476 .tuner_type = TUNER_LG_PAL_I_FM,
2bfa1ac6
MCC
1477 .tuner_addr = ADDR_UNSET,
1478 .has_remote = 1,
1479 /* GPIO wiring:
1480 GPIO0: U4.A0 (hef4052bt)
1481 GPIO1: U4.A1
1482 GPIO2: U4.A1 (second hef4052bt)
1483 GPIO3: U4.nEN, U5.A0, A5.nEN
1484 GPIO8-15: vrd866b ?
1485 */
1486 },
5a25e84b 1487 [BTTV_BOARD_FLYVIDEO98EZ] = {
2bfa1ac6
MCC
1488 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1489 .video_inputs = 4,
4c548d4b 1490 /* .audio_inputs= 0, */
2bfa1ac6 1491 .svhs = 2,
6f98700a
TP
1492 /* AV1, AV2, SVHS, CVid adapter on SVHS */
1493 .muxsel = MUXSEL(2, 3, 1, 1),
2bfa1ac6
MCC
1494 .pll = PLL_28,
1495 .no_msp34xx = 1,
abb0362f 1496 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1497 .tuner_addr = ADDR_UNSET,
1498 },
1499
1500 /* ---- card 0x48 ---------------------------------- */
5a25e84b 1501 [BTTV_BOARD_PV_BT878P_9B] = {
2bfa1ac6
MCC
1502 /* Dariusz Kowalewski <darekk@automex.pl> */
1503 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1504 .video_inputs = 4,
4c548d4b 1505 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1506 .svhs = 2,
1507 .gpiomask = 0x3f,
6f98700a 1508 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1509 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1510 .gpiomute = 0x09,
2bfa1ac6
MCC
1511 .needs_tvaudio = 1,
1512 .no_msp34xx = 1,
2bfa1ac6 1513 .pll = PLL_28,
8c2c0dfe 1514 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6 1515 .tuner_addr = ADDR_UNSET,
4b9b936f 1516 .audio_mode_gpio= pvbt878p9b_audio, /* Note: not all cards have stereo */
2bfa1ac6
MCC
1517 .has_radio = 1, /* Note: not all cards have radio */
1518 .has_remote = 1,
1519 /* GPIO wiring:
1520 GPIO0: A0 hef4052
1521 GPIO1: A1 hef4052
1522 GPIO3: nEN hef4052
1523 GPIO8-15: vrd866b
1524 GPIO20,22,23: R30,R29,R28
1525 */
1526 },
5a25e84b 1527 [BTTV_BOARD_SENSORAY311] = {
2bfa1ac6
MCC
1528 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1529 /* you must jumper JP5 for the card to work */
1530 .name = "Sensoray 311",
1531 .video_inputs = 5,
4c548d4b 1532 /* .audio_inputs= 0, */
2bfa1ac6
MCC
1533 .svhs = 4,
1534 .gpiomask = 0,
6f98700a 1535 .muxsel = MUXSEL(2, 3, 1, 0, 0),
8bf2f8e7 1536 .gpiomux = { 0 },
2bfa1ac6 1537 .needs_tvaudio = 0,
abb0362f 1538 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1539 .tuner_addr = ADDR_UNSET,
1540 },
5a25e84b 1541 [BTTV_BOARD_RV605] = {
2bfa1ac6
MCC
1542 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1543 .name = "RemoteVision MX (RV605)",
1544 .video_inputs = 16,
4c548d4b
TP
1545 /* .audio_inputs= 0, */
1546 .svhs = NO_SVHS,
2bfa1ac6
MCC
1547 .gpiomask = 0x00,
1548 .gpiomask2 = 0x07ff,
6f98700a 1549 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2bfa1ac6 1550 .no_msp34xx = 1,
abb0362f 1551 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1552 .tuner_addr = ADDR_UNSET,
1553 .muxsel_hook = rv605_muxsel,
1554 },
5a25e84b 1555 [BTTV_BOARD_POWERCLR_MTV878] = {
2bfa1ac6
MCC
1556 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1557 .video_inputs = 3,
4c548d4b 1558 /* .audio_inputs= 2, */
2bfa1ac6
MCC
1559 .svhs = 2,
1560 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
6f98700a 1561 .muxsel = MUXSEL(2, 1, 1),
8bf2f8e7
HV
1562 .gpiomux = { 0, 1, 2, 2 },
1563 .gpiomute = 4,
2bfa1ac6
MCC
1564 .needs_tvaudio = 0,
1565 .tuner_type = TUNER_PHILIPS_PAL,
1566 .tuner_addr = ADDR_UNSET,
1567 .pll = PLL_28,
1568 .has_radio = 1,
1569 },
1570
1571 /* ---- card 0x4c ---------------------------------- */
5a25e84b 1572 [BTTV_BOARD_WINDVR] = {
2bfa1ac6
MCC
1573 /* Masaki Suzuki <masaki@btree.org> */
1574 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1575 .video_inputs = 3,
4c548d4b 1576 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1577 .svhs = 2,
1578 .gpiomask = 0x140007,
6f98700a 1579 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1580 .gpiomux = { 0, 1, 2, 3 },
1581 .gpiomute = 4,
2bfa1ac6
MCC
1582 .tuner_type = TUNER_PHILIPS_NTSC,
1583 .tuner_addr = ADDR_UNSET,
4b9b936f 1584 .audio_mode_gpio= windvr_audio,
2bfa1ac6 1585 },
5a25e84b 1586 [BTTV_BOARD_GRANDTEC_MULTI] = {
2bfa1ac6
MCC
1587 .name = "GrandTec Multi Capture Card (Bt878)",
1588 .video_inputs = 4,
4c548d4b
TP
1589 /* .audio_inputs= 0, */
1590 .svhs = NO_SVHS,
2bfa1ac6 1591 .gpiomask = 0,
6f98700a 1592 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7 1593 .gpiomux = { 0 },
2bfa1ac6
MCC
1594 .needs_tvaudio = 0,
1595 .no_msp34xx = 1,
1596 .pll = PLL_28,
abb0362f 1597 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1598 .tuner_addr = ADDR_UNSET,
1599 },
5a25e84b 1600 [BTTV_BOARD_KWORLD] = {
2bfa1ac6
MCC
1601 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1602 .video_inputs = 4,
4c548d4b 1603 /* .audio_inputs= 3, */
2bfa1ac6
MCC
1604 .svhs = 2,
1605 .gpiomask = 7,
6f98700a
TP
1606 /* Tuner, SVid, SVHS, SVid to SVHS connector */
1607 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 1608 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
2bfa1ac6
MCC
1609 * This card lacks external Audio In, so we mute it on Ext. & Int.
1610 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1611 * This card lacks PCI subsystem ID, sigh.
8bf2f8e7 1612 * gpiomux =1: lower volume, 2+3: mute
2bfa1ac6
MCC
1613 * btwincap uses 0x80000/0x80003
1614 */
8bf2f8e7 1615 .gpiomute = 4,
2bfa1ac6
MCC
1616 .needs_tvaudio = 0,
1617 .no_msp34xx = 1,
1618 .pll = PLL_28,
8c2c0dfe 1619 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6
MCC
1620 .tuner_addr = ADDR_UNSET,
1621 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1622 radio signal strength indicators work fine. */
1623 .has_radio = 1,
1624 /* GPIO Info:
1625 GPIO0,1: HEF4052 A0,A1
1626 GPIO2: HEF4052 nENABLE
1627 GPIO3-7: n.c.
1628 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1629 GPIO14,15: ??
1630 GPIO16-21: n.c.
1631 GPIO22,23: ??
1632 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1633 },
5a25e84b 1634 [BTTV_BOARD_DSP_TCVIDEO] = {
2bfa1ac6
MCC
1635 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1636 .name = "DSP Design TCVIDEO",
1637 .video_inputs = 4,
4c548d4b 1638 .svhs = NO_SVHS,
6f98700a 1639 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6 1640 .pll = PLL_28,
8c2c0dfe 1641 .tuner_type = UNSET,
2bfa1ac6
MCC
1642 .tuner_addr = ADDR_UNSET,
1643 },
1644
1645 /* ---- card 0x50 ---------------------------------- */
5a25e84b 1646 [BTTV_BOARD_HAUPPAUGEPVR] = {
2bfa1ac6
MCC
1647 .name = "Hauppauge WinTV PVR",
1648 .video_inputs = 4,
4c548d4b 1649 /* .audio_inputs= 1, */
2bfa1ac6 1650 .svhs = 2,
6f98700a 1651 .muxsel = MUXSEL(2, 0, 1, 1),
2bfa1ac6
MCC
1652 .needs_tvaudio = 1,
1653 .pll = PLL_28,
8c2c0dfe 1654 .tuner_type = UNSET,
2bfa1ac6
MCC
1655 .tuner_addr = ADDR_UNSET,
1656
1657 .gpiomask = 7,
8bf2f8e7 1658 .gpiomux = {7},
2bfa1ac6 1659 },
5a25e84b 1660 [BTTV_BOARD_GVBCTV5PCI] = {
2bfa1ac6
MCC
1661 .name = "IODATA GV-BCTV5/PCI",
1662 .video_inputs = 3,
4c548d4b 1663 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1664 .svhs = 2,
1665 .gpiomask = 0x0f0f80,
6f98700a 1666 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
1667 .gpiomux = {0x030000, 0x010000, 0, 0 },
1668 .gpiomute = 0x020000,
2bfa1ac6
MCC
1669 .no_msp34xx = 1,
1670 .pll = PLL_28,
1671 .tuner_type = TUNER_PHILIPS_NTSC_M,
1672 .tuner_addr = ADDR_UNSET,
4b9b936f 1673 .audio_mode_gpio= gvbctv5pci_audio,
2bfa1ac6
MCC
1674 .has_radio = 1,
1675 },
5a25e84b 1676 [BTTV_BOARD_OSPREY1x0] = {
2bfa1ac6
MCC
1677 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1678 .video_inputs = 4, /* id-inputs-clock */
4c548d4b 1679 /* .audio_inputs= 0, */
2bfa1ac6 1680 .svhs = 3,
6f98700a 1681 .muxsel = MUXSEL(3, 2, 0, 1),
2bfa1ac6 1682 .pll = PLL_28,
abb0362f 1683 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1684 .tuner_addr = ADDR_UNSET,
1685 .no_msp34xx = 1,
2bfa1ac6
MCC
1686 .no_tda7432 = 1,
1687 },
5a25e84b 1688 [BTTV_BOARD_OSPREY1x0_848] = {
2bfa1ac6
MCC
1689 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1690 .video_inputs = 3,
4c548d4b 1691 /* .audio_inputs= 0, */
2bfa1ac6 1692 .svhs = 2,
6f98700a 1693 .muxsel = MUXSEL(2, 3, 1),
2bfa1ac6 1694 .pll = PLL_28,
abb0362f 1695 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1696 .tuner_addr = ADDR_UNSET,
1697 .no_msp34xx = 1,
2bfa1ac6
MCC
1698 .no_tda7432 = 1,
1699 },
1700
1701 /* ---- card 0x54 ---------------------------------- */
5a25e84b 1702 [BTTV_BOARD_OSPREY101_848] = {
2bfa1ac6
MCC
1703 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1704 .video_inputs = 2,
4c548d4b 1705 /* .audio_inputs= 0, */
2bfa1ac6 1706 .svhs = 1,
6f98700a 1707 .muxsel = MUXSEL(3, 1),
2bfa1ac6 1708 .pll = PLL_28,
abb0362f 1709 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1710 .tuner_addr = ADDR_UNSET,
1711 .no_msp34xx = 1,
2bfa1ac6
MCC
1712 .no_tda7432 = 1,
1713 },
5a25e84b 1714 [BTTV_BOARD_OSPREY1x1] = {
2bfa1ac6
MCC
1715 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1716 .video_inputs = 1,
4c548d4b
TP
1717 /* .audio_inputs= 0, */
1718 .svhs = NO_SVHS,
6f98700a 1719 .muxsel = MUXSEL(0),
2bfa1ac6 1720 .pll = PLL_28,
abb0362f 1721 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1722 .tuner_addr = ADDR_UNSET,
1723 .no_msp34xx = 1,
2bfa1ac6
MCC
1724 .no_tda7432 = 1,
1725 },
5a25e84b 1726 [BTTV_BOARD_OSPREY1x1_SVID] = {
2bfa1ac6
MCC
1727 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1728 .video_inputs = 2,
4c548d4b 1729 /* .audio_inputs= 0, */
2bfa1ac6 1730 .svhs = 1,
6f98700a 1731 .muxsel = MUXSEL(0, 1),
2bfa1ac6 1732 .pll = PLL_28,
abb0362f 1733 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1734 .tuner_addr = ADDR_UNSET,
1735 .no_msp34xx = 1,
2bfa1ac6
MCC
1736 .no_tda7432 = 1,
1737 },
5a25e84b 1738 [BTTV_BOARD_OSPREY2xx] = {
2bfa1ac6
MCC
1739 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1740 .video_inputs = 1,
4c548d4b
TP
1741 /* .audio_inputs= 1, */
1742 .svhs = NO_SVHS,
6f98700a 1743 .muxsel = MUXSEL(0),
2bfa1ac6 1744 .pll = PLL_28,
abb0362f 1745 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1746 .tuner_addr = ADDR_UNSET,
1747 .no_msp34xx = 1,
2bfa1ac6
MCC
1748 .no_tda7432 = 1,
1749 },
1750
1751 /* ---- card 0x58 ---------------------------------- */
5a25e84b 1752 [BTTV_BOARD_OSPREY2x0_SVID] = {
2bfa1ac6
MCC
1753 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1754 .video_inputs = 2,
4c548d4b 1755 /* .audio_inputs= 1, */
2bfa1ac6 1756 .svhs = 1,
6f98700a 1757 .muxsel = MUXSEL(0, 1),
2bfa1ac6 1758 .pll = PLL_28,
abb0362f 1759 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1760 .tuner_addr = ADDR_UNSET,
1761 .no_msp34xx = 1,
2bfa1ac6
MCC
1762 .no_tda7432 = 1,
1763 },
5a25e84b 1764 [BTTV_BOARD_OSPREY2x0] = {
52398efc 1765 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
2bfa1ac6 1766 .video_inputs = 2,
4c548d4b 1767 /* .audio_inputs= 1, */
2bfa1ac6 1768 .svhs = 1,
6f98700a 1769 .muxsel = MUXSEL(2, 3),
2bfa1ac6 1770 .pll = PLL_28,
abb0362f 1771 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1772 .tuner_addr = ADDR_UNSET,
1773 .no_msp34xx = 1,
2bfa1ac6
MCC
1774 .no_tda7432 = 1,
1775 },
5a25e84b 1776 [BTTV_BOARD_OSPREY500] = {
2bfa1ac6
MCC
1777 .name = "Osprey 500", /* 500 */
1778 .video_inputs = 2,
4c548d4b 1779 /* .audio_inputs= 1, */
2bfa1ac6 1780 .svhs = 1,
6f98700a 1781 .muxsel = MUXSEL(2, 3),
2bfa1ac6 1782 .pll = PLL_28,
abb0362f 1783 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1784 .tuner_addr = ADDR_UNSET,
1785 .no_msp34xx = 1,
2bfa1ac6
MCC
1786 .no_tda7432 = 1,
1787 },
5a25e84b 1788 [BTTV_BOARD_OSPREY540] = {
2bfa1ac6
MCC
1789 .name = "Osprey 540", /* 540 */
1790 .video_inputs = 4,
4c548d4b 1791 /* .audio_inputs= 1, */
2bfa1ac6 1792 .pll = PLL_28,
abb0362f 1793 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1794 .tuner_addr = ADDR_UNSET,
1795 .no_msp34xx = 1,
2bfa1ac6 1796 .no_tda7432 = 1,
2bfa1ac6
MCC
1797 },
1798
1799 /* ---- card 0x5C ---------------------------------- */
5a25e84b 1800 [BTTV_BOARD_OSPREY2000] = {
2bfa1ac6
MCC
1801 .name = "Osprey 2000", /* 2000 */
1802 .video_inputs = 2,
4c548d4b 1803 /* .audio_inputs= 1, */
2bfa1ac6 1804 .svhs = 1,
6f98700a 1805 .muxsel = MUXSEL(2, 3),
2bfa1ac6 1806 .pll = PLL_28,
abb0362f 1807 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1808 .tuner_addr = ADDR_UNSET,
1809 .no_msp34xx = 1,
2bfa1ac6
MCC
1810 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1811 },
5a25e84b 1812 [BTTV_BOARD_IDS_EAGLE] = {
2bfa1ac6
MCC
1813 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1814 .name = "IDS Eagle",
1815 .video_inputs = 4,
4c548d4b 1816 /* .audio_inputs= 0, */
abb0362f 1817 .tuner_type = TUNER_ABSENT,
2bfa1ac6 1818 .tuner_addr = ADDR_UNSET,
4c548d4b 1819 .svhs = NO_SVHS,
2bfa1ac6 1820 .gpiomask = 0,
6f98700a 1821 .muxsel = MUXSEL(2, 2, 2, 2),
2bfa1ac6
MCC
1822 .muxsel_hook = eagle_muxsel,
1823 .no_msp34xx = 1,
2bfa1ac6
MCC
1824 .pll = PLL_28,
1825 },
5a25e84b 1826 [BTTV_BOARD_PINNACLESAT] = {
2bfa1ac6
MCC
1827 .name = "Pinnacle PCTV Sat",
1828 .video_inputs = 2,
4c548d4b 1829 /* .audio_inputs= 0, */
2bfa1ac6 1830 .svhs = 1,
abb0362f 1831 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1832 .tuner_addr = ADDR_UNSET,
1833 .no_msp34xx = 1,
2bfa1ac6 1834 .no_tda7432 = 1,
6f98700a 1835 .muxsel = MUXSEL(3, 1),
2bfa1ac6
MCC
1836 .pll = PLL_28,
1837 .no_gpioirq = 1,
1838 .has_dvb = 1,
1839 },
5a25e84b 1840 [BTTV_BOARD_FORMAC_PROTV] = {
2bfa1ac6
MCC
1841 .name = "Formac ProTV II (bt878)",
1842 .video_inputs = 4,
4c548d4b 1843 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1844 .svhs = 3,
1845 .gpiomask = 2,
1846 /* TV, Comp1, Composite over SVID con, SVID */
6f98700a 1847 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 1848 .gpiomux = { 2, 2, 0, 0 },
2bfa1ac6
MCC
1849 .pll = PLL_28,
1850 .has_radio = 1,
1851 .tuner_type = TUNER_PHILIPS_PAL,
1852 .tuner_addr = ADDR_UNSET,
1853 /* sound routing:
1854 GPIO=0x00,0x01,0x03: mute (?)
1855 0x02: both TV and radio (tuner: FM1216/I)
1856 The card has onboard audio connectors labeled "cdrom" and "board",
1857 not soldered here, though unknown wiring.
1858 Card lacks: external audio in, pci subsystem id.
24a70fdc 1859 */
2bfa1ac6
MCC
1860 },
1861
1862 /* ---- card 0x60 ---------------------------------- */
5a25e84b 1863 [BTTV_BOARD_MACHTV] = {
2bfa1ac6
MCC
1864 .name = "MachTV",
1865 .video_inputs = 3,
4c548d4b
TP
1866 /* .audio_inputs= 1, */
1867 .svhs = NO_SVHS,
2bfa1ac6 1868 .gpiomask = 7,
6f98700a 1869 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
1870 .gpiomux = { 0, 1, 2, 3},
1871 .gpiomute = 4,
2bfa1ac6 1872 .needs_tvaudio = 1,
8c2c0dfe 1873 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6 1874 .tuner_addr = ADDR_UNSET,
cf583ac4 1875 .pll = PLL_28,
2bfa1ac6 1876 },
5a25e84b 1877 [BTTV_BOARD_EURESYS_PICOLO] = {
2bfa1ac6
MCC
1878 .name = "Euresys Picolo",
1879 .video_inputs = 3,
4c548d4b 1880 /* .audio_inputs= 0, */
2bfa1ac6
MCC
1881 .svhs = 2,
1882 .gpiomask = 0,
1883 .no_msp34xx = 1,
2bfa1ac6 1884 .no_tda7432 = 1,
6f98700a 1885 .muxsel = MUXSEL(2, 0, 1),
2bfa1ac6 1886 .pll = PLL_28,
abb0362f 1887 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1888 .tuner_addr = ADDR_UNSET,
1889 },
5a25e84b 1890 [BTTV_BOARD_PV150] = {
2bfa1ac6
MCC
1891 /* Luc Van Hoeylandt <luc@e-magic.be> */
1892 .name = "ProVideo PV150", /* 0x4f */
1893 .video_inputs = 2,
4c548d4b
TP
1894 /* .audio_inputs= 0, */
1895 .svhs = NO_SVHS,
2bfa1ac6 1896 .gpiomask = 0,
6f98700a 1897 .muxsel = MUXSEL(2, 3),
8bf2f8e7 1898 .gpiomux = { 0 },
2bfa1ac6
MCC
1899 .needs_tvaudio = 0,
1900 .no_msp34xx = 1,
1901 .pll = PLL_28,
abb0362f 1902 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1903 .tuner_addr = ADDR_UNSET,
1904 },
5a25e84b 1905 [BTTV_BOARD_AD_TVK503] = {
2bfa1ac6
MCC
1906 /* Hiroshi Takekawa <sian@big.or.jp> */
1907 /* This card lacks subsystem ID */
1908 .name = "AD-TVK503", /* 0x63 */
1909 .video_inputs = 4,
4c548d4b 1910 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1911 .svhs = 2,
1912 .gpiomask = 0x001e8007,
6f98700a 1913 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6 1914 /* Tuner, Radio, external, internal, off, on */
8bf2f8e7
HV
1915 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1916 .gpiomute = 0x0f,
2bfa1ac6
MCC
1917 .needs_tvaudio = 0,
1918 .no_msp34xx = 1,
1919 .pll = PLL_28,
8c2c0dfe 1920 .tuner_type = TUNER_PHILIPS_NTSC,
2bfa1ac6 1921 .tuner_addr = ADDR_UNSET,
4b9b936f 1922 .audio_mode_gpio= adtvk503_audio,
2bfa1ac6
MCC
1923 },
1924
1925 /* ---- card 0x64 ---------------------------------- */
5a25e84b 1926 [BTTV_BOARD_HERCULES_SM_TV] = {
2bfa1ac6
MCC
1927 .name = "Hercules Smart TV Stereo",
1928 .video_inputs = 4,
4c548d4b 1929 /* .audio_inputs= 1, */
2bfa1ac6
MCC
1930 .svhs = 2,
1931 .gpiomask = 0x00,
6f98700a 1932 .muxsel = MUXSEL(2, 3, 1, 1),
2bfa1ac6
MCC
1933 .needs_tvaudio = 1,
1934 .no_msp34xx = 1,
1935 .pll = PLL_28,
8c2c0dfe 1936 .tuner_type = TUNER_PHILIPS_PAL,
2bfa1ac6
MCC
1937 .tuner_addr = ADDR_UNSET,
1938 /* Notes:
1939 - card lacks subsystem ID
1940 - stereo variant w/ daughter board with tda9874a @0xb0
1941 - Audio Routing:
1942 always from tda9874 independent of GPIO (?)
1943 external line in: unknown
1944 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
1945 hef4053 (instead 4052) for unknown function
1946 */
1947 },
5a25e84b 1948 [BTTV_BOARD_PACETV] = {
2bfa1ac6
MCC
1949 .name = "Pace TV & Radio Card",
1950 .video_inputs = 4,
4c548d4b 1951 /* .audio_inputs= 1, */
2bfa1ac6 1952 .svhs = 2,
6f98700a
TP
1953 /* Tuner, CVid, SVid, CVid over SVid connector */
1954 .muxsel = MUXSEL(2, 3, 1, 1),
2bfa1ac6 1955 .gpiomask = 0,
2bfa1ac6 1956 .no_tda7432 = 1,
8c2c0dfe 1957 .tuner_type = TUNER_PHILIPS_PAL_I,
2bfa1ac6
MCC
1958 .tuner_addr = ADDR_UNSET,
1959 .has_radio = 1,
1960 .pll = PLL_28,
1961 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
1962 only internal line out: (4pin header) RGGL
1963 Radio must be decoded by msp3410d (not routed through)*/
1964 /*
1965 .digital_mode = DIGITAL_MODE_CAMERA, todo!
1966 */
1967 },
5a25e84b 1968 [BTTV_BOARD_IVC200] = {
2bfa1ac6
MCC
1969 /* Chris Willing <chris@vislab.usyd.edu.au> */
1970 .name = "IVC-200",
1971 .video_inputs = 1,
4c548d4b 1972 /* .audio_inputs= 0, */
abb0362f 1973 .tuner_type = TUNER_ABSENT,
2bfa1ac6 1974 .tuner_addr = ADDR_UNSET,
4c548d4b 1975 .svhs = NO_SVHS,
ade0815c 1976 .gpiomask = 0xdf,
6f98700a 1977 .muxsel = MUXSEL(2),
ade0815c
DK
1978 .pll = PLL_28,
1979 },
1980 [BTTV_BOARD_IVCE8784] = {
1981 .name = "IVCE-8784",
1982 .video_inputs = 1,
4c548d4b 1983 /* .audio_inputs= 0, */
abb0362f 1984 .tuner_type = TUNER_ABSENT,
ade0815c 1985 .tuner_addr = ADDR_UNSET,
4c548d4b 1986 .svhs = NO_SVHS,
2bfa1ac6 1987 .gpiomask = 0xdf,
6f98700a 1988 .muxsel = MUXSEL(2),
2bfa1ac6
MCC
1989 .pll = PLL_28,
1990 },
5a25e84b 1991 [BTTV_BOARD_XGUARD] = {
2bfa1ac6
MCC
1992 .name = "Grand X-Guard / Trust 814PCI",
1993 .video_inputs = 16,
4c548d4b
TP
1994 /* .audio_inputs= 0, */
1995 .svhs = NO_SVHS,
8c2c0dfe 1996 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
1997 .tuner_addr = ADDR_UNSET,
1998 .gpiomask2 = 0xff,
6f98700a 1999 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
2bfa1ac6
MCC
2000 .muxsel_hook = xguard_muxsel,
2001 .no_msp34xx = 1,
2bfa1ac6
MCC
2002 .no_tda7432 = 1,
2003 .pll = PLL_28,
2004 },
2005
2006 /* ---- card 0x68 ---------------------------------- */
5a25e84b 2007 [BTTV_BOARD_NEBULA_DIGITV] = {
2bfa1ac6
MCC
2008 .name = "Nebula Electronics DigiTV",
2009 .video_inputs = 1,
4c548d4b 2010 .svhs = NO_SVHS,
6f98700a 2011 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6 2012 .no_msp34xx = 1,
2bfa1ac6
MCC
2013 .no_tda7432 = 1,
2014 .pll = PLL_28,
abb0362f 2015 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2016 .tuner_addr = ADDR_UNSET,
2017 .has_dvb = 1,
6c6c0b2c
MW
2018 .has_remote = 1,
2019 .gpiomask = 0x1b,
2bfa1ac6
MCC
2020 .no_gpioirq = 1,
2021 },
5a25e84b 2022 [BTTV_BOARD_PV143] = {
2bfa1ac6
MCC
2023 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2024 .name = "ProVideo PV143",
2025 .video_inputs = 4,
4c548d4b
TP
2026 /* .audio_inputs= 0, */
2027 .svhs = NO_SVHS,
2bfa1ac6 2028 .gpiomask = 0,
6f98700a 2029 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7 2030 .gpiomux = { 0 },
2bfa1ac6
MCC
2031 .needs_tvaudio = 0,
2032 .no_msp34xx = 1,
2033 .pll = PLL_28,
abb0362f 2034 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2035 .tuner_addr = ADDR_UNSET,
2036 },
05583625 2037 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
2bfa1ac6 2038 /* M.Klahr@phytec.de */
05583625 2039 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
2bfa1ac6 2040 .video_inputs = 4,
4c548d4b 2041 /* .audio_inputs= 0, */
2bfa1ac6
MCC
2042 .svhs = 3,
2043 .gpiomask = 0x00,
6f98700a 2044 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7 2045 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
05583625 2046 .needs_tvaudio = 0,
2bfa1ac6 2047 .pll = PLL_28,
abb0362f 2048 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2049 .tuner_addr = ADDR_UNSET,
2050 },
05583625
DH
2051 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2052 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2bfa1ac6 2053 .video_inputs = 4,
4c548d4b 2054 /* .audio_inputs= 0, */
2bfa1ac6
MCC
2055 .svhs = 3,
2056 .gpiomask = 0x00,
6f98700a 2057 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 2058 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
05583625 2059 .needs_tvaudio = 0,
2bfa1ac6 2060 .pll = PLL_28,
abb0362f 2061 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2062 .tuner_addr = ADDR_UNSET,
2063 },
2064
2065 /* ---- card 0x6c ---------------------------------- */
5a25e84b 2066 [BTTV_BOARD_VD009_MINIDIN] = {
2bfa1ac6
MCC
2067 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2068 .video_inputs = 10,
4c548d4b 2069 /* .audio_inputs= 0, */
2bfa1ac6
MCC
2070 .svhs = 9,
2071 .gpiomask = 0x00,
15f8eeb2 2072 .gpiomask2 = 0x03, /* used for external vodeo mux */
6f98700a 2073 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
15f8eeb2 2074 .muxsel_hook = phytec_muxsel,
8bf2f8e7 2075 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2bfa1ac6
MCC
2076 .needs_tvaudio = 1,
2077 .pll = PLL_28,
abb0362f 2078 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2079 .tuner_addr = ADDR_UNSET,
2080 },
5a25e84b 2081 [BTTV_BOARD_VD009_COMBI] = {
2bfa1ac6
MCC
2082 .name = "PHYTEC VD-009 Combi (bt878)",
2083 .video_inputs = 10,
4c548d4b 2084 /* .audio_inputs= 0, */
2bfa1ac6
MCC
2085 .svhs = 9,
2086 .gpiomask = 0x00,
15f8eeb2 2087 .gpiomask2 = 0x03, /* used for external vodeo mux */
6f98700a 2088 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
15f8eeb2 2089 .muxsel_hook = phytec_muxsel,
8bf2f8e7 2090 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2bfa1ac6
MCC
2091 .needs_tvaudio = 1,
2092 .pll = PLL_28,
abb0362f 2093 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2094 .tuner_addr = ADDR_UNSET,
2095 },
5a25e84b 2096 [BTTV_BOARD_IVC100] = {
2bfa1ac6
MCC
2097 .name = "IVC-100",
2098 .video_inputs = 4,
4c548d4b 2099 /* .audio_inputs= 0, */
abb0362f 2100 .tuner_type = TUNER_ABSENT,
2bfa1ac6 2101 .tuner_addr = ADDR_UNSET,
4c548d4b 2102 .svhs = NO_SVHS,
2bfa1ac6 2103 .gpiomask = 0xdf,
6f98700a 2104 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6
MCC
2105 .pll = PLL_28,
2106 },
5a25e84b 2107 [BTTV_BOARD_IVC120] = {
2bfa1ac6
MCC
2108 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2109 .name = "IVC-120G",
2110 .video_inputs = 16,
4c548d4b 2111 /* .audio_inputs= 0, */
abb0362f 2112 .tuner_type = TUNER_ABSENT,
2bfa1ac6 2113 .tuner_addr = ADDR_UNSET,
4c548d4b 2114 .svhs = NO_SVHS, /* card has no svhs */
2bfa1ac6
MCC
2115 .needs_tvaudio = 0,
2116 .no_msp34xx = 1,
2bfa1ac6
MCC
2117 .no_tda7432 = 1,
2118 .gpiomask = 0x00,
6f98700a 2119 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2bfa1ac6
MCC
2120 .muxsel_hook = ivc120_muxsel,
2121 .pll = PLL_28,
2122 },
2123
2124 /* ---- card 0x70 ---------------------------------- */
5a25e84b 2125 [BTTV_BOARD_PC_HDTV] = {
2bfa1ac6
MCC
2126 .name = "pcHDTV HD-2000 TV",
2127 .video_inputs = 4,
4c548d4b 2128 /* .audio_inputs= 1, */
2bfa1ac6 2129 .svhs = 2,
6f98700a 2130 .muxsel = MUXSEL(2, 3, 1, 0),
ab8b870e 2131 .tuner_type = TUNER_PHILIPS_FCV1236D,
2bfa1ac6
MCC
2132 .tuner_addr = ADDR_UNSET,
2133 .has_dvb = 1,
2134 },
5a25e84b 2135 [BTTV_BOARD_TWINHAN_DST] = {
2bfa1ac6
MCC
2136 .name = "Twinhan DST + clones",
2137 .no_msp34xx = 1,
2bfa1ac6
MCC
2138 .no_tda7432 = 1,
2139 .tuner_type = TUNER_ABSENT,
2140 .tuner_addr = ADDR_UNSET,
2141 .no_video = 1,
2142 .has_dvb = 1,
2143 },
5a25e84b 2144 [BTTV_BOARD_WINFASTVC100] = {
2bfa1ac6
MCC
2145 .name = "Winfast VC100",
2146 .video_inputs = 3,
4c548d4b 2147 /* .audio_inputs= 0, */
2bfa1ac6 2148 .svhs = 1,
6f98700a
TP
2149 /* Vid In, SVid In, Vid over SVid in connector */
2150 .muxsel = MUXSEL(3, 1, 1, 3),
2bfa1ac6 2151 .no_msp34xx = 1,
2bfa1ac6
MCC
2152 .no_tda7432 = 1,
2153 .tuner_type = TUNER_ABSENT,
2154 .tuner_addr = ADDR_UNSET,
2155 .pll = PLL_28,
2156 },
5a25e84b 2157 [BTTV_BOARD_TEV560] = {
2bfa1ac6
MCC
2158 .name = "Teppro TEV-560/InterVision IV-560",
2159 .video_inputs = 3,
4c548d4b 2160 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2161 .svhs = 2,
2162 .gpiomask = 3,
6f98700a 2163 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 2164 .gpiomux = { 1, 1, 1, 1 },
2bfa1ac6
MCC
2165 .needs_tvaudio = 1,
2166 .tuner_type = TUNER_PHILIPS_PAL,
2167 .tuner_addr = ADDR_UNSET,
2168 .pll = PLL_35,
2169 },
2170
2171 /* ---- card 0x74 ---------------------------------- */
5a25e84b 2172 [BTTV_BOARD_SIMUS_GVC1100] = {
2bfa1ac6
MCC
2173 .name = "SIMUS GVC1100",
2174 .video_inputs = 4,
4c548d4b
TP
2175 /* .audio_inputs= 0, */
2176 .svhs = NO_SVHS,
abb0362f 2177 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2178 .tuner_addr = ADDR_UNSET,
2179 .pll = PLL_28,
6f98700a 2180 .muxsel = MUXSEL(2, 2, 2, 2),
2bfa1ac6
MCC
2181 .gpiomask = 0x3F,
2182 .muxsel_hook = gvc1100_muxsel,
2183 },
5a25e84b 2184 [BTTV_BOARD_NGSTV_PLUS] = {
2bfa1ac6
MCC
2185 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2186 .name = "NGS NGSTV+",
2187 .video_inputs = 3,
2bfa1ac6
MCC
2188 .svhs = 2,
2189 .gpiomask = 0x008007,
6f98700a 2190 .muxsel = MUXSEL(2, 3, 0, 0),
8bf2f8e7
HV
2191 .gpiomux = { 0, 0, 0, 0 },
2192 .gpiomute = 0x000003,
2bfa1ac6
MCC
2193 .pll = PLL_28,
2194 .tuner_type = TUNER_PHILIPS_PAL,
2195 .tuner_addr = ADDR_UNSET,
2196 .has_remote = 1,
2197 },
5a25e84b 2198 [BTTV_BOARD_LMLBT4] = {
2bfa1ac6
MCC
2199 /* http://linuxmedialabs.com */
2200 .name = "LMLBT4",
2201 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
4c548d4b
TP
2202 /* .audio_inputs= 0, */
2203 .svhs = NO_SVHS,
6f98700a 2204 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6 2205 .no_msp34xx = 1,
2bfa1ac6
MCC
2206 .no_tda7432 = 1,
2207 .needs_tvaudio = 0,
abb0362f 2208 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2209 .tuner_addr = ADDR_UNSET,
2210 },
5a25e84b 2211 [BTTV_BOARD_TEKRAM_M205] = {
2bfa1ac6
MCC
2212 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2213 .name = "Tekram M205 PRO",
2214 .video_inputs = 3,
4c548d4b 2215 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2216 .tuner_type = TUNER_PHILIPS_PAL,
2217 .tuner_addr = ADDR_UNSET,
2218 .svhs = 2,
2219 .needs_tvaudio = 0,
2220 .gpiomask = 0x68,
6f98700a 2221 .muxsel = MUXSEL(2, 3, 1),
8bf2f8e7 2222 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2bfa1ac6
MCC
2223 .pll = PLL_28,
2224 },
2225
2226 /* ---- card 0x78 ---------------------------------- */
5a25e84b 2227 [BTTV_BOARD_CONTVFMI] = {
2bfa1ac6
MCC
2228 /* Javier Cendan Ares <jcendan@lycos.es> */
2229 /* bt878 TV + FM without subsystem ID */
2230 .name = "Conceptronic CONTVFMi",
2231 .video_inputs = 3,
4c548d4b 2232 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2233 .svhs = 2,
2234 .gpiomask = 0x008007,
6f98700a 2235 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2236 .gpiomux = { 0, 1, 2, 2 },
2237 .gpiomute = 3,
2bfa1ac6
MCC
2238 .needs_tvaudio = 0,
2239 .pll = PLL_28,
2240 .tuner_type = TUNER_PHILIPS_PAL,
2241 .tuner_addr = ADDR_UNSET,
2242 .has_remote = 1,
2243 .has_radio = 1,
2244 },
5a25e84b 2245 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2bfa1ac6 2246 /*Eric DEBIEF <debief@telemsa.com>*/
25985edc
LDM
2247 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controlled*/
2248 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the following declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
2bfa1ac6
MCC
2249 /*0x79 in bttv.h*/
2250 .name = "Euresys Picolo Tetra",
2251 .video_inputs = 4,
4c548d4b
TP
2252 /* .audio_inputs= 0, */
2253 .svhs = NO_SVHS,
2bfa1ac6
MCC
2254 .gpiomask = 0,
2255 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2256 .no_msp34xx = 1,
2bfa1ac6 2257 .no_tda7432 = 1,
6f98700a
TP
2258 /*878A input is always MUX0, see above.*/
2259 .muxsel = MUXSEL(2, 2, 2, 2),
8bf2f8e7 2260 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2bfa1ac6
MCC
2261 .pll = PLL_28,
2262 .needs_tvaudio = 0,
2263 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
abb0362f 2264 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2265 .tuner_addr = ADDR_UNSET,
2266 },
5a25e84b 2267 [BTTV_BOARD_SPIRIT_TV] = {
2bfa1ac6
MCC
2268 /* Spirit TV Tuner from http://spiritmodems.com.au */
2269 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2270 .name = "Spirit TV Tuner",
2271 .video_inputs = 3,
4c548d4b 2272 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2273 .svhs = 2,
2274 .gpiomask = 0x0000000f,
6f98700a 2275 .muxsel = MUXSEL(2, 1, 1),
8bf2f8e7 2276 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2bfa1ac6
MCC
2277 .tuner_type = TUNER_TEMIC_PAL,
2278 .tuner_addr = ADDR_UNSET,
2279 .no_msp34xx = 1,
2bfa1ac6 2280 },
5a25e84b 2281 [BTTV_BOARD_AVDVBT_771] = {
2bfa1ac6
MCC
2282 /* Wolfram Joost <wojo@frokaschwei.de> */
2283 .name = "AVerMedia AVerTV DVB-T 771",
2284 .video_inputs = 2,
2285 .svhs = 1,
2bfa1ac6
MCC
2286 .tuner_type = TUNER_ABSENT,
2287 .tuner_addr = ADDR_UNSET,
6f98700a 2288 .muxsel = MUXSEL(3, 3),
2bfa1ac6 2289 .no_msp34xx = 1,
2bfa1ac6
MCC
2290 .no_tda7432 = 1,
2291 .pll = PLL_28,
2292 .has_dvb = 1,
2293 .no_gpioirq = 1,
2294 .has_remote = 1,
2295 },
2296 /* ---- card 0x7c ---------------------------------- */
5a25e84b 2297 [BTTV_BOARD_AVDVBT_761] = {
2bfa1ac6 2298 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
5a25e84b 2299 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
2bfa1ac6
MCC
2300 .name = "AverMedia AverTV DVB-T 761",
2301 .video_inputs = 2,
2bfa1ac6 2302 .svhs = 1,
6f98700a 2303 .muxsel = MUXSEL(3, 1, 2, 0), /* Comp0, S-Video, ?, ? */
2bfa1ac6 2304 .no_msp34xx = 1,
2bfa1ac6
MCC
2305 .no_tda7432 = 1,
2306 .pll = PLL_28,
abb0362f 2307 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2308 .tuner_addr = ADDR_UNSET,
2309 .has_dvb = 1,
2310 .no_gpioirq = 1,
2311 .has_remote = 1,
2312 },
5a25e84b 2313 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2bfa1ac6 2314 /* andre.schwarz@matrix-vision.de */
4c548d4b
TP
2315 .name = "MATRIX Vision Sigma-SQ",
2316 .video_inputs = 16,
2317 /* .audio_inputs= 0, */
2318 .svhs = NO_SVHS,
2319 .gpiomask = 0x0,
6f98700a 2320 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
4c548d4b
TP
2321 .muxsel_hook = sigmaSQ_muxsel,
2322 .gpiomux = { 0 },
2323 .no_msp34xx = 1,
2324 .pll = PLL_28,
2325 .tuner_type = TUNER_ABSENT,
2326 .tuner_addr = ADDR_UNSET,
2bfa1ac6 2327 },
5a25e84b 2328 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2bfa1ac6 2329 /* andre.schwarz@matrix-vision.de */
4c548d4b
TP
2330 .name = "MATRIX Vision Sigma-SLC",
2331 .video_inputs = 4,
2332 /* .audio_inputs= 0, */
2333 .svhs = NO_SVHS,
2334 .gpiomask = 0x0,
6f98700a 2335 .muxsel = MUXSEL(2, 2, 2, 2),
4c548d4b
TP
2336 .muxsel_hook = sigmaSLC_muxsel,
2337 .gpiomux = { 0 },
2338 .no_msp34xx = 1,
2339 .pll = PLL_28,
2340 .tuner_type = TUNER_ABSENT,
2341 .tuner_addr = ADDR_UNSET,
2bfa1ac6 2342 },
5a25e84b
MCC
2343 /* BTTV_BOARD_APAC_VIEWCOMP */
2344 [BTTV_BOARD_APAC_VIEWCOMP] = {
2bfa1ac6
MCC
2345 /* Attila Kondoros <attila.kondoros@chello.hu> */
2346 /* bt878 TV + FM 0x00000000 subsystem ID */
2347 .name = "APAC Viewcomp 878(AMAX)",
2348 .video_inputs = 2,
4c548d4b
TP
2349 /* .audio_inputs= 1, */
2350 .svhs = NO_SVHS,
2bfa1ac6 2351 .gpiomask = 0xFF,
6f98700a 2352 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2353 .gpiomux = { 2, 0, 0, 0 },
2354 .gpiomute = 10,
2bfa1ac6
MCC
2355 .needs_tvaudio = 0,
2356 .pll = PLL_28,
2357 .tuner_type = TUNER_PHILIPS_PAL,
2358 .tuner_addr = ADDR_UNSET,
2359 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2360 .has_radio = 1, /* not every card has radio */
2361 },
2362
2363 /* ---- card 0x80 ---------------------------------- */
5a25e84b 2364 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2bfa1ac6
MCC
2365 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2366 .name = "DViCO FusionHDTV DVB-T Lite",
2bfa1ac6 2367 .no_msp34xx = 1,
2bfa1ac6
MCC
2368 .no_tda7432 = 1,
2369 .pll = PLL_28,
2370 .no_video = 1,
2371 .has_dvb = 1,
abb0362f 2372 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2373 .tuner_addr = ADDR_UNSET,
2374 },
5a25e84b 2375 [BTTV_BOARD_VGEAR_MYVCD] = {
2bfa1ac6
MCC
2376 /* Steven <photon38@pchome.com.tw> */
2377 .name = "V-Gear MyVCD",
2378 .video_inputs = 3,
4c548d4b 2379 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2380 .svhs = 2,
2381 .gpiomask = 0x3f,
6f98700a 2382 .muxsel = MUXSEL(2, 3, 1, 0),
8bf2f8e7
HV
2383 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2384 .gpiomute = 0x31,
2bfa1ac6
MCC
2385 .no_msp34xx = 1,
2386 .pll = PLL_28,
2387 .tuner_type = TUNER_PHILIPS_NTSC_M,
2388 .tuner_addr = ADDR_UNSET,
2389 .has_radio = 0,
2bfa1ac6 2390 },
5a25e84b 2391 [BTTV_BOARD_SUPER_TV] = {
2bfa1ac6
MCC
2392 /* Rick C <cryptdragoon@gmail.com> */
2393 .name = "Super TV Tuner",
2394 .video_inputs = 4,
4c548d4b 2395 /* .audio_inputs= 1, */
2bfa1ac6 2396 .svhs = 2,
6f98700a 2397 .muxsel = MUXSEL(2, 3, 1, 0),
2bfa1ac6
MCC
2398 .tuner_type = TUNER_PHILIPS_NTSC,
2399 .tuner_addr = ADDR_UNSET,
2400 .gpiomask = 0x008007,
8bf2f8e7 2401 .gpiomux = { 0, 0x000001,0,0 },
2bfa1ac6
MCC
2402 .needs_tvaudio = 1,
2403 .has_radio = 1,
2404 },
5a25e84b 2405 [BTTV_BOARD_TIBET_CS16] = {
2bfa1ac6
MCC
2406 /* Chris Fanning <video4linux@haydon.net> */
2407 .name = "Tibet Systems 'Progress DVR' CS16",
2408 .video_inputs = 16,
4c548d4b
TP
2409 /* .audio_inputs= 0, */
2410 .svhs = NO_SVHS,
6f98700a 2411 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2bfa1ac6
MCC
2412 .pll = PLL_28,
2413 .no_msp34xx = 1,
2bfa1ac6 2414 .no_tda7432 = 1,
abb0362f 2415 .tuner_type = TUNER_ABSENT,
2bfa1ac6
MCC
2416 .tuner_addr = ADDR_UNSET,
2417 .muxsel_hook = tibetCS16_muxsel,
2418 },
5a25e84b 2419 [BTTV_BOARD_KODICOM_4400R] = {
2bfa1ac6
MCC
2420 /* Bill Brack <wbrack@mmm.com.hk> */
2421 /*
2422 * Note that, because of the card's wiring, the "master"
2423 * BT878A chip (i.e. the one which controls the analog switch
2424 * and must use this card type) is the 2nd one detected. The
2425 * other 3 chips should use card type 0x85, whose description
2426 * follows this one. There is a EEPROM on the card (which is
2427 * connected to the I2C of one of those other chips), but is
2428 * not currently handled. There is also a facility for a
2429 * "monitor", which is also not currently implemented.
2430 */
2431 .name = "Kodicom 4400R (master)",
2432 .video_inputs = 16,
4c548d4b 2433 /* .audio_inputs= 0, */
abb0362f 2434 .tuner_type = TUNER_ABSENT,
2bfa1ac6 2435 .tuner_addr = ADDR_UNSET,
4c548d4b 2436 .svhs = NO_SVHS,
2bfa1ac6
MCC
2437 /* GPIO bits 0-9 used for analog switch:
2438 * 00 - 03: camera selector
2439 * 04 - 06: channel (controller) selector
2440 * 07: data (1->on, 0->off)
2441 * 08: strobe
2442 * 09: reset
2443 * bit 16 is input from sync separator for the channel
2444 */
2445 .gpiomask = 0x0003ff,
2446 .no_gpioirq = 1,
6f98700a 2447 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2bfa1ac6
MCC
2448 .pll = PLL_28,
2449 .no_msp34xx = 1,
2450 .no_tda7432 = 1,
2bfa1ac6
MCC
2451 .muxsel_hook = kodicom4400r_muxsel,
2452 },
5a25e84b 2453 [BTTV_BOARD_KODICOM_4400R_SL] = {
2bfa1ac6
MCC
2454 /* Bill Brack <wbrack@mmm.com.hk> */
2455 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2456 * one which controls the analog switch, and must use the card type)
2457 * is the 2nd one detected. The other 3 chips should use this card
2458 * type
2459 */
2460 .name = "Kodicom 4400R (slave)",
2461 .video_inputs = 16,
4c548d4b 2462 /* .audio_inputs= 0, */
abb0362f 2463 .tuner_type = TUNER_ABSENT,
2bfa1ac6 2464 .tuner_addr = ADDR_UNSET,
4c548d4b 2465 .svhs = NO_SVHS,
2bfa1ac6
MCC
2466 .gpiomask = 0x010000,
2467 .no_gpioirq = 1,
6f98700a 2468 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2bfa1ac6
MCC
2469 .pll = PLL_28,
2470 .no_msp34xx = 1,
2471 .no_tda7432 = 1,
2bfa1ac6
MCC
2472 .muxsel_hook = kodicom4400r_muxsel,
2473 },
2bfa1ac6 2474 /* ---- card 0x86---------------------------------- */
5a25e84b 2475 [BTTV_BOARD_ADLINK_RTV24] = {
2bfa1ac6
MCC
2476 /* Michael Henson <mhenson@clarityvi.com> */
2477 /* Adlink RTV24 with special unlock codes */
2478 .name = "Adlink RTV24",
2479 .video_inputs = 4,
4c548d4b 2480 /* .audio_inputs= 1, */
2bfa1ac6 2481 .svhs = 2,
6f98700a 2482 .muxsel = MUXSEL(2, 3, 1, 0),
8c2c0dfe 2483 .tuner_type = UNSET,
2bfa1ac6
MCC
2484 .tuner_addr = ADDR_UNSET,
2485 .pll = PLL_28,
2486 },
2bfa1ac6 2487 /* ---- card 0x87---------------------------------- */
5a25e84b 2488 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2bfa1ac6
MCC
2489 /* Michael Krufky <mkrufky@m1k.net> */
2490 .name = "DViCO FusionHDTV 5 Lite",
9c26c8b1 2491 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
2bfa1ac6 2492 .tuner_addr = ADDR_UNSET,
4b017415 2493 .video_inputs = 3,
4c548d4b 2494 /* .audio_inputs= 1, */
2bfa1ac6 2495 .svhs = 2,
6f98700a 2496 .muxsel = MUXSEL(2, 3, 1),
2bfa1ac6 2497 .gpiomask = 0x00e00007,
8bf2f8e7
HV
2498 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2499 .gpiomute = 0x00c00007,
2bfa1ac6 2500 .no_msp34xx = 1,
2bfa1ac6
MCC
2501 .no_tda7432 = 1,
2502 .has_dvb = 1,
2503 },
2504 /* ---- card 0x88---------------------------------- */
5a25e84b 2505 [BTTV_BOARD_ACORP_Y878F] = {
2e7c6dc3 2506 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2bfa1ac6
MCC
2507 .name = "Acorp Y878F",
2508 .video_inputs = 3,
4c548d4b 2509 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2510 .svhs = 2,
2511 .gpiomask = 0x01fe00,
6f98700a 2512 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2513 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2514 .gpiomute = 0x002000,
2bfa1ac6
MCC
2515 .needs_tvaudio = 1,
2516 .pll = PLL_28,
2517 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2518 .tuner_addr = 0xc1 >>1,
2519 .has_radio = 1,
2520 },
2521 /* ---- card 0x89 ---------------------------------- */
5a25e84b 2522 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2bfa1ac6
MCC
2523 .name = "Conceptronic CTVFMi v2",
2524 .video_inputs = 3,
4c548d4b 2525 /* .audio_inputs= 1, */
2bfa1ac6
MCC
2526 .svhs = 2,
2527 .gpiomask = 0x001c0007,
6f98700a 2528 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2529 .gpiomux = { 0, 1, 2, 2 },
2530 .gpiomute = 3,
2bfa1ac6
MCC
2531 .needs_tvaudio = 0,
2532 .pll = PLL_28,
24d41228 2533 .tuner_type = TUNER_TENA_9533_DI,
2bfa1ac6
MCC
2534 .tuner_addr = ADDR_UNSET,
2535 .has_remote = 1,
2bfa1ac6 2536 .has_radio = 1,
2bfa1ac6 2537 },
10c2c8b1 2538 /* ---- card 0x8a ---------------------------------- */
5a25e84b 2539 [BTTV_BOARD_PV_BT878P_2E] = {
4c548d4b
TP
2540 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2541 .video_inputs = 5,
2542 /* .audio_inputs= 1, */
2543 .svhs = 3,
5221e21e 2544 .has_dig_in = 1,
4c548d4b 2545 .gpiomask = 0x01fe00,
6f98700a 2546 .muxsel = MUXSEL(2, 3, 1, 1, 0), /* in 4 is digital */
4c548d4b
TP
2547 /* .digital_mode= DIGITAL_MODE_CAMERA, */
2548 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2549 .gpiomute = 0x12400,
2550 .no_msp34xx = 1,
2551 .pll = PLL_28,
2552 .tuner_type = TUNER_LG_PAL_FM,
2553 .tuner_addr = ADDR_UNSET,
2554 .has_remote = 1,
10c2c8b1
MCC
2555 },
2556 /* ---- card 0x8b ---------------------------------- */
2557 [BTTV_BOARD_PV_M4900] = {
96de0e25 2558 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
10c2c8b1
MCC
2559 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2560 .video_inputs = 3,
4c548d4b 2561 /* .audio_inputs= 1, */
10c2c8b1
MCC
2562 .svhs = 2,
2563 .gpiomask = 0x3f,
6f98700a 2564 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2565 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2566 .gpiomute = 0x29,
10c2c8b1
MCC
2567 .no_msp34xx = 1,
2568 .pll = PLL_28,
2569 .tuner_type = TUNER_YMEC_TVF_5533MF,
2570 .tuner_addr = ADDR_UNSET,
10c2c8b1
MCC
2571 .has_radio = 1,
2572 .has_remote = 1,
f718e6e7 2573 },
cf583ac4 2574 /* ---- card 0x8c ---------------------------------- */
cf784d55
TP
2575 /* Has four Bt878 chips behind a PCI bridge, each chip has:
2576 one external BNC composite input (mux 2)
2577 three internal composite inputs (unknown muxes)
2578 an 18-bit stereo A/D (CS5331A), which has:
2579 one external stereo unblanced (RCA) audio connection
2580 one (or 3?) internal stereo balanced (XLR) audio connection
2581 input is selected via gpio to a 14052B mux
2582 (mask=0x300, unbal=0x000, bal=0x100, ??=0x200,0x300)
2583 gain is controlled via an X9221A chip on the I2C bus @0x28
2584 sample rate is controlled via gpio to an MK1413S
2585 (mask=0x3, 32kHz=0x0, 44.1kHz=0x1, 48kHz=0x2, ??=0x3)
2586 There is neither a tuner nor an svideo input. */
f718e6e7
KA
2587 [BTTV_BOARD_OSPREY440] = {
2588 .name = "Osprey 440",
cf784d55 2589 .video_inputs = 4,
4c548d4b
TP
2590 /* .audio_inputs= 2, */
2591 .svhs = NO_SVHS,
6f98700a 2592 .muxsel = MUXSEL(2, 3, 0, 1), /* 3,0,1 are guesses */
cf784d55
TP
2593 .gpiomask = 0x303,
2594 .gpiomute = 0x000, /* int + 32kHz */
2595 .gpiomux = { 0, 0, 0x000, 0x100},
f718e6e7 2596 .pll = PLL_28,
abb0362f 2597 .tuner_type = TUNER_ABSENT,
f718e6e7 2598 .tuner_addr = ADDR_UNSET,
f718e6e7 2599 .no_msp34xx = 1,
f718e6e7
KA
2600 .no_tda7432 = 1,
2601 },
71633c05 2602 /* ---- card 0x8d ---------------------------------- */
2603 [BTTV_BOARD_ASOUND_SKYEYE] = {
2604 .name = "Asound Skyeye PCTV",
2605 .video_inputs = 3,
4c548d4b 2606 /* .audio_inputs= 1, */
71633c05 2607 .svhs = 2,
2608 .gpiomask = 15,
6f98700a 2609 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2610 .gpiomux = { 2, 0, 0, 0 },
2611 .gpiomute = 1,
71633c05 2612 .needs_tvaudio = 1,
2613 .pll = PLL_28,
8c2c0dfe 2614 .tuner_type = TUNER_PHILIPS_NTSC,
71633c05 2615 .tuner_addr = ADDR_UNSET,
71633c05 2616 },
633323ff
BP
2617 /* ---- card 0x8e ---------------------------------- */
2618 [BTTV_BOARD_SABRENT_TVFM] = {
2619 .name = "Sabrent TV-FM (bttv version)",
2620 .video_inputs = 3,
4c548d4b 2621 /* .audio_inputs= 1, */
633323ff
BP
2622 .svhs = 2,
2623 .gpiomask = 0x108007,
6f98700a 2624 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7 2625 .gpiomux = { 100000, 100002, 100002, 100000 },
633323ff 2626 .no_msp34xx = 1,
633323ff
BP
2627 .no_tda7432 = 1,
2628 .pll = PLL_28,
2629 .tuner_type = TUNER_TNF_5335MF,
2630 .tuner_addr = ADDR_UNSET,
2631 .has_radio = 1,
2632 },
cd1257d8
ST
2633 /* ---- card 0x8f ---------------------------------- */
2634 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2635 .name = "Hauppauge ImpactVCB (bt878)",
2636 .video_inputs = 4,
4c548d4b
TP
2637 /* .audio_inputs= 0, */
2638 .svhs = NO_SVHS,
cd1257d8 2639 .gpiomask = 0x0f, /* old: 7 */
6f98700a 2640 .muxsel = MUXSEL(0, 1, 3, 2), /* Composite 0-3 */
cd1257d8 2641 .no_msp34xx = 1,
cd1257d8 2642 .no_tda7432 = 1,
abb0362f 2643 .tuner_type = TUNER_ABSENT,
cd1257d8 2644 .tuner_addr = ADDR_UNSET,
cd1257d8 2645 },
2d05ae6b
JC
2646 [BTTV_BOARD_MACHTV_MAGICTV] = {
2647 /* Julian Calaby <julian.calaby@gmail.com>
2648 * Slightly different from original MachTV definition (0x60)
2649
2650 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2651 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2652 * properly (methinks) causing no keyup bits being set */
2653
2654 .name = "MagicTV", /* rebranded MachTV */
2655 .video_inputs = 3,
4c548d4b 2656 /* .audio_inputs= 1, */
2d05ae6b
JC
2657 .svhs = 2,
2658 .gpiomask = 7,
6f98700a 2659 .muxsel = MUXSEL(2, 3, 1, 1),
8bf2f8e7
HV
2660 .gpiomux = { 0, 1, 2, 3 },
2661 .gpiomute = 4,
2d05ae6b
JC
2662 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2663 .tuner_addr = ADDR_UNSET,
2d05ae6b
JC
2664 .pll = PLL_28,
2665 .has_radio = 1,
2666 .has_remote = 1,
2667 },
1ebba670
SA
2668 [BTTV_BOARD_SSAI_SECURITY] = {
2669 .name = "SSAI Security Video Interface",
2670 .video_inputs = 4,
4c548d4b
TP
2671 /* .audio_inputs= 0, */
2672 .svhs = NO_SVHS,
6f98700a 2673 .muxsel = MUXSEL(0, 1, 2, 3),
abb0362f 2674 .tuner_type = TUNER_ABSENT,
1ebba670 2675 .tuner_addr = ADDR_UNSET,
1ebba670
SA
2676 },
2677 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2678 .name = "SSAI Ultrasound Video Interface",
2679 .video_inputs = 2,
4c548d4b 2680 /* .audio_inputs= 0, */
1ebba670 2681 .svhs = 1,
6f98700a 2682 .muxsel = MUXSEL(2, 0, 1, 3),
abb0362f 2683 .tuner_type = TUNER_ABSENT,
1ebba670 2684 .tuner_addr = ADDR_UNSET,
1ebba670 2685 },
27cb786f
MK
2686 /* ---- card 0x94---------------------------------- */
2687 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2688 .name = "DViCO FusionHDTV 2",
ab8b870e 2689 .tuner_type = TUNER_PHILIPS_FCV1236D,
27cb786f 2690 .tuner_addr = ADDR_UNSET,
27cb786f 2691 .video_inputs = 3,
4c548d4b 2692 /* .audio_inputs= 1, */
27cb786f 2693 .svhs = 2,
6f98700a 2694 .muxsel = MUXSEL(2, 3, 1),
27cb786f
MK
2695 .gpiomask = 0x00e00007,
2696 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2697 .gpiomute = 0x00c00007,
2698 .no_msp34xx = 1,
27cb786f
MK
2699 .no_tda7432 = 1,
2700 },
b5457b7b
SS
2701 /* ---- card 0x95---------------------------------- */
2702 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2703 .name = "Typhoon TV-Tuner PCI (50684)",
2704 .video_inputs = 3,
4c548d4b 2705 /* .audio_inputs= 1, */
b5457b7b
SS
2706 .svhs = 2,
2707 .gpiomask = 0x3014f,
6f98700a 2708 .muxsel = MUXSEL(2, 3, 1, 1),
b5457b7b
SS
2709 .gpiomux = { 0x20001,0x10001, 0, 0 },
2710 .gpiomute = 10,
2711 .needs_tvaudio = 1,
2712 .pll = PLL_28,
2713 .tuner_type = TUNER_PHILIPS_PAL_I,
2714 .tuner_addr = ADDR_UNSET,
b5457b7b 2715 },
97275ac5
EHN
2716 [BTTV_BOARD_GEOVISION_GV600] = {
2717 /* emhn@usb.ve */
4c548d4b
TP
2718 .name = "Geovision GV-600",
2719 .video_inputs = 16,
2720 /* .audio_inputs= 0, */
2721 .svhs = NO_SVHS,
2722 .gpiomask = 0x0,
6f98700a 2723 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
4c548d4b
TP
2724 .muxsel_hook = geovision_muxsel,
2725 .gpiomux = { 0 },
2726 .no_msp34xx = 1,
2727 .pll = PLL_28,
2728 .tuner_type = TUNER_ABSENT,
2729 .tuner_addr = ADDR_UNSET,
97275ac5 2730 },
e80faad3
ML
2731 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2732 /* Mauro Lacy <mauro@lacy.com.ar>
2733 * Based on MagicTV and Conceptronic CONTVFMi */
2734
2735 .name = "Kozumi KTV-01C",
2736 .video_inputs = 3,
4c548d4b 2737 /* .audio_inputs= 1, */
e80faad3
ML
2738 .svhs = 2,
2739 .gpiomask = 0x008007,
6f98700a 2740 .muxsel = MUXSEL(2, 3, 1, 1),
e80faad3 2741 .gpiomux = { 0, 1, 2, 2 }, /* CONTVFMi */
e80faad3 2742 .gpiomute = 3, /* CONTVFMi */
e80faad3
ML
2743 .needs_tvaudio = 0,
2744 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3, /* TCL MK3 */
2745 .tuner_addr = ADDR_UNSET,
e80faad3
ML
2746 .pll = PLL_28,
2747 .has_radio = 1,
2748 .has_remote = 1,
2749 },
7d341a6a
MCC
2750 [BTTV_BOARD_ENLTV_FM_2] = {
2751 /* Encore TV Tuner Pro ENL TV-FM-2
2752 Mauro Carvalho Chehab <mchehab@infradead.org */
2753 .name = "Encore ENL TV-FM-2",
2754 .video_inputs = 3,
4c548d4b 2755 /* .audio_inputs= 1, */
7d341a6a
MCC
2756 .svhs = 2,
2757 /* bit 6 -> IR disabled
2758 bit 18/17 = 00 -> mute
2759 01 -> enable external audio input
2760 10 -> internal audio input (mono?)
2761 11 -> internal audio input
2762 */
2763 .gpiomask = 0x060040,
6f98700a 2764 .muxsel = MUXSEL(2, 3, 3),
7d341a6a
MCC
2765 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2766 .gpiomute = 0,
2767 .tuner_type = TUNER_TCL_MF02GIP_5N,
2768 .tuner_addr = ADDR_UNSET,
7d341a6a
MCC
2769 .pll = PLL_28,
2770 .has_radio = 1,
2771 .has_remote = 1,
05583625
DH
2772 },
2773 [BTTV_BOARD_VD012] = {
2774 /* D.Heer@Phytec.de */
2775 .name = "PHYTEC VD-012 (bt878)",
2776 .video_inputs = 4,
4c548d4b
TP
2777 /* .audio_inputs= 0, */
2778 .svhs = NO_SVHS,
05583625 2779 .gpiomask = 0x00,
6f98700a 2780 .muxsel = MUXSEL(0, 2, 3, 1),
05583625
DH
2781 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2782 .needs_tvaudio = 0,
2783 .pll = PLL_28,
abb0362f 2784 .tuner_type = TUNER_ABSENT,
05583625 2785 .tuner_addr = ADDR_UNSET,
05583625
DH
2786 },
2787 [BTTV_BOARD_VD012_X1] = {
2788 /* D.Heer@Phytec.de */
2789 .name = "PHYTEC VD-012-X1 (bt878)",
2790 .video_inputs = 4,
4c548d4b 2791 /* .audio_inputs= 0, */
05583625
DH
2792 .svhs = 3,
2793 .gpiomask = 0x00,
6f98700a 2794 .muxsel = MUXSEL(2, 3, 1),
05583625
DH
2795 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2796 .needs_tvaudio = 0,
2797 .pll = PLL_28,
abb0362f 2798 .tuner_type = TUNER_ABSENT,
05583625 2799 .tuner_addr = ADDR_UNSET,
05583625
DH
2800 },
2801 [BTTV_BOARD_VD012_X2] = {
2802 /* D.Heer@Phytec.de */
2803 .name = "PHYTEC VD-012-X2 (bt878)",
2804 .video_inputs = 4,
4c548d4b 2805 /* .audio_inputs= 0, */
05583625
DH
2806 .svhs = 3,
2807 .gpiomask = 0x00,
6f98700a 2808 .muxsel = MUXSEL(3, 2, 1),
05583625
DH
2809 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
2810 .needs_tvaudio = 0,
2811 .pll = PLL_28,
abb0362f 2812 .tuner_type = TUNER_ABSENT,
05583625 2813 .tuner_addr = ADDR_UNSET,
0c5db425
BC
2814 },
2815 [BTTV_BOARD_GEOVISION_GV800S] = {
2816 /* Bruno Christo <bchristo@inf.ufsm.br>
2817 *
2818 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2819 * 1 audio input per BT878A = 4 audio inputs
2820 * 4 video inputs per BT878A = 16 video inputs
2821 * This is the first BT878A chip of the GV-800(S). It's the
2822 * "master" chip and it controls the video inputs through an
2823 * analog multiplexer (a CD22M3494) via some GPIO pins. The
2824 * slaves should use card type 0x9e (following this one).
2825 * There is a EEPROM on the card which is currently not handled.
2826 * The audio input is not working yet.
2827 */
2828 .name = "Geovision GV-800(S) (master)",
2829 .video_inputs = 4,
2830 /* .audio_inputs= 1, */
2831 .tuner_type = TUNER_ABSENT,
2832 .tuner_addr = ADDR_UNSET,
2833 .svhs = NO_SVHS,
2834 .gpiomask = 0xf107f,
2835 .no_gpioirq = 1,
2836 .muxsel = MUXSEL(2, 2, 2, 2),
2837 .pll = PLL_28,
2838 .no_msp34xx = 1,
2839 .no_tda7432 = 1,
0c5db425
BC
2840 .muxsel_hook = gv800s_muxsel,
2841 },
2842 [BTTV_BOARD_GEOVISION_GV800S_SL] = {
2843 /* Bruno Christo <bchristo@inf.ufsm.br>
2844 *
2845 * GeoVision GV-800(S) has 4 Conexant Fusion 878A:
2846 * 1 audio input per BT878A = 4 audio inputs
2847 * 4 video inputs per BT878A = 16 video inputs
2848 * The 3 other BT878A chips are "slave" chips of the GV-800(S)
2849 * and should use this card type.
2850 * The audio input is not working yet.
2851 */
2852 .name = "Geovision GV-800(S) (slave)",
2853 .video_inputs = 4,
2854 /* .audio_inputs= 1, */
2855 .tuner_type = TUNER_ABSENT,
2856 .tuner_addr = ADDR_UNSET,
2857 .svhs = NO_SVHS,
2858 .gpiomask = 0x00,
2859 .no_gpioirq = 1,
2860 .muxsel = MUXSEL(2, 2, 2, 2),
2861 .pll = PLL_28,
2862 .no_msp34xx = 1,
2863 .no_tda7432 = 1,
0c5db425
BC
2864 .muxsel_hook = gv800s_muxsel,
2865 },
dceaddb9
AM
2866 [BTTV_BOARD_PV183] = {
2867 .name = "ProVideo PV183", /* 0x9f */
2868 .video_inputs = 2,
2869 /* .audio_inputs= 0, */
2870 .svhs = NO_SVHS,
2871 .gpiomask = 0,
2872 .muxsel = MUXSEL(2, 3),
2873 .gpiomux = { 0 },
2874 .needs_tvaudio = 0,
2875 .no_msp34xx = 1,
2876 .pll = PLL_28,
2877 .tuner_type = TUNER_ABSENT,
2878 .tuner_addr = ADDR_UNSET,
2879 },
10c2c8b1 2880};
1da177e4
LT
2881
2882static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2883
2884/* ----------------------------------------------------------------------- */
2885
2886static unsigned char eeprom_data[256];
2887
2888/*
2889 * identify card
2890 */
2891void __devinit bttv_idcard(struct bttv *btv)
2892{
2893 unsigned int gpiobits;
2894 int i,type;
2895 unsigned short tmp;
2896
2897 /* read PCI subsystem ID */
2898 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2899 btv->cardid = tmp << 16;
2900 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2901 btv->cardid |= tmp;
2902
2903 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2904 /* look for the card */
2905 for (type = -1, i = 0; cards[i].id != 0; i++)
2906 if (cards[i].id == btv->cardid)
2907 type = i;
2908
2909 if (type != -1) {
2910 /* found it */
2911 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2912 "PCI subsystem ID is %04x:%04x\n",
2913 btv->c.nr,cards[type].name,cards[type].cardnr,
2914 btv->cardid & 0xffff,
2915 (btv->cardid >> 16) & 0xffff);
2916 btv->c.type = cards[type].cardnr;
2917 } else {
2918 /* 404 */
2919 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2920 btv->c.nr, btv->cardid & 0xffff,
2921 (btv->cardid >> 16) & 0xffff);
2922 printk(KERN_DEBUG "please mail id, board name and "
15965f06 2923 "the correct card= insmod option to linux-media@vger.kernel.org\n");
1da177e4
LT
2924 }
2925 }
2926
2927 /* let the user override the autodetected type */
2928 if (card[btv->c.nr] < bttv_num_tvcards)
2929 btv->c.type=card[btv->c.nr];
2930
2931 /* print which card config we are using */
2932 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2933 bttv_tvcards[btv->c.type].name, btv->c.type,
2934 card[btv->c.nr] < bttv_num_tvcards
2935 ? "insmod option" : "autodetected");
2936
2937 /* overwrite gpio stuff ?? */
2938 if (UNSET == audioall && UNSET == audiomux[0])
2939 return;
2940
2941 if (UNSET != audiomux[0]) {
2942 gpiobits = 0;
57747b7f 2943 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
8bf2f8e7 2944 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
1da177e4
LT
2945 gpiobits |= audiomux[i];
2946 }
2947 } else {
2948 gpiobits = audioall;
57747b7f 2949 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
8bf2f8e7 2950 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
1da177e4
LT
2951 }
2952 }
2953 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2954 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2955 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
57747b7f 2956 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
8bf2f8e7 2957 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
1da177e4
LT
2958 }
2959 printk("\n");
2960}
2961
2962/*
2963 * (most) board specific initialisations goes here
2964 */
2965
2966/* Some Modular Technology cards have an eeprom, but no subsystem ID */
943a4902 2967static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
1da177e4
LT
2968{
2969 int type = -1;
2970
2971 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
5a25e84b 2972 type = BTTV_BOARD_MODTEC_205;
1da177e4 2973 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
5a25e84b 2974 type = BTTV_BOARD_EURESYS_PICOLO;
1da177e4 2975 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
4ac97914 2976 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
1da177e4
LT
2977
2978 if (-1 != type) {
2979 btv->c.type = type;
2980 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2981 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2982 }
2983}
2984
2985static void flyvideo_gpio(struct bttv *btv)
2986{
c6eb8eaf
HV
2987 int gpio, has_remote, has_radio, is_capture_only;
2988 int is_lr90, has_tda9820_tda9821;
2989 int tuner_type = UNSET, ttype;
1da177e4
LT
2990
2991 gpio_inout(0xffffff, 0);
24a70fdc 2992 udelay(8); /* without this we would see the 0x1800 mask */
1da177e4
LT
2993 gpio = gpio_read();
2994 /* FIXME: must restore OUR_EN ??? */
2995
24a70fdc
MCC
2996 /* all cards provide GPIO info, some have an additional eeprom
2997 * LR50: GPIO coding can be found lower right CP1 .. CP9
2998 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2999 * GPIO14-12: n.c.
3000 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
1da177e4 3001
24a70fdc
MCC
3002 * lowest 3 bytes are remote control codes (no handshake needed)
3003 * xxxFFF: No remote control chip soldered
3004 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3005 * Note: Some bits are Audio_Mask !
3006 */
c6eb8eaf
HV
3007 ttype = (gpio & 0x0f0000) >> 16;
3008 switch (ttype) {
3009 case 0x0:
3010 tuner_type = 2; /* NTSC, e.g. TPI8NSR11P */
1da177e4 3011 break;
c6eb8eaf
HV
3012 case 0x2:
3013 tuner_type = 39; /* LG NTSC (newer TAPC series) TAPC-H701P */
1da177e4 3014 break;
c6eb8eaf
HV
3015 case 0x4:
3016 tuner_type = 5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
1da177e4 3017 break;
c6eb8eaf
HV
3018 case 0x6:
3019 tuner_type = 37; /* LG PAL (newer TAPC series) TAPC-G702P */
1da177e4 3020 break;
c6eb8eaf
HV
3021 case 0xC:
3022 tuner_type = 3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
1da177e4
LT
3023 break;
3024 default:
3025 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
c6eb8eaf 3026 break;
1da177e4
LT
3027 }
3028
3029 has_remote = gpio & 0x800000;
3030 has_radio = gpio & 0x400000;
24a70fdc
MCC
3031 /* unknown 0x200000;
3032 * unknown2 0x100000; */
4ac97914 3033 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
1da177e4 3034 has_tda9820_tda9821 = !(gpio & 0x004000);
24a70fdc
MCC
3035 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3036 /*
3037 * gpio & 0x001000 output bit for audio routing */
1da177e4 3038
c6eb8eaf
HV
3039 if (is_capture_only)
3040 tuner_type = TUNER_ABSENT; /* No tuner present */
1da177e4
LT
3041
3042 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
c6eb8eaf
HV
3043 btv->c.nr, has_radio ? "yes" : "no ",
3044 has_remote ? "yes" : "no ", tuner_type, gpio);
1da177e4 3045 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
c6eb8eaf
HV
3046 btv->c.nr, is_lr90 ? "yes" : "no ",
3047 has_tda9820_tda9821 ? "yes" : "no ",
3048 is_capture_only ? "yes" : "no ");
1da177e4 3049
c6eb8eaf
HV
3050 if (tuner_type != UNSET) /* only set if known tuner autodetected, else let insmod option through */
3051 btv->tuner_type = tuner_type;
1da177e4
LT
3052 btv->has_radio = has_radio;
3053
24a70fdc
MCC
3054 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3055 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3056 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
c6eb8eaf
HV
3057 if (has_tda9820_tda9821)
3058 btv->audio_mode_gpio = lt9415_audio;
4b9b936f 3059 /* todo: if(has_tda9874) btv->audio_mode_gpio = fv2000s_audio; */
1da177e4
LT
3060}
3061
3062static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3063 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3064static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3065 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3066
3067static void miro_pinnacle_gpio(struct bttv *btv)
3068{
3069 int id,msp,gpio;
3070 char *info;
3071
3072 gpio_inout(0xffffff, 0);
4ac97914 3073 gpio = gpio_read();
1da177e4 3074 id = ((gpio>>10) & 63) -1;
09df1c16 3075 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
1da177e4
LT
3076 if (id < 32) {
3077 btv->tuner_type = miro_tunermap[id];
3078 if (0 == (gpio & 0x20)) {
3079 btv->has_radio = 1;
3080 if (!miro_fmtuner[id]) {
3081 btv->has_matchbox = 1;
3082 btv->mbox_we = (1<<6);
3083 btv->mbox_most = (1<<7);
3084 btv->mbox_clk = (1<<8);
3085 btv->mbox_data = (1<<9);
3086 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3087 }
3088 } else {
3089 btv->has_radio = 0;
3090 }
3091 if (-1 != msp) {
5a25e84b
MCC
3092 if (btv->c.type == BTTV_BOARD_MIRO)
3093 btv->c.type = BTTV_BOARD_MIROPRO;
3094 if (btv->c.type == BTTV_BOARD_PINNACLE)
3095 btv->c.type = BTTV_BOARD_PINNACLEPRO;
1da177e4
LT
3096 }
3097 printk(KERN_INFO
3098 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3099 btv->c.nr, id+1, btv->tuner_type,
3100 !btv->has_radio ? "no" :
3101 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3102 (-1 == msp) ? "no" : "yes");
3103 } else {
3104 /* new cards with microtune tuner */
3105 id = 63 - id;
3106 btv->has_radio = 0;
3107 switch (id) {
3108 case 1:
3109 info = "PAL / mono";
39e8f40d 3110 btv->tda9887_conf = TDA9887_INTERCARRIER;
1da177e4
LT
3111 break;
3112 case 2:
3113 info = "PAL+SECAM / stereo";
3114 btv->has_radio = 1;
39e8f40d 3115 btv->tda9887_conf = TDA9887_QSS;
1da177e4
LT
3116 break;
3117 case 3:
3118 info = "NTSC / stereo";
3119 btv->has_radio = 1;
39e8f40d 3120 btv->tda9887_conf = TDA9887_QSS;
1da177e4
LT
3121 break;
3122 case 4:
3123 info = "PAL+SECAM / mono";
39e8f40d 3124 btv->tda9887_conf = TDA9887_QSS;
1da177e4
LT
3125 break;
3126 case 5:
3127 info = "NTSC / mono";
39e8f40d 3128 btv->tda9887_conf = TDA9887_INTERCARRIER;
1da177e4
LT
3129 break;
3130 case 6:
3131 info = "NTSC / stereo";
39e8f40d 3132 btv->tda9887_conf = TDA9887_INTERCARRIER;
1da177e4
LT
3133 break;
3134 case 7:
3135 info = "PAL / stereo";
39e8f40d 3136 btv->tda9887_conf = TDA9887_INTERCARRIER;
1da177e4
LT
3137 break;
3138 default:
3139 info = "oops: unknown card";
3140 break;
3141 }
3142 if (-1 != msp)
5a25e84b 3143 btv->c.type = BTTV_BOARD_PINNACLEPRO;
1da177e4
LT
3144 printk(KERN_INFO
3145 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3146 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
39e8f40d 3147 btv->tuner_type = TUNER_MT2032;
1da177e4
LT
3148 }
3149}
3150
3151/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3152#define LM1882_SYNC_DRIVE 0x200000L
3153
3154static void init_ids_eagle(struct bttv *btv)
3155{
3156 gpio_inout(0xffffff,0xFFFF37);
3157 gpio_write(0x200020);
3158
3159 /* flash strobe inverter ?! */
3160 gpio_write(0x200024);
3161
3162 /* switch sync drive off */
3163 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3164
3165 /* set BT848 muxel to 2 */
3166 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3167}
3168
3169/* Muxsel helper for the IDS Eagle.
3170 * the eagles does not use the standard muxsel-bits but
3171 * has its own multiplexer */
3172static void eagle_muxsel(struct bttv *btv, unsigned int input)
3173{
430390e6 3174 gpio_bits(3, input & 3);
1da177e4 3175
b930e1d8
MK
3176 /* composite */
3177 /* set chroma ADC to sleep */
3178 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3179 /* set to composite video */
3180 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3181 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3182
3183 /* switch sync drive off */
3184 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
1da177e4
LT
3185}
3186
3187static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3188{
4ac97914 3189 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
1da177e4
LT
3190 gpio_write(masks[input%4]);
3191}
3192
3193/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3194 alarms output
3195
3196 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3197 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3198
3199 IN - sensor inputs, INx - sensor inputs and TI XORed together
3200 O1,O2,O3 - alarm outputs (relays)
3201
3202 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3203
3204*/
3205
3206static void init_lmlbt4x(struct bttv *btv)
3207{
3208 printk(KERN_DEBUG "LMLBT4x init\n");
3209 btwrite(0x000000, BT848_GPIO_REG_INP);
3210 gpio_inout(0xffffff, 0x0006C0);
3211 gpio_write(0x000000);
3212}
3213
3214static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3215{
3216 unsigned int inmux = input % 8;
3217 gpio_inout( 0xf, 0xf );
3218 gpio_bits( 0xf, inmux );
3219}
3220
3221static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3222{
3223 unsigned int inmux = input % 4;
3224 gpio_inout( 3<<9, 3<<9 );
3225 gpio_bits( 3<<9, inmux<<9 );
3226}
3227
97275ac5
EHN
3228static void geovision_muxsel(struct bttv *btv, unsigned int input)
3229{
3230 unsigned int inmux = input % 16;
3231 gpio_inout(0xf, 0xf);
3232 gpio_bits(0xf, inmux);
3233}
3234
1da177e4
LT
3235/* ----------------------------------------------------------------------- */
3236
3237static void bttv_reset_audio(struct bttv *btv)
3238{
3239 /*
3240 * BT878A has a audio-reset register.
3241 * 1. This register is an audio reset function but it is in
3242 * function-0 (video capture) address space.
3243 * 2. It is enough to do this once per power-up of the card.
3244 * 3. There is a typo in the Conexant doc -- it is not at
3245 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3246 * --//Shrikumar 030609
3247 */
3248 if (btv->id != 878)
3249 return;
3250
3251 if (bttv_debug)
3252 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3253 btwrite((1<<7), 0x058);
3254 udelay(10);
3255 btwrite( 0, 0x058);
3256}
3257
3258/* initialization part one -- before registering i2c bus */
3259void __devinit bttv_init_card1(struct bttv *btv)
3260{
3261 switch (btv->c.type) {
5a25e84b
MCC
3262 case BTTV_BOARD_HAUPPAUGE:
3263 case BTTV_BOARD_HAUPPAUGE878:
4ac97914 3264 boot_msp34xx(btv,5);
1da177e4 3265 break;
434b2526 3266 case BTTV_BOARD_VOODOOTV_200:
5a25e84b 3267 case BTTV_BOARD_VOODOOTV_FM:
4ac97914 3268 boot_msp34xx(btv,20);
1da177e4 3269 break;
5a25e84b 3270 case BTTV_BOARD_AVERMEDIA98:
1da177e4
LT
3271 boot_msp34xx(btv,11);
3272 break;
5a25e84b 3273 case BTTV_BOARD_HAUPPAUGEPVR:
1da177e4
LT
3274 pvr_boot(btv);
3275 break;
5a25e84b
MCC
3276 case BTTV_BOARD_TWINHAN_DST:
3277 case BTTV_BOARD_AVDVBT_771:
3278 case BTTV_BOARD_PINNACLESAT:
1da177e4
LT
3279 btv->use_i2c_hw = 1;
3280 break;
5a25e84b 3281 case BTTV_BOARD_ADLINK_RTV24:
7c08fb02
MK
3282 init_RTV24( btv );
3283 break;
2d03e289 3284
1da177e4
LT
3285 }
3286 if (!bttv_tvcards[btv->c.type].has_dvb)
3287 bttv_reset_audio(btv);
3288}
3289
3290/* initialization part two -- after registering i2c bus */
3291void __devinit bttv_init_card2(struct bttv *btv)
3292{
ac7dc845 3293 btv->tuner_type = UNSET;
1da177e4 3294
5a25e84b 3295 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
1da177e4
LT
3296 bttv_readee(btv,eeprom_data,0xa0);
3297 identify_by_eeprom(btv,eeprom_data);
3298 }
3299
3300 switch (btv->c.type) {
5a25e84b
MCC
3301 case BTTV_BOARD_MIRO:
3302 case BTTV_BOARD_MIROPRO:
3303 case BTTV_BOARD_PINNACLE:
3304 case BTTV_BOARD_PINNACLEPRO:
1da177e4
LT
3305 /* miro/pinnacle */
3306 miro_pinnacle_gpio(btv);
3307 break;
5a25e84b
MCC
3308 case BTTV_BOARD_FLYVIDEO_98:
3309 case BTTV_BOARD_MAXI:
3310 case BTTV_BOARD_LIFE_FLYKIT:
3311 case BTTV_BOARD_FLYVIDEO:
3312 case BTTV_BOARD_TYPHOON_TVIEW:
3313 case BTTV_BOARD_CHRONOS_VS2:
3314 case BTTV_BOARD_FLYVIDEO_98FM:
3315 case BTTV_BOARD_FLYVIDEO2000:
3316 case BTTV_BOARD_FLYVIDEO98EZ:
3317 case BTTV_BOARD_CONFERENCETV:
3318 case BTTV_BOARD_LIFETEC_9415:
1da177e4
LT
3319 flyvideo_gpio(btv);
3320 break;
5a25e84b
MCC
3321 case BTTV_BOARD_HAUPPAUGE:
3322 case BTTV_BOARD_HAUPPAUGE878:
3323 case BTTV_BOARD_HAUPPAUGEPVR:
1da177e4
LT
3324 /* pick up some config infos from the eeprom */
3325 bttv_readee(btv,eeprom_data,0xa0);
4ac97914 3326 hauppauge_eeprom(btv);
1da177e4 3327 break;
5a25e84b
MCC
3328 case BTTV_BOARD_AVERMEDIA98:
3329 case BTTV_BOARD_AVPHONE98:
1da177e4
LT
3330 bttv_readee(btv,eeprom_data,0xa0);
3331 avermedia_eeprom(btv);
3332 break;
5a25e84b 3333 case BTTV_BOARD_PXC200:
1da177e4
LT
3334 init_PXC200(btv);
3335 break;
5a25e84b 3336 case BTTV_BOARD_PICOLO_TETRA_CHIP:
1da177e4
LT
3337 picolo_tetra_init(btv);
3338 break;
5a25e84b 3339 case BTTV_BOARD_VHX:
1da177e4
LT
3340 btv->has_radio = 1;
3341 btv->has_matchbox = 1;
3342 btv->mbox_we = 0x20;
3343 btv->mbox_most = 0;
3344 btv->mbox_clk = 0x08;
3345 btv->mbox_data = 0x10;
3346 btv->mbox_mask = 0x38;
3347 break;
5a25e84b
MCC
3348 case BTTV_BOARD_VOBIS_BOOSTAR:
3349 case BTTV_BOARD_TERRATV:
1da177e4
LT
3350 terratec_active_radio_upgrade(btv);
3351 break;
5a25e84b 3352 case BTTV_BOARD_MAGICTVIEW061:
1da177e4
LT
3353 if (btv->cardid == 0x3002144f) {
3354 btv->has_radio=1;
3355 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3356 }
3357 break;
b930e1d8 3358 case BTTV_BOARD_STB2:
4ac97914 3359 if (btv->cardid == 0x3060121a) {
1da177e4
LT
3360 /* Fix up entry for 3DFX VoodooTV 100,
3361 which is an OEM STB card variant. */
3362 btv->has_radio=0;
3363 btv->tuner_type=TUNER_TEMIC_NTSC;
3364 }
3365 break;
5a25e84b
MCC
3366 case BTTV_BOARD_OSPREY1x0:
3367 case BTTV_BOARD_OSPREY1x0_848:
3368 case BTTV_BOARD_OSPREY101_848:
3369 case BTTV_BOARD_OSPREY1x1:
3370 case BTTV_BOARD_OSPREY1x1_SVID:
3371 case BTTV_BOARD_OSPREY2xx:
3372 case BTTV_BOARD_OSPREY2x0_SVID:
3373 case BTTV_BOARD_OSPREY2x0:
cf784d55 3374 case BTTV_BOARD_OSPREY440:
5a25e84b
MCC
3375 case BTTV_BOARD_OSPREY500:
3376 case BTTV_BOARD_OSPREY540:
3377 case BTTV_BOARD_OSPREY2000:
1da177e4 3378 bttv_readee(btv,eeprom_data,0xa0);
cf784d55 3379 osprey_eeprom(btv, eeprom_data);
1da177e4 3380 break;
5a25e84b 3381 case BTTV_BOARD_IDS_EAGLE:
1da177e4
LT
3382 init_ids_eagle(btv);
3383 break;
5a25e84b 3384 case BTTV_BOARD_MODTEC_205:
1da177e4
LT
3385 bttv_readee(btv,eeprom_data,0xa0);
3386 modtec_eeprom(btv);
3387 break;
5a25e84b 3388 case BTTV_BOARD_LMLBT4:
1da177e4
LT
3389 init_lmlbt4x(btv);
3390 break;
5a25e84b 3391 case BTTV_BOARD_TIBET_CS16:
1da177e4
LT
3392 tibetCS16_init(btv);
3393 break;
5a25e84b 3394 case BTTV_BOARD_KODICOM_4400R:
1da177e4
LT
3395 kodicom4400r_init(btv);
3396 break;
0c5db425
BC
3397 case BTTV_BOARD_GEOVISION_GV800S:
3398 gv800s_init(btv);
3399 break;
1da177e4
LT
3400 }
3401
3402 /* pll configuration */
4ac97914 3403 if (!(btv->id==848 && btv->revision==0x11)) {
1da177e4
LT
3404 /* defaults from card list */
3405 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3406 btv->pll.pll_ifreq=28636363;
3407 btv->pll.pll_crystal=BT848_IFORM_XT0;
3408 }
3409 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3410 btv->pll.pll_ifreq=35468950;
3411 btv->pll.pll_crystal=BT848_IFORM_XT1;
3412 }
3413 /* insmod options can override */
4ac97914
MCC
3414 switch (pll[btv->c.nr]) {
3415 case 0: /* none */
1da177e4
LT
3416 btv->pll.pll_crystal = 0;
3417 btv->pll.pll_ifreq = 0;
3418 btv->pll.pll_ofreq = 0;
4ac97914
MCC
3419 break;
3420 case 1: /* 28 MHz */
1da177e4 3421 case 28:
4ac97914 3422 btv->pll.pll_ifreq = 28636363;
1da177e4 3423 btv->pll.pll_ofreq = 0;
4ac97914
MCC
3424 btv->pll.pll_crystal = BT848_IFORM_XT0;
3425 break;
3426 case 2: /* 35 MHz */
1da177e4 3427 case 35:
4ac97914 3428 btv->pll.pll_ifreq = 35468950;
1da177e4 3429 btv->pll.pll_ofreq = 0;
4ac97914
MCC
3430 btv->pll.pll_crystal = BT848_IFORM_XT1;
3431 break;
3432 }
3433 }
1da177e4
LT
3434 btv->pll.pll_current = -1;
3435
1da177e4 3436 /* tuner configuration (from card list / autodetect / insmod option) */
24a70fdc 3437 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
abb0362f 3438 if (UNSET == btv->tuner_type)
4ac97914 3439 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
1da177e4
LT
3440 if (UNSET != tuner[btv->c.nr])
3441 btv->tuner_type = tuner[btv->c.nr];
ac7dc845 3442
abb0362f 3443 if (btv->tuner_type == TUNER_ABSENT)
ac7dc845
TP
3444 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3445 else if(btv->tuner_type == UNSET)
3446 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3447 else
3448 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3449 btv->tuner_type);
f3b512fd 3450
859f0277
HV
3451 if (autoload != UNSET) {
3452 printk(KERN_WARNING "bttv%d: the autoload option is obsolete.\n", btv->c.nr);
3453 printk(KERN_WARNING "bttv%d: use option msp3400, tda7432 or tvaudio to\n", btv->c.nr);
3454 printk(KERN_WARNING "bttv%d: override which audio module should be used.\n", btv->c.nr);
3455 }
3456
abb0362f
TP
3457 if (UNSET == btv->tuner_type)
3458 btv->tuner_type = TUNER_ABSENT;
3459
5221e21e
TP
3460 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3461 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
4c548d4b
TP
3462 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3463 UNSET : bttv_tvcards[btv->c.type].svhs;
1da177e4
LT
3464 if (svhs[btv->c.nr] != UNSET)
3465 btv->svhs = svhs[btv->c.nr];
3466 if (remote[btv->c.nr] != UNSET)
3467 btv->has_remote = remote[btv->c.nr];
3468
3469 if (bttv_tvcards[btv->c.type].has_radio)
2c905778 3470 btv->has_radio = 1;
1da177e4 3471 if (bttv_tvcards[btv->c.type].has_remote)
2c905778 3472 btv->has_remote = 1;
7c08fb02 3473 if (!bttv_tvcards[btv->c.type].no_gpioirq)
2c905778 3474 btv->gpioirq = 1;
4b9b936f 3475 if (bttv_tvcards[btv->c.type].volume_gpio)
2c905778 3476 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
4b9b936f 3477 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
2c905778 3478 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
1da177e4 3479
abb0362f 3480 if (btv->tuner_type == TUNER_ABSENT)
ac7dc845
TP
3481 return; /* no tuner or related drivers to load */
3482
859f0277
HV
3483 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3484 /* Probe for RDS receiver chip */
3485 static const unsigned short addrs[] = {
3486 0x20 >> 1,
3487 0x22 >> 1,
3488 I2C_CLIENT_END
3489 };
3490 struct v4l2_subdev *sd;
3491
53dacb15 3492 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3493 &btv->c.i2c_adap, "saa6588", 0, addrs);
859f0277
HV
3494 btv->has_saa6588 = (sd != NULL);
3495 }
3496
1da177e4 3497 /* try to detect audio/fader chips */
1da177e4 3498
859f0277
HV
3499 /* First check if the user specified the audio chip via a module
3500 option. */
1da177e4 3501
859f0277
HV
3502 switch (audiodev[btv->c.nr]) {
3503 case -1:
3504 return; /* do not load any audio module */
1da177e4 3505
859f0277
HV
3506 case 0: /* autodetect */
3507 break;
3508
3509 case 1: {
3510 /* The user specified that we should probe for msp3400 */
3511 static const unsigned short addrs[] = {
3512 I2C_ADDR_MSP3400 >> 1,
3513 I2C_ADDR_MSP3400_ALT >> 1,
3514 I2C_CLIENT_END
3515 };
3516
53dacb15 3517 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3518 &btv->c.i2c_adap, "msp3400", 0, addrs);
859f0277
HV
3519 if (btv->sd_msp34xx)
3520 return;
3521 goto no_audio;
3522 }
3523
3524 case 2: {
3525 /* The user specified that we should probe for tda7432 */
3526 static const unsigned short addrs[] = {
3527 I2C_ADDR_TDA7432 >> 1,
3528 I2C_CLIENT_END
3529 };
3530
53dacb15 3531 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3532 &btv->c.i2c_adap, "tda7432", 0, addrs))
859f0277
HV
3533 return;
3534 goto no_audio;
3535 }
3536
3537 case 3: {
3538 /* The user specified that we should probe for tvaudio */
53dacb15 3539 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3540 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
859f0277
HV
3541 if (btv->sd_tvaudio)
3542 return;
3543 goto no_audio;
3544 }
3545
3546 default:
3547 printk(KERN_WARNING "bttv%d: unknown audiodev value!\n",
3548 btv->c.nr);
3549 return;
3550 }
3551
3552 /* There were no overrides, so now we try to discover this through the
3553 card definition */
3554
3555 /* probe for msp3400 first: this driver can detect whether or not
3556 it really is a msp3400, so it will return NULL when the device
3557 found is really something else (e.g. a tea6300). */
3558 if (!bttv_tvcards[btv->c.type].no_msp34xx) {
53dacb15 3559 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3560 &btv->c.i2c_adap, "msp3400",
53dacb15 3561 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
859f0277 3562 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
53dacb15 3563 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3564 &btv->c.i2c_adap, "msp3400",
53dacb15 3565 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
859f0277
HV
3566 }
3567
3568 /* If we found a msp34xx, then we're done. */
3569 if (btv->sd_msp34xx)
3570 return;
3571
3572 /* it might also be a tda7432. */
3573 if (!bttv_tvcards[btv->c.type].no_tda7432) {
3574 static const unsigned short addrs[] = {
3575 I2C_ADDR_TDA7432 >> 1,
3576 I2C_CLIENT_END
3577 };
3578
53dacb15 3579 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3580 &btv->c.i2c_adap, "tda7432", 0, addrs))
859f0277
HV
3581 return;
3582 }
3583
3584 /* Now see if we can find one of the tvaudio devices. */
53dacb15 3585 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3586 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
859f0277
HV
3587 if (btv->sd_tvaudio)
3588 return;
1da177e4 3589
859f0277
HV
3590no_audio:
3591 printk(KERN_WARNING "bttv%d: audio absent, no audio device found!\n",
3592 btv->c.nr);
1da177e4
LT
3593}
3594
3595
2c905778
HV
3596/* initialize the tuner */
3597void __devinit bttv_init_tuner(struct bttv *btv)
3598{
3599 int addr = ADDR_UNSET;
3600
3601 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3602 addr = bttv_tvcards[btv->c.type].tuner_addr;
3603
3604 if (btv->tuner_type != TUNER_ABSENT) {
3605 struct tuner_setup tun_setup;
3606
3607 /* Load tuner module before issuing tuner config call! */
3608 if (bttv_tvcards[btv->c.type].has_radio)
53dacb15 3609 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3610 &btv->c.i2c_adap, "tuner",
53dacb15
HV
3611 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3612 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3613 &btv->c.i2c_adap, "tuner",
53dacb15
HV
3614 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3615 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
9a1f8b34 3616 &btv->c.i2c_adap, "tuner",
53dacb15 3617 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
2c905778 3618
ad020dc2 3619 tun_setup.mode_mask = T_ANALOG_TV;
2c905778
HV
3620 tun_setup.type = btv->tuner_type;
3621 tun_setup.addr = addr;
3622
3623 if (bttv_tvcards[btv->c.type].has_radio)
3624 tun_setup.mode_mask |= T_RADIO;
3625
3626 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3627 }
3628
3629 if (btv->tda9887_conf) {
3630 struct v4l2_priv_tun_config tda9887_cfg;
3631
3632 tda9887_cfg.tuner = TUNER_TDA9887;
3633 tda9887_cfg.priv = &btv->tda9887_conf;
3634
3635 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3636 }
3637}
3638
1da177e4
LT
3639/* ----------------------------------------------------------------------- */
3640
3641static void modtec_eeprom(struct bttv *btv)
3642{
3643 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3644 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3645 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3646 btv->c.nr,&eeprom_data[0x1e]);
3647 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3648 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3649 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
4ac97914
MCC
3650 btv->c.nr,&eeprom_data[0x1e]);
3651 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3652 btv->tuner_type=TUNER_PHILIPS_NTSC;
3653 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3654 btv->c.nr,&eeprom_data[0x1e]);
1da177e4
LT
3655 } else {
3656 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3657 btv->c.nr,&eeprom_data[0x1e]);
3658 }
3659}
3660
3661static void __devinit hauppauge_eeprom(struct bttv *btv)
3662{
3663 struct tveeprom tv;
3664
0f97a931 3665 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
1da177e4
LT
3666 btv->tuner_type = tv.tuner_type;
3667 btv->has_radio = tv.has_radio;
cd1257d8
ST
3668
3669 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3670 btv->c.nr, tv.model);
3671
3672 /*
3673 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3674 * type based on model #.
3675 */
3676 if(tv.model == 64900) {
3677 printk("bttv%d: Switching board type from %s to %s\n",
3678 btv->c.nr,
3679 bttv_tvcards[btv->c.type].name,
3680 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3681 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3682 }
1da177e4
LT
3683}
3684
3685static int terratec_active_radio_upgrade(struct bttv *btv)
3686{
3687 int freq;
3688
3689 btv->has_radio = 1;
3690 btv->has_matchbox = 1;
3691 btv->mbox_we = 0x10;
3692 btv->mbox_most = 0x20;
3693 btv->mbox_clk = 0x08;
3694 btv->mbox_data = 0x04;
3695 btv->mbox_mask = 0x3c;
3696
3697 btv->mbox_iow = 1 << 8;
3698 btv->mbox_ior = 1 << 9;
3699 btv->mbox_csel = 1 << 10;
3700
3701 freq=88000/62.5;
24a70fdc 3702 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
1da177e4
LT
3703 if (0x1ed8 == tea5757_read(btv)) {
3704 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3705 btv->c.nr);
3706 btv->has_radio = 1;
859f0277 3707 btv->has_saa6588 = 1;
1da177e4
LT
3708 btv->has_matchbox = 1;
3709 } else {
3710 btv->has_radio = 0;
3711 btv->has_matchbox = 0;
3712 }
3713 return 0;
3714}
3715
3716
3717/* ----------------------------------------------------------------------- */
3718
3719/*
3720 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3721 *
3722 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3723 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3724 * unpacked with unzip).
3725 */
3726#define PVR_GPIO_DELAY 10
3727
3728#define BTTV_ALT_DATA 0x000001
3729#define BTTV_ALT_DCLK 0x100000
3730#define BTTV_ALT_NCONFIG 0x800000
3731
4f2a0c3c
DW
3732static int __devinit pvr_altera_load(struct bttv *btv, const u8 *micro,
3733 u32 microlen)
1da177e4
LT
3734{
3735 u32 n;
4ac97914 3736 u8 bits;
1da177e4
LT
3737 int i;
3738
3739 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3740 gpio_write(0);
3741 udelay(PVR_GPIO_DELAY);
3742
3743 gpio_write(BTTV_ALT_NCONFIG);
3744 udelay(PVR_GPIO_DELAY);
3745
3746 for (n = 0; n < microlen; n++) {
3747 bits = micro[n];
c1d57038 3748 for (i = 0 ; i < 8 ; i++) {
1da177e4
LT
3749 gpio_bits(BTTV_ALT_DCLK,0);
3750 if (bits & 0x01)
3751 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3752 else
3753 gpio_bits(BTTV_ALT_DATA,0);
3754 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3755 bits >>= 1;
3756 }
3757 }
3758 gpio_bits(BTTV_ALT_DCLK,0);
3759 udelay(PVR_GPIO_DELAY);
3760
3761 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3762 for (i = 0 ; i < 30 ; i++) {
3763 gpio_bits(BTTV_ALT_DCLK,0);
3764 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3765 }
3766 gpio_bits(BTTV_ALT_DCLK,0);
3767 return 0;
3768}
3769
3770static int __devinit pvr_boot(struct bttv *btv)
3771{
4ac97914 3772 const struct firmware *fw_entry;
1da177e4
LT
3773 int rc;
3774
3775 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3776 if (rc != 0) {
3777 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3778 btv->c.nr);
4ac97914
MCC
3779 return rc;
3780 }
1da177e4
LT
3781 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3782 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3783 btv->c.nr, (rc < 0) ? "failed" : "ok");
4ac97914 3784 release_firmware(fw_entry);
1da177e4
LT
3785 return rc;
3786}
3787
3788/* ----------------------------------------------------------------------- */
3789/* some osprey specific stuff */
3790
cf784d55 3791static void __devinit osprey_eeprom(struct bttv *btv, const u8 ee[256])
1da177e4 3792{
cf784d55
TP
3793 int i;
3794 u32 serial = 0;
3795 int cardid = -1;
3796
3797 /* This code will nevery actually get called in this case.... */
3798 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3799 /* this might be an antique... check for MMAC label in eeprom */
3800 if (!strncmp(ee, "MMAC", 4)) {
3801 u8 checksum = 0;
3802 for (i = 0; i < 21; i++)
3803 checksum += ee[i];
3804 if (checksum != ee[21])
3805 return;
3806 cardid = BTTV_BOARD_OSPREY1x0_848;
3807 for (i = 12; i < 21; i++)
3808 serial *= 10, serial += ee[i] - '0';
3809 }
b930e1d8 3810 } else {
cf784d55
TP
3811 unsigned short type;
3812
3813 for (i = 4*16; i < 8*16; i += 16) {
3814 u16 checksum = ip_compute_csum(ee + i, 16);
3815
3816 if ((checksum&0xff) + (checksum>>8) == 0xff)
3817 break;
3818 }
3819 if (i >= 8*16)
3820 return;
3821 ee += i;
3822
3823 /* found a valid descriptor */
c1c36f31 3824 type = get_unaligned_be16((__be16 *)(ee+4));
cf784d55
TP
3825
3826 switch(type) {
3827 /* 848 based */
3828 case 0x0004:
3829 cardid = BTTV_BOARD_OSPREY1x0_848;
3830 break;
3831 case 0x0005:
3832 cardid = BTTV_BOARD_OSPREY101_848;
3833 break;
3834
3835 /* 878 based */
3836 case 0x0012:
3837 case 0x0013:
3838 cardid = BTTV_BOARD_OSPREY1x0;
3839 break;
3840 case 0x0014:
3841 case 0x0015:
3842 cardid = BTTV_BOARD_OSPREY1x1;
3843 break;
3844 case 0x0016:
3845 case 0x0017:
3846 case 0x0020:
3847 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3848 break;
3849 case 0x0018:
3850 case 0x0019:
3851 case 0x001E:
3852 case 0x001F:
3853 cardid = BTTV_BOARD_OSPREY2xx;
3854 break;
3855 case 0x001A:
3856 case 0x001B:
3857 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3858 break;
3859 case 0x0040:
3860 cardid = BTTV_BOARD_OSPREY500;
3861 break;
3862 case 0x0050:
3863 case 0x0056:
3864 cardid = BTTV_BOARD_OSPREY540;
3865 /* bttv_osprey_540_init(btv); */
3866 break;
3867 case 0x0060:
3868 case 0x0070:
3869 case 0x00A0:
3870 cardid = BTTV_BOARD_OSPREY2x0;
3871 /* enable output on select control lines */
3872 gpio_inout(0xffffff,0x000303);
3873 break;
3874 case 0x00D8:
3875 cardid = BTTV_BOARD_OSPREY440;
3876 break;
3877 default:
3878 /* unknown...leave generic, but get serial # */
3879 printk(KERN_INFO "bttv%d: "
3880 "osprey eeprom: unknown card type 0x%04x\n",
3881 btv->c.nr, type);
3882 break;
3883 }
c1c36f31 3884 serial = get_unaligned_be32((__be32 *)(ee+6));
cf784d55
TP
3885 }
3886
3887 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d '%s' serial=%u\n",
3888 btv->c.nr, cardid,
3889 cardid>0 ? bttv_tvcards[cardid].name : "Unknown", serial);
3890
3891 if (cardid<0 || btv->c.type == cardid)
3892 return;
3893
3894 /* card type isn't set correctly */
3895 if (card[btv->c.nr] < bttv_num_tvcards) {
3896 printk(KERN_WARNING "bttv%d: osprey eeprom: "
3897 "Not overriding user specified card type\n", btv->c.nr);
3898 } else {
3899 printk(KERN_INFO "bttv%d: osprey eeprom: "
3900 "Changing card type from %d to %d\n", btv->c.nr,
3901 btv->c.type, cardid);
3902 btv->c.type = cardid;
3903 }
1da177e4
LT
3904}
3905
3906/* ----------------------------------------------------------------------- */
3907/* AVermedia specific stuff, from bktr_card.c */
3908
3909static int tuner_0_table[] = {
4ac97914
MCC
3910 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3911 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3912 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3913 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3914 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
1da177e4 3915 TUNER_PHILIPS_FM1216ME_MK3 };
1da177e4
LT
3916
3917static int tuner_1_table[] = {
4ac97914 3918 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
1da177e4
LT
3919 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3920 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4ac97914
MCC
3921 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3922 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
1da177e4
LT
3923
3924static void __devinit avermedia_eeprom(struct bttv *btv)
3925{
c6eb8eaf 3926 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
1da177e4
LT
3927
3928 tuner_make = (eeprom_data[0x41] & 0x7);
4ac97914
MCC
3929 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3930 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
1da177e4
LT
3931 btv->has_remote = (eeprom_data[0x42] & 0x01);
3932
3933 if (tuner_make == 0 || tuner_make == 2)
c6eb8eaf
HV
3934 if (tuner_format <= 0x0a)
3935 tuner_type = tuner_0_table[tuner_format];
1da177e4 3936 if (tuner_make == 1)
c6eb8eaf
HV
3937 if (tuner_format <= 9)
3938 tuner_type = tuner_1_table[tuner_format];
1da177e4
LT
3939
3940 if (tuner_make == 4)
c6eb8eaf
HV
3941 if (tuner_format == 0x09)
3942 tuner_type = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
1da177e4
LT
3943
3944 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
c6eb8eaf
HV
3945 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
3946 if (tuner_type) {
3947 btv->tuner_type = tuner_type;
3948 printk(KERN_CONT "%d", tuner_type);
1da177e4 3949 } else
c6eb8eaf
HV
3950 printk(KERN_CONT "Unknown type");
3951 printk(KERN_CONT " radio:%s remote control:%s\n",
1da177e4
LT
3952 tuner_tv_fm ? "yes" : "no",
3953 btv->has_remote ? "yes" : "no");
3954}
3955
72134a6d
TP
3956/*
3957 * For Voodoo TV/FM and Voodoo 200. These cards' tuners use a TDA9880
3958 * analog demod, which is not I2C controlled like the newer and more common
3959 * TDA9887 series. Instead is has two tri-state input pins, S0 and S1,
3960 * that control the IF for the video and audio. Apparently, bttv GPIO
3961 * 0x10000 is connected to S0. S0 low selects a 38.9 MHz VIF for B/G/D/K/I
3962 * (i.e., PAL) while high selects 45.75 MHz for M/N (i.e., NTSC).
3963 */
3964u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
1da177e4 3965{
72134a6d
TP
3966
3967 if (btv->audio == TVAUDIO_INPUT_TUNER) {
3968 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
3969 gpiobits |= 0x10000;
3970 else
3971 gpiobits &= ~0x10000;
1da177e4 3972 }
72134a6d
TP
3973
3974 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
3975 return gpiobits;
1da177e4
LT
3976}
3977
3978
3979/*
3980 * reset/enable the MSP on some Hauppauge cards
93e960ff 3981 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
1da177e4
LT
3982 *
3983 * Hauppauge: pin 5
3984 * Voodoo: pin 20
3985 */
3986static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3987{
3988 int mask = (1 << pin);
3989
3990 gpio_inout(mask,mask);
3991 gpio_bits(mask,0);
c4e3fd94
TM
3992 mdelay(2);
3993 udelay(500);
1da177e4
LT
3994 gpio_bits(mask,mask);
3995
3996 if (bttv_gpio)
3997 bttv_gpio_tracking(btv,"msp34xx");
3998 if (bttv_verbose)
3999 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
4000 "init [%d]\n", btv->c.nr, pin);
4001}
4002
1da177e4
LT
4003/* ----------------------------------------------------------------------- */
4004/* Imagenation L-Model PXC200 Framegrabber */
4005/* This is basically the same procedure as
4006 * used by Alessandro Rubini in his pxc200
4007 * driver, but using BTTV functions */
4008
4009static void __devinit init_PXC200(struct bttv *btv)
4010{
4011 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
4012 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
4013 0x00 };
4014 unsigned int i;
4015 int tmp;
4016 u32 val;
4017
4018 /* Initialise GPIO-connevted stuff */
4019 gpio_inout(0xffffff, (1<<13));
4020 gpio_write(0);
4021 udelay(3);
4022 gpio_write(1<<13);
4023 /* GPIO inputs are pulled up, so no need to drive
4024 * reset pin any longer */
4025 gpio_bits(0xffffff, 0);
4026 if (bttv_gpio)
4027 bttv_gpio_tracking(btv,"pxc200");
4028
4029 /* we could/should try and reset/control the AD pots? but
4030 right now we simply turned off the crushing. Without
4031 this the AGC drifts drifts
4032 remember the EN is reverse logic -->
4033 setting BT848_ADC_AGC_EN disable the AGC
4034 tboult@eecs.lehigh.edu
4035 */
4036
4037 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4038
4039 /* Initialise MAX517 DAC */
4040 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
4041 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4042
4043 /* Initialise 12C508 PIC */
4044 /* The I2CWrite and I2CRead commmands are actually to the
4045 * same chips - but the R/W bit is included in the address
4046 * argument so the numbers are different */
4047
4048
4049 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
4050
4051 /* First of all, enable the clock line. This is used in the PXC200-F */
4052 val = btread(BT848_GPIO_DMA_CTL);
4053 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4054 btwrite(val, BT848_GPIO_DMA_CTL);
4055
4056 /* Then, push to 0 the reset pin long enough to reset the *
4057 * device same as above for the reset line, but not the same
4058 * value sent to the GPIO-connected stuff
4059 * which one is the good one? */
4060 gpio_inout(0xffffff,(1<<2));
4061 gpio_write(0);
4062 udelay(10);
4063 gpio_write(1<<2);
4064
4ac97914 4065 for (i = 0; i < ARRAY_SIZE(vals); i++) {
1da177e4
LT
4066 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4067 if (tmp != -1) {
4068 printk(KERN_INFO
4069 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4070 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4071 }
4072 }
4073
4074 printk(KERN_INFO "PXC200 Initialised.\n");
4075}
4076
2d03e289
MCC
4077
4078
93b43f13
PS
4079/* ----------------------------------------------------------------------- */
4080/*
4081 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4082 * it. This apparently involves the following procedure for each 878 chip:
4083 *
4084 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4085 *
4086 * 2) write to GPIO_DATA
4087 * - 0x0E
4088 * - sleep 1ms
4089 * - 0x10 + 0x0E
4090 * - sleep 10ms
4091 * - 0x0E
4092 * read from GPIO_DATA into buf (uint_32)
4093 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4094 * error. ERROR_CPLD_Check_Failed stop.
4095 *
4096 * 3) write to GPIO_DATA
4097 * - write 0x4400 + 0x0E
4098 * - sleep 10ms
4099 * - write 0x4410 + 0x0E
4100 * - sleep 1ms
4101 * - write 0x0E
4102 * read from GPIO_DATA into buf (uint_32)
fef4fa14 4103 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
93b43f13
PS
4104 * error. ERROR_CPLD_Check_Failed.
4105 */
4106/* ----------------------------------------------------------------------- */
943a4902 4107static void
2d03e289 4108init_RTV24 (struct bttv *btv)
93b43f13 4109{
2d03e289
MCC
4110 uint32_t dataRead = 0;
4111 long watchdog_value = 0x0E;
93b43f13 4112
2d03e289
MCC
4113 printk (KERN_INFO
4114 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
93b43f13
PS
4115 btv->c.nr);
4116
2d03e289 4117 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
93b43f13 4118
2d03e289
MCC
4119 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4120 msleep (1);
4121 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4122 msleep (10);
4123 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
93b43f13 4124
2d03e289 4125 dataRead = btread (BT848_GPIO_DATA);
93b43f13 4126
2d03e289
MCC
4127 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4128 printk (KERN_INFO
4129 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4130 btv->c.nr, dataRead);
93b43f13
PS
4131 }
4132
2d03e289
MCC
4133 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4134 msleep (10);
4135 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4136 msleep (1);
4137 btwrite (watchdog_value, BT848_GPIO_DATA);
4138 msleep (1);
4139 dataRead = btread (BT848_GPIO_DATA);
4140
4141 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4142 printk (KERN_INFO
4143 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4144 btv->c.nr, dataRead);
4145
93b43f13
PS
4146 return;
4147 }
4148
2d03e289
MCC
4149 printk (KERN_INFO
4150 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
93b43f13 4151}
1da177e4 4152
2d03e289
MCC
4153
4154
1da177e4
LT
4155/* ----------------------------------------------------------------------- */
4156/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4157/*
4158 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4159 * This code is placed under the terms of the GNU General Public License
4160 *
4161 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4162 */
4163
4164static void bus_low(struct bttv *btv, int bit)
4165{
4166 if (btv->mbox_ior) {
4167 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4168 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4169 udelay(5);
4170 }
4171
4172 gpio_bits(bit,0);
4173 udelay(5);
4174
4175 if (btv->mbox_ior) {
4176 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4177 udelay(5);
4178 }
4179}
4180
4181static void bus_high(struct bttv *btv, int bit)
4182{
4183 if (btv->mbox_ior) {
4184 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4185 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4186 udelay(5);
4187 }
4188
4189 gpio_bits(bit,bit);
4190 udelay(5);
4191
4192 if (btv->mbox_ior) {
4193 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4194 udelay(5);
4195 }
4196}
4197
4198static int bus_in(struct bttv *btv, int bit)
4199{
4200 if (btv->mbox_ior) {
4201 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4202 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4203 udelay(5);
4204
4205 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4206 udelay(5);
4207 }
4208 return gpio_read() & (bit);
4209}
4210
4211/* TEA5757 register bits */
4212#define TEA_FREQ 0:14
4213#define TEA_BUFFER 15:15
4214
4215#define TEA_SIGNAL_STRENGTH 16:17
4216
4217#define TEA_PORT1 18:18
4218#define TEA_PORT0 19:19
4219
4220#define TEA_BAND 20:21
4221#define TEA_BAND_FM 0
4222#define TEA_BAND_MW 1
4223#define TEA_BAND_LW 2
4224#define TEA_BAND_SW 3
4225
4226#define TEA_MONO 22:22
4227#define TEA_ALLOW_STEREO 0
4228#define TEA_FORCE_MONO 1
4229
4230#define TEA_SEARCH_DIRECTION 23:23
4231#define TEA_SEARCH_DOWN 0
4232#define TEA_SEARCH_UP 1
4233
4234#define TEA_STATUS 24:24
4235#define TEA_STATUS_TUNED 0
4236#define TEA_STATUS_SEARCHING 1
4237
4238/* Low-level stuff */
4239static int tea5757_read(struct bttv *btv)
4240{
4241 unsigned long timeout;
4242 int value = 0;
4243 int i;
4244
4245 /* better safe than sorry */
4246 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4247
4248 if (btv->mbox_ior) {
4249 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4250 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4251 udelay(5);
4252 }
4253
4254 if (bttv_gpio)
4255 bttv_gpio_tracking(btv,"tea5757 read");
4256
4257 bus_low(btv,btv->mbox_we);
4258 bus_low(btv,btv->mbox_clk);
4259
4260 udelay(10);
fe06fe0a 4261 timeout= jiffies + msecs_to_jiffies(1000);
1da177e4 4262
24a70fdc 4263 /* wait for DATA line to go low; error if it doesn't */
1da177e4
LT
4264 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4265 schedule();
4266 if (bus_in(btv,btv->mbox_data)) {
4267 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4268 return -1;
4269 }
4270
4271 dprintk("bttv%d: tea5757:",btv->c.nr);
c1d57038 4272 for (i = 0; i < 24; i++) {
1da177e4
LT
4273 udelay(5);
4274 bus_high(btv,btv->mbox_clk);
4275 udelay(5);
4276 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4277 bus_low(btv,btv->mbox_clk);
4278 value <<= 1;
4279 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4280 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4281 }
4282 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4283 return value;
4284}
4285
4286static int tea5757_write(struct bttv *btv, int value)
4287{
4288 int i;
4289 int reg = value;
4290
4291 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4292
4293 if (btv->mbox_ior) {
4294 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4295 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4296 udelay(5);
4297 }
4298 if (bttv_gpio)
4299 bttv_gpio_tracking(btv,"tea5757 write");
4300
4301 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4302 bus_low(btv,btv->mbox_clk);
4303 bus_high(btv,btv->mbox_we);
c1d57038 4304 for (i = 0; i < 25; i++) {
1da177e4
LT
4305 if (reg & 0x1000000)
4306 bus_high(btv,btv->mbox_data);
4307 else
4308 bus_low(btv,btv->mbox_data);
4309 reg <<= 1;
4310 bus_high(btv,btv->mbox_clk);
4311 udelay(10);
4312 bus_low(btv,btv->mbox_clk);
4313 udelay(10);
4314 }
4315 bus_low(btv,btv->mbox_we); /* unmute !!! */
4316 return 0;
4317}
4318
4319void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4320{
4321 dprintk("tea5757_set_freq %d\n",freq);
4322 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
1da177e4
LT
4323}
4324
1da177e4
LT
4325/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4326 *
4327 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4328 * switch instead (CD22M3494E). This IC can have multiple active connections
4329 * between Xn (input) and Yn (output) pins. We need to clear any existing
4330 * connection prior to establish a new one, pulsing the STROBE pin.
4331 *
4332 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4333 * GPIO pins are wired as:
3a4fa0a2
RD
4334 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroller)
4335 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroller)
4336 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroller)
4337 * GPIO[8] - - P3[5] (microcontroller)
4338 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroller)
4339 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroller)
4340 * GPINTR - - P3[4] (microcontroller)
1da177e4 4341 *
3a4fa0a2
RD
4342 * The microcontroller is a 80C32 like. It should be possible to change xpoint
4343 * configuration either directly (as we are doing) or using the microcontroller
1da177e4 4344 * which is also wired to I2C interface. I have no further info on the
3a4fa0a2 4345 * microcontroller features, one would need to disassembly the firmware.
1da177e4
LT
4346 * note: the vendor refused to give any information on this product, all
4347 * that stuff was found using a multimeter! :)
4348 */
4349static void rv605_muxsel(struct bttv *btv, unsigned int input)
4350{
13afaefc
TP
4351 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4352 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4353
4354 gpio_bits(0x07f, muxgpio[input]);
4355
1da177e4
LT
4356 /* reset all conections */
4357 gpio_bits(0x200,0x200);
4358 mdelay(1);
4359 gpio_bits(0x200,0x000);
4360 mdelay(1);
4361
c84e6036 4362 /* create a new connection */
1da177e4
LT
4363 gpio_bits(0x480,0x480);
4364 mdelay(1);
4365 gpio_bits(0x480,0x080);
4366 mdelay(1);
4367}
4368
4369/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4370 *
4371 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
3ad2f3fb 4372 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync separator
1da177e4
LT
4373 * chips, ten eight input analog multiplexors, a not chip and a few
4374 * other components.
4375 *
4376 * 16 inputs on a secondary bracket are provided and can be selected
4377 * from each of the four capture chips. Two of the eight input
4378 * multiplexors are used to select from any of the 16 input signals.
4379 *
4380 * Unsupported hardware capabilities:
4381 * . A video output monitor on the secondary bracket can be selected from
4382 * one of the 878A chips.
4383 * . Another passthrough but I haven't spent any time investigating it.
4384 * . Digital I/O (logic level connected to GPIO) is available from an
4385 * onboard header.
4386 *
4387 * The on chip input mux should always be set to 2.
4388 * GPIO[16:19] - Video input selection
4389 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4390 * GPIO[?:?] - Digital I/O.
4391 *
4392 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4393 * determined what function (if any) it provides. With the microcontroller
3ad2f3fb 4394 * and sync separator chips a guess is that it might have to do with video
1da177e4
LT
4395 * switching and maybe some digital I/O.
4396 */
4397static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4398{
4399 /* video mux */
4400 gpio_bits(0x0f0000, input << 16);
4401}
4402
4403static void tibetCS16_init(struct bttv *btv)
4404{
4405 /* enable gpio bits, mask obtained via btSpy */
4406 gpio_inout(0xffffff, 0x0f7fff);
4407 gpio_write(0x0f7fff);
4408}
4409
4410/*
4411 * The following routines for the Kodicom-4400r get a little mind-twisting.
4412 * There is a "master" controller and three "slave" controllers, together
4413 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4414 * The analog switch is controlled by the "master", but the detection order
4415 * of the four BT878A chips is in an order which I just don't understand.
4416 * The "master" is actually the second controller to be detected. The
3a4fa0a2 4417 * logic on the board uses logical numbers for the 4 controllers, but
1da177e4
LT
4418 * those numbers are different from the detection sequence. When working
4419 * with the analog switch, we need to "map" from the detection sequence
4420 * over to the board's logical controller number. This mapping sequence
4421 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4422 * unit 3, the second (which is the master) is logical unit 0, etc.
4423 * We need to maintain the status of the analog switch (which of the 16
4424 * cameras is connected to which of the 4 controllers). Rather than
4425 * add to the bttv structure for this, we use the data reserved for
4426 * the mbox (unused for this card type).
4427 */
4428
4429/*
4430 * First a routine to set the analog switch, which controls which camera
4431 * is routed to which controller. The switch comprises an X-address
4432 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4433 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4434 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4435 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4436 * specified address. The idea is to set the address and data, then bring
4437 * STROBE high, and finally bring STROBE back to low.
4438 */
4439static void kodicom4400r_write(struct bttv *btv,
4440 unsigned char xaddr,
4441 unsigned char yaddr,
4442 unsigned char data) {
4443 unsigned int udata;
4444
4445 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4446 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4447 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4448 gpio_bits(0x1ff, udata); /* strobe low */
4449}
4450
4451/*
4452 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4453 * use this routine. The routine finds the "master" for the card, maps
4454 * the controller number from the detected position over to the logical
4455 * number, writes the appropriate data to the analog switch, and housekeeps
4456 * the local copy of the switch information. The parameter 'input' is the
4457 * requested camera number (0 - 15).
4458 */
4459static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4460{
4461 char *sw_status;
4462 int xaddr, yaddr;
4463 struct bttv *mctlr;
4464 static unsigned char map[4] = {3, 0, 2, 1};
4465
4466 mctlr = master[btv->c.nr];
4467 if (mctlr == NULL) { /* ignore if master not yet detected */
4468 return;
4469 }
4470 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4471 yaddr = map[yaddr];
4472 sw_status = (char *)(&mctlr->mbox_we);
4473 xaddr = input & 0xf;
4474 /* Check if the controller/camera pair has changed, else ignore */
4475 if (sw_status[yaddr] != xaddr)
4476 {
4477 /* "open" the old switch, "close" the new one, save the new */
4478 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4479 sw_status[yaddr] = xaddr;
4480 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4481 }
4482}
4483
4484/*
4485 * During initialisation, we need to reset the analog switch. We
4486 * also preset the switch to map the 4 connectors on the card to the
4487 * *user's* (see above description of kodicom4400r_muxsel) channels
4488 * 0 through 3
4489 */
4490static void kodicom4400r_init(struct bttv *btv)
4491{
4492 char *sw_status = (char *)(&btv->mbox_we);
4493 int ix;
4494
4495 gpio_inout(0x0003ff, 0x0003ff);
4496 gpio_write(1 << 9); /* reset MUX */
4497 gpio_write(0);
4498 /* Preset camera 0 to the 4 controllers */
c1d57038 4499 for (ix = 0; ix < 4; ix++) {
1da177e4
LT
4500 sw_status[ix] = ix;
4501 kodicom4400r_write(btv, ix, ix, 1);
4502 }
4503 /*
4504 * Since this is the "master", we need to set up the
4505 * other three controller chips' pointers to this structure
4506 * for later use in the muxsel routine.
4507 */
4508 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4509 return;
4510 master[btv->c.nr-1] = btv;
4511 master[btv->c.nr] = btv;
4512 master[btv->c.nr+1] = btv;
4513 master[btv->c.nr+2] = btv;
4514}
4515
24a70fdc
MCC
4516/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4517 * video multiplexers to provide up to 16 video inputs. These
4518 * multiplexers are controlled by the lower 8 GPIO pins of the
4519 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
1da177e4 4520
24a70fdc
MCC
4521 * xxx0 is pin xxx of multiplexer U5,
4522 * yyy1 is pin yyy of multiplexer U2
4523 */
1da177e4
LT
4524#define ENA0 0x01
4525#define ENB0 0x02
4526#define ENA1 0x04
4527#define ENB1 0x08
4528
4529#define IN10 0x10
4530#define IN00 0x20
4531#define IN11 0x40
4532#define IN01 0x80
4533
4534static void xguard_muxsel(struct bttv *btv, unsigned int input)
4535{
4536 static const int masks[] = {
4ac97914
MCC
4537 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4538 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4539 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4540 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
1da177e4
LT
4541 };
4542 gpio_write(masks[input%16]);
4543}
4544static void picolo_tetra_init(struct bttv *btv)
4545{
4546 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4547 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4548 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4549}
4550static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4551{
4552
4553 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4554 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4555 /*GPIO[20]&GPIO[21] used to choose the right input*/
4556 btwrite (input<<20,BT848_GPIO_DATA);
4557
4558}
4559
4560/*
4561 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4562 *
4563 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4564 * swichers to provide 16 channels to MUX0. The TDA8540's have
d6e05edc 4565 * 4 independent outputs and as such the IVC120G also has the
1da177e4
LT
4566 * optional "Monitor Out" bus. This allows the card to be looking
4567 * at one input while the monitor is looking at another.
4568 *
4569 * Since I've couldn't be bothered figuring out how to add an
25985edc 4570 * independent muxsel for the monitor bus, I've just set it to
1da177e4
LT
4571 * whatever the card is looking at.
4572 *
4573 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4574 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4575 *
4576 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4577 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4578 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4579 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4580 *
4581 */
4582
4583/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4584#define I2C_TDA8540 0x90
4585#define I2C_TDA8540_ALT1 0x92
4586#define I2C_TDA8540_ALT2 0x94
4587#define I2C_TDA8540_ALT3 0x96
4588#define I2C_TDA8540_ALT4 0x98
4589#define I2C_TDA8540_ALT5 0x9a
4590#define I2C_TDA8540_ALT6 0x9c
4591
4592static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4593{
24a70fdc 4594 /* Simple maths */
1da177e4
LT
4595 int key = input % 4;
4596 int matrix = input / 4;
4597
4598 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4599 btv->c.nr, input, matrix, key);
4600
24a70fdc 4601 /* Handles the input selection on the TDA8540's */
1da177e4
LT
4602 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4603 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4604 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4605 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4606 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4607 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4608 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4609 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4610
24a70fdc 4611 /* Handles the output enables on the TDA8540's */
1da177e4 4612 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
24a70fdc 4613 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
1da177e4 4614 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
24a70fdc 4615 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
1da177e4 4616 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
24a70fdc 4617 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
1da177e4 4618 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
24a70fdc 4619 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
1da177e4 4620
fb5deb1b 4621 /* 878's MUX0 is already selected for input via muxsel values */
1da177e4
LT
4622}
4623
4624
4625/* PXC200 muxsel helper
4626 * luke@syseng.anu.edu.au
4627 * another transplant
4628 * from Alessandro Rubini (rubini@linux.it)
4629 *
4630 * There are 4 kinds of cards:
4631 * PXC200L which is bt848
4632 * PXC200F which is bt848 with PIC controlling mux
4633 * PXC200AL which is bt878
4634 * PXC200AF which is bt878 with PIC controlling mux
4635 */
4636#define PX_CFG_PXC200F 0x01
4637#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4638#define PX_I2C_PIC 0x0f
4639#define PX_PXC200A_CARDID 0x200a1295
4640#define PX_I2C_CMD_CFG 0x00
4641
4642static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4643{
4ac97914 4644 int rc;
1da177e4
LT
4645 long mux;
4646 int bitmask;
4ac97914 4647 unsigned char buf[2];
1da177e4
LT
4648
4649 /* Read PIC config to determine if this is a PXC200F */
4650 /* PX_I2C_CMD_CFG*/
4651 buf[0]=0;
4652 buf[1]=0;
4653 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4654 if (rc) {
4655 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4656 /* not PXC ? do nothing */
4657 return;
4658 }
4659
4660 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4661 if (!(rc & PX_CFG_PXC200F)) {
4662 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4663 return;
4664 }
4665
4666
4667 /* The multiplexer in the 200F is handled by the GPIO port */
4668 /* get correct mapping between inputs */
4669 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4670 /* ** not needed!? */
4671 mux = input;
4672
4673 /* make sure output pins are enabled */
4674 /* bitmask=0x30f; */
4675 bitmask=0x302;
4676 /* check whether we have a PXC200A */
4ac97914 4677 if (btv->cardid == PX_PXC200A_CARDID) {
1da177e4
LT
4678 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4679 bitmask |= 7<<4; /* the DAC */
4680 }
4681 btwrite(bitmask, BT848_GPIO_OUT_EN);
4682
4683 bitmask = btread(BT848_GPIO_DATA);
4ac97914 4684 if (btv->cardid == PX_PXC200A_CARDID)
1da177e4
LT
4685 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4686 else /* older device */
4687 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4688 btwrite(bitmask,BT848_GPIO_DATA);
4689
4690 /*
4691 * Was "to be safe, set the bt848 to input 0"
4692 * Actually, since it's ok at load time, better not messing
4693 * with these bits (on PXC200AF you need to set mux 2 here)
4694 *
4695 * needed because bttv-driver sets mux before calling this function
4696 */
4ac97914 4697 if (btv->cardid == PX_PXC200A_CARDID)
1da177e4
LT
4698 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4699 else /* older device */
4700 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4701
4702 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4703}
4704
15f8eeb2
TP
4705static void phytec_muxsel(struct bttv *btv, unsigned int input)
4706{
4707 unsigned int mux = input % 4;
4708
4709 if (input == btv->svhs)
4710 mux = 0;
4711
4712 gpio_bits(0x3, mux);
4713}
4714
0c5db425
BC
4715/*
4716 * GeoVision GV-800(S) functions
4717 * Bruno Christo <bchristo@inf.ufsm.br>
4718*/
4719
4720/* This is a function to control the analog switch, which determines which
4721 * camera is routed to which controller. The switch comprises an X-address
4722 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4723 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4724 * A data value (gpio bit 18) of '1' enables the switch, and '0' disables
4725 * the switch. A STROBE bit (gpio bit 17) latches the data value into the
4726 * specified address. There is also a chip select (gpio bit 16).
4727 * The idea is to set the address and chip select together, bring
4728 * STROBE high, write the data, and finally bring STROBE back to low.
4729 */
4730static void gv800s_write(struct bttv *btv,
4731 unsigned char xaddr,
4732 unsigned char yaddr,
4733 unsigned char data) {
4734 /* On the "master" 878A:
4735 * GPIO bits 0-9 are used for the analog switch:
4736 * 00 - 03: camera selector
4737 * 04 - 06: 878A (controller) selector
4738 * 16: cselect
4739 * 17: strobe
4740 * 18: data (1->on, 0->off)
4741 * 19: reset
4742 */
4743 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4744 const u32 CSELECT = 1<<16;
4745 const u32 STROBE = 1<<17;
4746 const u32 DATA = data<<18;
4747
4748 gpio_bits(0x1007f, ADDRESS | CSELECT); /* write ADDRESS and CSELECT */
4749 gpio_bits(0x20000, STROBE); /* STROBE high */
4750 gpio_bits(0x40000, DATA); /* write DATA */
4751 gpio_bits(0x20000, ~STROBE); /* STROBE low */
4752}
4753
4754/*
4755 * GeoVision GV-800(S) muxsel
4756 *
4757 * Each of the 4 cards (controllers) use this function.
4758 * The controller using this function selects the input through the GPIO pins
4759 * of the "master" card. A pointer to this card is stored in master[btv->c.nr].
4760 *
4761 * The parameter 'input' is the requested camera number (0-4) on the controller.
4762 * The map array has the address of each input. Note that the addresses in the
4763 * array are in the sequence the original GeoVision driver uses, that is, set
4764 * every controller to input 0, then to input 1, 2, 3, repeat. This means that
4765 * the physical "camera 1" connector corresponds to controller 0 input 0,
4766 * "camera 2" corresponds to controller 1 input 0, and so on.
4767 *
4768 * After getting the input address, the function then writes the appropriate
4769 * data to the analog switch, and housekeeps the local copy of the switch
4770 * information.
4771 */
4772static void gv800s_muxsel(struct bttv *btv, unsigned int input)
4773{
4774 struct bttv *mctlr;
4775 char *sw_status;
4776 int xaddr, yaddr;
4777 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4778 { 0x1, 0x5, 0xb, 0x7 },
4779 { 0x2, 0x8, 0xc, 0xe },
4780 { 0x3, 0x9, 0xd, 0xf } };
4781 input = input%4;
4782 mctlr = master[btv->c.nr];
4783 if (mctlr == NULL) {
4784 /* do nothing until the "master" is detected */
4785 return;
4786 }
4787 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4788 sw_status = (char *)(&mctlr->mbox_we);
4789 xaddr = map[yaddr][input] & 0xf;
4790
4791 /* Check if the controller/camera pair has changed, ignore otherwise */
4792 if (sw_status[yaddr] != xaddr) {
4793 /* disable the old switch, enable the new one and save status */
4794 gv800s_write(mctlr, sw_status[yaddr], yaddr, 0);
4795 sw_status[yaddr] = xaddr;
4796 gv800s_write(mctlr, xaddr, yaddr, 1);
4797 }
4798}
4799
4800/* GeoVision GV-800(S) "master" chip init */
4801static void gv800s_init(struct bttv *btv)
4802{
4803 char *sw_status = (char *)(&btv->mbox_we);
4804 int ix;
4805
4806 gpio_inout(0xf107f, 0xf107f);
4807 gpio_write(1<<19); /* reset the analog MUX */
4808 gpio_write(0);
4809
4810 /* Preset camera 0 to the 4 controllers */
4811 for (ix = 0; ix < 4; ix++) {
4812 sw_status[ix] = ix;
4813 gv800s_write(btv, ix, ix, 1);
4814 }
4815
4816 /* Inputs on the "master" controller need this brightness fix */
4817 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
4818
4819 if (btv->c.nr > BTTV_MAX-4)
4820 return;
4821 /*
4822 * Store the "master" controller pointer in the master
4823 * array for later use in the muxsel function.
4824 */
4825 master[btv->c.nr] = btv;
4826 master[btv->c.nr+1] = btv;
4827 master[btv->c.nr+2] = btv;
4828 master[btv->c.nr+3] = btv;
4829}
4830
1da177e4
LT
4831/* ----------------------------------------------------------------------- */
4832/* motherboard chipset specific stuff */
4833
7d44e892 4834void __init bttv_check_chipset(void)
1da177e4
LT
4835{
4836 int pcipci_fail = 0;
4837 struct pci_dev *dev = NULL;
4838
3d265c96 4839 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
1da177e4
LT
4840 pcipci_fail = 1;
4841 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4842 triton1 = 1;
4843 if (pci_pci_problems & PCIPCI_VSFX)
4844 vsfx = 1;
4845#ifdef PCIPCI_ALIMAGIK
4846 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4847 latency = 0x0A;
4848#endif
4849
1da177e4
LT
4850
4851 /* print warnings about any quirks found */
4852 if (triton1)
4853 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4854 if (vsfx)
4855 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4856 if (pcipci_fail) {
9050d942
MCC
4857 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4858 "together.\n");
4dcef524 4859 if (!no_overlay) {
9050d942 4860 printk(KERN_INFO "bttv: overlay will be disabled.\n");
1da177e4 4861 no_overlay = 1;
4dcef524 4862 } else {
9050d942
MCC
4863 printk(KERN_INFO "bttv: overlay forced. Use this "
4864 "option at your own risk.\n");
1da177e4
LT
4865 }
4866 }
4867 if (UNSET != latency)
4868 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
2bfa1ac6 4869 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
1da177e4 4870 PCI_DEVICE_ID_INTEL_82441, dev))) {
4ac97914 4871 unsigned char b;
1da177e4
LT
4872 pci_read_config_byte(dev, 0x53, &b);
4873 if (bttv_debug)
4874 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4875 "bufcon=0x%02x\n",b);
4876 }
4877}
4878
4879int __devinit bttv_handle_chipset(struct bttv *btv)
4880{
4ac97914 4881 unsigned char command;
1da177e4
LT
4882
4883 if (!triton1 && !vsfx && UNSET == latency)
4884 return 0;
4885
4886 if (bttv_verbose) {
4887 if (triton1)
4888 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4889 if (vsfx && btv->id >= 878)
4890 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4891 if (UNSET != latency)
4892 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4893 btv->c.nr,latency);
4894 }
4895
4896 if (btv->id < 878) {
4897 /* bt848 (mis)uses a bit in the irq mask for etbf */
4898 if (triton1)
4899 btv->triton1 = BT848_INT_ETBF;
4900 } else {
4901 /* bt878 has a bit in the pci config space for it */
4ac97914 4902 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
1da177e4
LT
4903 if (triton1)
4904 command |= BT878_EN_TBFX;
4905 if (vsfx)
4906 command |= BT878_EN_VSFX;
4ac97914
MCC
4907 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4908 }
1da177e4
LT
4909 if (UNSET != latency)
4910 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4911 return 0;
4912}
4913
4914
4915/*
4916 * Local variables:
4917 * c-basic-offset: 8
4918 * End:
4919 */