blob: 6addc42df045f77b8760aa185541a4b0c41f07f9 [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
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800181 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
182 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 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
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700294 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800295 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700296
Steven Tothcd1257d2006-01-09 15:25:01 -0200297 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
298 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
299
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700300 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800301 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
Michael Krufky2af35572006-01-23 17:11:06 -0200302 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
303 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800304 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
305 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
306 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
307 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
Michael Krufky2af35572006-01-23 17:11:06 -0200308 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800309 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
Michael Krufky19790db2007-01-07 22:12:22 -0300310 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800311 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Cameron Hutchinson442d15d2006-06-21 18:45:31 -0300312 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
314 { 0, -1, NULL }
315};
316
317/* ----------------------------------------------------------------------- */
318/* array with description for bt848 / bt878 tv/grabber cards */
319
320struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800321 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800322 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800323 .name = " *** UNKNOWN/GENERIC *** ",
324 .video_inputs = 4,
325 .audio_inputs = 1,
326 .tuner = 0,
327 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200328 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800329 .tuner_type = -1,
330 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800331 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800332 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800333 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800334 .name = "MIRO PCTV",
335 .video_inputs = 4,
336 .audio_inputs = 1,
337 .tuner = 0,
338 .svhs = 2,
339 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200340 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300341 .gpiomux = { 2, 0, 0, 0 },
342 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800343 .needs_tvaudio = 1,
344 .tuner_type = -1,
345 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800346 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800347 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800348 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800349 .name = "Hauppauge (bt848)",
350 .video_inputs = 4,
351 .audio_inputs = 1,
352 .tuner = 0,
353 .svhs = 2,
354 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200355 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300356 .gpiomux = { 0, 1, 2, 3 },
357 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800358 .needs_tvaudio = 1,
359 .tuner_type = -1,
360 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800361 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800362 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800363 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800364 .name = "STB, Gateway P/N 6000699 (bt848)",
365 .video_inputs = 3,
366 .audio_inputs = 1,
367 .tuner = 0,
368 .svhs = 2,
369 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200370 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300371 .gpiomux = { 4, 0, 2, 3 },
372 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800373 .no_msp34xx = 1,
374 .needs_tvaudio = 1,
375 .tuner_type = TUNER_PHILIPS_NTSC,
376 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800377 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800378 .pll = PLL_28,
379 .has_radio = 1,
380 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800382 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800383 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800384 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
385 .video_inputs = 4,
386 .audio_inputs = 0,
387 .tuner = -1,
388 .svhs = 2,
389 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200390 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300391 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800392 .needs_tvaudio = 0,
393 .tuner_type = 4,
394 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800395 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800396 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800397 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800398 .name = "Diamond DTV2000",
399 .video_inputs = 4,
400 .audio_inputs = 1,
401 .tuner = 0,
402 .svhs = 2,
403 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200404 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300405 .gpiomux = { 0, 1, 0, 1 },
406 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800407 .needs_tvaudio = 1,
408 .tuner_type = -1,
409 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800410 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800411 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800412 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800413 .name = "AVerMedia TVPhone",
414 .video_inputs = 3,
415 .audio_inputs = 1,
416 .tuner = 0,
417 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200418 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800419 .gpiomask = 0x0f,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300420 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800421 /* 0x04 for some cards ?? */
422 .needs_tvaudio = 1,
423 .tuner_type = -1,
424 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800425 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800426 .audio_hook = avermedia_tvphone_audio,
427 .has_remote = 1,
428 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800429 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800430 .name = "MATRIX-Vision MV-Delta",
431 .video_inputs = 5,
432 .audio_inputs = 1,
433 .tuner = -1,
434 .svhs = 3,
435 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200436 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300437 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800438 .needs_tvaudio = 1,
439 .tuner_type = -1,
440 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800441 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800442 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800444 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800445 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800446 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
447 .video_inputs = 4,
448 .audio_inputs = 1,
449 .tuner = 0,
450 .svhs = 2,
451 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200452 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300453 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
454 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800455 .needs_tvaudio = 1,
456 .pll = PLL_28,
457 .tuner_type = -1,
458 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800459 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800460 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800461 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800462 .name = "IMS/IXmicro TurboTV",
463 .video_inputs = 3,
464 .audio_inputs = 1,
465 .tuner = 0,
466 .svhs = 2,
467 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200468 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300469 .gpiomux = { 1, 1, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800470 .needs_tvaudio = 0,
471 .pll = PLL_28,
472 .tuner_type = TUNER_TEMIC_PAL,
473 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800474 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800475 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800476 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800477 .name = "Hauppauge (bt878)",
478 .video_inputs = 4,
479 .audio_inputs = 1,
480 .tuner = 0,
481 .svhs = 2,
482 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200483 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300484 .gpiomux = { 0, 1, 2, 3 },
485 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800486 .needs_tvaudio = 1,
487 .pll = PLL_28,
488 .tuner_type = -1,
489 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800490 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800491 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800492 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800493 .name = "MIRO PCTV pro",
494 .video_inputs = 3,
495 .audio_inputs = 1,
496 .tuner = 0,
497 .svhs = 2,
498 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200499 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300500 .gpiomux = { 0x20001,0x10001, 0, 0 },
501 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800502 .needs_tvaudio = 1,
503 .tuner_type = -1,
504 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800505 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800506 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800508 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800509 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800510 .name = "ADS Technologies Channel Surfer TV (bt848)",
511 .video_inputs = 3,
512 .audio_inputs = 1,
513 .tuner = 0,
514 .svhs = 2,
515 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200516 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300517 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800518 .needs_tvaudio = 1,
519 .tuner_type = -1,
520 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800521 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800522 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800523 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800524 .name = "AVerMedia TVCapture 98",
525 .video_inputs = 3,
526 .audio_inputs = 4,
527 .tuner = 0,
528 .svhs = 2,
529 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200530 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300531 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800532 .needs_tvaudio = 1,
533 .msp34xx_alt = 1,
534 .pll = PLL_28,
535 .tuner_type = TUNER_PHILIPS_PAL,
536 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800537 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800538 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800539 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800540 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800541 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800542 .name = "Aimslab Video Highway Xtreme (VHX)",
543 .video_inputs = 3,
544 .audio_inputs = 1,
545 .tuner = 0,
546 .svhs = 2,
547 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200548 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300549 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
550 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800551 .needs_tvaudio = 1,
552 .pll = PLL_28,
553 .tuner_type = -1,
554 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800555 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800556 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800557 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800558 .name = "Zoltrix TV-Max",
559 .video_inputs = 3,
560 .audio_inputs = 1,
561 .tuner = 0,
562 .svhs = 2,
563 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200564 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300565 .gpiomux = { 0, 0, 1, 0 },
566 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800567 .needs_tvaudio = 1,
568 .tuner_type = -1,
569 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800570 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800571 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800573 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800574 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800575 .name = "Prolink Pixelview PlayTV (bt878)",
576 .video_inputs = 3,
577 .audio_inputs = 1,
578 .tuner = 0,
579 .svhs = 2,
580 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200581 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800582 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300583 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
584 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800585 .needs_tvaudio = 1,
586 .pll = PLL_28,
587 .tuner_type = -1,
588 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800589 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800590 .name = "Leadtek WinView 601",
591 .video_inputs = 3,
592 .audio_inputs = 1,
593 .tuner = 0,
594 .svhs = 2,
595 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200596 .muxsel = { 2, 3, 1, 1,0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300597 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
598 .gpiomute = 0xcfa007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800599 .needs_tvaudio = 1,
600 .tuner_type = -1,
601 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800602 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800603 .audio_hook = winview_audio,
604 .has_radio = 1,
605 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800606 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800607 .name = "AVEC Intercapture",
608 .video_inputs = 3,
609 .audio_inputs = 2,
610 .tuner = 0,
611 .svhs = 2,
612 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200613 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300614 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800615 .needs_tvaudio = 1,
616 .tuner_type = -1,
617 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800618 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800619 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800620 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800621 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
622 .video_inputs = 4,
623 .audio_inputs = 1,
624 .tuner = -1,
625 .svhs = -1,
626 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200627 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300628 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800629 .no_msp34xx = 1,
630 .tuner_type = -1,
631 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800632 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800633 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800635 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800636 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800637 .name = "CEI Raffles Card",
638 .video_inputs = 3,
639 .audio_inputs = 3,
640 .tuner = 0,
641 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200642 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800643 .tuner_type = -1,
644 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800645 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800646 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800647 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800648 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
649 .video_inputs = 4,
650 .audio_inputs = 2, /* tuner, line in */
651 .tuner = 0,
652 .svhs = 2,
653 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200654 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300655 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
656 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800657 .pll = PLL_28,
658 .tuner_type = TUNER_PHILIPS_PAL_I,
659 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800660 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800661 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800662 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800663 .name = "Askey CPH050/ Phoebe Tv Master + FM",
664 .video_inputs = 3,
665 .audio_inputs = 1,
666 .tuner = 0,
667 .svhs = 2,
668 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200669 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300670 .gpiomux = { 0, 1, 0x800, 0x400 },
671 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800672 .needs_tvaudio = 1,
673 .pll = PLL_28,
674 .tuner_type = -1,
675 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800676 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800677 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800678 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800679 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
680 .video_inputs = 3,
681 .audio_inputs = 1,
682 .tuner = 0,
683 .svhs = -1,
684 .gpiomask = 7,
685 .muxsel = { 2, 3, -1 },
686 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300687 .gpiomux = { 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800688 .no_msp34xx = 1,
689 .pll = PLL_28,
690 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
691 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800692 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800693 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800695 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800696 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800697 .name = "Askey CPH05X/06X (bt878) [many vendors]",
698 .video_inputs = 3,
699 .audio_inputs = 1,
700 .tuner = 0,
701 .svhs = 2,
702 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200703 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300704 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
705 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800706 .needs_tvaudio = 1,
707 .pll = PLL_28,
708 .tuner_type = -1,
709 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800710 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800711 .has_remote = 1,
712 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800713 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800714 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
715 .video_inputs = 3,
716 .audio_inputs = 1,
717 .tuner = 0,
718 .svhs = 2,
719 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200720 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300721 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
722 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800723 .needs_tvaudio = 0,
724 .tuner_type = TUNER_PHILIPS_PAL,
725 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800726 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800727 .audio_hook = terratv_audio,
728 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800729 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800730 .name = "Hauppauge WinCam newer (bt878)",
731 .video_inputs = 4,
732 .audio_inputs = 1,
733 .tuner = 0,
734 .svhs = 3,
735 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200736 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300737 .gpiomux = { 0, 1, 2, 3 },
738 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800739 .needs_tvaudio = 1,
740 .tuner_type = -1,
741 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800742 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800743 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800744 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800745 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
746 .video_inputs = 4,
747 .audio_inputs = 2,
748 .tuner = 0,
749 .svhs = 2,
750 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200751 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300752 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
753 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800754 .pll = PLL_28,
755 .tuner_type = TUNER_PHILIPS_SECAM,
756 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800757 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800758 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800760 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800761 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800762 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
763 .video_inputs = 3,
764 .audio_inputs = 1,
765 .tuner = 0,
766 .svhs = 2,
767 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200768 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300769 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
770 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800771 .needs_tvaudio = 0,
772 .tuner_type = TUNER_PHILIPS_PAL,
773 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800774 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800775 .audio_hook = terratv_audio,
776 /* GPIO wiring:
777 External 20 pin connector (for Active Radio Upgrade board)
778 gpio00: i2c-sda
779 gpio01: i2c-scl
780 gpio02: om5610-data
781 gpio03: om5610-clk
782 gpio04: om5610-wre
783 gpio05: om5610-stereo
784 gpio06: rds6588-davn
785 gpio07: Pin 7 n.c.
786 gpio08: nIOW
787 gpio09+10: nIOR, nSEL ?? (bt878)
788 gpio09: nIOR (bt848)
789 gpio10: nSEL (bt848)
790 Sound Routing:
791 gpio16: u2-A0 (1st 4052bt)
792 gpio17: u2-A1
793 gpio18: u2-nEN
794 gpio19: u4-A0 (2nd 4052)
795 gpio20: u4-A1
796 u4-nEN - GND
797 Btspy:
798 00000 : Cdrom (internal audio input)
799 10000 : ext. Video audio input
800 20000 : TV Mono
801 a0000 : TV Mono/2
802 1a0000 : TV Stereo
803 30000 : Radio
804 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700805 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700806
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800807 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800808 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800809 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
810 .name = "Imagenation PXC200",
811 .video_inputs = 5,
812 .audio_inputs = 1,
813 .tuner = -1,
814 .svhs = 1, /* was: 4 */
815 .gpiomask = 0,
816 .muxsel = { 2, 3, 1, 0, 0},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300817 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800818 .needs_tvaudio = 1,
819 .tuner_type = -1,
820 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800821 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800822 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800824 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800825 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800826 .name = "Lifeview FlyVideo 98 LR50",
827 .video_inputs = 4,
828 .audio_inputs = 1,
829 .tuner = 0,
830 .svhs = 2,
831 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200832 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300833 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
834 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800835 .pll = PLL_28,
836 .tuner_type = -1,
837 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800838 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800839 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800840 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800841 .name = "Formac iProTV, Formac ProTV I (bt848)",
842 .video_inputs = 4,
843 .audio_inputs = 1,
844 .tuner = 0,
845 .svhs = 3,
846 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200847 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300848 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800849 .pll = PLL_28,
850 .tuner_type = TUNER_PHILIPS_PAL,
851 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800852 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800853 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800855 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800856 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800857 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
858 .video_inputs = 4,
859 .audio_inputs = 0,
860 .tuner = -1,
861 .svhs = 2,
862 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200863 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300864 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800865 .needs_tvaudio = 0,
866 .tuner_type = 4,
867 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800868 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800869 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800870 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800871 .name = "Terratec TerraTValue Version Bt878",
872 .video_inputs = 3,
873 .audio_inputs = 1,
874 .tuner = 0,
875 .svhs = 2,
876 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200877 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300878 .gpiomux = { 0x500, 0, 0x300, 0x900 },
879 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800880 .needs_tvaudio = 1,
881 .pll = PLL_28,
882 .tuner_type = TUNER_PHILIPS_PAL,
883 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800884 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800885 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800886 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800887 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
888 .video_inputs = 4,
889 .audio_inputs = 1,
890 .tuner = 0,
891 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200892 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800893 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
894 .gpiomask = 0xb33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300895 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
896 .gpiomute = 0x800000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800897 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
898 gpio23 -- hef4052:nEnable (0x800000)
899 gpio12 -- hef4052:A1
900 gpio13 -- hef4052:A0
901 0x0000: external audio
902 0x1000: FM
903 0x2000: TV
904 0x3000: n.c.
905 Note: There exists another variant "Winfast 2000" with tv stereo !?
906 Note: eeprom only contains FF and pci subsystem id 107d:6606
907 */
908 .needs_tvaudio = 0,
909 .pll = PLL_28,
910 .has_radio = 1,
911 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
912 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800913 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800914 .audio_hook = winfast2000_audio,
915 .has_remote = 1,
916 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800917 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800918 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
919 .video_inputs = 4,
920 .audio_inputs = 3,
921 .tuner = 0,
922 .svhs = 2,
923 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200924 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300925 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
926 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800927 .pll = PLL_28,
928 .tuner_type = -1,
929 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800930 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800931 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800933 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800934 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800935 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
936 .video_inputs = 4,
937 .audio_inputs = 3,
938 .tuner = 0,
939 .svhs = 2,
940 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200941 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300942 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
943 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800944 .pll = PLL_28,
945 .tuner_type = -1,
946 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800947 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800948 .has_radio = 1,
949 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800950 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800951 .name = "Prolink PixelView PlayTV pro",
952 .video_inputs = 3,
953 .audio_inputs = 1,
954 .tuner = 0,
955 .svhs = 2,
956 .gpiomask = 0xff,
957 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300958 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
959 .gpiomute = 0x29,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800960 .no_msp34xx = 1,
961 .pll = PLL_28,
962 .tuner_type = -1,
963 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800964 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800965 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800966 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800967 .name = "Askey CPH06X TView99",
968 .video_inputs = 4,
969 .audio_inputs = 1,
970 .tuner = 0,
971 .svhs = 2,
972 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200973 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300974 .gpiomux = { 0x551400, 0x551200, 0, 0 },
975 .gpiomute = 0x551c00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800976 .needs_tvaudio = 1,
977 .pll = PLL_28,
978 .tuner_type = 1,
979 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800980 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800981 .has_remote = 1,
982 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800983 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800984 .name = "Pinnacle PCTV Studio/Rave",
985 .video_inputs = 3,
986 .audio_inputs = 1,
987 .tuner = 0,
988 .svhs = 2,
989 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -0200990 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300991 .gpiomux = { 2, 0xd0001, 0, 0 },
992 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800993 .needs_tvaudio = 0,
994 .pll = PLL_28,
995 .tuner_type = -1,
996 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800997 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800998 },
999
1000 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001001 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001002 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1003 .video_inputs = 3,
1004 .audio_inputs = 1,
1005 .tuner = 0,
1006 .svhs = 2,
1007 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001008 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001009 .gpiomux = { 4, 0, 2, 3 },
1010 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001011 .no_msp34xx = 1,
1012 .needs_tvaudio = 1,
1013 .tuner_type = TUNER_PHILIPS_NTSC,
1014 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001015 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001016 .pll = PLL_28,
1017 .has_radio = 1,
1018 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001019 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001020 .name = "AVerMedia TVPhone 98",
1021 .video_inputs = 3,
1022 .audio_inputs = 4,
1023 .tuner = 0,
1024 .svhs = 2,
1025 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001026 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001027 .gpiomux = { 13, 4, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001028 .needs_tvaudio = 1,
1029 .pll = PLL_28,
1030 .tuner_type = -1,
1031 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001032 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001033 .has_radio = 1,
1034 .audio_hook = avermedia_tvphone_audio,
1035 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001036 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001037 .name = "ProVideo PV951", /* pic16c54 */
1038 .video_inputs = 3,
1039 .audio_inputs = 1,
1040 .tuner = 0,
1041 .svhs = 2,
1042 .gpiomask = 0,
1043 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001044 .gpiomux = { 0, 0, 0, 0},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001045 .needs_tvaudio = 1,
1046 .no_msp34xx = 1,
1047 .pll = PLL_28,
1048 .tuner_type = 1,
1049 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001050 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001051 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001052 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001053 .name = "Little OnAir TV",
1054 .video_inputs = 3,
1055 .audio_inputs = 1,
1056 .tuner = 0,
1057 .svhs = 2,
1058 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001059 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001060 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1061 .gpiomute = 0xff3ffc,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001062 .no_msp34xx = 1,
1063 .tuner_type = -1,
1064 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001065 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001066 },
1067
1068 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001069 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001070 .name = "Sigma TVII-FM",
1071 .video_inputs = 2,
1072 .audio_inputs = 1,
1073 .tuner = 0,
1074 .svhs = -1,
1075 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001076 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001077 .gpiomux = { 1, 1, 0, 2 },
1078 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001079 .no_msp34xx = 1,
1080 .pll = PLL_NONE,
1081 .tuner_type = -1,
1082 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001083 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001084 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001085 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001086 .name = "MATRIX-Vision MV-Delta 2",
1087 .video_inputs = 5,
1088 .audio_inputs = 1,
1089 .tuner = -1,
1090 .svhs = 3,
1091 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001092 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001093 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001094 .no_msp34xx = 1,
1095 .pll = PLL_28,
1096 .tuner_type = -1,
1097 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001098 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001099 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001100 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001101 .name = "Zoltrix Genie TV/FM",
1102 .video_inputs = 3,
1103 .audio_inputs = 1,
1104 .tuner = 0,
1105 .svhs = 2,
1106 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001107 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001108 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1109 .gpiomute = 0xbcb03f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001110 .no_msp34xx = 1,
1111 .pll = PLL_28,
1112 .tuner_type = 21,
1113 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001114 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001115 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001116 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001117 .name = "Terratec TV/Radio+",
1118 .video_inputs = 3,
1119 .audio_inputs = 1,
1120 .tuner = 0,
1121 .svhs = 2,
1122 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001123 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001124 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1125 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001126 .needs_tvaudio = 1,
1127 .no_msp34xx = 1,
1128 .pll = PLL_35,
1129 .tuner_type = 1,
1130 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001131 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001132 .has_radio = 1,
1133 },
1134
1135 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001136 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001137 .name = "Askey CPH03x/ Dynalink Magic TView",
1138 .video_inputs = 3,
1139 .audio_inputs = 1,
1140 .tuner = 0,
1141 .svhs = 2,
1142 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001143 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001144 .gpiomux = {2,0,0,0 },
1145 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001146 .needs_tvaudio = 1,
1147 .pll = PLL_28,
1148 .tuner_type = -1,
1149 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001150 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001151 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001152 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001153 .name = "IODATA GV-BCTV3/PCI",
1154 .video_inputs = 3,
1155 .audio_inputs = 1,
1156 .tuner = 0,
1157 .svhs = 2,
1158 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001159 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001160 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001161 .no_msp34xx = 1,
1162 .pll = PLL_28,
1163 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1164 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001165 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001166 .audio_hook = gvbctv3pci_audio,
1167 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001168 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001169 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1170 .video_inputs = 5,
1171 .audio_inputs = 1,
1172 .tuner = 0,
1173 .svhs = 3,
1174 .gpiomask = 0xAA0000,
1175 .muxsel = { 2,3,1,1,-1 },
1176 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001177 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1178 .gpiomute = 0xa8000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001179 .no_msp34xx = 1,
1180 .pll = PLL_28,
1181 .tuner_type = TUNER_PHILIPS_PAL_I,
1182 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001183 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001184 .has_remote = 1,
1185 /* GPIO wiring: (different from Rev.4C !)
1186 GPIO17: U4.A0 (first hef4052bt)
1187 GPIO19: U4.A1
1188 GPIO20: U5.A1 (second hef4052bt)
1189 GPIO21: U4.nEN
1190 GPIO22: BT832 Reset Line
1191 GPIO23: A5,A0, U5,nEN
1192 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1193 */
1194 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001195 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001196 .name = "Eagle Wireless Capricorn2 (bt878A)",
1197 .video_inputs = 4,
1198 .audio_inputs = 1,
1199 .tuner = 0,
1200 .svhs = 2,
1201 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001202 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001203 .gpiomux = { 0, 1, 2, 3 },
1204 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001205 .pll = PLL_28,
1206 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1207 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001208 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001209 },
1210
1211 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001212 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001213 /* David Härdeman <david@2gen.com> */
1214 .name = "Pinnacle PCTV Studio Pro",
1215 .video_inputs = 4,
1216 .audio_inputs = 1,
1217 .tuner = 0,
1218 .svhs = 3,
1219 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001220 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001221 .gpiomux = { 1, 0xd0001, 0, 0 },
1222 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001223 /* sound path (5 sources):
1224 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1225 0= ext. Audio IN
1226 1= from MUX2
1227 2= Mono TV sound from Tuner
1228 3= not connected
1229 MUX2 (mask 0x30000):
1230 0,2,3= from MSP34xx
1231 1= FM stereo Radio from Tuner */
1232 .needs_tvaudio = 0,
1233 .pll = PLL_28,
1234 .tuner_type = -1,
1235 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001236 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001237 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001238 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001239 /* Claas Langbehn <claas@bigfoot.com>,
1240 Sven Grothklags <sven@upb.de> */
1241 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1242 .video_inputs = 4,
1243 .audio_inputs = 3,
1244 .tuner = 0,
1245 .svhs = 2,
1246 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001247 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001248 .gpiomux = { 0, 0, 0x10, 8 },
1249 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001250 .needs_tvaudio = 1,
1251 .pll = PLL_28,
1252 .tuner_type = TUNER_PHILIPS_PAL,
1253 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001254 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001255 .has_radio = 1,
1256 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001257 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001258 /* Tim Röstermundt <rosterm@uni-muenster.de>
1259 in de.comp.os.unix.linux.hardware:
1260 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001261 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001262 options tuner type=5 */
1263 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1264 .video_inputs = 4,
1265 .audio_inputs = 1,
1266 .tuner = 0,
1267 .svhs = 2,
1268 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001269 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001270 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1271 .gpiomute = 0x18e0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001272 /* For cards with tda9820/tda9821:
1273 0x0000: Tuner normal stereo
1274 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1275 0x0880: Tuner A2 stereo */
1276 .pll = PLL_28,
1277 .tuner_type = -1,
1278 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001279 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001280 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001281 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001282 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1283 old Easy TV BT848 version (model CPH031) */
1284 .name = "Askey CPH031/ BESTBUY Easy TV",
1285 .video_inputs = 4,
1286 .audio_inputs = 1,
1287 .tuner = 0,
1288 .svhs = 2,
1289 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001290 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001291 .gpiomux = { 2, 0, 0, 0 },
1292 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001293 .needs_tvaudio = 0,
1294 .pll = PLL_28,
1295 .tuner_type = TUNER_TEMIC_PAL,
1296 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001297 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001298 },
1299
1300 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001301 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001302 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1303 .name = "Lifeview FlyVideo 98FM LR50",
1304 .video_inputs = 4,
1305 .audio_inputs = 3,
1306 .tuner = 0,
1307 .svhs = 2,
1308 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001309 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001310 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1311 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001312 .pll = PLL_28,
1313 .tuner_type = 5,
1314 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001315 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001316 },
1317 /* This is the ultimate cheapo capture card
1318 * just a BT848A on a small PCB!
1319 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001320 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001321 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1322 .video_inputs = 2,
1323 .audio_inputs = 0,
1324 .tuner = -1,
1325 .svhs = 1,
1326 .gpiomask = 0,
1327 .muxsel = { 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001328 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001329 .needs_tvaudio = 0,
1330 .no_msp34xx = 1,
1331 .pll = PLL_35,
1332 .tuner_type = -1,
1333 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001334 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001335 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001336 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001337 /* Daniel Herrington <daniel.herrington@home.com> */
1338 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1339 .video_inputs = 3,
1340 .audio_inputs = 1,
1341 .tuner = 0,
1342 .svhs = 2,
1343 .gpiomask = 0xe00,
1344 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001345 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1346 .gpiomute = 0x800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001347 .needs_tvaudio = 1,
1348 .pll = PLL_28,
1349 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1350 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001351 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001352 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001353 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001354 /* Matti Mottus <mottus@physic.ut.ee> */
1355 .name = "Askey CPH03x TV Capturer",
1356 .video_inputs = 4,
1357 .audio_inputs = 1,
1358 .tuner = 0,
1359 .svhs = 2,
1360 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001361 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001362 .gpiomux = { 2, 0, 0, 0 },
1363 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001364 .pll = PLL_28,
1365 .tuner_type = 0,
1366 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001367 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001368 },
1369
1370 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001371 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001372 /* Philip Blundell <philb@gnu.org> */
1373 .name = "Modular Technology MM100PCTV",
1374 .video_inputs = 2,
1375 .audio_inputs = 2,
1376 .tuner = 0,
1377 .svhs = -1,
1378 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001379 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001380 .gpiomux = { 2, 0, 0, 1 },
1381 .gpiomute = 8,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001382 .pll = PLL_35,
1383 .tuner_type = TUNER_TEMIC_PAL,
1384 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001385 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001386 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001387 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001388 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001389 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001390 .video_inputs = 2,
1391 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001392 .tuner = -1,
1393 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001394 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001395 .muxsel = { 2, 2 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001396 .gpiomux = { },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001397 .no_msp34xx = 1,
1398 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001399 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001400 .tuner_type = -1,
1401 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001402 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001403 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001404 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001405 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1406 new Easy TV BT878 version (model CPH061)
1407 special thanks to Informatica Mieres for providing the card */
1408 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1409 .video_inputs = 3,
1410 .audio_inputs = 2,
1411 .tuner = 0,
1412 .svhs = 2,
1413 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001414 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001415 .gpiomux = { 1, 0, 4, 4 },
1416 .gpiomute = 9,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001417 .needs_tvaudio = 0,
1418 .pll = PLL_28,
1419 .tuner_type = TUNER_PHILIPS_PAL,
1420 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001421 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001422 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001423 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001424 /* Lukas Gebauer <geby@volny.cz> */
1425 .name = "ATI TV-Wonder",
1426 .video_inputs = 3,
1427 .audio_inputs = 1,
1428 .tuner = 0,
1429 .svhs = 2,
1430 .gpiomask = 0xf03f,
1431 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001432 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1433 .gpiomute = 0xbffe,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001434 .pll = PLL_28,
1435 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1436 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001437 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001438 },
1439
1440 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001441 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001442 /* Lukas Gebauer <geby@volny.cz> */
1443 .name = "ATI TV-Wonder VE",
1444 .video_inputs = 2,
1445 .audio_inputs = 1,
1446 .tuner = 0,
1447 .svhs = -1,
1448 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001449 .muxsel = { 2, 3, 0, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001450 .gpiomux = { 0, 0, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001451 .no_msp34xx = 1,
1452 .pll = PLL_28,
1453 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1454 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001455 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001456 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001457 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001458 /* DeeJay <deejay@westel900.net (2000S) */
1459 .name = "Lifeview FlyVideo 2000S LR90",
1460 .video_inputs = 3,
1461 .audio_inputs = 3,
1462 .tuner = 0,
1463 .svhs = 2,
1464 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001465 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001466 /* Radio changed from 1e80 to 0x800 to make
1467 FlyVideo2000S in .hu happy (gm)*/
1468 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001469 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1470 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001471 .audio_hook = fv2000s_audio,
1472 .no_msp34xx = 1,
1473 .no_tda9875 = 1,
1474 .needs_tvaudio = 1,
1475 .pll = PLL_28,
1476 .tuner_type = 5,
1477 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001478 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001479 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001480 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001481 .name = "Terratec TValueRadio",
1482 .video_inputs = 3,
1483 .audio_inputs = 1,
1484 .tuner = 0,
1485 .svhs = 2,
1486 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001487 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001488 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1489 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001490 .needs_tvaudio = 1,
1491 .pll = PLL_28,
1492 .tuner_type = TUNER_PHILIPS_PAL,
1493 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001494 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001495 .has_radio = 1,
1496 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001497 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001498 /* TANAKA Kei <peg00625@nifty.com> */
1499 .name = "IODATA GV-BCTV4/PCI",
1500 .video_inputs = 3,
1501 .audio_inputs = 1,
1502 .tuner = 0,
1503 .svhs = 2,
1504 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001505 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001506 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001507 .no_msp34xx = 1,
1508 .pll = PLL_28,
1509 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1510 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001511 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001512 .audio_hook = gvbctv3pci_audio,
1513 },
1514
1515 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001516 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001517 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1518 /* try "insmod msp3400 simple=0" if you have
1519 * sound problems with this card. */
1520 .video_inputs = 4,
1521 .audio_inputs = 1,
1522 .tuner = 0,
1523 .svhs = -1,
1524 .gpiomask = 0x4f8a00,
1525 /* 0x100000: 1=MSP enabled (0=disable again)
1526 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001527 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1528 .gpiomute = 0x947fff,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001529 /* tvtuner, radio, external,internal, mute, stereo
1530 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001531 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001532 .tuner_type = TUNER_MT2032,
1533 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001534 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001535 .pll = PLL_28,
1536 .has_radio = 1,
1537 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001538 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001539 /* Philip Blundell <pb@nexus.co.uk> */
1540 .name = "Active Imaging AIMMS",
1541 .video_inputs = 1,
1542 .audio_inputs = 0,
1543 .tuner = -1,
1544 .tuner_type = -1,
1545 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001546 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001547 .pll = PLL_28,
1548 .muxsel = { 2 },
1549 .gpiomask = 0
1550 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001551 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001552 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1553 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1554 .video_inputs = 3,
1555 .audio_inputs = 4,
1556 .tuner = 0,
1557 .svhs = 2,
1558 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001559 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001560 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1561 .gpiomute = 13,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001562 .needs_tvaudio = 1,
1563 .pll = PLL_28,
1564 .tuner_type = 25,
1565 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001566 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001567 .has_remote = 1,
1568 /* GPIO wiring:
1569 GPIO0: U4.A0 (hef4052bt)
1570 GPIO1: U4.A1
1571 GPIO2: U4.A1 (second hef4052bt)
1572 GPIO3: U4.nEN, U5.A0, A5.nEN
1573 GPIO8-15: vrd866b ?
1574 */
1575 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001576 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001577 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1578 .video_inputs = 4,
1579 .audio_inputs = 0,
1580 .tuner = -1,
1581 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001582 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001583 .pll = PLL_28,
1584 .no_msp34xx = 1,
1585 .tuner_type = UNSET,
1586 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001587 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001588 },
1589
1590 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001591 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001592 /* Dariusz Kowalewski <darekk@automex.pl> */
1593 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1594 .video_inputs = 4,
1595 .audio_inputs = 1,
1596 .tuner = 0,
1597 .svhs = 2,
1598 .gpiomask = 0x3f,
1599 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001600 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1601 .gpiomute = 0x09,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001602 .needs_tvaudio = 1,
1603 .no_msp34xx = 1,
1604 .no_tda9875 = 1,
1605 .pll = PLL_28,
1606 .tuner_type = 5,
1607 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001608 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001609 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1610 .has_radio = 1, /* Note: not all cards have radio */
1611 .has_remote = 1,
1612 /* GPIO wiring:
1613 GPIO0: A0 hef4052
1614 GPIO1: A1 hef4052
1615 GPIO3: nEN hef4052
1616 GPIO8-15: vrd866b
1617 GPIO20,22,23: R30,R29,R28
1618 */
1619 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001620 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001621 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1622 /* you must jumper JP5 for the card to work */
1623 .name = "Sensoray 311",
1624 .video_inputs = 5,
1625 .audio_inputs = 0,
1626 .tuner = -1,
1627 .svhs = 4,
1628 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001629 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001630 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001631 .needs_tvaudio = 0,
1632 .tuner_type = -1,
1633 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001634 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001635 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001636 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001637 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1638 .name = "RemoteVision MX (RV605)",
1639 .video_inputs = 16,
1640 .audio_inputs = 0,
1641 .tuner = -1,
1642 .svhs = -1,
1643 .gpiomask = 0x00,
1644 .gpiomask2 = 0x07ff,
1645 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1646 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1647 .no_msp34xx = 1,
1648 .no_tda9875 = 1,
1649 .tuner_type = -1,
1650 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001651 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001652 .muxsel_hook = rv605_muxsel,
1653 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001654 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001655 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1656 .video_inputs = 3,
1657 .audio_inputs = 2,
1658 .tuner = 0,
1659 .svhs = 2,
1660 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1661 .muxsel = { 2, 1, 1, },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001662 .gpiomux = { 0, 1, 2, 2 },
1663 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001664 .needs_tvaudio = 0,
1665 .tuner_type = TUNER_PHILIPS_PAL,
1666 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001667 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001668 .pll = PLL_28,
1669 .has_radio = 1,
1670 },
1671
1672 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001673 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001674 /* Masaki Suzuki <masaki@btree.org> */
1675 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1676 .video_inputs = 3,
1677 .audio_inputs = 1,
1678 .tuner = 0,
1679 .svhs = 2,
1680 .gpiomask = 0x140007,
1681 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001682 .gpiomux = { 0, 1, 2, 3 },
1683 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001684 .tuner_type = TUNER_PHILIPS_NTSC,
1685 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001686 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001687 .audio_hook = windvr_audio,
1688 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001689 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001690 .name = "GrandTec Multi Capture Card (Bt878)",
1691 .video_inputs = 4,
1692 .audio_inputs = 0,
1693 .tuner = -1,
1694 .svhs = -1,
1695 .gpiomask = 0,
1696 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001697 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001698 .needs_tvaudio = 0,
1699 .no_msp34xx = 1,
1700 .pll = PLL_28,
1701 .tuner_type = -1,
1702 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001703 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001704 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001705 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001706 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1707 .video_inputs = 4,
1708 .audio_inputs = 3,
1709 .tuner = 0,
1710 .svhs = 2,
1711 .gpiomask = 7,
1712 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001713 .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 -08001714 * This card lacks external Audio In, so we mute it on Ext. & Int.
1715 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1716 * This card lacks PCI subsystem ID, sigh.
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001717 * gpiomux =1: lower volume, 2+3: mute
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001718 * btwincap uses 0x80000/0x80003
1719 */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001720 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001721 .needs_tvaudio = 0,
1722 .no_msp34xx = 1,
1723 .pll = PLL_28,
1724 .tuner_type = 5,
1725 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001726 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001727 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1728 radio signal strength indicators work fine. */
1729 .has_radio = 1,
1730 /* GPIO Info:
1731 GPIO0,1: HEF4052 A0,A1
1732 GPIO2: HEF4052 nENABLE
1733 GPIO3-7: n.c.
1734 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1735 GPIO14,15: ??
1736 GPIO16-21: n.c.
1737 GPIO22,23: ??
1738 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1739 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001740 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001741 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1742 .name = "DSP Design TCVIDEO",
1743 .video_inputs = 4,
1744 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001745 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001746 .pll = PLL_28,
1747 .tuner_type = -1,
1748 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001749 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001750 },
1751
1752 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001753 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001754 .name = "Hauppauge WinTV PVR",
1755 .video_inputs = 4,
1756 .audio_inputs = 1,
1757 .tuner = 0,
1758 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001759 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001760 .needs_tvaudio = 1,
1761 .pll = PLL_28,
1762 .tuner_type = -1,
1763 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001764 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001765
1766 .gpiomask = 7,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001767 .gpiomux = {7},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001768 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001769 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001770 .name = "IODATA GV-BCTV5/PCI",
1771 .video_inputs = 3,
1772 .audio_inputs = 1,
1773 .tuner = 0,
1774 .svhs = 2,
1775 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001776 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001777 .gpiomux = {0x030000, 0x010000, 0, 0 },
1778 .gpiomute = 0x020000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001779 .no_msp34xx = 1,
1780 .pll = PLL_28,
1781 .tuner_type = TUNER_PHILIPS_NTSC_M,
1782 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001783 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001784 .audio_hook = gvbctv5pci_audio,
1785 .has_radio = 1,
1786 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001787 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001788 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1789 .video_inputs = 4, /* id-inputs-clock */
1790 .audio_inputs = 0,
1791 .tuner = -1,
1792 .svhs = 3,
1793 .muxsel = { 3, 2, 0, 1 },
1794 .pll = PLL_28,
1795 .tuner_type = -1,
1796 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001797 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001798 .no_msp34xx = 1,
1799 .no_tda9875 = 1,
1800 .no_tda7432 = 1,
1801 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001802 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001803 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1804 .video_inputs = 3,
1805 .audio_inputs = 0,
1806 .tuner = -1,
1807 .svhs = 2,
1808 .muxsel = { 2, 3, 1 },
1809 .pll = PLL_28,
1810 .tuner_type = -1,
1811 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001812 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001813 .no_msp34xx = 1,
1814 .no_tda9875 = 1,
1815 .no_tda7432 = 1,
1816 },
1817
1818 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001819 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001820 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1821 .video_inputs = 2,
1822 .audio_inputs = 0,
1823 .tuner = -1,
1824 .svhs = 1,
1825 .muxsel = { 3, 1 },
1826 .pll = PLL_28,
1827 .tuner_type = -1,
1828 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001829 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001830 .no_msp34xx = 1,
1831 .no_tda9875 = 1,
1832 .no_tda7432 = 1,
1833 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001834 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001835 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1836 .video_inputs = 1,
1837 .audio_inputs = 0,
1838 .tuner = -1,
1839 .svhs = -1,
1840 .muxsel = { 0 },
1841 .pll = PLL_28,
1842 .tuner_type = -1,
1843 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001844 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001845 .no_msp34xx = 1,
1846 .no_tda9875 = 1,
1847 .no_tda7432 = 1,
1848 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001849 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001850 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1851 .video_inputs = 2,
1852 .audio_inputs = 0,
1853 .tuner = -1,
1854 .svhs = 1,
1855 .muxsel = { 0, 1 },
1856 .pll = PLL_28,
1857 .tuner_type = -1,
1858 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001859 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001860 .no_msp34xx = 1,
1861 .no_tda9875 = 1,
1862 .no_tda7432 = 1,
1863 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001864 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001865 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1866 .video_inputs = 1,
1867 .audio_inputs = 1,
1868 .tuner = -1,
1869 .svhs = -1,
1870 .muxsel = { 0 },
1871 .pll = PLL_28,
1872 .tuner_type = UNSET,
1873 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001874 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001875 .no_msp34xx = 1,
1876 .no_tda9875 = 1,
1877 .no_tda7432 = 1,
1878 },
1879
1880 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001881 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001882 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1883 .video_inputs = 2,
1884 .audio_inputs = 1,
1885 .tuner = -1,
1886 .svhs = 1,
1887 .muxsel = { 0, 1 },
1888 .pll = PLL_28,
1889 .tuner_type = UNSET,
1890 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001891 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001892 .no_msp34xx = 1,
1893 .no_tda9875 = 1,
1894 .no_tda7432 = 1,
1895 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001896 [BTTV_BOARD_OSPREY2x0] = {
Michael Krufky52398ef2006-05-26 02:13:15 -03001897 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001898 .video_inputs = 2,
1899 .audio_inputs = 1,
1900 .tuner = -1,
1901 .svhs = 1,
1902 .muxsel = { 2, 3 },
1903 .pll = PLL_28,
1904 .tuner_type = UNSET,
1905 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001906 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001907 .no_msp34xx = 1,
1908 .no_tda9875 = 1,
1909 .no_tda7432 = 1,
1910 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001911 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001912 .name = "Osprey 500", /* 500 */
1913 .video_inputs = 2,
1914 .audio_inputs = 1,
1915 .tuner = -1,
1916 .svhs = 1,
1917 .muxsel = { 2, 3 },
1918 .pll = PLL_28,
1919 .tuner_type = -1,
1920 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001921 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001922 .no_msp34xx = 1,
1923 .no_tda9875 = 1,
1924 .no_tda7432 = 1,
1925 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001926 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001927 .name = "Osprey 540", /* 540 */
1928 .video_inputs = 4,
1929 .audio_inputs = 1,
1930 .tuner = -1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001931 .pll = PLL_28,
1932 .tuner_type = -1,
1933 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001934 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001935 .no_msp34xx = 1,
1936 .no_tda9875 = 1,
1937 .no_tda7432 = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001938 },
1939
1940 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001941 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001942 .name = "Osprey 2000", /* 2000 */
1943 .video_inputs = 2,
1944 .audio_inputs = 1,
1945 .tuner = -1,
1946 .svhs = 1,
1947 .muxsel = { 2, 3 },
1948 .pll = PLL_28,
1949 .tuner_type = UNSET,
1950 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001951 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001952 .no_msp34xx = 1,
1953 .no_tda9875 = 1,
1954 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1955 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001956 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001957 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1958 .name = "IDS Eagle",
1959 .video_inputs = 4,
1960 .audio_inputs = 0,
1961 .tuner = -1,
1962 .tuner_type = -1,
1963 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001964 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001965 .svhs = -1,
1966 .gpiomask = 0,
1967 .muxsel = { 0, 1, 2, 3 },
1968 .muxsel_hook = eagle_muxsel,
1969 .no_msp34xx = 1,
1970 .no_tda9875 = 1,
1971 .pll = PLL_28,
1972 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001973 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001974 .name = "Pinnacle PCTV Sat",
1975 .video_inputs = 2,
1976 .audio_inputs = 0,
1977 .svhs = 1,
1978 .tuner = -1,
1979 .tuner_type = -1,
1980 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001981 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001982 .no_msp34xx = 1,
1983 .no_tda9875 = 1,
1984 .no_tda7432 = 1,
Mauro Carvalho Chehabd2be8932006-10-02 23:52:48 -03001985 .muxsel = { 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001986 .pll = PLL_28,
1987 .no_gpioirq = 1,
1988 .has_dvb = 1,
1989 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001990 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001991 .name = "Formac ProTV II (bt878)",
1992 .video_inputs = 4,
1993 .audio_inputs = 1,
1994 .tuner = 0,
1995 .svhs = 3,
1996 .gpiomask = 2,
1997 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02001998 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001999 .gpiomux = { 2, 2, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002000 .pll = PLL_28,
2001 .has_radio = 1,
2002 .tuner_type = TUNER_PHILIPS_PAL,
2003 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002004 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002005 /* sound routing:
2006 GPIO=0x00,0x01,0x03: mute (?)
2007 0x02: both TV and radio (tuner: FM1216/I)
2008 The card has onboard audio connectors labeled "cdrom" and "board",
2009 not soldered here, though unknown wiring.
2010 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002011 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002012 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002013
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002014 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002015 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002016 .name = "MachTV",
2017 .video_inputs = 3,
2018 .audio_inputs = 1,
2019 .tuner = 0,
2020 .svhs = -1,
2021 .gpiomask = 7,
2022 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002023 .gpiomux = { 0, 1, 2, 3},
2024 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002025 .needs_tvaudio = 1,
2026 .tuner_type = 5,
2027 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002028 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08002029 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002030 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002031 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002032 .name = "Euresys Picolo",
2033 .video_inputs = 3,
2034 .audio_inputs = 0,
2035 .tuner = -1,
2036 .svhs = 2,
2037 .gpiomask = 0,
2038 .no_msp34xx = 1,
2039 .no_tda9875 = 1,
2040 .no_tda7432 = 1,
2041 .muxsel = { 2, 0, 1},
2042 .pll = PLL_28,
2043 .tuner_type = UNSET,
2044 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002045 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002046 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002047 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002048 /* Luc Van Hoeylandt <luc@e-magic.be> */
2049 .name = "ProVideo PV150", /* 0x4f */
2050 .video_inputs = 2,
2051 .audio_inputs = 0,
2052 .tuner = -1,
2053 .svhs = -1,
2054 .gpiomask = 0,
2055 .muxsel = { 2, 3 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002056 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002057 .needs_tvaudio = 0,
2058 .no_msp34xx = 1,
2059 .pll = PLL_28,
2060 .tuner_type = UNSET,
2061 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002062 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002063 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002064 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002065 /* Hiroshi Takekawa <sian@big.or.jp> */
2066 /* This card lacks subsystem ID */
2067 .name = "AD-TVK503", /* 0x63 */
2068 .video_inputs = 4,
2069 .audio_inputs = 1,
2070 .tuner = 0,
2071 .svhs = 2,
2072 .gpiomask = 0x001e8007,
2073 .muxsel = { 2, 3, 1, 0 },
2074 /* Tuner, Radio, external, internal, off, on */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002075 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2076 .gpiomute = 0x0f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002077 .needs_tvaudio = 0,
2078 .no_msp34xx = 1,
2079 .pll = PLL_28,
2080 .tuner_type = 2,
2081 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002082 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002083 .audio_hook = adtvk503_audio,
2084 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002085
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002086 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002087 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002088 .name = "Hercules Smart TV Stereo",
2089 .video_inputs = 4,
2090 .audio_inputs = 1,
2091 .tuner = 0,
2092 .svhs = 2,
2093 .gpiomask = 0x00,
2094 .muxsel = { 2, 3, 1, 1 },
2095 .needs_tvaudio = 1,
2096 .no_msp34xx = 1,
2097 .pll = PLL_28,
2098 .tuner_type = 5,
2099 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002100 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002101 /* Notes:
2102 - card lacks subsystem ID
2103 - stereo variant w/ daughter board with tda9874a @0xb0
2104 - Audio Routing:
2105 always from tda9874 independent of GPIO (?)
2106 external line in: unknown
2107 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2108 hef4053 (instead 4052) for unknown function
2109 */
2110 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002111 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002112 .name = "Pace TV & Radio Card",
2113 .video_inputs = 4,
2114 .audio_inputs = 1,
2115 .tuner = 0,
2116 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002117 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002118 .gpiomask = 0,
2119 .no_tda9875 = 1,
2120 .no_tda7432 = 1,
2121 .tuner_type = 1,
2122 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002123 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002124 .has_radio = 1,
2125 .pll = PLL_28,
2126 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2127 only internal line out: (4pin header) RGGL
2128 Radio must be decoded by msp3410d (not routed through)*/
2129 /*
2130 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2131 */
2132 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002133 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002134 /* Chris Willing <chris@vislab.usyd.edu.au> */
2135 .name = "IVC-200",
2136 .video_inputs = 1,
2137 .audio_inputs = 0,
2138 .tuner = -1,
2139 .tuner_type = -1,
2140 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002141 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002142 .svhs = -1,
2143 .gpiomask = 0xdf,
2144 .muxsel = { 2 },
2145 .pll = PLL_28,
2146 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002147 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002148 .name = "Grand X-Guard / Trust 814PCI",
2149 .video_inputs = 16,
2150 .audio_inputs = 0,
2151 .tuner = -1,
2152 .svhs = -1,
2153 .tuner_type = 4,
2154 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002155 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002156 .gpiomask2 = 0xff,
2157 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2158 .muxsel_hook = xguard_muxsel,
2159 .no_msp34xx = 1,
2160 .no_tda9875 = 1,
2161 .no_tda7432 = 1,
2162 .pll = PLL_28,
2163 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002164
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002165 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002166 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002167 .name = "Nebula Electronics DigiTV",
2168 .video_inputs = 1,
2169 .tuner = -1,
2170 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002171 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002172 .no_msp34xx = 1,
2173 .no_tda9875 = 1,
2174 .no_tda7432 = 1,
2175 .pll = PLL_28,
2176 .tuner_type = -1,
2177 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002178 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002179 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002180 .has_remote = 1,
2181 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002182 .no_gpioirq = 1,
2183 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002184 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002185 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2186 .name = "ProVideo PV143",
2187 .video_inputs = 4,
2188 .audio_inputs = 0,
2189 .tuner = -1,
2190 .svhs = -1,
2191 .gpiomask = 0,
2192 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002193 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002194 .needs_tvaudio = 0,
2195 .no_msp34xx = 1,
2196 .pll = PLL_28,
2197 .tuner_type = -1,
2198 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002199 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002200 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002201 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002202 /* M.Klahr@phytec.de */
2203 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2204 .video_inputs = 4,
2205 .audio_inputs = 0,
2206 .tuner = -1, /* card has no tuner */
2207 .svhs = 3,
2208 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002209 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002210 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002211 .needs_tvaudio = 1,
2212 .pll = PLL_28,
2213 .tuner_type = -1,
2214 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002215 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002216 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002217 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002218 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2219 .video_inputs = 4,
2220 .audio_inputs = 0,
2221 .tuner = -1, /* card has no tuner */
2222 .svhs = 3,
2223 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002224 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002225 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002226 .needs_tvaudio = 1,
2227 .pll = PLL_28,
2228 .tuner_type = -1,
2229 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002230 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002231 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002232
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002233 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002234 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002235 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2236 .video_inputs = 10,
2237 .audio_inputs = 0,
2238 .tuner = -1, /* card has no tuner */
2239 .svhs = 9,
2240 .gpiomask = 0x00,
2241 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2242 via the upper nibble of muxsel. here: used for
2243 xternal video-mux */
2244 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002245 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002246 .needs_tvaudio = 1,
2247 .pll = PLL_28,
2248 .tuner_type = -1,
2249 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002250 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002251 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002252 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002253 .name = "PHYTEC VD-009 Combi (bt878)",
2254 .video_inputs = 10,
2255 .audio_inputs = 0,
2256 .tuner = -1, /* card has no tuner */
2257 .svhs = 9,
2258 .gpiomask = 0x00,
2259 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2260 via the upper nibble of muxsel. here: used for
2261 xternal video-mux */
2262 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002263 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002264 .needs_tvaudio = 1,
2265 .pll = PLL_28,
2266 .tuner_type = -1,
2267 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002268 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002269 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002270 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002271 .name = "IVC-100",
2272 .video_inputs = 4,
2273 .audio_inputs = 0,
2274 .tuner = -1,
2275 .tuner_type = -1,
2276 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002277 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002278 .svhs = -1,
2279 .gpiomask = 0xdf,
2280 .muxsel = { 2, 3, 1, 0 },
2281 .pll = PLL_28,
2282 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002283 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002284 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2285 .name = "IVC-120G",
2286 .video_inputs = 16,
2287 .audio_inputs = 0, /* card has no audio */
2288 .tuner = -1, /* card has no tuner */
2289 .tuner_type = -1,
2290 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002291 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002292 .svhs = -1, /* card has no svhs */
2293 .needs_tvaudio = 0,
2294 .no_msp34xx = 1,
2295 .no_tda9875 = 1,
2296 .no_tda7432 = 1,
2297 .gpiomask = 0x00,
2298 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2299 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2300 .muxsel_hook = ivc120_muxsel,
2301 .pll = PLL_28,
2302 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002303
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002304 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002305 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002306 .name = "pcHDTV HD-2000 TV",
2307 .video_inputs = 4,
2308 .audio_inputs = 1,
2309 .tuner = 0,
2310 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002311 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002312 .tuner_type = TUNER_PHILIPS_ATSC,
2313 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002314 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002315 .has_dvb = 1,
2316 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002317 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002318 .name = "Twinhan DST + clones",
2319 .no_msp34xx = 1,
2320 .no_tda9875 = 1,
2321 .no_tda7432 = 1,
2322 .tuner_type = TUNER_ABSENT,
2323 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002324 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002325 .no_video = 1,
2326 .has_dvb = 1,
2327 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002328 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002329 .name = "Winfast VC100",
2330 .video_inputs = 3,
2331 .audio_inputs = 0,
2332 .svhs = 1,
2333 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002334 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002335 .no_msp34xx = 1,
2336 .no_tda9875 = 1,
2337 .no_tda7432 = 1,
2338 .tuner_type = TUNER_ABSENT,
2339 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002340 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002341 .pll = PLL_28,
2342 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002343 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002344 .name = "Teppro TEV-560/InterVision IV-560",
2345 .video_inputs = 3,
2346 .audio_inputs = 1,
2347 .tuner = 0,
2348 .svhs = 2,
2349 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002350 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002351 .gpiomux = { 1, 1, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002352 .needs_tvaudio = 1,
2353 .tuner_type = TUNER_PHILIPS_PAL,
2354 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002355 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002356 .pll = PLL_35,
2357 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002358
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002359 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002360 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002361 .name = "SIMUS GVC1100",
2362 .video_inputs = 4,
2363 .audio_inputs = 0,
2364 .tuner = -1,
2365 .svhs = -1,
2366 .tuner_type = -1,
2367 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002368 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002369 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002370 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002371 .gpiomask = 0x3F,
2372 .muxsel_hook = gvc1100_muxsel,
2373 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002374 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002375 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2376 .name = "NGS NGSTV+",
2377 .video_inputs = 3,
2378 .tuner = 0,
2379 .svhs = 2,
2380 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002381 .muxsel = { 2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002382 .gpiomux = { 0, 0, 0, 0 },
2383 .gpiomute = 0x000003,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002384 .pll = PLL_28,
2385 .tuner_type = TUNER_PHILIPS_PAL,
2386 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002387 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002388 .has_remote = 1,
2389 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002390 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002391 /* http://linuxmedialabs.com */
2392 .name = "LMLBT4",
2393 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2394 .audio_inputs = 0,
2395 .tuner = -1,
2396 .svhs = -1,
2397 .muxsel = { 2, 3, 1, 0 },
2398 .no_msp34xx = 1,
2399 .no_tda9875 = 1,
2400 .no_tda7432 = 1,
2401 .needs_tvaudio = 0,
2402 .tuner_type = -1,
2403 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002404 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002405 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002406 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002407 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2408 .name = "Tekram M205 PRO",
2409 .video_inputs = 3,
2410 .audio_inputs = 1,
2411 .tuner = 0,
2412 .tuner_type = TUNER_PHILIPS_PAL,
2413 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002414 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002415 .svhs = 2,
2416 .needs_tvaudio = 0,
2417 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002418 .muxsel = { 2, 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002419 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002420 .pll = PLL_28,
2421 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002422
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002423 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002424 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002425 /* Javier Cendan Ares <jcendan@lycos.es> */
2426 /* bt878 TV + FM without subsystem ID */
2427 .name = "Conceptronic CONTVFMi",
2428 .video_inputs = 3,
2429 .audio_inputs = 1,
2430 .tuner = 0,
2431 .svhs = 2,
2432 .gpiomask = 0x008007,
2433 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002434 .gpiomux = { 0, 1, 2, 2 },
2435 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002436 .needs_tvaudio = 0,
2437 .pll = PLL_28,
2438 .tuner_type = TUNER_PHILIPS_PAL,
2439 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002440 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002441 .has_remote = 1,
2442 .has_radio = 1,
2443 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002444 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002445 /*Eric DEBIEF <debief@telemsa.com>*/
2446 /*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 -08002447 /* 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 -08002448 /*0x79 in bttv.h*/
2449 .name = "Euresys Picolo Tetra",
2450 .video_inputs = 4,
2451 .audio_inputs = 0,
2452 .tuner = -1,
2453 .svhs = -1,
2454 .gpiomask = 0,
2455 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2456 .no_msp34xx = 1,
2457 .no_tda9875 = 1,
2458 .no_tda7432 = 1,
2459 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002460 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002461 .pll = PLL_28,
2462 .needs_tvaudio = 0,
2463 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2464 .tuner_type = -1,
2465 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002466 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002467 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002468 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002469 /* Spirit TV Tuner from http://spiritmodems.com.au */
2470 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2471 .name = "Spirit TV Tuner",
2472 .video_inputs = 3,
2473 .audio_inputs = 1,
2474 .tuner = 0,
2475 .svhs = 2,
2476 .gpiomask = 0x0000000f,
2477 .muxsel = { 2, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002478 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002479 .tuner_type = TUNER_TEMIC_PAL,
2480 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002481 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002482 .no_msp34xx = 1,
2483 .no_tda9875 = 1,
2484 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002485 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002486 /* Wolfram Joost <wojo@frokaschwei.de> */
2487 .name = "AVerMedia AVerTV DVB-T 771",
2488 .video_inputs = 2,
2489 .svhs = 1,
2490 .tuner = -1,
2491 .tuner_type = TUNER_ABSENT,
2492 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002493 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002494 .muxsel = { 3 , 3 },
2495 .no_msp34xx = 1,
2496 .no_tda9875 = 1,
2497 .no_tda7432 = 1,
2498 .pll = PLL_28,
2499 .has_dvb = 1,
2500 .no_gpioirq = 1,
2501 .has_remote = 1,
2502 },
2503 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002504 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002505 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002506 /* 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 -08002507 .name = "AverMedia AverTV DVB-T 761",
2508 .video_inputs = 2,
2509 .tuner = -1,
2510 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002511 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002512 .no_msp34xx = 1,
2513 .no_tda9875 = 1,
2514 .no_tda7432 = 1,
2515 .pll = PLL_28,
2516 .tuner_type = -1,
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 .has_dvb = 1,
2520 .no_gpioirq = 1,
2521 .has_remote = 1,
2522 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002523 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002524 /* andre.schwarz@matrix-vision.de */
2525 .name = "MATRIX Vision Sigma-SQ",
2526 .video_inputs = 16,
2527 .audio_inputs = 0,
2528 .tuner = -1,
2529 .svhs = -1,
2530 .gpiomask = 0x0,
2531 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2532 3, 3, 3, 3, 3, 3, 3, 3 },
2533 .muxsel_hook = sigmaSQ_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002534 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002535 .no_msp34xx = 1,
2536 .pll = PLL_28,
2537 .tuner_type = -1,
2538 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002539 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002540 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002541 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002542 /* andre.schwarz@matrix-vision.de */
2543 .name = "MATRIX Vision Sigma-SLC",
2544 .video_inputs = 4,
2545 .audio_inputs = 0,
2546 .tuner = -1,
2547 .svhs = -1,
2548 .gpiomask = 0x0,
2549 .muxsel = { 2, 2, 2, 2 },
2550 .muxsel_hook = sigmaSLC_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002551 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002552 .no_msp34xx = 1,
2553 .pll = PLL_28,
2554 .tuner_type = -1,
2555 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002556 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002557 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002558 /* BTTV_BOARD_APAC_VIEWCOMP */
2559 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002560 /* Attila Kondoros <attila.kondoros@chello.hu> */
2561 /* bt878 TV + FM 0x00000000 subsystem ID */
2562 .name = "APAC Viewcomp 878(AMAX)",
2563 .video_inputs = 2,
2564 .audio_inputs = 1,
2565 .tuner = 0,
2566 .svhs = -1,
2567 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002568 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002569 .gpiomux = { 2, 0, 0, 0 },
2570 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002571 .needs_tvaudio = 0,
2572 .pll = PLL_28,
2573 .tuner_type = TUNER_PHILIPS_PAL,
2574 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002575 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002576 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2577 .has_radio = 1, /* not every card has radio */
2578 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002579
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002580 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002581 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002582 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2583 .name = "DViCO FusionHDTV DVB-T Lite",
2584 .tuner = -1,
2585 .no_msp34xx = 1,
2586 .no_tda9875 = 1,
2587 .no_tda7432 = 1,
2588 .pll = PLL_28,
2589 .no_video = 1,
2590 .has_dvb = 1,
2591 .tuner_type = -1,
2592 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002593 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002594 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002595 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002596 /* Steven <photon38@pchome.com.tw> */
2597 .name = "V-Gear MyVCD",
2598 .video_inputs = 3,
2599 .audio_inputs = 1,
2600 .tuner = 0,
2601 .svhs = 2,
2602 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002603 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002604 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2605 .gpiomute = 0x31,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002606 .no_msp34xx = 1,
2607 .pll = PLL_28,
2608 .tuner_type = TUNER_PHILIPS_NTSC_M,
2609 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002610 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002611 .has_radio = 0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002612 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002613 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002614 /* Rick C <cryptdragoon@gmail.com> */
2615 .name = "Super TV Tuner",
2616 .video_inputs = 4,
2617 .audio_inputs = 1,
2618 .tuner = 0,
2619 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002620 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002621 .tuner_type = TUNER_PHILIPS_NTSC,
2622 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002623 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002624 .gpiomask = 0x008007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002625 .gpiomux = { 0, 0x000001,0,0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002626 .needs_tvaudio = 1,
2627 .has_radio = 1,
2628 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002629 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002630 /* Chris Fanning <video4linux@haydon.net> */
2631 .name = "Tibet Systems 'Progress DVR' CS16",
2632 .video_inputs = 16,
2633 .audio_inputs = 0,
2634 .tuner = -1,
2635 .svhs = -1,
2636 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2637 .pll = PLL_28,
2638 .no_msp34xx = 1,
2639 .no_tda9875 = 1,
2640 .no_tda7432 = 1,
2641 .tuner_type = -1,
2642 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002643 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002644 .muxsel_hook = tibetCS16_muxsel,
2645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002646 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002647 /* Bill Brack <wbrack@mmm.com.hk> */
2648 /*
2649 * Note that, because of the card's wiring, the "master"
2650 * BT878A chip (i.e. the one which controls the analog switch
2651 * and must use this card type) is the 2nd one detected. The
2652 * other 3 chips should use card type 0x85, whose description
2653 * follows this one. There is a EEPROM on the card (which is
2654 * connected to the I2C of one of those other chips), but is
2655 * not currently handled. There is also a facility for a
2656 * "monitor", which is also not currently implemented.
2657 */
2658 .name = "Kodicom 4400R (master)",
2659 .video_inputs = 16,
2660 .audio_inputs = 0,
2661 .tuner = -1,
2662 .tuner_type = -1,
2663 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002664 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002665 .svhs = -1,
2666 /* GPIO bits 0-9 used for analog switch:
2667 * 00 - 03: camera selector
2668 * 04 - 06: channel (controller) selector
2669 * 07: data (1->on, 0->off)
2670 * 08: strobe
2671 * 09: reset
2672 * bit 16 is input from sync separator for the channel
2673 */
2674 .gpiomask = 0x0003ff,
2675 .no_gpioirq = 1,
2676 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2677 .pll = PLL_28,
2678 .no_msp34xx = 1,
2679 .no_tda7432 = 1,
2680 .no_tda9875 = 1,
2681 .muxsel_hook = kodicom4400r_muxsel,
2682 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002683 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002684 /* Bill Brack <wbrack@mmm.com.hk> */
2685 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2686 * one which controls the analog switch, and must use the card type)
2687 * is the 2nd one detected. The other 3 chips should use this card
2688 * type
2689 */
2690 .name = "Kodicom 4400R (slave)",
2691 .video_inputs = 16,
2692 .audio_inputs = 0,
2693 .tuner = -1,
2694 .tuner_type = -1,
2695 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002696 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002697 .svhs = -1,
2698 .gpiomask = 0x010000,
2699 .no_gpioirq = 1,
2700 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2701 .pll = PLL_28,
2702 .no_msp34xx = 1,
2703 .no_tda7432 = 1,
2704 .no_tda9875 = 1,
2705 .muxsel_hook = kodicom4400r_muxsel,
2706 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002707 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002708 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002709 /* Michael Henson <mhenson@clarityvi.com> */
2710 /* Adlink RTV24 with special unlock codes */
2711 .name = "Adlink RTV24",
2712 .video_inputs = 4,
2713 .audio_inputs = 1,
2714 .tuner = 0,
2715 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002716 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002717 .tuner_type = -1,
2718 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002719 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002720 .pll = PLL_28,
2721 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002722 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002723 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002724 /* Michael Krufky <mkrufky@m1k.net> */
2725 .name = "DViCO FusionHDTV 5 Lite",
2726 .tuner = 0,
Michael Krufky9c26c8b2006-04-27 01:29:17 -03002727 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002728 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002729 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002730 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002731 .audio_inputs = 1,
2732 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002733 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002734 .gpiomask = 0x00e00007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002735 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2736 .gpiomute = 0x00c00007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002737 .no_msp34xx = 1,
2738 .no_tda9875 = 1,
2739 .no_tda7432 = 1,
2740 .has_dvb = 1,
2741 },
2742 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002743 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03002744 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002745 .name = "Acorp Y878F",
2746 .video_inputs = 3,
2747 .audio_inputs = 1,
2748 .tuner = 0,
2749 .svhs = 2,
2750 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002751 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002752 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2753 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002754 .needs_tvaudio = 1,
2755 .pll = PLL_28,
2756 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2757 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002758 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002759 .has_radio = 1,
2760 },
2761 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002762 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002763 .name = "Conceptronic CTVFMi v2",
2764 .video_inputs = 3,
2765 .audio_inputs = 1,
2766 .tuner = 0,
2767 .svhs = 2,
2768 .gpiomask = 0x001c0007,
2769 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002770 .gpiomux = { 0, 1, 2, 2 },
2771 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002772 .needs_tvaudio = 0,
2773 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002774 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002775 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002776 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002777 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002778 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002779 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002780 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002781 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002782 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2783 .video_inputs = 5,
2784 .audio_inputs = 1,
2785 .tuner = 0,
2786 .svhs = 3,
2787 .gpiomask = 0x01fe00,
2788 .muxsel = { 2,3,1,1,-1 },
2789 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002790 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2791 .gpiomute = 0x12400,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002792 .no_msp34xx = 1,
2793 .pll = PLL_28,
2794 .tuner_type = TUNER_LG_PAL_FM,
2795 .tuner_addr = ADDR_UNSET,
2796 .radio_addr = ADDR_UNSET,
2797 .has_remote = 1,
2798 },
2799 /* ---- card 0x8b ---------------------------------- */
2800 [BTTV_BOARD_PV_M4900] = {
2801 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2802 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2803 .video_inputs = 3,
2804 .audio_inputs = 1,
2805 .tuner = 0,
2806 .svhs = 2,
2807 .gpiomask = 0x3f,
2808 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002809 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2810 .gpiomute = 0x29,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002811 .no_msp34xx = 1,
2812 .pll = PLL_28,
2813 .tuner_type = TUNER_YMEC_TVF_5533MF,
2814 .tuner_addr = ADDR_UNSET,
2815 .radio_addr = ADDR_UNSET,
2816 .has_radio = 1,
2817 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002818 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002819 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002820 [BTTV_BOARD_OSPREY440] = {
2821 .name = "Osprey 440",
2822 .video_inputs = 1,
2823 .audio_inputs = 1,
2824 .tuner = -1,
2825 .svhs = 1,
2826 .muxsel = { 2 },
2827 .pll = PLL_28,
2828 .tuner_type = UNSET,
2829 .tuner_addr = ADDR_UNSET,
2830 .radio_addr = ADDR_UNSET,
2831 .no_msp34xx = 1,
2832 .no_tda9875 = 1,
2833 .no_tda7432 = 1,
2834 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002835 /* ---- card 0x8d ---------------------------------- */
2836 [BTTV_BOARD_ASOUND_SKYEYE] = {
2837 .name = "Asound Skyeye PCTV",
2838 .video_inputs = 3,
2839 .audio_inputs = 1,
2840 .tuner = 0,
2841 .svhs = 2,
2842 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002843 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002844 .gpiomux = { 2, 0, 0, 0 },
2845 .gpiomute = 1,
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002846 .needs_tvaudio = 1,
2847 .pll = PLL_28,
2848 .tuner_type = 2,
2849 .tuner_addr = ADDR_UNSET,
2850 .radio_addr = ADDR_UNSET,
2851 },
Bill Pechter633323f2005-11-13 16:07:50 -08002852 /* ---- card 0x8e ---------------------------------- */
2853 [BTTV_BOARD_SABRENT_TVFM] = {
2854 .name = "Sabrent TV-FM (bttv version)",
2855 .video_inputs = 3,
2856 .audio_inputs = 1,
2857 .tuner = 0,
2858 .svhs = 2,
2859 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002860 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002861 .gpiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002862 .no_msp34xx = 1,
2863 .no_tda9875 = 1,
2864 .no_tda7432 = 1,
2865 .pll = PLL_28,
2866 .tuner_type = TUNER_TNF_5335MF,
2867 .tuner_addr = ADDR_UNSET,
2868 .has_radio = 1,
2869 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002870 /* ---- card 0x8f ---------------------------------- */
2871 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2872 .name = "Hauppauge ImpactVCB (bt878)",
2873 .video_inputs = 4,
2874 .audio_inputs = 0,
2875 .tuner = -1,
2876 .svhs = -1,
2877 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002878 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002879 .no_msp34xx = 1,
2880 .no_tda9875 = 1,
2881 .no_tda7432 = 1,
2882 .tuner_type = -1,
2883 .tuner_addr = ADDR_UNSET,
2884 .radio_addr = ADDR_UNSET,
2885 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002886 [BTTV_BOARD_MACHTV_MAGICTV] = {
2887 /* Julian Calaby <julian.calaby@gmail.com>
2888 * Slightly different from original MachTV definition (0x60)
2889
2890 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2891 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2892 * properly (methinks) causing no keyup bits being set */
2893
2894 .name = "MagicTV", /* rebranded MachTV */
2895 .video_inputs = 3,
2896 .audio_inputs = 1,
2897 .tuner = 0,
2898 .svhs = 2,
2899 .gpiomask = 7,
2900 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002901 .gpiomux = { 0, 1, 2, 3 },
2902 .gpiomute = 4,
Julian Calaby2d05ae62006-01-11 19:40:09 -02002903 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2904 .tuner_addr = ADDR_UNSET,
2905 .radio_addr = ADDR_UNSET,
2906 .pll = PLL_28,
2907 .has_radio = 1,
2908 .has_remote = 1,
2909 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002910};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002911
2912static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2913
2914/* ----------------------------------------------------------------------- */
2915
2916static unsigned char eeprom_data[256];
2917
2918/*
2919 * identify card
2920 */
2921void __devinit bttv_idcard(struct bttv *btv)
2922{
2923 unsigned int gpiobits;
2924 int i,type;
2925 unsigned short tmp;
2926
2927 /* read PCI subsystem ID */
2928 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2929 btv->cardid = tmp << 16;
2930 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2931 btv->cardid |= tmp;
2932
2933 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2934 /* look for the card */
2935 for (type = -1, i = 0; cards[i].id != 0; i++)
2936 if (cards[i].id == btv->cardid)
2937 type = i;
2938
2939 if (type != -1) {
2940 /* found it */
2941 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2942 "PCI subsystem ID is %04x:%04x\n",
2943 btv->c.nr,cards[type].name,cards[type].cardnr,
2944 btv->cardid & 0xffff,
2945 (btv->cardid >> 16) & 0xffff);
2946 btv->c.type = cards[type].cardnr;
2947 } else {
2948 /* 404 */
2949 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2950 btv->c.nr, btv->cardid & 0xffff,
2951 (btv->cardid >> 16) & 0xffff);
2952 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002953 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002954 }
2955 }
2956
2957 /* let the user override the autodetected type */
2958 if (card[btv->c.nr] < bttv_num_tvcards)
2959 btv->c.type=card[btv->c.nr];
2960
2961 /* print which card config we are using */
2962 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2963 bttv_tvcards[btv->c.type].name, btv->c.type,
2964 card[btv->c.nr] < bttv_num_tvcards
2965 ? "insmod option" : "autodetected");
2966
2967 /* overwrite gpio stuff ?? */
2968 if (UNSET == audioall && UNSET == audiomux[0])
2969 return;
2970
2971 if (UNSET != audiomux[0]) {
2972 gpiobits = 0;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03002973 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002974 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07002975 gpiobits |= audiomux[i];
2976 }
2977 } else {
2978 gpiobits = audioall;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03002979 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002980 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002981 }
2982 }
2983 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2984 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2985 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2986 for (i = 0; i < 5; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002987 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002988 }
2989 printk("\n");
2990}
2991
2992/*
2993 * (most) board specific initialisations goes here
2994 */
2995
2996/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08002997static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07002998{
2999 int type = -1;
3000
3001 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003002 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003003 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003004 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003005 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003006 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003007
3008 if (-1 != type) {
3009 btv->c.type = type;
3010 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3011 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3012 }
3013}
3014
3015static void flyvideo_gpio(struct bttv *btv)
3016{
3017 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3018 int tuner=-1,ttype;
3019
3020 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003021 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003022 gpio = gpio_read();
3023 /* FIXME: must restore OUR_EN ??? */
3024
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003025 /* all cards provide GPIO info, some have an additional eeprom
3026 * LR50: GPIO coding can be found lower right CP1 .. CP9
3027 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3028 * GPIO14-12: n.c.
3029 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003030
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003031 * lowest 3 bytes are remote control codes (no handshake needed)
3032 * xxxFFF: No remote control chip soldered
3033 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3034 * Note: Some bits are Audio_Mask !
3035 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003036 ttype=(gpio&0x0f0000)>>16;
3037 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003038 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003039 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003040 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003041 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003042 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003043 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003044 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003045 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003046 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003047 break;
3048 default:
3049 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3050 }
3051
3052 has_remote = gpio & 0x800000;
3053 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003054 /* unknown 0x200000;
3055 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003056 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003057 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003058 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3059 /*
3060 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003061
3062 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003063 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003064
3065 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3066 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3067 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3068 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3069 is_capture_only?"yes":"no ");
3070
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003071 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003072 btv->tuner_type = tuner;
3073 btv->has_radio = has_radio;
3074
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003075 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3076 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3077 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003078 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003079 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003080}
3081
3082static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3083 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3084static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3085 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3086
3087static void miro_pinnacle_gpio(struct bttv *btv)
3088{
3089 int id,msp,gpio;
3090 char *info;
3091
3092 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003093 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003094 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003095 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003096 if (id < 32) {
3097 btv->tuner_type = miro_tunermap[id];
3098 if (0 == (gpio & 0x20)) {
3099 btv->has_radio = 1;
3100 if (!miro_fmtuner[id]) {
3101 btv->has_matchbox = 1;
3102 btv->mbox_we = (1<<6);
3103 btv->mbox_most = (1<<7);
3104 btv->mbox_clk = (1<<8);
3105 btv->mbox_data = (1<<9);
3106 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3107 }
3108 } else {
3109 btv->has_radio = 0;
3110 }
3111 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003112 if (btv->c.type == BTTV_BOARD_MIRO)
3113 btv->c.type = BTTV_BOARD_MIROPRO;
3114 if (btv->c.type == BTTV_BOARD_PINNACLE)
3115 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003116 }
3117 printk(KERN_INFO
3118 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3119 btv->c.nr, id+1, btv->tuner_type,
3120 !btv->has_radio ? "no" :
3121 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3122 (-1 == msp) ? "no" : "yes");
3123 } else {
3124 /* new cards with microtune tuner */
3125 id = 63 - id;
3126 btv->has_radio = 0;
3127 switch (id) {
3128 case 1:
3129 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003130 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003131 break;
3132 case 2:
3133 info = "PAL+SECAM / stereo";
3134 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003135 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003136 break;
3137 case 3:
3138 info = "NTSC / stereo";
3139 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003140 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003141 break;
3142 case 4:
3143 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003144 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003145 break;
3146 case 5:
3147 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003148 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003149 break;
3150 case 6:
3151 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003152 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003153 break;
3154 case 7:
3155 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003156 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003157 break;
3158 default:
3159 info = "oops: unknown card";
3160 break;
3161 }
3162 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003163 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003164 printk(KERN_INFO
3165 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3166 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003167 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003168 }
3169}
3170
3171/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3172#define LM1882_SYNC_DRIVE 0x200000L
3173
3174static void init_ids_eagle(struct bttv *btv)
3175{
3176 gpio_inout(0xffffff,0xFFFF37);
3177 gpio_write(0x200020);
3178
3179 /* flash strobe inverter ?! */
3180 gpio_write(0x200024);
3181
3182 /* switch sync drive off */
3183 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3184
3185 /* set BT848 muxel to 2 */
3186 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3187}
3188
3189/* Muxsel helper for the IDS Eagle.
3190 * the eagles does not use the standard muxsel-bits but
3191 * has its own multiplexer */
3192static void eagle_muxsel(struct bttv *btv, unsigned int input)
3193{
3194 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3195 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3196
Linus Torvalds1da177e2005-04-16 15:20:36 -07003197 /* composite */
3198 /* set chroma ADC to sleep */
3199 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3200 /* set to composite video */
3201 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3202 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003203
3204 /* switch sync drive off */
3205 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3206}
3207
3208static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3209{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003210 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003211 gpio_write(masks[input%4]);
3212}
3213
3214/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3215 alarms output
3216
3217 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3218 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3219
3220 IN - sensor inputs, INx - sensor inputs and TI XORed together
3221 O1,O2,O3 - alarm outputs (relays)
3222
3223 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3224
3225*/
3226
3227static void init_lmlbt4x(struct bttv *btv)
3228{
3229 printk(KERN_DEBUG "LMLBT4x init\n");
3230 btwrite(0x000000, BT848_GPIO_REG_INP);
3231 gpio_inout(0xffffff, 0x0006C0);
3232 gpio_write(0x000000);
3233}
3234
3235static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3236{
3237 unsigned int inmux = input % 8;
3238 gpio_inout( 0xf, 0xf );
3239 gpio_bits( 0xf, inmux );
3240}
3241
3242static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3243{
3244 unsigned int inmux = input % 4;
3245 gpio_inout( 3<<9, 3<<9 );
3246 gpio_bits( 3<<9, inmux<<9 );
3247}
3248
3249/* ----------------------------------------------------------------------- */
3250
3251static void bttv_reset_audio(struct bttv *btv)
3252{
3253 /*
3254 * BT878A has a audio-reset register.
3255 * 1. This register is an audio reset function but it is in
3256 * function-0 (video capture) address space.
3257 * 2. It is enough to do this once per power-up of the card.
3258 * 3. There is a typo in the Conexant doc -- it is not at
3259 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3260 * --//Shrikumar 030609
3261 */
3262 if (btv->id != 878)
3263 return;
3264
3265 if (bttv_debug)
3266 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3267 btwrite((1<<7), 0x058);
3268 udelay(10);
3269 btwrite( 0, 0x058);
3270}
3271
3272/* initialization part one -- before registering i2c bus */
3273void __devinit bttv_init_card1(struct bttv *btv)
3274{
3275 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003276 case BTTV_BOARD_HAUPPAUGE:
3277 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003278 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003279 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003280 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003281 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003282 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003283 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003284 boot_msp34xx(btv,11);
3285 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003286 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003287 pvr_boot(btv);
3288 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003289 case BTTV_BOARD_TWINHAN_DST:
3290 case BTTV_BOARD_AVDVBT_771:
3291 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003292 btv->use_i2c_hw = 1;
3293 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003294 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003295 init_RTV24( btv );
3296 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003297
Linus Torvalds1da177e2005-04-16 15:20:36 -07003298 }
3299 if (!bttv_tvcards[btv->c.type].has_dvb)
3300 bttv_reset_audio(btv);
3301}
3302
3303/* initialization part two -- after registering i2c bus */
3304void __devinit bttv_init_card2(struct bttv *btv)
3305{
3306 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003307 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003308
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003309 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003310
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003311 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003312 bttv_readee(btv,eeprom_data,0xa0);
3313 identify_by_eeprom(btv,eeprom_data);
3314 }
3315
3316 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003317 case BTTV_BOARD_MIRO:
3318 case BTTV_BOARD_MIROPRO:
3319 case BTTV_BOARD_PINNACLE:
3320 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003321 /* miro/pinnacle */
3322 miro_pinnacle_gpio(btv);
3323 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003324 case BTTV_BOARD_FLYVIDEO_98:
3325 case BTTV_BOARD_MAXI:
3326 case BTTV_BOARD_LIFE_FLYKIT:
3327 case BTTV_BOARD_FLYVIDEO:
3328 case BTTV_BOARD_TYPHOON_TVIEW:
3329 case BTTV_BOARD_CHRONOS_VS2:
3330 case BTTV_BOARD_FLYVIDEO_98FM:
3331 case BTTV_BOARD_FLYVIDEO2000:
3332 case BTTV_BOARD_FLYVIDEO98EZ:
3333 case BTTV_BOARD_CONFERENCETV:
3334 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003335 flyvideo_gpio(btv);
3336 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003337 case BTTV_BOARD_HAUPPAUGE:
3338 case BTTV_BOARD_HAUPPAUGE878:
3339 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003340 /* pick up some config infos from the eeprom */
3341 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003342 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003343 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003344 case BTTV_BOARD_AVERMEDIA98:
3345 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003346 bttv_readee(btv,eeprom_data,0xa0);
3347 avermedia_eeprom(btv);
3348 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003349 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003350 init_PXC200(btv);
3351 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003352 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003353 picolo_tetra_init(btv);
3354 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003355 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003356 btv->has_radio = 1;
3357 btv->has_matchbox = 1;
3358 btv->mbox_we = 0x20;
3359 btv->mbox_most = 0;
3360 btv->mbox_clk = 0x08;
3361 btv->mbox_data = 0x10;
3362 btv->mbox_mask = 0x38;
3363 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003364 case BTTV_BOARD_VOBIS_BOOSTAR:
3365 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003366 terratec_active_radio_upgrade(btv);
3367 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003368 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003369 if (btv->cardid == 0x3002144f) {
3370 btv->has_radio=1;
3371 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3372 }
3373 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003374 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003375 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003376 /* Fix up entry for 3DFX VoodooTV 100,
3377 which is an OEM STB card variant. */
3378 btv->has_radio=0;
3379 btv->tuner_type=TUNER_TEMIC_NTSC;
3380 }
3381 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003382 case BTTV_BOARD_OSPREY1x0:
3383 case BTTV_BOARD_OSPREY1x0_848:
3384 case BTTV_BOARD_OSPREY101_848:
3385 case BTTV_BOARD_OSPREY1x1:
3386 case BTTV_BOARD_OSPREY1x1_SVID:
3387 case BTTV_BOARD_OSPREY2xx:
3388 case BTTV_BOARD_OSPREY2x0_SVID:
3389 case BTTV_BOARD_OSPREY2x0:
3390 case BTTV_BOARD_OSPREY500:
3391 case BTTV_BOARD_OSPREY540:
3392 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003393 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003394 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003395 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003396 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003397 init_ids_eagle(btv);
3398 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003399 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003400 bttv_readee(btv,eeprom_data,0xa0);
3401 modtec_eeprom(btv);
3402 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003403 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003404 init_lmlbt4x(btv);
3405 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003406 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003407 tibetCS16_init(btv);
3408 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003409 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003410 kodicom4400r_init(btv);
3411 break;
3412 }
3413
3414 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003415 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003416 /* defaults from card list */
3417 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3418 btv->pll.pll_ifreq=28636363;
3419 btv->pll.pll_crystal=BT848_IFORM_XT0;
3420 }
3421 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3422 btv->pll.pll_ifreq=35468950;
3423 btv->pll.pll_crystal=BT848_IFORM_XT1;
3424 }
3425 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003426 switch (pll[btv->c.nr]) {
3427 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003428 btv->pll.pll_crystal = 0;
3429 btv->pll.pll_ifreq = 0;
3430 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003431 break;
3432 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003433 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003434 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003435 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003436 btv->pll.pll_crystal = BT848_IFORM_XT0;
3437 break;
3438 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003439 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003440 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003441 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003442 btv->pll.pll_crystal = BT848_IFORM_XT1;
3443 break;
3444 }
3445 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003446 btv->pll.pll_current = -1;
3447
Linus Torvalds1da177e2005-04-16 15:20:36 -07003448 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003449 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3450 addr = bttv_tvcards[btv->c.type].tuner_addr;
3451
3452 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003453 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003454 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003455 if (UNSET != tuner[btv->c.nr])
3456 btv->tuner_type = tuner[btv->c.nr];
3457 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003458
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003459 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003460 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003461
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003462 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003463 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003464 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003465
3466 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3467 }
3468
Hans Verkuil39e8f402006-01-09 15:25:16 -02003469 if (btv->tda9887_conf) {
3470 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3471 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003472 }
3473
Linus Torvalds1da177e2005-04-16 15:20:36 -07003474 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3475 if (svhs[btv->c.nr] != UNSET)
3476 btv->svhs = svhs[btv->c.nr];
3477 if (remote[btv->c.nr] != UNSET)
3478 btv->has_remote = remote[btv->c.nr];
3479
3480 if (bttv_tvcards[btv->c.type].has_radio)
3481 btv->has_radio=1;
3482 if (bttv_tvcards[btv->c.type].has_remote)
3483 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003484 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3485 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003486 if (bttv_tvcards[btv->c.type].audio_hook)
3487 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3488
3489 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3490 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003491 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3492 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003493 boot_bt832(btv);
3494 }
3495
3496 if (!autoload)
3497 return;
3498
3499 /* try to detect audio/fader chips */
3500 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003501 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003502 request_module("msp3400");
3503
3504 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003505 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003506 request_module("msp3400");
3507
3508 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003509 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003510 request_module("tda9875");
3511
3512 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003513 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003514 request_module("tda7432");
3515
3516 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3517 request_module("tvaudio");
3518
3519 /* tuner modules */
3520 tda9887 = 0;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003521 if (btv->tda9887_conf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003522 tda9887 = 1;
3523 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003524 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003525 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003526 /* Hybrid DVB card, DOES have a tda9887 */
3527 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3528 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003529 if (btv->tuner_type != UNSET)
3530 request_module("tuner");
3531}
3532
3533
3534/* ----------------------------------------------------------------------- */
3535
3536static void modtec_eeprom(struct bttv *btv)
3537{
3538 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3539 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3540 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3541 btv->c.nr,&eeprom_data[0x1e]);
3542 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3543 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3544 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003545 btv->c.nr,&eeprom_data[0x1e]);
3546 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3547 btv->tuner_type=TUNER_PHILIPS_NTSC;
3548 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3549 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003550 } else {
3551 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3552 btv->c.nr,&eeprom_data[0x1e]);
3553 }
3554}
3555
3556static void __devinit hauppauge_eeprom(struct bttv *btv)
3557{
3558 struct tveeprom tv;
3559
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003560 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003561 btv->tuner_type = tv.tuner_type;
3562 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003563
3564 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3565 btv->c.nr, tv.model);
3566
3567 /*
3568 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3569 * type based on model #.
3570 */
3571 if(tv.model == 64900) {
3572 printk("bttv%d: Switching board type from %s to %s\n",
3573 btv->c.nr,
3574 bttv_tvcards[btv->c.type].name,
3575 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3576 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3577 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003578}
3579
3580static int terratec_active_radio_upgrade(struct bttv *btv)
3581{
3582 int freq;
3583
3584 btv->has_radio = 1;
3585 btv->has_matchbox = 1;
3586 btv->mbox_we = 0x10;
3587 btv->mbox_most = 0x20;
3588 btv->mbox_clk = 0x08;
3589 btv->mbox_data = 0x04;
3590 btv->mbox_mask = 0x3c;
3591
3592 btv->mbox_iow = 1 << 8;
3593 btv->mbox_ior = 1 << 9;
3594 btv->mbox_csel = 1 << 10;
3595
3596 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003597 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003598 if (0x1ed8 == tea5757_read(btv)) {
3599 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3600 btv->c.nr);
3601 btv->has_radio = 1;
3602 btv->has_matchbox = 1;
3603 } else {
3604 btv->has_radio = 0;
3605 btv->has_matchbox = 0;
3606 }
3607 return 0;
3608}
3609
3610
3611/* ----------------------------------------------------------------------- */
3612
3613/*
3614 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3615 *
3616 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3617 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3618 * unpacked with unzip).
3619 */
3620#define PVR_GPIO_DELAY 10
3621
3622#define BTTV_ALT_DATA 0x000001
3623#define BTTV_ALT_DCLK 0x100000
3624#define BTTV_ALT_NCONFIG 0x800000
3625
3626static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3627{
3628 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003629 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003630 int i;
3631
3632 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3633 gpio_write(0);
3634 udelay(PVR_GPIO_DELAY);
3635
3636 gpio_write(BTTV_ALT_NCONFIG);
3637 udelay(PVR_GPIO_DELAY);
3638
3639 for (n = 0; n < microlen; n++) {
3640 bits = micro[n];
3641 for ( i = 0 ; i < 8 ; i++ ) {
3642 gpio_bits(BTTV_ALT_DCLK,0);
3643 if (bits & 0x01)
3644 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3645 else
3646 gpio_bits(BTTV_ALT_DATA,0);
3647 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3648 bits >>= 1;
3649 }
3650 }
3651 gpio_bits(BTTV_ALT_DCLK,0);
3652 udelay(PVR_GPIO_DELAY);
3653
3654 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3655 for (i = 0 ; i < 30 ; i++) {
3656 gpio_bits(BTTV_ALT_DCLK,0);
3657 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3658 }
3659 gpio_bits(BTTV_ALT_DCLK,0);
3660 return 0;
3661}
3662
3663static int __devinit pvr_boot(struct bttv *btv)
3664{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003665 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003666 int rc;
3667
3668 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3669 if (rc != 0) {
3670 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3671 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003672 return rc;
3673 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003674 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3675 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3676 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003677 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003678 return rc;
3679}
3680
3681/* ----------------------------------------------------------------------- */
3682/* some osprey specific stuff */
3683
3684static void __devinit osprey_eeprom(struct bttv *btv)
3685{
3686 int i = 0;
3687 unsigned char *ee = eeprom_data;
3688 unsigned long serial = 0;
3689
3690 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003691 /* this might be an antique... check for MMAC label in eeprom */
3692 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3693 unsigned char checksum = 0;
3694 for (i =0; i<21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003695 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003696 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003697 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003698 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003699 for (i = 12; i < 21; i++)
3700 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003701 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003702 } else {
3703 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003704 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003705
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003706 for(; offset < 8*16; offset += 16) {
3707 unsigned short checksum = 0;
3708 /* verify the checksum */
3709 for(i = 0; i<14; i++) checksum += ee[i+offset];
3710 checksum = ~checksum; /* no idea why */
3711 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003712 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003713 break;
3714 }
3715 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003716
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003717 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003718 return;
3719
3720 /* found a valid descriptor */
3721 type = (ee[offset+4]<<8) | (ee[offset+5]);
3722
3723 switch(type) {
3724
3725 /* 848 based */
3726 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003727 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003728 break;
3729 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003730 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003731 break;
3732
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003733 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003734 case 0x0012:
3735 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003736 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003737 break;
3738 case 0x0014:
3739 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003740 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003741 break;
3742 case 0x0016:
3743 case 0x0017:
3744 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003745 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003746 break;
3747 case 0x0018:
3748 case 0x0019:
3749 case 0x001E:
3750 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003751 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003752 break;
3753 case 0x001A:
3754 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003755 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003756 break;
3757 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003758 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003759 break;
3760 case 0x0050:
3761 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003762 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003763 /* bttv_osprey_540_init(btv); */
3764 break;
3765 case 0x0060:
3766 case 0x0070:
Michael Krufky52398ef2006-05-26 02:13:15 -03003767 case 0x00A0:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003768 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003769 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003770 gpio_inout(0xffffff,0x000303);
3771 break;
3772 default:
3773 /* unknown...leave generic, but get serial # */
3774 break;
3775 }
3776 serial = (ee[offset+6] << 24)
3777 | (ee[offset+7] << 16)
3778 | (ee[offset+8] << 8)
3779 | (ee[offset+9]);
3780 }
3781
3782 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3783 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3784}
3785
3786/* ----------------------------------------------------------------------- */
3787/* AVermedia specific stuff, from bktr_card.c */
3788
3789static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003790 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3791 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3792 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3793 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3794 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003795 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003796
3797static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003798 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003799 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3800 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003801 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3802 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003803
3804static void __devinit avermedia_eeprom(struct bttv *btv)
3805{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003806 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003807
3808 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003809 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3810 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003811 btv->has_remote = (eeprom_data[0x42] & 0x01);
3812
3813 if (tuner_make == 0 || tuner_make == 2)
3814 if(tuner_format <=0x0a)
3815 tuner = tuner_0_table[tuner_format];
3816 if (tuner_make == 1)
3817 if(tuner_format <=9)
3818 tuner = tuner_1_table[tuner_format];
3819
3820 if (tuner_make == 4)
3821 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003822 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003823
3824 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3825 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3826 if(tuner) {
3827 btv->tuner_type=tuner;
3828 printk("%d",tuner);
3829 } else
3830 printk("Unknown type");
3831 printk(" radio:%s remote control:%s\n",
3832 tuner_tv_fm ? "yes" : "no",
3833 btv->has_remote ? "yes" : "no");
3834}
3835
3836/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3837void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3838{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003839 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003840 if(norm==VIDEO_MODE_NTSC) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003841 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3842 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003843 dprintk("bttv_tda9880_setnorm to NTSC\n");
3844 }
3845 else {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003846 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3847 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003848 dprintk("bttv_tda9880_setnorm to PAL\n");
3849 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003850 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003851 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003852 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003853}
3854
3855
3856/*
3857 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003858 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003859 *
3860 * Hauppauge: pin 5
3861 * Voodoo: pin 20
3862 */
3863static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3864{
3865 int mask = (1 << pin);
3866
3867 gpio_inout(mask,mask);
3868 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003869 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003870 gpio_bits(mask,mask);
3871
3872 if (bttv_gpio)
3873 bttv_gpio_tracking(btv,"msp34xx");
3874 if (bttv_verbose)
3875 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3876 "init [%d]\n", btv->c.nr, pin);
3877}
3878
3879static void __devinit boot_bt832(struct bttv *btv)
3880{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003881}
3882
3883/* ----------------------------------------------------------------------- */
3884/* Imagenation L-Model PXC200 Framegrabber */
3885/* This is basically the same procedure as
3886 * used by Alessandro Rubini in his pxc200
3887 * driver, but using BTTV functions */
3888
3889static void __devinit init_PXC200(struct bttv *btv)
3890{
3891 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3892 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3893 0x00 };
3894 unsigned int i;
3895 int tmp;
3896 u32 val;
3897
3898 /* Initialise GPIO-connevted stuff */
3899 gpio_inout(0xffffff, (1<<13));
3900 gpio_write(0);
3901 udelay(3);
3902 gpio_write(1<<13);
3903 /* GPIO inputs are pulled up, so no need to drive
3904 * reset pin any longer */
3905 gpio_bits(0xffffff, 0);
3906 if (bttv_gpio)
3907 bttv_gpio_tracking(btv,"pxc200");
3908
3909 /* we could/should try and reset/control the AD pots? but
3910 right now we simply turned off the crushing. Without
3911 this the AGC drifts drifts
3912 remember the EN is reverse logic -->
3913 setting BT848_ADC_AGC_EN disable the AGC
3914 tboult@eecs.lehigh.edu
3915 */
3916
3917 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3918
3919 /* Initialise MAX517 DAC */
3920 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3921 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3922
3923 /* Initialise 12C508 PIC */
3924 /* The I2CWrite and I2CRead commmands are actually to the
3925 * same chips - but the R/W bit is included in the address
3926 * argument so the numbers are different */
3927
3928
3929 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3930
3931 /* First of all, enable the clock line. This is used in the PXC200-F */
3932 val = btread(BT848_GPIO_DMA_CTL);
3933 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3934 btwrite(val, BT848_GPIO_DMA_CTL);
3935
3936 /* Then, push to 0 the reset pin long enough to reset the *
3937 * device same as above for the reset line, but not the same
3938 * value sent to the GPIO-connected stuff
3939 * which one is the good one? */
3940 gpio_inout(0xffffff,(1<<2));
3941 gpio_write(0);
3942 udelay(10);
3943 gpio_write(1<<2);
3944
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003945 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003946 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3947 if (tmp != -1) {
3948 printk(KERN_INFO
3949 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3950 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3951 }
3952 }
3953
3954 printk(KERN_INFO "PXC200 Initialised.\n");
3955}
3956
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003957
3958
Peter Skipworth93b43f12005-06-23 22:04:45 -07003959/* ----------------------------------------------------------------------- */
3960/*
3961 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3962 * it. This apparently involves the following procedure for each 878 chip:
3963 *
3964 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3965 *
3966 * 2) write to GPIO_DATA
3967 * - 0x0E
3968 * - sleep 1ms
3969 * - 0x10 + 0x0E
3970 * - sleep 10ms
3971 * - 0x0E
3972 * read from GPIO_DATA into buf (uint_32)
3973 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3974 * error. ERROR_CPLD_Check_Failed stop.
3975 *
3976 * 3) write to GPIO_DATA
3977 * - write 0x4400 + 0x0E
3978 * - sleep 10ms
3979 * - write 0x4410 + 0x0E
3980 * - sleep 1ms
3981 * - write 0x0E
3982 * read from GPIO_DATA into buf (uint_32)
Jean Delvarefef4fa142006-11-09 17:25:28 -03003983 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
Peter Skipworth93b43f12005-06-23 22:04:45 -07003984 * error. ERROR_CPLD_Check_Failed.
3985 */
3986/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08003987static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003988init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003989{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003990 uint32_t dataRead = 0;
3991 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003992
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003993 printk (KERN_INFO
3994 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003995 btv->c.nr);
3996
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003997 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003998
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003999 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4000 msleep (1);
4001 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4002 msleep (10);
4003 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004004
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004005 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004006
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004007 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4008 printk (KERN_INFO
4009 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4010 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004011 }
4012
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004013 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4014 msleep (10);
4015 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4016 msleep (1);
4017 btwrite (watchdog_value, BT848_GPIO_DATA);
4018 msleep (1);
4019 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004020
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004021 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4022 printk (KERN_INFO
4023 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4024 btv->c.nr, dataRead);
4025
Peter Skipworth93b43f12005-06-23 22:04:45 -07004026 return;
4027 }
4028
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004029 printk (KERN_INFO
4030 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004031}
Linus Torvalds1da177e2005-04-16 15:20:36 -07004032
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004033
4034
Linus Torvalds1da177e2005-04-16 15:20:36 -07004035/* ----------------------------------------------------------------------- */
4036/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4037/*
4038 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4039 * This code is placed under the terms of the GNU General Public License
4040 *
4041 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4042 */
4043
4044static void bus_low(struct bttv *btv, int bit)
4045{
4046 if (btv->mbox_ior) {
4047 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4048 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4049 udelay(5);
4050 }
4051
4052 gpio_bits(bit,0);
4053 udelay(5);
4054
4055 if (btv->mbox_ior) {
4056 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4057 udelay(5);
4058 }
4059}
4060
4061static void bus_high(struct bttv *btv, int bit)
4062{
4063 if (btv->mbox_ior) {
4064 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4065 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4066 udelay(5);
4067 }
4068
4069 gpio_bits(bit,bit);
4070 udelay(5);
4071
4072 if (btv->mbox_ior) {
4073 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4074 udelay(5);
4075 }
4076}
4077
4078static int bus_in(struct bttv *btv, int bit)
4079{
4080 if (btv->mbox_ior) {
4081 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4082 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4083 udelay(5);
4084
4085 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4086 udelay(5);
4087 }
4088 return gpio_read() & (bit);
4089}
4090
4091/* TEA5757 register bits */
4092#define TEA_FREQ 0:14
4093#define TEA_BUFFER 15:15
4094
4095#define TEA_SIGNAL_STRENGTH 16:17
4096
4097#define TEA_PORT1 18:18
4098#define TEA_PORT0 19:19
4099
4100#define TEA_BAND 20:21
4101#define TEA_BAND_FM 0
4102#define TEA_BAND_MW 1
4103#define TEA_BAND_LW 2
4104#define TEA_BAND_SW 3
4105
4106#define TEA_MONO 22:22
4107#define TEA_ALLOW_STEREO 0
4108#define TEA_FORCE_MONO 1
4109
4110#define TEA_SEARCH_DIRECTION 23:23
4111#define TEA_SEARCH_DOWN 0
4112#define TEA_SEARCH_UP 1
4113
4114#define TEA_STATUS 24:24
4115#define TEA_STATUS_TUNED 0
4116#define TEA_STATUS_SEARCHING 1
4117
4118/* Low-level stuff */
4119static int tea5757_read(struct bttv *btv)
4120{
4121 unsigned long timeout;
4122 int value = 0;
4123 int i;
4124
4125 /* better safe than sorry */
4126 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4127
4128 if (btv->mbox_ior) {
4129 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4130 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4131 udelay(5);
4132 }
4133
4134 if (bttv_gpio)
4135 bttv_gpio_tracking(btv,"tea5757 read");
4136
4137 bus_low(btv,btv->mbox_we);
4138 bus_low(btv,btv->mbox_clk);
4139
4140 udelay(10);
4141 timeout= jiffies + HZ;
4142
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004143 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004144 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4145 schedule();
4146 if (bus_in(btv,btv->mbox_data)) {
4147 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4148 return -1;
4149 }
4150
4151 dprintk("bttv%d: tea5757:",btv->c.nr);
4152 for(i = 0; i < 24; i++)
4153 {
4154 udelay(5);
4155 bus_high(btv,btv->mbox_clk);
4156 udelay(5);
4157 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4158 bus_low(btv,btv->mbox_clk);
4159 value <<= 1;
4160 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4161 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4162 }
4163 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4164 return value;
4165}
4166
4167static int tea5757_write(struct bttv *btv, int value)
4168{
4169 int i;
4170 int reg = value;
4171
4172 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4173
4174 if (btv->mbox_ior) {
4175 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4176 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4177 udelay(5);
4178 }
4179 if (bttv_gpio)
4180 bttv_gpio_tracking(btv,"tea5757 write");
4181
4182 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4183 bus_low(btv,btv->mbox_clk);
4184 bus_high(btv,btv->mbox_we);
4185 for(i = 0; i < 25; i++)
4186 {
4187 if (reg & 0x1000000)
4188 bus_high(btv,btv->mbox_data);
4189 else
4190 bus_low(btv,btv->mbox_data);
4191 reg <<= 1;
4192 bus_high(btv,btv->mbox_clk);
4193 udelay(10);
4194 bus_low(btv,btv->mbox_clk);
4195 udelay(10);
4196 }
4197 bus_low(btv,btv->mbox_we); /* unmute !!! */
4198 return 0;
4199}
4200
4201void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4202{
4203 dprintk("tea5757_set_freq %d\n",freq);
4204 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004205}
4206
4207
4208/* ----------------------------------------------------------------------- */
4209/* winview */
4210
Adrian Bunk943a4902005-12-01 00:51:35 -08004211static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004212{
4213 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4214 int bits_out, loops, vol, data;
4215
4216 if (!set) {
4217 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4218 v->flags |= VIDEO_AUDIO_VOLUME;
4219 return;
4220 }
4221
4222 /* 32 levels logarithmic */
4223 vol = 32 - ((v->volume>>11));
4224 /* units */
4225 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4226 /* tens */
4227 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4228 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4229 data = gpio_read();
4230 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4231 WINVIEW_PT2254_STROBE);
4232 for (loops = 17; loops >= 0 ; loops--) {
4233 if (bits_out & (1<<loops))
4234 data |= WINVIEW_PT2254_DATA;
4235 else
4236 data &= ~WINVIEW_PT2254_DATA;
4237 gpio_write(data);
4238 udelay(5);
4239 data |= WINVIEW_PT2254_CLK;
4240 gpio_write(data);
4241 udelay(5);
4242 data &= ~WINVIEW_PT2254_CLK;
4243 gpio_write(data);
4244 }
4245 data |= WINVIEW_PT2254_STROBE;
4246 data &= ~WINVIEW_PT2254_DATA;
4247 gpio_write(data);
4248 udelay(10);
4249 data &= ~WINVIEW_PT2254_STROBE;
4250 gpio_write(data);
4251}
4252
4253/* ----------------------------------------------------------------------- */
4254/* mono/stereo control for various cards (which don't use i2c chips but */
4255/* connect something to the GPIO pins */
4256
4257static void
4258gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4259{
4260 unsigned int con = 0;
4261
4262 if (set) {
4263 gpio_inout(0x300, 0x300);
4264 if (v->mode & VIDEO_SOUND_LANG1)
4265 con = 0x000;
4266 if (v->mode & VIDEO_SOUND_LANG2)
4267 con = 0x300;
4268 if (v->mode & VIDEO_SOUND_STEREO)
4269 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004270/* if (v->mode & VIDEO_SOUND_MONO)
4271 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004272 gpio_bits(0x300, con);
4273 } else {
4274 v->mode = VIDEO_SOUND_STEREO |
4275 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4276 }
4277}
4278
4279static void
4280gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4281{
4282 unsigned int val, con;
4283
Linus Torvalds1da177e2005-04-16 15:20:36 -07004284 if (btv->radio_user)
4285 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004286
4287 val = gpio_read();
4288 if (set) {
4289 con = 0x000;
4290 if (v->mode & VIDEO_SOUND_LANG2) {
4291 if (v->mode & VIDEO_SOUND_LANG1) {
4292 /* LANG1 + LANG2 */
4293 con = 0x100;
4294 }
4295 else {
4296 /* LANG2 */
4297 con = 0x300;
4298 }
4299 }
4300 if (con != (val & 0x300)) {
4301 gpio_bits(0x300, con);
4302 if (bttv_gpio)
4303 bttv_gpio_tracking(btv,"gvbctv5pci");
4304 }
4305 } else {
4306 switch (val & 0x70) {
4307 case 0x10:
4308 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4309 break;
4310 case 0x30:
4311 v->mode = VIDEO_SOUND_LANG2;
4312 break;
4313 case 0x50:
4314 v->mode = VIDEO_SOUND_LANG1;
4315 break;
4316 case 0x60:
4317 v->mode = VIDEO_SOUND_STEREO;
4318 break;
4319 case 0x70:
4320 v->mode = VIDEO_SOUND_MONO;
4321 break;
4322 default:
4323 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4324 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4325 }
4326 }
4327}
4328
4329/*
4330 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4331 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4332 * 0xdde enables mono and 0xccd enables sap
4333 *
4334 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4335 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4336 * input/output sound connection, so both must be set for output mode.
4337 *
4338 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4339 * handles this with a tda9840
4340 *
4341 */
4342static void
4343avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4344{
4345 int val = 0;
4346
4347 if (set) {
4348 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4349 val = 0x02;
4350 if (v->mode & VIDEO_SOUND_STEREO)
4351 val = 0x01;
4352 if (val) {
4353 gpio_bits(0x03,val);
4354 if (bttv_gpio)
4355 bttv_gpio_tracking(btv,"avermedia");
4356 }
4357 } else {
4358 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4359 VIDEO_SOUND_LANG1;
4360 return;
4361 }
4362}
4363
4364static void
4365avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4366{
4367 int val = 0;
4368
4369 if (set) {
4370 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4371 val = 0x01;
4372 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4373 val = 0x02;
4374 btaor(val, ~0x03, BT848_GPIO_DATA);
4375 if (bttv_gpio)
4376 bttv_gpio_tracking(btv,"avermedia");
4377 } else {
4378 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4379 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4380 return;
4381 }
4382}
4383
4384/* Lifetec 9415 handling */
4385static void
4386lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4387{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004388 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004389
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004390 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004391 v->mode = VIDEO_SOUND_MONO;
4392 return;
4393 }
4394
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004395 if (set) {
4396 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4397 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004398 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004399 val = 0x0880;
4400 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004401 (v->mode & VIDEO_SOUND_MONO))
4402 val = 0;
4403 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004404 if (bttv_gpio)
4405 bttv_gpio_tracking(btv,"lt9415");
4406 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004407 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004408 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004409 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004410 return;
4411 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004412}
4413
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004414/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004415static void
4416terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4417{
4418 unsigned int con = 0;
4419
4420 if (set) {
4421 gpio_inout(0x180000,0x180000);
4422 if (v->mode & VIDEO_SOUND_LANG2)
4423 con = 0x080000;
4424 if (v->mode & VIDEO_SOUND_STEREO)
4425 con = 0x180000;
4426 gpio_bits(0x180000, con);
4427 if (bttv_gpio)
4428 bttv_gpio_tracking(btv,"terratv");
4429 } else {
4430 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4431 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4432 }
4433}
4434
4435static void
4436winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4437{
4438 unsigned long val = 0;
4439
4440 if (set) {
4441 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4442 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4443 val = 0x420000;
4444 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4445 val = 0x420000;
4446 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4447 val = 0x410000;
4448 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4449 val = 0x020000;
4450 if (val) {
4451 gpio_bits(0x430000, val);
4452 if (bttv_gpio)
4453 bttv_gpio_tracking(btv,"winfast2000");
4454 }
4455 } else {
4456 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4457 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4458 }
4459}
4460
4461/*
4462 * Dariusz Kowalewski <darekk@automex.pl>
4463 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4464 * revision 9B has on-board TDA9874A sound decoder).
4465 *
4466 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4467 * will mute this cards.
4468 */
4469static void
4470pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4471{
4472 unsigned int val = 0;
4473
Linus Torvalds1da177e2005-04-16 15:20:36 -07004474 if (btv->radio_user)
4475 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004476
4477 if (set) {
4478 if (v->mode & VIDEO_SOUND_MONO) {
4479 val = 0x01;
4480 }
4481 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4482 || (v->mode & VIDEO_SOUND_STEREO)) {
4483 val = 0x02;
4484 }
4485 if (val) {
4486 gpio_bits(0x03,val);
4487 if (bttv_gpio)
4488 bttv_gpio_tracking(btv,"pvbt878p9b");
4489 }
4490 } else {
4491 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4492 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4493 }
4494}
4495
4496/*
4497 * Dariusz Kowalewski <darekk@automex.pl>
4498 * sound control for FlyVideo 2000S (with tda9874 decoder)
4499 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4500 */
4501static void
4502fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4503{
4504 unsigned int val = 0xffff;
4505
Linus Torvalds1da177e2005-04-16 15:20:36 -07004506 if (btv->radio_user)
4507 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004508 if (set) {
4509 if (v->mode & VIDEO_SOUND_MONO) {
4510 val = 0x0000;
4511 }
4512 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4513 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004514 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004515 }
4516 if (val != 0xffff) {
4517 gpio_bits(0x1800, val);
4518 if (bttv_gpio)
4519 bttv_gpio_tracking(btv,"fv2000s");
4520 }
4521 } else {
4522 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4523 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4524 }
4525}
4526
4527/*
4528 * sound control for Canopus WinDVR PCI
4529 * Masaki Suzuki <masaki@btree.org>
4530 */
4531static void
4532windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4533{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004534 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004535
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004536 if (set) {
4537 if (v->mode & VIDEO_SOUND_MONO)
4538 val = 0x040000;
4539 if (v->mode & VIDEO_SOUND_LANG1)
4540 val = 0;
4541 if (v->mode & VIDEO_SOUND_LANG2)
4542 val = 0x100000;
4543 if (v->mode & VIDEO_SOUND_STEREO)
4544 val = 0;
4545 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004546 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004547 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004548 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004549 }
4550 } else {
4551 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4552 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4553 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004554}
4555
4556/*
4557 * sound control for AD-TVK503
4558 * Hiroshi Takekawa <sian@big.or.jp>
4559 */
4560static void
4561adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4562{
4563 unsigned int con = 0xffffff;
4564
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004565 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004566
4567 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004568 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004569 if (v->mode & VIDEO_SOUND_LANG1)
4570 con = 0x00000000;
4571 if (v->mode & VIDEO_SOUND_LANG2)
4572 con = 0x00180000;
4573 if (v->mode & VIDEO_SOUND_STEREO)
4574 con = 0x00000000;
4575 if (v->mode & VIDEO_SOUND_MONO)
4576 con = 0x00060000;
4577 if (con != 0xffffff) {
4578 gpio_bits(0x1e0000,con);
4579 if (bttv_gpio)
4580 bttv_gpio_tracking(btv, "adtvk503");
4581 }
4582 } else {
4583 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4584 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4585 }
4586}
4587
4588/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4589 *
4590 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4591 * switch instead (CD22M3494E). This IC can have multiple active connections
4592 * between Xn (input) and Yn (output) pins. We need to clear any existing
4593 * connection prior to establish a new one, pulsing the STROBE pin.
4594 *
4595 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4596 * GPIO pins are wired as:
4597 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4598 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4599 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4600 * GPIO[8] - - P3[5] (microcontroler)
4601 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4602 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4603 * GPINTR - - P3[4] (microcontroler)
4604 *
4605 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4606 * configuration either directly (as we are doing) or using the microcontroler
4607 * which is also wired to I2C interface. I have no further info on the
4608 * microcontroler features, one would need to disassembly the firmware.
4609 * note: the vendor refused to give any information on this product, all
4610 * that stuff was found using a multimeter! :)
4611 */
4612static void rv605_muxsel(struct bttv *btv, unsigned int input)
4613{
4614 /* reset all conections */
4615 gpio_bits(0x200,0x200);
4616 mdelay(1);
4617 gpio_bits(0x200,0x000);
4618 mdelay(1);
4619
4620 /* create a new conection */
4621 gpio_bits(0x480,0x080);
4622 gpio_bits(0x480,0x480);
4623 mdelay(1);
4624 gpio_bits(0x480,0x080);
4625 mdelay(1);
4626}
4627
4628/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4629 *
4630 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4631 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4632 * chips, ten eight input analog multiplexors, a not chip and a few
4633 * other components.
4634 *
4635 * 16 inputs on a secondary bracket are provided and can be selected
4636 * from each of the four capture chips. Two of the eight input
4637 * multiplexors are used to select from any of the 16 input signals.
4638 *
4639 * Unsupported hardware capabilities:
4640 * . A video output monitor on the secondary bracket can be selected from
4641 * one of the 878A chips.
4642 * . Another passthrough but I haven't spent any time investigating it.
4643 * . Digital I/O (logic level connected to GPIO) is available from an
4644 * onboard header.
4645 *
4646 * The on chip input mux should always be set to 2.
4647 * GPIO[16:19] - Video input selection
4648 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4649 * GPIO[?:?] - Digital I/O.
4650 *
4651 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4652 * determined what function (if any) it provides. With the microcontroller
4653 * and sync seperator chips a guess is that it might have to do with video
4654 * switching and maybe some digital I/O.
4655 */
4656static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4657{
4658 /* video mux */
4659 gpio_bits(0x0f0000, input << 16);
4660}
4661
4662static void tibetCS16_init(struct bttv *btv)
4663{
4664 /* enable gpio bits, mask obtained via btSpy */
4665 gpio_inout(0xffffff, 0x0f7fff);
4666 gpio_write(0x0f7fff);
4667}
4668
4669/*
4670 * The following routines for the Kodicom-4400r get a little mind-twisting.
4671 * There is a "master" controller and three "slave" controllers, together
4672 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4673 * The analog switch is controlled by the "master", but the detection order
4674 * of the four BT878A chips is in an order which I just don't understand.
4675 * The "master" is actually the second controller to be detected. The
4676 * logic on the board uses logical numbers for the 4 controlers, but
4677 * those numbers are different from the detection sequence. When working
4678 * with the analog switch, we need to "map" from the detection sequence
4679 * over to the board's logical controller number. This mapping sequence
4680 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4681 * unit 3, the second (which is the master) is logical unit 0, etc.
4682 * We need to maintain the status of the analog switch (which of the 16
4683 * cameras is connected to which of the 4 controllers). Rather than
4684 * add to the bttv structure for this, we use the data reserved for
4685 * the mbox (unused for this card type).
4686 */
4687
4688/*
4689 * First a routine to set the analog switch, which controls which camera
4690 * is routed to which controller. The switch comprises an X-address
4691 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4692 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4693 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4694 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4695 * specified address. The idea is to set the address and data, then bring
4696 * STROBE high, and finally bring STROBE back to low.
4697 */
4698static void kodicom4400r_write(struct bttv *btv,
4699 unsigned char xaddr,
4700 unsigned char yaddr,
4701 unsigned char data) {
4702 unsigned int udata;
4703
4704 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4705 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4706 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4707 gpio_bits(0x1ff, udata); /* strobe low */
4708}
4709
4710/*
4711 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4712 * use this routine. The routine finds the "master" for the card, maps
4713 * the controller number from the detected position over to the logical
4714 * number, writes the appropriate data to the analog switch, and housekeeps
4715 * the local copy of the switch information. The parameter 'input' is the
4716 * requested camera number (0 - 15).
4717 */
4718static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4719{
4720 char *sw_status;
4721 int xaddr, yaddr;
4722 struct bttv *mctlr;
4723 static unsigned char map[4] = {3, 0, 2, 1};
4724
4725 mctlr = master[btv->c.nr];
4726 if (mctlr == NULL) { /* ignore if master not yet detected */
4727 return;
4728 }
4729 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4730 yaddr = map[yaddr];
4731 sw_status = (char *)(&mctlr->mbox_we);
4732 xaddr = input & 0xf;
4733 /* Check if the controller/camera pair has changed, else ignore */
4734 if (sw_status[yaddr] != xaddr)
4735 {
4736 /* "open" the old switch, "close" the new one, save the new */
4737 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4738 sw_status[yaddr] = xaddr;
4739 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4740 }
4741}
4742
4743/*
4744 * During initialisation, we need to reset the analog switch. We
4745 * also preset the switch to map the 4 connectors on the card to the
4746 * *user's* (see above description of kodicom4400r_muxsel) channels
4747 * 0 through 3
4748 */
4749static void kodicom4400r_init(struct bttv *btv)
4750{
4751 char *sw_status = (char *)(&btv->mbox_we);
4752 int ix;
4753
4754 gpio_inout(0x0003ff, 0x0003ff);
4755 gpio_write(1 << 9); /* reset MUX */
4756 gpio_write(0);
4757 /* Preset camera 0 to the 4 controllers */
4758 for (ix=0; ix<4; ix++) {
4759 sw_status[ix] = ix;
4760 kodicom4400r_write(btv, ix, ix, 1);
4761 }
4762 /*
4763 * Since this is the "master", we need to set up the
4764 * other three controller chips' pointers to this structure
4765 * for later use in the muxsel routine.
4766 */
4767 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4768 return;
4769 master[btv->c.nr-1] = btv;
4770 master[btv->c.nr] = btv;
4771 master[btv->c.nr+1] = btv;
4772 master[btv->c.nr+2] = btv;
4773}
4774
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004775/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4776 * video multiplexers to provide up to 16 video inputs. These
4777 * multiplexers are controlled by the lower 8 GPIO pins of the
4778 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004779
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004780 * xxx0 is pin xxx of multiplexer U5,
4781 * yyy1 is pin yyy of multiplexer U2
4782 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004783#define ENA0 0x01
4784#define ENB0 0x02
4785#define ENA1 0x04
4786#define ENB1 0x08
4787
4788#define IN10 0x10
4789#define IN00 0x20
4790#define IN11 0x40
4791#define IN01 0x80
4792
4793static void xguard_muxsel(struct bttv *btv, unsigned int input)
4794{
4795 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004796 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4797 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4798 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4799 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004800 };
4801 gpio_write(masks[input%16]);
4802}
4803static void picolo_tetra_init(struct bttv *btv)
4804{
4805 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4806 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4807 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4808}
4809static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4810{
4811
4812 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4813 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4814 /*GPIO[20]&GPIO[21] used to choose the right input*/
4815 btwrite (input<<20,BT848_GPIO_DATA);
4816
4817}
4818
4819/*
4820 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4821 *
4822 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4823 * swichers to provide 16 channels to MUX0. The TDA8540's have
Andreas Mohrd6e05ed2006-06-26 18:35:02 +02004824 * 4 independent outputs and as such the IVC120G also has the
Linus Torvalds1da177e2005-04-16 15:20:36 -07004825 * optional "Monitor Out" bus. This allows the card to be looking
4826 * at one input while the monitor is looking at another.
4827 *
4828 * Since I've couldn't be bothered figuring out how to add an
4829 * independant muxsel for the monitor bus, I've just set it to
4830 * whatever the card is looking at.
4831 *
4832 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4833 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4834 *
4835 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4836 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4837 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4838 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4839 *
4840 */
4841
4842/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4843#define I2C_TDA8540 0x90
4844#define I2C_TDA8540_ALT1 0x92
4845#define I2C_TDA8540_ALT2 0x94
4846#define I2C_TDA8540_ALT3 0x96
4847#define I2C_TDA8540_ALT4 0x98
4848#define I2C_TDA8540_ALT5 0x9a
4849#define I2C_TDA8540_ALT6 0x9c
4850
4851static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4852{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004853 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004854 int key = input % 4;
4855 int matrix = input / 4;
4856
4857 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4858 btv->c.nr, input, matrix, key);
4859
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004860 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004861 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4862 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4863 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4864 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4865 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4866 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4867 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4868 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4869
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004870 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004871 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004872 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004873 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004874 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004875 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004876 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004877 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004878 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004879
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004880 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004881 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4882}
4883
4884
4885/* PXC200 muxsel helper
4886 * luke@syseng.anu.edu.au
4887 * another transplant
4888 * from Alessandro Rubini (rubini@linux.it)
4889 *
4890 * There are 4 kinds of cards:
4891 * PXC200L which is bt848
4892 * PXC200F which is bt848 with PIC controlling mux
4893 * PXC200AL which is bt878
4894 * PXC200AF which is bt878 with PIC controlling mux
4895 */
4896#define PX_CFG_PXC200F 0x01
4897#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4898#define PX_I2C_PIC 0x0f
4899#define PX_PXC200A_CARDID 0x200a1295
4900#define PX_I2C_CMD_CFG 0x00
4901
4902static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4903{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004904 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004905 long mux;
4906 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004907 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004908
4909 /* Read PIC config to determine if this is a PXC200F */
4910 /* PX_I2C_CMD_CFG*/
4911 buf[0]=0;
4912 buf[1]=0;
4913 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4914 if (rc) {
4915 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4916 /* not PXC ? do nothing */
4917 return;
4918 }
4919
4920 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4921 if (!(rc & PX_CFG_PXC200F)) {
4922 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4923 return;
4924 }
4925
4926
4927 /* The multiplexer in the 200F is handled by the GPIO port */
4928 /* get correct mapping between inputs */
4929 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4930 /* ** not needed!? */
4931 mux = input;
4932
4933 /* make sure output pins are enabled */
4934 /* bitmask=0x30f; */
4935 bitmask=0x302;
4936 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004937 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004938 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4939 bitmask |= 7<<4; /* the DAC */
4940 }
4941 btwrite(bitmask, BT848_GPIO_OUT_EN);
4942
4943 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004944 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004945 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4946 else /* older device */
4947 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4948 btwrite(bitmask,BT848_GPIO_DATA);
4949
4950 /*
4951 * Was "to be safe, set the bt848 to input 0"
4952 * Actually, since it's ok at load time, better not messing
4953 * with these bits (on PXC200AF you need to set mux 2 here)
4954 *
4955 * needed because bttv-driver sets mux before calling this function
4956 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004957 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004958 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4959 else /* older device */
4960 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4961
4962 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4963}
4964
4965/* ----------------------------------------------------------------------- */
4966/* motherboard chipset specific stuff */
4967
4968void __devinit bttv_check_chipset(void)
4969{
4970 int pcipci_fail = 0;
4971 struct pci_dev *dev = NULL;
4972
Alan Cox3d265c92006-09-14 11:53:16 -03004973 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004974 pcipci_fail = 1;
4975 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4976 triton1 = 1;
4977 if (pci_pci_problems & PCIPCI_VSFX)
4978 vsfx = 1;
4979#ifdef PCIPCI_ALIMAGIK
4980 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4981 latency = 0x0A;
4982#endif
4983
Linus Torvalds1da177e2005-04-16 15:20:36 -07004984
4985 /* print warnings about any quirks found */
4986 if (triton1)
4987 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4988 if (vsfx)
4989 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4990 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004991 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4992 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004993 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004994 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004995 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004996 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004997 printk(KERN_INFO "bttv: overlay forced. Use this "
4998 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004999 }
5000 }
5001 if (UNSET != latency)
5002 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08005003 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005004 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005005 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005006 pci_read_config_byte(dev, 0x53, &b);
5007 if (bttv_debug)
5008 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5009 "bufcon=0x%02x\n",b);
5010 }
5011}
5012
5013int __devinit bttv_handle_chipset(struct bttv *btv)
5014{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005015 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005016
5017 if (!triton1 && !vsfx && UNSET == latency)
5018 return 0;
5019
5020 if (bttv_verbose) {
5021 if (triton1)
5022 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5023 if (vsfx && btv->id >= 878)
5024 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5025 if (UNSET != latency)
5026 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5027 btv->c.nr,latency);
5028 }
5029
5030 if (btv->id < 878) {
5031 /* bt848 (mis)uses a bit in the irq mask for etbf */
5032 if (triton1)
5033 btv->triton1 = BT848_INT_ETBF;
5034 } else {
5035 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005036 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005037 if (triton1)
5038 command |= BT878_EN_TBFX;
5039 if (vsfx)
5040 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005041 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5042 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005043 if (UNSET != latency)
5044 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5045 return 0;
5046}
5047
5048
5049/*
5050 * Local variables:
5051 * c-basic-offset: 8
5052 * End:
5053 */