blob: 3b653c9247307cdbe67e91349bcb53b67dfde499 [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" },
310 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Cameron Hutchinson442d15d2006-06-21 18:45:31 -0300311 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312
313 { 0, -1, NULL }
314};
315
316/* ----------------------------------------------------------------------- */
317/* array with description for bt848 / bt878 tv/grabber cards */
318
319struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800320 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800321 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800322 .name = " *** UNKNOWN/GENERIC *** ",
323 .video_inputs = 4,
324 .audio_inputs = 1,
325 .tuner = 0,
326 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200327 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800328 .tuner_type = -1,
329 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800330 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800331 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800332 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800333 .name = "MIRO PCTV",
334 .video_inputs = 4,
335 .audio_inputs = 1,
336 .tuner = 0,
337 .svhs = 2,
338 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200339 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300340 .gpiomux = { 2, 0, 0, 0 },
341 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800342 .needs_tvaudio = 1,
343 .tuner_type = -1,
344 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800345 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800346 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800347 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800348 .name = "Hauppauge (bt848)",
349 .video_inputs = 4,
350 .audio_inputs = 1,
351 .tuner = 0,
352 .svhs = 2,
353 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200354 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300355 .gpiomux = { 0, 1, 2, 3 },
356 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800357 .needs_tvaudio = 1,
358 .tuner_type = -1,
359 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800360 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800361 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800362 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800363 .name = "STB, Gateway P/N 6000699 (bt848)",
364 .video_inputs = 3,
365 .audio_inputs = 1,
366 .tuner = 0,
367 .svhs = 2,
368 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200369 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300370 .gpiomux = { 4, 0, 2, 3 },
371 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800372 .no_msp34xx = 1,
373 .needs_tvaudio = 1,
374 .tuner_type = TUNER_PHILIPS_NTSC,
375 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800376 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800377 .pll = PLL_28,
378 .has_radio = 1,
379 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800381 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800382 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800383 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
384 .video_inputs = 4,
385 .audio_inputs = 0,
386 .tuner = -1,
387 .svhs = 2,
388 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200389 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300390 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800391 .needs_tvaudio = 0,
392 .tuner_type = 4,
393 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800394 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800395 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800396 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800397 .name = "Diamond DTV2000",
398 .video_inputs = 4,
399 .audio_inputs = 1,
400 .tuner = 0,
401 .svhs = 2,
402 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200403 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300404 .gpiomux = { 0, 1, 0, 1 },
405 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800406 .needs_tvaudio = 1,
407 .tuner_type = -1,
408 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800409 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800410 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800411 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800412 .name = "AVerMedia TVPhone",
413 .video_inputs = 3,
414 .audio_inputs = 1,
415 .tuner = 0,
416 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200417 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800418 .gpiomask = 0x0f,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300419 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800420 /* 0x04 for some cards ?? */
421 .needs_tvaudio = 1,
422 .tuner_type = -1,
423 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800424 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800425 .audio_hook = avermedia_tvphone_audio,
426 .has_remote = 1,
427 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800428 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800429 .name = "MATRIX-Vision MV-Delta",
430 .video_inputs = 5,
431 .audio_inputs = 1,
432 .tuner = -1,
433 .svhs = 3,
434 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200435 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300436 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800437 .needs_tvaudio = 1,
438 .tuner_type = -1,
439 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800440 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800441 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800443 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800444 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800445 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
446 .video_inputs = 4,
447 .audio_inputs = 1,
448 .tuner = 0,
449 .svhs = 2,
450 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200451 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300452 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
453 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800454 .needs_tvaudio = 1,
455 .pll = PLL_28,
456 .tuner_type = -1,
457 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800458 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800459 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800460 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800461 .name = "IMS/IXmicro TurboTV",
462 .video_inputs = 3,
463 .audio_inputs = 1,
464 .tuner = 0,
465 .svhs = 2,
466 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200467 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300468 .gpiomux = { 1, 1, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800469 .needs_tvaudio = 0,
470 .pll = PLL_28,
471 .tuner_type = TUNER_TEMIC_PAL,
472 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800473 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800474 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800475 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800476 .name = "Hauppauge (bt878)",
477 .video_inputs = 4,
478 .audio_inputs = 1,
479 .tuner = 0,
480 .svhs = 2,
481 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200482 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300483 .gpiomux = { 0, 1, 2, 3 },
484 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800485 .needs_tvaudio = 1,
486 .pll = PLL_28,
487 .tuner_type = -1,
488 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800489 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800490 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800491 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800492 .name = "MIRO PCTV pro",
493 .video_inputs = 3,
494 .audio_inputs = 1,
495 .tuner = 0,
496 .svhs = 2,
497 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200498 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300499 .gpiomux = { 0x20001,0x10001, 0, 0 },
500 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800501 .needs_tvaudio = 1,
502 .tuner_type = -1,
503 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800504 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800505 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800507 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800508 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800509 .name = "ADS Technologies Channel Surfer TV (bt848)",
510 .video_inputs = 3,
511 .audio_inputs = 1,
512 .tuner = 0,
513 .svhs = 2,
514 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200515 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300516 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800517 .needs_tvaudio = 1,
518 .tuner_type = -1,
519 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800520 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800521 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800522 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800523 .name = "AVerMedia TVCapture 98",
524 .video_inputs = 3,
525 .audio_inputs = 4,
526 .tuner = 0,
527 .svhs = 2,
528 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200529 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300530 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800531 .needs_tvaudio = 1,
532 .msp34xx_alt = 1,
533 .pll = PLL_28,
534 .tuner_type = TUNER_PHILIPS_PAL,
535 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800536 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800537 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800538 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800539 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800540 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800541 .name = "Aimslab Video Highway Xtreme (VHX)",
542 .video_inputs = 3,
543 .audio_inputs = 1,
544 .tuner = 0,
545 .svhs = 2,
546 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200547 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300548 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
549 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800550 .needs_tvaudio = 1,
551 .pll = PLL_28,
552 .tuner_type = -1,
553 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800554 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800555 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800556 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800557 .name = "Zoltrix TV-Max",
558 .video_inputs = 3,
559 .audio_inputs = 1,
560 .tuner = 0,
561 .svhs = 2,
562 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200563 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300564 .gpiomux = { 0, 0, 1, 0 },
565 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800566 .needs_tvaudio = 1,
567 .tuner_type = -1,
568 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800569 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800570 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800572 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800573 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800574 .name = "Prolink Pixelview PlayTV (bt878)",
575 .video_inputs = 3,
576 .audio_inputs = 1,
577 .tuner = 0,
578 .svhs = 2,
579 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200580 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800581 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300582 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
583 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800584 .needs_tvaudio = 1,
585 .pll = PLL_28,
586 .tuner_type = -1,
587 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800588 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800589 .name = "Leadtek WinView 601",
590 .video_inputs = 3,
591 .audio_inputs = 1,
592 .tuner = 0,
593 .svhs = 2,
594 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200595 .muxsel = { 2, 3, 1, 1,0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300596 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
597 .gpiomute = 0xcfa007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800598 .needs_tvaudio = 1,
599 .tuner_type = -1,
600 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800601 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800602 .audio_hook = winview_audio,
603 .has_radio = 1,
604 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800605 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800606 .name = "AVEC Intercapture",
607 .video_inputs = 3,
608 .audio_inputs = 2,
609 .tuner = 0,
610 .svhs = 2,
611 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200612 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300613 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800614 .needs_tvaudio = 1,
615 .tuner_type = -1,
616 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800617 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800618 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800619 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800620 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
621 .video_inputs = 4,
622 .audio_inputs = 1,
623 .tuner = -1,
624 .svhs = -1,
625 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200626 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300627 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800628 .no_msp34xx = 1,
629 .tuner_type = -1,
630 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800631 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800632 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700633
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800634 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800635 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800636 .name = "CEI Raffles Card",
637 .video_inputs = 3,
638 .audio_inputs = 3,
639 .tuner = 0,
640 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200641 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800642 .tuner_type = -1,
643 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800644 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800646 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800647 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
648 .video_inputs = 4,
649 .audio_inputs = 2, /* tuner, line in */
650 .tuner = 0,
651 .svhs = 2,
652 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200653 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300654 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
655 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800656 .pll = PLL_28,
657 .tuner_type = TUNER_PHILIPS_PAL_I,
658 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800659 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800660 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800661 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800662 .name = "Askey CPH050/ Phoebe Tv Master + FM",
663 .video_inputs = 3,
664 .audio_inputs = 1,
665 .tuner = 0,
666 .svhs = 2,
667 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200668 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300669 .gpiomux = { 0, 1, 0x800, 0x400 },
670 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800671 .needs_tvaudio = 1,
672 .pll = PLL_28,
673 .tuner_type = -1,
674 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800675 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800676 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800677 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800678 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
679 .video_inputs = 3,
680 .audio_inputs = 1,
681 .tuner = 0,
682 .svhs = -1,
683 .gpiomask = 7,
684 .muxsel = { 2, 3, -1 },
685 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300686 .gpiomux = { 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800687 .no_msp34xx = 1,
688 .pll = PLL_28,
689 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
690 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800691 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800692 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800694 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800695 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800696 .name = "Askey CPH05X/06X (bt878) [many vendors]",
697 .video_inputs = 3,
698 .audio_inputs = 1,
699 .tuner = 0,
700 .svhs = 2,
701 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200702 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300703 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
704 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800705 .needs_tvaudio = 1,
706 .pll = PLL_28,
707 .tuner_type = -1,
708 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800709 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800710 .has_remote = 1,
711 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800712 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800713 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
714 .video_inputs = 3,
715 .audio_inputs = 1,
716 .tuner = 0,
717 .svhs = 2,
718 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200719 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300720 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
721 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800722 .needs_tvaudio = 0,
723 .tuner_type = TUNER_PHILIPS_PAL,
724 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800725 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800726 .audio_hook = terratv_audio,
727 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800728 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800729 .name = "Hauppauge WinCam newer (bt878)",
730 .video_inputs = 4,
731 .audio_inputs = 1,
732 .tuner = 0,
733 .svhs = 3,
734 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200735 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300736 .gpiomux = { 0, 1, 2, 3 },
737 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800738 .needs_tvaudio = 1,
739 .tuner_type = -1,
740 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800741 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800742 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800743 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800744 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
745 .video_inputs = 4,
746 .audio_inputs = 2,
747 .tuner = 0,
748 .svhs = 2,
749 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200750 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300751 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
752 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800753 .pll = PLL_28,
754 .tuner_type = TUNER_PHILIPS_SECAM,
755 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800756 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800757 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700758
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800759 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800760 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800761 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
762 .video_inputs = 3,
763 .audio_inputs = 1,
764 .tuner = 0,
765 .svhs = 2,
766 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200767 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300768 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
769 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800770 .needs_tvaudio = 0,
771 .tuner_type = TUNER_PHILIPS_PAL,
772 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800773 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800774 .audio_hook = terratv_audio,
775 /* GPIO wiring:
776 External 20 pin connector (for Active Radio Upgrade board)
777 gpio00: i2c-sda
778 gpio01: i2c-scl
779 gpio02: om5610-data
780 gpio03: om5610-clk
781 gpio04: om5610-wre
782 gpio05: om5610-stereo
783 gpio06: rds6588-davn
784 gpio07: Pin 7 n.c.
785 gpio08: nIOW
786 gpio09+10: nIOR, nSEL ?? (bt878)
787 gpio09: nIOR (bt848)
788 gpio10: nSEL (bt848)
789 Sound Routing:
790 gpio16: u2-A0 (1st 4052bt)
791 gpio17: u2-A1
792 gpio18: u2-nEN
793 gpio19: u4-A0 (2nd 4052)
794 gpio20: u4-A1
795 u4-nEN - GND
796 Btspy:
797 00000 : Cdrom (internal audio input)
798 10000 : ext. Video audio input
799 20000 : TV Mono
800 a0000 : TV Mono/2
801 1a0000 : TV Stereo
802 30000 : Radio
803 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700804 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800806 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800807 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800808 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
809 .name = "Imagenation PXC200",
810 .video_inputs = 5,
811 .audio_inputs = 1,
812 .tuner = -1,
813 .svhs = 1, /* was: 4 */
814 .gpiomask = 0,
815 .muxsel = { 2, 3, 1, 0, 0},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300816 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800817 .needs_tvaudio = 1,
818 .tuner_type = -1,
819 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800820 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800821 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800823 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800824 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800825 .name = "Lifeview FlyVideo 98 LR50",
826 .video_inputs = 4,
827 .audio_inputs = 1,
828 .tuner = 0,
829 .svhs = 2,
830 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200831 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300832 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
833 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800834 .pll = PLL_28,
835 .tuner_type = -1,
836 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800837 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800838 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800839 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800840 .name = "Formac iProTV, Formac ProTV I (bt848)",
841 .video_inputs = 4,
842 .audio_inputs = 1,
843 .tuner = 0,
844 .svhs = 3,
845 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200846 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300847 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800848 .pll = PLL_28,
849 .tuner_type = TUNER_PHILIPS_PAL,
850 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800851 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800852 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800854 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800855 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800856 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
857 .video_inputs = 4,
858 .audio_inputs = 0,
859 .tuner = -1,
860 .svhs = 2,
861 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200862 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300863 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800864 .needs_tvaudio = 0,
865 .tuner_type = 4,
866 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800867 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800868 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800869 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800870 .name = "Terratec TerraTValue Version Bt878",
871 .video_inputs = 3,
872 .audio_inputs = 1,
873 .tuner = 0,
874 .svhs = 2,
875 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200876 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300877 .gpiomux = { 0x500, 0, 0x300, 0x900 },
878 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800879 .needs_tvaudio = 1,
880 .pll = PLL_28,
881 .tuner_type = TUNER_PHILIPS_PAL,
882 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800883 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800884 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800885 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800886 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
887 .video_inputs = 4,
888 .audio_inputs = 1,
889 .tuner = 0,
890 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200891 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800892 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
893 .gpiomask = 0xb33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300894 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
895 .gpiomute = 0x800000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800896 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
897 gpio23 -- hef4052:nEnable (0x800000)
898 gpio12 -- hef4052:A1
899 gpio13 -- hef4052:A0
900 0x0000: external audio
901 0x1000: FM
902 0x2000: TV
903 0x3000: n.c.
904 Note: There exists another variant "Winfast 2000" with tv stereo !?
905 Note: eeprom only contains FF and pci subsystem id 107d:6606
906 */
907 .needs_tvaudio = 0,
908 .pll = PLL_28,
909 .has_radio = 1,
910 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
911 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800912 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800913 .audio_hook = winfast2000_audio,
914 .has_remote = 1,
915 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800916 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800917 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
918 .video_inputs = 4,
919 .audio_inputs = 3,
920 .tuner = 0,
921 .svhs = 2,
922 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200923 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300924 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
925 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800926 .pll = PLL_28,
927 .tuner_type = -1,
928 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800929 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800930 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700931
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800932 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800933 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800934 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
935 .video_inputs = 4,
936 .audio_inputs = 3,
937 .tuner = 0,
938 .svhs = 2,
939 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200940 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300941 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
942 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800943 .pll = PLL_28,
944 .tuner_type = -1,
945 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800946 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800947 .has_radio = 1,
948 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800949 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800950 .name = "Prolink PixelView PlayTV pro",
951 .video_inputs = 3,
952 .audio_inputs = 1,
953 .tuner = 0,
954 .svhs = 2,
955 .gpiomask = 0xff,
956 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300957 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
958 .gpiomute = 0x29,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800959 .no_msp34xx = 1,
960 .pll = PLL_28,
961 .tuner_type = -1,
962 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800963 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800964 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800965 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800966 .name = "Askey CPH06X TView99",
967 .video_inputs = 4,
968 .audio_inputs = 1,
969 .tuner = 0,
970 .svhs = 2,
971 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200972 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300973 .gpiomux = { 0x551400, 0x551200, 0, 0 },
974 .gpiomute = 0x551c00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800975 .needs_tvaudio = 1,
976 .pll = PLL_28,
977 .tuner_type = 1,
978 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800979 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800980 .has_remote = 1,
981 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800982 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800983 .name = "Pinnacle PCTV Studio/Rave",
984 .video_inputs = 3,
985 .audio_inputs = 1,
986 .tuner = 0,
987 .svhs = 2,
988 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -0200989 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300990 .gpiomux = { 2, 0xd0001, 0, 0 },
991 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800992 .needs_tvaudio = 0,
993 .pll = PLL_28,
994 .tuner_type = -1,
995 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800996 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800997 },
998
999 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001000 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001001 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1002 .video_inputs = 3,
1003 .audio_inputs = 1,
1004 .tuner = 0,
1005 .svhs = 2,
1006 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001007 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001008 .gpiomux = { 4, 0, 2, 3 },
1009 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001010 .no_msp34xx = 1,
1011 .needs_tvaudio = 1,
1012 .tuner_type = TUNER_PHILIPS_NTSC,
1013 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001014 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001015 .pll = PLL_28,
1016 .has_radio = 1,
1017 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001018 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001019 .name = "AVerMedia TVPhone 98",
1020 .video_inputs = 3,
1021 .audio_inputs = 4,
1022 .tuner = 0,
1023 .svhs = 2,
1024 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001025 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001026 .gpiomux = { 13, 4, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001027 .needs_tvaudio = 1,
1028 .pll = PLL_28,
1029 .tuner_type = -1,
1030 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001031 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001032 .has_radio = 1,
1033 .audio_hook = avermedia_tvphone_audio,
1034 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001035 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001036 .name = "ProVideo PV951", /* pic16c54 */
1037 .video_inputs = 3,
1038 .audio_inputs = 1,
1039 .tuner = 0,
1040 .svhs = 2,
1041 .gpiomask = 0,
1042 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001043 .gpiomux = { 0, 0, 0, 0},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001044 .needs_tvaudio = 1,
1045 .no_msp34xx = 1,
1046 .pll = PLL_28,
1047 .tuner_type = 1,
1048 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001049 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001050 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001051 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001052 .name = "Little OnAir TV",
1053 .video_inputs = 3,
1054 .audio_inputs = 1,
1055 .tuner = 0,
1056 .svhs = 2,
1057 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001058 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001059 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1060 .gpiomute = 0xff3ffc,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001061 .no_msp34xx = 1,
1062 .tuner_type = -1,
1063 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001064 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001065 },
1066
1067 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001068 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001069 .name = "Sigma TVII-FM",
1070 .video_inputs = 2,
1071 .audio_inputs = 1,
1072 .tuner = 0,
1073 .svhs = -1,
1074 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001075 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001076 .gpiomux = { 1, 1, 0, 2 },
1077 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001078 .no_msp34xx = 1,
1079 .pll = PLL_NONE,
1080 .tuner_type = -1,
1081 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001082 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001083 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001084 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001085 .name = "MATRIX-Vision MV-Delta 2",
1086 .video_inputs = 5,
1087 .audio_inputs = 1,
1088 .tuner = -1,
1089 .svhs = 3,
1090 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001091 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001092 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001093 .no_msp34xx = 1,
1094 .pll = PLL_28,
1095 .tuner_type = -1,
1096 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001097 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001098 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001099 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001100 .name = "Zoltrix Genie TV/FM",
1101 .video_inputs = 3,
1102 .audio_inputs = 1,
1103 .tuner = 0,
1104 .svhs = 2,
1105 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001106 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001107 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1108 .gpiomute = 0xbcb03f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001109 .no_msp34xx = 1,
1110 .pll = PLL_28,
1111 .tuner_type = 21,
1112 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001113 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001114 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001115 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001116 .name = "Terratec TV/Radio+",
1117 .video_inputs = 3,
1118 .audio_inputs = 1,
1119 .tuner = 0,
1120 .svhs = 2,
1121 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001122 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001123 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1124 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001125 .needs_tvaudio = 1,
1126 .no_msp34xx = 1,
1127 .pll = PLL_35,
1128 .tuner_type = 1,
1129 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001130 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001131 .has_radio = 1,
1132 },
1133
1134 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001135 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001136 .name = "Askey CPH03x/ Dynalink Magic TView",
1137 .video_inputs = 3,
1138 .audio_inputs = 1,
1139 .tuner = 0,
1140 .svhs = 2,
1141 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001142 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001143 .gpiomux = {2,0,0,0 },
1144 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001145 .needs_tvaudio = 1,
1146 .pll = PLL_28,
1147 .tuner_type = -1,
1148 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001149 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001150 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001151 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001152 .name = "IODATA GV-BCTV3/PCI",
1153 .video_inputs = 3,
1154 .audio_inputs = 1,
1155 .tuner = 0,
1156 .svhs = 2,
1157 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001158 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001159 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001160 .no_msp34xx = 1,
1161 .pll = PLL_28,
1162 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1163 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001164 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001165 .audio_hook = gvbctv3pci_audio,
1166 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001167 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001168 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1169 .video_inputs = 5,
1170 .audio_inputs = 1,
1171 .tuner = 0,
1172 .svhs = 3,
1173 .gpiomask = 0xAA0000,
1174 .muxsel = { 2,3,1,1,-1 },
1175 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001176 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1177 .gpiomute = 0xa8000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001178 .no_msp34xx = 1,
1179 .pll = PLL_28,
1180 .tuner_type = TUNER_PHILIPS_PAL_I,
1181 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001182 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001183 .has_remote = 1,
1184 /* GPIO wiring: (different from Rev.4C !)
1185 GPIO17: U4.A0 (first hef4052bt)
1186 GPIO19: U4.A1
1187 GPIO20: U5.A1 (second hef4052bt)
1188 GPIO21: U4.nEN
1189 GPIO22: BT832 Reset Line
1190 GPIO23: A5,A0, U5,nEN
1191 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1192 */
1193 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001194 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001195 .name = "Eagle Wireless Capricorn2 (bt878A)",
1196 .video_inputs = 4,
1197 .audio_inputs = 1,
1198 .tuner = 0,
1199 .svhs = 2,
1200 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001201 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001202 .gpiomux = { 0, 1, 2, 3 },
1203 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001204 .pll = PLL_28,
1205 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1206 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001207 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001208 },
1209
1210 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001211 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001212 /* David Härdeman <david@2gen.com> */
1213 .name = "Pinnacle PCTV Studio Pro",
1214 .video_inputs = 4,
1215 .audio_inputs = 1,
1216 .tuner = 0,
1217 .svhs = 3,
1218 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001219 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001220 .gpiomux = { 1, 0xd0001, 0, 0 },
1221 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001222 /* sound path (5 sources):
1223 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1224 0= ext. Audio IN
1225 1= from MUX2
1226 2= Mono TV sound from Tuner
1227 3= not connected
1228 MUX2 (mask 0x30000):
1229 0,2,3= from MSP34xx
1230 1= FM stereo Radio from Tuner */
1231 .needs_tvaudio = 0,
1232 .pll = PLL_28,
1233 .tuner_type = -1,
1234 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001235 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001236 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001237 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001238 /* Claas Langbehn <claas@bigfoot.com>,
1239 Sven Grothklags <sven@upb.de> */
1240 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1241 .video_inputs = 4,
1242 .audio_inputs = 3,
1243 .tuner = 0,
1244 .svhs = 2,
1245 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001246 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001247 .gpiomux = { 0, 0, 0x10, 8 },
1248 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001249 .needs_tvaudio = 1,
1250 .pll = PLL_28,
1251 .tuner_type = TUNER_PHILIPS_PAL,
1252 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001253 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001254 .has_radio = 1,
1255 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001256 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001257 /* Tim Röstermundt <rosterm@uni-muenster.de>
1258 in de.comp.os.unix.linux.hardware:
1259 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001260 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001261 options tuner type=5 */
1262 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1263 .video_inputs = 4,
1264 .audio_inputs = 1,
1265 .tuner = 0,
1266 .svhs = 2,
1267 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001268 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001269 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1270 .gpiomute = 0x18e0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001271 /* For cards with tda9820/tda9821:
1272 0x0000: Tuner normal stereo
1273 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1274 0x0880: Tuner A2 stereo */
1275 .pll = PLL_28,
1276 .tuner_type = -1,
1277 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001278 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001279 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001280 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001281 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1282 old Easy TV BT848 version (model CPH031) */
1283 .name = "Askey CPH031/ BESTBUY Easy TV",
1284 .video_inputs = 4,
1285 .audio_inputs = 1,
1286 .tuner = 0,
1287 .svhs = 2,
1288 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001289 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001290 .gpiomux = { 2, 0, 0, 0 },
1291 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001292 .needs_tvaudio = 0,
1293 .pll = PLL_28,
1294 .tuner_type = TUNER_TEMIC_PAL,
1295 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001296 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001297 },
1298
1299 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001300 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001301 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1302 .name = "Lifeview FlyVideo 98FM LR50",
1303 .video_inputs = 4,
1304 .audio_inputs = 3,
1305 .tuner = 0,
1306 .svhs = 2,
1307 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001308 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001309 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1310 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001311 .pll = PLL_28,
1312 .tuner_type = 5,
1313 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001314 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001315 },
1316 /* This is the ultimate cheapo capture card
1317 * just a BT848A on a small PCB!
1318 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001319 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001320 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1321 .video_inputs = 2,
1322 .audio_inputs = 0,
1323 .tuner = -1,
1324 .svhs = 1,
1325 .gpiomask = 0,
1326 .muxsel = { 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001327 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001328 .needs_tvaudio = 0,
1329 .no_msp34xx = 1,
1330 .pll = PLL_35,
1331 .tuner_type = -1,
1332 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001333 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001334 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001335 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001336 /* Daniel Herrington <daniel.herrington@home.com> */
1337 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1338 .video_inputs = 3,
1339 .audio_inputs = 1,
1340 .tuner = 0,
1341 .svhs = 2,
1342 .gpiomask = 0xe00,
1343 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001344 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1345 .gpiomute = 0x800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001346 .needs_tvaudio = 1,
1347 .pll = PLL_28,
1348 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1349 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001350 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001351 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001352 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001353 /* Matti Mottus <mottus@physic.ut.ee> */
1354 .name = "Askey CPH03x TV Capturer",
1355 .video_inputs = 4,
1356 .audio_inputs = 1,
1357 .tuner = 0,
1358 .svhs = 2,
1359 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001360 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001361 .gpiomux = { 2, 0, 0, 0 },
1362 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001363 .pll = PLL_28,
1364 .tuner_type = 0,
1365 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001366 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001367 },
1368
1369 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001370 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001371 /* Philip Blundell <philb@gnu.org> */
1372 .name = "Modular Technology MM100PCTV",
1373 .video_inputs = 2,
1374 .audio_inputs = 2,
1375 .tuner = 0,
1376 .svhs = -1,
1377 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001378 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001379 .gpiomux = { 2, 0, 0, 1 },
1380 .gpiomute = 8,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001381 .pll = PLL_35,
1382 .tuner_type = TUNER_TEMIC_PAL,
1383 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001384 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001385 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001386 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001387 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001388 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001389 .video_inputs = 2,
1390 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001391 .tuner = -1,
1392 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001393 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001394 .muxsel = { 2, 2 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001395 .gpiomux = { },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001396 .no_msp34xx = 1,
1397 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001398 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001399 .tuner_type = -1,
1400 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001401 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001402 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001403 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001404 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1405 new Easy TV BT878 version (model CPH061)
1406 special thanks to Informatica Mieres for providing the card */
1407 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1408 .video_inputs = 3,
1409 .audio_inputs = 2,
1410 .tuner = 0,
1411 .svhs = 2,
1412 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001413 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001414 .gpiomux = { 1, 0, 4, 4 },
1415 .gpiomute = 9,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001416 .needs_tvaudio = 0,
1417 .pll = PLL_28,
1418 .tuner_type = TUNER_PHILIPS_PAL,
1419 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001420 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001421 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001422 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001423 /* Lukas Gebauer <geby@volny.cz> */
1424 .name = "ATI TV-Wonder",
1425 .video_inputs = 3,
1426 .audio_inputs = 1,
1427 .tuner = 0,
1428 .svhs = 2,
1429 .gpiomask = 0xf03f,
1430 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001431 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1432 .gpiomute = 0xbffe,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001433 .pll = PLL_28,
1434 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1435 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001436 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001437 },
1438
1439 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001440 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001441 /* Lukas Gebauer <geby@volny.cz> */
1442 .name = "ATI TV-Wonder VE",
1443 .video_inputs = 2,
1444 .audio_inputs = 1,
1445 .tuner = 0,
1446 .svhs = -1,
1447 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001448 .muxsel = { 2, 3, 0, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001449 .gpiomux = { 0, 0, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001450 .no_msp34xx = 1,
1451 .pll = PLL_28,
1452 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1453 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001454 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001455 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001456 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001457 /* DeeJay <deejay@westel900.net (2000S) */
1458 .name = "Lifeview FlyVideo 2000S LR90",
1459 .video_inputs = 3,
1460 .audio_inputs = 3,
1461 .tuner = 0,
1462 .svhs = 2,
1463 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001464 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001465 /* Radio changed from 1e80 to 0x800 to make
1466 FlyVideo2000S in .hu happy (gm)*/
1467 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001468 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1469 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001470 .audio_hook = fv2000s_audio,
1471 .no_msp34xx = 1,
1472 .no_tda9875 = 1,
1473 .needs_tvaudio = 1,
1474 .pll = PLL_28,
1475 .tuner_type = 5,
1476 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001477 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001478 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001479 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001480 .name = "Terratec TValueRadio",
1481 .video_inputs = 3,
1482 .audio_inputs = 1,
1483 .tuner = 0,
1484 .svhs = 2,
1485 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001486 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001487 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1488 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001489 .needs_tvaudio = 1,
1490 .pll = PLL_28,
1491 .tuner_type = TUNER_PHILIPS_PAL,
1492 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001493 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001494 .has_radio = 1,
1495 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001496 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001497 /* TANAKA Kei <peg00625@nifty.com> */
1498 .name = "IODATA GV-BCTV4/PCI",
1499 .video_inputs = 3,
1500 .audio_inputs = 1,
1501 .tuner = 0,
1502 .svhs = 2,
1503 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001504 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001505 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001506 .no_msp34xx = 1,
1507 .pll = PLL_28,
1508 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1509 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001510 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001511 .audio_hook = gvbctv3pci_audio,
1512 },
1513
1514 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001515 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001516 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1517 /* try "insmod msp3400 simple=0" if you have
1518 * sound problems with this card. */
1519 .video_inputs = 4,
1520 .audio_inputs = 1,
1521 .tuner = 0,
1522 .svhs = -1,
1523 .gpiomask = 0x4f8a00,
1524 /* 0x100000: 1=MSP enabled (0=disable again)
1525 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001526 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1527 .gpiomute = 0x947fff,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001528 /* tvtuner, radio, external,internal, mute, stereo
1529 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001530 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001531 .tuner_type = TUNER_MT2032,
1532 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001533 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001534 .pll = PLL_28,
1535 .has_radio = 1,
1536 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001537 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001538 /* Philip Blundell <pb@nexus.co.uk> */
1539 .name = "Active Imaging AIMMS",
1540 .video_inputs = 1,
1541 .audio_inputs = 0,
1542 .tuner = -1,
1543 .tuner_type = -1,
1544 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001545 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001546 .pll = PLL_28,
1547 .muxsel = { 2 },
1548 .gpiomask = 0
1549 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001550 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001551 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1552 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1553 .video_inputs = 3,
1554 .audio_inputs = 4,
1555 .tuner = 0,
1556 .svhs = 2,
1557 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001558 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001559 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1560 .gpiomute = 13,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001561 .needs_tvaudio = 1,
1562 .pll = PLL_28,
1563 .tuner_type = 25,
1564 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001565 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001566 .has_remote = 1,
1567 /* GPIO wiring:
1568 GPIO0: U4.A0 (hef4052bt)
1569 GPIO1: U4.A1
1570 GPIO2: U4.A1 (second hef4052bt)
1571 GPIO3: U4.nEN, U5.A0, A5.nEN
1572 GPIO8-15: vrd866b ?
1573 */
1574 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001575 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001576 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1577 .video_inputs = 4,
1578 .audio_inputs = 0,
1579 .tuner = -1,
1580 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001581 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001582 .pll = PLL_28,
1583 .no_msp34xx = 1,
1584 .tuner_type = UNSET,
1585 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001586 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001587 },
1588
1589 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001590 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001591 /* Dariusz Kowalewski <darekk@automex.pl> */
1592 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1593 .video_inputs = 4,
1594 .audio_inputs = 1,
1595 .tuner = 0,
1596 .svhs = 2,
1597 .gpiomask = 0x3f,
1598 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001599 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1600 .gpiomute = 0x09,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001601 .needs_tvaudio = 1,
1602 .no_msp34xx = 1,
1603 .no_tda9875 = 1,
1604 .pll = PLL_28,
1605 .tuner_type = 5,
1606 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001607 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001608 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1609 .has_radio = 1, /* Note: not all cards have radio */
1610 .has_remote = 1,
1611 /* GPIO wiring:
1612 GPIO0: A0 hef4052
1613 GPIO1: A1 hef4052
1614 GPIO3: nEN hef4052
1615 GPIO8-15: vrd866b
1616 GPIO20,22,23: R30,R29,R28
1617 */
1618 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001619 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001620 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1621 /* you must jumper JP5 for the card to work */
1622 .name = "Sensoray 311",
1623 .video_inputs = 5,
1624 .audio_inputs = 0,
1625 .tuner = -1,
1626 .svhs = 4,
1627 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001628 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001629 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001630 .needs_tvaudio = 0,
1631 .tuner_type = -1,
1632 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001633 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001634 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001635 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001636 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1637 .name = "RemoteVision MX (RV605)",
1638 .video_inputs = 16,
1639 .audio_inputs = 0,
1640 .tuner = -1,
1641 .svhs = -1,
1642 .gpiomask = 0x00,
1643 .gpiomask2 = 0x07ff,
1644 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1645 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1646 .no_msp34xx = 1,
1647 .no_tda9875 = 1,
1648 .tuner_type = -1,
1649 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001650 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001651 .muxsel_hook = rv605_muxsel,
1652 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001653 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001654 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1655 .video_inputs = 3,
1656 .audio_inputs = 2,
1657 .tuner = 0,
1658 .svhs = 2,
1659 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1660 .muxsel = { 2, 1, 1, },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001661 .gpiomux = { 0, 1, 2, 2 },
1662 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001663 .needs_tvaudio = 0,
1664 .tuner_type = TUNER_PHILIPS_PAL,
1665 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001666 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001667 .pll = PLL_28,
1668 .has_radio = 1,
1669 },
1670
1671 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001672 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001673 /* Masaki Suzuki <masaki@btree.org> */
1674 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1675 .video_inputs = 3,
1676 .audio_inputs = 1,
1677 .tuner = 0,
1678 .svhs = 2,
1679 .gpiomask = 0x140007,
1680 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001681 .gpiomux = { 0, 1, 2, 3 },
1682 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001683 .tuner_type = TUNER_PHILIPS_NTSC,
1684 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001685 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001686 .audio_hook = windvr_audio,
1687 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001688 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001689 .name = "GrandTec Multi Capture Card (Bt878)",
1690 .video_inputs = 4,
1691 .audio_inputs = 0,
1692 .tuner = -1,
1693 .svhs = -1,
1694 .gpiomask = 0,
1695 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001696 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001697 .needs_tvaudio = 0,
1698 .no_msp34xx = 1,
1699 .pll = PLL_28,
1700 .tuner_type = -1,
1701 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001702 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001703 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001704 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001705 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1706 .video_inputs = 4,
1707 .audio_inputs = 3,
1708 .tuner = 0,
1709 .svhs = 2,
1710 .gpiomask = 7,
1711 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001712 .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 -08001713 * This card lacks external Audio In, so we mute it on Ext. & Int.
1714 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1715 * This card lacks PCI subsystem ID, sigh.
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001716 * gpiomux =1: lower volume, 2+3: mute
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001717 * btwincap uses 0x80000/0x80003
1718 */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001719 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001720 .needs_tvaudio = 0,
1721 .no_msp34xx = 1,
1722 .pll = PLL_28,
1723 .tuner_type = 5,
1724 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001725 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001726 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1727 radio signal strength indicators work fine. */
1728 .has_radio = 1,
1729 /* GPIO Info:
1730 GPIO0,1: HEF4052 A0,A1
1731 GPIO2: HEF4052 nENABLE
1732 GPIO3-7: n.c.
1733 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1734 GPIO14,15: ??
1735 GPIO16-21: n.c.
1736 GPIO22,23: ??
1737 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1738 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001739 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001740 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1741 .name = "DSP Design TCVIDEO",
1742 .video_inputs = 4,
1743 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001744 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001745 .pll = PLL_28,
1746 .tuner_type = -1,
1747 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001748 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001749 },
1750
1751 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001752 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001753 .name = "Hauppauge WinTV PVR",
1754 .video_inputs = 4,
1755 .audio_inputs = 1,
1756 .tuner = 0,
1757 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001758 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001759 .needs_tvaudio = 1,
1760 .pll = PLL_28,
1761 .tuner_type = -1,
1762 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001763 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001764
1765 .gpiomask = 7,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001766 .gpiomux = {7},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001767 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001768 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001769 .name = "IODATA GV-BCTV5/PCI",
1770 .video_inputs = 3,
1771 .audio_inputs = 1,
1772 .tuner = 0,
1773 .svhs = 2,
1774 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001775 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001776 .gpiomux = {0x030000, 0x010000, 0, 0 },
1777 .gpiomute = 0x020000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001778 .no_msp34xx = 1,
1779 .pll = PLL_28,
1780 .tuner_type = TUNER_PHILIPS_NTSC_M,
1781 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001782 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001783 .audio_hook = gvbctv5pci_audio,
1784 .has_radio = 1,
1785 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001786 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001787 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1788 .video_inputs = 4, /* id-inputs-clock */
1789 .audio_inputs = 0,
1790 .tuner = -1,
1791 .svhs = 3,
1792 .muxsel = { 3, 2, 0, 1 },
1793 .pll = PLL_28,
1794 .tuner_type = -1,
1795 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001796 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001797 .no_msp34xx = 1,
1798 .no_tda9875 = 1,
1799 .no_tda7432 = 1,
1800 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001801 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001802 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1803 .video_inputs = 3,
1804 .audio_inputs = 0,
1805 .tuner = -1,
1806 .svhs = 2,
1807 .muxsel = { 2, 3, 1 },
1808 .pll = PLL_28,
1809 .tuner_type = -1,
1810 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001811 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001812 .no_msp34xx = 1,
1813 .no_tda9875 = 1,
1814 .no_tda7432 = 1,
1815 },
1816
1817 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001818 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001819 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1820 .video_inputs = 2,
1821 .audio_inputs = 0,
1822 .tuner = -1,
1823 .svhs = 1,
1824 .muxsel = { 3, 1 },
1825 .pll = PLL_28,
1826 .tuner_type = -1,
1827 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001828 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001829 .no_msp34xx = 1,
1830 .no_tda9875 = 1,
1831 .no_tda7432 = 1,
1832 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001833 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001834 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1835 .video_inputs = 1,
1836 .audio_inputs = 0,
1837 .tuner = -1,
1838 .svhs = -1,
1839 .muxsel = { 0 },
1840 .pll = PLL_28,
1841 .tuner_type = -1,
1842 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001843 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001844 .no_msp34xx = 1,
1845 .no_tda9875 = 1,
1846 .no_tda7432 = 1,
1847 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001848 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001849 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1850 .video_inputs = 2,
1851 .audio_inputs = 0,
1852 .tuner = -1,
1853 .svhs = 1,
1854 .muxsel = { 0, 1 },
1855 .pll = PLL_28,
1856 .tuner_type = -1,
1857 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001858 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001859 .no_msp34xx = 1,
1860 .no_tda9875 = 1,
1861 .no_tda7432 = 1,
1862 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001863 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001864 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1865 .video_inputs = 1,
1866 .audio_inputs = 1,
1867 .tuner = -1,
1868 .svhs = -1,
1869 .muxsel = { 0 },
1870 .pll = PLL_28,
1871 .tuner_type = UNSET,
1872 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001873 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001874 .no_msp34xx = 1,
1875 .no_tda9875 = 1,
1876 .no_tda7432 = 1,
1877 },
1878
1879 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001880 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001881 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1882 .video_inputs = 2,
1883 .audio_inputs = 1,
1884 .tuner = -1,
1885 .svhs = 1,
1886 .muxsel = { 0, 1 },
1887 .pll = PLL_28,
1888 .tuner_type = UNSET,
1889 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001890 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001891 .no_msp34xx = 1,
1892 .no_tda9875 = 1,
1893 .no_tda7432 = 1,
1894 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001895 [BTTV_BOARD_OSPREY2x0] = {
Michael Krufky52398ef2006-05-26 02:13:15 -03001896 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001897 .video_inputs = 2,
1898 .audio_inputs = 1,
1899 .tuner = -1,
1900 .svhs = 1,
1901 .muxsel = { 2, 3 },
1902 .pll = PLL_28,
1903 .tuner_type = UNSET,
1904 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001905 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001906 .no_msp34xx = 1,
1907 .no_tda9875 = 1,
1908 .no_tda7432 = 1,
1909 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001910 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001911 .name = "Osprey 500", /* 500 */
1912 .video_inputs = 2,
1913 .audio_inputs = 1,
1914 .tuner = -1,
1915 .svhs = 1,
1916 .muxsel = { 2, 3 },
1917 .pll = PLL_28,
1918 .tuner_type = -1,
1919 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001920 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001921 .no_msp34xx = 1,
1922 .no_tda9875 = 1,
1923 .no_tda7432 = 1,
1924 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001925 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001926 .name = "Osprey 540", /* 540 */
1927 .video_inputs = 4,
1928 .audio_inputs = 1,
1929 .tuner = -1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001930 .pll = PLL_28,
1931 .tuner_type = -1,
1932 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001933 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001934 .no_msp34xx = 1,
1935 .no_tda9875 = 1,
1936 .no_tda7432 = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001937 },
1938
1939 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001940 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001941 .name = "Osprey 2000", /* 2000 */
1942 .video_inputs = 2,
1943 .audio_inputs = 1,
1944 .tuner = -1,
1945 .svhs = 1,
1946 .muxsel = { 2, 3 },
1947 .pll = PLL_28,
1948 .tuner_type = UNSET,
1949 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001950 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001951 .no_msp34xx = 1,
1952 .no_tda9875 = 1,
1953 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1954 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001955 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001956 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1957 .name = "IDS Eagle",
1958 .video_inputs = 4,
1959 .audio_inputs = 0,
1960 .tuner = -1,
1961 .tuner_type = -1,
1962 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001963 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001964 .svhs = -1,
1965 .gpiomask = 0,
1966 .muxsel = { 0, 1, 2, 3 },
1967 .muxsel_hook = eagle_muxsel,
1968 .no_msp34xx = 1,
1969 .no_tda9875 = 1,
1970 .pll = PLL_28,
1971 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001972 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001973 .name = "Pinnacle PCTV Sat",
1974 .video_inputs = 2,
1975 .audio_inputs = 0,
1976 .svhs = 1,
1977 .tuner = -1,
1978 .tuner_type = -1,
1979 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001980 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001981 .no_msp34xx = 1,
1982 .no_tda9875 = 1,
1983 .no_tda7432 = 1,
Mauro Carvalho Chehabd2be8932006-10-02 23:52:48 -03001984 .muxsel = { 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001985 .pll = PLL_28,
1986 .no_gpioirq = 1,
1987 .has_dvb = 1,
1988 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001989 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001990 .name = "Formac ProTV II (bt878)",
1991 .video_inputs = 4,
1992 .audio_inputs = 1,
1993 .tuner = 0,
1994 .svhs = 3,
1995 .gpiomask = 2,
1996 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02001997 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001998 .gpiomux = { 2, 2, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001999 .pll = PLL_28,
2000 .has_radio = 1,
2001 .tuner_type = TUNER_PHILIPS_PAL,
2002 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002003 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002004 /* sound routing:
2005 GPIO=0x00,0x01,0x03: mute (?)
2006 0x02: both TV and radio (tuner: FM1216/I)
2007 The card has onboard audio connectors labeled "cdrom" and "board",
2008 not soldered here, though unknown wiring.
2009 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002010 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002011 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002012
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002013 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002014 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002015 .name = "MachTV",
2016 .video_inputs = 3,
2017 .audio_inputs = 1,
2018 .tuner = 0,
2019 .svhs = -1,
2020 .gpiomask = 7,
2021 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002022 .gpiomux = { 0, 1, 2, 3},
2023 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002024 .needs_tvaudio = 1,
2025 .tuner_type = 5,
2026 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002027 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08002028 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002029 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002030 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002031 .name = "Euresys Picolo",
2032 .video_inputs = 3,
2033 .audio_inputs = 0,
2034 .tuner = -1,
2035 .svhs = 2,
2036 .gpiomask = 0,
2037 .no_msp34xx = 1,
2038 .no_tda9875 = 1,
2039 .no_tda7432 = 1,
2040 .muxsel = { 2, 0, 1},
2041 .pll = PLL_28,
2042 .tuner_type = UNSET,
2043 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002044 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002045 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002046 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002047 /* Luc Van Hoeylandt <luc@e-magic.be> */
2048 .name = "ProVideo PV150", /* 0x4f */
2049 .video_inputs = 2,
2050 .audio_inputs = 0,
2051 .tuner = -1,
2052 .svhs = -1,
2053 .gpiomask = 0,
2054 .muxsel = { 2, 3 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002055 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002056 .needs_tvaudio = 0,
2057 .no_msp34xx = 1,
2058 .pll = PLL_28,
2059 .tuner_type = UNSET,
2060 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002061 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002062 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002063 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002064 /* Hiroshi Takekawa <sian@big.or.jp> */
2065 /* This card lacks subsystem ID */
2066 .name = "AD-TVK503", /* 0x63 */
2067 .video_inputs = 4,
2068 .audio_inputs = 1,
2069 .tuner = 0,
2070 .svhs = 2,
2071 .gpiomask = 0x001e8007,
2072 .muxsel = { 2, 3, 1, 0 },
2073 /* Tuner, Radio, external, internal, off, on */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002074 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2075 .gpiomute = 0x0f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002076 .needs_tvaudio = 0,
2077 .no_msp34xx = 1,
2078 .pll = PLL_28,
2079 .tuner_type = 2,
2080 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002081 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002082 .audio_hook = adtvk503_audio,
2083 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002084
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002085 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002086 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002087 .name = "Hercules Smart TV Stereo",
2088 .video_inputs = 4,
2089 .audio_inputs = 1,
2090 .tuner = 0,
2091 .svhs = 2,
2092 .gpiomask = 0x00,
2093 .muxsel = { 2, 3, 1, 1 },
2094 .needs_tvaudio = 1,
2095 .no_msp34xx = 1,
2096 .pll = PLL_28,
2097 .tuner_type = 5,
2098 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002099 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002100 /* Notes:
2101 - card lacks subsystem ID
2102 - stereo variant w/ daughter board with tda9874a @0xb0
2103 - Audio Routing:
2104 always from tda9874 independent of GPIO (?)
2105 external line in: unknown
2106 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2107 hef4053 (instead 4052) for unknown function
2108 */
2109 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002110 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002111 .name = "Pace TV & Radio Card",
2112 .video_inputs = 4,
2113 .audio_inputs = 1,
2114 .tuner = 0,
2115 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002116 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002117 .gpiomask = 0,
2118 .no_tda9875 = 1,
2119 .no_tda7432 = 1,
2120 .tuner_type = 1,
2121 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002122 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002123 .has_radio = 1,
2124 .pll = PLL_28,
2125 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2126 only internal line out: (4pin header) RGGL
2127 Radio must be decoded by msp3410d (not routed through)*/
2128 /*
2129 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2130 */
2131 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002132 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002133 /* Chris Willing <chris@vislab.usyd.edu.au> */
2134 .name = "IVC-200",
2135 .video_inputs = 1,
2136 .audio_inputs = 0,
2137 .tuner = -1,
2138 .tuner_type = -1,
2139 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002140 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002141 .svhs = -1,
2142 .gpiomask = 0xdf,
2143 .muxsel = { 2 },
2144 .pll = PLL_28,
2145 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002146 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002147 .name = "Grand X-Guard / Trust 814PCI",
2148 .video_inputs = 16,
2149 .audio_inputs = 0,
2150 .tuner = -1,
2151 .svhs = -1,
2152 .tuner_type = 4,
2153 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002154 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002155 .gpiomask2 = 0xff,
2156 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2157 .muxsel_hook = xguard_muxsel,
2158 .no_msp34xx = 1,
2159 .no_tda9875 = 1,
2160 .no_tda7432 = 1,
2161 .pll = PLL_28,
2162 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002163
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002164 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002165 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002166 .name = "Nebula Electronics DigiTV",
2167 .video_inputs = 1,
2168 .tuner = -1,
2169 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002170 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002171 .no_msp34xx = 1,
2172 .no_tda9875 = 1,
2173 .no_tda7432 = 1,
2174 .pll = PLL_28,
2175 .tuner_type = -1,
2176 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002177 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002178 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002179 .has_remote = 1,
2180 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002181 .no_gpioirq = 1,
2182 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002183 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002184 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2185 .name = "ProVideo PV143",
2186 .video_inputs = 4,
2187 .audio_inputs = 0,
2188 .tuner = -1,
2189 .svhs = -1,
2190 .gpiomask = 0,
2191 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002192 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002193 .needs_tvaudio = 0,
2194 .no_msp34xx = 1,
2195 .pll = PLL_28,
2196 .tuner_type = -1,
2197 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002198 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002199 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002200 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002201 /* M.Klahr@phytec.de */
2202 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2203 .video_inputs = 4,
2204 .audio_inputs = 0,
2205 .tuner = -1, /* card has no tuner */
2206 .svhs = 3,
2207 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002208 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002209 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002210 .needs_tvaudio = 1,
2211 .pll = PLL_28,
2212 .tuner_type = -1,
2213 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002214 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002215 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002216 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002217 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2218 .video_inputs = 4,
2219 .audio_inputs = 0,
2220 .tuner = -1, /* card has no tuner */
2221 .svhs = 3,
2222 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002223 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002224 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002225 .needs_tvaudio = 1,
2226 .pll = PLL_28,
2227 .tuner_type = -1,
2228 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002229 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002230 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002231
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002232 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002233 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002234 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2235 .video_inputs = 10,
2236 .audio_inputs = 0,
2237 .tuner = -1, /* card has no tuner */
2238 .svhs = 9,
2239 .gpiomask = 0x00,
2240 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2241 via the upper nibble of muxsel. here: used for
2242 xternal video-mux */
2243 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002244 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002245 .needs_tvaudio = 1,
2246 .pll = PLL_28,
2247 .tuner_type = -1,
2248 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002249 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002250 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002251 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002252 .name = "PHYTEC VD-009 Combi (bt878)",
2253 .video_inputs = 10,
2254 .audio_inputs = 0,
2255 .tuner = -1, /* card has no tuner */
2256 .svhs = 9,
2257 .gpiomask = 0x00,
2258 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2259 via the upper nibble of muxsel. here: used for
2260 xternal video-mux */
2261 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002262 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002263 .needs_tvaudio = 1,
2264 .pll = PLL_28,
2265 .tuner_type = -1,
2266 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002267 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002268 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002269 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002270 .name = "IVC-100",
2271 .video_inputs = 4,
2272 .audio_inputs = 0,
2273 .tuner = -1,
2274 .tuner_type = -1,
2275 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002276 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002277 .svhs = -1,
2278 .gpiomask = 0xdf,
2279 .muxsel = { 2, 3, 1, 0 },
2280 .pll = PLL_28,
2281 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002282 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002283 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2284 .name = "IVC-120G",
2285 .video_inputs = 16,
2286 .audio_inputs = 0, /* card has no audio */
2287 .tuner = -1, /* card has no tuner */
2288 .tuner_type = -1,
2289 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002290 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002291 .svhs = -1, /* card has no svhs */
2292 .needs_tvaudio = 0,
2293 .no_msp34xx = 1,
2294 .no_tda9875 = 1,
2295 .no_tda7432 = 1,
2296 .gpiomask = 0x00,
2297 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2298 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2299 .muxsel_hook = ivc120_muxsel,
2300 .pll = PLL_28,
2301 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002302
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002303 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002304 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002305 .name = "pcHDTV HD-2000 TV",
2306 .video_inputs = 4,
2307 .audio_inputs = 1,
2308 .tuner = 0,
2309 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002310 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002311 .tuner_type = TUNER_PHILIPS_ATSC,
2312 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002313 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002314 .has_dvb = 1,
2315 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002316 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002317 .name = "Twinhan DST + clones",
2318 .no_msp34xx = 1,
2319 .no_tda9875 = 1,
2320 .no_tda7432 = 1,
2321 .tuner_type = TUNER_ABSENT,
2322 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002323 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002324 .no_video = 1,
2325 .has_dvb = 1,
2326 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002327 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002328 .name = "Winfast VC100",
2329 .video_inputs = 3,
2330 .audio_inputs = 0,
2331 .svhs = 1,
2332 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002333 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002334 .no_msp34xx = 1,
2335 .no_tda9875 = 1,
2336 .no_tda7432 = 1,
2337 .tuner_type = TUNER_ABSENT,
2338 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002339 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002340 .pll = PLL_28,
2341 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002342 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002343 .name = "Teppro TEV-560/InterVision IV-560",
2344 .video_inputs = 3,
2345 .audio_inputs = 1,
2346 .tuner = 0,
2347 .svhs = 2,
2348 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002349 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002350 .gpiomux = { 1, 1, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002351 .needs_tvaudio = 1,
2352 .tuner_type = TUNER_PHILIPS_PAL,
2353 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002354 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002355 .pll = PLL_35,
2356 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002357
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002358 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002359 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002360 .name = "SIMUS GVC1100",
2361 .video_inputs = 4,
2362 .audio_inputs = 0,
2363 .tuner = -1,
2364 .svhs = -1,
2365 .tuner_type = -1,
2366 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002367 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002368 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002369 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002370 .gpiomask = 0x3F,
2371 .muxsel_hook = gvc1100_muxsel,
2372 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002373 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002374 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2375 .name = "NGS NGSTV+",
2376 .video_inputs = 3,
2377 .tuner = 0,
2378 .svhs = 2,
2379 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002380 .muxsel = { 2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002381 .gpiomux = { 0, 0, 0, 0 },
2382 .gpiomute = 0x000003,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002383 .pll = PLL_28,
2384 .tuner_type = TUNER_PHILIPS_PAL,
2385 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002386 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002387 .has_remote = 1,
2388 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002389 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002390 /* http://linuxmedialabs.com */
2391 .name = "LMLBT4",
2392 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2393 .audio_inputs = 0,
2394 .tuner = -1,
2395 .svhs = -1,
2396 .muxsel = { 2, 3, 1, 0 },
2397 .no_msp34xx = 1,
2398 .no_tda9875 = 1,
2399 .no_tda7432 = 1,
2400 .needs_tvaudio = 0,
2401 .tuner_type = -1,
2402 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002403 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002404 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002405 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002406 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2407 .name = "Tekram M205 PRO",
2408 .video_inputs = 3,
2409 .audio_inputs = 1,
2410 .tuner = 0,
2411 .tuner_type = TUNER_PHILIPS_PAL,
2412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002414 .svhs = 2,
2415 .needs_tvaudio = 0,
2416 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002417 .muxsel = { 2, 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002418 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002419 .pll = PLL_28,
2420 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002421
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002422 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002423 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002424 /* Javier Cendan Ares <jcendan@lycos.es> */
2425 /* bt878 TV + FM without subsystem ID */
2426 .name = "Conceptronic CONTVFMi",
2427 .video_inputs = 3,
2428 .audio_inputs = 1,
2429 .tuner = 0,
2430 .svhs = 2,
2431 .gpiomask = 0x008007,
2432 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002433 .gpiomux = { 0, 1, 2, 2 },
2434 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002435 .needs_tvaudio = 0,
2436 .pll = PLL_28,
2437 .tuner_type = TUNER_PHILIPS_PAL,
2438 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002439 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002440 .has_remote = 1,
2441 .has_radio = 1,
2442 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002443 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002444 /*Eric DEBIEF <debief@telemsa.com>*/
2445 /*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 -08002446 /* 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 -08002447 /*0x79 in bttv.h*/
2448 .name = "Euresys Picolo Tetra",
2449 .video_inputs = 4,
2450 .audio_inputs = 0,
2451 .tuner = -1,
2452 .svhs = -1,
2453 .gpiomask = 0,
2454 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2455 .no_msp34xx = 1,
2456 .no_tda9875 = 1,
2457 .no_tda7432 = 1,
2458 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002459 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002460 .pll = PLL_28,
2461 .needs_tvaudio = 0,
2462 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2463 .tuner_type = -1,
2464 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002465 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002466 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002467 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002468 /* Spirit TV Tuner from http://spiritmodems.com.au */
2469 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2470 .name = "Spirit TV Tuner",
2471 .video_inputs = 3,
2472 .audio_inputs = 1,
2473 .tuner = 0,
2474 .svhs = 2,
2475 .gpiomask = 0x0000000f,
2476 .muxsel = { 2, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002477 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002478 .tuner_type = TUNER_TEMIC_PAL,
2479 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002480 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002481 .no_msp34xx = 1,
2482 .no_tda9875 = 1,
2483 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002484 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002485 /* Wolfram Joost <wojo@frokaschwei.de> */
2486 .name = "AVerMedia AVerTV DVB-T 771",
2487 .video_inputs = 2,
2488 .svhs = 1,
2489 .tuner = -1,
2490 .tuner_type = TUNER_ABSENT,
2491 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002492 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002493 .muxsel = { 3 , 3 },
2494 .no_msp34xx = 1,
2495 .no_tda9875 = 1,
2496 .no_tda7432 = 1,
2497 .pll = PLL_28,
2498 .has_dvb = 1,
2499 .no_gpioirq = 1,
2500 .has_remote = 1,
2501 },
2502 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002503 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002504 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002505 /* 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 -08002506 .name = "AverMedia AverTV DVB-T 761",
2507 .video_inputs = 2,
2508 .tuner = -1,
2509 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002510 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002511 .no_msp34xx = 1,
2512 .no_tda9875 = 1,
2513 .no_tda7432 = 1,
2514 .pll = PLL_28,
2515 .tuner_type = -1,
2516 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002517 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002518 .has_dvb = 1,
2519 .no_gpioirq = 1,
2520 .has_remote = 1,
2521 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002522 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002523 /* andre.schwarz@matrix-vision.de */
2524 .name = "MATRIX Vision Sigma-SQ",
2525 .video_inputs = 16,
2526 .audio_inputs = 0,
2527 .tuner = -1,
2528 .svhs = -1,
2529 .gpiomask = 0x0,
2530 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2531 3, 3, 3, 3, 3, 3, 3, 3 },
2532 .muxsel_hook = sigmaSQ_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002533 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002534 .no_msp34xx = 1,
2535 .pll = PLL_28,
2536 .tuner_type = -1,
2537 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002538 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002539 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002540 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002541 /* andre.schwarz@matrix-vision.de */
2542 .name = "MATRIX Vision Sigma-SLC",
2543 .video_inputs = 4,
2544 .audio_inputs = 0,
2545 .tuner = -1,
2546 .svhs = -1,
2547 .gpiomask = 0x0,
2548 .muxsel = { 2, 2, 2, 2 },
2549 .muxsel_hook = sigmaSLC_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002550 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002551 .no_msp34xx = 1,
2552 .pll = PLL_28,
2553 .tuner_type = -1,
2554 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002555 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002556 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002557 /* BTTV_BOARD_APAC_VIEWCOMP */
2558 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002559 /* Attila Kondoros <attila.kondoros@chello.hu> */
2560 /* bt878 TV + FM 0x00000000 subsystem ID */
2561 .name = "APAC Viewcomp 878(AMAX)",
2562 .video_inputs = 2,
2563 .audio_inputs = 1,
2564 .tuner = 0,
2565 .svhs = -1,
2566 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002567 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002568 .gpiomux = { 2, 0, 0, 0 },
2569 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002570 .needs_tvaudio = 0,
2571 .pll = PLL_28,
2572 .tuner_type = TUNER_PHILIPS_PAL,
2573 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002574 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002575 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2576 .has_radio = 1, /* not every card has radio */
2577 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002578
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002579 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002580 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002581 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2582 .name = "DViCO FusionHDTV DVB-T Lite",
2583 .tuner = -1,
2584 .no_msp34xx = 1,
2585 .no_tda9875 = 1,
2586 .no_tda7432 = 1,
2587 .pll = PLL_28,
2588 .no_video = 1,
2589 .has_dvb = 1,
2590 .tuner_type = -1,
2591 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002592 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002593 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002594 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002595 /* Steven <photon38@pchome.com.tw> */
2596 .name = "V-Gear MyVCD",
2597 .video_inputs = 3,
2598 .audio_inputs = 1,
2599 .tuner = 0,
2600 .svhs = 2,
2601 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002602 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002603 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2604 .gpiomute = 0x31,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002605 .no_msp34xx = 1,
2606 .pll = PLL_28,
2607 .tuner_type = TUNER_PHILIPS_NTSC_M,
2608 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002609 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002610 .has_radio = 0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002611 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002612 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002613 /* Rick C <cryptdragoon@gmail.com> */
2614 .name = "Super TV Tuner",
2615 .video_inputs = 4,
2616 .audio_inputs = 1,
2617 .tuner = 0,
2618 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002619 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002620 .tuner_type = TUNER_PHILIPS_NTSC,
2621 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002622 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002623 .gpiomask = 0x008007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002624 .gpiomux = { 0, 0x000001,0,0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002625 .needs_tvaudio = 1,
2626 .has_radio = 1,
2627 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002628 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002629 /* Chris Fanning <video4linux@haydon.net> */
2630 .name = "Tibet Systems 'Progress DVR' CS16",
2631 .video_inputs = 16,
2632 .audio_inputs = 0,
2633 .tuner = -1,
2634 .svhs = -1,
2635 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2636 .pll = PLL_28,
2637 .no_msp34xx = 1,
2638 .no_tda9875 = 1,
2639 .no_tda7432 = 1,
2640 .tuner_type = -1,
2641 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002642 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002643 .muxsel_hook = tibetCS16_muxsel,
2644 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002645 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002646 /* Bill Brack <wbrack@mmm.com.hk> */
2647 /*
2648 * Note that, because of the card's wiring, the "master"
2649 * BT878A chip (i.e. the one which controls the analog switch
2650 * and must use this card type) is the 2nd one detected. The
2651 * other 3 chips should use card type 0x85, whose description
2652 * follows this one. There is a EEPROM on the card (which is
2653 * connected to the I2C of one of those other chips), but is
2654 * not currently handled. There is also a facility for a
2655 * "monitor", which is also not currently implemented.
2656 */
2657 .name = "Kodicom 4400R (master)",
2658 .video_inputs = 16,
2659 .audio_inputs = 0,
2660 .tuner = -1,
2661 .tuner_type = -1,
2662 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002663 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002664 .svhs = -1,
2665 /* GPIO bits 0-9 used for analog switch:
2666 * 00 - 03: camera selector
2667 * 04 - 06: channel (controller) selector
2668 * 07: data (1->on, 0->off)
2669 * 08: strobe
2670 * 09: reset
2671 * bit 16 is input from sync separator for the channel
2672 */
2673 .gpiomask = 0x0003ff,
2674 .no_gpioirq = 1,
2675 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2676 .pll = PLL_28,
2677 .no_msp34xx = 1,
2678 .no_tda7432 = 1,
2679 .no_tda9875 = 1,
2680 .muxsel_hook = kodicom4400r_muxsel,
2681 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002682 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002683 /* Bill Brack <wbrack@mmm.com.hk> */
2684 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2685 * one which controls the analog switch, and must use the card type)
2686 * is the 2nd one detected. The other 3 chips should use this card
2687 * type
2688 */
2689 .name = "Kodicom 4400R (slave)",
2690 .video_inputs = 16,
2691 .audio_inputs = 0,
2692 .tuner = -1,
2693 .tuner_type = -1,
2694 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002695 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002696 .svhs = -1,
2697 .gpiomask = 0x010000,
2698 .no_gpioirq = 1,
2699 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2700 .pll = PLL_28,
2701 .no_msp34xx = 1,
2702 .no_tda7432 = 1,
2703 .no_tda9875 = 1,
2704 .muxsel_hook = kodicom4400r_muxsel,
2705 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002706 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002707 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002708 /* Michael Henson <mhenson@clarityvi.com> */
2709 /* Adlink RTV24 with special unlock codes */
2710 .name = "Adlink RTV24",
2711 .video_inputs = 4,
2712 .audio_inputs = 1,
2713 .tuner = 0,
2714 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002715 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002716 .tuner_type = -1,
2717 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002718 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002719 .pll = PLL_28,
2720 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002721 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002722 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002723 /* Michael Krufky <mkrufky@m1k.net> */
2724 .name = "DViCO FusionHDTV 5 Lite",
2725 .tuner = 0,
Michael Krufky9c26c8b2006-04-27 01:29:17 -03002726 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002727 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002728 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002729 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002730 .audio_inputs = 1,
2731 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002732 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002733 .gpiomask = 0x00e00007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002734 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2735 .gpiomute = 0x00c00007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002736 .no_msp34xx = 1,
2737 .no_tda9875 = 1,
2738 .no_tda7432 = 1,
2739 .has_dvb = 1,
2740 },
2741 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002742 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03002743 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002744 .name = "Acorp Y878F",
2745 .video_inputs = 3,
2746 .audio_inputs = 1,
2747 .tuner = 0,
2748 .svhs = 2,
2749 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002750 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002751 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2752 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002753 .needs_tvaudio = 1,
2754 .pll = PLL_28,
2755 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2756 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002757 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002758 .has_radio = 1,
2759 },
2760 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002761 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002762 .name = "Conceptronic CTVFMi v2",
2763 .video_inputs = 3,
2764 .audio_inputs = 1,
2765 .tuner = 0,
2766 .svhs = 2,
2767 .gpiomask = 0x001c0007,
2768 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002769 .gpiomux = { 0, 1, 2, 2 },
2770 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002771 .needs_tvaudio = 0,
2772 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002773 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002774 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002775 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002776 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002777 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002778 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002779 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002780 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002781 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2782 .video_inputs = 5,
2783 .audio_inputs = 1,
2784 .tuner = 0,
2785 .svhs = 3,
2786 .gpiomask = 0x01fe00,
2787 .muxsel = { 2,3,1,1,-1 },
2788 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002789 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2790 .gpiomute = 0x12400,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002791 .no_msp34xx = 1,
2792 .pll = PLL_28,
2793 .tuner_type = TUNER_LG_PAL_FM,
2794 .tuner_addr = ADDR_UNSET,
2795 .radio_addr = ADDR_UNSET,
2796 .has_remote = 1,
2797 },
2798 /* ---- card 0x8b ---------------------------------- */
2799 [BTTV_BOARD_PV_M4900] = {
2800 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2801 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2802 .video_inputs = 3,
2803 .audio_inputs = 1,
2804 .tuner = 0,
2805 .svhs = 2,
2806 .gpiomask = 0x3f,
2807 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002808 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2809 .gpiomute = 0x29,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002810 .no_msp34xx = 1,
2811 .pll = PLL_28,
2812 .tuner_type = TUNER_YMEC_TVF_5533MF,
2813 .tuner_addr = ADDR_UNSET,
2814 .radio_addr = ADDR_UNSET,
2815 .has_radio = 1,
2816 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002817 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002818 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002819 [BTTV_BOARD_OSPREY440] = {
2820 .name = "Osprey 440",
2821 .video_inputs = 1,
2822 .audio_inputs = 1,
2823 .tuner = -1,
2824 .svhs = 1,
2825 .muxsel = { 2 },
2826 .pll = PLL_28,
2827 .tuner_type = UNSET,
2828 .tuner_addr = ADDR_UNSET,
2829 .radio_addr = ADDR_UNSET,
2830 .no_msp34xx = 1,
2831 .no_tda9875 = 1,
2832 .no_tda7432 = 1,
2833 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002834 /* ---- card 0x8d ---------------------------------- */
2835 [BTTV_BOARD_ASOUND_SKYEYE] = {
2836 .name = "Asound Skyeye PCTV",
2837 .video_inputs = 3,
2838 .audio_inputs = 1,
2839 .tuner = 0,
2840 .svhs = 2,
2841 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002842 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002843 .gpiomux = { 2, 0, 0, 0 },
2844 .gpiomute = 1,
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002845 .needs_tvaudio = 1,
2846 .pll = PLL_28,
2847 .tuner_type = 2,
2848 .tuner_addr = ADDR_UNSET,
2849 .radio_addr = ADDR_UNSET,
2850 },
Bill Pechter633323f2005-11-13 16:07:50 -08002851 /* ---- card 0x8e ---------------------------------- */
2852 [BTTV_BOARD_SABRENT_TVFM] = {
2853 .name = "Sabrent TV-FM (bttv version)",
2854 .video_inputs = 3,
2855 .audio_inputs = 1,
2856 .tuner = 0,
2857 .svhs = 2,
2858 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002859 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002860 .gpiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002861 .no_msp34xx = 1,
2862 .no_tda9875 = 1,
2863 .no_tda7432 = 1,
2864 .pll = PLL_28,
2865 .tuner_type = TUNER_TNF_5335MF,
2866 .tuner_addr = ADDR_UNSET,
2867 .has_radio = 1,
2868 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002869 /* ---- card 0x8f ---------------------------------- */
2870 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2871 .name = "Hauppauge ImpactVCB (bt878)",
2872 .video_inputs = 4,
2873 .audio_inputs = 0,
2874 .tuner = -1,
2875 .svhs = -1,
2876 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002877 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002878 .no_msp34xx = 1,
2879 .no_tda9875 = 1,
2880 .no_tda7432 = 1,
2881 .tuner_type = -1,
2882 .tuner_addr = ADDR_UNSET,
2883 .radio_addr = ADDR_UNSET,
2884 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002885 [BTTV_BOARD_MACHTV_MAGICTV] = {
2886 /* Julian Calaby <julian.calaby@gmail.com>
2887 * Slightly different from original MachTV definition (0x60)
2888
2889 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2890 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2891 * properly (methinks) causing no keyup bits being set */
2892
2893 .name = "MagicTV", /* rebranded MachTV */
2894 .video_inputs = 3,
2895 .audio_inputs = 1,
2896 .tuner = 0,
2897 .svhs = 2,
2898 .gpiomask = 7,
2899 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002900 .gpiomux = { 0, 1, 2, 3 },
2901 .gpiomute = 4,
Julian Calaby2d05ae62006-01-11 19:40:09 -02002902 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2903 .tuner_addr = ADDR_UNSET,
2904 .radio_addr = ADDR_UNSET,
2905 .pll = PLL_28,
2906 .has_radio = 1,
2907 .has_remote = 1,
2908 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002909};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002910
2911static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2912
2913/* ----------------------------------------------------------------------- */
2914
2915static unsigned char eeprom_data[256];
2916
2917/*
2918 * identify card
2919 */
2920void __devinit bttv_idcard(struct bttv *btv)
2921{
2922 unsigned int gpiobits;
2923 int i,type;
2924 unsigned short tmp;
2925
2926 /* read PCI subsystem ID */
2927 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2928 btv->cardid = tmp << 16;
2929 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2930 btv->cardid |= tmp;
2931
2932 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2933 /* look for the card */
2934 for (type = -1, i = 0; cards[i].id != 0; i++)
2935 if (cards[i].id == btv->cardid)
2936 type = i;
2937
2938 if (type != -1) {
2939 /* found it */
2940 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2941 "PCI subsystem ID is %04x:%04x\n",
2942 btv->c.nr,cards[type].name,cards[type].cardnr,
2943 btv->cardid & 0xffff,
2944 (btv->cardid >> 16) & 0xffff);
2945 btv->c.type = cards[type].cardnr;
2946 } else {
2947 /* 404 */
2948 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2949 btv->c.nr, btv->cardid & 0xffff,
2950 (btv->cardid >> 16) & 0xffff);
2951 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002952 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002953 }
2954 }
2955
2956 /* let the user override the autodetected type */
2957 if (card[btv->c.nr] < bttv_num_tvcards)
2958 btv->c.type=card[btv->c.nr];
2959
2960 /* print which card config we are using */
2961 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2962 bttv_tvcards[btv->c.type].name, btv->c.type,
2963 card[btv->c.nr] < bttv_num_tvcards
2964 ? "insmod option" : "autodetected");
2965
2966 /* overwrite gpio stuff ?? */
2967 if (UNSET == audioall && UNSET == audiomux[0])
2968 return;
2969
2970 if (UNSET != audiomux[0]) {
2971 gpiobits = 0;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03002972 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002973 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07002974 gpiobits |= audiomux[i];
2975 }
2976 } else {
2977 gpiobits = audioall;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03002978 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002979 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002980 }
2981 }
2982 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2983 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2984 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2985 for (i = 0; i < 5; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002986 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07002987 }
2988 printk("\n");
2989}
2990
2991/*
2992 * (most) board specific initialisations goes here
2993 */
2994
2995/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08002996static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07002997{
2998 int type = -1;
2999
3000 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003001 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003002 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003003 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003004 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003005 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003006
3007 if (-1 != type) {
3008 btv->c.type = type;
3009 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3010 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3011 }
3012}
3013
3014static void flyvideo_gpio(struct bttv *btv)
3015{
3016 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3017 int tuner=-1,ttype;
3018
3019 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003020 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003021 gpio = gpio_read();
3022 /* FIXME: must restore OUR_EN ??? */
3023
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003024 /* all cards provide GPIO info, some have an additional eeprom
3025 * LR50: GPIO coding can be found lower right CP1 .. CP9
3026 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3027 * GPIO14-12: n.c.
3028 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003029
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003030 * lowest 3 bytes are remote control codes (no handshake needed)
3031 * xxxFFF: No remote control chip soldered
3032 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3033 * Note: Some bits are Audio_Mask !
3034 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003035 ttype=(gpio&0x0f0000)>>16;
3036 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003037 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003038 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003039 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003040 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003041 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003042 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003043 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003044 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003045 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003046 break;
3047 default:
3048 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3049 }
3050
3051 has_remote = gpio & 0x800000;
3052 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003053 /* unknown 0x200000;
3054 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003055 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003056 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003057 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3058 /*
3059 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003060
3061 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003062 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003063
3064 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3065 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3066 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3067 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3068 is_capture_only?"yes":"no ");
3069
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003070 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003071 btv->tuner_type = tuner;
3072 btv->has_radio = has_radio;
3073
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003074 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3075 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3076 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003077 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003078 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003079}
3080
3081static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3082 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3083static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3084 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3085
3086static void miro_pinnacle_gpio(struct bttv *btv)
3087{
3088 int id,msp,gpio;
3089 char *info;
3090
3091 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003092 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003093 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003094 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003095 if (id < 32) {
3096 btv->tuner_type = miro_tunermap[id];
3097 if (0 == (gpio & 0x20)) {
3098 btv->has_radio = 1;
3099 if (!miro_fmtuner[id]) {
3100 btv->has_matchbox = 1;
3101 btv->mbox_we = (1<<6);
3102 btv->mbox_most = (1<<7);
3103 btv->mbox_clk = (1<<8);
3104 btv->mbox_data = (1<<9);
3105 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3106 }
3107 } else {
3108 btv->has_radio = 0;
3109 }
3110 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003111 if (btv->c.type == BTTV_BOARD_MIRO)
3112 btv->c.type = BTTV_BOARD_MIROPRO;
3113 if (btv->c.type == BTTV_BOARD_PINNACLE)
3114 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003115 }
3116 printk(KERN_INFO
3117 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3118 btv->c.nr, id+1, btv->tuner_type,
3119 !btv->has_radio ? "no" :
3120 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3121 (-1 == msp) ? "no" : "yes");
3122 } else {
3123 /* new cards with microtune tuner */
3124 id = 63 - id;
3125 btv->has_radio = 0;
3126 switch (id) {
3127 case 1:
3128 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003129 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003130 break;
3131 case 2:
3132 info = "PAL+SECAM / stereo";
3133 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003134 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003135 break;
3136 case 3:
3137 info = "NTSC / stereo";
3138 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003139 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003140 break;
3141 case 4:
3142 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003143 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003144 break;
3145 case 5:
3146 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003147 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003148 break;
3149 case 6:
3150 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003151 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003152 break;
3153 case 7:
3154 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003155 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003156 break;
3157 default:
3158 info = "oops: unknown card";
3159 break;
3160 }
3161 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003162 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003163 printk(KERN_INFO
3164 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3165 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003166 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003167 }
3168}
3169
3170/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3171#define LM1882_SYNC_DRIVE 0x200000L
3172
3173static void init_ids_eagle(struct bttv *btv)
3174{
3175 gpio_inout(0xffffff,0xFFFF37);
3176 gpio_write(0x200020);
3177
3178 /* flash strobe inverter ?! */
3179 gpio_write(0x200024);
3180
3181 /* switch sync drive off */
3182 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3183
3184 /* set BT848 muxel to 2 */
3185 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3186}
3187
3188/* Muxsel helper for the IDS Eagle.
3189 * the eagles does not use the standard muxsel-bits but
3190 * has its own multiplexer */
3191static void eagle_muxsel(struct bttv *btv, unsigned int input)
3192{
3193 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3194 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3195
Linus Torvalds1da177e2005-04-16 15:20:36 -07003196 /* composite */
3197 /* set chroma ADC to sleep */
3198 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3199 /* set to composite video */
3200 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3201 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003202
3203 /* switch sync drive off */
3204 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3205}
3206
3207static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3208{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003209 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003210 gpio_write(masks[input%4]);
3211}
3212
3213/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3214 alarms output
3215
3216 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3217 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3218
3219 IN - sensor inputs, INx - sensor inputs and TI XORed together
3220 O1,O2,O3 - alarm outputs (relays)
3221
3222 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3223
3224*/
3225
3226static void init_lmlbt4x(struct bttv *btv)
3227{
3228 printk(KERN_DEBUG "LMLBT4x init\n");
3229 btwrite(0x000000, BT848_GPIO_REG_INP);
3230 gpio_inout(0xffffff, 0x0006C0);
3231 gpio_write(0x000000);
3232}
3233
3234static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3235{
3236 unsigned int inmux = input % 8;
3237 gpio_inout( 0xf, 0xf );
3238 gpio_bits( 0xf, inmux );
3239}
3240
3241static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3242{
3243 unsigned int inmux = input % 4;
3244 gpio_inout( 3<<9, 3<<9 );
3245 gpio_bits( 3<<9, inmux<<9 );
3246}
3247
3248/* ----------------------------------------------------------------------- */
3249
3250static void bttv_reset_audio(struct bttv *btv)
3251{
3252 /*
3253 * BT878A has a audio-reset register.
3254 * 1. This register is an audio reset function but it is in
3255 * function-0 (video capture) address space.
3256 * 2. It is enough to do this once per power-up of the card.
3257 * 3. There is a typo in the Conexant doc -- it is not at
3258 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3259 * --//Shrikumar 030609
3260 */
3261 if (btv->id != 878)
3262 return;
3263
3264 if (bttv_debug)
3265 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3266 btwrite((1<<7), 0x058);
3267 udelay(10);
3268 btwrite( 0, 0x058);
3269}
3270
3271/* initialization part one -- before registering i2c bus */
3272void __devinit bttv_init_card1(struct bttv *btv)
3273{
3274 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003275 case BTTV_BOARD_HAUPPAUGE:
3276 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003277 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003278 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003279 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003280 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003281 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003282 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003283 boot_msp34xx(btv,11);
3284 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003285 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003286 pvr_boot(btv);
3287 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003288 case BTTV_BOARD_TWINHAN_DST:
3289 case BTTV_BOARD_AVDVBT_771:
3290 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003291 btv->use_i2c_hw = 1;
3292 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003293 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003294 init_RTV24( btv );
3295 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003296
Linus Torvalds1da177e2005-04-16 15:20:36 -07003297 }
3298 if (!bttv_tvcards[btv->c.type].has_dvb)
3299 bttv_reset_audio(btv);
3300}
3301
3302/* initialization part two -- after registering i2c bus */
3303void __devinit bttv_init_card2(struct bttv *btv)
3304{
3305 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003306 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003307
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003308 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003309
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003310 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003311 bttv_readee(btv,eeprom_data,0xa0);
3312 identify_by_eeprom(btv,eeprom_data);
3313 }
3314
3315 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003316 case BTTV_BOARD_MIRO:
3317 case BTTV_BOARD_MIROPRO:
3318 case BTTV_BOARD_PINNACLE:
3319 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003320 /* miro/pinnacle */
3321 miro_pinnacle_gpio(btv);
3322 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003323 case BTTV_BOARD_FLYVIDEO_98:
3324 case BTTV_BOARD_MAXI:
3325 case BTTV_BOARD_LIFE_FLYKIT:
3326 case BTTV_BOARD_FLYVIDEO:
3327 case BTTV_BOARD_TYPHOON_TVIEW:
3328 case BTTV_BOARD_CHRONOS_VS2:
3329 case BTTV_BOARD_FLYVIDEO_98FM:
3330 case BTTV_BOARD_FLYVIDEO2000:
3331 case BTTV_BOARD_FLYVIDEO98EZ:
3332 case BTTV_BOARD_CONFERENCETV:
3333 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003334 flyvideo_gpio(btv);
3335 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003336 case BTTV_BOARD_HAUPPAUGE:
3337 case BTTV_BOARD_HAUPPAUGE878:
3338 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003339 /* pick up some config infos from the eeprom */
3340 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003341 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003342 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003343 case BTTV_BOARD_AVERMEDIA98:
3344 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003345 bttv_readee(btv,eeprom_data,0xa0);
3346 avermedia_eeprom(btv);
3347 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003348 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003349 init_PXC200(btv);
3350 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003351 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003352 picolo_tetra_init(btv);
3353 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003354 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003355 btv->has_radio = 1;
3356 btv->has_matchbox = 1;
3357 btv->mbox_we = 0x20;
3358 btv->mbox_most = 0;
3359 btv->mbox_clk = 0x08;
3360 btv->mbox_data = 0x10;
3361 btv->mbox_mask = 0x38;
3362 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003363 case BTTV_BOARD_VOBIS_BOOSTAR:
3364 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003365 terratec_active_radio_upgrade(btv);
3366 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003367 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003368 if (btv->cardid == 0x3002144f) {
3369 btv->has_radio=1;
3370 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3371 }
3372 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003373 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003374 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003375 /* Fix up entry for 3DFX VoodooTV 100,
3376 which is an OEM STB card variant. */
3377 btv->has_radio=0;
3378 btv->tuner_type=TUNER_TEMIC_NTSC;
3379 }
3380 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003381 case BTTV_BOARD_OSPREY1x0:
3382 case BTTV_BOARD_OSPREY1x0_848:
3383 case BTTV_BOARD_OSPREY101_848:
3384 case BTTV_BOARD_OSPREY1x1:
3385 case BTTV_BOARD_OSPREY1x1_SVID:
3386 case BTTV_BOARD_OSPREY2xx:
3387 case BTTV_BOARD_OSPREY2x0_SVID:
3388 case BTTV_BOARD_OSPREY2x0:
3389 case BTTV_BOARD_OSPREY500:
3390 case BTTV_BOARD_OSPREY540:
3391 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003392 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003393 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003394 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003395 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003396 init_ids_eagle(btv);
3397 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003398 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003399 bttv_readee(btv,eeprom_data,0xa0);
3400 modtec_eeprom(btv);
3401 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003402 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003403 init_lmlbt4x(btv);
3404 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003405 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003406 tibetCS16_init(btv);
3407 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003408 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003409 kodicom4400r_init(btv);
3410 break;
3411 }
3412
3413 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003414 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003415 /* defaults from card list */
3416 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3417 btv->pll.pll_ifreq=28636363;
3418 btv->pll.pll_crystal=BT848_IFORM_XT0;
3419 }
3420 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3421 btv->pll.pll_ifreq=35468950;
3422 btv->pll.pll_crystal=BT848_IFORM_XT1;
3423 }
3424 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003425 switch (pll[btv->c.nr]) {
3426 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003427 btv->pll.pll_crystal = 0;
3428 btv->pll.pll_ifreq = 0;
3429 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003430 break;
3431 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003432 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003433 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003434 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003435 btv->pll.pll_crystal = BT848_IFORM_XT0;
3436 break;
3437 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003438 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003439 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003440 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003441 btv->pll.pll_crystal = BT848_IFORM_XT1;
3442 break;
3443 }
3444 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003445 btv->pll.pll_current = -1;
3446
Linus Torvalds1da177e2005-04-16 15:20:36 -07003447 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003448 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3449 addr = bttv_tvcards[btv->c.type].tuner_addr;
3450
3451 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003452 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003453 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003454 if (UNSET != tuner[btv->c.nr])
3455 btv->tuner_type = tuner[btv->c.nr];
3456 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003457
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003458 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003459 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003460
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003461 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003462 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003463 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003464
3465 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3466 }
3467
Hans Verkuil39e8f402006-01-09 15:25:16 -02003468 if (btv->tda9887_conf) {
3469 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3470 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003471 }
3472
Linus Torvalds1da177e2005-04-16 15:20:36 -07003473 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3474 if (svhs[btv->c.nr] != UNSET)
3475 btv->svhs = svhs[btv->c.nr];
3476 if (remote[btv->c.nr] != UNSET)
3477 btv->has_remote = remote[btv->c.nr];
3478
3479 if (bttv_tvcards[btv->c.type].has_radio)
3480 btv->has_radio=1;
3481 if (bttv_tvcards[btv->c.type].has_remote)
3482 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003483 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3484 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003485 if (bttv_tvcards[btv->c.type].audio_hook)
3486 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3487
3488 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3489 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003490 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3491 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003492 boot_bt832(btv);
3493 }
3494
3495 if (!autoload)
3496 return;
3497
3498 /* try to detect audio/fader chips */
3499 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003500 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003501 request_module("msp3400");
3502
3503 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003504 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003505 request_module("msp3400");
3506
3507 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003508 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003509 request_module("tda9875");
3510
3511 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003512 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003513 request_module("tda7432");
3514
3515 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3516 request_module("tvaudio");
3517
3518 /* tuner modules */
3519 tda9887 = 0;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003520 if (btv->tda9887_conf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003521 tda9887 = 1;
3522 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003523 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003524 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003525 /* Hybrid DVB card, DOES have a tda9887 */
3526 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3527 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003528 if (btv->tuner_type != UNSET)
3529 request_module("tuner");
3530}
3531
3532
3533/* ----------------------------------------------------------------------- */
3534
3535static void modtec_eeprom(struct bttv *btv)
3536{
3537 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3538 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3539 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3540 btv->c.nr,&eeprom_data[0x1e]);
3541 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3542 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3543 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003544 btv->c.nr,&eeprom_data[0x1e]);
3545 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3546 btv->tuner_type=TUNER_PHILIPS_NTSC;
3547 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3548 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003549 } else {
3550 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3551 btv->c.nr,&eeprom_data[0x1e]);
3552 }
3553}
3554
3555static void __devinit hauppauge_eeprom(struct bttv *btv)
3556{
3557 struct tveeprom tv;
3558
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003559 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003560 btv->tuner_type = tv.tuner_type;
3561 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003562
3563 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3564 btv->c.nr, tv.model);
3565
3566 /*
3567 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3568 * type based on model #.
3569 */
3570 if(tv.model == 64900) {
3571 printk("bttv%d: Switching board type from %s to %s\n",
3572 btv->c.nr,
3573 bttv_tvcards[btv->c.type].name,
3574 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3575 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3576 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003577}
3578
3579static int terratec_active_radio_upgrade(struct bttv *btv)
3580{
3581 int freq;
3582
3583 btv->has_radio = 1;
3584 btv->has_matchbox = 1;
3585 btv->mbox_we = 0x10;
3586 btv->mbox_most = 0x20;
3587 btv->mbox_clk = 0x08;
3588 btv->mbox_data = 0x04;
3589 btv->mbox_mask = 0x3c;
3590
3591 btv->mbox_iow = 1 << 8;
3592 btv->mbox_ior = 1 << 9;
3593 btv->mbox_csel = 1 << 10;
3594
3595 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003596 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003597 if (0x1ed8 == tea5757_read(btv)) {
3598 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3599 btv->c.nr);
3600 btv->has_radio = 1;
3601 btv->has_matchbox = 1;
3602 } else {
3603 btv->has_radio = 0;
3604 btv->has_matchbox = 0;
3605 }
3606 return 0;
3607}
3608
3609
3610/* ----------------------------------------------------------------------- */
3611
3612/*
3613 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3614 *
3615 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3616 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3617 * unpacked with unzip).
3618 */
3619#define PVR_GPIO_DELAY 10
3620
3621#define BTTV_ALT_DATA 0x000001
3622#define BTTV_ALT_DCLK 0x100000
3623#define BTTV_ALT_NCONFIG 0x800000
3624
3625static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3626{
3627 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003628 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003629 int i;
3630
3631 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3632 gpio_write(0);
3633 udelay(PVR_GPIO_DELAY);
3634
3635 gpio_write(BTTV_ALT_NCONFIG);
3636 udelay(PVR_GPIO_DELAY);
3637
3638 for (n = 0; n < microlen; n++) {
3639 bits = micro[n];
3640 for ( i = 0 ; i < 8 ; i++ ) {
3641 gpio_bits(BTTV_ALT_DCLK,0);
3642 if (bits & 0x01)
3643 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3644 else
3645 gpio_bits(BTTV_ALT_DATA,0);
3646 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3647 bits >>= 1;
3648 }
3649 }
3650 gpio_bits(BTTV_ALT_DCLK,0);
3651 udelay(PVR_GPIO_DELAY);
3652
3653 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3654 for (i = 0 ; i < 30 ; i++) {
3655 gpio_bits(BTTV_ALT_DCLK,0);
3656 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3657 }
3658 gpio_bits(BTTV_ALT_DCLK,0);
3659 return 0;
3660}
3661
3662static int __devinit pvr_boot(struct bttv *btv)
3663{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003664 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003665 int rc;
3666
3667 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3668 if (rc != 0) {
3669 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3670 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003671 return rc;
3672 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003673 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3674 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3675 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003676 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003677 return rc;
3678}
3679
3680/* ----------------------------------------------------------------------- */
3681/* some osprey specific stuff */
3682
3683static void __devinit osprey_eeprom(struct bttv *btv)
3684{
3685 int i = 0;
3686 unsigned char *ee = eeprom_data;
3687 unsigned long serial = 0;
3688
3689 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003690 /* this might be an antique... check for MMAC label in eeprom */
3691 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3692 unsigned char checksum = 0;
3693 for (i =0; i<21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003694 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003695 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003696 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003697 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003698 for (i = 12; i < 21; i++)
3699 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003700 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003701 } else {
3702 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003703 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003704
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003705 for(; offset < 8*16; offset += 16) {
3706 unsigned short checksum = 0;
3707 /* verify the checksum */
3708 for(i = 0; i<14; i++) checksum += ee[i+offset];
3709 checksum = ~checksum; /* no idea why */
3710 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003711 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003712 break;
3713 }
3714 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003715
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003716 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003717 return;
3718
3719 /* found a valid descriptor */
3720 type = (ee[offset+4]<<8) | (ee[offset+5]);
3721
3722 switch(type) {
3723
3724 /* 848 based */
3725 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003726 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003727 break;
3728 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003729 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003730 break;
3731
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003732 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003733 case 0x0012:
3734 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003735 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003736 break;
3737 case 0x0014:
3738 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003739 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003740 break;
3741 case 0x0016:
3742 case 0x0017:
3743 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003744 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003745 break;
3746 case 0x0018:
3747 case 0x0019:
3748 case 0x001E:
3749 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003750 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003751 break;
3752 case 0x001A:
3753 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003754 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003755 break;
3756 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003757 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003758 break;
3759 case 0x0050:
3760 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003761 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003762 /* bttv_osprey_540_init(btv); */
3763 break;
3764 case 0x0060:
3765 case 0x0070:
Michael Krufky52398ef2006-05-26 02:13:15 -03003766 case 0x00A0:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003767 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003768 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003769 gpio_inout(0xffffff,0x000303);
3770 break;
3771 default:
3772 /* unknown...leave generic, but get serial # */
3773 break;
3774 }
3775 serial = (ee[offset+6] << 24)
3776 | (ee[offset+7] << 16)
3777 | (ee[offset+8] << 8)
3778 | (ee[offset+9]);
3779 }
3780
3781 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3782 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3783}
3784
3785/* ----------------------------------------------------------------------- */
3786/* AVermedia specific stuff, from bktr_card.c */
3787
3788static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003789 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3790 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3791 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3792 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3793 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003794 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003795
3796static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003797 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003798 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3799 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003800 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3801 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003802
3803static void __devinit avermedia_eeprom(struct bttv *btv)
3804{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003805 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003806
3807 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003808 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3809 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003810 btv->has_remote = (eeprom_data[0x42] & 0x01);
3811
3812 if (tuner_make == 0 || tuner_make == 2)
3813 if(tuner_format <=0x0a)
3814 tuner = tuner_0_table[tuner_format];
3815 if (tuner_make == 1)
3816 if(tuner_format <=9)
3817 tuner = tuner_1_table[tuner_format];
3818
3819 if (tuner_make == 4)
3820 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003821 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003822
3823 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3824 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3825 if(tuner) {
3826 btv->tuner_type=tuner;
3827 printk("%d",tuner);
3828 } else
3829 printk("Unknown type");
3830 printk(" radio:%s remote control:%s\n",
3831 tuner_tv_fm ? "yes" : "no",
3832 btv->has_remote ? "yes" : "no");
3833}
3834
3835/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3836void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3837{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003838 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003839 if(norm==VIDEO_MODE_NTSC) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003840 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3841 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003842 dprintk("bttv_tda9880_setnorm to NTSC\n");
3843 }
3844 else {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003845 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3846 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003847 dprintk("bttv_tda9880_setnorm to PAL\n");
3848 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003849 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003850 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003851 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003852}
3853
3854
3855/*
3856 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003857 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003858 *
3859 * Hauppauge: pin 5
3860 * Voodoo: pin 20
3861 */
3862static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3863{
3864 int mask = (1 << pin);
3865
3866 gpio_inout(mask,mask);
3867 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003868 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003869 gpio_bits(mask,mask);
3870
3871 if (bttv_gpio)
3872 bttv_gpio_tracking(btv,"msp34xx");
3873 if (bttv_verbose)
3874 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3875 "init [%d]\n", btv->c.nr, pin);
3876}
3877
3878static void __devinit boot_bt832(struct bttv *btv)
3879{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003880}
3881
3882/* ----------------------------------------------------------------------- */
3883/* Imagenation L-Model PXC200 Framegrabber */
3884/* This is basically the same procedure as
3885 * used by Alessandro Rubini in his pxc200
3886 * driver, but using BTTV functions */
3887
3888static void __devinit init_PXC200(struct bttv *btv)
3889{
3890 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3891 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3892 0x00 };
3893 unsigned int i;
3894 int tmp;
3895 u32 val;
3896
3897 /* Initialise GPIO-connevted stuff */
3898 gpio_inout(0xffffff, (1<<13));
3899 gpio_write(0);
3900 udelay(3);
3901 gpio_write(1<<13);
3902 /* GPIO inputs are pulled up, so no need to drive
3903 * reset pin any longer */
3904 gpio_bits(0xffffff, 0);
3905 if (bttv_gpio)
3906 bttv_gpio_tracking(btv,"pxc200");
3907
3908 /* we could/should try and reset/control the AD pots? but
3909 right now we simply turned off the crushing. Without
3910 this the AGC drifts drifts
3911 remember the EN is reverse logic -->
3912 setting BT848_ADC_AGC_EN disable the AGC
3913 tboult@eecs.lehigh.edu
3914 */
3915
3916 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3917
3918 /* Initialise MAX517 DAC */
3919 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3920 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3921
3922 /* Initialise 12C508 PIC */
3923 /* The I2CWrite and I2CRead commmands are actually to the
3924 * same chips - but the R/W bit is included in the address
3925 * argument so the numbers are different */
3926
3927
3928 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3929
3930 /* First of all, enable the clock line. This is used in the PXC200-F */
3931 val = btread(BT848_GPIO_DMA_CTL);
3932 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3933 btwrite(val, BT848_GPIO_DMA_CTL);
3934
3935 /* Then, push to 0 the reset pin long enough to reset the *
3936 * device same as above for the reset line, but not the same
3937 * value sent to the GPIO-connected stuff
3938 * which one is the good one? */
3939 gpio_inout(0xffffff,(1<<2));
3940 gpio_write(0);
3941 udelay(10);
3942 gpio_write(1<<2);
3943
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003944 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003945 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3946 if (tmp != -1) {
3947 printk(KERN_INFO
3948 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3949 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3950 }
3951 }
3952
3953 printk(KERN_INFO "PXC200 Initialised.\n");
3954}
3955
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003956
3957
Peter Skipworth93b43f12005-06-23 22:04:45 -07003958/* ----------------------------------------------------------------------- */
3959/*
3960 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3961 * it. This apparently involves the following procedure for each 878 chip:
3962 *
3963 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3964 *
3965 * 2) write to GPIO_DATA
3966 * - 0x0E
3967 * - sleep 1ms
3968 * - 0x10 + 0x0E
3969 * - sleep 10ms
3970 * - 0x0E
3971 * read from GPIO_DATA into buf (uint_32)
3972 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3973 * error. ERROR_CPLD_Check_Failed stop.
3974 *
3975 * 3) write to GPIO_DATA
3976 * - write 0x4400 + 0x0E
3977 * - sleep 10ms
3978 * - write 0x4410 + 0x0E
3979 * - sleep 1ms
3980 * - write 0x0E
3981 * read from GPIO_DATA into buf (uint_32)
Jean Delvarefef4fa142006-11-09 17:25:28 -03003982 * - if ( buf>>18 & 0x01 ) || ( buf>>19 & 0x01 != 0 )
Peter Skipworth93b43f12005-06-23 22:04:45 -07003983 * error. ERROR_CPLD_Check_Failed.
3984 */
3985/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08003986static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003987init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003988{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003989 uint32_t dataRead = 0;
3990 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003991
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003992 printk (KERN_INFO
3993 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003994 btv->c.nr);
3995
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003996 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003997
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003998 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3999 msleep (1);
4000 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4001 msleep (10);
4002 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004003
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004004 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004005
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004006 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4007 printk (KERN_INFO
4008 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4009 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004010 }
4011
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004012 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4013 msleep (10);
4014 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4015 msleep (1);
4016 btwrite (watchdog_value, BT848_GPIO_DATA);
4017 msleep (1);
4018 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004019
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004020 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4021 printk (KERN_INFO
4022 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4023 btv->c.nr, dataRead);
4024
Peter Skipworth93b43f12005-06-23 22:04:45 -07004025 return;
4026 }
4027
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004028 printk (KERN_INFO
4029 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004030}
Linus Torvalds1da177e2005-04-16 15:20:36 -07004031
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004032
4033
Linus Torvalds1da177e2005-04-16 15:20:36 -07004034/* ----------------------------------------------------------------------- */
4035/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4036/*
4037 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4038 * This code is placed under the terms of the GNU General Public License
4039 *
4040 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4041 */
4042
4043static void bus_low(struct bttv *btv, int bit)
4044{
4045 if (btv->mbox_ior) {
4046 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4047 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4048 udelay(5);
4049 }
4050
4051 gpio_bits(bit,0);
4052 udelay(5);
4053
4054 if (btv->mbox_ior) {
4055 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4056 udelay(5);
4057 }
4058}
4059
4060static void bus_high(struct bttv *btv, int bit)
4061{
4062 if (btv->mbox_ior) {
4063 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4064 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4065 udelay(5);
4066 }
4067
4068 gpio_bits(bit,bit);
4069 udelay(5);
4070
4071 if (btv->mbox_ior) {
4072 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4073 udelay(5);
4074 }
4075}
4076
4077static int bus_in(struct bttv *btv, int bit)
4078{
4079 if (btv->mbox_ior) {
4080 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4081 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4082 udelay(5);
4083
4084 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4085 udelay(5);
4086 }
4087 return gpio_read() & (bit);
4088}
4089
4090/* TEA5757 register bits */
4091#define TEA_FREQ 0:14
4092#define TEA_BUFFER 15:15
4093
4094#define TEA_SIGNAL_STRENGTH 16:17
4095
4096#define TEA_PORT1 18:18
4097#define TEA_PORT0 19:19
4098
4099#define TEA_BAND 20:21
4100#define TEA_BAND_FM 0
4101#define TEA_BAND_MW 1
4102#define TEA_BAND_LW 2
4103#define TEA_BAND_SW 3
4104
4105#define TEA_MONO 22:22
4106#define TEA_ALLOW_STEREO 0
4107#define TEA_FORCE_MONO 1
4108
4109#define TEA_SEARCH_DIRECTION 23:23
4110#define TEA_SEARCH_DOWN 0
4111#define TEA_SEARCH_UP 1
4112
4113#define TEA_STATUS 24:24
4114#define TEA_STATUS_TUNED 0
4115#define TEA_STATUS_SEARCHING 1
4116
4117/* Low-level stuff */
4118static int tea5757_read(struct bttv *btv)
4119{
4120 unsigned long timeout;
4121 int value = 0;
4122 int i;
4123
4124 /* better safe than sorry */
4125 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4126
4127 if (btv->mbox_ior) {
4128 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4129 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4130 udelay(5);
4131 }
4132
4133 if (bttv_gpio)
4134 bttv_gpio_tracking(btv,"tea5757 read");
4135
4136 bus_low(btv,btv->mbox_we);
4137 bus_low(btv,btv->mbox_clk);
4138
4139 udelay(10);
4140 timeout= jiffies + HZ;
4141
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004142 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004143 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4144 schedule();
4145 if (bus_in(btv,btv->mbox_data)) {
4146 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4147 return -1;
4148 }
4149
4150 dprintk("bttv%d: tea5757:",btv->c.nr);
4151 for(i = 0; i < 24; i++)
4152 {
4153 udelay(5);
4154 bus_high(btv,btv->mbox_clk);
4155 udelay(5);
4156 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4157 bus_low(btv,btv->mbox_clk);
4158 value <<= 1;
4159 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4160 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4161 }
4162 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4163 return value;
4164}
4165
4166static int tea5757_write(struct bttv *btv, int value)
4167{
4168 int i;
4169 int reg = value;
4170
4171 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4172
4173 if (btv->mbox_ior) {
4174 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4175 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4176 udelay(5);
4177 }
4178 if (bttv_gpio)
4179 bttv_gpio_tracking(btv,"tea5757 write");
4180
4181 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4182 bus_low(btv,btv->mbox_clk);
4183 bus_high(btv,btv->mbox_we);
4184 for(i = 0; i < 25; i++)
4185 {
4186 if (reg & 0x1000000)
4187 bus_high(btv,btv->mbox_data);
4188 else
4189 bus_low(btv,btv->mbox_data);
4190 reg <<= 1;
4191 bus_high(btv,btv->mbox_clk);
4192 udelay(10);
4193 bus_low(btv,btv->mbox_clk);
4194 udelay(10);
4195 }
4196 bus_low(btv,btv->mbox_we); /* unmute !!! */
4197 return 0;
4198}
4199
4200void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4201{
4202 dprintk("tea5757_set_freq %d\n",freq);
4203 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004204}
4205
4206
4207/* ----------------------------------------------------------------------- */
4208/* winview */
4209
Adrian Bunk943a4902005-12-01 00:51:35 -08004210static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004211{
4212 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4213 int bits_out, loops, vol, data;
4214
4215 if (!set) {
4216 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4217 v->flags |= VIDEO_AUDIO_VOLUME;
4218 return;
4219 }
4220
4221 /* 32 levels logarithmic */
4222 vol = 32 - ((v->volume>>11));
4223 /* units */
4224 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4225 /* tens */
4226 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4227 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4228 data = gpio_read();
4229 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4230 WINVIEW_PT2254_STROBE);
4231 for (loops = 17; loops >= 0 ; loops--) {
4232 if (bits_out & (1<<loops))
4233 data |= WINVIEW_PT2254_DATA;
4234 else
4235 data &= ~WINVIEW_PT2254_DATA;
4236 gpio_write(data);
4237 udelay(5);
4238 data |= WINVIEW_PT2254_CLK;
4239 gpio_write(data);
4240 udelay(5);
4241 data &= ~WINVIEW_PT2254_CLK;
4242 gpio_write(data);
4243 }
4244 data |= WINVIEW_PT2254_STROBE;
4245 data &= ~WINVIEW_PT2254_DATA;
4246 gpio_write(data);
4247 udelay(10);
4248 data &= ~WINVIEW_PT2254_STROBE;
4249 gpio_write(data);
4250}
4251
4252/* ----------------------------------------------------------------------- */
4253/* mono/stereo control for various cards (which don't use i2c chips but */
4254/* connect something to the GPIO pins */
4255
4256static void
4257gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4258{
4259 unsigned int con = 0;
4260
4261 if (set) {
4262 gpio_inout(0x300, 0x300);
4263 if (v->mode & VIDEO_SOUND_LANG1)
4264 con = 0x000;
4265 if (v->mode & VIDEO_SOUND_LANG2)
4266 con = 0x300;
4267 if (v->mode & VIDEO_SOUND_STEREO)
4268 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004269/* if (v->mode & VIDEO_SOUND_MONO)
4270 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004271 gpio_bits(0x300, con);
4272 } else {
4273 v->mode = VIDEO_SOUND_STEREO |
4274 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4275 }
4276}
4277
4278static void
4279gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4280{
4281 unsigned int val, con;
4282
Linus Torvalds1da177e2005-04-16 15:20:36 -07004283 if (btv->radio_user)
4284 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004285
4286 val = gpio_read();
4287 if (set) {
4288 con = 0x000;
4289 if (v->mode & VIDEO_SOUND_LANG2) {
4290 if (v->mode & VIDEO_SOUND_LANG1) {
4291 /* LANG1 + LANG2 */
4292 con = 0x100;
4293 }
4294 else {
4295 /* LANG2 */
4296 con = 0x300;
4297 }
4298 }
4299 if (con != (val & 0x300)) {
4300 gpio_bits(0x300, con);
4301 if (bttv_gpio)
4302 bttv_gpio_tracking(btv,"gvbctv5pci");
4303 }
4304 } else {
4305 switch (val & 0x70) {
4306 case 0x10:
4307 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4308 break;
4309 case 0x30:
4310 v->mode = VIDEO_SOUND_LANG2;
4311 break;
4312 case 0x50:
4313 v->mode = VIDEO_SOUND_LANG1;
4314 break;
4315 case 0x60:
4316 v->mode = VIDEO_SOUND_STEREO;
4317 break;
4318 case 0x70:
4319 v->mode = VIDEO_SOUND_MONO;
4320 break;
4321 default:
4322 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4323 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4324 }
4325 }
4326}
4327
4328/*
4329 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4330 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4331 * 0xdde enables mono and 0xccd enables sap
4332 *
4333 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4334 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4335 * input/output sound connection, so both must be set for output mode.
4336 *
4337 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4338 * handles this with a tda9840
4339 *
4340 */
4341static void
4342avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4343{
4344 int val = 0;
4345
4346 if (set) {
4347 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4348 val = 0x02;
4349 if (v->mode & VIDEO_SOUND_STEREO)
4350 val = 0x01;
4351 if (val) {
4352 gpio_bits(0x03,val);
4353 if (bttv_gpio)
4354 bttv_gpio_tracking(btv,"avermedia");
4355 }
4356 } else {
4357 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4358 VIDEO_SOUND_LANG1;
4359 return;
4360 }
4361}
4362
4363static void
4364avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4365{
4366 int val = 0;
4367
4368 if (set) {
4369 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4370 val = 0x01;
4371 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4372 val = 0x02;
4373 btaor(val, ~0x03, BT848_GPIO_DATA);
4374 if (bttv_gpio)
4375 bttv_gpio_tracking(btv,"avermedia");
4376 } else {
4377 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4378 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4379 return;
4380 }
4381}
4382
4383/* Lifetec 9415 handling */
4384static void
4385lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4386{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004387 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004388
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004389 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004390 v->mode = VIDEO_SOUND_MONO;
4391 return;
4392 }
4393
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004394 if (set) {
4395 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4396 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004397 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004398 val = 0x0880;
4399 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004400 (v->mode & VIDEO_SOUND_MONO))
4401 val = 0;
4402 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004403 if (bttv_gpio)
4404 bttv_gpio_tracking(btv,"lt9415");
4405 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004406 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004407 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004408 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004409 return;
4410 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004411}
4412
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004413/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004414static void
4415terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4416{
4417 unsigned int con = 0;
4418
4419 if (set) {
4420 gpio_inout(0x180000,0x180000);
4421 if (v->mode & VIDEO_SOUND_LANG2)
4422 con = 0x080000;
4423 if (v->mode & VIDEO_SOUND_STEREO)
4424 con = 0x180000;
4425 gpio_bits(0x180000, con);
4426 if (bttv_gpio)
4427 bttv_gpio_tracking(btv,"terratv");
4428 } else {
4429 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4430 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4431 }
4432}
4433
4434static void
4435winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4436{
4437 unsigned long val = 0;
4438
4439 if (set) {
4440 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4441 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4442 val = 0x420000;
4443 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4444 val = 0x420000;
4445 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4446 val = 0x410000;
4447 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4448 val = 0x020000;
4449 if (val) {
4450 gpio_bits(0x430000, val);
4451 if (bttv_gpio)
4452 bttv_gpio_tracking(btv,"winfast2000");
4453 }
4454 } else {
4455 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4456 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4457 }
4458}
4459
4460/*
4461 * Dariusz Kowalewski <darekk@automex.pl>
4462 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4463 * revision 9B has on-board TDA9874A sound decoder).
4464 *
4465 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4466 * will mute this cards.
4467 */
4468static void
4469pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4470{
4471 unsigned int val = 0;
4472
Linus Torvalds1da177e2005-04-16 15:20:36 -07004473 if (btv->radio_user)
4474 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004475
4476 if (set) {
4477 if (v->mode & VIDEO_SOUND_MONO) {
4478 val = 0x01;
4479 }
4480 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4481 || (v->mode & VIDEO_SOUND_STEREO)) {
4482 val = 0x02;
4483 }
4484 if (val) {
4485 gpio_bits(0x03,val);
4486 if (bttv_gpio)
4487 bttv_gpio_tracking(btv,"pvbt878p9b");
4488 }
4489 } else {
4490 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4491 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4492 }
4493}
4494
4495/*
4496 * Dariusz Kowalewski <darekk@automex.pl>
4497 * sound control for FlyVideo 2000S (with tda9874 decoder)
4498 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4499 */
4500static void
4501fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4502{
4503 unsigned int val = 0xffff;
4504
Linus Torvalds1da177e2005-04-16 15:20:36 -07004505 if (btv->radio_user)
4506 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004507 if (set) {
4508 if (v->mode & VIDEO_SOUND_MONO) {
4509 val = 0x0000;
4510 }
4511 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4512 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004513 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004514 }
4515 if (val != 0xffff) {
4516 gpio_bits(0x1800, val);
4517 if (bttv_gpio)
4518 bttv_gpio_tracking(btv,"fv2000s");
4519 }
4520 } else {
4521 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4522 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4523 }
4524}
4525
4526/*
4527 * sound control for Canopus WinDVR PCI
4528 * Masaki Suzuki <masaki@btree.org>
4529 */
4530static void
4531windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4532{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004533 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004534
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004535 if (set) {
4536 if (v->mode & VIDEO_SOUND_MONO)
4537 val = 0x040000;
4538 if (v->mode & VIDEO_SOUND_LANG1)
4539 val = 0;
4540 if (v->mode & VIDEO_SOUND_LANG2)
4541 val = 0x100000;
4542 if (v->mode & VIDEO_SOUND_STEREO)
4543 val = 0;
4544 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004545 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004546 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004547 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004548 }
4549 } else {
4550 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4551 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4552 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004553}
4554
4555/*
4556 * sound control for AD-TVK503
4557 * Hiroshi Takekawa <sian@big.or.jp>
4558 */
4559static void
4560adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4561{
4562 unsigned int con = 0xffffff;
4563
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004564 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004565
4566 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004567 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004568 if (v->mode & VIDEO_SOUND_LANG1)
4569 con = 0x00000000;
4570 if (v->mode & VIDEO_SOUND_LANG2)
4571 con = 0x00180000;
4572 if (v->mode & VIDEO_SOUND_STEREO)
4573 con = 0x00000000;
4574 if (v->mode & VIDEO_SOUND_MONO)
4575 con = 0x00060000;
4576 if (con != 0xffffff) {
4577 gpio_bits(0x1e0000,con);
4578 if (bttv_gpio)
4579 bttv_gpio_tracking(btv, "adtvk503");
4580 }
4581 } else {
4582 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4583 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4584 }
4585}
4586
4587/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4588 *
4589 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4590 * switch instead (CD22M3494E). This IC can have multiple active connections
4591 * between Xn (input) and Yn (output) pins. We need to clear any existing
4592 * connection prior to establish a new one, pulsing the STROBE pin.
4593 *
4594 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4595 * GPIO pins are wired as:
4596 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4597 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4598 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4599 * GPIO[8] - - P3[5] (microcontroler)
4600 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4601 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4602 * GPINTR - - P3[4] (microcontroler)
4603 *
4604 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4605 * configuration either directly (as we are doing) or using the microcontroler
4606 * which is also wired to I2C interface. I have no further info on the
4607 * microcontroler features, one would need to disassembly the firmware.
4608 * note: the vendor refused to give any information on this product, all
4609 * that stuff was found using a multimeter! :)
4610 */
4611static void rv605_muxsel(struct bttv *btv, unsigned int input)
4612{
4613 /* reset all conections */
4614 gpio_bits(0x200,0x200);
4615 mdelay(1);
4616 gpio_bits(0x200,0x000);
4617 mdelay(1);
4618
4619 /* create a new conection */
4620 gpio_bits(0x480,0x080);
4621 gpio_bits(0x480,0x480);
4622 mdelay(1);
4623 gpio_bits(0x480,0x080);
4624 mdelay(1);
4625}
4626
4627/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4628 *
4629 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4630 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4631 * chips, ten eight input analog multiplexors, a not chip and a few
4632 * other components.
4633 *
4634 * 16 inputs on a secondary bracket are provided and can be selected
4635 * from each of the four capture chips. Two of the eight input
4636 * multiplexors are used to select from any of the 16 input signals.
4637 *
4638 * Unsupported hardware capabilities:
4639 * . A video output monitor on the secondary bracket can be selected from
4640 * one of the 878A chips.
4641 * . Another passthrough but I haven't spent any time investigating it.
4642 * . Digital I/O (logic level connected to GPIO) is available from an
4643 * onboard header.
4644 *
4645 * The on chip input mux should always be set to 2.
4646 * GPIO[16:19] - Video input selection
4647 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4648 * GPIO[?:?] - Digital I/O.
4649 *
4650 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4651 * determined what function (if any) it provides. With the microcontroller
4652 * and sync seperator chips a guess is that it might have to do with video
4653 * switching and maybe some digital I/O.
4654 */
4655static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4656{
4657 /* video mux */
4658 gpio_bits(0x0f0000, input << 16);
4659}
4660
4661static void tibetCS16_init(struct bttv *btv)
4662{
4663 /* enable gpio bits, mask obtained via btSpy */
4664 gpio_inout(0xffffff, 0x0f7fff);
4665 gpio_write(0x0f7fff);
4666}
4667
4668/*
4669 * The following routines for the Kodicom-4400r get a little mind-twisting.
4670 * There is a "master" controller and three "slave" controllers, together
4671 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4672 * The analog switch is controlled by the "master", but the detection order
4673 * of the four BT878A chips is in an order which I just don't understand.
4674 * The "master" is actually the second controller to be detected. The
4675 * logic on the board uses logical numbers for the 4 controlers, but
4676 * those numbers are different from the detection sequence. When working
4677 * with the analog switch, we need to "map" from the detection sequence
4678 * over to the board's logical controller number. This mapping sequence
4679 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4680 * unit 3, the second (which is the master) is logical unit 0, etc.
4681 * We need to maintain the status of the analog switch (which of the 16
4682 * cameras is connected to which of the 4 controllers). Rather than
4683 * add to the bttv structure for this, we use the data reserved for
4684 * the mbox (unused for this card type).
4685 */
4686
4687/*
4688 * First a routine to set the analog switch, which controls which camera
4689 * is routed to which controller. The switch comprises an X-address
4690 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4691 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4692 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4693 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4694 * specified address. The idea is to set the address and data, then bring
4695 * STROBE high, and finally bring STROBE back to low.
4696 */
4697static void kodicom4400r_write(struct bttv *btv,
4698 unsigned char xaddr,
4699 unsigned char yaddr,
4700 unsigned char data) {
4701 unsigned int udata;
4702
4703 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4704 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4705 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4706 gpio_bits(0x1ff, udata); /* strobe low */
4707}
4708
4709/*
4710 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4711 * use this routine. The routine finds the "master" for the card, maps
4712 * the controller number from the detected position over to the logical
4713 * number, writes the appropriate data to the analog switch, and housekeeps
4714 * the local copy of the switch information. The parameter 'input' is the
4715 * requested camera number (0 - 15).
4716 */
4717static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4718{
4719 char *sw_status;
4720 int xaddr, yaddr;
4721 struct bttv *mctlr;
4722 static unsigned char map[4] = {3, 0, 2, 1};
4723
4724 mctlr = master[btv->c.nr];
4725 if (mctlr == NULL) { /* ignore if master not yet detected */
4726 return;
4727 }
4728 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4729 yaddr = map[yaddr];
4730 sw_status = (char *)(&mctlr->mbox_we);
4731 xaddr = input & 0xf;
4732 /* Check if the controller/camera pair has changed, else ignore */
4733 if (sw_status[yaddr] != xaddr)
4734 {
4735 /* "open" the old switch, "close" the new one, save the new */
4736 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4737 sw_status[yaddr] = xaddr;
4738 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4739 }
4740}
4741
4742/*
4743 * During initialisation, we need to reset the analog switch. We
4744 * also preset the switch to map the 4 connectors on the card to the
4745 * *user's* (see above description of kodicom4400r_muxsel) channels
4746 * 0 through 3
4747 */
4748static void kodicom4400r_init(struct bttv *btv)
4749{
4750 char *sw_status = (char *)(&btv->mbox_we);
4751 int ix;
4752
4753 gpio_inout(0x0003ff, 0x0003ff);
4754 gpio_write(1 << 9); /* reset MUX */
4755 gpio_write(0);
4756 /* Preset camera 0 to the 4 controllers */
4757 for (ix=0; ix<4; ix++) {
4758 sw_status[ix] = ix;
4759 kodicom4400r_write(btv, ix, ix, 1);
4760 }
4761 /*
4762 * Since this is the "master", we need to set up the
4763 * other three controller chips' pointers to this structure
4764 * for later use in the muxsel routine.
4765 */
4766 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4767 return;
4768 master[btv->c.nr-1] = btv;
4769 master[btv->c.nr] = btv;
4770 master[btv->c.nr+1] = btv;
4771 master[btv->c.nr+2] = btv;
4772}
4773
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004774/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4775 * video multiplexers to provide up to 16 video inputs. These
4776 * multiplexers are controlled by the lower 8 GPIO pins of the
4777 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004778
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004779 * xxx0 is pin xxx of multiplexer U5,
4780 * yyy1 is pin yyy of multiplexer U2
4781 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004782#define ENA0 0x01
4783#define ENB0 0x02
4784#define ENA1 0x04
4785#define ENB1 0x08
4786
4787#define IN10 0x10
4788#define IN00 0x20
4789#define IN11 0x40
4790#define IN01 0x80
4791
4792static void xguard_muxsel(struct bttv *btv, unsigned int input)
4793{
4794 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004795 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4796 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4797 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4798 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004799 };
4800 gpio_write(masks[input%16]);
4801}
4802static void picolo_tetra_init(struct bttv *btv)
4803{
4804 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4805 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4806 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4807}
4808static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4809{
4810
4811 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4812 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4813 /*GPIO[20]&GPIO[21] used to choose the right input*/
4814 btwrite (input<<20,BT848_GPIO_DATA);
4815
4816}
4817
4818/*
4819 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4820 *
4821 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4822 * swichers to provide 16 channels to MUX0. The TDA8540's have
Andreas Mohrd6e05ed2006-06-26 18:35:02 +02004823 * 4 independent outputs and as such the IVC120G also has the
Linus Torvalds1da177e2005-04-16 15:20:36 -07004824 * optional "Monitor Out" bus. This allows the card to be looking
4825 * at one input while the monitor is looking at another.
4826 *
4827 * Since I've couldn't be bothered figuring out how to add an
4828 * independant muxsel for the monitor bus, I've just set it to
4829 * whatever the card is looking at.
4830 *
4831 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4832 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4833 *
4834 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4835 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4836 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4837 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4838 *
4839 */
4840
4841/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4842#define I2C_TDA8540 0x90
4843#define I2C_TDA8540_ALT1 0x92
4844#define I2C_TDA8540_ALT2 0x94
4845#define I2C_TDA8540_ALT3 0x96
4846#define I2C_TDA8540_ALT4 0x98
4847#define I2C_TDA8540_ALT5 0x9a
4848#define I2C_TDA8540_ALT6 0x9c
4849
4850static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4851{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004852 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004853 int key = input % 4;
4854 int matrix = input / 4;
4855
4856 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4857 btv->c.nr, input, matrix, key);
4858
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004859 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004860 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4861 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4862 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4863 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4864 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4865 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4866 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4867 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4868
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004869 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004870 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004871 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004872 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004873 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004874 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004875 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004876 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004877 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004878
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004879 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004880 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4881}
4882
4883
4884/* PXC200 muxsel helper
4885 * luke@syseng.anu.edu.au
4886 * another transplant
4887 * from Alessandro Rubini (rubini@linux.it)
4888 *
4889 * There are 4 kinds of cards:
4890 * PXC200L which is bt848
4891 * PXC200F which is bt848 with PIC controlling mux
4892 * PXC200AL which is bt878
4893 * PXC200AF which is bt878 with PIC controlling mux
4894 */
4895#define PX_CFG_PXC200F 0x01
4896#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4897#define PX_I2C_PIC 0x0f
4898#define PX_PXC200A_CARDID 0x200a1295
4899#define PX_I2C_CMD_CFG 0x00
4900
4901static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4902{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004903 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004904 long mux;
4905 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004906 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004907
4908 /* Read PIC config to determine if this is a PXC200F */
4909 /* PX_I2C_CMD_CFG*/
4910 buf[0]=0;
4911 buf[1]=0;
4912 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4913 if (rc) {
4914 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4915 /* not PXC ? do nothing */
4916 return;
4917 }
4918
4919 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4920 if (!(rc & PX_CFG_PXC200F)) {
4921 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4922 return;
4923 }
4924
4925
4926 /* The multiplexer in the 200F is handled by the GPIO port */
4927 /* get correct mapping between inputs */
4928 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4929 /* ** not needed!? */
4930 mux = input;
4931
4932 /* make sure output pins are enabled */
4933 /* bitmask=0x30f; */
4934 bitmask=0x302;
4935 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004936 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004937 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4938 bitmask |= 7<<4; /* the DAC */
4939 }
4940 btwrite(bitmask, BT848_GPIO_OUT_EN);
4941
4942 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004943 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004944 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4945 else /* older device */
4946 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4947 btwrite(bitmask,BT848_GPIO_DATA);
4948
4949 /*
4950 * Was "to be safe, set the bt848 to input 0"
4951 * Actually, since it's ok at load time, better not messing
4952 * with these bits (on PXC200AF you need to set mux 2 here)
4953 *
4954 * needed because bttv-driver sets mux before calling this function
4955 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004956 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004957 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4958 else /* older device */
4959 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4960
4961 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4962}
4963
4964/* ----------------------------------------------------------------------- */
4965/* motherboard chipset specific stuff */
4966
4967void __devinit bttv_check_chipset(void)
4968{
4969 int pcipci_fail = 0;
4970 struct pci_dev *dev = NULL;
4971
Alan Cox3d265c92006-09-14 11:53:16 -03004972 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL)) /* should check if target is AGP */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004973 pcipci_fail = 1;
4974 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4975 triton1 = 1;
4976 if (pci_pci_problems & PCIPCI_VSFX)
4977 vsfx = 1;
4978#ifdef PCIPCI_ALIMAGIK
4979 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4980 latency = 0x0A;
4981#endif
4982
Linus Torvalds1da177e2005-04-16 15:20:36 -07004983
4984 /* print warnings about any quirks found */
4985 if (triton1)
4986 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4987 if (vsfx)
4988 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4989 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004990 printk(KERN_INFO "bttv: bttv and your chipset may not work "
4991 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004992 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004993 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004994 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004995 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03004996 printk(KERN_INFO "bttv: overlay forced. Use this "
4997 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004998 }
4999 }
5000 if (UNSET != latency)
5001 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08005002 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005003 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005004 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005005 pci_read_config_byte(dev, 0x53, &b);
5006 if (bttv_debug)
5007 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5008 "bufcon=0x%02x\n",b);
5009 }
5010}
5011
5012int __devinit bttv_handle_chipset(struct bttv *btv)
5013{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005014 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005015
5016 if (!triton1 && !vsfx && UNSET == latency)
5017 return 0;
5018
5019 if (bttv_verbose) {
5020 if (triton1)
5021 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5022 if (vsfx && btv->id >= 878)
5023 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5024 if (UNSET != latency)
5025 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5026 btv->c.nr,latency);
5027 }
5028
5029 if (btv->id < 878) {
5030 /* bt848 (mis)uses a bit in the irq mask for etbf */
5031 if (triton1)
5032 btv->triton1 = BT848_INT_ETBF;
5033 } else {
5034 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005035 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005036 if (triton1)
5037 command |= BT878_EN_TBFX;
5038 if (vsfx)
5039 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005040 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5041 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005042 if (UNSET != latency)
5043 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5044 return 0;
5045}
5046
5047
5048/*
5049 * Local variables:
5050 * c-basic-offset: 8
5051 * End:
5052 */