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