blob: e6cdc9989e124b6ac10ee6dacdfab7ba66cb9020 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
3 bttv-cards.c
4
5 this file has configuration informations - card-specific stuff
6 like the big tvcards array for the most part
7
8 Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08009 & Marcus Metzler (mocm@thp.uni-koeln.de)
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 (c) 1999-2001 Gerd Knorr <kraxel@goldbach.in-berlin.de>
11
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
16
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
26*/
27
Linus Torvalds1da177e2005-04-16 15:20:36 -070028#include <linux/delay.h>
29#include <linux/module.h>
30#include <linux/moduleparam.h>
31#include <linux/kmod.h>
32#include <linux/init.h>
33#include <linux/pci.h>
34#include <linux/vmalloc.h>
35#include <linux/firmware.h>
36
37#include <asm/io.h>
38
39#include "bttvp.h"
Michael Krufky5e453dc2006-01-09 15:32:31 -020040#include <media/v4l2-common.h>
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -030041#include <media/tvaudio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
43/* fwd decl */
44static void boot_msp34xx(struct bttv *btv, int pin);
45static void boot_bt832(struct bttv *btv);
46static void hauppauge_eeprom(struct bttv *btv);
47static void avermedia_eeprom(struct bttv *btv);
48static void osprey_eeprom(struct bttv *btv);
49static void modtec_eeprom(struct bttv *btv);
50static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070051static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
54static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
55static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
56 int set);
57static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
58 int set);
59static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
60static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
61static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
62static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
63static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
64static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
65static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
66static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
67static void rv605_muxsel(struct bttv *btv, unsigned int input);
68static void eagle_muxsel(struct bttv *btv, unsigned int input);
69static void xguard_muxsel(struct bttv *btv, unsigned int input);
70static void ivc120_muxsel(struct bttv *btv, unsigned int input);
71static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
72
73static void PXC200_muxsel(struct bttv *btv, unsigned int input);
74
75static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
76static void picolo_tetra_init(struct bttv *btv);
77
78static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
79static void tibetCS16_init(struct bttv *btv);
80
81static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
82static void kodicom4400r_init(struct bttv *btv);
83
84static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
85static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
86
87static int terratec_active_radio_upgrade(struct bttv *btv);
88static int tea5757_read(struct bttv *btv);
89static int tea5757_write(struct bttv *btv, int value);
90static void identify_by_eeprom(struct bttv *btv,
91 unsigned char eeprom_data[256]);
92static int __devinit pvr_boot(struct bttv *btv);
93
94/* config variables */
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -020095static unsigned int triton1;
96static unsigned int vsfx;
Linus Torvalds1da177e2005-04-16 15:20:36 -070097static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070098int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
100static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
106#ifdef MODULE
107static unsigned int autoload = 1;
108#else
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -0200109static unsigned int autoload;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110#endif
111static unsigned int gpiomask = UNSET;
112static unsigned int audioall = UNSET;
113static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
114
115/* insmod options */
116module_param(triton1, int, 0444);
117module_param(vsfx, int, 0444);
118module_param(no_overlay, int, 0444);
119module_param(latency, int, 0444);
120module_param(gpiomask, int, 0444);
121module_param(audioall, int, 0444);
122module_param(autoload, int, 0444);
123
124module_param_array(card, int, NULL, 0444);
125module_param_array(pll, int, NULL, 0444);
126module_param_array(tuner, int, NULL, 0444);
127module_param_array(svhs, int, NULL, 0444);
128module_param_array(remote, int, NULL, 0444);
129module_param_array(audiomux, int, NULL, 0444);
130
131MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
132 "[enable bug compatibility for triton1 + others]");
133MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
134 "[yet another chipset flaw workaround]");
135MODULE_PARM_DESC(latency,"pci latency timer");
136MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
137MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
138MODULE_PARM_DESC(tuner,"specify installed tuner type");
139MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -0300140MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
141 " [some VIA/SIS chipsets are known to have problem with overlay]");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142
143/* ----------------------------------------------------------------------- */
144/* list of card IDs for bt878+ cards */
145
146static struct CARD {
147 unsigned id;
148 int cardnr;
149 char *name;
150} cards[] __devinitdata = {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800151 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
152 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
153 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
154 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
155 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
156 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
157 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
158 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
Kenth Anderssonf718e6e2005-11-08 21:37:02 -0800159 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800161 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
162 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800164 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
165 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
166 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
167 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
168 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800169 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800170 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
171 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800172 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800174 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700175 /* some cards ship with byteswapped IDs ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800176 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
177 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700178 /* this seems to happen as well ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800179 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
Wade Berrier434b2522007-06-25 13:02:16 -0300181 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800183 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800185 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
186 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
187 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
188 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
189 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
190 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
191 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800193 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
194 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
195 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
196 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
197 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800199 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
200 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
201 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
202 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700203
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800204 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
205 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700206 /* clashes with FlyVideo
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800207 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
208 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
209 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
210 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
211 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700212
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800213 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
214 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
216 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700218
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800219 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
220 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
221 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
222 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
223 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800225 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
226 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
227 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
228 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700229
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800230 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
231 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
232 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
233 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800235 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
236 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800261 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
262 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700263
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800264 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
265 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
267 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
268 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
269 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Trent Piepho657de3c2006-06-20 00:30:57 -0300271 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800272 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800274 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
275 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
276 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
278 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
279 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800280 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
281 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800282 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800284 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
285 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800287 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
288 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
289 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
290 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800292 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700293
Scott Alfter1ebba672007-04-02 14:22:39 -0300294 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
295 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
296
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700297 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800298 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700299
Steven Tothcd1257d2006-01-09 15:25:01 -0200300 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
301 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
302
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700303 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800304 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
Michael Krufky2af35572006-01-23 17:11:06 -0200305 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
306 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800307 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
308 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
309 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
310 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
Michael Krufky2af35572006-01-23 17:11:06 -0200311 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800312 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
Michael Krufky19790db2007-01-07 22:12:22 -0300313 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800314 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Cameron Hutchinson442d15d2006-06-21 18:45:31 -0300315 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
Michael Krufky27cb7862007-06-28 12:19:20 -0300316 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317
318 { 0, -1, NULL }
319};
320
321/* ----------------------------------------------------------------------- */
322/* array with description for bt848 / bt878 tv/grabber cards */
323
324struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800325 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800326 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800327 .name = " *** UNKNOWN/GENERIC *** ",
328 .video_inputs = 4,
329 .audio_inputs = 1,
330 .tuner = 0,
331 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200332 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800333 .tuner_type = -1,
334 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800335 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800336 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800337 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800338 .name = "MIRO PCTV",
339 .video_inputs = 4,
340 .audio_inputs = 1,
341 .tuner = 0,
342 .svhs = 2,
343 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200344 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300345 .gpiomux = { 2, 0, 0, 0 },
346 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800347 .needs_tvaudio = 1,
348 .tuner_type = -1,
349 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800350 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800351 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800352 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800353 .name = "Hauppauge (bt848)",
354 .video_inputs = 4,
355 .audio_inputs = 1,
356 .tuner = 0,
357 .svhs = 2,
358 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200359 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300360 .gpiomux = { 0, 1, 2, 3 },
361 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800362 .needs_tvaudio = 1,
363 .tuner_type = -1,
364 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800365 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800366 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800367 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800368 .name = "STB, Gateway P/N 6000699 (bt848)",
369 .video_inputs = 3,
370 .audio_inputs = 1,
371 .tuner = 0,
372 .svhs = 2,
373 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200374 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300375 .gpiomux = { 4, 0, 2, 3 },
376 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800377 .no_msp34xx = 1,
378 .needs_tvaudio = 1,
379 .tuner_type = TUNER_PHILIPS_NTSC,
380 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800381 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800382 .pll = PLL_28,
383 .has_radio = 1,
384 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800386 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800387 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800388 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
389 .video_inputs = 4,
390 .audio_inputs = 0,
391 .tuner = -1,
392 .svhs = 2,
393 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200394 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300395 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800396 .needs_tvaudio = 0,
397 .tuner_type = 4,
398 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800399 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800400 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800401 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800402 .name = "Diamond DTV2000",
403 .video_inputs = 4,
404 .audio_inputs = 1,
405 .tuner = 0,
406 .svhs = 2,
407 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200408 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300409 .gpiomux = { 0, 1, 0, 1 },
410 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800411 .needs_tvaudio = 1,
412 .tuner_type = -1,
413 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800414 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800415 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800416 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800417 .name = "AVerMedia TVPhone",
418 .video_inputs = 3,
419 .audio_inputs = 1,
420 .tuner = 0,
421 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200422 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800423 .gpiomask = 0x0f,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300424 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800425 /* 0x04 for some cards ?? */
426 .needs_tvaudio = 1,
427 .tuner_type = -1,
428 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800429 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800430 .audio_hook = avermedia_tvphone_audio,
431 .has_remote = 1,
432 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800433 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800434 .name = "MATRIX-Vision MV-Delta",
435 .video_inputs = 5,
436 .audio_inputs = 1,
437 .tuner = -1,
438 .svhs = 3,
439 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200440 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300441 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800442 .needs_tvaudio = 1,
443 .tuner_type = -1,
444 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800445 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800446 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800448 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800449 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800450 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
451 .video_inputs = 4,
452 .audio_inputs = 1,
453 .tuner = 0,
454 .svhs = 2,
455 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200456 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300457 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
458 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800459 .needs_tvaudio = 1,
460 .pll = PLL_28,
461 .tuner_type = -1,
462 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800463 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800464 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800465 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800466 .name = "IMS/IXmicro TurboTV",
467 .video_inputs = 3,
468 .audio_inputs = 1,
469 .tuner = 0,
470 .svhs = 2,
471 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200472 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300473 .gpiomux = { 1, 1, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800474 .needs_tvaudio = 0,
475 .pll = PLL_28,
476 .tuner_type = TUNER_TEMIC_PAL,
477 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800478 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800479 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800480 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800481 .name = "Hauppauge (bt878)",
482 .video_inputs = 4,
483 .audio_inputs = 1,
484 .tuner = 0,
485 .svhs = 2,
486 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200487 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300488 .gpiomux = { 0, 1, 2, 3 },
489 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800490 .needs_tvaudio = 1,
491 .pll = PLL_28,
492 .tuner_type = -1,
493 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800494 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800495 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800496 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800497 .name = "MIRO PCTV pro",
498 .video_inputs = 3,
499 .audio_inputs = 1,
500 .tuner = 0,
501 .svhs = 2,
502 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200503 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300504 .gpiomux = { 0x20001,0x10001, 0, 0 },
505 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800506 .needs_tvaudio = 1,
507 .tuner_type = -1,
508 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800509 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800510 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800512 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800513 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800514 .name = "ADS Technologies Channel Surfer TV (bt848)",
515 .video_inputs = 3,
516 .audio_inputs = 1,
517 .tuner = 0,
518 .svhs = 2,
519 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200520 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300521 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800522 .needs_tvaudio = 1,
523 .tuner_type = -1,
524 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800525 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800526 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800527 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800528 .name = "AVerMedia TVCapture 98",
529 .video_inputs = 3,
530 .audio_inputs = 4,
531 .tuner = 0,
532 .svhs = 2,
533 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200534 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300535 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800536 .needs_tvaudio = 1,
537 .msp34xx_alt = 1,
538 .pll = PLL_28,
539 .tuner_type = TUNER_PHILIPS_PAL,
540 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800541 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800542 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800543 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800544 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800545 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800546 .name = "Aimslab Video Highway Xtreme (VHX)",
547 .video_inputs = 3,
548 .audio_inputs = 1,
549 .tuner = 0,
550 .svhs = 2,
551 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200552 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300553 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
554 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800555 .needs_tvaudio = 1,
556 .pll = PLL_28,
557 .tuner_type = -1,
558 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800559 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800560 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800561 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800562 .name = "Zoltrix TV-Max",
563 .video_inputs = 3,
564 .audio_inputs = 1,
565 .tuner = 0,
566 .svhs = 2,
567 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200568 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300569 .gpiomux = { 0, 0, 1, 0 },
570 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800571 .needs_tvaudio = 1,
572 .tuner_type = -1,
573 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800574 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800575 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800577 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800578 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800579 .name = "Prolink Pixelview PlayTV (bt878)",
580 .video_inputs = 3,
581 .audio_inputs = 1,
582 .tuner = 0,
583 .svhs = 2,
584 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200585 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800586 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300587 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
588 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800589 .needs_tvaudio = 1,
590 .pll = PLL_28,
591 .tuner_type = -1,
592 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800593 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800594 .name = "Leadtek WinView 601",
595 .video_inputs = 3,
596 .audio_inputs = 1,
597 .tuner = 0,
598 .svhs = 2,
599 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200600 .muxsel = { 2, 3, 1, 1,0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300601 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
602 .gpiomute = 0xcfa007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800603 .needs_tvaudio = 1,
604 .tuner_type = -1,
605 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800606 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800607 .audio_hook = winview_audio,
608 .has_radio = 1,
609 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800610 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800611 .name = "AVEC Intercapture",
612 .video_inputs = 3,
613 .audio_inputs = 2,
614 .tuner = 0,
615 .svhs = 2,
616 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200617 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300618 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800619 .needs_tvaudio = 1,
620 .tuner_type = -1,
621 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800622 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800623 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800624 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800625 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
626 .video_inputs = 4,
627 .audio_inputs = 1,
628 .tuner = -1,
629 .svhs = -1,
630 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200631 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300632 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800633 .no_msp34xx = 1,
634 .tuner_type = -1,
635 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800636 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800637 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800639 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800640 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800641 .name = "CEI Raffles Card",
642 .video_inputs = 3,
643 .audio_inputs = 3,
644 .tuner = 0,
645 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200646 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800647 .tuner_type = -1,
648 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800649 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800650 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800651 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800652 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
653 .video_inputs = 4,
654 .audio_inputs = 2, /* tuner, line in */
655 .tuner = 0,
656 .svhs = 2,
657 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200658 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300659 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
660 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800661 .pll = PLL_28,
662 .tuner_type = TUNER_PHILIPS_PAL_I,
663 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800664 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800665 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800666 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800667 .name = "Askey CPH050/ Phoebe Tv Master + FM",
668 .video_inputs = 3,
669 .audio_inputs = 1,
670 .tuner = 0,
671 .svhs = 2,
672 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200673 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300674 .gpiomux = { 0, 1, 0x800, 0x400 },
675 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800676 .needs_tvaudio = 1,
677 .pll = PLL_28,
678 .tuner_type = -1,
679 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800680 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800681 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800682 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800683 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
684 .video_inputs = 3,
685 .audio_inputs = 1,
686 .tuner = 0,
687 .svhs = -1,
688 .gpiomask = 7,
689 .muxsel = { 2, 3, -1 },
690 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300691 .gpiomux = { 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800692 .no_msp34xx = 1,
693 .pll = PLL_28,
694 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
695 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800696 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800697 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800699 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800700 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800701 .name = "Askey CPH05X/06X (bt878) [many vendors]",
702 .video_inputs = 3,
703 .audio_inputs = 1,
704 .tuner = 0,
705 .svhs = 2,
706 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200707 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300708 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
709 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800710 .needs_tvaudio = 1,
711 .pll = PLL_28,
712 .tuner_type = -1,
713 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800714 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800715 .has_remote = 1,
716 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800717 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800718 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
719 .video_inputs = 3,
720 .audio_inputs = 1,
721 .tuner = 0,
722 .svhs = 2,
723 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200724 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300725 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
726 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800727 .needs_tvaudio = 0,
728 .tuner_type = TUNER_PHILIPS_PAL,
729 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800730 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800731 .audio_hook = terratv_audio,
732 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800733 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800734 .name = "Hauppauge WinCam newer (bt878)",
735 .video_inputs = 4,
736 .audio_inputs = 1,
737 .tuner = 0,
738 .svhs = 3,
739 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200740 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300741 .gpiomux = { 0, 1, 2, 3 },
742 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800743 .needs_tvaudio = 1,
744 .tuner_type = -1,
745 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800746 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800747 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800748 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800749 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
750 .video_inputs = 4,
751 .audio_inputs = 2,
752 .tuner = 0,
753 .svhs = 2,
754 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200755 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300756 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
757 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800758 .pll = PLL_28,
759 .tuner_type = TUNER_PHILIPS_SECAM,
760 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800761 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800762 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700763
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800764 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800765 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800766 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
767 .video_inputs = 3,
768 .audio_inputs = 1,
769 .tuner = 0,
770 .svhs = 2,
771 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200772 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300773 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
774 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800775 .needs_tvaudio = 0,
776 .tuner_type = TUNER_PHILIPS_PAL,
777 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800778 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800779 .audio_hook = terratv_audio,
780 /* GPIO wiring:
781 External 20 pin connector (for Active Radio Upgrade board)
782 gpio00: i2c-sda
783 gpio01: i2c-scl
784 gpio02: om5610-data
785 gpio03: om5610-clk
786 gpio04: om5610-wre
787 gpio05: om5610-stereo
788 gpio06: rds6588-davn
789 gpio07: Pin 7 n.c.
790 gpio08: nIOW
791 gpio09+10: nIOR, nSEL ?? (bt878)
792 gpio09: nIOR (bt848)
793 gpio10: nSEL (bt848)
794 Sound Routing:
795 gpio16: u2-A0 (1st 4052bt)
796 gpio17: u2-A1
797 gpio18: u2-nEN
798 gpio19: u4-A0 (2nd 4052)
799 gpio20: u4-A1
800 u4-nEN - GND
801 Btspy:
802 00000 : Cdrom (internal audio input)
803 10000 : ext. Video audio input
804 20000 : TV Mono
805 a0000 : TV Mono/2
806 1a0000 : TV Stereo
807 30000 : Radio
808 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700809 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800811 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800812 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800813 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
814 .name = "Imagenation PXC200",
815 .video_inputs = 5,
816 .audio_inputs = 1,
817 .tuner = -1,
818 .svhs = 1, /* was: 4 */
819 .gpiomask = 0,
820 .muxsel = { 2, 3, 1, 0, 0},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300821 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800822 .needs_tvaudio = 1,
823 .tuner_type = -1,
824 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800825 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800826 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800828 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800829 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800830 .name = "Lifeview FlyVideo 98 LR50",
831 .video_inputs = 4,
832 .audio_inputs = 1,
833 .tuner = 0,
834 .svhs = 2,
835 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200836 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300837 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
838 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800839 .pll = PLL_28,
840 .tuner_type = -1,
841 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800842 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800843 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800844 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800845 .name = "Formac iProTV, Formac ProTV I (bt848)",
846 .video_inputs = 4,
847 .audio_inputs = 1,
848 .tuner = 0,
849 .svhs = 3,
850 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200851 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300852 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800853 .pll = PLL_28,
854 .tuner_type = TUNER_PHILIPS_PAL,
855 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800856 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800857 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700858
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800859 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800860 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800861 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
862 .video_inputs = 4,
863 .audio_inputs = 0,
864 .tuner = -1,
865 .svhs = 2,
866 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200867 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300868 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800869 .needs_tvaudio = 0,
870 .tuner_type = 4,
871 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800872 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800873 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800874 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800875 .name = "Terratec TerraTValue Version Bt878",
876 .video_inputs = 3,
877 .audio_inputs = 1,
878 .tuner = 0,
879 .svhs = 2,
880 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200881 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300882 .gpiomux = { 0x500, 0, 0x300, 0x900 },
883 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800884 .needs_tvaudio = 1,
885 .pll = PLL_28,
886 .tuner_type = TUNER_PHILIPS_PAL,
887 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800888 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800889 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800890 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800891 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
892 .video_inputs = 4,
893 .audio_inputs = 1,
894 .tuner = 0,
895 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200896 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800897 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
898 .gpiomask = 0xb33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300899 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
900 .gpiomute = 0x800000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800901 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
902 gpio23 -- hef4052:nEnable (0x800000)
903 gpio12 -- hef4052:A1
904 gpio13 -- hef4052:A0
905 0x0000: external audio
906 0x1000: FM
907 0x2000: TV
908 0x3000: n.c.
909 Note: There exists another variant "Winfast 2000" with tv stereo !?
910 Note: eeprom only contains FF and pci subsystem id 107d:6606
911 */
912 .needs_tvaudio = 0,
913 .pll = PLL_28,
914 .has_radio = 1,
915 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
916 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800917 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800918 .audio_hook = winfast2000_audio,
919 .has_remote = 1,
920 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800921 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800922 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
923 .video_inputs = 4,
924 .audio_inputs = 3,
925 .tuner = 0,
926 .svhs = 2,
927 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200928 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300929 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
930 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800931 .pll = PLL_28,
932 .tuner_type = -1,
933 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800934 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800935 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700936
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800937 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800938 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800939 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
940 .video_inputs = 4,
941 .audio_inputs = 3,
942 .tuner = 0,
943 .svhs = 2,
944 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200945 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300946 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
947 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800948 .pll = PLL_28,
949 .tuner_type = -1,
950 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800951 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800952 .has_radio = 1,
953 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800954 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800955 .name = "Prolink PixelView PlayTV pro",
956 .video_inputs = 3,
957 .audio_inputs = 1,
958 .tuner = 0,
959 .svhs = 2,
960 .gpiomask = 0xff,
961 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300962 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
963 .gpiomute = 0x29,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800964 .no_msp34xx = 1,
965 .pll = PLL_28,
966 .tuner_type = -1,
967 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800968 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800969 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800970 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800971 .name = "Askey CPH06X TView99",
972 .video_inputs = 4,
973 .audio_inputs = 1,
974 .tuner = 0,
975 .svhs = 2,
976 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200977 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300978 .gpiomux = { 0x551400, 0x551200, 0, 0 },
979 .gpiomute = 0x551c00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800980 .needs_tvaudio = 1,
981 .pll = PLL_28,
982 .tuner_type = 1,
983 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800984 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800985 .has_remote = 1,
986 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800987 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800988 .name = "Pinnacle PCTV Studio/Rave",
989 .video_inputs = 3,
990 .audio_inputs = 1,
991 .tuner = 0,
992 .svhs = 2,
993 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -0200994 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300995 .gpiomux = { 2, 0xd0001, 0, 0 },
996 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800997 .needs_tvaudio = 0,
998 .pll = PLL_28,
999 .tuner_type = -1,
1000 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001001 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001002 },
1003
1004 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001005 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001006 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1007 .video_inputs = 3,
1008 .audio_inputs = 1,
1009 .tuner = 0,
1010 .svhs = 2,
1011 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001012 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001013 .gpiomux = { 4, 0, 2, 3 },
1014 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001015 .no_msp34xx = 1,
1016 .needs_tvaudio = 1,
1017 .tuner_type = TUNER_PHILIPS_NTSC,
1018 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001019 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001020 .pll = PLL_28,
1021 .has_radio = 1,
1022 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001023 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001024 .name = "AVerMedia TVPhone 98",
1025 .video_inputs = 3,
1026 .audio_inputs = 4,
1027 .tuner = 0,
1028 .svhs = 2,
1029 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001030 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001031 .gpiomux = { 13, 4, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001032 .needs_tvaudio = 1,
1033 .pll = PLL_28,
1034 .tuner_type = -1,
1035 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001036 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001037 .has_radio = 1,
1038 .audio_hook = avermedia_tvphone_audio,
1039 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001040 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001041 .name = "ProVideo PV951", /* pic16c54 */
1042 .video_inputs = 3,
1043 .audio_inputs = 1,
1044 .tuner = 0,
1045 .svhs = 2,
1046 .gpiomask = 0,
1047 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001048 .gpiomux = { 0, 0, 0, 0},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001049 .needs_tvaudio = 1,
1050 .no_msp34xx = 1,
1051 .pll = PLL_28,
1052 .tuner_type = 1,
1053 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001054 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001055 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001056 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001057 .name = "Little OnAir TV",
1058 .video_inputs = 3,
1059 .audio_inputs = 1,
1060 .tuner = 0,
1061 .svhs = 2,
1062 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001063 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001064 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1065 .gpiomute = 0xff3ffc,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001066 .no_msp34xx = 1,
1067 .tuner_type = -1,
1068 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001069 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001070 },
1071
1072 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001073 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001074 .name = "Sigma TVII-FM",
1075 .video_inputs = 2,
1076 .audio_inputs = 1,
1077 .tuner = 0,
1078 .svhs = -1,
1079 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001080 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001081 .gpiomux = { 1, 1, 0, 2 },
1082 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001083 .no_msp34xx = 1,
1084 .pll = PLL_NONE,
1085 .tuner_type = -1,
1086 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001087 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001088 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001089 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001090 .name = "MATRIX-Vision MV-Delta 2",
1091 .video_inputs = 5,
1092 .audio_inputs = 1,
1093 .tuner = -1,
1094 .svhs = 3,
1095 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001096 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001097 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001098 .no_msp34xx = 1,
1099 .pll = PLL_28,
1100 .tuner_type = -1,
1101 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001102 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001103 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001104 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001105 .name = "Zoltrix Genie TV/FM",
1106 .video_inputs = 3,
1107 .audio_inputs = 1,
1108 .tuner = 0,
1109 .svhs = 2,
1110 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001111 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001112 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1113 .gpiomute = 0xbcb03f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001114 .no_msp34xx = 1,
1115 .pll = PLL_28,
1116 .tuner_type = 21,
1117 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001118 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001119 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001120 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001121 .name = "Terratec TV/Radio+",
1122 .video_inputs = 3,
1123 .audio_inputs = 1,
1124 .tuner = 0,
1125 .svhs = 2,
1126 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001127 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001128 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1129 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001130 .needs_tvaudio = 1,
1131 .no_msp34xx = 1,
1132 .pll = PLL_35,
1133 .tuner_type = 1,
1134 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001135 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001136 .has_radio = 1,
1137 },
1138
1139 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001140 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001141 .name = "Askey CPH03x/ Dynalink Magic TView",
1142 .video_inputs = 3,
1143 .audio_inputs = 1,
1144 .tuner = 0,
1145 .svhs = 2,
1146 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001147 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001148 .gpiomux = {2,0,0,0 },
1149 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001150 .needs_tvaudio = 1,
1151 .pll = PLL_28,
1152 .tuner_type = -1,
1153 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001154 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001155 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001156 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001157 .name = "IODATA GV-BCTV3/PCI",
1158 .video_inputs = 3,
1159 .audio_inputs = 1,
1160 .tuner = 0,
1161 .svhs = 2,
1162 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001163 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001164 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001165 .no_msp34xx = 1,
1166 .pll = PLL_28,
1167 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1168 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001169 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001170 .audio_hook = gvbctv3pci_audio,
1171 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001172 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001173 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1174 .video_inputs = 5,
1175 .audio_inputs = 1,
1176 .tuner = 0,
1177 .svhs = 3,
1178 .gpiomask = 0xAA0000,
1179 .muxsel = { 2,3,1,1,-1 },
1180 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001181 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1182 .gpiomute = 0xa8000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001183 .no_msp34xx = 1,
1184 .pll = PLL_28,
1185 .tuner_type = TUNER_PHILIPS_PAL_I,
1186 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001187 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001188 .has_remote = 1,
1189 /* GPIO wiring: (different from Rev.4C !)
1190 GPIO17: U4.A0 (first hef4052bt)
1191 GPIO19: U4.A1
1192 GPIO20: U5.A1 (second hef4052bt)
1193 GPIO21: U4.nEN
1194 GPIO22: BT832 Reset Line
1195 GPIO23: A5,A0, U5,nEN
1196 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1197 */
1198 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001199 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001200 .name = "Eagle Wireless Capricorn2 (bt878A)",
1201 .video_inputs = 4,
1202 .audio_inputs = 1,
1203 .tuner = 0,
1204 .svhs = 2,
1205 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001206 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001207 .gpiomux = { 0, 1, 2, 3 },
1208 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001209 .pll = PLL_28,
1210 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1211 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001212 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001213 },
1214
1215 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001216 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001217 /* David Härdeman <david@2gen.com> */
1218 .name = "Pinnacle PCTV Studio Pro",
1219 .video_inputs = 4,
1220 .audio_inputs = 1,
1221 .tuner = 0,
1222 .svhs = 3,
1223 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001224 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001225 .gpiomux = { 1, 0xd0001, 0, 0 },
1226 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001227 /* sound path (5 sources):
1228 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1229 0= ext. Audio IN
1230 1= from MUX2
1231 2= Mono TV sound from Tuner
1232 3= not connected
1233 MUX2 (mask 0x30000):
1234 0,2,3= from MSP34xx
1235 1= FM stereo Radio from Tuner */
1236 .needs_tvaudio = 0,
1237 .pll = PLL_28,
1238 .tuner_type = -1,
1239 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001240 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001241 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001242 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001243 /* Claas Langbehn <claas@bigfoot.com>,
1244 Sven Grothklags <sven@upb.de> */
1245 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1246 .video_inputs = 4,
1247 .audio_inputs = 3,
1248 .tuner = 0,
1249 .svhs = 2,
1250 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001251 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001252 .gpiomux = { 0, 0, 0x10, 8 },
1253 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001254 .needs_tvaudio = 1,
1255 .pll = PLL_28,
1256 .tuner_type = TUNER_PHILIPS_PAL,
1257 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001258 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001259 .has_radio = 1,
1260 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001261 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001262 /* Tim Röstermundt <rosterm@uni-muenster.de>
1263 in de.comp.os.unix.linux.hardware:
1264 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001265 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001266 options tuner type=5 */
1267 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1268 .video_inputs = 4,
1269 .audio_inputs = 1,
1270 .tuner = 0,
1271 .svhs = 2,
1272 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001273 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001274 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1275 .gpiomute = 0x18e0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001276 /* For cards with tda9820/tda9821:
1277 0x0000: Tuner normal stereo
1278 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1279 0x0880: Tuner A2 stereo */
1280 .pll = PLL_28,
1281 .tuner_type = -1,
1282 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001283 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001284 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001285 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001286 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1287 old Easy TV BT848 version (model CPH031) */
1288 .name = "Askey CPH031/ BESTBUY Easy TV",
1289 .video_inputs = 4,
1290 .audio_inputs = 1,
1291 .tuner = 0,
1292 .svhs = 2,
1293 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001294 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001295 .gpiomux = { 2, 0, 0, 0 },
1296 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001297 .needs_tvaudio = 0,
1298 .pll = PLL_28,
1299 .tuner_type = TUNER_TEMIC_PAL,
1300 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001301 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001302 },
1303
1304 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001305 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001306 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1307 .name = "Lifeview FlyVideo 98FM LR50",
1308 .video_inputs = 4,
1309 .audio_inputs = 3,
1310 .tuner = 0,
1311 .svhs = 2,
1312 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001313 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001314 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1315 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001316 .pll = PLL_28,
1317 .tuner_type = 5,
1318 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001319 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001320 },
1321 /* This is the ultimate cheapo capture card
1322 * just a BT848A on a small PCB!
1323 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001324 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001325 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1326 .video_inputs = 2,
1327 .audio_inputs = 0,
1328 .tuner = -1,
1329 .svhs = 1,
1330 .gpiomask = 0,
1331 .muxsel = { 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001332 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001333 .needs_tvaudio = 0,
1334 .no_msp34xx = 1,
1335 .pll = PLL_35,
1336 .tuner_type = -1,
1337 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001338 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001339 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001340 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001341 /* Daniel Herrington <daniel.herrington@home.com> */
1342 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1343 .video_inputs = 3,
1344 .audio_inputs = 1,
1345 .tuner = 0,
1346 .svhs = 2,
1347 .gpiomask = 0xe00,
1348 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001349 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1350 .gpiomute = 0x800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001351 .needs_tvaudio = 1,
1352 .pll = PLL_28,
1353 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1354 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001355 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001356 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001357 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001358 /* Matti Mottus <mottus@physic.ut.ee> */
1359 .name = "Askey CPH03x TV Capturer",
1360 .video_inputs = 4,
1361 .audio_inputs = 1,
1362 .tuner = 0,
1363 .svhs = 2,
1364 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001365 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001366 .gpiomux = { 2, 0, 0, 0 },
1367 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001368 .pll = PLL_28,
1369 .tuner_type = 0,
1370 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001371 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001372 },
1373
1374 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001375 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001376 /* Philip Blundell <philb@gnu.org> */
1377 .name = "Modular Technology MM100PCTV",
1378 .video_inputs = 2,
1379 .audio_inputs = 2,
1380 .tuner = 0,
1381 .svhs = -1,
1382 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001383 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001384 .gpiomux = { 2, 0, 0, 1 },
1385 .gpiomute = 8,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001386 .pll = PLL_35,
1387 .tuner_type = TUNER_TEMIC_PAL,
1388 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001389 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001390 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001391 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001392 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001393 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001394 .video_inputs = 2,
1395 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001396 .tuner = -1,
1397 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001398 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001399 .muxsel = { 2, 2 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001400 .gpiomux = { },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001401 .no_msp34xx = 1,
1402 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001403 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001404 .tuner_type = -1,
1405 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001406 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001407 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001408 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001409 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1410 new Easy TV BT878 version (model CPH061)
1411 special thanks to Informatica Mieres for providing the card */
1412 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1413 .video_inputs = 3,
1414 .audio_inputs = 2,
1415 .tuner = 0,
1416 .svhs = 2,
1417 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001418 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001419 .gpiomux = { 1, 0, 4, 4 },
1420 .gpiomute = 9,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001421 .needs_tvaudio = 0,
1422 .pll = PLL_28,
1423 .tuner_type = TUNER_PHILIPS_PAL,
1424 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001425 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001426 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001427 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001428 /* Lukas Gebauer <geby@volny.cz> */
1429 .name = "ATI TV-Wonder",
1430 .video_inputs = 3,
1431 .audio_inputs = 1,
1432 .tuner = 0,
1433 .svhs = 2,
1434 .gpiomask = 0xf03f,
1435 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001436 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1437 .gpiomute = 0xbffe,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001438 .pll = PLL_28,
1439 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1440 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001441 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001442 },
1443
1444 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001445 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001446 /* Lukas Gebauer <geby@volny.cz> */
1447 .name = "ATI TV-Wonder VE",
1448 .video_inputs = 2,
1449 .audio_inputs = 1,
1450 .tuner = 0,
1451 .svhs = -1,
1452 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001453 .muxsel = { 2, 3, 0, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001454 .gpiomux = { 0, 0, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001455 .no_msp34xx = 1,
1456 .pll = PLL_28,
1457 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1458 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001459 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001460 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001461 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001462 /* DeeJay <deejay@westel900.net (2000S) */
1463 .name = "Lifeview FlyVideo 2000S LR90",
1464 .video_inputs = 3,
1465 .audio_inputs = 3,
1466 .tuner = 0,
1467 .svhs = 2,
1468 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001469 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001470 /* Radio changed from 1e80 to 0x800 to make
1471 FlyVideo2000S in .hu happy (gm)*/
1472 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001473 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1474 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001475 .audio_hook = fv2000s_audio,
1476 .no_msp34xx = 1,
1477 .no_tda9875 = 1,
1478 .needs_tvaudio = 1,
1479 .pll = PLL_28,
1480 .tuner_type = 5,
1481 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001482 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001483 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001484 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001485 .name = "Terratec TValueRadio",
1486 .video_inputs = 3,
1487 .audio_inputs = 1,
1488 .tuner = 0,
1489 .svhs = 2,
1490 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001491 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001492 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1493 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001494 .needs_tvaudio = 1,
1495 .pll = PLL_28,
1496 .tuner_type = TUNER_PHILIPS_PAL,
1497 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001498 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001499 .has_radio = 1,
1500 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001501 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001502 /* TANAKA Kei <peg00625@nifty.com> */
1503 .name = "IODATA GV-BCTV4/PCI",
1504 .video_inputs = 3,
1505 .audio_inputs = 1,
1506 .tuner = 0,
1507 .svhs = 2,
1508 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001509 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001510 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001511 .no_msp34xx = 1,
1512 .pll = PLL_28,
1513 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1514 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001515 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001516 .audio_hook = gvbctv3pci_audio,
1517 },
1518
1519 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001520 [BTTV_BOARD_VOODOOTV_FM] = {
Wade Berrier434b2522007-06-25 13:02:16 -03001521 .name = "3Dfx VoodooTV FM (Euro)",
1522 /* try "insmod msp3400 simple=0" if you have
1523 * sound problems with this card. */
1524 .video_inputs = 4,
1525 .audio_inputs = 1,
1526 .tuner = 0,
1527 .svhs = -1,
1528 .gpiomask = 0x4f8a00,
1529 /* 0x100000: 1=MSP enabled (0=disable again)
1530 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1531 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1532 .gpiomute = 0x947fff,
1533 /* tvtuner, radio, external,internal, mute, stereo
1534 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1535 .muxsel = { 2, 3 ,0 ,1 },
1536 .tuner_type = TUNER_MT2032,
1537 .tuner_addr = ADDR_UNSET,
1538 .radio_addr = ADDR_UNSET,
1539 .pll = PLL_28,
1540 .has_radio = 1,
1541 },
1542 [BTTV_BOARD_VOODOOTV_200] = {
1543 .name = "VoodooTV 200 (USA)",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001544 /* try "insmod msp3400 simple=0" if you have
1545 * sound problems with this card. */
1546 .video_inputs = 4,
1547 .audio_inputs = 1,
1548 .tuner = 0,
1549 .svhs = -1,
1550 .gpiomask = 0x4f8a00,
1551 /* 0x100000: 1=MSP enabled (0=disable again)
1552 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001553 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1554 .gpiomute = 0x947fff,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001555 /* tvtuner, radio, external,internal, mute, stereo
1556 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001557 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001558 .tuner_type = TUNER_MT2032,
1559 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001560 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001561 .pll = PLL_28,
1562 .has_radio = 1,
1563 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001564 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001565 /* Philip Blundell <pb@nexus.co.uk> */
1566 .name = "Active Imaging AIMMS",
1567 .video_inputs = 1,
1568 .audio_inputs = 0,
1569 .tuner = -1,
1570 .tuner_type = -1,
1571 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001572 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001573 .pll = PLL_28,
1574 .muxsel = { 2 },
1575 .gpiomask = 0
1576 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001577 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001578 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1579 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1580 .video_inputs = 3,
1581 .audio_inputs = 4,
1582 .tuner = 0,
1583 .svhs = 2,
1584 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001585 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001586 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1587 .gpiomute = 13,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001588 .needs_tvaudio = 1,
1589 .pll = PLL_28,
1590 .tuner_type = 25,
1591 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001592 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001593 .has_remote = 1,
1594 /* GPIO wiring:
1595 GPIO0: U4.A0 (hef4052bt)
1596 GPIO1: U4.A1
1597 GPIO2: U4.A1 (second hef4052bt)
1598 GPIO3: U4.nEN, U5.A0, A5.nEN
1599 GPIO8-15: vrd866b ?
1600 */
1601 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001602 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001603 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1604 .video_inputs = 4,
1605 .audio_inputs = 0,
1606 .tuner = -1,
1607 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001608 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001609 .pll = PLL_28,
1610 .no_msp34xx = 1,
1611 .tuner_type = UNSET,
1612 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001613 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001614 },
1615
1616 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001617 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001618 /* Dariusz Kowalewski <darekk@automex.pl> */
1619 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1620 .video_inputs = 4,
1621 .audio_inputs = 1,
1622 .tuner = 0,
1623 .svhs = 2,
1624 .gpiomask = 0x3f,
1625 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001626 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1627 .gpiomute = 0x09,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001628 .needs_tvaudio = 1,
1629 .no_msp34xx = 1,
1630 .no_tda9875 = 1,
1631 .pll = PLL_28,
1632 .tuner_type = 5,
1633 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001634 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001635 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1636 .has_radio = 1, /* Note: not all cards have radio */
1637 .has_remote = 1,
1638 /* GPIO wiring:
1639 GPIO0: A0 hef4052
1640 GPIO1: A1 hef4052
1641 GPIO3: nEN hef4052
1642 GPIO8-15: vrd866b
1643 GPIO20,22,23: R30,R29,R28
1644 */
1645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001646 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001647 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1648 /* you must jumper JP5 for the card to work */
1649 .name = "Sensoray 311",
1650 .video_inputs = 5,
1651 .audio_inputs = 0,
1652 .tuner = -1,
1653 .svhs = 4,
1654 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001655 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001656 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001657 .needs_tvaudio = 0,
1658 .tuner_type = -1,
1659 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001660 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001661 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001662 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001663 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1664 .name = "RemoteVision MX (RV605)",
1665 .video_inputs = 16,
1666 .audio_inputs = 0,
1667 .tuner = -1,
1668 .svhs = -1,
1669 .gpiomask = 0x00,
1670 .gpiomask2 = 0x07ff,
1671 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1672 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1673 .no_msp34xx = 1,
1674 .no_tda9875 = 1,
1675 .tuner_type = -1,
1676 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001677 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001678 .muxsel_hook = rv605_muxsel,
1679 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001680 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001681 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1682 .video_inputs = 3,
1683 .audio_inputs = 2,
1684 .tuner = 0,
1685 .svhs = 2,
1686 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1687 .muxsel = { 2, 1, 1, },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001688 .gpiomux = { 0, 1, 2, 2 },
1689 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001690 .needs_tvaudio = 0,
1691 .tuner_type = TUNER_PHILIPS_PAL,
1692 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001693 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001694 .pll = PLL_28,
1695 .has_radio = 1,
1696 },
1697
1698 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001699 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001700 /* Masaki Suzuki <masaki@btree.org> */
1701 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1702 .video_inputs = 3,
1703 .audio_inputs = 1,
1704 .tuner = 0,
1705 .svhs = 2,
1706 .gpiomask = 0x140007,
1707 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001708 .gpiomux = { 0, 1, 2, 3 },
1709 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001710 .tuner_type = TUNER_PHILIPS_NTSC,
1711 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001712 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001713 .audio_hook = windvr_audio,
1714 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001715 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001716 .name = "GrandTec Multi Capture Card (Bt878)",
1717 .video_inputs = 4,
1718 .audio_inputs = 0,
1719 .tuner = -1,
1720 .svhs = -1,
1721 .gpiomask = 0,
1722 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001723 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001724 .needs_tvaudio = 0,
1725 .no_msp34xx = 1,
1726 .pll = PLL_28,
1727 .tuner_type = -1,
1728 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001729 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001730 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001731 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001732 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1733 .video_inputs = 4,
1734 .audio_inputs = 3,
1735 .tuner = 0,
1736 .svhs = 2,
1737 .gpiomask = 7,
1738 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001739 .gpiomux = { 0, 0, 4, 4 },/* Yes, this tuner uses the same audio output for TV and FM radio!
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001740 * This card lacks external Audio In, so we mute it on Ext. & Int.
1741 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1742 * This card lacks PCI subsystem ID, sigh.
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001743 * gpiomux =1: lower volume, 2+3: mute
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001744 * btwincap uses 0x80000/0x80003
1745 */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001746 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001747 .needs_tvaudio = 0,
1748 .no_msp34xx = 1,
1749 .pll = PLL_28,
1750 .tuner_type = 5,
1751 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001752 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001753 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1754 radio signal strength indicators work fine. */
1755 .has_radio = 1,
1756 /* GPIO Info:
1757 GPIO0,1: HEF4052 A0,A1
1758 GPIO2: HEF4052 nENABLE
1759 GPIO3-7: n.c.
1760 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1761 GPIO14,15: ??
1762 GPIO16-21: n.c.
1763 GPIO22,23: ??
1764 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1765 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001766 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001767 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1768 .name = "DSP Design TCVIDEO",
1769 .video_inputs = 4,
1770 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001771 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001772 .pll = PLL_28,
1773 .tuner_type = -1,
1774 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001775 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001776 },
1777
1778 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001779 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001780 .name = "Hauppauge WinTV PVR",
1781 .video_inputs = 4,
1782 .audio_inputs = 1,
1783 .tuner = 0,
1784 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001785 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001786 .needs_tvaudio = 1,
1787 .pll = PLL_28,
1788 .tuner_type = -1,
1789 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001790 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001791
1792 .gpiomask = 7,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001793 .gpiomux = {7},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001794 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001795 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001796 .name = "IODATA GV-BCTV5/PCI",
1797 .video_inputs = 3,
1798 .audio_inputs = 1,
1799 .tuner = 0,
1800 .svhs = 2,
1801 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001802 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001803 .gpiomux = {0x030000, 0x010000, 0, 0 },
1804 .gpiomute = 0x020000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001805 .no_msp34xx = 1,
1806 .pll = PLL_28,
1807 .tuner_type = TUNER_PHILIPS_NTSC_M,
1808 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001809 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001810 .audio_hook = gvbctv5pci_audio,
1811 .has_radio = 1,
1812 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001813 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001814 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1815 .video_inputs = 4, /* id-inputs-clock */
1816 .audio_inputs = 0,
1817 .tuner = -1,
1818 .svhs = 3,
1819 .muxsel = { 3, 2, 0, 1 },
1820 .pll = PLL_28,
1821 .tuner_type = -1,
1822 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001823 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001824 .no_msp34xx = 1,
1825 .no_tda9875 = 1,
1826 .no_tda7432 = 1,
1827 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001828 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001829 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1830 .video_inputs = 3,
1831 .audio_inputs = 0,
1832 .tuner = -1,
1833 .svhs = 2,
1834 .muxsel = { 2, 3, 1 },
1835 .pll = PLL_28,
1836 .tuner_type = -1,
1837 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001838 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001839 .no_msp34xx = 1,
1840 .no_tda9875 = 1,
1841 .no_tda7432 = 1,
1842 },
1843
1844 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001845 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001846 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1847 .video_inputs = 2,
1848 .audio_inputs = 0,
1849 .tuner = -1,
1850 .svhs = 1,
1851 .muxsel = { 3, 1 },
1852 .pll = PLL_28,
1853 .tuner_type = -1,
1854 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001855 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001856 .no_msp34xx = 1,
1857 .no_tda9875 = 1,
1858 .no_tda7432 = 1,
1859 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001860 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001861 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1862 .video_inputs = 1,
1863 .audio_inputs = 0,
1864 .tuner = -1,
1865 .svhs = -1,
1866 .muxsel = { 0 },
1867 .pll = PLL_28,
1868 .tuner_type = -1,
1869 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001870 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001871 .no_msp34xx = 1,
1872 .no_tda9875 = 1,
1873 .no_tda7432 = 1,
1874 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001875 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001876 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1877 .video_inputs = 2,
1878 .audio_inputs = 0,
1879 .tuner = -1,
1880 .svhs = 1,
1881 .muxsel = { 0, 1 },
1882 .pll = PLL_28,
1883 .tuner_type = -1,
1884 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001885 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001886 .no_msp34xx = 1,
1887 .no_tda9875 = 1,
1888 .no_tda7432 = 1,
1889 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001890 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001891 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1892 .video_inputs = 1,
1893 .audio_inputs = 1,
1894 .tuner = -1,
1895 .svhs = -1,
1896 .muxsel = { 0 },
1897 .pll = PLL_28,
1898 .tuner_type = UNSET,
1899 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001900 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001901 .no_msp34xx = 1,
1902 .no_tda9875 = 1,
1903 .no_tda7432 = 1,
1904 },
1905
1906 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001907 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001908 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1909 .video_inputs = 2,
1910 .audio_inputs = 1,
1911 .tuner = -1,
1912 .svhs = 1,
1913 .muxsel = { 0, 1 },
1914 .pll = PLL_28,
1915 .tuner_type = UNSET,
1916 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001917 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001918 .no_msp34xx = 1,
1919 .no_tda9875 = 1,
1920 .no_tda7432 = 1,
1921 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001922 [BTTV_BOARD_OSPREY2x0] = {
Michael Krufky52398ef2006-05-26 02:13:15 -03001923 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001924 .video_inputs = 2,
1925 .audio_inputs = 1,
1926 .tuner = -1,
1927 .svhs = 1,
1928 .muxsel = { 2, 3 },
1929 .pll = PLL_28,
1930 .tuner_type = UNSET,
1931 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001932 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001933 .no_msp34xx = 1,
1934 .no_tda9875 = 1,
1935 .no_tda7432 = 1,
1936 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001937 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001938 .name = "Osprey 500", /* 500 */
1939 .video_inputs = 2,
1940 .audio_inputs = 1,
1941 .tuner = -1,
1942 .svhs = 1,
1943 .muxsel = { 2, 3 },
1944 .pll = PLL_28,
1945 .tuner_type = -1,
1946 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001947 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001948 .no_msp34xx = 1,
1949 .no_tda9875 = 1,
1950 .no_tda7432 = 1,
1951 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001952 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001953 .name = "Osprey 540", /* 540 */
1954 .video_inputs = 4,
1955 .audio_inputs = 1,
1956 .tuner = -1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001957 .pll = PLL_28,
1958 .tuner_type = -1,
1959 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001960 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001961 .no_msp34xx = 1,
1962 .no_tda9875 = 1,
1963 .no_tda7432 = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001964 },
1965
1966 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001967 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001968 .name = "Osprey 2000", /* 2000 */
1969 .video_inputs = 2,
1970 .audio_inputs = 1,
1971 .tuner = -1,
1972 .svhs = 1,
1973 .muxsel = { 2, 3 },
1974 .pll = PLL_28,
1975 .tuner_type = UNSET,
1976 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001977 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001978 .no_msp34xx = 1,
1979 .no_tda9875 = 1,
1980 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1981 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001982 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001983 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1984 .name = "IDS Eagle",
1985 .video_inputs = 4,
1986 .audio_inputs = 0,
1987 .tuner = -1,
1988 .tuner_type = -1,
1989 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001990 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001991 .svhs = -1,
1992 .gpiomask = 0,
1993 .muxsel = { 0, 1, 2, 3 },
1994 .muxsel_hook = eagle_muxsel,
1995 .no_msp34xx = 1,
1996 .no_tda9875 = 1,
1997 .pll = PLL_28,
1998 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001999 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002000 .name = "Pinnacle PCTV Sat",
2001 .video_inputs = 2,
2002 .audio_inputs = 0,
2003 .svhs = 1,
2004 .tuner = -1,
2005 .tuner_type = -1,
2006 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002007 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002008 .no_msp34xx = 1,
2009 .no_tda9875 = 1,
2010 .no_tda7432 = 1,
Mauro Carvalho Chehabd2be8932006-10-02 23:52:48 -03002011 .muxsel = { 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002012 .pll = PLL_28,
2013 .no_gpioirq = 1,
2014 .has_dvb = 1,
2015 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002016 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002017 .name = "Formac ProTV II (bt878)",
2018 .video_inputs = 4,
2019 .audio_inputs = 1,
2020 .tuner = 0,
2021 .svhs = 3,
2022 .gpiomask = 2,
2023 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02002024 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002025 .gpiomux = { 2, 2, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002026 .pll = PLL_28,
2027 .has_radio = 1,
2028 .tuner_type = TUNER_PHILIPS_PAL,
2029 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002030 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002031 /* sound routing:
2032 GPIO=0x00,0x01,0x03: mute (?)
2033 0x02: both TV and radio (tuner: FM1216/I)
2034 The card has onboard audio connectors labeled "cdrom" and "board",
2035 not soldered here, though unknown wiring.
2036 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002037 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002038 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002039
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002040 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002041 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002042 .name = "MachTV",
2043 .video_inputs = 3,
2044 .audio_inputs = 1,
2045 .tuner = 0,
2046 .svhs = -1,
2047 .gpiomask = 7,
2048 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002049 .gpiomux = { 0, 1, 2, 3},
2050 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002051 .needs_tvaudio = 1,
2052 .tuner_type = 5,
2053 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002054 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08002055 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002056 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002057 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002058 .name = "Euresys Picolo",
2059 .video_inputs = 3,
2060 .audio_inputs = 0,
2061 .tuner = -1,
2062 .svhs = 2,
2063 .gpiomask = 0,
2064 .no_msp34xx = 1,
2065 .no_tda9875 = 1,
2066 .no_tda7432 = 1,
2067 .muxsel = { 2, 0, 1},
2068 .pll = PLL_28,
2069 .tuner_type = UNSET,
2070 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002071 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002072 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002073 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002074 /* Luc Van Hoeylandt <luc@e-magic.be> */
2075 .name = "ProVideo PV150", /* 0x4f */
2076 .video_inputs = 2,
2077 .audio_inputs = 0,
2078 .tuner = -1,
2079 .svhs = -1,
2080 .gpiomask = 0,
2081 .muxsel = { 2, 3 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002082 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002083 .needs_tvaudio = 0,
2084 .no_msp34xx = 1,
2085 .pll = PLL_28,
2086 .tuner_type = UNSET,
2087 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002088 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002089 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002090 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002091 /* Hiroshi Takekawa <sian@big.or.jp> */
2092 /* This card lacks subsystem ID */
2093 .name = "AD-TVK503", /* 0x63 */
2094 .video_inputs = 4,
2095 .audio_inputs = 1,
2096 .tuner = 0,
2097 .svhs = 2,
2098 .gpiomask = 0x001e8007,
2099 .muxsel = { 2, 3, 1, 0 },
2100 /* Tuner, Radio, external, internal, off, on */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002101 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2102 .gpiomute = 0x0f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002103 .needs_tvaudio = 0,
2104 .no_msp34xx = 1,
2105 .pll = PLL_28,
2106 .tuner_type = 2,
2107 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002108 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002109 .audio_hook = adtvk503_audio,
2110 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002111
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002112 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002113 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002114 .name = "Hercules Smart TV Stereo",
2115 .video_inputs = 4,
2116 .audio_inputs = 1,
2117 .tuner = 0,
2118 .svhs = 2,
2119 .gpiomask = 0x00,
2120 .muxsel = { 2, 3, 1, 1 },
2121 .needs_tvaudio = 1,
2122 .no_msp34xx = 1,
2123 .pll = PLL_28,
2124 .tuner_type = 5,
2125 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002126 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002127 /* Notes:
2128 - card lacks subsystem ID
2129 - stereo variant w/ daughter board with tda9874a @0xb0
2130 - Audio Routing:
2131 always from tda9874 independent of GPIO (?)
2132 external line in: unknown
2133 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2134 hef4053 (instead 4052) for unknown function
2135 */
2136 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002137 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002138 .name = "Pace TV & Radio Card",
2139 .video_inputs = 4,
2140 .audio_inputs = 1,
2141 .tuner = 0,
2142 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002143 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002144 .gpiomask = 0,
2145 .no_tda9875 = 1,
2146 .no_tda7432 = 1,
2147 .tuner_type = 1,
2148 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002149 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002150 .has_radio = 1,
2151 .pll = PLL_28,
2152 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2153 only internal line out: (4pin header) RGGL
2154 Radio must be decoded by msp3410d (not routed through)*/
2155 /*
2156 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2157 */
2158 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002159 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002160 /* Chris Willing <chris@vislab.usyd.edu.au> */
2161 .name = "IVC-200",
2162 .video_inputs = 1,
2163 .audio_inputs = 0,
2164 .tuner = -1,
2165 .tuner_type = -1,
2166 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002167 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002168 .svhs = -1,
2169 .gpiomask = 0xdf,
2170 .muxsel = { 2 },
2171 .pll = PLL_28,
2172 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002173 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002174 .name = "Grand X-Guard / Trust 814PCI",
2175 .video_inputs = 16,
2176 .audio_inputs = 0,
2177 .tuner = -1,
2178 .svhs = -1,
2179 .tuner_type = 4,
2180 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002181 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002182 .gpiomask2 = 0xff,
2183 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2184 .muxsel_hook = xguard_muxsel,
2185 .no_msp34xx = 1,
2186 .no_tda9875 = 1,
2187 .no_tda7432 = 1,
2188 .pll = PLL_28,
2189 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002190
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002191 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002192 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002193 .name = "Nebula Electronics DigiTV",
2194 .video_inputs = 1,
2195 .tuner = -1,
2196 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002197 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002198 .no_msp34xx = 1,
2199 .no_tda9875 = 1,
2200 .no_tda7432 = 1,
2201 .pll = PLL_28,
2202 .tuner_type = -1,
2203 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002204 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002205 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002206 .has_remote = 1,
2207 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002208 .no_gpioirq = 1,
2209 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002210 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002211 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2212 .name = "ProVideo PV143",
2213 .video_inputs = 4,
2214 .audio_inputs = 0,
2215 .tuner = -1,
2216 .svhs = -1,
2217 .gpiomask = 0,
2218 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002219 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002220 .needs_tvaudio = 0,
2221 .no_msp34xx = 1,
2222 .pll = PLL_28,
2223 .tuner_type = -1,
2224 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002225 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002226 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002227 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002228 /* M.Klahr@phytec.de */
2229 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2230 .video_inputs = 4,
2231 .audio_inputs = 0,
2232 .tuner = -1, /* card has no tuner */
2233 .svhs = 3,
2234 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002235 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002236 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002237 .needs_tvaudio = 1,
2238 .pll = PLL_28,
2239 .tuner_type = -1,
2240 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002241 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002242 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002243 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002244 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2245 .video_inputs = 4,
2246 .audio_inputs = 0,
2247 .tuner = -1, /* card has no tuner */
2248 .svhs = 3,
2249 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002250 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002251 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002252 .needs_tvaudio = 1,
2253 .pll = PLL_28,
2254 .tuner_type = -1,
2255 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002256 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002257 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002258
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002259 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002260 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002261 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2262 .video_inputs = 10,
2263 .audio_inputs = 0,
2264 .tuner = -1, /* card has no tuner */
2265 .svhs = 9,
2266 .gpiomask = 0x00,
2267 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2268 via the upper nibble of muxsel. here: used for
2269 xternal video-mux */
2270 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002271 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002272 .needs_tvaudio = 1,
2273 .pll = PLL_28,
2274 .tuner_type = -1,
2275 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002276 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002277 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002278 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002279 .name = "PHYTEC VD-009 Combi (bt878)",
2280 .video_inputs = 10,
2281 .audio_inputs = 0,
2282 .tuner = -1, /* card has no tuner */
2283 .svhs = 9,
2284 .gpiomask = 0x00,
2285 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2286 via the upper nibble of muxsel. here: used for
2287 xternal video-mux */
2288 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002289 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002290 .needs_tvaudio = 1,
2291 .pll = PLL_28,
2292 .tuner_type = -1,
2293 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002294 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002295 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002296 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002297 .name = "IVC-100",
2298 .video_inputs = 4,
2299 .audio_inputs = 0,
2300 .tuner = -1,
2301 .tuner_type = -1,
2302 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002303 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002304 .svhs = -1,
2305 .gpiomask = 0xdf,
2306 .muxsel = { 2, 3, 1, 0 },
2307 .pll = PLL_28,
2308 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002309 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002310 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2311 .name = "IVC-120G",
2312 .video_inputs = 16,
2313 .audio_inputs = 0, /* card has no audio */
2314 .tuner = -1, /* card has no tuner */
2315 .tuner_type = -1,
2316 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002317 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002318 .svhs = -1, /* card has no svhs */
2319 .needs_tvaudio = 0,
2320 .no_msp34xx = 1,
2321 .no_tda9875 = 1,
2322 .no_tda7432 = 1,
2323 .gpiomask = 0x00,
2324 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2325 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2326 .muxsel_hook = ivc120_muxsel,
2327 .pll = PLL_28,
2328 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002329
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002330 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002331 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002332 .name = "pcHDTV HD-2000 TV",
2333 .video_inputs = 4,
2334 .audio_inputs = 1,
2335 .tuner = 0,
2336 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002337 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002338 .tuner_type = TUNER_PHILIPS_ATSC,
2339 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002340 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002341 .has_dvb = 1,
2342 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002343 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002344 .name = "Twinhan DST + clones",
2345 .no_msp34xx = 1,
2346 .no_tda9875 = 1,
2347 .no_tda7432 = 1,
2348 .tuner_type = TUNER_ABSENT,
2349 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002350 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002351 .no_video = 1,
2352 .has_dvb = 1,
2353 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002354 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002355 .name = "Winfast VC100",
2356 .video_inputs = 3,
2357 .audio_inputs = 0,
2358 .svhs = 1,
2359 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002360 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002361 .no_msp34xx = 1,
2362 .no_tda9875 = 1,
2363 .no_tda7432 = 1,
2364 .tuner_type = TUNER_ABSENT,
2365 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002366 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002367 .pll = PLL_28,
2368 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002369 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002370 .name = "Teppro TEV-560/InterVision IV-560",
2371 .video_inputs = 3,
2372 .audio_inputs = 1,
2373 .tuner = 0,
2374 .svhs = 2,
2375 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002376 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002377 .gpiomux = { 1, 1, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002378 .needs_tvaudio = 1,
2379 .tuner_type = TUNER_PHILIPS_PAL,
2380 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002381 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002382 .pll = PLL_35,
2383 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002384
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002385 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002386 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002387 .name = "SIMUS GVC1100",
2388 .video_inputs = 4,
2389 .audio_inputs = 0,
2390 .tuner = -1,
2391 .svhs = -1,
2392 .tuner_type = -1,
2393 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002394 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002395 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002396 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002397 .gpiomask = 0x3F,
2398 .muxsel_hook = gvc1100_muxsel,
2399 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002400 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002401 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2402 .name = "NGS NGSTV+",
2403 .video_inputs = 3,
2404 .tuner = 0,
2405 .svhs = 2,
2406 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002407 .muxsel = { 2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002408 .gpiomux = { 0, 0, 0, 0 },
2409 .gpiomute = 0x000003,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002410 .pll = PLL_28,
2411 .tuner_type = TUNER_PHILIPS_PAL,
2412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002414 .has_remote = 1,
2415 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002416 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002417 /* http://linuxmedialabs.com */
2418 .name = "LMLBT4",
2419 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2420 .audio_inputs = 0,
2421 .tuner = -1,
2422 .svhs = -1,
2423 .muxsel = { 2, 3, 1, 0 },
2424 .no_msp34xx = 1,
2425 .no_tda9875 = 1,
2426 .no_tda7432 = 1,
2427 .needs_tvaudio = 0,
2428 .tuner_type = -1,
2429 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002430 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002431 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002432 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002433 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2434 .name = "Tekram M205 PRO",
2435 .video_inputs = 3,
2436 .audio_inputs = 1,
2437 .tuner = 0,
2438 .tuner_type = TUNER_PHILIPS_PAL,
2439 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002440 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002441 .svhs = 2,
2442 .needs_tvaudio = 0,
2443 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002444 .muxsel = { 2, 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002445 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002446 .pll = PLL_28,
2447 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002448
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002449 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002450 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002451 /* Javier Cendan Ares <jcendan@lycos.es> */
2452 /* bt878 TV + FM without subsystem ID */
2453 .name = "Conceptronic CONTVFMi",
2454 .video_inputs = 3,
2455 .audio_inputs = 1,
2456 .tuner = 0,
2457 .svhs = 2,
2458 .gpiomask = 0x008007,
2459 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002460 .gpiomux = { 0, 1, 2, 2 },
2461 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002462 .needs_tvaudio = 0,
2463 .pll = PLL_28,
2464 .tuner_type = TUNER_PHILIPS_PAL,
2465 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002466 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002467 .has_remote = 1,
2468 .has_radio = 1,
2469 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002470 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002471 /*Eric DEBIEF <debief@telemsa.com>*/
2472 /*EURESYS Picolo Tetra : 4 Conexant Fusion 878A, no audio, video input set with analog multiplexers GPIO controled*/
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002473 /* adds picolo_tetra_muxsel(), picolo_tetra_init(), the folowing declaration strucure, and #define BTTV_BOARD_PICOLO_TETRA_CHIP*/
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002474 /*0x79 in bttv.h*/
2475 .name = "Euresys Picolo Tetra",
2476 .video_inputs = 4,
2477 .audio_inputs = 0,
2478 .tuner = -1,
2479 .svhs = -1,
2480 .gpiomask = 0,
2481 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2482 .no_msp34xx = 1,
2483 .no_tda9875 = 1,
2484 .no_tda7432 = 1,
2485 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002486 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002487 .pll = PLL_28,
2488 .needs_tvaudio = 0,
2489 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2490 .tuner_type = -1,
2491 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002492 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002493 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002494 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002495 /* Spirit TV Tuner from http://spiritmodems.com.au */
2496 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2497 .name = "Spirit TV Tuner",
2498 .video_inputs = 3,
2499 .audio_inputs = 1,
2500 .tuner = 0,
2501 .svhs = 2,
2502 .gpiomask = 0x0000000f,
2503 .muxsel = { 2, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002504 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002505 .tuner_type = TUNER_TEMIC_PAL,
2506 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002507 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002508 .no_msp34xx = 1,
2509 .no_tda9875 = 1,
2510 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002511 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002512 /* Wolfram Joost <wojo@frokaschwei.de> */
2513 .name = "AVerMedia AVerTV DVB-T 771",
2514 .video_inputs = 2,
2515 .svhs = 1,
2516 .tuner = -1,
2517 .tuner_type = TUNER_ABSENT,
2518 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002519 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002520 .muxsel = { 3 , 3 },
2521 .no_msp34xx = 1,
2522 .no_tda9875 = 1,
2523 .no_tda7432 = 1,
2524 .pll = PLL_28,
2525 .has_dvb = 1,
2526 .no_gpioirq = 1,
2527 .has_remote = 1,
2528 },
2529 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002530 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002531 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002532 /* Based on the Nebula card data - added remote and new card number - BTTV_BOARD_AVDVBT_761, see also ir-kbd-gpio.c */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002533 .name = "AverMedia AverTV DVB-T 761",
2534 .video_inputs = 2,
2535 .tuner = -1,
2536 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002537 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002538 .no_msp34xx = 1,
2539 .no_tda9875 = 1,
2540 .no_tda7432 = 1,
2541 .pll = PLL_28,
2542 .tuner_type = -1,
2543 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002544 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002545 .has_dvb = 1,
2546 .no_gpioirq = 1,
2547 .has_remote = 1,
2548 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002549 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002550 /* andre.schwarz@matrix-vision.de */
2551 .name = "MATRIX Vision Sigma-SQ",
2552 .video_inputs = 16,
2553 .audio_inputs = 0,
2554 .tuner = -1,
2555 .svhs = -1,
2556 .gpiomask = 0x0,
2557 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2558 3, 3, 3, 3, 3, 3, 3, 3 },
2559 .muxsel_hook = sigmaSQ_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002560 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002561 .no_msp34xx = 1,
2562 .pll = PLL_28,
2563 .tuner_type = -1,
2564 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002565 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002566 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002567 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002568 /* andre.schwarz@matrix-vision.de */
2569 .name = "MATRIX Vision Sigma-SLC",
2570 .video_inputs = 4,
2571 .audio_inputs = 0,
2572 .tuner = -1,
2573 .svhs = -1,
2574 .gpiomask = 0x0,
2575 .muxsel = { 2, 2, 2, 2 },
2576 .muxsel_hook = sigmaSLC_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002577 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002578 .no_msp34xx = 1,
2579 .pll = PLL_28,
2580 .tuner_type = -1,
2581 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002582 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002583 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002584 /* BTTV_BOARD_APAC_VIEWCOMP */
2585 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002586 /* Attila Kondoros <attila.kondoros@chello.hu> */
2587 /* bt878 TV + FM 0x00000000 subsystem ID */
2588 .name = "APAC Viewcomp 878(AMAX)",
2589 .video_inputs = 2,
2590 .audio_inputs = 1,
2591 .tuner = 0,
2592 .svhs = -1,
2593 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002594 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002595 .gpiomux = { 2, 0, 0, 0 },
2596 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002597 .needs_tvaudio = 0,
2598 .pll = PLL_28,
2599 .tuner_type = TUNER_PHILIPS_PAL,
2600 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002601 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002602 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2603 .has_radio = 1, /* not every card has radio */
2604 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002605
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002606 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002607 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002608 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2609 .name = "DViCO FusionHDTV DVB-T Lite",
2610 .tuner = -1,
2611 .no_msp34xx = 1,
2612 .no_tda9875 = 1,
2613 .no_tda7432 = 1,
2614 .pll = PLL_28,
2615 .no_video = 1,
2616 .has_dvb = 1,
2617 .tuner_type = -1,
2618 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002619 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002620 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002621 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002622 /* Steven <photon38@pchome.com.tw> */
2623 .name = "V-Gear MyVCD",
2624 .video_inputs = 3,
2625 .audio_inputs = 1,
2626 .tuner = 0,
2627 .svhs = 2,
2628 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002629 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002630 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2631 .gpiomute = 0x31,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002632 .no_msp34xx = 1,
2633 .pll = PLL_28,
2634 .tuner_type = TUNER_PHILIPS_NTSC_M,
2635 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002636 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002637 .has_radio = 0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002638 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002639 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002640 /* Rick C <cryptdragoon@gmail.com> */
2641 .name = "Super TV Tuner",
2642 .video_inputs = 4,
2643 .audio_inputs = 1,
2644 .tuner = 0,
2645 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002646 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002647 .tuner_type = TUNER_PHILIPS_NTSC,
2648 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002649 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002650 .gpiomask = 0x008007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002651 .gpiomux = { 0, 0x000001,0,0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002652 .needs_tvaudio = 1,
2653 .has_radio = 1,
2654 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002655 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002656 /* Chris Fanning <video4linux@haydon.net> */
2657 .name = "Tibet Systems 'Progress DVR' CS16",
2658 .video_inputs = 16,
2659 .audio_inputs = 0,
2660 .tuner = -1,
2661 .svhs = -1,
2662 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2663 .pll = PLL_28,
2664 .no_msp34xx = 1,
2665 .no_tda9875 = 1,
2666 .no_tda7432 = 1,
2667 .tuner_type = -1,
2668 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002669 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002670 .muxsel_hook = tibetCS16_muxsel,
2671 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002672 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002673 /* Bill Brack <wbrack@mmm.com.hk> */
2674 /*
2675 * Note that, because of the card's wiring, the "master"
2676 * BT878A chip (i.e. the one which controls the analog switch
2677 * and must use this card type) is the 2nd one detected. The
2678 * other 3 chips should use card type 0x85, whose description
2679 * follows this one. There is a EEPROM on the card (which is
2680 * connected to the I2C of one of those other chips), but is
2681 * not currently handled. There is also a facility for a
2682 * "monitor", which is also not currently implemented.
2683 */
2684 .name = "Kodicom 4400R (master)",
2685 .video_inputs = 16,
2686 .audio_inputs = 0,
2687 .tuner = -1,
2688 .tuner_type = -1,
2689 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002690 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002691 .svhs = -1,
2692 /* GPIO bits 0-9 used for analog switch:
2693 * 00 - 03: camera selector
2694 * 04 - 06: channel (controller) selector
2695 * 07: data (1->on, 0->off)
2696 * 08: strobe
2697 * 09: reset
2698 * bit 16 is input from sync separator for the channel
2699 */
2700 .gpiomask = 0x0003ff,
2701 .no_gpioirq = 1,
2702 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2703 .pll = PLL_28,
2704 .no_msp34xx = 1,
2705 .no_tda7432 = 1,
2706 .no_tda9875 = 1,
2707 .muxsel_hook = kodicom4400r_muxsel,
2708 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002709 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002710 /* Bill Brack <wbrack@mmm.com.hk> */
2711 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2712 * one which controls the analog switch, and must use the card type)
2713 * is the 2nd one detected. The other 3 chips should use this card
2714 * type
2715 */
2716 .name = "Kodicom 4400R (slave)",
2717 .video_inputs = 16,
2718 .audio_inputs = 0,
2719 .tuner = -1,
2720 .tuner_type = -1,
2721 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002722 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002723 .svhs = -1,
2724 .gpiomask = 0x010000,
2725 .no_gpioirq = 1,
2726 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2727 .pll = PLL_28,
2728 .no_msp34xx = 1,
2729 .no_tda7432 = 1,
2730 .no_tda9875 = 1,
2731 .muxsel_hook = kodicom4400r_muxsel,
2732 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002733 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002734 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002735 /* Michael Henson <mhenson@clarityvi.com> */
2736 /* Adlink RTV24 with special unlock codes */
2737 .name = "Adlink RTV24",
2738 .video_inputs = 4,
2739 .audio_inputs = 1,
2740 .tuner = 0,
2741 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002742 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002743 .tuner_type = -1,
2744 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002745 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002746 .pll = PLL_28,
2747 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002748 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002749 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002750 /* Michael Krufky <mkrufky@m1k.net> */
2751 .name = "DViCO FusionHDTV 5 Lite",
2752 .tuner = 0,
Michael Krufky9c26c8b2006-04-27 01:29:17 -03002753 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002754 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002755 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002756 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002757 .audio_inputs = 1,
2758 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002759 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002760 .gpiomask = 0x00e00007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002761 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2762 .gpiomute = 0x00c00007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002763 .no_msp34xx = 1,
2764 .no_tda9875 = 1,
2765 .no_tda7432 = 1,
2766 .has_dvb = 1,
2767 },
2768 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002769 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03002770 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002771 .name = "Acorp Y878F",
2772 .video_inputs = 3,
2773 .audio_inputs = 1,
2774 .tuner = 0,
2775 .svhs = 2,
2776 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002777 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002778 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2779 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002780 .needs_tvaudio = 1,
2781 .pll = PLL_28,
2782 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2783 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002784 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002785 .has_radio = 1,
2786 },
2787 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002788 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002789 .name = "Conceptronic CTVFMi v2",
2790 .video_inputs = 3,
2791 .audio_inputs = 1,
2792 .tuner = 0,
2793 .svhs = 2,
2794 .gpiomask = 0x001c0007,
2795 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002796 .gpiomux = { 0, 1, 2, 2 },
2797 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002798 .needs_tvaudio = 0,
2799 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002800 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002801 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002802 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002803 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002804 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002805 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002806 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002807 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002808 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2809 .video_inputs = 5,
2810 .audio_inputs = 1,
2811 .tuner = 0,
2812 .svhs = 3,
2813 .gpiomask = 0x01fe00,
2814 .muxsel = { 2,3,1,1,-1 },
2815 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002816 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2817 .gpiomute = 0x12400,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002818 .no_msp34xx = 1,
2819 .pll = PLL_28,
2820 .tuner_type = TUNER_LG_PAL_FM,
2821 .tuner_addr = ADDR_UNSET,
2822 .radio_addr = ADDR_UNSET,
2823 .has_remote = 1,
2824 },
2825 /* ---- card 0x8b ---------------------------------- */
2826 [BTTV_BOARD_PV_M4900] = {
2827 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2828 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2829 .video_inputs = 3,
2830 .audio_inputs = 1,
2831 .tuner = 0,
2832 .svhs = 2,
2833 .gpiomask = 0x3f,
2834 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002835 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2836 .gpiomute = 0x29,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002837 .no_msp34xx = 1,
2838 .pll = PLL_28,
2839 .tuner_type = TUNER_YMEC_TVF_5533MF,
2840 .tuner_addr = ADDR_UNSET,
2841 .radio_addr = ADDR_UNSET,
2842 .has_radio = 1,
2843 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002844 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002845 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002846 [BTTV_BOARD_OSPREY440] = {
2847 .name = "Osprey 440",
2848 .video_inputs = 1,
2849 .audio_inputs = 1,
2850 .tuner = -1,
2851 .svhs = 1,
2852 .muxsel = { 2 },
2853 .pll = PLL_28,
2854 .tuner_type = UNSET,
2855 .tuner_addr = ADDR_UNSET,
2856 .radio_addr = ADDR_UNSET,
2857 .no_msp34xx = 1,
2858 .no_tda9875 = 1,
2859 .no_tda7432 = 1,
2860 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002861 /* ---- card 0x8d ---------------------------------- */
2862 [BTTV_BOARD_ASOUND_SKYEYE] = {
2863 .name = "Asound Skyeye PCTV",
2864 .video_inputs = 3,
2865 .audio_inputs = 1,
2866 .tuner = 0,
2867 .svhs = 2,
2868 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002869 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002870 .gpiomux = { 2, 0, 0, 0 },
2871 .gpiomute = 1,
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002872 .needs_tvaudio = 1,
2873 .pll = PLL_28,
2874 .tuner_type = 2,
2875 .tuner_addr = ADDR_UNSET,
2876 .radio_addr = ADDR_UNSET,
2877 },
Bill Pechter633323f2005-11-13 16:07:50 -08002878 /* ---- card 0x8e ---------------------------------- */
2879 [BTTV_BOARD_SABRENT_TVFM] = {
2880 .name = "Sabrent TV-FM (bttv version)",
2881 .video_inputs = 3,
2882 .audio_inputs = 1,
2883 .tuner = 0,
2884 .svhs = 2,
2885 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002886 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002887 .gpiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002888 .no_msp34xx = 1,
2889 .no_tda9875 = 1,
2890 .no_tda7432 = 1,
2891 .pll = PLL_28,
2892 .tuner_type = TUNER_TNF_5335MF,
2893 .tuner_addr = ADDR_UNSET,
2894 .has_radio = 1,
2895 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002896 /* ---- card 0x8f ---------------------------------- */
2897 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2898 .name = "Hauppauge ImpactVCB (bt878)",
2899 .video_inputs = 4,
2900 .audio_inputs = 0,
2901 .tuner = -1,
2902 .svhs = -1,
2903 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002904 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002905 .no_msp34xx = 1,
2906 .no_tda9875 = 1,
2907 .no_tda7432 = 1,
2908 .tuner_type = -1,
2909 .tuner_addr = ADDR_UNSET,
2910 .radio_addr = ADDR_UNSET,
2911 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002912 [BTTV_BOARD_MACHTV_MAGICTV] = {
2913 /* Julian Calaby <julian.calaby@gmail.com>
2914 * Slightly different from original MachTV definition (0x60)
2915
2916 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2917 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2918 * properly (methinks) causing no keyup bits being set */
2919
2920 .name = "MagicTV", /* rebranded MachTV */
2921 .video_inputs = 3,
2922 .audio_inputs = 1,
2923 .tuner = 0,
2924 .svhs = 2,
2925 .gpiomask = 7,
2926 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002927 .gpiomux = { 0, 1, 2, 3 },
2928 .gpiomute = 4,
Julian Calaby2d05ae62006-01-11 19:40:09 -02002929 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2930 .tuner_addr = ADDR_UNSET,
2931 .radio_addr = ADDR_UNSET,
2932 .pll = PLL_28,
2933 .has_radio = 1,
2934 .has_remote = 1,
2935 },
Scott Alfter1ebba672007-04-02 14:22:39 -03002936 [BTTV_BOARD_SSAI_SECURITY] = {
2937 .name = "SSAI Security Video Interface",
2938 .video_inputs = 4,
2939 .audio_inputs = 0,
2940 .tuner = -1,
2941 .svhs = -1,
2942 .muxsel = { 0, 1, 2, 3 },
2943 .tuner_type = -1,
2944 .tuner_addr = ADDR_UNSET,
2945 .radio_addr = ADDR_UNSET,
2946 },
2947 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2948 .name = "SSAI Ultrasound Video Interface",
2949 .video_inputs = 2,
2950 .audio_inputs = 0,
2951 .tuner = -1,
2952 .svhs = 1,
2953 .muxsel = { 2, 0, 1, 3 },
2954 .tuner_type = -1,
2955 .tuner_addr = ADDR_UNSET,
2956 .radio_addr = ADDR_UNSET,
2957 },
Michael Krufky27cb7862007-06-28 12:19:20 -03002958 /* ---- card 0x94---------------------------------- */
2959 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2960 .name = "DViCO FusionHDTV 2",
2961 .tuner = 0,
2962 .tuner_type = TUNER_PHILIPS_ATSC, /* FCV1236D */
2963 .tuner_addr = ADDR_UNSET,
2964 .radio_addr = ADDR_UNSET,
2965 .video_inputs = 3,
2966 .audio_inputs = 1,
2967 .svhs = 2,
2968 .muxsel = { 2, 3, 1 },
2969 .gpiomask = 0x00e00007,
2970 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2971 .gpiomute = 0x00c00007,
2972 .no_msp34xx = 1,
2973 .no_tda9875 = 1,
2974 .no_tda7432 = 1,
2975 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002976};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002977
2978static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2979
2980/* ----------------------------------------------------------------------- */
2981
2982static unsigned char eeprom_data[256];
2983
2984/*
2985 * identify card
2986 */
2987void __devinit bttv_idcard(struct bttv *btv)
2988{
2989 unsigned int gpiobits;
2990 int i,type;
2991 unsigned short tmp;
2992
2993 /* read PCI subsystem ID */
2994 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2995 btv->cardid = tmp << 16;
2996 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2997 btv->cardid |= tmp;
2998
2999 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
3000 /* look for the card */
3001 for (type = -1, i = 0; cards[i].id != 0; i++)
3002 if (cards[i].id == btv->cardid)
3003 type = i;
3004
3005 if (type != -1) {
3006 /* found it */
3007 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
3008 "PCI subsystem ID is %04x:%04x\n",
3009 btv->c.nr,cards[type].name,cards[type].cardnr,
3010 btv->cardid & 0xffff,
3011 (btv->cardid >> 16) & 0xffff);
3012 btv->c.type = cards[type].cardnr;
3013 } else {
3014 /* 404 */
3015 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
3016 btv->c.nr, btv->cardid & 0xffff,
3017 (btv->cardid >> 16) & 0xffff);
3018 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08003019 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003020 }
3021 }
3022
3023 /* let the user override the autodetected type */
3024 if (card[btv->c.nr] < bttv_num_tvcards)
3025 btv->c.type=card[btv->c.nr];
3026
3027 /* print which card config we are using */
3028 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
3029 bttv_tvcards[btv->c.type].name, btv->c.type,
3030 card[btv->c.nr] < bttv_num_tvcards
3031 ? "insmod option" : "autodetected");
3032
3033 /* overwrite gpio stuff ?? */
3034 if (UNSET == audioall && UNSET == audiomux[0])
3035 return;
3036
3037 if (UNSET != audiomux[0]) {
3038 gpiobits = 0;
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003039 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003040 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07003041 gpiobits |= audiomux[i];
3042 }
3043 } else {
3044 gpiobits = audioall;
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003045 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003046 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003047 }
3048 }
3049 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3050 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3051 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003052 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003053 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003054 }
3055 printk("\n");
3056}
3057
3058/*
3059 * (most) board specific initialisations goes here
3060 */
3061
3062/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08003063static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003064{
3065 int type = -1;
3066
3067 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003068 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003069 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003070 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003071 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003072 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003073
3074 if (-1 != type) {
3075 btv->c.type = type;
3076 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3077 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3078 }
3079}
3080
3081static void flyvideo_gpio(struct bttv *btv)
3082{
3083 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3084 int tuner=-1,ttype;
3085
3086 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003087 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003088 gpio = gpio_read();
3089 /* FIXME: must restore OUR_EN ??? */
3090
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003091 /* all cards provide GPIO info, some have an additional eeprom
3092 * LR50: GPIO coding can be found lower right CP1 .. CP9
3093 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3094 * GPIO14-12: n.c.
3095 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003096
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003097 * lowest 3 bytes are remote control codes (no handshake needed)
3098 * xxxFFF: No remote control chip soldered
3099 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3100 * Note: Some bits are Audio_Mask !
3101 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003102 ttype=(gpio&0x0f0000)>>16;
3103 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003104 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003105 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003106 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003107 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003108 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003109 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003110 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003111 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003112 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003113 break;
3114 default:
3115 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3116 }
3117
3118 has_remote = gpio & 0x800000;
3119 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003120 /* unknown 0x200000;
3121 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003122 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003123 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003124 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3125 /*
3126 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003127
3128 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003129 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003130
3131 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3132 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3133 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3134 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3135 is_capture_only?"yes":"no ");
3136
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003137 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003138 btv->tuner_type = tuner;
3139 btv->has_radio = has_radio;
3140
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003141 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3142 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3143 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003144 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003145 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003146}
3147
3148static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3149 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3150static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3151 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3152
3153static void miro_pinnacle_gpio(struct bttv *btv)
3154{
3155 int id,msp,gpio;
3156 char *info;
3157
3158 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003159 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003160 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003161 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003162 if (id < 32) {
3163 btv->tuner_type = miro_tunermap[id];
3164 if (0 == (gpio & 0x20)) {
3165 btv->has_radio = 1;
3166 if (!miro_fmtuner[id]) {
3167 btv->has_matchbox = 1;
3168 btv->mbox_we = (1<<6);
3169 btv->mbox_most = (1<<7);
3170 btv->mbox_clk = (1<<8);
3171 btv->mbox_data = (1<<9);
3172 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3173 }
3174 } else {
3175 btv->has_radio = 0;
3176 }
3177 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003178 if (btv->c.type == BTTV_BOARD_MIRO)
3179 btv->c.type = BTTV_BOARD_MIROPRO;
3180 if (btv->c.type == BTTV_BOARD_PINNACLE)
3181 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003182 }
3183 printk(KERN_INFO
3184 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3185 btv->c.nr, id+1, btv->tuner_type,
3186 !btv->has_radio ? "no" :
3187 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3188 (-1 == msp) ? "no" : "yes");
3189 } else {
3190 /* new cards with microtune tuner */
3191 id = 63 - id;
3192 btv->has_radio = 0;
3193 switch (id) {
3194 case 1:
3195 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003196 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003197 break;
3198 case 2:
3199 info = "PAL+SECAM / stereo";
3200 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003201 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003202 break;
3203 case 3:
3204 info = "NTSC / stereo";
3205 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003206 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003207 break;
3208 case 4:
3209 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003210 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003211 break;
3212 case 5:
3213 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003214 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003215 break;
3216 case 6:
3217 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003218 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003219 break;
3220 case 7:
3221 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003222 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003223 break;
3224 default:
3225 info = "oops: unknown card";
3226 break;
3227 }
3228 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003229 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003230 printk(KERN_INFO
3231 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3232 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003233 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003234 }
3235}
3236
3237/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3238#define LM1882_SYNC_DRIVE 0x200000L
3239
3240static void init_ids_eagle(struct bttv *btv)
3241{
3242 gpio_inout(0xffffff,0xFFFF37);
3243 gpio_write(0x200020);
3244
3245 /* flash strobe inverter ?! */
3246 gpio_write(0x200024);
3247
3248 /* switch sync drive off */
3249 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3250
3251 /* set BT848 muxel to 2 */
3252 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3253}
3254
3255/* Muxsel helper for the IDS Eagle.
3256 * the eagles does not use the standard muxsel-bits but
3257 * has its own multiplexer */
3258static void eagle_muxsel(struct bttv *btv, unsigned int input)
3259{
3260 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3261 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3262
Linus Torvalds1da177e2005-04-16 15:20:36 -07003263 /* composite */
3264 /* set chroma ADC to sleep */
3265 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3266 /* set to composite video */
3267 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3268 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003269
3270 /* switch sync drive off */
3271 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3272}
3273
3274static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3275{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003276 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003277 gpio_write(masks[input%4]);
3278}
3279
3280/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3281 alarms output
3282
3283 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3284 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3285
3286 IN - sensor inputs, INx - sensor inputs and TI XORed together
3287 O1,O2,O3 - alarm outputs (relays)
3288
3289 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3290
3291*/
3292
3293static void init_lmlbt4x(struct bttv *btv)
3294{
3295 printk(KERN_DEBUG "LMLBT4x init\n");
3296 btwrite(0x000000, BT848_GPIO_REG_INP);
3297 gpio_inout(0xffffff, 0x0006C0);
3298 gpio_write(0x000000);
3299}
3300
3301static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3302{
3303 unsigned int inmux = input % 8;
3304 gpio_inout( 0xf, 0xf );
3305 gpio_bits( 0xf, inmux );
3306}
3307
3308static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3309{
3310 unsigned int inmux = input % 4;
3311 gpio_inout( 3<<9, 3<<9 );
3312 gpio_bits( 3<<9, inmux<<9 );
3313}
3314
3315/* ----------------------------------------------------------------------- */
3316
3317static void bttv_reset_audio(struct bttv *btv)
3318{
3319 /*
3320 * BT878A has a audio-reset register.
3321 * 1. This register is an audio reset function but it is in
3322 * function-0 (video capture) address space.
3323 * 2. It is enough to do this once per power-up of the card.
3324 * 3. There is a typo in the Conexant doc -- it is not at
3325 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3326 * --//Shrikumar 030609
3327 */
3328 if (btv->id != 878)
3329 return;
3330
3331 if (bttv_debug)
3332 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3333 btwrite((1<<7), 0x058);
3334 udelay(10);
3335 btwrite( 0, 0x058);
3336}
3337
3338/* initialization part one -- before registering i2c bus */
3339void __devinit bttv_init_card1(struct bttv *btv)
3340{
3341 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003342 case BTTV_BOARD_HAUPPAUGE:
3343 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003344 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003345 break;
Wade Berrier434b2522007-06-25 13:02:16 -03003346 case BTTV_BOARD_VOODOOTV_200:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003347 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003348 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003349 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003350 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003351 boot_msp34xx(btv,11);
3352 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003353 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003354 pvr_boot(btv);
3355 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003356 case BTTV_BOARD_TWINHAN_DST:
3357 case BTTV_BOARD_AVDVBT_771:
3358 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003359 btv->use_i2c_hw = 1;
3360 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003361 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003362 init_RTV24( btv );
3363 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003364
Linus Torvalds1da177e2005-04-16 15:20:36 -07003365 }
3366 if (!bttv_tvcards[btv->c.type].has_dvb)
3367 bttv_reset_audio(btv);
3368}
3369
3370/* initialization part two -- after registering i2c bus */
3371void __devinit bttv_init_card2(struct bttv *btv)
3372{
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003373 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003374
Trent Piephoac7dc842007-06-28 17:51:08 -03003375 btv->tuner_type = UNSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003376
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003377 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003378 bttv_readee(btv,eeprom_data,0xa0);
3379 identify_by_eeprom(btv,eeprom_data);
3380 }
3381
3382 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003383 case BTTV_BOARD_MIRO:
3384 case BTTV_BOARD_MIROPRO:
3385 case BTTV_BOARD_PINNACLE:
3386 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003387 /* miro/pinnacle */
3388 miro_pinnacle_gpio(btv);
3389 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003390 case BTTV_BOARD_FLYVIDEO_98:
3391 case BTTV_BOARD_MAXI:
3392 case BTTV_BOARD_LIFE_FLYKIT:
3393 case BTTV_BOARD_FLYVIDEO:
3394 case BTTV_BOARD_TYPHOON_TVIEW:
3395 case BTTV_BOARD_CHRONOS_VS2:
3396 case BTTV_BOARD_FLYVIDEO_98FM:
3397 case BTTV_BOARD_FLYVIDEO2000:
3398 case BTTV_BOARD_FLYVIDEO98EZ:
3399 case BTTV_BOARD_CONFERENCETV:
3400 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003401 flyvideo_gpio(btv);
3402 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003403 case BTTV_BOARD_HAUPPAUGE:
3404 case BTTV_BOARD_HAUPPAUGE878:
3405 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003406 /* pick up some config infos from the eeprom */
3407 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003408 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003409 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003410 case BTTV_BOARD_AVERMEDIA98:
3411 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003412 bttv_readee(btv,eeprom_data,0xa0);
3413 avermedia_eeprom(btv);
3414 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003415 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003416 init_PXC200(btv);
3417 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003418 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003419 picolo_tetra_init(btv);
3420 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003421 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003422 btv->has_radio = 1;
3423 btv->has_matchbox = 1;
3424 btv->mbox_we = 0x20;
3425 btv->mbox_most = 0;
3426 btv->mbox_clk = 0x08;
3427 btv->mbox_data = 0x10;
3428 btv->mbox_mask = 0x38;
3429 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003430 case BTTV_BOARD_VOBIS_BOOSTAR:
3431 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003432 terratec_active_radio_upgrade(btv);
3433 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003434 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003435 if (btv->cardid == 0x3002144f) {
3436 btv->has_radio=1;
3437 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3438 }
3439 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003440 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003441 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003442 /* Fix up entry for 3DFX VoodooTV 100,
3443 which is an OEM STB card variant. */
3444 btv->has_radio=0;
3445 btv->tuner_type=TUNER_TEMIC_NTSC;
3446 }
3447 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003448 case BTTV_BOARD_OSPREY1x0:
3449 case BTTV_BOARD_OSPREY1x0_848:
3450 case BTTV_BOARD_OSPREY101_848:
3451 case BTTV_BOARD_OSPREY1x1:
3452 case BTTV_BOARD_OSPREY1x1_SVID:
3453 case BTTV_BOARD_OSPREY2xx:
3454 case BTTV_BOARD_OSPREY2x0_SVID:
3455 case BTTV_BOARD_OSPREY2x0:
3456 case BTTV_BOARD_OSPREY500:
3457 case BTTV_BOARD_OSPREY540:
3458 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003459 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003460 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003461 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003462 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003463 init_ids_eagle(btv);
3464 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003465 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003466 bttv_readee(btv,eeprom_data,0xa0);
3467 modtec_eeprom(btv);
3468 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003469 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003470 init_lmlbt4x(btv);
3471 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003472 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003473 tibetCS16_init(btv);
3474 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003475 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003476 kodicom4400r_init(btv);
3477 break;
3478 }
3479
3480 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003481 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003482 /* defaults from card list */
3483 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3484 btv->pll.pll_ifreq=28636363;
3485 btv->pll.pll_crystal=BT848_IFORM_XT0;
3486 }
3487 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3488 btv->pll.pll_ifreq=35468950;
3489 btv->pll.pll_crystal=BT848_IFORM_XT1;
3490 }
3491 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003492 switch (pll[btv->c.nr]) {
3493 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003494 btv->pll.pll_crystal = 0;
3495 btv->pll.pll_ifreq = 0;
3496 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003497 break;
3498 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003499 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003500 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003501 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003502 btv->pll.pll_crystal = BT848_IFORM_XT0;
3503 break;
3504 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003505 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003506 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003507 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003508 btv->pll.pll_crystal = BT848_IFORM_XT1;
3509 break;
3510 }
3511 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003512 btv->pll.pll_current = -1;
3513
Linus Torvalds1da177e2005-04-16 15:20:36 -07003514 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003515 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3516 addr = bttv_tvcards[btv->c.type].tuner_addr;
3517
3518 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003519 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003520 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003521 if (UNSET != tuner[btv->c.nr])
3522 btv->tuner_type = tuner[btv->c.nr];
Trent Piephoac7dc842007-06-28 17:51:08 -03003523
3524 if (btv->tuner_type == TUNER_ABSENT ||
3525 bttv_tvcards[btv->c.type].tuner == UNSET)
3526 printk(KERN_INFO "bttv%d: tuner absent\n", btv->c.nr);
3527 else if(btv->tuner_type == UNSET)
3528 printk(KERN_WARNING "bttv%d: tuner type unset\n", btv->c.nr);
3529 else
3530 printk(KERN_INFO "bttv%d: tuner type=%d\n", btv->c.nr,
3531 btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003532
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003533 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003534 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003535
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003536 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003537 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003538 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003539
3540 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3541 }
3542
Hans Verkuil39e8f402006-01-09 15:25:16 -02003543 if (btv->tda9887_conf) {
3544 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3545 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003546 }
3547
Linus Torvalds1da177e2005-04-16 15:20:36 -07003548 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3549 if (svhs[btv->c.nr] != UNSET)
3550 btv->svhs = svhs[btv->c.nr];
3551 if (remote[btv->c.nr] != UNSET)
3552 btv->has_remote = remote[btv->c.nr];
3553
3554 if (bttv_tvcards[btv->c.type].has_radio)
3555 btv->has_radio=1;
3556 if (bttv_tvcards[btv->c.type].has_remote)
3557 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003558 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3559 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003560 if (bttv_tvcards[btv->c.type].audio_hook)
3561 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3562
3563 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3564 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003565 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3566 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003567 boot_bt832(btv);
3568 }
3569
3570 if (!autoload)
3571 return;
3572
Trent Piephoac7dc842007-06-28 17:51:08 -03003573 if (bttv_tvcards[btv->c.type].tuner == UNSET)
3574 return; /* no tuner or related drivers to load */
3575
Linus Torvalds1da177e2005-04-16 15:20:36 -07003576 /* try to detect audio/fader chips */
3577 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003578 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003579 request_module("msp3400");
3580
3581 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003582 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003583 request_module("msp3400");
3584
3585 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003586 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003587 request_module("tda9875");
3588
3589 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003590 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003591 request_module("tda7432");
3592
3593 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3594 request_module("tvaudio");
3595
Trent Piephoac7dc842007-06-28 17:51:08 -03003596 if (btv->tuner_type != UNSET && btv->tuner_type != TUNER_ABSENT)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003597 request_module("tuner");
3598}
3599
3600
3601/* ----------------------------------------------------------------------- */
3602
3603static void modtec_eeprom(struct bttv *btv)
3604{
3605 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3606 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3607 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3608 btv->c.nr,&eeprom_data[0x1e]);
3609 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3610 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3611 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003612 btv->c.nr,&eeprom_data[0x1e]);
3613 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3614 btv->tuner_type=TUNER_PHILIPS_NTSC;
3615 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3616 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003617 } else {
3618 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3619 btv->c.nr,&eeprom_data[0x1e]);
3620 }
3621}
3622
3623static void __devinit hauppauge_eeprom(struct bttv *btv)
3624{
3625 struct tveeprom tv;
3626
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003627 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003628 btv->tuner_type = tv.tuner_type;
3629 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003630
3631 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3632 btv->c.nr, tv.model);
3633
3634 /*
3635 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3636 * type based on model #.
3637 */
3638 if(tv.model == 64900) {
3639 printk("bttv%d: Switching board type from %s to %s\n",
3640 btv->c.nr,
3641 bttv_tvcards[btv->c.type].name,
3642 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3643 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3644 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003645}
3646
3647static int terratec_active_radio_upgrade(struct bttv *btv)
3648{
3649 int freq;
3650
3651 btv->has_radio = 1;
3652 btv->has_matchbox = 1;
3653 btv->mbox_we = 0x10;
3654 btv->mbox_most = 0x20;
3655 btv->mbox_clk = 0x08;
3656 btv->mbox_data = 0x04;
3657 btv->mbox_mask = 0x3c;
3658
3659 btv->mbox_iow = 1 << 8;
3660 btv->mbox_ior = 1 << 9;
3661 btv->mbox_csel = 1 << 10;
3662
3663 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003664 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003665 if (0x1ed8 == tea5757_read(btv)) {
3666 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3667 btv->c.nr);
3668 btv->has_radio = 1;
3669 btv->has_matchbox = 1;
3670 } else {
3671 btv->has_radio = 0;
3672 btv->has_matchbox = 0;
3673 }
3674 return 0;
3675}
3676
3677
3678/* ----------------------------------------------------------------------- */
3679
3680/*
3681 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3682 *
3683 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3684 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3685 * unpacked with unzip).
3686 */
3687#define PVR_GPIO_DELAY 10
3688
3689#define BTTV_ALT_DATA 0x000001
3690#define BTTV_ALT_DCLK 0x100000
3691#define BTTV_ALT_NCONFIG 0x800000
3692
3693static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3694{
3695 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003696 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003697 int i;
3698
3699 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3700 gpio_write(0);
3701 udelay(PVR_GPIO_DELAY);
3702
3703 gpio_write(BTTV_ALT_NCONFIG);
3704 udelay(PVR_GPIO_DELAY);
3705
3706 for (n = 0; n < microlen; n++) {
3707 bits = micro[n];
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003708 for (i = 0 ; i < 8 ; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003709 gpio_bits(BTTV_ALT_DCLK,0);
3710 if (bits & 0x01)
3711 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3712 else
3713 gpio_bits(BTTV_ALT_DATA,0);
3714 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3715 bits >>= 1;
3716 }
3717 }
3718 gpio_bits(BTTV_ALT_DCLK,0);
3719 udelay(PVR_GPIO_DELAY);
3720
3721 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3722 for (i = 0 ; i < 30 ; i++) {
3723 gpio_bits(BTTV_ALT_DCLK,0);
3724 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3725 }
3726 gpio_bits(BTTV_ALT_DCLK,0);
3727 return 0;
3728}
3729
3730static int __devinit pvr_boot(struct bttv *btv)
3731{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003732 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003733 int rc;
3734
3735 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3736 if (rc != 0) {
3737 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3738 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003739 return rc;
3740 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003741 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3742 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3743 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003744 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003745 return rc;
3746}
3747
3748/* ----------------------------------------------------------------------- */
3749/* some osprey specific stuff */
3750
3751static void __devinit osprey_eeprom(struct bttv *btv)
3752{
3753 int i = 0;
3754 unsigned char *ee = eeprom_data;
3755 unsigned long serial = 0;
3756
3757 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003758 /* this might be an antique... check for MMAC label in eeprom */
3759 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3760 unsigned char checksum = 0;
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003761 for (i = 0; i < 21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003762 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003763 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003764 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003765 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003766 for (i = 12; i < 21; i++)
3767 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003768 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003769 } else {
3770 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003771 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003772
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003773 for (; offset < 8*16; offset += 16) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003774 unsigned short checksum = 0;
3775 /* verify the checksum */
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003776 for (i = 0; i < 14; i++)
3777 checksum += ee[i+offset];
3778 checksum = ~checksum; /* no idea why */
3779 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003780 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003781 break;
3782 }
3783 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003784
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003785 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003786 return;
3787
3788 /* found a valid descriptor */
3789 type = (ee[offset+4]<<8) | (ee[offset+5]);
3790
3791 switch(type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003792 /* 848 based */
3793 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003794 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003795 break;
3796 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003797 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003798 break;
3799
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003800 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003801 case 0x0012:
3802 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003803 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003804 break;
3805 case 0x0014:
3806 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003807 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003808 break;
3809 case 0x0016:
3810 case 0x0017:
3811 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003812 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003813 break;
3814 case 0x0018:
3815 case 0x0019:
3816 case 0x001E:
3817 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003818 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003819 break;
3820 case 0x001A:
3821 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003822 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003823 break;
3824 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003825 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003826 break;
3827 case 0x0050:
3828 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003829 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003830 /* bttv_osprey_540_init(btv); */
3831 break;
3832 case 0x0060:
3833 case 0x0070:
Michael Krufky52398ef2006-05-26 02:13:15 -03003834 case 0x00A0:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003835 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003836 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003837 gpio_inout(0xffffff,0x000303);
3838 break;
3839 default:
3840 /* unknown...leave generic, but get serial # */
3841 break;
3842 }
3843 serial = (ee[offset+6] << 24)
3844 | (ee[offset+7] << 16)
3845 | (ee[offset+8] << 8)
3846 | (ee[offset+9]);
3847 }
3848
3849 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3850 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3851}
3852
3853/* ----------------------------------------------------------------------- */
3854/* AVermedia specific stuff, from bktr_card.c */
3855
3856static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003857 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3858 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3859 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3860 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3861 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003862 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003863
3864static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003865 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003866 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3867 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003868 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3869 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003870
3871static void __devinit avermedia_eeprom(struct bttv *btv)
3872{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003873 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003874
3875 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003876 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3877 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003878 btv->has_remote = (eeprom_data[0x42] & 0x01);
3879
3880 if (tuner_make == 0 || tuner_make == 2)
3881 if(tuner_format <=0x0a)
3882 tuner = tuner_0_table[tuner_format];
3883 if (tuner_make == 1)
3884 if(tuner_format <=9)
3885 tuner = tuner_1_table[tuner_format];
3886
3887 if (tuner_make == 4)
3888 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003889 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003890
3891 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3892 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3893 if(tuner) {
3894 btv->tuner_type=tuner;
3895 printk("%d",tuner);
3896 } else
3897 printk("Unknown type");
3898 printk(" radio:%s remote control:%s\n",
3899 tuner_tv_fm ? "yes" : "no",
3900 btv->has_remote ? "yes" : "no");
3901}
3902
3903/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3904void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3905{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003906 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003907 if(norm==VIDEO_MODE_NTSC) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003908 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3909 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
Wade Berrier434b2522007-06-25 13:02:16 -03003910 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3911 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003912 dprintk("bttv_tda9880_setnorm to NTSC\n");
3913 }
3914 else {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003915 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3916 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
Wade Berrier434b2522007-06-25 13:02:16 -03003917 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3918 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003919 dprintk("bttv_tda9880_setnorm to PAL\n");
3920 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003921 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003922 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003923 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003924}
3925
3926
3927/*
3928 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003929 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003930 *
3931 * Hauppauge: pin 5
3932 * Voodoo: pin 20
3933 */
3934static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3935{
3936 int mask = (1 << pin);
3937
3938 gpio_inout(mask,mask);
3939 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003940 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003941 gpio_bits(mask,mask);
3942
3943 if (bttv_gpio)
3944 bttv_gpio_tracking(btv,"msp34xx");
3945 if (bttv_verbose)
3946 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3947 "init [%d]\n", btv->c.nr, pin);
3948}
3949
3950static void __devinit boot_bt832(struct bttv *btv)
3951{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003952}
3953
3954/* ----------------------------------------------------------------------- */
3955/* Imagenation L-Model PXC200 Framegrabber */
3956/* This is basically the same procedure as
3957 * used by Alessandro Rubini in his pxc200
3958 * driver, but using BTTV functions */
3959
3960static void __devinit init_PXC200(struct bttv *btv)
3961{
3962 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3963 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3964 0x00 };
3965 unsigned int i;
3966 int tmp;
3967 u32 val;
3968
3969 /* Initialise GPIO-connevted stuff */
3970 gpio_inout(0xffffff, (1<<13));
3971 gpio_write(0);
3972 udelay(3);
3973 gpio_write(1<<13);
3974 /* GPIO inputs are pulled up, so no need to drive
3975 * reset pin any longer */
3976 gpio_bits(0xffffff, 0);
3977 if (bttv_gpio)
3978 bttv_gpio_tracking(btv,"pxc200");
3979
3980 /* we could/should try and reset/control the AD pots? but
3981 right now we simply turned off the crushing. Without
3982 this the AGC drifts drifts
3983 remember the EN is reverse logic -->
3984 setting BT848_ADC_AGC_EN disable the AGC
3985 tboult@eecs.lehigh.edu
3986 */
3987
3988 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3989
3990 /* Initialise MAX517 DAC */
3991 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3992 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3993
3994 /* Initialise 12C508 PIC */
3995 /* The I2CWrite and I2CRead commmands are actually to the
3996 * same chips - but the R/W bit is included in the address
3997 * argument so the numbers are different */
3998
3999
4000 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
4001
4002 /* First of all, enable the clock line. This is used in the PXC200-F */
4003 val = btread(BT848_GPIO_DMA_CTL);
4004 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4005 btwrite(val, BT848_GPIO_DMA_CTL);
4006
4007 /* Then, push to 0 the reset pin long enough to reset the *
4008 * device same as above for the reset line, but not the same
4009 * value sent to the GPIO-connected stuff
4010 * which one is the good one? */
4011 gpio_inout(0xffffff,(1<<2));
4012 gpio_write(0);
4013 udelay(10);
4014 gpio_write(1<<2);
4015
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004016 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004017 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4018 if (tmp != -1) {
4019 printk(KERN_INFO
4020 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4021 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4022 }
4023 }
4024
4025 printk(KERN_INFO "PXC200 Initialised.\n");
4026}
4027
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004028
4029
Peter Skipworth93b43f12005-06-23 22:04:45 -07004030/* ----------------------------------------------------------------------- */
4031/*
4032 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4033 * it. This apparently involves the following procedure for each 878 chip:
4034 *
4035 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4036 *
4037 * 2) write to GPIO_DATA
4038 * - 0x0E
4039 * - sleep 1ms
4040 * - 0x10 + 0x0E
4041 * - sleep 10ms
4042 * - 0x0E
4043 * read from GPIO_DATA into buf (uint_32)
4044 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4045 * error. ERROR_CPLD_Check_Failed stop.
4046 *
4047 * 3) write to GPIO_DATA
4048 * - write 0x4400 + 0x0E
4049 * - sleep 10ms
4050 * - write 0x4410 + 0x0E
4051 * - sleep 1ms
4052 * - write 0x0E
4053 * read from GPIO_DATA into buf (uint_32)
Jean Delvarefef4fa142006-11-09 17:25:28 -03004054 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
Peter Skipworth93b43f12005-06-23 22:04:45 -07004055 * error. ERROR_CPLD_Check_Failed.
4056 */
4057/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08004058static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004059init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07004060{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004061 uint32_t dataRead = 0;
4062 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07004063
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004064 printk (KERN_INFO
4065 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07004066 btv->c.nr);
4067
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004068 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004069
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004070 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4071 msleep (1);
4072 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4073 msleep (10);
4074 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004075
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004076 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004077
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004078 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4079 printk (KERN_INFO
4080 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4081 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004082 }
4083
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004084 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4085 msleep (10);
4086 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4087 msleep (1);
4088 btwrite (watchdog_value, BT848_GPIO_DATA);
4089 msleep (1);
4090 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004091
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004092 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4093 printk (KERN_INFO
4094 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4095 btv->c.nr, dataRead);
4096
Peter Skipworth93b43f12005-06-23 22:04:45 -07004097 return;
4098 }
4099
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004100 printk (KERN_INFO
4101 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004102}
Linus Torvalds1da177e2005-04-16 15:20:36 -07004103
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004104
4105
Linus Torvalds1da177e2005-04-16 15:20:36 -07004106/* ----------------------------------------------------------------------- */
4107/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4108/*
4109 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4110 * This code is placed under the terms of the GNU General Public License
4111 *
4112 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4113 */
4114
4115static void bus_low(struct bttv *btv, int bit)
4116{
4117 if (btv->mbox_ior) {
4118 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4119 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4120 udelay(5);
4121 }
4122
4123 gpio_bits(bit,0);
4124 udelay(5);
4125
4126 if (btv->mbox_ior) {
4127 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4128 udelay(5);
4129 }
4130}
4131
4132static void bus_high(struct bttv *btv, int bit)
4133{
4134 if (btv->mbox_ior) {
4135 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4136 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4137 udelay(5);
4138 }
4139
4140 gpio_bits(bit,bit);
4141 udelay(5);
4142
4143 if (btv->mbox_ior) {
4144 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4145 udelay(5);
4146 }
4147}
4148
4149static int bus_in(struct bttv *btv, int bit)
4150{
4151 if (btv->mbox_ior) {
4152 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4153 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4154 udelay(5);
4155
4156 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4157 udelay(5);
4158 }
4159 return gpio_read() & (bit);
4160}
4161
4162/* TEA5757 register bits */
4163#define TEA_FREQ 0:14
4164#define TEA_BUFFER 15:15
4165
4166#define TEA_SIGNAL_STRENGTH 16:17
4167
4168#define TEA_PORT1 18:18
4169#define TEA_PORT0 19:19
4170
4171#define TEA_BAND 20:21
4172#define TEA_BAND_FM 0
4173#define TEA_BAND_MW 1
4174#define TEA_BAND_LW 2
4175#define TEA_BAND_SW 3
4176
4177#define TEA_MONO 22:22
4178#define TEA_ALLOW_STEREO 0
4179#define TEA_FORCE_MONO 1
4180
4181#define TEA_SEARCH_DIRECTION 23:23
4182#define TEA_SEARCH_DOWN 0
4183#define TEA_SEARCH_UP 1
4184
4185#define TEA_STATUS 24:24
4186#define TEA_STATUS_TUNED 0
4187#define TEA_STATUS_SEARCHING 1
4188
4189/* Low-level stuff */
4190static int tea5757_read(struct bttv *btv)
4191{
4192 unsigned long timeout;
4193 int value = 0;
4194 int i;
4195
4196 /* better safe than sorry */
4197 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4198
4199 if (btv->mbox_ior) {
4200 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4201 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4202 udelay(5);
4203 }
4204
4205 if (bttv_gpio)
4206 bttv_gpio_tracking(btv,"tea5757 read");
4207
4208 bus_low(btv,btv->mbox_we);
4209 bus_low(btv,btv->mbox_clk);
4210
4211 udelay(10);
4212 timeout= jiffies + HZ;
4213
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004214 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004215 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4216 schedule();
4217 if (bus_in(btv,btv->mbox_data)) {
4218 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4219 return -1;
4220 }
4221
4222 dprintk("bttv%d: tea5757:",btv->c.nr);
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004223 for (i = 0; i < 24; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004224 udelay(5);
4225 bus_high(btv,btv->mbox_clk);
4226 udelay(5);
4227 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4228 bus_low(btv,btv->mbox_clk);
4229 value <<= 1;
4230 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4231 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4232 }
4233 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4234 return value;
4235}
4236
4237static int tea5757_write(struct bttv *btv, int value)
4238{
4239 int i;
4240 int reg = value;
4241
4242 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4243
4244 if (btv->mbox_ior) {
4245 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4246 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4247 udelay(5);
4248 }
4249 if (bttv_gpio)
4250 bttv_gpio_tracking(btv,"tea5757 write");
4251
4252 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4253 bus_low(btv,btv->mbox_clk);
4254 bus_high(btv,btv->mbox_we);
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004255 for (i = 0; i < 25; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004256 if (reg & 0x1000000)
4257 bus_high(btv,btv->mbox_data);
4258 else
4259 bus_low(btv,btv->mbox_data);
4260 reg <<= 1;
4261 bus_high(btv,btv->mbox_clk);
4262 udelay(10);
4263 bus_low(btv,btv->mbox_clk);
4264 udelay(10);
4265 }
4266 bus_low(btv,btv->mbox_we); /* unmute !!! */
4267 return 0;
4268}
4269
4270void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4271{
4272 dprintk("tea5757_set_freq %d\n",freq);
4273 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004274}
4275
4276
4277/* ----------------------------------------------------------------------- */
4278/* winview */
4279
Adrian Bunk943a4902005-12-01 00:51:35 -08004280static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004281{
4282 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4283 int bits_out, loops, vol, data;
4284
4285 if (!set) {
4286 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4287 v->flags |= VIDEO_AUDIO_VOLUME;
4288 return;
4289 }
4290
4291 /* 32 levels logarithmic */
4292 vol = 32 - ((v->volume>>11));
4293 /* units */
4294 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4295 /* tens */
4296 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4297 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4298 data = gpio_read();
4299 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4300 WINVIEW_PT2254_STROBE);
4301 for (loops = 17; loops >= 0 ; loops--) {
4302 if (bits_out & (1<<loops))
4303 data |= WINVIEW_PT2254_DATA;
4304 else
4305 data &= ~WINVIEW_PT2254_DATA;
4306 gpio_write(data);
4307 udelay(5);
4308 data |= WINVIEW_PT2254_CLK;
4309 gpio_write(data);
4310 udelay(5);
4311 data &= ~WINVIEW_PT2254_CLK;
4312 gpio_write(data);
4313 }
4314 data |= WINVIEW_PT2254_STROBE;
4315 data &= ~WINVIEW_PT2254_DATA;
4316 gpio_write(data);
4317 udelay(10);
4318 data &= ~WINVIEW_PT2254_STROBE;
4319 gpio_write(data);
4320}
4321
4322/* ----------------------------------------------------------------------- */
4323/* mono/stereo control for various cards (which don't use i2c chips but */
4324/* connect something to the GPIO pins */
4325
4326static void
4327gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4328{
4329 unsigned int con = 0;
4330
4331 if (set) {
4332 gpio_inout(0x300, 0x300);
4333 if (v->mode & VIDEO_SOUND_LANG1)
4334 con = 0x000;
4335 if (v->mode & VIDEO_SOUND_LANG2)
4336 con = 0x300;
4337 if (v->mode & VIDEO_SOUND_STEREO)
4338 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004339/* if (v->mode & VIDEO_SOUND_MONO)
4340 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004341 gpio_bits(0x300, con);
4342 } else {
4343 v->mode = VIDEO_SOUND_STEREO |
4344 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4345 }
4346}
4347
4348static void
4349gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4350{
4351 unsigned int val, con;
4352
Linus Torvalds1da177e2005-04-16 15:20:36 -07004353 if (btv->radio_user)
4354 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004355
4356 val = gpio_read();
4357 if (set) {
4358 con = 0x000;
4359 if (v->mode & VIDEO_SOUND_LANG2) {
4360 if (v->mode & VIDEO_SOUND_LANG1) {
4361 /* LANG1 + LANG2 */
4362 con = 0x100;
4363 }
4364 else {
4365 /* LANG2 */
4366 con = 0x300;
4367 }
4368 }
4369 if (con != (val & 0x300)) {
4370 gpio_bits(0x300, con);
4371 if (bttv_gpio)
4372 bttv_gpio_tracking(btv,"gvbctv5pci");
4373 }
4374 } else {
4375 switch (val & 0x70) {
4376 case 0x10:
4377 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4378 break;
4379 case 0x30:
4380 v->mode = VIDEO_SOUND_LANG2;
4381 break;
4382 case 0x50:
4383 v->mode = VIDEO_SOUND_LANG1;
4384 break;
4385 case 0x60:
4386 v->mode = VIDEO_SOUND_STEREO;
4387 break;
4388 case 0x70:
4389 v->mode = VIDEO_SOUND_MONO;
4390 break;
4391 default:
4392 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4393 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4394 }
4395 }
4396}
4397
4398/*
4399 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4400 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4401 * 0xdde enables mono and 0xccd enables sap
4402 *
4403 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4404 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4405 * input/output sound connection, so both must be set for output mode.
4406 *
4407 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4408 * handles this with a tda9840
4409 *
4410 */
4411static void
4412avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4413{
4414 int val = 0;
4415
4416 if (set) {
4417 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4418 val = 0x02;
4419 if (v->mode & VIDEO_SOUND_STEREO)
4420 val = 0x01;
4421 if (val) {
4422 gpio_bits(0x03,val);
4423 if (bttv_gpio)
4424 bttv_gpio_tracking(btv,"avermedia");
4425 }
4426 } else {
4427 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4428 VIDEO_SOUND_LANG1;
4429 return;
4430 }
4431}
4432
4433static void
4434avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4435{
4436 int val = 0;
4437
4438 if (set) {
4439 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4440 val = 0x01;
4441 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4442 val = 0x02;
4443 btaor(val, ~0x03, BT848_GPIO_DATA);
4444 if (bttv_gpio)
4445 bttv_gpio_tracking(btv,"avermedia");
4446 } else {
4447 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4448 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4449 return;
4450 }
4451}
4452
4453/* Lifetec 9415 handling */
4454static void
4455lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4456{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004457 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004458
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004459 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004460 v->mode = VIDEO_SOUND_MONO;
4461 return;
4462 }
4463
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004464 if (set) {
4465 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4466 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004467 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004468 val = 0x0880;
4469 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004470 (v->mode & VIDEO_SOUND_MONO))
4471 val = 0;
4472 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004473 if (bttv_gpio)
4474 bttv_gpio_tracking(btv,"lt9415");
4475 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004476 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004477 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004478 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004479 return;
4480 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004481}
4482
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004483/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004484static void
4485terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4486{
4487 unsigned int con = 0;
4488
4489 if (set) {
4490 gpio_inout(0x180000,0x180000);
4491 if (v->mode & VIDEO_SOUND_LANG2)
4492 con = 0x080000;
4493 if (v->mode & VIDEO_SOUND_STEREO)
4494 con = 0x180000;
4495 gpio_bits(0x180000, con);
4496 if (bttv_gpio)
4497 bttv_gpio_tracking(btv,"terratv");
4498 } else {
4499 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4500 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4501 }
4502}
4503
4504static void
4505winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4506{
4507 unsigned long val = 0;
4508
4509 if (set) {
4510 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4511 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4512 val = 0x420000;
4513 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4514 val = 0x420000;
4515 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4516 val = 0x410000;
4517 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4518 val = 0x020000;
4519 if (val) {
4520 gpio_bits(0x430000, val);
4521 if (bttv_gpio)
4522 bttv_gpio_tracking(btv,"winfast2000");
4523 }
4524 } else {
4525 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4526 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4527 }
4528}
4529
4530/*
4531 * Dariusz Kowalewski <darekk@automex.pl>
4532 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4533 * revision 9B has on-board TDA9874A sound decoder).
4534 *
4535 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4536 * will mute this cards.
4537 */
4538static void
4539pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4540{
4541 unsigned int val = 0;
4542
Linus Torvalds1da177e2005-04-16 15:20:36 -07004543 if (btv->radio_user)
4544 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004545
4546 if (set) {
4547 if (v->mode & VIDEO_SOUND_MONO) {
4548 val = 0x01;
4549 }
4550 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4551 || (v->mode & VIDEO_SOUND_STEREO)) {
4552 val = 0x02;
4553 }
4554 if (val) {
4555 gpio_bits(0x03,val);
4556 if (bttv_gpio)
4557 bttv_gpio_tracking(btv,"pvbt878p9b");
4558 }
4559 } else {
4560 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4561 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4562 }
4563}
4564
4565/*
4566 * Dariusz Kowalewski <darekk@automex.pl>
4567 * sound control for FlyVideo 2000S (with tda9874 decoder)
4568 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4569 */
4570static void
4571fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4572{
4573 unsigned int val = 0xffff;
4574
Linus Torvalds1da177e2005-04-16 15:20:36 -07004575 if (btv->radio_user)
4576 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004577 if (set) {
4578 if (v->mode & VIDEO_SOUND_MONO) {
4579 val = 0x0000;
4580 }
4581 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4582 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004583 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004584 }
4585 if (val != 0xffff) {
4586 gpio_bits(0x1800, val);
4587 if (bttv_gpio)
4588 bttv_gpio_tracking(btv,"fv2000s");
4589 }
4590 } else {
4591 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4592 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4593 }
4594}
4595
4596/*
4597 * sound control for Canopus WinDVR PCI
4598 * Masaki Suzuki <masaki@btree.org>
4599 */
4600static void
4601windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4602{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004603 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004604
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004605 if (set) {
4606 if (v->mode & VIDEO_SOUND_MONO)
4607 val = 0x040000;
4608 if (v->mode & VIDEO_SOUND_LANG1)
4609 val = 0;
4610 if (v->mode & VIDEO_SOUND_LANG2)
4611 val = 0x100000;
4612 if (v->mode & VIDEO_SOUND_STEREO)
4613 val = 0;
4614 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004615 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004616 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004617 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004618 }
4619 } else {
4620 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4621 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4622 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004623}
4624
4625/*
4626 * sound control for AD-TVK503
4627 * Hiroshi Takekawa <sian@big.or.jp>
4628 */
4629static void
4630adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4631{
4632 unsigned int con = 0xffffff;
4633
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004634 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004635
4636 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004637 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004638 if (v->mode & VIDEO_SOUND_LANG1)
4639 con = 0x00000000;
4640 if (v->mode & VIDEO_SOUND_LANG2)
4641 con = 0x00180000;
4642 if (v->mode & VIDEO_SOUND_STEREO)
4643 con = 0x00000000;
4644 if (v->mode & VIDEO_SOUND_MONO)
4645 con = 0x00060000;
4646 if (con != 0xffffff) {
4647 gpio_bits(0x1e0000,con);
4648 if (bttv_gpio)
4649 bttv_gpio_tracking(btv, "adtvk503");
4650 }
4651 } else {
4652 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4653 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4654 }
4655}
4656
4657/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4658 *
4659 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4660 * switch instead (CD22M3494E). This IC can have multiple active connections
4661 * between Xn (input) and Yn (output) pins. We need to clear any existing
4662 * connection prior to establish a new one, pulsing the STROBE pin.
4663 *
4664 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4665 * GPIO pins are wired as:
4666 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4667 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4668 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4669 * GPIO[8] - - P3[5] (microcontroler)
4670 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4671 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4672 * GPINTR - - P3[4] (microcontroler)
4673 *
4674 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4675 * configuration either directly (as we are doing) or using the microcontroler
4676 * which is also wired to I2C interface. I have no further info on the
4677 * microcontroler features, one would need to disassembly the firmware.
4678 * note: the vendor refused to give any information on this product, all
4679 * that stuff was found using a multimeter! :)
4680 */
4681static void rv605_muxsel(struct bttv *btv, unsigned int input)
4682{
4683 /* reset all conections */
4684 gpio_bits(0x200,0x200);
4685 mdelay(1);
4686 gpio_bits(0x200,0x000);
4687 mdelay(1);
4688
4689 /* create a new conection */
4690 gpio_bits(0x480,0x080);
4691 gpio_bits(0x480,0x480);
4692 mdelay(1);
4693 gpio_bits(0x480,0x080);
4694 mdelay(1);
4695}
4696
4697/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4698 *
4699 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4700 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4701 * chips, ten eight input analog multiplexors, a not chip and a few
4702 * other components.
4703 *
4704 * 16 inputs on a secondary bracket are provided and can be selected
4705 * from each of the four capture chips. Two of the eight input
4706 * multiplexors are used to select from any of the 16 input signals.
4707 *
4708 * Unsupported hardware capabilities:
4709 * . A video output monitor on the secondary bracket can be selected from
4710 * one of the 878A chips.
4711 * . Another passthrough but I haven't spent any time investigating it.
4712 * . Digital I/O (logic level connected to GPIO) is available from an
4713 * onboard header.
4714 *
4715 * The on chip input mux should always be set to 2.
4716 * GPIO[16:19] - Video input selection
4717 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4718 * GPIO[?:?] - Digital I/O.
4719 *
4720 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4721 * determined what function (if any) it provides. With the microcontroller
4722 * and sync seperator chips a guess is that it might have to do with video
4723 * switching and maybe some digital I/O.
4724 */
4725static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4726{
4727 /* video mux */
4728 gpio_bits(0x0f0000, input << 16);
4729}
4730
4731static void tibetCS16_init(struct bttv *btv)
4732{
4733 /* enable gpio bits, mask obtained via btSpy */
4734 gpio_inout(0xffffff, 0x0f7fff);
4735 gpio_write(0x0f7fff);
4736}
4737
4738/*
4739 * The following routines for the Kodicom-4400r get a little mind-twisting.
4740 * There is a "master" controller and three "slave" controllers, together
4741 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4742 * The analog switch is controlled by the "master", but the detection order
4743 * of the four BT878A chips is in an order which I just don't understand.
4744 * The "master" is actually the second controller to be detected. The
4745 * logic on the board uses logical numbers for the 4 controlers, but
4746 * those numbers are different from the detection sequence. When working
4747 * with the analog switch, we need to "map" from the detection sequence
4748 * over to the board's logical controller number. This mapping sequence
4749 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4750 * unit 3, the second (which is the master) is logical unit 0, etc.
4751 * We need to maintain the status of the analog switch (which of the 16
4752 * cameras is connected to which of the 4 controllers). Rather than
4753 * add to the bttv structure for this, we use the data reserved for
4754 * the mbox (unused for this card type).
4755 */
4756
4757/*
4758 * First a routine to set the analog switch, which controls which camera
4759 * is routed to which controller. The switch comprises an X-address
4760 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4761 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4762 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4763 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4764 * specified address. The idea is to set the address and data, then bring
4765 * STROBE high, and finally bring STROBE back to low.
4766 */
4767static void kodicom4400r_write(struct bttv *btv,
4768 unsigned char xaddr,
4769 unsigned char yaddr,
4770 unsigned char data) {
4771 unsigned int udata;
4772
4773 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4774 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4775 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4776 gpio_bits(0x1ff, udata); /* strobe low */
4777}
4778
4779/*
4780 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4781 * use this routine. The routine finds the "master" for the card, maps
4782 * the controller number from the detected position over to the logical
4783 * number, writes the appropriate data to the analog switch, and housekeeps
4784 * the local copy of the switch information. The parameter 'input' is the
4785 * requested camera number (0 - 15).
4786 */
4787static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4788{
4789 char *sw_status;
4790 int xaddr, yaddr;
4791 struct bttv *mctlr;
4792 static unsigned char map[4] = {3, 0, 2, 1};
4793
4794 mctlr = master[btv->c.nr];
4795 if (mctlr == NULL) { /* ignore if master not yet detected */
4796 return;
4797 }
4798 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4799 yaddr = map[yaddr];
4800 sw_status = (char *)(&mctlr->mbox_we);
4801 xaddr = input & 0xf;
4802 /* Check if the controller/camera pair has changed, else ignore */
4803 if (sw_status[yaddr] != xaddr)
4804 {
4805 /* "open" the old switch, "close" the new one, save the new */
4806 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4807 sw_status[yaddr] = xaddr;
4808 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4809 }
4810}
4811
4812/*
4813 * During initialisation, we need to reset the analog switch. We
4814 * also preset the switch to map the 4 connectors on the card to the
4815 * *user's* (see above description of kodicom4400r_muxsel) channels
4816 * 0 through 3
4817 */
4818static void kodicom4400r_init(struct bttv *btv)
4819{
4820 char *sw_status = (char *)(&btv->mbox_we);
4821 int ix;
4822
4823 gpio_inout(0x0003ff, 0x0003ff);
4824 gpio_write(1 << 9); /* reset MUX */
4825 gpio_write(0);
4826 /* Preset camera 0 to the 4 controllers */
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004827 for (ix = 0; ix < 4; ix++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004828 sw_status[ix] = ix;
4829 kodicom4400r_write(btv, ix, ix, 1);
4830 }
4831 /*
4832 * Since this is the "master", we need to set up the
4833 * other three controller chips' pointers to this structure
4834 * for later use in the muxsel routine.
4835 */
4836 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4837 return;
4838 master[btv->c.nr-1] = btv;
4839 master[btv->c.nr] = btv;
4840 master[btv->c.nr+1] = btv;
4841 master[btv->c.nr+2] = btv;
4842}
4843
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004844/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4845 * video multiplexers to provide up to 16 video inputs. These
4846 * multiplexers are controlled by the lower 8 GPIO pins of the
4847 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004848
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004849 * xxx0 is pin xxx of multiplexer U5,
4850 * yyy1 is pin yyy of multiplexer U2
4851 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004852#define ENA0 0x01
4853#define ENB0 0x02
4854#define ENA1 0x04
4855#define ENB1 0x08
4856
4857#define IN10 0x10
4858#define IN00 0x20
4859#define IN11 0x40
4860#define IN01 0x80
4861
4862static void xguard_muxsel(struct bttv *btv, unsigned int input)
4863{
4864 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004865 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4866 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4867 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4868 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004869 };
4870 gpio_write(masks[input%16]);
4871}
4872static void picolo_tetra_init(struct bttv *btv)
4873{
4874 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4875 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4876 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4877}
4878static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4879{
4880
4881 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4882 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4883 /*GPIO[20]&GPIO[21] used to choose the right input*/
4884 btwrite (input<<20,BT848_GPIO_DATA);
4885
4886}
4887
4888/*
4889 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4890 *
4891 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4892 * swichers to provide 16 channels to MUX0. The TDA8540's have
Andreas Mohrd6e05ed2006-06-26 18:35:02 +02004893 * 4 independent outputs and as such the IVC120G also has the
Linus Torvalds1da177e2005-04-16 15:20:36 -07004894 * optional "Monitor Out" bus. This allows the card to be looking
4895 * at one input while the monitor is looking at another.
4896 *
4897 * Since I've couldn't be bothered figuring out how to add an
4898 * independant muxsel for the monitor bus, I've just set it to
4899 * whatever the card is looking at.
4900 *
4901 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4902 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4903 *
4904 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4905 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4906 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4907 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4908 *
4909 */
4910
4911/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4912#define I2C_TDA8540 0x90
4913#define I2C_TDA8540_ALT1 0x92
4914#define I2C_TDA8540_ALT2 0x94
4915#define I2C_TDA8540_ALT3 0x96
4916#define I2C_TDA8540_ALT4 0x98
4917#define I2C_TDA8540_ALT5 0x9a
4918#define I2C_TDA8540_ALT6 0x9c
4919
4920static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4921{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004922 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004923 int key = input % 4;
4924 int matrix = input / 4;
4925
4926 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4927 btv->c.nr, input, matrix, key);
4928
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004929 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004930 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4931 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4932 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4933 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4934 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4935 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4936 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4937 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4938
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004939 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004940 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004941 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004942 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004943 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004944 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004945 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004946 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004947 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004948
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004949 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004950 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4951}
4952
4953
4954/* PXC200 muxsel helper
4955 * luke@syseng.anu.edu.au
4956 * another transplant
4957 * from Alessandro Rubini (rubini@linux.it)
4958 *
4959 * There are 4 kinds of cards:
4960 * PXC200L which is bt848
4961 * PXC200F which is bt848 with PIC controlling mux
4962 * PXC200AL which is bt878
4963 * PXC200AF which is bt878 with PIC controlling mux
4964 */
4965#define PX_CFG_PXC200F 0x01
4966#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4967#define PX_I2C_PIC 0x0f
4968#define PX_PXC200A_CARDID 0x200a1295
4969#define PX_I2C_CMD_CFG 0x00
4970
4971static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4972{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004973 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004974 long mux;
4975 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004976 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004977
4978 /* Read PIC config to determine if this is a PXC200F */
4979 /* PX_I2C_CMD_CFG*/
4980 buf[0]=0;
4981 buf[1]=0;
4982 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4983 if (rc) {
4984 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4985 /* not PXC ? do nothing */
4986 return;
4987 }
4988
4989 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4990 if (!(rc & PX_CFG_PXC200F)) {
4991 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4992 return;
4993 }
4994
4995
4996 /* The multiplexer in the 200F is handled by the GPIO port */
4997 /* get correct mapping between inputs */
4998 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4999 /* ** not needed!? */
5000 mux = input;
5001
5002 /* make sure output pins are enabled */
5003 /* bitmask=0x30f; */
5004 bitmask=0x302;
5005 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005006 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07005007 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
5008 bitmask |= 7<<4; /* the DAC */
5009 }
5010 btwrite(bitmask, BT848_GPIO_OUT_EN);
5011
5012 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005013 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07005014 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
5015 else /* older device */
5016 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
5017 btwrite(bitmask,BT848_GPIO_DATA);
5018
5019 /*
5020 * Was "to be safe, set the bt848 to input 0"
5021 * Actually, since it's ok at load time, better not messing
5022 * with these bits (on PXC200AF you need to set mux 2 here)
5023 *
5024 * needed because bttv-driver sets mux before calling this function
5025 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005026 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07005027 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
5028 else /* older device */
5029 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
5030
5031 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
5032}
5033
5034/* ----------------------------------------------------------------------- */
5035/* motherboard chipset specific stuff */
5036
5037void __devinit bttv_check_chipset(void)
5038{
5039 int pcipci_fail = 0;
5040 struct pci_dev *dev = NULL;
5041
Alan Cox3d265c92006-09-14 11:53:16 -03005042 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
Linus Torvalds1da177e2005-04-16 15:20:36 -07005043 pcipci_fail = 1;
5044 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
5045 triton1 = 1;
5046 if (pci_pci_problems & PCIPCI_VSFX)
5047 vsfx = 1;
5048#ifdef PCIPCI_ALIMAGIK
5049 if (pci_pci_problems & PCIPCI_ALIMAGIK)
5050 latency = 0x0A;
5051#endif
5052
Linus Torvalds1da177e2005-04-16 15:20:36 -07005053
5054 /* print warnings about any quirks found */
5055 if (triton1)
5056 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
5057 if (vsfx)
5058 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
5059 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005060 printk(KERN_INFO "bttv: bttv and your chipset may not work "
5061 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005062 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005063 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005064 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005065 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005066 printk(KERN_INFO "bttv: overlay forced. Use this "
5067 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005068 }
5069 }
5070 if (UNSET != latency)
5071 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08005072 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005073 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005074 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005075 pci_read_config_byte(dev, 0x53, &b);
5076 if (bttv_debug)
5077 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5078 "bufcon=0x%02x\n",b);
5079 }
5080}
5081
5082int __devinit bttv_handle_chipset(struct bttv *btv)
5083{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005084 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005085
5086 if (!triton1 && !vsfx && UNSET == latency)
5087 return 0;
5088
5089 if (bttv_verbose) {
5090 if (triton1)
5091 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5092 if (vsfx && btv->id >= 878)
5093 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5094 if (UNSET != latency)
5095 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5096 btv->c.nr,latency);
5097 }
5098
5099 if (btv->id < 878) {
5100 /* bt848 (mis)uses a bit in the irq mask for etbf */
5101 if (triton1)
5102 btv->triton1 = BT848_INT_ETBF;
5103 } else {
5104 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005105 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005106 if (triton1)
5107 command |= BT878_EN_TBFX;
5108 if (vsfx)
5109 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005110 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5111 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005112 if (UNSET != latency)
5113 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5114 return 0;
5115}
5116
5117
5118/*
5119 * Local variables:
5120 * c-basic-offset: 8
5121 * End:
5122 */