blob: a5e02005cdae37c0729036a98e7c99cb4c5eb854 [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 "},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316
317 { 0, -1, NULL }
318};
319
320/* ----------------------------------------------------------------------- */
321/* array with description for bt848 / bt878 tv/grabber cards */
322
323struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800324 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800325 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800326 .name = " *** UNKNOWN/GENERIC *** ",
327 .video_inputs = 4,
328 .audio_inputs = 1,
329 .tuner = 0,
330 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200331 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800332 .tuner_type = -1,
333 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800334 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800335 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800336 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800337 .name = "MIRO PCTV",
338 .video_inputs = 4,
339 .audio_inputs = 1,
340 .tuner = 0,
341 .svhs = 2,
342 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200343 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300344 .gpiomux = { 2, 0, 0, 0 },
345 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800346 .needs_tvaudio = 1,
347 .tuner_type = -1,
348 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800349 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800350 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800351 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800352 .name = "Hauppauge (bt848)",
353 .video_inputs = 4,
354 .audio_inputs = 1,
355 .tuner = 0,
356 .svhs = 2,
357 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200358 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300359 .gpiomux = { 0, 1, 2, 3 },
360 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800361 .needs_tvaudio = 1,
362 .tuner_type = -1,
363 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800364 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800365 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800366 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800367 .name = "STB, Gateway P/N 6000699 (bt848)",
368 .video_inputs = 3,
369 .audio_inputs = 1,
370 .tuner = 0,
371 .svhs = 2,
372 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200373 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300374 .gpiomux = { 4, 0, 2, 3 },
375 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800376 .no_msp34xx = 1,
377 .needs_tvaudio = 1,
378 .tuner_type = TUNER_PHILIPS_NTSC,
379 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800380 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800381 .pll = PLL_28,
382 .has_radio = 1,
383 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800385 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800386 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800387 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
388 .video_inputs = 4,
389 .audio_inputs = 0,
390 .tuner = -1,
391 .svhs = 2,
392 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200393 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300394 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800395 .needs_tvaudio = 0,
396 .tuner_type = 4,
397 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800398 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800399 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800400 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800401 .name = "Diamond DTV2000",
402 .video_inputs = 4,
403 .audio_inputs = 1,
404 .tuner = 0,
405 .svhs = 2,
406 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200407 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300408 .gpiomux = { 0, 1, 0, 1 },
409 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800410 .needs_tvaudio = 1,
411 .tuner_type = -1,
412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800414 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800415 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800416 .name = "AVerMedia TVPhone",
417 .video_inputs = 3,
418 .audio_inputs = 1,
419 .tuner = 0,
420 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200421 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800422 .gpiomask = 0x0f,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300423 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800424 /* 0x04 for some cards ?? */
425 .needs_tvaudio = 1,
426 .tuner_type = -1,
427 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800428 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800429 .audio_hook = avermedia_tvphone_audio,
430 .has_remote = 1,
431 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800432 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800433 .name = "MATRIX-Vision MV-Delta",
434 .video_inputs = 5,
435 .audio_inputs = 1,
436 .tuner = -1,
437 .svhs = 3,
438 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200439 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300440 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800441 .needs_tvaudio = 1,
442 .tuner_type = -1,
443 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800444 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800445 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800447 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800448 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800449 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
450 .video_inputs = 4,
451 .audio_inputs = 1,
452 .tuner = 0,
453 .svhs = 2,
454 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200455 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300456 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
457 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800458 .needs_tvaudio = 1,
459 .pll = PLL_28,
460 .tuner_type = -1,
461 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800462 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800463 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800464 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800465 .name = "IMS/IXmicro TurboTV",
466 .video_inputs = 3,
467 .audio_inputs = 1,
468 .tuner = 0,
469 .svhs = 2,
470 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200471 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300472 .gpiomux = { 1, 1, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800473 .needs_tvaudio = 0,
474 .pll = PLL_28,
475 .tuner_type = TUNER_TEMIC_PAL,
476 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800477 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800478 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800479 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800480 .name = "Hauppauge (bt878)",
481 .video_inputs = 4,
482 .audio_inputs = 1,
483 .tuner = 0,
484 .svhs = 2,
485 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200486 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300487 .gpiomux = { 0, 1, 2, 3 },
488 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800489 .needs_tvaudio = 1,
490 .pll = PLL_28,
491 .tuner_type = -1,
492 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800493 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800494 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800495 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800496 .name = "MIRO PCTV pro",
497 .video_inputs = 3,
498 .audio_inputs = 1,
499 .tuner = 0,
500 .svhs = 2,
501 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200502 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300503 .gpiomux = { 0x20001,0x10001, 0, 0 },
504 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800505 .needs_tvaudio = 1,
506 .tuner_type = -1,
507 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800508 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800509 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800511 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800512 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800513 .name = "ADS Technologies Channel Surfer TV (bt848)",
514 .video_inputs = 3,
515 .audio_inputs = 1,
516 .tuner = 0,
517 .svhs = 2,
518 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200519 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300520 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800521 .needs_tvaudio = 1,
522 .tuner_type = -1,
523 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800524 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800525 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800526 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800527 .name = "AVerMedia TVCapture 98",
528 .video_inputs = 3,
529 .audio_inputs = 4,
530 .tuner = 0,
531 .svhs = 2,
532 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200533 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300534 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800535 .needs_tvaudio = 1,
536 .msp34xx_alt = 1,
537 .pll = PLL_28,
538 .tuner_type = TUNER_PHILIPS_PAL,
539 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800540 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800541 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800542 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800543 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800544 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800545 .name = "Aimslab Video Highway Xtreme (VHX)",
546 .video_inputs = 3,
547 .audio_inputs = 1,
548 .tuner = 0,
549 .svhs = 2,
550 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200551 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300552 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
553 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800554 .needs_tvaudio = 1,
555 .pll = PLL_28,
556 .tuner_type = -1,
557 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800558 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800559 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800560 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800561 .name = "Zoltrix TV-Max",
562 .video_inputs = 3,
563 .audio_inputs = 1,
564 .tuner = 0,
565 .svhs = 2,
566 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200567 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300568 .gpiomux = { 0, 0, 1, 0 },
569 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800570 .needs_tvaudio = 1,
571 .tuner_type = -1,
572 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800573 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800574 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800576 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800577 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800578 .name = "Prolink Pixelview PlayTV (bt878)",
579 .video_inputs = 3,
580 .audio_inputs = 1,
581 .tuner = 0,
582 .svhs = 2,
583 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200584 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800585 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300586 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
587 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800588 .needs_tvaudio = 1,
589 .pll = PLL_28,
590 .tuner_type = -1,
591 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800592 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800593 .name = "Leadtek WinView 601",
594 .video_inputs = 3,
595 .audio_inputs = 1,
596 .tuner = 0,
597 .svhs = 2,
598 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200599 .muxsel = { 2, 3, 1, 1,0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300600 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
601 .gpiomute = 0xcfa007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800602 .needs_tvaudio = 1,
603 .tuner_type = -1,
604 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800605 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800606 .audio_hook = winview_audio,
607 .has_radio = 1,
608 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800609 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800610 .name = "AVEC Intercapture",
611 .video_inputs = 3,
612 .audio_inputs = 2,
613 .tuner = 0,
614 .svhs = 2,
615 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200616 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300617 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800618 .needs_tvaudio = 1,
619 .tuner_type = -1,
620 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800621 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800622 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800623 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800624 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
625 .video_inputs = 4,
626 .audio_inputs = 1,
627 .tuner = -1,
628 .svhs = -1,
629 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200630 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300631 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800632 .no_msp34xx = 1,
633 .tuner_type = -1,
634 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800635 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800636 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800638 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800639 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800640 .name = "CEI Raffles Card",
641 .video_inputs = 3,
642 .audio_inputs = 3,
643 .tuner = 0,
644 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200645 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800646 .tuner_type = -1,
647 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800648 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800649 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800650 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800651 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
652 .video_inputs = 4,
653 .audio_inputs = 2, /* tuner, line in */
654 .tuner = 0,
655 .svhs = 2,
656 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200657 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300658 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
659 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800660 .pll = PLL_28,
661 .tuner_type = TUNER_PHILIPS_PAL_I,
662 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800663 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800664 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800665 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800666 .name = "Askey CPH050/ Phoebe Tv Master + FM",
667 .video_inputs = 3,
668 .audio_inputs = 1,
669 .tuner = 0,
670 .svhs = 2,
671 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200672 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300673 .gpiomux = { 0, 1, 0x800, 0x400 },
674 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800675 .needs_tvaudio = 1,
676 .pll = PLL_28,
677 .tuner_type = -1,
678 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800679 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800680 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800681 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800682 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
683 .video_inputs = 3,
684 .audio_inputs = 1,
685 .tuner = 0,
686 .svhs = -1,
687 .gpiomask = 7,
688 .muxsel = { 2, 3, -1 },
689 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300690 .gpiomux = { 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800691 .no_msp34xx = 1,
692 .pll = PLL_28,
693 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
694 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800695 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800696 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800698 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800699 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800700 .name = "Askey CPH05X/06X (bt878) [many vendors]",
701 .video_inputs = 3,
702 .audio_inputs = 1,
703 .tuner = 0,
704 .svhs = 2,
705 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200706 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300707 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
708 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800709 .needs_tvaudio = 1,
710 .pll = PLL_28,
711 .tuner_type = -1,
712 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800713 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800714 .has_remote = 1,
715 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800716 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800717 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
718 .video_inputs = 3,
719 .audio_inputs = 1,
720 .tuner = 0,
721 .svhs = 2,
722 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200723 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300724 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
725 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800726 .needs_tvaudio = 0,
727 .tuner_type = TUNER_PHILIPS_PAL,
728 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800729 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800730 .audio_hook = terratv_audio,
731 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800732 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800733 .name = "Hauppauge WinCam newer (bt878)",
734 .video_inputs = 4,
735 .audio_inputs = 1,
736 .tuner = 0,
737 .svhs = 3,
738 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200739 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300740 .gpiomux = { 0, 1, 2, 3 },
741 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800742 .needs_tvaudio = 1,
743 .tuner_type = -1,
744 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800745 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800746 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800747 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800748 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
749 .video_inputs = 4,
750 .audio_inputs = 2,
751 .tuner = 0,
752 .svhs = 2,
753 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200754 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300755 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
756 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800757 .pll = PLL_28,
758 .tuner_type = TUNER_PHILIPS_SECAM,
759 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800760 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800761 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800763 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800764 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800765 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
766 .video_inputs = 3,
767 .audio_inputs = 1,
768 .tuner = 0,
769 .svhs = 2,
770 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200771 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300772 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
773 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800774 .needs_tvaudio = 0,
775 .tuner_type = TUNER_PHILIPS_PAL,
776 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800777 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800778 .audio_hook = terratv_audio,
779 /* GPIO wiring:
780 External 20 pin connector (for Active Radio Upgrade board)
781 gpio00: i2c-sda
782 gpio01: i2c-scl
783 gpio02: om5610-data
784 gpio03: om5610-clk
785 gpio04: om5610-wre
786 gpio05: om5610-stereo
787 gpio06: rds6588-davn
788 gpio07: Pin 7 n.c.
789 gpio08: nIOW
790 gpio09+10: nIOR, nSEL ?? (bt878)
791 gpio09: nIOR (bt848)
792 gpio10: nSEL (bt848)
793 Sound Routing:
794 gpio16: u2-A0 (1st 4052bt)
795 gpio17: u2-A1
796 gpio18: u2-nEN
797 gpio19: u4-A0 (2nd 4052)
798 gpio20: u4-A1
799 u4-nEN - GND
800 Btspy:
801 00000 : Cdrom (internal audio input)
802 10000 : ext. Video audio input
803 20000 : TV Mono
804 a0000 : TV Mono/2
805 1a0000 : TV Stereo
806 30000 : Radio
807 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700808 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800810 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800811 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800812 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
813 .name = "Imagenation PXC200",
814 .video_inputs = 5,
815 .audio_inputs = 1,
816 .tuner = -1,
817 .svhs = 1, /* was: 4 */
818 .gpiomask = 0,
819 .muxsel = { 2, 3, 1, 0, 0},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300820 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800821 .needs_tvaudio = 1,
822 .tuner_type = -1,
823 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800824 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800825 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800827 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800828 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800829 .name = "Lifeview FlyVideo 98 LR50",
830 .video_inputs = 4,
831 .audio_inputs = 1,
832 .tuner = 0,
833 .svhs = 2,
834 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200835 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300836 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
837 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800838 .pll = PLL_28,
839 .tuner_type = -1,
840 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800841 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800842 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800843 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800844 .name = "Formac iProTV, Formac ProTV I (bt848)",
845 .video_inputs = 4,
846 .audio_inputs = 1,
847 .tuner = 0,
848 .svhs = 3,
849 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200850 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300851 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800852 .pll = PLL_28,
853 .tuner_type = TUNER_PHILIPS_PAL,
854 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800855 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800856 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800858 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800859 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800860 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
861 .video_inputs = 4,
862 .audio_inputs = 0,
863 .tuner = -1,
864 .svhs = 2,
865 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200866 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300867 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800868 .needs_tvaudio = 0,
869 .tuner_type = 4,
870 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800871 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800872 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800873 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800874 .name = "Terratec TerraTValue Version Bt878",
875 .video_inputs = 3,
876 .audio_inputs = 1,
877 .tuner = 0,
878 .svhs = 2,
879 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200880 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300881 .gpiomux = { 0x500, 0, 0x300, 0x900 },
882 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800883 .needs_tvaudio = 1,
884 .pll = PLL_28,
885 .tuner_type = TUNER_PHILIPS_PAL,
886 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800887 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800888 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800889 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800890 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
891 .video_inputs = 4,
892 .audio_inputs = 1,
893 .tuner = 0,
894 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200895 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800896 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
897 .gpiomask = 0xb33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300898 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
899 .gpiomute = 0x800000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800900 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
901 gpio23 -- hef4052:nEnable (0x800000)
902 gpio12 -- hef4052:A1
903 gpio13 -- hef4052:A0
904 0x0000: external audio
905 0x1000: FM
906 0x2000: TV
907 0x3000: n.c.
908 Note: There exists another variant "Winfast 2000" with tv stereo !?
909 Note: eeprom only contains FF and pci subsystem id 107d:6606
910 */
911 .needs_tvaudio = 0,
912 .pll = PLL_28,
913 .has_radio = 1,
914 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
915 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800916 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800917 .audio_hook = winfast2000_audio,
918 .has_remote = 1,
919 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800920 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800921 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
922 .video_inputs = 4,
923 .audio_inputs = 3,
924 .tuner = 0,
925 .svhs = 2,
926 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200927 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300928 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
929 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800930 .pll = PLL_28,
931 .tuner_type = -1,
932 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800933 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800934 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700935
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800936 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800937 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800938 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
939 .video_inputs = 4,
940 .audio_inputs = 3,
941 .tuner = 0,
942 .svhs = 2,
943 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200944 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300945 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
946 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800947 .pll = PLL_28,
948 .tuner_type = -1,
949 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800950 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800951 .has_radio = 1,
952 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800953 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800954 .name = "Prolink PixelView PlayTV pro",
955 .video_inputs = 3,
956 .audio_inputs = 1,
957 .tuner = 0,
958 .svhs = 2,
959 .gpiomask = 0xff,
960 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300961 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
962 .gpiomute = 0x29,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800963 .no_msp34xx = 1,
964 .pll = PLL_28,
965 .tuner_type = -1,
966 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800967 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800968 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800969 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800970 .name = "Askey CPH06X TView99",
971 .video_inputs = 4,
972 .audio_inputs = 1,
973 .tuner = 0,
974 .svhs = 2,
975 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200976 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300977 .gpiomux = { 0x551400, 0x551200, 0, 0 },
978 .gpiomute = 0x551c00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800979 .needs_tvaudio = 1,
980 .pll = PLL_28,
981 .tuner_type = 1,
982 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800983 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800984 .has_remote = 1,
985 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800986 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800987 .name = "Pinnacle PCTV Studio/Rave",
988 .video_inputs = 3,
989 .audio_inputs = 1,
990 .tuner = 0,
991 .svhs = 2,
992 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -0200993 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300994 .gpiomux = { 2, 0xd0001, 0, 0 },
995 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800996 .needs_tvaudio = 0,
997 .pll = PLL_28,
998 .tuner_type = -1,
999 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001000 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001001 },
1002
1003 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001004 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001005 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1006 .video_inputs = 3,
1007 .audio_inputs = 1,
1008 .tuner = 0,
1009 .svhs = 2,
1010 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001011 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001012 .gpiomux = { 4, 0, 2, 3 },
1013 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001014 .no_msp34xx = 1,
1015 .needs_tvaudio = 1,
1016 .tuner_type = TUNER_PHILIPS_NTSC,
1017 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001018 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001019 .pll = PLL_28,
1020 .has_radio = 1,
1021 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001022 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001023 .name = "AVerMedia TVPhone 98",
1024 .video_inputs = 3,
1025 .audio_inputs = 4,
1026 .tuner = 0,
1027 .svhs = 2,
1028 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001029 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001030 .gpiomux = { 13, 4, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001031 .needs_tvaudio = 1,
1032 .pll = PLL_28,
1033 .tuner_type = -1,
1034 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001035 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001036 .has_radio = 1,
1037 .audio_hook = avermedia_tvphone_audio,
1038 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001039 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001040 .name = "ProVideo PV951", /* pic16c54 */
1041 .video_inputs = 3,
1042 .audio_inputs = 1,
1043 .tuner = 0,
1044 .svhs = 2,
1045 .gpiomask = 0,
1046 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001047 .gpiomux = { 0, 0, 0, 0},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001048 .needs_tvaudio = 1,
1049 .no_msp34xx = 1,
1050 .pll = PLL_28,
1051 .tuner_type = 1,
1052 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001053 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001054 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001055 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001056 .name = "Little OnAir TV",
1057 .video_inputs = 3,
1058 .audio_inputs = 1,
1059 .tuner = 0,
1060 .svhs = 2,
1061 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001062 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001063 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1064 .gpiomute = 0xff3ffc,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001065 .no_msp34xx = 1,
1066 .tuner_type = -1,
1067 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001068 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001069 },
1070
1071 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001072 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001073 .name = "Sigma TVII-FM",
1074 .video_inputs = 2,
1075 .audio_inputs = 1,
1076 .tuner = 0,
1077 .svhs = -1,
1078 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001079 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001080 .gpiomux = { 1, 1, 0, 2 },
1081 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001082 .no_msp34xx = 1,
1083 .pll = PLL_NONE,
1084 .tuner_type = -1,
1085 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001086 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001087 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001088 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001089 .name = "MATRIX-Vision MV-Delta 2",
1090 .video_inputs = 5,
1091 .audio_inputs = 1,
1092 .tuner = -1,
1093 .svhs = 3,
1094 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001095 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001096 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001097 .no_msp34xx = 1,
1098 .pll = PLL_28,
1099 .tuner_type = -1,
1100 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001101 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001102 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001103 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001104 .name = "Zoltrix Genie TV/FM",
1105 .video_inputs = 3,
1106 .audio_inputs = 1,
1107 .tuner = 0,
1108 .svhs = 2,
1109 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001110 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001111 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1112 .gpiomute = 0xbcb03f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001113 .no_msp34xx = 1,
1114 .pll = PLL_28,
1115 .tuner_type = 21,
1116 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001117 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001118 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001119 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001120 .name = "Terratec TV/Radio+",
1121 .video_inputs = 3,
1122 .audio_inputs = 1,
1123 .tuner = 0,
1124 .svhs = 2,
1125 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001126 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001127 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1128 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001129 .needs_tvaudio = 1,
1130 .no_msp34xx = 1,
1131 .pll = PLL_35,
1132 .tuner_type = 1,
1133 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001134 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001135 .has_radio = 1,
1136 },
1137
1138 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001139 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001140 .name = "Askey CPH03x/ Dynalink Magic TView",
1141 .video_inputs = 3,
1142 .audio_inputs = 1,
1143 .tuner = 0,
1144 .svhs = 2,
1145 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001146 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001147 .gpiomux = {2,0,0,0 },
1148 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001149 .needs_tvaudio = 1,
1150 .pll = PLL_28,
1151 .tuner_type = -1,
1152 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001153 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001154 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001155 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001156 .name = "IODATA GV-BCTV3/PCI",
1157 .video_inputs = 3,
1158 .audio_inputs = 1,
1159 .tuner = 0,
1160 .svhs = 2,
1161 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001162 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001163 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001164 .no_msp34xx = 1,
1165 .pll = PLL_28,
1166 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1167 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001168 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001169 .audio_hook = gvbctv3pci_audio,
1170 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001171 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001172 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1173 .video_inputs = 5,
1174 .audio_inputs = 1,
1175 .tuner = 0,
1176 .svhs = 3,
1177 .gpiomask = 0xAA0000,
1178 .muxsel = { 2,3,1,1,-1 },
1179 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001180 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1181 .gpiomute = 0xa8000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001182 .no_msp34xx = 1,
1183 .pll = PLL_28,
1184 .tuner_type = TUNER_PHILIPS_PAL_I,
1185 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001186 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001187 .has_remote = 1,
1188 /* GPIO wiring: (different from Rev.4C !)
1189 GPIO17: U4.A0 (first hef4052bt)
1190 GPIO19: U4.A1
1191 GPIO20: U5.A1 (second hef4052bt)
1192 GPIO21: U4.nEN
1193 GPIO22: BT832 Reset Line
1194 GPIO23: A5,A0, U5,nEN
1195 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1196 */
1197 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001198 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001199 .name = "Eagle Wireless Capricorn2 (bt878A)",
1200 .video_inputs = 4,
1201 .audio_inputs = 1,
1202 .tuner = 0,
1203 .svhs = 2,
1204 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001205 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001206 .gpiomux = { 0, 1, 2, 3 },
1207 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001208 .pll = PLL_28,
1209 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1210 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001211 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001212 },
1213
1214 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001215 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001216 /* David Härdeman <david@2gen.com> */
1217 .name = "Pinnacle PCTV Studio Pro",
1218 .video_inputs = 4,
1219 .audio_inputs = 1,
1220 .tuner = 0,
1221 .svhs = 3,
1222 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001223 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001224 .gpiomux = { 1, 0xd0001, 0, 0 },
1225 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001226 /* sound path (5 sources):
1227 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1228 0= ext. Audio IN
1229 1= from MUX2
1230 2= Mono TV sound from Tuner
1231 3= not connected
1232 MUX2 (mask 0x30000):
1233 0,2,3= from MSP34xx
1234 1= FM stereo Radio from Tuner */
1235 .needs_tvaudio = 0,
1236 .pll = PLL_28,
1237 .tuner_type = -1,
1238 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001239 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001240 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001241 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001242 /* Claas Langbehn <claas@bigfoot.com>,
1243 Sven Grothklags <sven@upb.de> */
1244 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1245 .video_inputs = 4,
1246 .audio_inputs = 3,
1247 .tuner = 0,
1248 .svhs = 2,
1249 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001250 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001251 .gpiomux = { 0, 0, 0x10, 8 },
1252 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001253 .needs_tvaudio = 1,
1254 .pll = PLL_28,
1255 .tuner_type = TUNER_PHILIPS_PAL,
1256 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001257 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001258 .has_radio = 1,
1259 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001260 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001261 /* Tim Röstermundt <rosterm@uni-muenster.de>
1262 in de.comp.os.unix.linux.hardware:
1263 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001264 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001265 options tuner type=5 */
1266 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1267 .video_inputs = 4,
1268 .audio_inputs = 1,
1269 .tuner = 0,
1270 .svhs = 2,
1271 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001272 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001273 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1274 .gpiomute = 0x18e0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001275 /* For cards with tda9820/tda9821:
1276 0x0000: Tuner normal stereo
1277 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1278 0x0880: Tuner A2 stereo */
1279 .pll = PLL_28,
1280 .tuner_type = -1,
1281 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001282 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001283 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001284 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001285 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1286 old Easy TV BT848 version (model CPH031) */
1287 .name = "Askey CPH031/ BESTBUY Easy TV",
1288 .video_inputs = 4,
1289 .audio_inputs = 1,
1290 .tuner = 0,
1291 .svhs = 2,
1292 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001293 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001294 .gpiomux = { 2, 0, 0, 0 },
1295 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001296 .needs_tvaudio = 0,
1297 .pll = PLL_28,
1298 .tuner_type = TUNER_TEMIC_PAL,
1299 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001300 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001301 },
1302
1303 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001304 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001305 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1306 .name = "Lifeview FlyVideo 98FM LR50",
1307 .video_inputs = 4,
1308 .audio_inputs = 3,
1309 .tuner = 0,
1310 .svhs = 2,
1311 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001312 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001313 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1314 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001315 .pll = PLL_28,
1316 .tuner_type = 5,
1317 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001318 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001319 },
1320 /* This is the ultimate cheapo capture card
1321 * just a BT848A on a small PCB!
1322 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001323 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001324 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1325 .video_inputs = 2,
1326 .audio_inputs = 0,
1327 .tuner = -1,
1328 .svhs = 1,
1329 .gpiomask = 0,
1330 .muxsel = { 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001331 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001332 .needs_tvaudio = 0,
1333 .no_msp34xx = 1,
1334 .pll = PLL_35,
1335 .tuner_type = -1,
1336 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001337 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001338 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001339 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001340 /* Daniel Herrington <daniel.herrington@home.com> */
1341 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1342 .video_inputs = 3,
1343 .audio_inputs = 1,
1344 .tuner = 0,
1345 .svhs = 2,
1346 .gpiomask = 0xe00,
1347 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001348 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1349 .gpiomute = 0x800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001350 .needs_tvaudio = 1,
1351 .pll = PLL_28,
1352 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1353 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001354 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001355 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001356 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001357 /* Matti Mottus <mottus@physic.ut.ee> */
1358 .name = "Askey CPH03x TV Capturer",
1359 .video_inputs = 4,
1360 .audio_inputs = 1,
1361 .tuner = 0,
1362 .svhs = 2,
1363 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001364 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001365 .gpiomux = { 2, 0, 0, 0 },
1366 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001367 .pll = PLL_28,
1368 .tuner_type = 0,
1369 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001370 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001371 },
1372
1373 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001374 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001375 /* Philip Blundell <philb@gnu.org> */
1376 .name = "Modular Technology MM100PCTV",
1377 .video_inputs = 2,
1378 .audio_inputs = 2,
1379 .tuner = 0,
1380 .svhs = -1,
1381 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001382 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001383 .gpiomux = { 2, 0, 0, 1 },
1384 .gpiomute = 8,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001385 .pll = PLL_35,
1386 .tuner_type = TUNER_TEMIC_PAL,
1387 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001388 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001389 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001390 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001391 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001392 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001393 .video_inputs = 2,
1394 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001395 .tuner = -1,
1396 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001397 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001398 .muxsel = { 2, 2 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001399 .gpiomux = { },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001400 .no_msp34xx = 1,
1401 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001402 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001403 .tuner_type = -1,
1404 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001405 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001406 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001407 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001408 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1409 new Easy TV BT878 version (model CPH061)
1410 special thanks to Informatica Mieres for providing the card */
1411 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1412 .video_inputs = 3,
1413 .audio_inputs = 2,
1414 .tuner = 0,
1415 .svhs = 2,
1416 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001417 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001418 .gpiomux = { 1, 0, 4, 4 },
1419 .gpiomute = 9,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001420 .needs_tvaudio = 0,
1421 .pll = PLL_28,
1422 .tuner_type = TUNER_PHILIPS_PAL,
1423 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001424 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001425 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001426 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001427 /* Lukas Gebauer <geby@volny.cz> */
1428 .name = "ATI TV-Wonder",
1429 .video_inputs = 3,
1430 .audio_inputs = 1,
1431 .tuner = 0,
1432 .svhs = 2,
1433 .gpiomask = 0xf03f,
1434 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001435 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1436 .gpiomute = 0xbffe,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001437 .pll = PLL_28,
1438 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1439 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001440 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001441 },
1442
1443 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001444 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001445 /* Lukas Gebauer <geby@volny.cz> */
1446 .name = "ATI TV-Wonder VE",
1447 .video_inputs = 2,
1448 .audio_inputs = 1,
1449 .tuner = 0,
1450 .svhs = -1,
1451 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001452 .muxsel = { 2, 3, 0, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001453 .gpiomux = { 0, 0, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001454 .no_msp34xx = 1,
1455 .pll = PLL_28,
1456 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1457 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001458 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001459 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001460 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001461 /* DeeJay <deejay@westel900.net (2000S) */
1462 .name = "Lifeview FlyVideo 2000S LR90",
1463 .video_inputs = 3,
1464 .audio_inputs = 3,
1465 .tuner = 0,
1466 .svhs = 2,
1467 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001468 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001469 /* Radio changed from 1e80 to 0x800 to make
1470 FlyVideo2000S in .hu happy (gm)*/
1471 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001472 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1473 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001474 .audio_hook = fv2000s_audio,
1475 .no_msp34xx = 1,
1476 .no_tda9875 = 1,
1477 .needs_tvaudio = 1,
1478 .pll = PLL_28,
1479 .tuner_type = 5,
1480 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001481 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001482 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001483 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001484 .name = "Terratec TValueRadio",
1485 .video_inputs = 3,
1486 .audio_inputs = 1,
1487 .tuner = 0,
1488 .svhs = 2,
1489 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001490 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001491 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1492 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001493 .needs_tvaudio = 1,
1494 .pll = PLL_28,
1495 .tuner_type = TUNER_PHILIPS_PAL,
1496 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001497 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001498 .has_radio = 1,
1499 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001500 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001501 /* TANAKA Kei <peg00625@nifty.com> */
1502 .name = "IODATA GV-BCTV4/PCI",
1503 .video_inputs = 3,
1504 .audio_inputs = 1,
1505 .tuner = 0,
1506 .svhs = 2,
1507 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001508 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001509 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001510 .no_msp34xx = 1,
1511 .pll = PLL_28,
1512 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1513 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001514 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001515 .audio_hook = gvbctv3pci_audio,
1516 },
1517
1518 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001519 [BTTV_BOARD_VOODOOTV_FM] = {
Wade Berrier434b2522007-06-25 13:02:16 -03001520 .name = "3Dfx VoodooTV FM (Euro)",
1521 /* try "insmod msp3400 simple=0" if you have
1522 * sound problems with this card. */
1523 .video_inputs = 4,
1524 .audio_inputs = 1,
1525 .tuner = 0,
1526 .svhs = -1,
1527 .gpiomask = 0x4f8a00,
1528 /* 0x100000: 1=MSP enabled (0=disable again)
1529 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1530 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1531 .gpiomute = 0x947fff,
1532 /* tvtuner, radio, external,internal, mute, stereo
1533 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1534 .muxsel = { 2, 3 ,0 ,1 },
1535 .tuner_type = TUNER_MT2032,
1536 .tuner_addr = ADDR_UNSET,
1537 .radio_addr = ADDR_UNSET,
1538 .pll = PLL_28,
1539 .has_radio = 1,
1540 },
1541 [BTTV_BOARD_VOODOOTV_200] = {
1542 .name = "VoodooTV 200 (USA)",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001543 /* try "insmod msp3400 simple=0" if you have
1544 * sound problems with this card. */
1545 .video_inputs = 4,
1546 .audio_inputs = 1,
1547 .tuner = 0,
1548 .svhs = -1,
1549 .gpiomask = 0x4f8a00,
1550 /* 0x100000: 1=MSP enabled (0=disable again)
1551 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001552 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1553 .gpiomute = 0x947fff,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001554 /* tvtuner, radio, external,internal, mute, stereo
1555 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001556 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001557 .tuner_type = TUNER_MT2032,
1558 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001559 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001560 .pll = PLL_28,
1561 .has_radio = 1,
1562 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001563 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001564 /* Philip Blundell <pb@nexus.co.uk> */
1565 .name = "Active Imaging AIMMS",
1566 .video_inputs = 1,
1567 .audio_inputs = 0,
1568 .tuner = -1,
1569 .tuner_type = -1,
1570 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001571 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001572 .pll = PLL_28,
1573 .muxsel = { 2 },
1574 .gpiomask = 0
1575 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001576 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001577 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1578 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1579 .video_inputs = 3,
1580 .audio_inputs = 4,
1581 .tuner = 0,
1582 .svhs = 2,
1583 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001584 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001585 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1586 .gpiomute = 13,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001587 .needs_tvaudio = 1,
1588 .pll = PLL_28,
1589 .tuner_type = 25,
1590 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001591 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001592 .has_remote = 1,
1593 /* GPIO wiring:
1594 GPIO0: U4.A0 (hef4052bt)
1595 GPIO1: U4.A1
1596 GPIO2: U4.A1 (second hef4052bt)
1597 GPIO3: U4.nEN, U5.A0, A5.nEN
1598 GPIO8-15: vrd866b ?
1599 */
1600 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001601 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001602 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1603 .video_inputs = 4,
1604 .audio_inputs = 0,
1605 .tuner = -1,
1606 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001607 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001608 .pll = PLL_28,
1609 .no_msp34xx = 1,
1610 .tuner_type = UNSET,
1611 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001612 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001613 },
1614
1615 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001616 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001617 /* Dariusz Kowalewski <darekk@automex.pl> */
1618 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1619 .video_inputs = 4,
1620 .audio_inputs = 1,
1621 .tuner = 0,
1622 .svhs = 2,
1623 .gpiomask = 0x3f,
1624 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001625 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1626 .gpiomute = 0x09,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001627 .needs_tvaudio = 1,
1628 .no_msp34xx = 1,
1629 .no_tda9875 = 1,
1630 .pll = PLL_28,
1631 .tuner_type = 5,
1632 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001633 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001634 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1635 .has_radio = 1, /* Note: not all cards have radio */
1636 .has_remote = 1,
1637 /* GPIO wiring:
1638 GPIO0: A0 hef4052
1639 GPIO1: A1 hef4052
1640 GPIO3: nEN hef4052
1641 GPIO8-15: vrd866b
1642 GPIO20,22,23: R30,R29,R28
1643 */
1644 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001645 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001646 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1647 /* you must jumper JP5 for the card to work */
1648 .name = "Sensoray 311",
1649 .video_inputs = 5,
1650 .audio_inputs = 0,
1651 .tuner = -1,
1652 .svhs = 4,
1653 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001654 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001655 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001656 .needs_tvaudio = 0,
1657 .tuner_type = -1,
1658 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001659 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001660 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001661 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001662 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1663 .name = "RemoteVision MX (RV605)",
1664 .video_inputs = 16,
1665 .audio_inputs = 0,
1666 .tuner = -1,
1667 .svhs = -1,
1668 .gpiomask = 0x00,
1669 .gpiomask2 = 0x07ff,
1670 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1671 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1672 .no_msp34xx = 1,
1673 .no_tda9875 = 1,
1674 .tuner_type = -1,
1675 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001676 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001677 .muxsel_hook = rv605_muxsel,
1678 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001679 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001680 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1681 .video_inputs = 3,
1682 .audio_inputs = 2,
1683 .tuner = 0,
1684 .svhs = 2,
1685 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1686 .muxsel = { 2, 1, 1, },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001687 .gpiomux = { 0, 1, 2, 2 },
1688 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001689 .needs_tvaudio = 0,
1690 .tuner_type = TUNER_PHILIPS_PAL,
1691 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001692 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001693 .pll = PLL_28,
1694 .has_radio = 1,
1695 },
1696
1697 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001698 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001699 /* Masaki Suzuki <masaki@btree.org> */
1700 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1701 .video_inputs = 3,
1702 .audio_inputs = 1,
1703 .tuner = 0,
1704 .svhs = 2,
1705 .gpiomask = 0x140007,
1706 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001707 .gpiomux = { 0, 1, 2, 3 },
1708 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001709 .tuner_type = TUNER_PHILIPS_NTSC,
1710 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001711 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001712 .audio_hook = windvr_audio,
1713 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001714 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001715 .name = "GrandTec Multi Capture Card (Bt878)",
1716 .video_inputs = 4,
1717 .audio_inputs = 0,
1718 .tuner = -1,
1719 .svhs = -1,
1720 .gpiomask = 0,
1721 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001722 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001723 .needs_tvaudio = 0,
1724 .no_msp34xx = 1,
1725 .pll = PLL_28,
1726 .tuner_type = -1,
1727 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001728 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001729 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001730 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001731 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1732 .video_inputs = 4,
1733 .audio_inputs = 3,
1734 .tuner = 0,
1735 .svhs = 2,
1736 .gpiomask = 7,
1737 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001738 .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 -08001739 * This card lacks external Audio In, so we mute it on Ext. & Int.
1740 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1741 * This card lacks PCI subsystem ID, sigh.
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001742 * gpiomux =1: lower volume, 2+3: mute
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001743 * btwincap uses 0x80000/0x80003
1744 */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001745 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001746 .needs_tvaudio = 0,
1747 .no_msp34xx = 1,
1748 .pll = PLL_28,
1749 .tuner_type = 5,
1750 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001751 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001752 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1753 radio signal strength indicators work fine. */
1754 .has_radio = 1,
1755 /* GPIO Info:
1756 GPIO0,1: HEF4052 A0,A1
1757 GPIO2: HEF4052 nENABLE
1758 GPIO3-7: n.c.
1759 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1760 GPIO14,15: ??
1761 GPIO16-21: n.c.
1762 GPIO22,23: ??
1763 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1764 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001765 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001766 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1767 .name = "DSP Design TCVIDEO",
1768 .video_inputs = 4,
1769 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001770 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001771 .pll = PLL_28,
1772 .tuner_type = -1,
1773 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001774 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001775 },
1776
1777 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001778 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001779 .name = "Hauppauge WinTV PVR",
1780 .video_inputs = 4,
1781 .audio_inputs = 1,
1782 .tuner = 0,
1783 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001784 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001785 .needs_tvaudio = 1,
1786 .pll = PLL_28,
1787 .tuner_type = -1,
1788 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001789 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001790
1791 .gpiomask = 7,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001792 .gpiomux = {7},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001793 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001794 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001795 .name = "IODATA GV-BCTV5/PCI",
1796 .video_inputs = 3,
1797 .audio_inputs = 1,
1798 .tuner = 0,
1799 .svhs = 2,
1800 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001801 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001802 .gpiomux = {0x030000, 0x010000, 0, 0 },
1803 .gpiomute = 0x020000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001804 .no_msp34xx = 1,
1805 .pll = PLL_28,
1806 .tuner_type = TUNER_PHILIPS_NTSC_M,
1807 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001808 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001809 .audio_hook = gvbctv5pci_audio,
1810 .has_radio = 1,
1811 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001812 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001813 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1814 .video_inputs = 4, /* id-inputs-clock */
1815 .audio_inputs = 0,
1816 .tuner = -1,
1817 .svhs = 3,
1818 .muxsel = { 3, 2, 0, 1 },
1819 .pll = PLL_28,
1820 .tuner_type = -1,
1821 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001822 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001823 .no_msp34xx = 1,
1824 .no_tda9875 = 1,
1825 .no_tda7432 = 1,
1826 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001827 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001828 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1829 .video_inputs = 3,
1830 .audio_inputs = 0,
1831 .tuner = -1,
1832 .svhs = 2,
1833 .muxsel = { 2, 3, 1 },
1834 .pll = PLL_28,
1835 .tuner_type = -1,
1836 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001837 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001838 .no_msp34xx = 1,
1839 .no_tda9875 = 1,
1840 .no_tda7432 = 1,
1841 },
1842
1843 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001844 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001845 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1846 .video_inputs = 2,
1847 .audio_inputs = 0,
1848 .tuner = -1,
1849 .svhs = 1,
1850 .muxsel = { 3, 1 },
1851 .pll = PLL_28,
1852 .tuner_type = -1,
1853 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001854 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001855 .no_msp34xx = 1,
1856 .no_tda9875 = 1,
1857 .no_tda7432 = 1,
1858 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001859 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001860 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1861 .video_inputs = 1,
1862 .audio_inputs = 0,
1863 .tuner = -1,
1864 .svhs = -1,
1865 .muxsel = { 0 },
1866 .pll = PLL_28,
1867 .tuner_type = -1,
1868 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001869 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001870 .no_msp34xx = 1,
1871 .no_tda9875 = 1,
1872 .no_tda7432 = 1,
1873 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001874 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001875 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1876 .video_inputs = 2,
1877 .audio_inputs = 0,
1878 .tuner = -1,
1879 .svhs = 1,
1880 .muxsel = { 0, 1 },
1881 .pll = PLL_28,
1882 .tuner_type = -1,
1883 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001884 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001885 .no_msp34xx = 1,
1886 .no_tda9875 = 1,
1887 .no_tda7432 = 1,
1888 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001889 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001890 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1891 .video_inputs = 1,
1892 .audio_inputs = 1,
1893 .tuner = -1,
1894 .svhs = -1,
1895 .muxsel = { 0 },
1896 .pll = PLL_28,
1897 .tuner_type = UNSET,
1898 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001899 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001900 .no_msp34xx = 1,
1901 .no_tda9875 = 1,
1902 .no_tda7432 = 1,
1903 },
1904
1905 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001906 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001907 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1908 .video_inputs = 2,
1909 .audio_inputs = 1,
1910 .tuner = -1,
1911 .svhs = 1,
1912 .muxsel = { 0, 1 },
1913 .pll = PLL_28,
1914 .tuner_type = UNSET,
1915 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001916 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001917 .no_msp34xx = 1,
1918 .no_tda9875 = 1,
1919 .no_tda7432 = 1,
1920 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001921 [BTTV_BOARD_OSPREY2x0] = {
Michael Krufky52398ef2006-05-26 02:13:15 -03001922 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001923 .video_inputs = 2,
1924 .audio_inputs = 1,
1925 .tuner = -1,
1926 .svhs = 1,
1927 .muxsel = { 2, 3 },
1928 .pll = PLL_28,
1929 .tuner_type = UNSET,
1930 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001931 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001932 .no_msp34xx = 1,
1933 .no_tda9875 = 1,
1934 .no_tda7432 = 1,
1935 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001936 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001937 .name = "Osprey 500", /* 500 */
1938 .video_inputs = 2,
1939 .audio_inputs = 1,
1940 .tuner = -1,
1941 .svhs = 1,
1942 .muxsel = { 2, 3 },
1943 .pll = PLL_28,
1944 .tuner_type = -1,
1945 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001946 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001947 .no_msp34xx = 1,
1948 .no_tda9875 = 1,
1949 .no_tda7432 = 1,
1950 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001951 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001952 .name = "Osprey 540", /* 540 */
1953 .video_inputs = 4,
1954 .audio_inputs = 1,
1955 .tuner = -1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001956 .pll = PLL_28,
1957 .tuner_type = -1,
1958 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001959 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001960 .no_msp34xx = 1,
1961 .no_tda9875 = 1,
1962 .no_tda7432 = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001963 },
1964
1965 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001966 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001967 .name = "Osprey 2000", /* 2000 */
1968 .video_inputs = 2,
1969 .audio_inputs = 1,
1970 .tuner = -1,
1971 .svhs = 1,
1972 .muxsel = { 2, 3 },
1973 .pll = PLL_28,
1974 .tuner_type = UNSET,
1975 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001976 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001977 .no_msp34xx = 1,
1978 .no_tda9875 = 1,
1979 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1980 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001981 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001982 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1983 .name = "IDS Eagle",
1984 .video_inputs = 4,
1985 .audio_inputs = 0,
1986 .tuner = -1,
1987 .tuner_type = -1,
1988 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001989 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001990 .svhs = -1,
1991 .gpiomask = 0,
1992 .muxsel = { 0, 1, 2, 3 },
1993 .muxsel_hook = eagle_muxsel,
1994 .no_msp34xx = 1,
1995 .no_tda9875 = 1,
1996 .pll = PLL_28,
1997 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001998 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001999 .name = "Pinnacle PCTV Sat",
2000 .video_inputs = 2,
2001 .audio_inputs = 0,
2002 .svhs = 1,
2003 .tuner = -1,
2004 .tuner_type = -1,
2005 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002006 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002007 .no_msp34xx = 1,
2008 .no_tda9875 = 1,
2009 .no_tda7432 = 1,
Mauro Carvalho Chehabd2be8932006-10-02 23:52:48 -03002010 .muxsel = { 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002011 .pll = PLL_28,
2012 .no_gpioirq = 1,
2013 .has_dvb = 1,
2014 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002015 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002016 .name = "Formac ProTV II (bt878)",
2017 .video_inputs = 4,
2018 .audio_inputs = 1,
2019 .tuner = 0,
2020 .svhs = 3,
2021 .gpiomask = 2,
2022 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02002023 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002024 .gpiomux = { 2, 2, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002025 .pll = PLL_28,
2026 .has_radio = 1,
2027 .tuner_type = TUNER_PHILIPS_PAL,
2028 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002029 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002030 /* sound routing:
2031 GPIO=0x00,0x01,0x03: mute (?)
2032 0x02: both TV and radio (tuner: FM1216/I)
2033 The card has onboard audio connectors labeled "cdrom" and "board",
2034 not soldered here, though unknown wiring.
2035 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002036 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002037 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002038
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002039 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002040 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002041 .name = "MachTV",
2042 .video_inputs = 3,
2043 .audio_inputs = 1,
2044 .tuner = 0,
2045 .svhs = -1,
2046 .gpiomask = 7,
2047 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002048 .gpiomux = { 0, 1, 2, 3},
2049 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002050 .needs_tvaudio = 1,
2051 .tuner_type = 5,
2052 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002053 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08002054 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002055 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002056 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002057 .name = "Euresys Picolo",
2058 .video_inputs = 3,
2059 .audio_inputs = 0,
2060 .tuner = -1,
2061 .svhs = 2,
2062 .gpiomask = 0,
2063 .no_msp34xx = 1,
2064 .no_tda9875 = 1,
2065 .no_tda7432 = 1,
2066 .muxsel = { 2, 0, 1},
2067 .pll = PLL_28,
2068 .tuner_type = UNSET,
2069 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002070 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002071 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002072 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002073 /* Luc Van Hoeylandt <luc@e-magic.be> */
2074 .name = "ProVideo PV150", /* 0x4f */
2075 .video_inputs = 2,
2076 .audio_inputs = 0,
2077 .tuner = -1,
2078 .svhs = -1,
2079 .gpiomask = 0,
2080 .muxsel = { 2, 3 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002081 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002082 .needs_tvaudio = 0,
2083 .no_msp34xx = 1,
2084 .pll = PLL_28,
2085 .tuner_type = UNSET,
2086 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002087 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002088 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002089 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002090 /* Hiroshi Takekawa <sian@big.or.jp> */
2091 /* This card lacks subsystem ID */
2092 .name = "AD-TVK503", /* 0x63 */
2093 .video_inputs = 4,
2094 .audio_inputs = 1,
2095 .tuner = 0,
2096 .svhs = 2,
2097 .gpiomask = 0x001e8007,
2098 .muxsel = { 2, 3, 1, 0 },
2099 /* Tuner, Radio, external, internal, off, on */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002100 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2101 .gpiomute = 0x0f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002102 .needs_tvaudio = 0,
2103 .no_msp34xx = 1,
2104 .pll = PLL_28,
2105 .tuner_type = 2,
2106 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002107 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002108 .audio_hook = adtvk503_audio,
2109 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002110
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002111 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002112 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002113 .name = "Hercules Smart TV Stereo",
2114 .video_inputs = 4,
2115 .audio_inputs = 1,
2116 .tuner = 0,
2117 .svhs = 2,
2118 .gpiomask = 0x00,
2119 .muxsel = { 2, 3, 1, 1 },
2120 .needs_tvaudio = 1,
2121 .no_msp34xx = 1,
2122 .pll = PLL_28,
2123 .tuner_type = 5,
2124 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002125 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002126 /* Notes:
2127 - card lacks subsystem ID
2128 - stereo variant w/ daughter board with tda9874a @0xb0
2129 - Audio Routing:
2130 always from tda9874 independent of GPIO (?)
2131 external line in: unknown
2132 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2133 hef4053 (instead 4052) for unknown function
2134 */
2135 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002136 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002137 .name = "Pace TV & Radio Card",
2138 .video_inputs = 4,
2139 .audio_inputs = 1,
2140 .tuner = 0,
2141 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002142 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002143 .gpiomask = 0,
2144 .no_tda9875 = 1,
2145 .no_tda7432 = 1,
2146 .tuner_type = 1,
2147 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002148 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002149 .has_radio = 1,
2150 .pll = PLL_28,
2151 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2152 only internal line out: (4pin header) RGGL
2153 Radio must be decoded by msp3410d (not routed through)*/
2154 /*
2155 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2156 */
2157 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002158 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002159 /* Chris Willing <chris@vislab.usyd.edu.au> */
2160 .name = "IVC-200",
2161 .video_inputs = 1,
2162 .audio_inputs = 0,
2163 .tuner = -1,
2164 .tuner_type = -1,
2165 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002166 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002167 .svhs = -1,
2168 .gpiomask = 0xdf,
2169 .muxsel = { 2 },
2170 .pll = PLL_28,
2171 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002172 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002173 .name = "Grand X-Guard / Trust 814PCI",
2174 .video_inputs = 16,
2175 .audio_inputs = 0,
2176 .tuner = -1,
2177 .svhs = -1,
2178 .tuner_type = 4,
2179 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002180 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002181 .gpiomask2 = 0xff,
2182 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2183 .muxsel_hook = xguard_muxsel,
2184 .no_msp34xx = 1,
2185 .no_tda9875 = 1,
2186 .no_tda7432 = 1,
2187 .pll = PLL_28,
2188 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002189
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002190 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002191 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002192 .name = "Nebula Electronics DigiTV",
2193 .video_inputs = 1,
2194 .tuner = -1,
2195 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002196 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002197 .no_msp34xx = 1,
2198 .no_tda9875 = 1,
2199 .no_tda7432 = 1,
2200 .pll = PLL_28,
2201 .tuner_type = -1,
2202 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002203 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002204 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002205 .has_remote = 1,
2206 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002207 .no_gpioirq = 1,
2208 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002209 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002210 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2211 .name = "ProVideo PV143",
2212 .video_inputs = 4,
2213 .audio_inputs = 0,
2214 .tuner = -1,
2215 .svhs = -1,
2216 .gpiomask = 0,
2217 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002218 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002219 .needs_tvaudio = 0,
2220 .no_msp34xx = 1,
2221 .pll = PLL_28,
2222 .tuner_type = -1,
2223 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002224 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002225 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002226 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002227 /* M.Klahr@phytec.de */
2228 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2229 .video_inputs = 4,
2230 .audio_inputs = 0,
2231 .tuner = -1, /* card has no tuner */
2232 .svhs = 3,
2233 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002234 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002235 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002236 .needs_tvaudio = 1,
2237 .pll = PLL_28,
2238 .tuner_type = -1,
2239 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002240 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002241 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002242 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002243 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2244 .video_inputs = 4,
2245 .audio_inputs = 0,
2246 .tuner = -1, /* card has no tuner */
2247 .svhs = 3,
2248 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002249 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002250 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002251 .needs_tvaudio = 1,
2252 .pll = PLL_28,
2253 .tuner_type = -1,
2254 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002255 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002256 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002257
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002258 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002259 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002260 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2261 .video_inputs = 10,
2262 .audio_inputs = 0,
2263 .tuner = -1, /* card has no tuner */
2264 .svhs = 9,
2265 .gpiomask = 0x00,
2266 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2267 via the upper nibble of muxsel. here: used for
2268 xternal video-mux */
2269 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002270 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002271 .needs_tvaudio = 1,
2272 .pll = PLL_28,
2273 .tuner_type = -1,
2274 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002275 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002276 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002277 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002278 .name = "PHYTEC VD-009 Combi (bt878)",
2279 .video_inputs = 10,
2280 .audio_inputs = 0,
2281 .tuner = -1, /* card has no tuner */
2282 .svhs = 9,
2283 .gpiomask = 0x00,
2284 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2285 via the upper nibble of muxsel. here: used for
2286 xternal video-mux */
2287 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002288 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002289 .needs_tvaudio = 1,
2290 .pll = PLL_28,
2291 .tuner_type = -1,
2292 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002293 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002294 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002295 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002296 .name = "IVC-100",
2297 .video_inputs = 4,
2298 .audio_inputs = 0,
2299 .tuner = -1,
2300 .tuner_type = -1,
2301 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002302 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002303 .svhs = -1,
2304 .gpiomask = 0xdf,
2305 .muxsel = { 2, 3, 1, 0 },
2306 .pll = PLL_28,
2307 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002308 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002309 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2310 .name = "IVC-120G",
2311 .video_inputs = 16,
2312 .audio_inputs = 0, /* card has no audio */
2313 .tuner = -1, /* card has no tuner */
2314 .tuner_type = -1,
2315 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002316 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002317 .svhs = -1, /* card has no svhs */
2318 .needs_tvaudio = 0,
2319 .no_msp34xx = 1,
2320 .no_tda9875 = 1,
2321 .no_tda7432 = 1,
2322 .gpiomask = 0x00,
2323 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2324 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2325 .muxsel_hook = ivc120_muxsel,
2326 .pll = PLL_28,
2327 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002328
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002329 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002330 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002331 .name = "pcHDTV HD-2000 TV",
2332 .video_inputs = 4,
2333 .audio_inputs = 1,
2334 .tuner = 0,
2335 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002336 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002337 .tuner_type = TUNER_PHILIPS_ATSC,
2338 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002339 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002340 .has_dvb = 1,
2341 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002342 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002343 .name = "Twinhan DST + clones",
2344 .no_msp34xx = 1,
2345 .no_tda9875 = 1,
2346 .no_tda7432 = 1,
2347 .tuner_type = TUNER_ABSENT,
2348 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002349 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002350 .no_video = 1,
2351 .has_dvb = 1,
2352 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002353 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002354 .name = "Winfast VC100",
2355 .video_inputs = 3,
2356 .audio_inputs = 0,
2357 .svhs = 1,
2358 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002359 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002360 .no_msp34xx = 1,
2361 .no_tda9875 = 1,
2362 .no_tda7432 = 1,
2363 .tuner_type = TUNER_ABSENT,
2364 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002365 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002366 .pll = PLL_28,
2367 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002368 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002369 .name = "Teppro TEV-560/InterVision IV-560",
2370 .video_inputs = 3,
2371 .audio_inputs = 1,
2372 .tuner = 0,
2373 .svhs = 2,
2374 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002375 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002376 .gpiomux = { 1, 1, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002377 .needs_tvaudio = 1,
2378 .tuner_type = TUNER_PHILIPS_PAL,
2379 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002380 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002381 .pll = PLL_35,
2382 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002383
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002384 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002385 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002386 .name = "SIMUS GVC1100",
2387 .video_inputs = 4,
2388 .audio_inputs = 0,
2389 .tuner = -1,
2390 .svhs = -1,
2391 .tuner_type = -1,
2392 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002393 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002394 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002395 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002396 .gpiomask = 0x3F,
2397 .muxsel_hook = gvc1100_muxsel,
2398 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002399 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002400 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2401 .name = "NGS NGSTV+",
2402 .video_inputs = 3,
2403 .tuner = 0,
2404 .svhs = 2,
2405 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002406 .muxsel = { 2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002407 .gpiomux = { 0, 0, 0, 0 },
2408 .gpiomute = 0x000003,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002409 .pll = PLL_28,
2410 .tuner_type = TUNER_PHILIPS_PAL,
2411 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002412 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002413 .has_remote = 1,
2414 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002415 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002416 /* http://linuxmedialabs.com */
2417 .name = "LMLBT4",
2418 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2419 .audio_inputs = 0,
2420 .tuner = -1,
2421 .svhs = -1,
2422 .muxsel = { 2, 3, 1, 0 },
2423 .no_msp34xx = 1,
2424 .no_tda9875 = 1,
2425 .no_tda7432 = 1,
2426 .needs_tvaudio = 0,
2427 .tuner_type = -1,
2428 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002429 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002430 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002431 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002432 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2433 .name = "Tekram M205 PRO",
2434 .video_inputs = 3,
2435 .audio_inputs = 1,
2436 .tuner = 0,
2437 .tuner_type = TUNER_PHILIPS_PAL,
2438 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002439 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002440 .svhs = 2,
2441 .needs_tvaudio = 0,
2442 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002443 .muxsel = { 2, 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002444 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002445 .pll = PLL_28,
2446 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002447
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002448 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002449 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002450 /* Javier Cendan Ares <jcendan@lycos.es> */
2451 /* bt878 TV + FM without subsystem ID */
2452 .name = "Conceptronic CONTVFMi",
2453 .video_inputs = 3,
2454 .audio_inputs = 1,
2455 .tuner = 0,
2456 .svhs = 2,
2457 .gpiomask = 0x008007,
2458 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002459 .gpiomux = { 0, 1, 2, 2 },
2460 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002461 .needs_tvaudio = 0,
2462 .pll = PLL_28,
2463 .tuner_type = TUNER_PHILIPS_PAL,
2464 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002465 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002466 .has_remote = 1,
2467 .has_radio = 1,
2468 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002469 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002470 /*Eric DEBIEF <debief@telemsa.com>*/
2471 /*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 -08002472 /* 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 -08002473 /*0x79 in bttv.h*/
2474 .name = "Euresys Picolo Tetra",
2475 .video_inputs = 4,
2476 .audio_inputs = 0,
2477 .tuner = -1,
2478 .svhs = -1,
2479 .gpiomask = 0,
2480 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2481 .no_msp34xx = 1,
2482 .no_tda9875 = 1,
2483 .no_tda7432 = 1,
2484 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002485 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002486 .pll = PLL_28,
2487 .needs_tvaudio = 0,
2488 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2489 .tuner_type = -1,
2490 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002491 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002492 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002493 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002494 /* Spirit TV Tuner from http://spiritmodems.com.au */
2495 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2496 .name = "Spirit TV Tuner",
2497 .video_inputs = 3,
2498 .audio_inputs = 1,
2499 .tuner = 0,
2500 .svhs = 2,
2501 .gpiomask = 0x0000000f,
2502 .muxsel = { 2, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002503 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002504 .tuner_type = TUNER_TEMIC_PAL,
2505 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002506 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002507 .no_msp34xx = 1,
2508 .no_tda9875 = 1,
2509 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002510 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002511 /* Wolfram Joost <wojo@frokaschwei.de> */
2512 .name = "AVerMedia AVerTV DVB-T 771",
2513 .video_inputs = 2,
2514 .svhs = 1,
2515 .tuner = -1,
2516 .tuner_type = TUNER_ABSENT,
2517 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002518 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002519 .muxsel = { 3 , 3 },
2520 .no_msp34xx = 1,
2521 .no_tda9875 = 1,
2522 .no_tda7432 = 1,
2523 .pll = PLL_28,
2524 .has_dvb = 1,
2525 .no_gpioirq = 1,
2526 .has_remote = 1,
2527 },
2528 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002529 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002530 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002531 /* 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 -08002532 .name = "AverMedia AverTV DVB-T 761",
2533 .video_inputs = 2,
2534 .tuner = -1,
2535 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002536 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002537 .no_msp34xx = 1,
2538 .no_tda9875 = 1,
2539 .no_tda7432 = 1,
2540 .pll = PLL_28,
2541 .tuner_type = -1,
2542 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002543 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002544 .has_dvb = 1,
2545 .no_gpioirq = 1,
2546 .has_remote = 1,
2547 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002548 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002549 /* andre.schwarz@matrix-vision.de */
2550 .name = "MATRIX Vision Sigma-SQ",
2551 .video_inputs = 16,
2552 .audio_inputs = 0,
2553 .tuner = -1,
2554 .svhs = -1,
2555 .gpiomask = 0x0,
2556 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2557 3, 3, 3, 3, 3, 3, 3, 3 },
2558 .muxsel_hook = sigmaSQ_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002559 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002560 .no_msp34xx = 1,
2561 .pll = PLL_28,
2562 .tuner_type = -1,
2563 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002564 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002565 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002566 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002567 /* andre.schwarz@matrix-vision.de */
2568 .name = "MATRIX Vision Sigma-SLC",
2569 .video_inputs = 4,
2570 .audio_inputs = 0,
2571 .tuner = -1,
2572 .svhs = -1,
2573 .gpiomask = 0x0,
2574 .muxsel = { 2, 2, 2, 2 },
2575 .muxsel_hook = sigmaSLC_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002576 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002577 .no_msp34xx = 1,
2578 .pll = PLL_28,
2579 .tuner_type = -1,
2580 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002581 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002582 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002583 /* BTTV_BOARD_APAC_VIEWCOMP */
2584 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002585 /* Attila Kondoros <attila.kondoros@chello.hu> */
2586 /* bt878 TV + FM 0x00000000 subsystem ID */
2587 .name = "APAC Viewcomp 878(AMAX)",
2588 .video_inputs = 2,
2589 .audio_inputs = 1,
2590 .tuner = 0,
2591 .svhs = -1,
2592 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002593 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002594 .gpiomux = { 2, 0, 0, 0 },
2595 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002596 .needs_tvaudio = 0,
2597 .pll = PLL_28,
2598 .tuner_type = TUNER_PHILIPS_PAL,
2599 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002600 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002601 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2602 .has_radio = 1, /* not every card has radio */
2603 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002604
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002605 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002606 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002607 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2608 .name = "DViCO FusionHDTV DVB-T Lite",
2609 .tuner = -1,
2610 .no_msp34xx = 1,
2611 .no_tda9875 = 1,
2612 .no_tda7432 = 1,
2613 .pll = PLL_28,
2614 .no_video = 1,
2615 .has_dvb = 1,
2616 .tuner_type = -1,
2617 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002618 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002619 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002620 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002621 /* Steven <photon38@pchome.com.tw> */
2622 .name = "V-Gear MyVCD",
2623 .video_inputs = 3,
2624 .audio_inputs = 1,
2625 .tuner = 0,
2626 .svhs = 2,
2627 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002628 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002629 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2630 .gpiomute = 0x31,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002631 .no_msp34xx = 1,
2632 .pll = PLL_28,
2633 .tuner_type = TUNER_PHILIPS_NTSC_M,
2634 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002635 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002636 .has_radio = 0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002637 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002638 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002639 /* Rick C <cryptdragoon@gmail.com> */
2640 .name = "Super TV Tuner",
2641 .video_inputs = 4,
2642 .audio_inputs = 1,
2643 .tuner = 0,
2644 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002645 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002646 .tuner_type = TUNER_PHILIPS_NTSC,
2647 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002648 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002649 .gpiomask = 0x008007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002650 .gpiomux = { 0, 0x000001,0,0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002651 .needs_tvaudio = 1,
2652 .has_radio = 1,
2653 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002654 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002655 /* Chris Fanning <video4linux@haydon.net> */
2656 .name = "Tibet Systems 'Progress DVR' CS16",
2657 .video_inputs = 16,
2658 .audio_inputs = 0,
2659 .tuner = -1,
2660 .svhs = -1,
2661 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2662 .pll = PLL_28,
2663 .no_msp34xx = 1,
2664 .no_tda9875 = 1,
2665 .no_tda7432 = 1,
2666 .tuner_type = -1,
2667 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002668 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002669 .muxsel_hook = tibetCS16_muxsel,
2670 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002671 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002672 /* Bill Brack <wbrack@mmm.com.hk> */
2673 /*
2674 * Note that, because of the card's wiring, the "master"
2675 * BT878A chip (i.e. the one which controls the analog switch
2676 * and must use this card type) is the 2nd one detected. The
2677 * other 3 chips should use card type 0x85, whose description
2678 * follows this one. There is a EEPROM on the card (which is
2679 * connected to the I2C of one of those other chips), but is
2680 * not currently handled. There is also a facility for a
2681 * "monitor", which is also not currently implemented.
2682 */
2683 .name = "Kodicom 4400R (master)",
2684 .video_inputs = 16,
2685 .audio_inputs = 0,
2686 .tuner = -1,
2687 .tuner_type = -1,
2688 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002689 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002690 .svhs = -1,
2691 /* GPIO bits 0-9 used for analog switch:
2692 * 00 - 03: camera selector
2693 * 04 - 06: channel (controller) selector
2694 * 07: data (1->on, 0->off)
2695 * 08: strobe
2696 * 09: reset
2697 * bit 16 is input from sync separator for the channel
2698 */
2699 .gpiomask = 0x0003ff,
2700 .no_gpioirq = 1,
2701 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2702 .pll = PLL_28,
2703 .no_msp34xx = 1,
2704 .no_tda7432 = 1,
2705 .no_tda9875 = 1,
2706 .muxsel_hook = kodicom4400r_muxsel,
2707 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002708 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002709 /* Bill Brack <wbrack@mmm.com.hk> */
2710 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2711 * one which controls the analog switch, and must use the card type)
2712 * is the 2nd one detected. The other 3 chips should use this card
2713 * type
2714 */
2715 .name = "Kodicom 4400R (slave)",
2716 .video_inputs = 16,
2717 .audio_inputs = 0,
2718 .tuner = -1,
2719 .tuner_type = -1,
2720 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002721 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002722 .svhs = -1,
2723 .gpiomask = 0x010000,
2724 .no_gpioirq = 1,
2725 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2726 .pll = PLL_28,
2727 .no_msp34xx = 1,
2728 .no_tda7432 = 1,
2729 .no_tda9875 = 1,
2730 .muxsel_hook = kodicom4400r_muxsel,
2731 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002732 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002733 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002734 /* Michael Henson <mhenson@clarityvi.com> */
2735 /* Adlink RTV24 with special unlock codes */
2736 .name = "Adlink RTV24",
2737 .video_inputs = 4,
2738 .audio_inputs = 1,
2739 .tuner = 0,
2740 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002741 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002742 .tuner_type = -1,
2743 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002744 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002745 .pll = PLL_28,
2746 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002747 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002748 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002749 /* Michael Krufky <mkrufky@m1k.net> */
2750 .name = "DViCO FusionHDTV 5 Lite",
2751 .tuner = 0,
Michael Krufky9c26c8b2006-04-27 01:29:17 -03002752 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002753 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002754 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002755 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002756 .audio_inputs = 1,
2757 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002758 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002759 .gpiomask = 0x00e00007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002760 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2761 .gpiomute = 0x00c00007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002762 .no_msp34xx = 1,
2763 .no_tda9875 = 1,
2764 .no_tda7432 = 1,
2765 .has_dvb = 1,
2766 },
2767 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002768 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03002769 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002770 .name = "Acorp Y878F",
2771 .video_inputs = 3,
2772 .audio_inputs = 1,
2773 .tuner = 0,
2774 .svhs = 2,
2775 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002776 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002777 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2778 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002779 .needs_tvaudio = 1,
2780 .pll = PLL_28,
2781 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2782 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002783 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002784 .has_radio = 1,
2785 },
2786 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002787 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002788 .name = "Conceptronic CTVFMi v2",
2789 .video_inputs = 3,
2790 .audio_inputs = 1,
2791 .tuner = 0,
2792 .svhs = 2,
2793 .gpiomask = 0x001c0007,
2794 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002795 .gpiomux = { 0, 1, 2, 2 },
2796 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002797 .needs_tvaudio = 0,
2798 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002799 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002800 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002801 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002802 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002803 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002804 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002805 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002806 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002807 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2808 .video_inputs = 5,
2809 .audio_inputs = 1,
2810 .tuner = 0,
2811 .svhs = 3,
2812 .gpiomask = 0x01fe00,
2813 .muxsel = { 2,3,1,1,-1 },
2814 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002815 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2816 .gpiomute = 0x12400,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002817 .no_msp34xx = 1,
2818 .pll = PLL_28,
2819 .tuner_type = TUNER_LG_PAL_FM,
2820 .tuner_addr = ADDR_UNSET,
2821 .radio_addr = ADDR_UNSET,
2822 .has_remote = 1,
2823 },
2824 /* ---- card 0x8b ---------------------------------- */
2825 [BTTV_BOARD_PV_M4900] = {
2826 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2827 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2828 .video_inputs = 3,
2829 .audio_inputs = 1,
2830 .tuner = 0,
2831 .svhs = 2,
2832 .gpiomask = 0x3f,
2833 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002834 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2835 .gpiomute = 0x29,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002836 .no_msp34xx = 1,
2837 .pll = PLL_28,
2838 .tuner_type = TUNER_YMEC_TVF_5533MF,
2839 .tuner_addr = ADDR_UNSET,
2840 .radio_addr = ADDR_UNSET,
2841 .has_radio = 1,
2842 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002843 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002844 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002845 [BTTV_BOARD_OSPREY440] = {
2846 .name = "Osprey 440",
2847 .video_inputs = 1,
2848 .audio_inputs = 1,
2849 .tuner = -1,
2850 .svhs = 1,
2851 .muxsel = { 2 },
2852 .pll = PLL_28,
2853 .tuner_type = UNSET,
2854 .tuner_addr = ADDR_UNSET,
2855 .radio_addr = ADDR_UNSET,
2856 .no_msp34xx = 1,
2857 .no_tda9875 = 1,
2858 .no_tda7432 = 1,
2859 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002860 /* ---- card 0x8d ---------------------------------- */
2861 [BTTV_BOARD_ASOUND_SKYEYE] = {
2862 .name = "Asound Skyeye PCTV",
2863 .video_inputs = 3,
2864 .audio_inputs = 1,
2865 .tuner = 0,
2866 .svhs = 2,
2867 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002868 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002869 .gpiomux = { 2, 0, 0, 0 },
2870 .gpiomute = 1,
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002871 .needs_tvaudio = 1,
2872 .pll = PLL_28,
2873 .tuner_type = 2,
2874 .tuner_addr = ADDR_UNSET,
2875 .radio_addr = ADDR_UNSET,
2876 },
Bill Pechter633323f2005-11-13 16:07:50 -08002877 /* ---- card 0x8e ---------------------------------- */
2878 [BTTV_BOARD_SABRENT_TVFM] = {
2879 .name = "Sabrent TV-FM (bttv version)",
2880 .video_inputs = 3,
2881 .audio_inputs = 1,
2882 .tuner = 0,
2883 .svhs = 2,
2884 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002885 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002886 .gpiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002887 .no_msp34xx = 1,
2888 .no_tda9875 = 1,
2889 .no_tda7432 = 1,
2890 .pll = PLL_28,
2891 .tuner_type = TUNER_TNF_5335MF,
2892 .tuner_addr = ADDR_UNSET,
2893 .has_radio = 1,
2894 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002895 /* ---- card 0x8f ---------------------------------- */
2896 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2897 .name = "Hauppauge ImpactVCB (bt878)",
2898 .video_inputs = 4,
2899 .audio_inputs = 0,
2900 .tuner = -1,
2901 .svhs = -1,
2902 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002903 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002904 .no_msp34xx = 1,
2905 .no_tda9875 = 1,
2906 .no_tda7432 = 1,
2907 .tuner_type = -1,
2908 .tuner_addr = ADDR_UNSET,
2909 .radio_addr = ADDR_UNSET,
2910 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002911 [BTTV_BOARD_MACHTV_MAGICTV] = {
2912 /* Julian Calaby <julian.calaby@gmail.com>
2913 * Slightly different from original MachTV definition (0x60)
2914
2915 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2916 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2917 * properly (methinks) causing no keyup bits being set */
2918
2919 .name = "MagicTV", /* rebranded MachTV */
2920 .video_inputs = 3,
2921 .audio_inputs = 1,
2922 .tuner = 0,
2923 .svhs = 2,
2924 .gpiomask = 7,
2925 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002926 .gpiomux = { 0, 1, 2, 3 },
2927 .gpiomute = 4,
Julian Calaby2d05ae62006-01-11 19:40:09 -02002928 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2929 .tuner_addr = ADDR_UNSET,
2930 .radio_addr = ADDR_UNSET,
2931 .pll = PLL_28,
2932 .has_radio = 1,
2933 .has_remote = 1,
2934 },
Scott Alfter1ebba672007-04-02 14:22:39 -03002935 [BTTV_BOARD_SSAI_SECURITY] = {
2936 .name = "SSAI Security Video Interface",
2937 .video_inputs = 4,
2938 .audio_inputs = 0,
2939 .tuner = -1,
2940 .svhs = -1,
2941 .muxsel = { 0, 1, 2, 3 },
2942 .tuner_type = -1,
2943 .tuner_addr = ADDR_UNSET,
2944 .radio_addr = ADDR_UNSET,
2945 },
2946 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2947 .name = "SSAI Ultrasound Video Interface",
2948 .video_inputs = 2,
2949 .audio_inputs = 0,
2950 .tuner = -1,
2951 .svhs = 1,
2952 .muxsel = { 2, 0, 1, 3 },
2953 .tuner_type = -1,
2954 .tuner_addr = ADDR_UNSET,
2955 .radio_addr = ADDR_UNSET,
2956 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002957};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002958
2959static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2960
2961/* ----------------------------------------------------------------------- */
2962
2963static unsigned char eeprom_data[256];
2964
2965/*
2966 * identify card
2967 */
2968void __devinit bttv_idcard(struct bttv *btv)
2969{
2970 unsigned int gpiobits;
2971 int i,type;
2972 unsigned short tmp;
2973
2974 /* read PCI subsystem ID */
2975 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2976 btv->cardid = tmp << 16;
2977 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2978 btv->cardid |= tmp;
2979
2980 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2981 /* look for the card */
2982 for (type = -1, i = 0; cards[i].id != 0; i++)
2983 if (cards[i].id == btv->cardid)
2984 type = i;
2985
2986 if (type != -1) {
2987 /* found it */
2988 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2989 "PCI subsystem ID is %04x:%04x\n",
2990 btv->c.nr,cards[type].name,cards[type].cardnr,
2991 btv->cardid & 0xffff,
2992 (btv->cardid >> 16) & 0xffff);
2993 btv->c.type = cards[type].cardnr;
2994 } else {
2995 /* 404 */
2996 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2997 btv->c.nr, btv->cardid & 0xffff,
2998 (btv->cardid >> 16) & 0xffff);
2999 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08003000 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003001 }
3002 }
3003
3004 /* let the user override the autodetected type */
3005 if (card[btv->c.nr] < bttv_num_tvcards)
3006 btv->c.type=card[btv->c.nr];
3007
3008 /* print which card config we are using */
3009 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
3010 bttv_tvcards[btv->c.type].name, btv->c.type,
3011 card[btv->c.nr] < bttv_num_tvcards
3012 ? "insmod option" : "autodetected");
3013
3014 /* overwrite gpio stuff ?? */
3015 if (UNSET == audioall && UNSET == audiomux[0])
3016 return;
3017
3018 if (UNSET != audiomux[0]) {
3019 gpiobits = 0;
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003020 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003021 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07003022 gpiobits |= audiomux[i];
3023 }
3024 } else {
3025 gpiobits = audioall;
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003026 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003027 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003028 }
3029 }
3030 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3031 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3032 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
Mauro Carvalho Chehab57747b72007-03-28 22:37:20 -03003033 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003034 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003035 }
3036 printk("\n");
3037}
3038
3039/*
3040 * (most) board specific initialisations goes here
3041 */
3042
3043/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08003044static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003045{
3046 int type = -1;
3047
3048 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003049 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003050 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003051 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003052 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003053 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003054
3055 if (-1 != type) {
3056 btv->c.type = type;
3057 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3058 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3059 }
3060}
3061
3062static void flyvideo_gpio(struct bttv *btv)
3063{
3064 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3065 int tuner=-1,ttype;
3066
3067 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003068 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003069 gpio = gpio_read();
3070 /* FIXME: must restore OUR_EN ??? */
3071
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003072 /* all cards provide GPIO info, some have an additional eeprom
3073 * LR50: GPIO coding can be found lower right CP1 .. CP9
3074 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3075 * GPIO14-12: n.c.
3076 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003077
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003078 * lowest 3 bytes are remote control codes (no handshake needed)
3079 * xxxFFF: No remote control chip soldered
3080 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3081 * Note: Some bits are Audio_Mask !
3082 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003083 ttype=(gpio&0x0f0000)>>16;
3084 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003085 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003086 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003087 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003088 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003089 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003090 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003091 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003092 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003093 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003094 break;
3095 default:
3096 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3097 }
3098
3099 has_remote = gpio & 0x800000;
3100 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003101 /* unknown 0x200000;
3102 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003103 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003104 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003105 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3106 /*
3107 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003108
3109 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003110 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003111
3112 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3113 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3114 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3115 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3116 is_capture_only?"yes":"no ");
3117
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003118 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003119 btv->tuner_type = tuner;
3120 btv->has_radio = has_radio;
3121
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003122 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3123 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3124 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003125 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003126 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003127}
3128
3129static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3130 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3131static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3132 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3133
3134static void miro_pinnacle_gpio(struct bttv *btv)
3135{
3136 int id,msp,gpio;
3137 char *info;
3138
3139 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003140 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003141 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003142 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003143 if (id < 32) {
3144 btv->tuner_type = miro_tunermap[id];
3145 if (0 == (gpio & 0x20)) {
3146 btv->has_radio = 1;
3147 if (!miro_fmtuner[id]) {
3148 btv->has_matchbox = 1;
3149 btv->mbox_we = (1<<6);
3150 btv->mbox_most = (1<<7);
3151 btv->mbox_clk = (1<<8);
3152 btv->mbox_data = (1<<9);
3153 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3154 }
3155 } else {
3156 btv->has_radio = 0;
3157 }
3158 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003159 if (btv->c.type == BTTV_BOARD_MIRO)
3160 btv->c.type = BTTV_BOARD_MIROPRO;
3161 if (btv->c.type == BTTV_BOARD_PINNACLE)
3162 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003163 }
3164 printk(KERN_INFO
3165 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3166 btv->c.nr, id+1, btv->tuner_type,
3167 !btv->has_radio ? "no" :
3168 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3169 (-1 == msp) ? "no" : "yes");
3170 } else {
3171 /* new cards with microtune tuner */
3172 id = 63 - id;
3173 btv->has_radio = 0;
3174 switch (id) {
3175 case 1:
3176 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003177 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003178 break;
3179 case 2:
3180 info = "PAL+SECAM / stereo";
3181 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003182 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003183 break;
3184 case 3:
3185 info = "NTSC / stereo";
3186 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003187 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003188 break;
3189 case 4:
3190 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003191 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003192 break;
3193 case 5:
3194 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003195 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003196 break;
3197 case 6:
3198 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003199 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003200 break;
3201 case 7:
3202 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003203 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003204 break;
3205 default:
3206 info = "oops: unknown card";
3207 break;
3208 }
3209 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003210 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003211 printk(KERN_INFO
3212 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3213 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003214 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003215 }
3216}
3217
3218/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3219#define LM1882_SYNC_DRIVE 0x200000L
3220
3221static void init_ids_eagle(struct bttv *btv)
3222{
3223 gpio_inout(0xffffff,0xFFFF37);
3224 gpio_write(0x200020);
3225
3226 /* flash strobe inverter ?! */
3227 gpio_write(0x200024);
3228
3229 /* switch sync drive off */
3230 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3231
3232 /* set BT848 muxel to 2 */
3233 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3234}
3235
3236/* Muxsel helper for the IDS Eagle.
3237 * the eagles does not use the standard muxsel-bits but
3238 * has its own multiplexer */
3239static void eagle_muxsel(struct bttv *btv, unsigned int input)
3240{
3241 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3242 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3243
Linus Torvalds1da177e2005-04-16 15:20:36 -07003244 /* composite */
3245 /* set chroma ADC to sleep */
3246 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3247 /* set to composite video */
3248 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3249 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003250
3251 /* switch sync drive off */
3252 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3253}
3254
3255static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3256{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003257 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003258 gpio_write(masks[input%4]);
3259}
3260
3261/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3262 alarms output
3263
3264 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3265 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3266
3267 IN - sensor inputs, INx - sensor inputs and TI XORed together
3268 O1,O2,O3 - alarm outputs (relays)
3269
3270 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3271
3272*/
3273
3274static void init_lmlbt4x(struct bttv *btv)
3275{
3276 printk(KERN_DEBUG "LMLBT4x init\n");
3277 btwrite(0x000000, BT848_GPIO_REG_INP);
3278 gpio_inout(0xffffff, 0x0006C0);
3279 gpio_write(0x000000);
3280}
3281
3282static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3283{
3284 unsigned int inmux = input % 8;
3285 gpio_inout( 0xf, 0xf );
3286 gpio_bits( 0xf, inmux );
3287}
3288
3289static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3290{
3291 unsigned int inmux = input % 4;
3292 gpio_inout( 3<<9, 3<<9 );
3293 gpio_bits( 3<<9, inmux<<9 );
3294}
3295
3296/* ----------------------------------------------------------------------- */
3297
3298static void bttv_reset_audio(struct bttv *btv)
3299{
3300 /*
3301 * BT878A has a audio-reset register.
3302 * 1. This register is an audio reset function but it is in
3303 * function-0 (video capture) address space.
3304 * 2. It is enough to do this once per power-up of the card.
3305 * 3. There is a typo in the Conexant doc -- it is not at
3306 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3307 * --//Shrikumar 030609
3308 */
3309 if (btv->id != 878)
3310 return;
3311
3312 if (bttv_debug)
3313 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3314 btwrite((1<<7), 0x058);
3315 udelay(10);
3316 btwrite( 0, 0x058);
3317}
3318
3319/* initialization part one -- before registering i2c bus */
3320void __devinit bttv_init_card1(struct bttv *btv)
3321{
3322 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003323 case BTTV_BOARD_HAUPPAUGE:
3324 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003325 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003326 break;
Wade Berrier434b2522007-06-25 13:02:16 -03003327 case BTTV_BOARD_VOODOOTV_200:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003328 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003329 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003330 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003331 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003332 boot_msp34xx(btv,11);
3333 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003334 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003335 pvr_boot(btv);
3336 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003337 case BTTV_BOARD_TWINHAN_DST:
3338 case BTTV_BOARD_AVDVBT_771:
3339 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003340 btv->use_i2c_hw = 1;
3341 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003342 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003343 init_RTV24( btv );
3344 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003345
Linus Torvalds1da177e2005-04-16 15:20:36 -07003346 }
3347 if (!bttv_tvcards[btv->c.type].has_dvb)
3348 bttv_reset_audio(btv);
3349}
3350
3351/* initialization part two -- after registering i2c bus */
3352void __devinit bttv_init_card2(struct bttv *btv)
3353{
3354 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003355 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003356
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003357 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003358
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003359 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003360 bttv_readee(btv,eeprom_data,0xa0);
3361 identify_by_eeprom(btv,eeprom_data);
3362 }
3363
3364 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003365 case BTTV_BOARD_MIRO:
3366 case BTTV_BOARD_MIROPRO:
3367 case BTTV_BOARD_PINNACLE:
3368 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003369 /* miro/pinnacle */
3370 miro_pinnacle_gpio(btv);
3371 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003372 case BTTV_BOARD_FLYVIDEO_98:
3373 case BTTV_BOARD_MAXI:
3374 case BTTV_BOARD_LIFE_FLYKIT:
3375 case BTTV_BOARD_FLYVIDEO:
3376 case BTTV_BOARD_TYPHOON_TVIEW:
3377 case BTTV_BOARD_CHRONOS_VS2:
3378 case BTTV_BOARD_FLYVIDEO_98FM:
3379 case BTTV_BOARD_FLYVIDEO2000:
3380 case BTTV_BOARD_FLYVIDEO98EZ:
3381 case BTTV_BOARD_CONFERENCETV:
3382 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003383 flyvideo_gpio(btv);
3384 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003385 case BTTV_BOARD_HAUPPAUGE:
3386 case BTTV_BOARD_HAUPPAUGE878:
3387 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003388 /* pick up some config infos from the eeprom */
3389 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003390 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003391 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003392 case BTTV_BOARD_AVERMEDIA98:
3393 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003394 bttv_readee(btv,eeprom_data,0xa0);
3395 avermedia_eeprom(btv);
3396 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003397 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003398 init_PXC200(btv);
3399 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003400 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003401 picolo_tetra_init(btv);
3402 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003403 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003404 btv->has_radio = 1;
3405 btv->has_matchbox = 1;
3406 btv->mbox_we = 0x20;
3407 btv->mbox_most = 0;
3408 btv->mbox_clk = 0x08;
3409 btv->mbox_data = 0x10;
3410 btv->mbox_mask = 0x38;
3411 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003412 case BTTV_BOARD_VOBIS_BOOSTAR:
3413 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003414 terratec_active_radio_upgrade(btv);
3415 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003416 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003417 if (btv->cardid == 0x3002144f) {
3418 btv->has_radio=1;
3419 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3420 }
3421 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003422 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003423 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003424 /* Fix up entry for 3DFX VoodooTV 100,
3425 which is an OEM STB card variant. */
3426 btv->has_radio=0;
3427 btv->tuner_type=TUNER_TEMIC_NTSC;
3428 }
3429 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003430 case BTTV_BOARD_OSPREY1x0:
3431 case BTTV_BOARD_OSPREY1x0_848:
3432 case BTTV_BOARD_OSPREY101_848:
3433 case BTTV_BOARD_OSPREY1x1:
3434 case BTTV_BOARD_OSPREY1x1_SVID:
3435 case BTTV_BOARD_OSPREY2xx:
3436 case BTTV_BOARD_OSPREY2x0_SVID:
3437 case BTTV_BOARD_OSPREY2x0:
3438 case BTTV_BOARD_OSPREY500:
3439 case BTTV_BOARD_OSPREY540:
3440 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003441 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003442 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003443 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003444 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003445 init_ids_eagle(btv);
3446 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003447 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003448 bttv_readee(btv,eeprom_data,0xa0);
3449 modtec_eeprom(btv);
3450 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003451 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003452 init_lmlbt4x(btv);
3453 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003454 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003455 tibetCS16_init(btv);
3456 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003457 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003458 kodicom4400r_init(btv);
3459 break;
3460 }
3461
3462 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003463 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003464 /* defaults from card list */
3465 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3466 btv->pll.pll_ifreq=28636363;
3467 btv->pll.pll_crystal=BT848_IFORM_XT0;
3468 }
3469 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3470 btv->pll.pll_ifreq=35468950;
3471 btv->pll.pll_crystal=BT848_IFORM_XT1;
3472 }
3473 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003474 switch (pll[btv->c.nr]) {
3475 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003476 btv->pll.pll_crystal = 0;
3477 btv->pll.pll_ifreq = 0;
3478 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003479 break;
3480 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003481 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003482 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003483 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003484 btv->pll.pll_crystal = BT848_IFORM_XT0;
3485 break;
3486 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003487 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003488 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003489 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003490 btv->pll.pll_crystal = BT848_IFORM_XT1;
3491 break;
3492 }
3493 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003494 btv->pll.pll_current = -1;
3495
Linus Torvalds1da177e2005-04-16 15:20:36 -07003496 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003497 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3498 addr = bttv_tvcards[btv->c.type].tuner_addr;
3499
3500 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003501 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003502 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003503 if (UNSET != tuner[btv->c.nr])
3504 btv->tuner_type = tuner[btv->c.nr];
3505 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003506
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003507 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003508 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003509
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003510 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003511 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003512 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003513
3514 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3515 }
3516
Hans Verkuil39e8f402006-01-09 15:25:16 -02003517 if (btv->tda9887_conf) {
3518 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3519 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003520 }
3521
Linus Torvalds1da177e2005-04-16 15:20:36 -07003522 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3523 if (svhs[btv->c.nr] != UNSET)
3524 btv->svhs = svhs[btv->c.nr];
3525 if (remote[btv->c.nr] != UNSET)
3526 btv->has_remote = remote[btv->c.nr];
3527
3528 if (bttv_tvcards[btv->c.type].has_radio)
3529 btv->has_radio=1;
3530 if (bttv_tvcards[btv->c.type].has_remote)
3531 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003532 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3533 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003534 if (bttv_tvcards[btv->c.type].audio_hook)
3535 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3536
3537 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3538 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003539 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3540 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003541 boot_bt832(btv);
3542 }
3543
3544 if (!autoload)
3545 return;
3546
3547 /* try to detect audio/fader chips */
3548 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003549 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003550 request_module("msp3400");
3551
3552 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003553 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003554 request_module("msp3400");
3555
3556 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003557 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003558 request_module("tda9875");
3559
3560 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003561 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003562 request_module("tda7432");
3563
3564 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3565 request_module("tvaudio");
3566
3567 /* tuner modules */
3568 tda9887 = 0;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003569 if (btv->tda9887_conf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003570 tda9887 = 1;
3571 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003572 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003573 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003574 /* Hybrid DVB card, DOES have a tda9887 */
3575 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3576 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003577 if (btv->tuner_type != UNSET)
3578 request_module("tuner");
3579}
3580
3581
3582/* ----------------------------------------------------------------------- */
3583
3584static void modtec_eeprom(struct bttv *btv)
3585{
3586 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3587 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3588 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3589 btv->c.nr,&eeprom_data[0x1e]);
3590 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3591 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3592 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003593 btv->c.nr,&eeprom_data[0x1e]);
3594 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3595 btv->tuner_type=TUNER_PHILIPS_NTSC;
3596 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3597 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003598 } else {
3599 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3600 btv->c.nr,&eeprom_data[0x1e]);
3601 }
3602}
3603
3604static void __devinit hauppauge_eeprom(struct bttv *btv)
3605{
3606 struct tveeprom tv;
3607
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003608 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003609 btv->tuner_type = tv.tuner_type;
3610 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003611
3612 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3613 btv->c.nr, tv.model);
3614
3615 /*
3616 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3617 * type based on model #.
3618 */
3619 if(tv.model == 64900) {
3620 printk("bttv%d: Switching board type from %s to %s\n",
3621 btv->c.nr,
3622 bttv_tvcards[btv->c.type].name,
3623 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3624 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3625 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003626}
3627
3628static int terratec_active_radio_upgrade(struct bttv *btv)
3629{
3630 int freq;
3631
3632 btv->has_radio = 1;
3633 btv->has_matchbox = 1;
3634 btv->mbox_we = 0x10;
3635 btv->mbox_most = 0x20;
3636 btv->mbox_clk = 0x08;
3637 btv->mbox_data = 0x04;
3638 btv->mbox_mask = 0x3c;
3639
3640 btv->mbox_iow = 1 << 8;
3641 btv->mbox_ior = 1 << 9;
3642 btv->mbox_csel = 1 << 10;
3643
3644 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003645 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003646 if (0x1ed8 == tea5757_read(btv)) {
3647 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3648 btv->c.nr);
3649 btv->has_radio = 1;
3650 btv->has_matchbox = 1;
3651 } else {
3652 btv->has_radio = 0;
3653 btv->has_matchbox = 0;
3654 }
3655 return 0;
3656}
3657
3658
3659/* ----------------------------------------------------------------------- */
3660
3661/*
3662 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3663 *
3664 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3665 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3666 * unpacked with unzip).
3667 */
3668#define PVR_GPIO_DELAY 10
3669
3670#define BTTV_ALT_DATA 0x000001
3671#define BTTV_ALT_DCLK 0x100000
3672#define BTTV_ALT_NCONFIG 0x800000
3673
3674static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3675{
3676 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003677 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003678 int i;
3679
3680 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3681 gpio_write(0);
3682 udelay(PVR_GPIO_DELAY);
3683
3684 gpio_write(BTTV_ALT_NCONFIG);
3685 udelay(PVR_GPIO_DELAY);
3686
3687 for (n = 0; n < microlen; n++) {
3688 bits = micro[n];
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003689 for (i = 0 ; i < 8 ; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003690 gpio_bits(BTTV_ALT_DCLK,0);
3691 if (bits & 0x01)
3692 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3693 else
3694 gpio_bits(BTTV_ALT_DATA,0);
3695 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3696 bits >>= 1;
3697 }
3698 }
3699 gpio_bits(BTTV_ALT_DCLK,0);
3700 udelay(PVR_GPIO_DELAY);
3701
3702 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3703 for (i = 0 ; i < 30 ; i++) {
3704 gpio_bits(BTTV_ALT_DCLK,0);
3705 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3706 }
3707 gpio_bits(BTTV_ALT_DCLK,0);
3708 return 0;
3709}
3710
3711static int __devinit pvr_boot(struct bttv *btv)
3712{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003713 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003714 int rc;
3715
3716 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3717 if (rc != 0) {
3718 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3719 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003720 return rc;
3721 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003722 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3723 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3724 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003725 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003726 return rc;
3727}
3728
3729/* ----------------------------------------------------------------------- */
3730/* some osprey specific stuff */
3731
3732static void __devinit osprey_eeprom(struct bttv *btv)
3733{
3734 int i = 0;
3735 unsigned char *ee = eeprom_data;
3736 unsigned long serial = 0;
3737
3738 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003739 /* this might be an antique... check for MMAC label in eeprom */
3740 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3741 unsigned char checksum = 0;
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003742 for (i = 0; i < 21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003743 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003744 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003745 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003746 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003747 for (i = 12; i < 21; i++)
3748 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003749 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003750 } else {
3751 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003752 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003753
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003754 for (; offset < 8*16; offset += 16) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003755 unsigned short checksum = 0;
3756 /* verify the checksum */
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03003757 for (i = 0; i < 14; i++)
3758 checksum += ee[i+offset];
3759 checksum = ~checksum; /* no idea why */
3760 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003761 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003762 break;
3763 }
3764 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003765
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003766 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003767 return;
3768
3769 /* found a valid descriptor */
3770 type = (ee[offset+4]<<8) | (ee[offset+5]);
3771
3772 switch(type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003773 /* 848 based */
3774 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003775 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003776 break;
3777 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003778 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003779 break;
3780
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003781 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003782 case 0x0012:
3783 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003784 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003785 break;
3786 case 0x0014:
3787 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003788 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003789 break;
3790 case 0x0016:
3791 case 0x0017:
3792 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003793 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003794 break;
3795 case 0x0018:
3796 case 0x0019:
3797 case 0x001E:
3798 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003799 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003800 break;
3801 case 0x001A:
3802 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003803 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003804 break;
3805 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003806 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003807 break;
3808 case 0x0050:
3809 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003810 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003811 /* bttv_osprey_540_init(btv); */
3812 break;
3813 case 0x0060:
3814 case 0x0070:
Michael Krufky52398ef2006-05-26 02:13:15 -03003815 case 0x00A0:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003816 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003817 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003818 gpio_inout(0xffffff,0x000303);
3819 break;
3820 default:
3821 /* unknown...leave generic, but get serial # */
3822 break;
3823 }
3824 serial = (ee[offset+6] << 24)
3825 | (ee[offset+7] << 16)
3826 | (ee[offset+8] << 8)
3827 | (ee[offset+9]);
3828 }
3829
3830 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3831 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3832}
3833
3834/* ----------------------------------------------------------------------- */
3835/* AVermedia specific stuff, from bktr_card.c */
3836
3837static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003838 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3839 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3840 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3841 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3842 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003843 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003844
3845static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003846 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003847 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3848 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003849 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3850 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003851
3852static void __devinit avermedia_eeprom(struct bttv *btv)
3853{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003854 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003855
3856 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003857 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3858 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003859 btv->has_remote = (eeprom_data[0x42] & 0x01);
3860
3861 if (tuner_make == 0 || tuner_make == 2)
3862 if(tuner_format <=0x0a)
3863 tuner = tuner_0_table[tuner_format];
3864 if (tuner_make == 1)
3865 if(tuner_format <=9)
3866 tuner = tuner_1_table[tuner_format];
3867
3868 if (tuner_make == 4)
3869 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003870 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003871
3872 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3873 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3874 if(tuner) {
3875 btv->tuner_type=tuner;
3876 printk("%d",tuner);
3877 } else
3878 printk("Unknown type");
3879 printk(" radio:%s remote control:%s\n",
3880 tuner_tv_fm ? "yes" : "no",
3881 btv->has_remote ? "yes" : "no");
3882}
3883
3884/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3885void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3886{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003887 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003888 if(norm==VIDEO_MODE_NTSC) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003889 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3890 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
Wade Berrier434b2522007-06-25 13:02:16 -03003891 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3892 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003893 dprintk("bttv_tda9880_setnorm to NTSC\n");
3894 }
3895 else {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003896 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3897 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
Wade Berrier434b2522007-06-25 13:02:16 -03003898 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3899 bttv_tvcards[BTTV_BOARD_VOODOOTV_200].gpiomute=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003900 dprintk("bttv_tda9880_setnorm to PAL\n");
3901 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003902 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003903 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003904 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003905}
3906
3907
3908/*
3909 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003910 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003911 *
3912 * Hauppauge: pin 5
3913 * Voodoo: pin 20
3914 */
3915static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3916{
3917 int mask = (1 << pin);
3918
3919 gpio_inout(mask,mask);
3920 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003921 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003922 gpio_bits(mask,mask);
3923
3924 if (bttv_gpio)
3925 bttv_gpio_tracking(btv,"msp34xx");
3926 if (bttv_verbose)
3927 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3928 "init [%d]\n", btv->c.nr, pin);
3929}
3930
3931static void __devinit boot_bt832(struct bttv *btv)
3932{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003933}
3934
3935/* ----------------------------------------------------------------------- */
3936/* Imagenation L-Model PXC200 Framegrabber */
3937/* This is basically the same procedure as
3938 * used by Alessandro Rubini in his pxc200
3939 * driver, but using BTTV functions */
3940
3941static void __devinit init_PXC200(struct bttv *btv)
3942{
3943 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3944 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3945 0x00 };
3946 unsigned int i;
3947 int tmp;
3948 u32 val;
3949
3950 /* Initialise GPIO-connevted stuff */
3951 gpio_inout(0xffffff, (1<<13));
3952 gpio_write(0);
3953 udelay(3);
3954 gpio_write(1<<13);
3955 /* GPIO inputs are pulled up, so no need to drive
3956 * reset pin any longer */
3957 gpio_bits(0xffffff, 0);
3958 if (bttv_gpio)
3959 bttv_gpio_tracking(btv,"pxc200");
3960
3961 /* we could/should try and reset/control the AD pots? but
3962 right now we simply turned off the crushing. Without
3963 this the AGC drifts drifts
3964 remember the EN is reverse logic -->
3965 setting BT848_ADC_AGC_EN disable the AGC
3966 tboult@eecs.lehigh.edu
3967 */
3968
3969 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3970
3971 /* Initialise MAX517 DAC */
3972 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3973 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3974
3975 /* Initialise 12C508 PIC */
3976 /* The I2CWrite and I2CRead commmands are actually to the
3977 * same chips - but the R/W bit is included in the address
3978 * argument so the numbers are different */
3979
3980
3981 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3982
3983 /* First of all, enable the clock line. This is used in the PXC200-F */
3984 val = btread(BT848_GPIO_DMA_CTL);
3985 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3986 btwrite(val, BT848_GPIO_DMA_CTL);
3987
3988 /* Then, push to 0 the reset pin long enough to reset the *
3989 * device same as above for the reset line, but not the same
3990 * value sent to the GPIO-connected stuff
3991 * which one is the good one? */
3992 gpio_inout(0xffffff,(1<<2));
3993 gpio_write(0);
3994 udelay(10);
3995 gpio_write(1<<2);
3996
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003997 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003998 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3999 if (tmp != -1) {
4000 printk(KERN_INFO
4001 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4002 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4003 }
4004 }
4005
4006 printk(KERN_INFO "PXC200 Initialised.\n");
4007}
4008
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004009
4010
Peter Skipworth93b43f12005-06-23 22:04:45 -07004011/* ----------------------------------------------------------------------- */
4012/*
4013 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
4014 * it. This apparently involves the following procedure for each 878 chip:
4015 *
4016 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
4017 *
4018 * 2) write to GPIO_DATA
4019 * - 0x0E
4020 * - sleep 1ms
4021 * - 0x10 + 0x0E
4022 * - sleep 10ms
4023 * - 0x0E
4024 * read from GPIO_DATA into buf (uint_32)
4025 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4026 * error. ERROR_CPLD_Check_Failed stop.
4027 *
4028 * 3) write to GPIO_DATA
4029 * - write 0x4400 + 0x0E
4030 * - sleep 10ms
4031 * - write 0x4410 + 0x0E
4032 * - sleep 1ms
4033 * - write 0x0E
4034 * read from GPIO_DATA into buf (uint_32)
Jean Delvarefef4fa142006-11-09 17:25:28 -03004035 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
Peter Skipworth93b43f12005-06-23 22:04:45 -07004036 * error. ERROR_CPLD_Check_Failed.
4037 */
4038/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08004039static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004040init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07004041{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004042 uint32_t dataRead = 0;
4043 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07004044
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004045 printk (KERN_INFO
4046 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07004047 btv->c.nr);
4048
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004049 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004050
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004051 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4052 msleep (1);
4053 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4054 msleep (10);
4055 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004056
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004057 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004058
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004059 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4060 printk (KERN_INFO
4061 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4062 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004063 }
4064
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004065 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4066 msleep (10);
4067 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4068 msleep (1);
4069 btwrite (watchdog_value, BT848_GPIO_DATA);
4070 msleep (1);
4071 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004072
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004073 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4074 printk (KERN_INFO
4075 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4076 btv->c.nr, dataRead);
4077
Peter Skipworth93b43f12005-06-23 22:04:45 -07004078 return;
4079 }
4080
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004081 printk (KERN_INFO
4082 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004083}
Linus Torvalds1da177e2005-04-16 15:20:36 -07004084
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004085
4086
Linus Torvalds1da177e2005-04-16 15:20:36 -07004087/* ----------------------------------------------------------------------- */
4088/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4089/*
4090 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4091 * This code is placed under the terms of the GNU General Public License
4092 *
4093 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4094 */
4095
4096static void bus_low(struct bttv *btv, int bit)
4097{
4098 if (btv->mbox_ior) {
4099 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4100 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4101 udelay(5);
4102 }
4103
4104 gpio_bits(bit,0);
4105 udelay(5);
4106
4107 if (btv->mbox_ior) {
4108 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4109 udelay(5);
4110 }
4111}
4112
4113static void bus_high(struct bttv *btv, int bit)
4114{
4115 if (btv->mbox_ior) {
4116 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4117 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4118 udelay(5);
4119 }
4120
4121 gpio_bits(bit,bit);
4122 udelay(5);
4123
4124 if (btv->mbox_ior) {
4125 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4126 udelay(5);
4127 }
4128}
4129
4130static int bus_in(struct bttv *btv, int bit)
4131{
4132 if (btv->mbox_ior) {
4133 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4134 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4135 udelay(5);
4136
4137 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4138 udelay(5);
4139 }
4140 return gpio_read() & (bit);
4141}
4142
4143/* TEA5757 register bits */
4144#define TEA_FREQ 0:14
4145#define TEA_BUFFER 15:15
4146
4147#define TEA_SIGNAL_STRENGTH 16:17
4148
4149#define TEA_PORT1 18:18
4150#define TEA_PORT0 19:19
4151
4152#define TEA_BAND 20:21
4153#define TEA_BAND_FM 0
4154#define TEA_BAND_MW 1
4155#define TEA_BAND_LW 2
4156#define TEA_BAND_SW 3
4157
4158#define TEA_MONO 22:22
4159#define TEA_ALLOW_STEREO 0
4160#define TEA_FORCE_MONO 1
4161
4162#define TEA_SEARCH_DIRECTION 23:23
4163#define TEA_SEARCH_DOWN 0
4164#define TEA_SEARCH_UP 1
4165
4166#define TEA_STATUS 24:24
4167#define TEA_STATUS_TUNED 0
4168#define TEA_STATUS_SEARCHING 1
4169
4170/* Low-level stuff */
4171static int tea5757_read(struct bttv *btv)
4172{
4173 unsigned long timeout;
4174 int value = 0;
4175 int i;
4176
4177 /* better safe than sorry */
4178 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4179
4180 if (btv->mbox_ior) {
4181 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4182 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4183 udelay(5);
4184 }
4185
4186 if (bttv_gpio)
4187 bttv_gpio_tracking(btv,"tea5757 read");
4188
4189 bus_low(btv,btv->mbox_we);
4190 bus_low(btv,btv->mbox_clk);
4191
4192 udelay(10);
4193 timeout= jiffies + HZ;
4194
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004195 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004196 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4197 schedule();
4198 if (bus_in(btv,btv->mbox_data)) {
4199 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4200 return -1;
4201 }
4202
4203 dprintk("bttv%d: tea5757:",btv->c.nr);
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004204 for (i = 0; i < 24; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004205 udelay(5);
4206 bus_high(btv,btv->mbox_clk);
4207 udelay(5);
4208 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4209 bus_low(btv,btv->mbox_clk);
4210 value <<= 1;
4211 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4212 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4213 }
4214 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4215 return value;
4216}
4217
4218static int tea5757_write(struct bttv *btv, int value)
4219{
4220 int i;
4221 int reg = value;
4222
4223 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4224
4225 if (btv->mbox_ior) {
4226 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4227 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4228 udelay(5);
4229 }
4230 if (bttv_gpio)
4231 bttv_gpio_tracking(btv,"tea5757 write");
4232
4233 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4234 bus_low(btv,btv->mbox_clk);
4235 bus_high(btv,btv->mbox_we);
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004236 for (i = 0; i < 25; i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004237 if (reg & 0x1000000)
4238 bus_high(btv,btv->mbox_data);
4239 else
4240 bus_low(btv,btv->mbox_data);
4241 reg <<= 1;
4242 bus_high(btv,btv->mbox_clk);
4243 udelay(10);
4244 bus_low(btv,btv->mbox_clk);
4245 udelay(10);
4246 }
4247 bus_low(btv,btv->mbox_we); /* unmute !!! */
4248 return 0;
4249}
4250
4251void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4252{
4253 dprintk("tea5757_set_freq %d\n",freq);
4254 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004255}
4256
4257
4258/* ----------------------------------------------------------------------- */
4259/* winview */
4260
Adrian Bunk943a4902005-12-01 00:51:35 -08004261static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004262{
4263 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4264 int bits_out, loops, vol, data;
4265
4266 if (!set) {
4267 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4268 v->flags |= VIDEO_AUDIO_VOLUME;
4269 return;
4270 }
4271
4272 /* 32 levels logarithmic */
4273 vol = 32 - ((v->volume>>11));
4274 /* units */
4275 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4276 /* tens */
4277 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4278 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4279 data = gpio_read();
4280 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4281 WINVIEW_PT2254_STROBE);
4282 for (loops = 17; loops >= 0 ; loops--) {
4283 if (bits_out & (1<<loops))
4284 data |= WINVIEW_PT2254_DATA;
4285 else
4286 data &= ~WINVIEW_PT2254_DATA;
4287 gpio_write(data);
4288 udelay(5);
4289 data |= WINVIEW_PT2254_CLK;
4290 gpio_write(data);
4291 udelay(5);
4292 data &= ~WINVIEW_PT2254_CLK;
4293 gpio_write(data);
4294 }
4295 data |= WINVIEW_PT2254_STROBE;
4296 data &= ~WINVIEW_PT2254_DATA;
4297 gpio_write(data);
4298 udelay(10);
4299 data &= ~WINVIEW_PT2254_STROBE;
4300 gpio_write(data);
4301}
4302
4303/* ----------------------------------------------------------------------- */
4304/* mono/stereo control for various cards (which don't use i2c chips but */
4305/* connect something to the GPIO pins */
4306
4307static void
4308gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4309{
4310 unsigned int con = 0;
4311
4312 if (set) {
4313 gpio_inout(0x300, 0x300);
4314 if (v->mode & VIDEO_SOUND_LANG1)
4315 con = 0x000;
4316 if (v->mode & VIDEO_SOUND_LANG2)
4317 con = 0x300;
4318 if (v->mode & VIDEO_SOUND_STEREO)
4319 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004320/* if (v->mode & VIDEO_SOUND_MONO)
4321 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004322 gpio_bits(0x300, con);
4323 } else {
4324 v->mode = VIDEO_SOUND_STEREO |
4325 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4326 }
4327}
4328
4329static void
4330gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4331{
4332 unsigned int val, con;
4333
Linus Torvalds1da177e2005-04-16 15:20:36 -07004334 if (btv->radio_user)
4335 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004336
4337 val = gpio_read();
4338 if (set) {
4339 con = 0x000;
4340 if (v->mode & VIDEO_SOUND_LANG2) {
4341 if (v->mode & VIDEO_SOUND_LANG1) {
4342 /* LANG1 + LANG2 */
4343 con = 0x100;
4344 }
4345 else {
4346 /* LANG2 */
4347 con = 0x300;
4348 }
4349 }
4350 if (con != (val & 0x300)) {
4351 gpio_bits(0x300, con);
4352 if (bttv_gpio)
4353 bttv_gpio_tracking(btv,"gvbctv5pci");
4354 }
4355 } else {
4356 switch (val & 0x70) {
4357 case 0x10:
4358 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4359 break;
4360 case 0x30:
4361 v->mode = VIDEO_SOUND_LANG2;
4362 break;
4363 case 0x50:
4364 v->mode = VIDEO_SOUND_LANG1;
4365 break;
4366 case 0x60:
4367 v->mode = VIDEO_SOUND_STEREO;
4368 break;
4369 case 0x70:
4370 v->mode = VIDEO_SOUND_MONO;
4371 break;
4372 default:
4373 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4374 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4375 }
4376 }
4377}
4378
4379/*
4380 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4381 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4382 * 0xdde enables mono and 0xccd enables sap
4383 *
4384 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4385 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4386 * input/output sound connection, so both must be set for output mode.
4387 *
4388 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4389 * handles this with a tda9840
4390 *
4391 */
4392static void
4393avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4394{
4395 int val = 0;
4396
4397 if (set) {
4398 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4399 val = 0x02;
4400 if (v->mode & VIDEO_SOUND_STEREO)
4401 val = 0x01;
4402 if (val) {
4403 gpio_bits(0x03,val);
4404 if (bttv_gpio)
4405 bttv_gpio_tracking(btv,"avermedia");
4406 }
4407 } else {
4408 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4409 VIDEO_SOUND_LANG1;
4410 return;
4411 }
4412}
4413
4414static void
4415avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4416{
4417 int val = 0;
4418
4419 if (set) {
4420 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4421 val = 0x01;
4422 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4423 val = 0x02;
4424 btaor(val, ~0x03, BT848_GPIO_DATA);
4425 if (bttv_gpio)
4426 bttv_gpio_tracking(btv,"avermedia");
4427 } else {
4428 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4429 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4430 return;
4431 }
4432}
4433
4434/* Lifetec 9415 handling */
4435static void
4436lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4437{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004438 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004439
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004440 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004441 v->mode = VIDEO_SOUND_MONO;
4442 return;
4443 }
4444
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004445 if (set) {
4446 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4447 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004448 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004449 val = 0x0880;
4450 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004451 (v->mode & VIDEO_SOUND_MONO))
4452 val = 0;
4453 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004454 if (bttv_gpio)
4455 bttv_gpio_tracking(btv,"lt9415");
4456 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004457 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004458 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004459 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004460 return;
4461 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004462}
4463
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004464/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004465static void
4466terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4467{
4468 unsigned int con = 0;
4469
4470 if (set) {
4471 gpio_inout(0x180000,0x180000);
4472 if (v->mode & VIDEO_SOUND_LANG2)
4473 con = 0x080000;
4474 if (v->mode & VIDEO_SOUND_STEREO)
4475 con = 0x180000;
4476 gpio_bits(0x180000, con);
4477 if (bttv_gpio)
4478 bttv_gpio_tracking(btv,"terratv");
4479 } else {
4480 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4481 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4482 }
4483}
4484
4485static void
4486winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4487{
4488 unsigned long val = 0;
4489
4490 if (set) {
4491 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4492 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4493 val = 0x420000;
4494 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4495 val = 0x420000;
4496 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4497 val = 0x410000;
4498 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4499 val = 0x020000;
4500 if (val) {
4501 gpio_bits(0x430000, val);
4502 if (bttv_gpio)
4503 bttv_gpio_tracking(btv,"winfast2000");
4504 }
4505 } else {
4506 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4507 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4508 }
4509}
4510
4511/*
4512 * Dariusz Kowalewski <darekk@automex.pl>
4513 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4514 * revision 9B has on-board TDA9874A sound decoder).
4515 *
4516 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4517 * will mute this cards.
4518 */
4519static void
4520pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4521{
4522 unsigned int val = 0;
4523
Linus Torvalds1da177e2005-04-16 15:20:36 -07004524 if (btv->radio_user)
4525 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004526
4527 if (set) {
4528 if (v->mode & VIDEO_SOUND_MONO) {
4529 val = 0x01;
4530 }
4531 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4532 || (v->mode & VIDEO_SOUND_STEREO)) {
4533 val = 0x02;
4534 }
4535 if (val) {
4536 gpio_bits(0x03,val);
4537 if (bttv_gpio)
4538 bttv_gpio_tracking(btv,"pvbt878p9b");
4539 }
4540 } else {
4541 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4542 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4543 }
4544}
4545
4546/*
4547 * Dariusz Kowalewski <darekk@automex.pl>
4548 * sound control for FlyVideo 2000S (with tda9874 decoder)
4549 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4550 */
4551static void
4552fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4553{
4554 unsigned int val = 0xffff;
4555
Linus Torvalds1da177e2005-04-16 15:20:36 -07004556 if (btv->radio_user)
4557 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004558 if (set) {
4559 if (v->mode & VIDEO_SOUND_MONO) {
4560 val = 0x0000;
4561 }
4562 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4563 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004564 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004565 }
4566 if (val != 0xffff) {
4567 gpio_bits(0x1800, val);
4568 if (bttv_gpio)
4569 bttv_gpio_tracking(btv,"fv2000s");
4570 }
4571 } else {
4572 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4573 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4574 }
4575}
4576
4577/*
4578 * sound control for Canopus WinDVR PCI
4579 * Masaki Suzuki <masaki@btree.org>
4580 */
4581static void
4582windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4583{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004584 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004585
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004586 if (set) {
4587 if (v->mode & VIDEO_SOUND_MONO)
4588 val = 0x040000;
4589 if (v->mode & VIDEO_SOUND_LANG1)
4590 val = 0;
4591 if (v->mode & VIDEO_SOUND_LANG2)
4592 val = 0x100000;
4593 if (v->mode & VIDEO_SOUND_STEREO)
4594 val = 0;
4595 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004596 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004597 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004598 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004599 }
4600 } else {
4601 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4602 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4603 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004604}
4605
4606/*
4607 * sound control for AD-TVK503
4608 * Hiroshi Takekawa <sian@big.or.jp>
4609 */
4610static void
4611adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4612{
4613 unsigned int con = 0xffffff;
4614
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004615 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004616
4617 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004618 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004619 if (v->mode & VIDEO_SOUND_LANG1)
4620 con = 0x00000000;
4621 if (v->mode & VIDEO_SOUND_LANG2)
4622 con = 0x00180000;
4623 if (v->mode & VIDEO_SOUND_STEREO)
4624 con = 0x00000000;
4625 if (v->mode & VIDEO_SOUND_MONO)
4626 con = 0x00060000;
4627 if (con != 0xffffff) {
4628 gpio_bits(0x1e0000,con);
4629 if (bttv_gpio)
4630 bttv_gpio_tracking(btv, "adtvk503");
4631 }
4632 } else {
4633 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4634 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4635 }
4636}
4637
4638/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4639 *
4640 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4641 * switch instead (CD22M3494E). This IC can have multiple active connections
4642 * between Xn (input) and Yn (output) pins. We need to clear any existing
4643 * connection prior to establish a new one, pulsing the STROBE pin.
4644 *
4645 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4646 * GPIO pins are wired as:
4647 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4648 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4649 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4650 * GPIO[8] - - P3[5] (microcontroler)
4651 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4652 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4653 * GPINTR - - P3[4] (microcontroler)
4654 *
4655 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4656 * configuration either directly (as we are doing) or using the microcontroler
4657 * which is also wired to I2C interface. I have no further info on the
4658 * microcontroler features, one would need to disassembly the firmware.
4659 * note: the vendor refused to give any information on this product, all
4660 * that stuff was found using a multimeter! :)
4661 */
4662static void rv605_muxsel(struct bttv *btv, unsigned int input)
4663{
4664 /* reset all conections */
4665 gpio_bits(0x200,0x200);
4666 mdelay(1);
4667 gpio_bits(0x200,0x000);
4668 mdelay(1);
4669
4670 /* create a new conection */
4671 gpio_bits(0x480,0x080);
4672 gpio_bits(0x480,0x480);
4673 mdelay(1);
4674 gpio_bits(0x480,0x080);
4675 mdelay(1);
4676}
4677
4678/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4679 *
4680 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4681 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4682 * chips, ten eight input analog multiplexors, a not chip and a few
4683 * other components.
4684 *
4685 * 16 inputs on a secondary bracket are provided and can be selected
4686 * from each of the four capture chips. Two of the eight input
4687 * multiplexors are used to select from any of the 16 input signals.
4688 *
4689 * Unsupported hardware capabilities:
4690 * . A video output monitor on the secondary bracket can be selected from
4691 * one of the 878A chips.
4692 * . Another passthrough but I haven't spent any time investigating it.
4693 * . Digital I/O (logic level connected to GPIO) is available from an
4694 * onboard header.
4695 *
4696 * The on chip input mux should always be set to 2.
4697 * GPIO[16:19] - Video input selection
4698 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4699 * GPIO[?:?] - Digital I/O.
4700 *
4701 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4702 * determined what function (if any) it provides. With the microcontroller
4703 * and sync seperator chips a guess is that it might have to do with video
4704 * switching and maybe some digital I/O.
4705 */
4706static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4707{
4708 /* video mux */
4709 gpio_bits(0x0f0000, input << 16);
4710}
4711
4712static void tibetCS16_init(struct bttv *btv)
4713{
4714 /* enable gpio bits, mask obtained via btSpy */
4715 gpio_inout(0xffffff, 0x0f7fff);
4716 gpio_write(0x0f7fff);
4717}
4718
4719/*
4720 * The following routines for the Kodicom-4400r get a little mind-twisting.
4721 * There is a "master" controller and three "slave" controllers, together
4722 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4723 * The analog switch is controlled by the "master", but the detection order
4724 * of the four BT878A chips is in an order which I just don't understand.
4725 * The "master" is actually the second controller to be detected. The
4726 * logic on the board uses logical numbers for the 4 controlers, but
4727 * those numbers are different from the detection sequence. When working
4728 * with the analog switch, we need to "map" from the detection sequence
4729 * over to the board's logical controller number. This mapping sequence
4730 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4731 * unit 3, the second (which is the master) is logical unit 0, etc.
4732 * We need to maintain the status of the analog switch (which of the 16
4733 * cameras is connected to which of the 4 controllers). Rather than
4734 * add to the bttv structure for this, we use the data reserved for
4735 * the mbox (unused for this card type).
4736 */
4737
4738/*
4739 * First a routine to set the analog switch, which controls which camera
4740 * is routed to which controller. The switch comprises an X-address
4741 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4742 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4743 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4744 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4745 * specified address. The idea is to set the address and data, then bring
4746 * STROBE high, and finally bring STROBE back to low.
4747 */
4748static void kodicom4400r_write(struct bttv *btv,
4749 unsigned char xaddr,
4750 unsigned char yaddr,
4751 unsigned char data) {
4752 unsigned int udata;
4753
4754 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4755 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4756 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4757 gpio_bits(0x1ff, udata); /* strobe low */
4758}
4759
4760/*
4761 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4762 * use this routine. The routine finds the "master" for the card, maps
4763 * the controller number from the detected position over to the logical
4764 * number, writes the appropriate data to the analog switch, and housekeeps
4765 * the local copy of the switch information. The parameter 'input' is the
4766 * requested camera number (0 - 15).
4767 */
4768static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4769{
4770 char *sw_status;
4771 int xaddr, yaddr;
4772 struct bttv *mctlr;
4773 static unsigned char map[4] = {3, 0, 2, 1};
4774
4775 mctlr = master[btv->c.nr];
4776 if (mctlr == NULL) { /* ignore if master not yet detected */
4777 return;
4778 }
4779 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4780 yaddr = map[yaddr];
4781 sw_status = (char *)(&mctlr->mbox_we);
4782 xaddr = input & 0xf;
4783 /* Check if the controller/camera pair has changed, else ignore */
4784 if (sw_status[yaddr] != xaddr)
4785 {
4786 /* "open" the old switch, "close" the new one, save the new */
4787 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4788 sw_status[yaddr] = xaddr;
4789 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4790 }
4791}
4792
4793/*
4794 * During initialisation, we need to reset the analog switch. We
4795 * also preset the switch to map the 4 connectors on the card to the
4796 * *user's* (see above description of kodicom4400r_muxsel) channels
4797 * 0 through 3
4798 */
4799static void kodicom4400r_init(struct bttv *btv)
4800{
4801 char *sw_status = (char *)(&btv->mbox_we);
4802 int ix;
4803
4804 gpio_inout(0x0003ff, 0x0003ff);
4805 gpio_write(1 << 9); /* reset MUX */
4806 gpio_write(0);
4807 /* Preset camera 0 to the 4 controllers */
Mauro Carvalho Chehabc1d57032007-03-28 22:37:23 -03004808 for (ix = 0; ix < 4; ix++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004809 sw_status[ix] = ix;
4810 kodicom4400r_write(btv, ix, ix, 1);
4811 }
4812 /*
4813 * Since this is the "master", we need to set up the
4814 * other three controller chips' pointers to this structure
4815 * for later use in the muxsel routine.
4816 */
4817 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4818 return;
4819 master[btv->c.nr-1] = btv;
4820 master[btv->c.nr] = btv;
4821 master[btv->c.nr+1] = btv;
4822 master[btv->c.nr+2] = btv;
4823}
4824
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004825/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4826 * video multiplexers to provide up to 16 video inputs. These
4827 * multiplexers are controlled by the lower 8 GPIO pins of the
4828 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004829
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004830 * xxx0 is pin xxx of multiplexer U5,
4831 * yyy1 is pin yyy of multiplexer U2
4832 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004833#define ENA0 0x01
4834#define ENB0 0x02
4835#define ENA1 0x04
4836#define ENB1 0x08
4837
4838#define IN10 0x10
4839#define IN00 0x20
4840#define IN11 0x40
4841#define IN01 0x80
4842
4843static void xguard_muxsel(struct bttv *btv, unsigned int input)
4844{
4845 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004846 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4847 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4848 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4849 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004850 };
4851 gpio_write(masks[input%16]);
4852}
4853static void picolo_tetra_init(struct bttv *btv)
4854{
4855 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4856 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4857 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4858}
4859static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4860{
4861
4862 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4863 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4864 /*GPIO[20]&GPIO[21] used to choose the right input*/
4865 btwrite (input<<20,BT848_GPIO_DATA);
4866
4867}
4868
4869/*
4870 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4871 *
4872 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4873 * swichers to provide 16 channels to MUX0. The TDA8540's have
Andreas Mohrd6e05ed2006-06-26 18:35:02 +02004874 * 4 independent outputs and as such the IVC120G also has the
Linus Torvalds1da177e2005-04-16 15:20:36 -07004875 * optional "Monitor Out" bus. This allows the card to be looking
4876 * at one input while the monitor is looking at another.
4877 *
4878 * Since I've couldn't be bothered figuring out how to add an
4879 * independant muxsel for the monitor bus, I've just set it to
4880 * whatever the card is looking at.
4881 *
4882 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4883 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4884 *
4885 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4886 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4887 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4888 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4889 *
4890 */
4891
4892/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4893#define I2C_TDA8540 0x90
4894#define I2C_TDA8540_ALT1 0x92
4895#define I2C_TDA8540_ALT2 0x94
4896#define I2C_TDA8540_ALT3 0x96
4897#define I2C_TDA8540_ALT4 0x98
4898#define I2C_TDA8540_ALT5 0x9a
4899#define I2C_TDA8540_ALT6 0x9c
4900
4901static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4902{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004903 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004904 int key = input % 4;
4905 int matrix = input / 4;
4906
4907 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4908 btv->c.nr, input, matrix, key);
4909
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004910 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004911 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4912 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4913 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4914 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4915 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4916 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4917 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4918 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4919
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004920 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004921 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004922 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004923 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004924 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004925 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004926 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004927 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004928 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004929
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004930 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004931 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4932}
4933
4934
4935/* PXC200 muxsel helper
4936 * luke@syseng.anu.edu.au
4937 * another transplant
4938 * from Alessandro Rubini (rubini@linux.it)
4939 *
4940 * There are 4 kinds of cards:
4941 * PXC200L which is bt848
4942 * PXC200F which is bt848 with PIC controlling mux
4943 * PXC200AL which is bt878
4944 * PXC200AF which is bt878 with PIC controlling mux
4945 */
4946#define PX_CFG_PXC200F 0x01
4947#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4948#define PX_I2C_PIC 0x0f
4949#define PX_PXC200A_CARDID 0x200a1295
4950#define PX_I2C_CMD_CFG 0x00
4951
4952static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4953{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004954 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004955 long mux;
4956 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004957 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004958
4959 /* Read PIC config to determine if this is a PXC200F */
4960 /* PX_I2C_CMD_CFG*/
4961 buf[0]=0;
4962 buf[1]=0;
4963 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4964 if (rc) {
4965 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4966 /* not PXC ? do nothing */
4967 return;
4968 }
4969
4970 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4971 if (!(rc & PX_CFG_PXC200F)) {
4972 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4973 return;
4974 }
4975
4976
4977 /* The multiplexer in the 200F is handled by the GPIO port */
4978 /* get correct mapping between inputs */
4979 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4980 /* ** not needed!? */
4981 mux = input;
4982
4983 /* make sure output pins are enabled */
4984 /* bitmask=0x30f; */
4985 bitmask=0x302;
4986 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004987 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004988 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4989 bitmask |= 7<<4; /* the DAC */
4990 }
4991 btwrite(bitmask, BT848_GPIO_OUT_EN);
4992
4993 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004994 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004995 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4996 else /* older device */
4997 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4998 btwrite(bitmask,BT848_GPIO_DATA);
4999
5000 /*
5001 * Was "to be safe, set the bt848 to input 0"
5002 * Actually, since it's ok at load time, better not messing
5003 * with these bits (on PXC200AF you need to set mux 2 here)
5004 *
5005 * needed because bttv-driver sets mux before calling this function
5006 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005007 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07005008 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
5009 else /* older device */
5010 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
5011
5012 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
5013}
5014
5015/* ----------------------------------------------------------------------- */
5016/* motherboard chipset specific stuff */
5017
5018void __devinit bttv_check_chipset(void)
5019{
5020 int pcipci_fail = 0;
5021 struct pci_dev *dev = NULL;
5022
Alan Cox3d265c92006-09-14 11:53:16 -03005023 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
Linus Torvalds1da177e2005-04-16 15:20:36 -07005024 pcipci_fail = 1;
5025 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
5026 triton1 = 1;
5027 if (pci_pci_problems & PCIPCI_VSFX)
5028 vsfx = 1;
5029#ifdef PCIPCI_ALIMAGIK
5030 if (pci_pci_problems & PCIPCI_ALIMAGIK)
5031 latency = 0x0A;
5032#endif
5033
Linus Torvalds1da177e2005-04-16 15:20:36 -07005034
5035 /* print warnings about any quirks found */
5036 if (triton1)
5037 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
5038 if (vsfx)
5039 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
5040 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005041 printk(KERN_INFO "bttv: bttv and your chipset may not work "
5042 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005043 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005044 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005045 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005046 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005047 printk(KERN_INFO "bttv: overlay forced. Use this "
5048 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005049 }
5050 }
5051 if (UNSET != latency)
5052 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08005053 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005054 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005055 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005056 pci_read_config_byte(dev, 0x53, &b);
5057 if (bttv_debug)
5058 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5059 "bufcon=0x%02x\n",b);
5060 }
5061}
5062
5063int __devinit bttv_handle_chipset(struct bttv *btv)
5064{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005065 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005066
5067 if (!triton1 && !vsfx && UNSET == latency)
5068 return 0;
5069
5070 if (bttv_verbose) {
5071 if (triton1)
5072 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5073 if (vsfx && btv->id >= 878)
5074 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5075 if (UNSET != latency)
5076 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5077 btv->c.nr,latency);
5078 }
5079
5080 if (btv->id < 878) {
5081 /* bt848 (mis)uses a bit in the irq mask for etbf */
5082 if (triton1)
5083 btv->triton1 = BT848_INT_ETBF;
5084 } else {
5085 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005086 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005087 if (triton1)
5088 command |= BT878_EN_TBFX;
5089 if (vsfx)
5090 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005091 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5092 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005093 if (UNSET != latency)
5094 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5095 return 0;
5096}
5097
5098
5099/*
5100 * Local variables:
5101 * c-basic-offset: 8
5102 * End:
5103 */