blob: e68a6d2fff2439a94aa8f2b49e393f0916b0724c [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
28#include <linux/config.h>
29#include <linux/delay.h>
30#include <linux/module.h>
31#include <linux/moduleparam.h>
32#include <linux/kmod.h>
33#include <linux/init.h>
34#include <linux/pci.h>
35#include <linux/vmalloc.h>
36#include <linux/firmware.h>
37
38#include <asm/io.h>
39
40#include "bttvp.h"
Michael Krufky5e453dc2006-01-09 15:32:31 -020041#include <media/v4l2-common.h>
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -030042#include <media/tvaudio.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070043
44/* fwd decl */
45static void boot_msp34xx(struct bttv *btv, int pin);
46static void boot_bt832(struct bttv *btv);
47static void hauppauge_eeprom(struct bttv *btv);
48static void avermedia_eeprom(struct bttv *btv);
49static void osprey_eeprom(struct bttv *btv);
50static void modtec_eeprom(struct bttv *btv);
51static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070052static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
54static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
55static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
56static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
57 int set);
58static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
59 int set);
60static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
61static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
62static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
63static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
64static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
65static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
66static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
67static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
68static void rv605_muxsel(struct bttv *btv, unsigned int input);
69static void eagle_muxsel(struct bttv *btv, unsigned int input);
70static void xguard_muxsel(struct bttv *btv, unsigned int input);
71static void ivc120_muxsel(struct bttv *btv, unsigned int input);
72static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
73
74static void PXC200_muxsel(struct bttv *btv, unsigned int input);
75
76static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
77static void picolo_tetra_init(struct bttv *btv);
78
79static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
80static void tibetCS16_init(struct bttv *btv);
81
82static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
83static void kodicom4400r_init(struct bttv *btv);
84
85static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
86static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
87
88static int terratec_active_radio_upgrade(struct bttv *btv);
89static int tea5757_read(struct bttv *btv);
90static int tea5757_write(struct bttv *btv, int value);
91static void identify_by_eeprom(struct bttv *btv,
92 unsigned char eeprom_data[256]);
93static int __devinit pvr_boot(struct bttv *btv);
94
95/* config variables */
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -020096static unsigned int triton1;
97static unsigned int vsfx;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070099int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100
101static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
105static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
106static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
107#ifdef MODULE
108static unsigned int autoload = 1;
109#else
Mauro Carvalho Chehaba5ed4252006-01-13 14:10:19 -0200110static unsigned int autoload;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111#endif
112static unsigned int gpiomask = UNSET;
113static unsigned int audioall = UNSET;
114static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
115
116/* insmod options */
117module_param(triton1, int, 0444);
118module_param(vsfx, int, 0444);
119module_param(no_overlay, int, 0444);
120module_param(latency, int, 0444);
121module_param(gpiomask, int, 0444);
122module_param(audioall, int, 0444);
123module_param(autoload, int, 0444);
124
125module_param_array(card, int, NULL, 0444);
126module_param_array(pll, int, NULL, 0444);
127module_param_array(tuner, int, NULL, 0444);
128module_param_array(svhs, int, NULL, 0444);
129module_param_array(remote, int, NULL, 0444);
130module_param_array(audiomux, int, NULL, 0444);
131
132MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
133 "[enable bug compatibility for triton1 + others]");
134MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
135 "[yet another chipset flaw workaround]");
136MODULE_PARM_DESC(latency,"pci latency timer");
137MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
138MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
139MODULE_PARM_DESC(tuner,"specify installed tuner type");
140MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -0300141MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
142 " [some VIA/SIS chipsets are known to have problem with overlay]");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143
144/* ----------------------------------------------------------------------- */
145/* list of card IDs for bt878+ cards */
146
147static struct CARD {
148 unsigned id;
149 int cardnr;
150 char *name;
151} cards[] __devinitdata = {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800152 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
153 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
154 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
155 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
156 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
157 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
158 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
159 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
Kenth Anderssonf718e6e2005-11-08 21:37:02 -0800160 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800162 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
163 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800165 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
166 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
167 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
168 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800170 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800171 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
172 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800173 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800175 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700176 /* some cards ship with byteswapped IDs ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800177 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700179 /* this seems to happen as well ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800180 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800182 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
183 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
184 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800186 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
187 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
188 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
189 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
190 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
191 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
192 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800194 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
196 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
197 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
198 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800200 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
201 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
202 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
203 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800205 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
206 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700207 /* clashes with FlyVideo
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800208 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
209 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
210 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
211 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
212 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800214 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800220 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
221 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
222 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
223 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
224 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800226 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
227 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
228 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
229 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800231 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
232 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
233 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
234 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800236 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
237 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800262 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
263 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800265 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
266 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
267 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
268 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
269 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
270 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271
Trent Piepho657de3c2006-06-20 00:30:57 -0300272 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800273 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800275 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
276 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
277 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
278 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
279 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
280 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800281 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
282 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800283 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800285 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
286 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800288 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
289 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
290 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
291 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800293 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700295 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800296 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700297
Steven Tothcd1257d2006-01-09 15:25:01 -0200298 /* Duplicate PCI ID, reconfigure for this board during the eeprom read.
299 * { 0x13eb0070, BTTV_BOARD_HAUPPAUGE_IMPACTVCB, "Hauppauge ImpactVCB" }, */
300
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700301 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800302 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
Michael Krufky2af35572006-01-23 17:11:06 -0200303 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
304 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800305 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
306 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
307 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
308 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
Michael Krufky2af35572006-01-23 17:11:06 -0200309 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800310 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
311 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Cameron Hutchinson442d15d2006-06-21 18:45:31 -0300312 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313
314 { 0, -1, NULL }
315};
316
317/* ----------------------------------------------------------------------- */
318/* array with description for bt848 / bt878 tv/grabber cards */
319
320struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800321 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800322 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800323 .name = " *** UNKNOWN/GENERIC *** ",
324 .video_inputs = 4,
325 .audio_inputs = 1,
326 .tuner = 0,
327 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200328 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800329 .tuner_type = -1,
330 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800331 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800332 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800333 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800334 .name = "MIRO PCTV",
335 .video_inputs = 4,
336 .audio_inputs = 1,
337 .tuner = 0,
338 .svhs = 2,
339 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200340 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300341 .gpiomux = { 2, 0, 0, 0 },
342 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800343 .needs_tvaudio = 1,
344 .tuner_type = -1,
345 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800346 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800347 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800348 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800349 .name = "Hauppauge (bt848)",
350 .video_inputs = 4,
351 .audio_inputs = 1,
352 .tuner = 0,
353 .svhs = 2,
354 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200355 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300356 .gpiomux = { 0, 1, 2, 3 },
357 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800358 .needs_tvaudio = 1,
359 .tuner_type = -1,
360 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800361 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800362 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800363 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800364 .name = "STB, Gateway P/N 6000699 (bt848)",
365 .video_inputs = 3,
366 .audio_inputs = 1,
367 .tuner = 0,
368 .svhs = 2,
369 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200370 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300371 .gpiomux = { 4, 0, 2, 3 },
372 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800373 .no_msp34xx = 1,
374 .needs_tvaudio = 1,
375 .tuner_type = TUNER_PHILIPS_NTSC,
376 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800377 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800378 .pll = PLL_28,
379 .has_radio = 1,
380 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800382 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800383 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800384 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
385 .video_inputs = 4,
386 .audio_inputs = 0,
387 .tuner = -1,
388 .svhs = 2,
389 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200390 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300391 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800392 .needs_tvaudio = 0,
393 .tuner_type = 4,
394 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800395 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800396 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800397 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800398 .name = "Diamond DTV2000",
399 .video_inputs = 4,
400 .audio_inputs = 1,
401 .tuner = 0,
402 .svhs = 2,
403 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200404 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300405 .gpiomux = { 0, 1, 0, 1 },
406 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800407 .needs_tvaudio = 1,
408 .tuner_type = -1,
409 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800410 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800411 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800412 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800413 .name = "AVerMedia TVPhone",
414 .video_inputs = 3,
415 .audio_inputs = 1,
416 .tuner = 0,
417 .svhs = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200418 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800419 .gpiomask = 0x0f,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300420 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800421 /* 0x04 for some cards ?? */
422 .needs_tvaudio = 1,
423 .tuner_type = -1,
424 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800425 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800426 .audio_hook = avermedia_tvphone_audio,
427 .has_remote = 1,
428 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800429 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800430 .name = "MATRIX-Vision MV-Delta",
431 .video_inputs = 5,
432 .audio_inputs = 1,
433 .tuner = -1,
434 .svhs = 3,
435 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200436 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300437 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800438 .needs_tvaudio = 1,
439 .tuner_type = -1,
440 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800441 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800442 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800444 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800445 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800446 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
447 .video_inputs = 4,
448 .audio_inputs = 1,
449 .tuner = 0,
450 .svhs = 2,
451 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200452 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300453 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
454 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800455 .needs_tvaudio = 1,
456 .pll = PLL_28,
457 .tuner_type = -1,
458 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800459 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800460 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800461 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800462 .name = "IMS/IXmicro TurboTV",
463 .video_inputs = 3,
464 .audio_inputs = 1,
465 .tuner = 0,
466 .svhs = 2,
467 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -0200468 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300469 .gpiomux = { 1, 1, 2, 3 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800470 .needs_tvaudio = 0,
471 .pll = PLL_28,
472 .tuner_type = TUNER_TEMIC_PAL,
473 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800474 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800475 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800476 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800477 .name = "Hauppauge (bt878)",
478 .video_inputs = 4,
479 .audio_inputs = 1,
480 .tuner = 0,
481 .svhs = 2,
482 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -0200483 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300484 .gpiomux = { 0, 1, 2, 3 },
485 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800486 .needs_tvaudio = 1,
487 .pll = PLL_28,
488 .tuner_type = -1,
489 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800490 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800491 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800492 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800493 .name = "MIRO PCTV pro",
494 .video_inputs = 3,
495 .audio_inputs = 1,
496 .tuner = 0,
497 .svhs = 2,
498 .gpiomask = 0x3014f,
Michael Krufkybc286362006-01-11 19:40:17 -0200499 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300500 .gpiomux = { 0x20001,0x10001, 0, 0 },
501 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800502 .needs_tvaudio = 1,
503 .tuner_type = -1,
504 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800505 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800506 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800508 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800509 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800510 .name = "ADS Technologies Channel Surfer TV (bt848)",
511 .video_inputs = 3,
512 .audio_inputs = 1,
513 .tuner = 0,
514 .svhs = 2,
515 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200516 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300517 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800518 .needs_tvaudio = 1,
519 .tuner_type = -1,
520 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800521 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800522 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800523 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800524 .name = "AVerMedia TVCapture 98",
525 .video_inputs = 3,
526 .audio_inputs = 4,
527 .tuner = 0,
528 .svhs = 2,
529 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200530 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300531 .gpiomux = { 13, 14, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800532 .needs_tvaudio = 1,
533 .msp34xx_alt = 1,
534 .pll = PLL_28,
535 .tuner_type = TUNER_PHILIPS_PAL,
536 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800537 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800538 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800539 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800540 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800541 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800542 .name = "Aimslab Video Highway Xtreme (VHX)",
543 .video_inputs = 3,
544 .audio_inputs = 1,
545 .tuner = 0,
546 .svhs = 2,
547 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200548 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300549 .gpiomux = { 0, 2, 1, 3 }, /* old: {0, 1, 2, 3, 4} */
550 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800551 .needs_tvaudio = 1,
552 .pll = PLL_28,
553 .tuner_type = -1,
554 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800555 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800556 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800557 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800558 .name = "Zoltrix TV-Max",
559 .video_inputs = 3,
560 .audio_inputs = 1,
561 .tuner = 0,
562 .svhs = 2,
563 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -0200564 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300565 .gpiomux = { 0, 0, 1, 0 },
566 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800567 .needs_tvaudio = 1,
568 .tuner_type = -1,
569 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800570 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800571 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700572
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800573 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800574 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800575 .name = "Prolink Pixelview PlayTV (bt878)",
576 .video_inputs = 3,
577 .audio_inputs = 1,
578 .tuner = 0,
579 .svhs = 2,
580 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200581 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800582 #if 0
583 /* old */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300584 .gpiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800585 #else
586 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300587 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
588 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800589 #endif
590 .needs_tvaudio = 1,
591 .pll = PLL_28,
592 .tuner_type = -1,
593 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800594 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800595 .name = "Leadtek WinView 601",
596 .video_inputs = 3,
597 .audio_inputs = 1,
598 .tuner = 0,
599 .svhs = 2,
600 .gpiomask = 0x8300f8,
Michael Krufkybc286362006-01-11 19:40:17 -0200601 .muxsel = { 2, 3, 1, 1,0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300602 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
603 .gpiomute = 0xcfa007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800604 .needs_tvaudio = 1,
605 .tuner_type = -1,
606 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800607 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800608 .audio_hook = winview_audio,
609 .has_radio = 1,
610 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800611 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800612 .name = "AVEC Intercapture",
613 .video_inputs = 3,
614 .audio_inputs = 2,
615 .tuner = 0,
616 .svhs = 2,
617 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200618 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300619 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800620 .needs_tvaudio = 1,
621 .tuner_type = -1,
622 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800623 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800624 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800625 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800626 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
627 .video_inputs = 4,
628 .audio_inputs = 1,
629 .tuner = -1,
630 .svhs = -1,
631 .gpiomask = 0x8dff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200632 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300633 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800634 .no_msp34xx = 1,
635 .tuner_type = -1,
636 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800637 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800638 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700639
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800640 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800641 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800642 .name = "CEI Raffles Card",
643 .video_inputs = 3,
644 .audio_inputs = 3,
645 .tuner = 0,
646 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200647 .muxsel = { 2, 3, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800648 .tuner_type = -1,
649 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800650 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800651 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800652 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800653 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
654 .video_inputs = 4,
655 .audio_inputs = 2, /* tuner, line in */
656 .tuner = 0,
657 .svhs = 2,
658 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200659 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300660 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
661 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800662 .pll = PLL_28,
663 .tuner_type = TUNER_PHILIPS_PAL_I,
664 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800665 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800666 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800667 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800668 .name = "Askey CPH050/ Phoebe Tv Master + FM",
669 .video_inputs = 3,
670 .audio_inputs = 1,
671 .tuner = 0,
672 .svhs = 2,
673 .gpiomask = 0xc00,
Michael Krufkybc286362006-01-11 19:40:17 -0200674 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300675 .gpiomux = { 0, 1, 0x800, 0x400 },
676 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800677 .needs_tvaudio = 1,
678 .pll = PLL_28,
679 .tuner_type = -1,
680 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800681 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800682 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800683 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800684 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
685 .video_inputs = 3,
686 .audio_inputs = 1,
687 .tuner = 0,
688 .svhs = -1,
689 .gpiomask = 7,
690 .muxsel = { 2, 3, -1 },
691 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300692 .gpiomux = { 0, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800693 .no_msp34xx = 1,
694 .pll = PLL_28,
695 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
696 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800697 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800698 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800700 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800701 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800702 .name = "Askey CPH05X/06X (bt878) [many vendors]",
703 .video_inputs = 3,
704 .audio_inputs = 1,
705 .tuner = 0,
706 .svhs = 2,
707 .gpiomask = 0xe00,
Michael Krufkybc286362006-01-11 19:40:17 -0200708 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300709 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
710 .gpiomute = 0xc00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800711 .needs_tvaudio = 1,
712 .pll = PLL_28,
713 .tuner_type = -1,
714 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800715 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800716 .has_remote = 1,
717 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800718 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800719 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
720 .video_inputs = 3,
721 .audio_inputs = 1,
722 .tuner = 0,
723 .svhs = 2,
724 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200725 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300726 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
727 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800728 .needs_tvaudio = 0,
729 .tuner_type = TUNER_PHILIPS_PAL,
730 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800731 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800732 .audio_hook = terratv_audio,
733 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800734 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800735 .name = "Hauppauge WinCam newer (bt878)",
736 .video_inputs = 4,
737 .audio_inputs = 1,
738 .tuner = 0,
739 .svhs = 3,
740 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -0200741 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300742 .gpiomux = { 0, 1, 2, 3 },
743 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800744 .needs_tvaudio = 1,
745 .tuner_type = -1,
746 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800747 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800748 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800749 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800750 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
751 .video_inputs = 4,
752 .audio_inputs = 2,
753 .tuner = 0,
754 .svhs = 2,
755 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200756 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300757 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
758 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800759 .pll = PLL_28,
760 .tuner_type = TUNER_PHILIPS_SECAM,
761 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800762 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800763 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800765 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800766 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800767 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
768 .video_inputs = 3,
769 .audio_inputs = 1,
770 .tuner = 0,
771 .svhs = 2,
772 .gpiomask = 0x1f0fff,
Michael Krufkybc286362006-01-11 19:40:17 -0200773 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300774 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
775 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800776 .needs_tvaudio = 0,
777 .tuner_type = TUNER_PHILIPS_PAL,
778 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800779 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800780 .audio_hook = terratv_audio,
781 /* GPIO wiring:
782 External 20 pin connector (for Active Radio Upgrade board)
783 gpio00: i2c-sda
784 gpio01: i2c-scl
785 gpio02: om5610-data
786 gpio03: om5610-clk
787 gpio04: om5610-wre
788 gpio05: om5610-stereo
789 gpio06: rds6588-davn
790 gpio07: Pin 7 n.c.
791 gpio08: nIOW
792 gpio09+10: nIOR, nSEL ?? (bt878)
793 gpio09: nIOR (bt848)
794 gpio10: nSEL (bt848)
795 Sound Routing:
796 gpio16: u2-A0 (1st 4052bt)
797 gpio17: u2-A1
798 gpio18: u2-nEN
799 gpio19: u4-A0 (2nd 4052)
800 gpio20: u4-A1
801 u4-nEN - GND
802 Btspy:
803 00000 : Cdrom (internal audio input)
804 10000 : ext. Video audio input
805 20000 : TV Mono
806 a0000 : TV Mono/2
807 1a0000 : TV Stereo
808 30000 : Radio
809 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700810 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800812 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800813 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800814 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
815 .name = "Imagenation PXC200",
816 .video_inputs = 5,
817 .audio_inputs = 1,
818 .tuner = -1,
819 .svhs = 1, /* was: 4 */
820 .gpiomask = 0,
821 .muxsel = { 2, 3, 1, 0, 0},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300822 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800823 .needs_tvaudio = 1,
824 .tuner_type = -1,
825 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800826 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800827 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800829 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800830 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800831 .name = "Lifeview FlyVideo 98 LR50",
832 .video_inputs = 4,
833 .audio_inputs = 1,
834 .tuner = 0,
835 .svhs = 2,
836 .gpiomask = 0x1800, /* 0x8dfe00 */
Michael Krufkybc286362006-01-11 19:40:17 -0200837 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300838 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
839 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800840 .pll = PLL_28,
841 .tuner_type = -1,
842 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800843 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800844 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800845 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800846 .name = "Formac iProTV, Formac ProTV I (bt848)",
847 .video_inputs = 4,
848 .audio_inputs = 1,
849 .tuner = 0,
850 .svhs = 3,
851 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -0200852 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300853 .gpiomux = { 1, 0, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800854 .pll = PLL_28,
855 .tuner_type = TUNER_PHILIPS_PAL,
856 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800857 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800858 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700859
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800860 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800861 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800862 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
863 .video_inputs = 4,
864 .audio_inputs = 0,
865 .tuner = -1,
866 .svhs = 2,
867 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -0200868 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300869 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800870 .needs_tvaudio = 0,
871 .tuner_type = 4,
872 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800873 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800874 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800875 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800876 .name = "Terratec TerraTValue Version Bt878",
877 .video_inputs = 3,
878 .audio_inputs = 1,
879 .tuner = 0,
880 .svhs = 2,
881 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -0200882 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300883 .gpiomux = { 0x500, 0, 0x300, 0x900 },
884 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800885 .needs_tvaudio = 1,
886 .pll = PLL_28,
887 .tuner_type = TUNER_PHILIPS_PAL,
888 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800889 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800890 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800891 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800892 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
893 .video_inputs = 4,
894 .audio_inputs = 1,
895 .tuner = 0,
896 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -0200897 .muxsel = { 2, 3, 1, 1, 0 }, /* TV, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800898 #if 0
899 .gpiomask = 0xc33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300900 .gpiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800901 #else
902 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
903 .gpiomask = 0xb33000,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300904 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
905 .gpiomute = 0x800000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800906 #endif
907 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
908 gpio23 -- hef4052:nEnable (0x800000)
909 gpio12 -- hef4052:A1
910 gpio13 -- hef4052:A0
911 0x0000: external audio
912 0x1000: FM
913 0x2000: TV
914 0x3000: n.c.
915 Note: There exists another variant "Winfast 2000" with tv stereo !?
916 Note: eeprom only contains FF and pci subsystem id 107d:6606
917 */
918 .needs_tvaudio = 0,
919 .pll = PLL_28,
920 .has_radio = 1,
921 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
922 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800923 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800924 .audio_hook = winfast2000_audio,
925 .has_remote = 1,
926 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800927 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800928 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
929 .video_inputs = 4,
930 .audio_inputs = 3,
931 .tuner = 0,
932 .svhs = 2,
933 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200934 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300935 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
936 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800937 .pll = PLL_28,
938 .tuner_type = -1,
939 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800940 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800941 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700942
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800943 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800944 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800945 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
946 .video_inputs = 4,
947 .audio_inputs = 3,
948 .tuner = 0,
949 .svhs = 2,
950 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -0200951 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300952 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
953 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800954 .pll = PLL_28,
955 .tuner_type = -1,
956 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800957 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800958 .has_radio = 1,
959 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800960 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800961 .name = "Prolink PixelView PlayTV pro",
962 .video_inputs = 3,
963 .audio_inputs = 1,
964 .tuner = 0,
965 .svhs = 2,
966 .gpiomask = 0xff,
967 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300968 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
969 .gpiomute = 0x29,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800970 .no_msp34xx = 1,
971 .pll = PLL_28,
972 .tuner_type = -1,
973 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800974 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800975 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800976 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800977 .name = "Askey CPH06X TView99",
978 .video_inputs = 4,
979 .audio_inputs = 1,
980 .tuner = 0,
981 .svhs = 2,
982 .gpiomask = 0x551e00,
Michael Krufkybc286362006-01-11 19:40:17 -0200983 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -0300984 .gpiomux = { 0x551400, 0x551200, 0, 0 },
985 .gpiomute = 0x551c00,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800986 .needs_tvaudio = 1,
987 .pll = PLL_28,
988 .tuner_type = 1,
989 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800990 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800991 .has_remote = 1,
992 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800993 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800994 .name = "Pinnacle PCTV Studio/Rave",
995 .video_inputs = 3,
996 .audio_inputs = 1,
997 .tuner = 0,
998 .svhs = 2,
999 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001000 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001001 .gpiomux = { 2, 0xd0001, 0, 0 },
1002 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001003 .needs_tvaudio = 0,
1004 .pll = PLL_28,
1005 .tuner_type = -1,
1006 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001007 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001008 },
1009
1010 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001011 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001012 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
1013 .video_inputs = 3,
1014 .audio_inputs = 1,
1015 .tuner = 0,
1016 .svhs = 2,
1017 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001018 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001019 .gpiomux = { 4, 0, 2, 3 },
1020 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001021 .no_msp34xx = 1,
1022 .needs_tvaudio = 1,
1023 .tuner_type = TUNER_PHILIPS_NTSC,
1024 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001025 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001026 .pll = PLL_28,
1027 .has_radio = 1,
1028 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001029 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001030 .name = "AVerMedia TVPhone 98",
1031 .video_inputs = 3,
1032 .audio_inputs = 4,
1033 .tuner = 0,
1034 .svhs = 2,
1035 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001036 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001037 .gpiomux = { 13, 4, 11, 7 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001038 .needs_tvaudio = 1,
1039 .pll = PLL_28,
1040 .tuner_type = -1,
1041 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001042 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001043 .has_radio = 1,
1044 .audio_hook = avermedia_tvphone_audio,
1045 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001046 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001047 .name = "ProVideo PV951", /* pic16c54 */
1048 .video_inputs = 3,
1049 .audio_inputs = 1,
1050 .tuner = 0,
1051 .svhs = 2,
1052 .gpiomask = 0,
1053 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001054 .gpiomux = { 0, 0, 0, 0},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001055 .needs_tvaudio = 1,
1056 .no_msp34xx = 1,
1057 .pll = PLL_28,
1058 .tuner_type = 1,
1059 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001060 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001061 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001062 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001063 .name = "Little OnAir TV",
1064 .video_inputs = 3,
1065 .audio_inputs = 1,
1066 .tuner = 0,
1067 .svhs = 2,
1068 .gpiomask = 0xe00b,
Michael Krufkybc286362006-01-11 19:40:17 -02001069 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001070 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
1071 .gpiomute = 0xff3ffc,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001072 .no_msp34xx = 1,
1073 .tuner_type = -1,
1074 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001075 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001076 },
1077
1078 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001079 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001080 .name = "Sigma TVII-FM",
1081 .video_inputs = 2,
1082 .audio_inputs = 1,
1083 .tuner = 0,
1084 .svhs = -1,
1085 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02001086 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001087 .gpiomux = { 1, 1, 0, 2 },
1088 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001089 .no_msp34xx = 1,
1090 .pll = PLL_NONE,
1091 .tuner_type = -1,
1092 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001093 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001094 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001095 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001096 .name = "MATRIX-Vision MV-Delta 2",
1097 .video_inputs = 5,
1098 .audio_inputs = 1,
1099 .tuner = -1,
1100 .svhs = 3,
1101 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001102 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001103 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001104 .no_msp34xx = 1,
1105 .pll = PLL_28,
1106 .tuner_type = -1,
1107 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001108 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001109 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001110 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001111 .name = "Zoltrix Genie TV/FM",
1112 .video_inputs = 3,
1113 .audio_inputs = 1,
1114 .tuner = 0,
1115 .svhs = 2,
1116 .gpiomask = 0xbcf03f,
Michael Krufkybc286362006-01-11 19:40:17 -02001117 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001118 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1119 .gpiomute = 0xbcb03f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001120 .no_msp34xx = 1,
1121 .pll = PLL_28,
1122 .tuner_type = 21,
1123 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001124 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001125 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001126 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001127 .name = "Terratec TV/Radio+",
1128 .video_inputs = 3,
1129 .audio_inputs = 1,
1130 .tuner = 0,
1131 .svhs = 2,
1132 .gpiomask = 0x70000,
Michael Krufkybc286362006-01-11 19:40:17 -02001133 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001134 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1135 .gpiomute = 0x40000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001136 .needs_tvaudio = 1,
1137 .no_msp34xx = 1,
1138 .pll = PLL_35,
1139 .tuner_type = 1,
1140 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001141 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001142 .has_radio = 1,
1143 },
1144
1145 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001146 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001147 .name = "Askey CPH03x/ Dynalink Magic TView",
1148 .video_inputs = 3,
1149 .audio_inputs = 1,
1150 .tuner = 0,
1151 .svhs = 2,
1152 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001153 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001154 .gpiomux = {2,0,0,0 },
1155 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001156 .needs_tvaudio = 1,
1157 .pll = PLL_28,
1158 .tuner_type = -1,
1159 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001160 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001161 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001162 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001163 .name = "IODATA GV-BCTV3/PCI",
1164 .video_inputs = 3,
1165 .audio_inputs = 1,
1166 .tuner = 0,
1167 .svhs = 2,
1168 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001169 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001170 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001171 .no_msp34xx = 1,
1172 .pll = PLL_28,
1173 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1174 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001175 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001176 .audio_hook = gvbctv3pci_audio,
1177 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001178 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001179 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1180 .video_inputs = 5,
1181 .audio_inputs = 1,
1182 .tuner = 0,
1183 .svhs = 3,
1184 .gpiomask = 0xAA0000,
1185 .muxsel = { 2,3,1,1,-1 },
1186 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001187 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1188 .gpiomute = 0xa8000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001189 .no_msp34xx = 1,
1190 .pll = PLL_28,
1191 .tuner_type = TUNER_PHILIPS_PAL_I,
1192 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001193 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001194 .has_remote = 1,
1195 /* GPIO wiring: (different from Rev.4C !)
1196 GPIO17: U4.A0 (first hef4052bt)
1197 GPIO19: U4.A1
1198 GPIO20: U5.A1 (second hef4052bt)
1199 GPIO21: U4.nEN
1200 GPIO22: BT832 Reset Line
1201 GPIO23: A5,A0, U5,nEN
1202 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1203 */
1204 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001205 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001206 .name = "Eagle Wireless Capricorn2 (bt878A)",
1207 .video_inputs = 4,
1208 .audio_inputs = 1,
1209 .tuner = 0,
1210 .svhs = 2,
1211 .gpiomask = 7,
Michael Krufkybc286362006-01-11 19:40:17 -02001212 .muxsel = { 2, 0, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001213 .gpiomux = { 0, 1, 2, 3 },
1214 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001215 .pll = PLL_28,
1216 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1217 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001218 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001219 },
1220
1221 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001222 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001223 /* David Härdeman <david@2gen.com> */
1224 .name = "Pinnacle PCTV Studio Pro",
1225 .video_inputs = 4,
1226 .audio_inputs = 1,
1227 .tuner = 0,
1228 .svhs = 3,
1229 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001230 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001231 .gpiomux = { 1, 0xd0001, 0, 0 },
1232 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001233 /* sound path (5 sources):
1234 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1235 0= ext. Audio IN
1236 1= from MUX2
1237 2= Mono TV sound from Tuner
1238 3= not connected
1239 MUX2 (mask 0x30000):
1240 0,2,3= from MSP34xx
1241 1= FM stereo Radio from Tuner */
1242 .needs_tvaudio = 0,
1243 .pll = PLL_28,
1244 .tuner_type = -1,
1245 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001246 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001247 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001248 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001249 /* Claas Langbehn <claas@bigfoot.com>,
1250 Sven Grothklags <sven@upb.de> */
1251 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1252 .video_inputs = 4,
1253 .audio_inputs = 3,
1254 .tuner = 0,
1255 .svhs = 2,
1256 .gpiomask = 0x1c,
Michael Krufkybc286362006-01-11 19:40:17 -02001257 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001258 .gpiomux = { 0, 0, 0x10, 8 },
1259 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001260 .needs_tvaudio = 1,
1261 .pll = PLL_28,
1262 .tuner_type = TUNER_PHILIPS_PAL,
1263 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001264 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001265 .has_radio = 1,
1266 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001267 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001268 /* Tim Röstermundt <rosterm@uni-muenster.de>
1269 in de.comp.os.unix.linux.hardware:
1270 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001271 gpiomux =0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001272 options tuner type=5 */
1273 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1274 .video_inputs = 4,
1275 .audio_inputs = 1,
1276 .tuner = 0,
1277 .svhs = 2,
1278 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001279 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001280 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1281 .gpiomute = 0x18e0,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001282 /* For cards with tda9820/tda9821:
1283 0x0000: Tuner normal stereo
1284 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1285 0x0880: Tuner A2 stereo */
1286 .pll = PLL_28,
1287 .tuner_type = -1,
1288 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001289 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001290 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001291 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001292 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1293 old Easy TV BT848 version (model CPH031) */
1294 .name = "Askey CPH031/ BESTBUY Easy TV",
1295 .video_inputs = 4,
1296 .audio_inputs = 1,
1297 .tuner = 0,
1298 .svhs = 2,
1299 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001300 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001301 .gpiomux = { 2, 0, 0, 0 },
1302 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001303 .needs_tvaudio = 0,
1304 .pll = PLL_28,
1305 .tuner_type = TUNER_TEMIC_PAL,
1306 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001307 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001308 },
1309
1310 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001311 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001312 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1313 .name = "Lifeview FlyVideo 98FM LR50",
1314 .video_inputs = 4,
1315 .audio_inputs = 3,
1316 .tuner = 0,
1317 .svhs = 2,
1318 .gpiomask = 0x1800,
Michael Krufkybc286362006-01-11 19:40:17 -02001319 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001320 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1321 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001322 .pll = PLL_28,
1323 .tuner_type = 5,
1324 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001325 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001326 },
1327 /* This is the ultimate cheapo capture card
1328 * just a BT848A on a small PCB!
1329 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001330 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001331 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1332 .video_inputs = 2,
1333 .audio_inputs = 0,
1334 .tuner = -1,
1335 .svhs = 1,
1336 .gpiomask = 0,
1337 .muxsel = { 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001338 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001339 .needs_tvaudio = 0,
1340 .no_msp34xx = 1,
1341 .pll = PLL_35,
1342 .tuner_type = -1,
1343 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001344 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001345 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001346 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001347 /* Daniel Herrington <daniel.herrington@home.com> */
1348 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1349 .video_inputs = 3,
1350 .audio_inputs = 1,
1351 .tuner = 0,
1352 .svhs = 2,
1353 .gpiomask = 0xe00,
1354 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001355 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1356 .gpiomute = 0x800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001357 .needs_tvaudio = 1,
1358 .pll = PLL_28,
1359 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1360 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001361 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001362 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001363 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001364 /* Matti Mottus <mottus@physic.ut.ee> */
1365 .name = "Askey CPH03x TV Capturer",
1366 .video_inputs = 4,
1367 .audio_inputs = 1,
1368 .tuner = 0,
1369 .svhs = 2,
1370 .gpiomask = 0x03000F,
Michael Krufkybc286362006-01-11 19:40:17 -02001371 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001372 .gpiomux = { 2, 0, 0, 0 },
1373 .gpiomute = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001374 .pll = PLL_28,
1375 .tuner_type = 0,
1376 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001377 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001378 },
1379
1380 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001381 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001382 /* Philip Blundell <philb@gnu.org> */
1383 .name = "Modular Technology MM100PCTV",
1384 .video_inputs = 2,
1385 .audio_inputs = 2,
1386 .tuner = 0,
1387 .svhs = -1,
1388 .gpiomask = 11,
Michael Krufkybc286362006-01-11 19:40:17 -02001389 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001390 .gpiomux = { 2, 0, 0, 1 },
1391 .gpiomute = 8,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001392 .pll = PLL_35,
1393 .tuner_type = TUNER_TEMIC_PAL,
1394 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001395 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001396 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001397 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001398 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001399 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001400 .video_inputs = 2,
1401 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001402 .tuner = -1,
1403 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001404 .gpiomask = 0xF,
Michael Krufkybc286362006-01-11 19:40:17 -02001405 .muxsel = { 2, 2 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001406 .gpiomux = { },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001407 .no_msp34xx = 1,
1408 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001409 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001410 .tuner_type = -1,
1411 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001412 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001413 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001414 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001415 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1416 new Easy TV BT878 version (model CPH061)
1417 special thanks to Informatica Mieres for providing the card */
1418 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1419 .video_inputs = 3,
1420 .audio_inputs = 2,
1421 .tuner = 0,
1422 .svhs = 2,
1423 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02001424 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001425 .gpiomux = { 1, 0, 4, 4 },
1426 .gpiomute = 9,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001427 .needs_tvaudio = 0,
1428 .pll = PLL_28,
1429 .tuner_type = TUNER_PHILIPS_PAL,
1430 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001431 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001432 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001433 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001434 /* Lukas Gebauer <geby@volny.cz> */
1435 .name = "ATI TV-Wonder",
1436 .video_inputs = 3,
1437 .audio_inputs = 1,
1438 .tuner = 0,
1439 .svhs = 2,
1440 .gpiomask = 0xf03f,
1441 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001442 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1443 .gpiomute = 0xbffe,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001444 .pll = PLL_28,
1445 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1446 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001447 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001448 },
1449
1450 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001451 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001452 /* Lukas Gebauer <geby@volny.cz> */
1453 .name = "ATI TV-Wonder VE",
1454 .video_inputs = 2,
1455 .audio_inputs = 1,
1456 .tuner = 0,
1457 .svhs = -1,
1458 .gpiomask = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02001459 .muxsel = { 2, 3, 0, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001460 .gpiomux = { 0, 0, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001461 .no_msp34xx = 1,
1462 .pll = PLL_28,
1463 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1464 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001465 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001466 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001467 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001468 /* DeeJay <deejay@westel900.net (2000S) */
1469 .name = "Lifeview FlyVideo 2000S LR90",
1470 .video_inputs = 3,
1471 .audio_inputs = 3,
1472 .tuner = 0,
1473 .svhs = 2,
1474 .gpiomask = 0x18e0,
Michael Krufkybc286362006-01-11 19:40:17 -02001475 .muxsel = { 2, 3, 0, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001476 /* Radio changed from 1e80 to 0x800 to make
1477 FlyVideo2000S in .hu happy (gm)*/
1478 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001479 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1480 .gpiomute = 0x1800,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001481 .audio_hook = fv2000s_audio,
1482 .no_msp34xx = 1,
1483 .no_tda9875 = 1,
1484 .needs_tvaudio = 1,
1485 .pll = PLL_28,
1486 .tuner_type = 5,
1487 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001488 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001489 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001490 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001491 .name = "Terratec TValueRadio",
1492 .video_inputs = 3,
1493 .audio_inputs = 1,
1494 .tuner = 0,
1495 .svhs = 2,
1496 .gpiomask = 0xffff00,
Michael Krufkybc286362006-01-11 19:40:17 -02001497 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001498 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1499 .gpiomute = 0x900,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001500 .needs_tvaudio = 1,
1501 .pll = PLL_28,
1502 .tuner_type = TUNER_PHILIPS_PAL,
1503 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001504 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001505 .has_radio = 1,
1506 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001507 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001508 /* TANAKA Kei <peg00625@nifty.com> */
1509 .name = "IODATA GV-BCTV4/PCI",
1510 .video_inputs = 3,
1511 .audio_inputs = 1,
1512 .tuner = 0,
1513 .svhs = 2,
1514 .gpiomask = 0x010f00,
Michael Krufkybc286362006-01-11 19:40:17 -02001515 .muxsel = {2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001516 .gpiomux = {0x10000, 0, 0x10000, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001517 .no_msp34xx = 1,
1518 .pll = PLL_28,
1519 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1520 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001521 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001522 .audio_hook = gvbctv3pci_audio,
1523 },
1524
1525 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001526 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001527 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1528 /* try "insmod msp3400 simple=0" if you have
1529 * sound problems with this card. */
1530 .video_inputs = 4,
1531 .audio_inputs = 1,
1532 .tuner = 0,
1533 .svhs = -1,
1534 .gpiomask = 0x4f8a00,
1535 /* 0x100000: 1=MSP enabled (0=disable again)
1536 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001537 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1538 .gpiomute = 0x947fff,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001539 /* tvtuner, radio, external,internal, mute, stereo
1540 * tuner, Composit, SVid, Composit-on-Svid-adapter */
Michael Krufkybc286362006-01-11 19:40:17 -02001541 .muxsel = { 2, 3 ,0 ,1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001542 .tuner_type = TUNER_MT2032,
1543 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001544 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001545 .pll = PLL_28,
1546 .has_radio = 1,
1547 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001548 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001549 /* Philip Blundell <pb@nexus.co.uk> */
1550 .name = "Active Imaging AIMMS",
1551 .video_inputs = 1,
1552 .audio_inputs = 0,
1553 .tuner = -1,
1554 .tuner_type = -1,
1555 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001556 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001557 .pll = PLL_28,
1558 .muxsel = { 2 },
1559 .gpiomask = 0
1560 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001561 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001562 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1563 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1564 .video_inputs = 3,
1565 .audio_inputs = 4,
1566 .tuner = 0,
1567 .svhs = 2,
1568 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02001569 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001570 .gpiomux = { 0, 0, 11, 7 }, /* TV and Radio with same GPIO ! */
1571 .gpiomute = 13,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001572 .needs_tvaudio = 1,
1573 .pll = PLL_28,
1574 .tuner_type = 25,
1575 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001576 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001577 .has_remote = 1,
1578 /* GPIO wiring:
1579 GPIO0: U4.A0 (hef4052bt)
1580 GPIO1: U4.A1
1581 GPIO2: U4.A1 (second hef4052bt)
1582 GPIO3: U4.nEN, U5.A0, A5.nEN
1583 GPIO8-15: vrd866b ?
1584 */
1585 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001586 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001587 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1588 .video_inputs = 4,
1589 .audio_inputs = 0,
1590 .tuner = -1,
1591 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001592 .muxsel = { 2, 3, 1, 1 }, /* AV1, AV2, SVHS, CVid adapter on SVHS */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001593 .pll = PLL_28,
1594 .no_msp34xx = 1,
1595 .tuner_type = UNSET,
1596 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001597 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001598 },
1599
1600 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001601 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001602 /* Dariusz Kowalewski <darekk@automex.pl> */
1603 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1604 .video_inputs = 4,
1605 .audio_inputs = 1,
1606 .tuner = 0,
1607 .svhs = 2,
1608 .gpiomask = 0x3f,
1609 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001610 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1611 .gpiomute = 0x09,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001612 .needs_tvaudio = 1,
1613 .no_msp34xx = 1,
1614 .no_tda9875 = 1,
1615 .pll = PLL_28,
1616 .tuner_type = 5,
1617 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001618 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001619 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1620 .has_radio = 1, /* Note: not all cards have radio */
1621 .has_remote = 1,
1622 /* GPIO wiring:
1623 GPIO0: A0 hef4052
1624 GPIO1: A1 hef4052
1625 GPIO3: nEN hef4052
1626 GPIO8-15: vrd866b
1627 GPIO20,22,23: R30,R29,R28
1628 */
1629 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001630 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001631 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1632 /* you must jumper JP5 for the card to work */
1633 .name = "Sensoray 311",
1634 .video_inputs = 5,
1635 .audio_inputs = 0,
1636 .tuner = -1,
1637 .svhs = 4,
1638 .gpiomask = 0,
Michael Krufkybc286362006-01-11 19:40:17 -02001639 .muxsel = { 2, 3, 1, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001640 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001641 .needs_tvaudio = 0,
1642 .tuner_type = -1,
1643 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001644 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001645 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001646 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001647 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1648 .name = "RemoteVision MX (RV605)",
1649 .video_inputs = 16,
1650 .audio_inputs = 0,
1651 .tuner = -1,
1652 .svhs = -1,
1653 .gpiomask = 0x00,
1654 .gpiomask2 = 0x07ff,
1655 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1656 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1657 .no_msp34xx = 1,
1658 .no_tda9875 = 1,
1659 .tuner_type = -1,
1660 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001661 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001662 .muxsel_hook = rv605_muxsel,
1663 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001664 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001665 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1666 .video_inputs = 3,
1667 .audio_inputs = 2,
1668 .tuner = 0,
1669 .svhs = 2,
1670 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1671 .muxsel = { 2, 1, 1, },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001672 .gpiomux = { 0, 1, 2, 2 },
1673 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001674 .needs_tvaudio = 0,
1675 .tuner_type = TUNER_PHILIPS_PAL,
1676 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001677 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001678 .pll = PLL_28,
1679 .has_radio = 1,
1680 },
1681
1682 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001683 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001684 /* Masaki Suzuki <masaki@btree.org> */
1685 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1686 .video_inputs = 3,
1687 .audio_inputs = 1,
1688 .tuner = 0,
1689 .svhs = 2,
1690 .gpiomask = 0x140007,
1691 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001692 .gpiomux = { 0, 1, 2, 3 },
1693 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001694 .tuner_type = TUNER_PHILIPS_NTSC,
1695 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001696 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001697 .audio_hook = windvr_audio,
1698 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001699 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001700 .name = "GrandTec Multi Capture Card (Bt878)",
1701 .video_inputs = 4,
1702 .audio_inputs = 0,
1703 .tuner = -1,
1704 .svhs = -1,
1705 .gpiomask = 0,
1706 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001707 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001708 .needs_tvaudio = 0,
1709 .no_msp34xx = 1,
1710 .pll = PLL_28,
1711 .tuner_type = -1,
1712 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001713 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001714 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001715 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001716 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1717 .video_inputs = 4,
1718 .audio_inputs = 3,
1719 .tuner = 0,
1720 .svhs = 2,
1721 .gpiomask = 7,
1722 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001723 .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 -08001724 * This card lacks external Audio In, so we mute it on Ext. & Int.
1725 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1726 * This card lacks PCI subsystem ID, sigh.
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001727 * gpiomux =1: lower volume, 2+3: mute
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001728 * btwincap uses 0x80000/0x80003
1729 */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001730 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001731 .needs_tvaudio = 0,
1732 .no_msp34xx = 1,
1733 .pll = PLL_28,
1734 .tuner_type = 5,
1735 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001736 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001737 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1738 radio signal strength indicators work fine. */
1739 .has_radio = 1,
1740 /* GPIO Info:
1741 GPIO0,1: HEF4052 A0,A1
1742 GPIO2: HEF4052 nENABLE
1743 GPIO3-7: n.c.
1744 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1745 GPIO14,15: ??
1746 GPIO16-21: n.c.
1747 GPIO22,23: ??
1748 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1749 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001750 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001751 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1752 .name = "DSP Design TCVIDEO",
1753 .video_inputs = 4,
1754 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02001755 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001756 .pll = PLL_28,
1757 .tuner_type = -1,
1758 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001759 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001760 },
1761
1762 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001763 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001764 .name = "Hauppauge WinTV PVR",
1765 .video_inputs = 4,
1766 .audio_inputs = 1,
1767 .tuner = 0,
1768 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02001769 .muxsel = { 2, 0, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001770 .needs_tvaudio = 1,
1771 .pll = PLL_28,
1772 .tuner_type = -1,
1773 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001774 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001775
1776 .gpiomask = 7,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001777 .gpiomux = {7},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001778 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001779 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001780 .name = "IODATA GV-BCTV5/PCI",
1781 .video_inputs = 3,
1782 .audio_inputs = 1,
1783 .tuner = 0,
1784 .svhs = 2,
1785 .gpiomask = 0x0f0f80,
Michael Krufkybc286362006-01-11 19:40:17 -02001786 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03001787 .gpiomux = {0x030000, 0x010000, 0, 0 },
1788 .gpiomute = 0x020000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001789 .no_msp34xx = 1,
1790 .pll = PLL_28,
1791 .tuner_type = TUNER_PHILIPS_NTSC_M,
1792 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001793 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001794 .audio_hook = gvbctv5pci_audio,
1795 .has_radio = 1,
1796 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001797 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001798 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1799 .video_inputs = 4, /* id-inputs-clock */
1800 .audio_inputs = 0,
1801 .tuner = -1,
1802 .svhs = 3,
1803 .muxsel = { 3, 2, 0, 1 },
1804 .pll = PLL_28,
1805 .tuner_type = -1,
1806 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001807 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001808 .no_msp34xx = 1,
1809 .no_tda9875 = 1,
1810 .no_tda7432 = 1,
1811 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001812 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001813 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1814 .video_inputs = 3,
1815 .audio_inputs = 0,
1816 .tuner = -1,
1817 .svhs = 2,
1818 .muxsel = { 2, 3, 1 },
1819 .pll = PLL_28,
1820 .tuner_type = -1,
1821 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001822 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001823 .no_msp34xx = 1,
1824 .no_tda9875 = 1,
1825 .no_tda7432 = 1,
1826 },
1827
1828 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001829 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001830 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1831 .video_inputs = 2,
1832 .audio_inputs = 0,
1833 .tuner = -1,
1834 .svhs = 1,
1835 .muxsel = { 3, 1 },
1836 .pll = PLL_28,
1837 .tuner_type = -1,
1838 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001839 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001840 .no_msp34xx = 1,
1841 .no_tda9875 = 1,
1842 .no_tda7432 = 1,
1843 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001844 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001845 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1846 .video_inputs = 1,
1847 .audio_inputs = 0,
1848 .tuner = -1,
1849 .svhs = -1,
1850 .muxsel = { 0 },
1851 .pll = PLL_28,
1852 .tuner_type = -1,
1853 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001854 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001855 .no_msp34xx = 1,
1856 .no_tda9875 = 1,
1857 .no_tda7432 = 1,
1858 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001859 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001860 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1861 .video_inputs = 2,
1862 .audio_inputs = 0,
1863 .tuner = -1,
1864 .svhs = 1,
1865 .muxsel = { 0, 1 },
1866 .pll = PLL_28,
1867 .tuner_type = -1,
1868 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001869 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001870 .no_msp34xx = 1,
1871 .no_tda9875 = 1,
1872 .no_tda7432 = 1,
1873 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001874 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001875 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1876 .video_inputs = 1,
1877 .audio_inputs = 1,
1878 .tuner = -1,
1879 .svhs = -1,
1880 .muxsel = { 0 },
1881 .pll = PLL_28,
1882 .tuner_type = UNSET,
1883 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001884 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001885 .no_msp34xx = 1,
1886 .no_tda9875 = 1,
1887 .no_tda7432 = 1,
1888 },
1889
1890 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001891 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001892 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1893 .video_inputs = 2,
1894 .audio_inputs = 1,
1895 .tuner = -1,
1896 .svhs = 1,
1897 .muxsel = { 0, 1 },
1898 .pll = PLL_28,
1899 .tuner_type = UNSET,
1900 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001901 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001902 .no_msp34xx = 1,
1903 .no_tda9875 = 1,
1904 .no_tda7432 = 1,
1905 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001906 [BTTV_BOARD_OSPREY2x0] = {
Michael Krufky52398ef2006-05-26 02:13:15 -03001907 .name = "Osprey 210/220/230", /* 0x1(A|B)-04C0-C1 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001908 .video_inputs = 2,
1909 .audio_inputs = 1,
1910 .tuner = -1,
1911 .svhs = 1,
1912 .muxsel = { 2, 3 },
1913 .pll = PLL_28,
1914 .tuner_type = UNSET,
1915 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001916 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001917 .no_msp34xx = 1,
1918 .no_tda9875 = 1,
1919 .no_tda7432 = 1,
1920 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001921 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001922 .name = "Osprey 500", /* 500 */
1923 .video_inputs = 2,
1924 .audio_inputs = 1,
1925 .tuner = -1,
1926 .svhs = 1,
1927 .muxsel = { 2, 3 },
1928 .pll = PLL_28,
1929 .tuner_type = -1,
1930 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001931 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001932 .no_msp34xx = 1,
1933 .no_tda9875 = 1,
1934 .no_tda7432 = 1,
1935 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001936 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001937 .name = "Osprey 540", /* 540 */
1938 .video_inputs = 4,
1939 .audio_inputs = 1,
1940 .tuner = -1,
1941 #if 0 /* TODO ... */
1942 .svhs = OSPREY540_SVID_ANALOG,
1943 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1944 [OSPREY540_SVID_ANALOG] = 3, },
1945 #endif
1946 .pll = PLL_28,
1947 .tuner_type = -1,
1948 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001949 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001950 .no_msp34xx = 1,
1951 .no_tda9875 = 1,
1952 .no_tda7432 = 1,
1953 #if 0 /* TODO ... */
1954 .muxsel_hook = osprey_540_muxsel,
1955 .picture_hook = osprey_540_set_picture,
1956 #endif
1957 },
1958
1959 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001960 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001961 .name = "Osprey 2000", /* 2000 */
1962 .video_inputs = 2,
1963 .audio_inputs = 1,
1964 .tuner = -1,
1965 .svhs = 1,
1966 .muxsel = { 2, 3 },
1967 .pll = PLL_28,
1968 .tuner_type = UNSET,
1969 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001970 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001971 .no_msp34xx = 1,
1972 .no_tda9875 = 1,
1973 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1974 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001975 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001976 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1977 .name = "IDS Eagle",
1978 .video_inputs = 4,
1979 .audio_inputs = 0,
1980 .tuner = -1,
1981 .tuner_type = -1,
1982 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001983 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001984 .svhs = -1,
1985 .gpiomask = 0,
1986 .muxsel = { 0, 1, 2, 3 },
1987 .muxsel_hook = eagle_muxsel,
1988 .no_msp34xx = 1,
1989 .no_tda9875 = 1,
1990 .pll = PLL_28,
1991 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001992 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001993 .name = "Pinnacle PCTV Sat",
1994 .video_inputs = 2,
1995 .audio_inputs = 0,
1996 .svhs = 1,
1997 .tuner = -1,
1998 .tuner_type = -1,
1999 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002000 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002001 .no_msp34xx = 1,
2002 .no_tda9875 = 1,
2003 .no_tda7432 = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002004 .muxsel = { 3, 0, 1, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002005 .pll = PLL_28,
2006 .no_gpioirq = 1,
2007 .has_dvb = 1,
2008 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002009 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002010 .name = "Formac ProTV II (bt878)",
2011 .video_inputs = 4,
2012 .audio_inputs = 1,
2013 .tuner = 0,
2014 .svhs = 3,
2015 .gpiomask = 2,
2016 /* TV, Comp1, Composite over SVID con, SVID */
Michael Krufkybc286362006-01-11 19:40:17 -02002017 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002018 .gpiomux = { 2, 2, 0, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002019 .pll = PLL_28,
2020 .has_radio = 1,
2021 .tuner_type = TUNER_PHILIPS_PAL,
2022 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002023 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002024 /* sound routing:
2025 GPIO=0x00,0x01,0x03: mute (?)
2026 0x02: both TV and radio (tuner: FM1216/I)
2027 The card has onboard audio connectors labeled "cdrom" and "board",
2028 not soldered here, though unknown wiring.
2029 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002030 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002031 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002032
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002033 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002034 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002035 .name = "MachTV",
2036 .video_inputs = 3,
2037 .audio_inputs = 1,
2038 .tuner = 0,
2039 .svhs = -1,
2040 .gpiomask = 7,
2041 .muxsel = { 2, 3, 1, 1},
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002042 .gpiomux = { 0, 1, 2, 3},
2043 .gpiomute = 4,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002044 .needs_tvaudio = 1,
2045 .tuner_type = 5,
2046 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002047 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08002048 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002049 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002050 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002051 .name = "Euresys Picolo",
2052 .video_inputs = 3,
2053 .audio_inputs = 0,
2054 .tuner = -1,
2055 .svhs = 2,
2056 .gpiomask = 0,
2057 .no_msp34xx = 1,
2058 .no_tda9875 = 1,
2059 .no_tda7432 = 1,
2060 .muxsel = { 2, 0, 1},
2061 .pll = PLL_28,
2062 .tuner_type = UNSET,
2063 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002064 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002065 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002066 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002067 /* Luc Van Hoeylandt <luc@e-magic.be> */
2068 .name = "ProVideo PV150", /* 0x4f */
2069 .video_inputs = 2,
2070 .audio_inputs = 0,
2071 .tuner = -1,
2072 .svhs = -1,
2073 .gpiomask = 0,
2074 .muxsel = { 2, 3 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002075 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002076 .needs_tvaudio = 0,
2077 .no_msp34xx = 1,
2078 .pll = PLL_28,
2079 .tuner_type = UNSET,
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 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002083 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002084 /* Hiroshi Takekawa <sian@big.or.jp> */
2085 /* This card lacks subsystem ID */
2086 .name = "AD-TVK503", /* 0x63 */
2087 .video_inputs = 4,
2088 .audio_inputs = 1,
2089 .tuner = 0,
2090 .svhs = 2,
2091 .gpiomask = 0x001e8007,
2092 .muxsel = { 2, 3, 1, 0 },
2093 /* Tuner, Radio, external, internal, off, on */
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002094 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
2095 .gpiomute = 0x0f,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002096 .needs_tvaudio = 0,
2097 .no_msp34xx = 1,
2098 .pll = PLL_28,
2099 .tuner_type = 2,
2100 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002101 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002102 .audio_hook = adtvk503_audio,
2103 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002104
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002105 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002106 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002107 .name = "Hercules Smart TV Stereo",
2108 .video_inputs = 4,
2109 .audio_inputs = 1,
2110 .tuner = 0,
2111 .svhs = 2,
2112 .gpiomask = 0x00,
2113 .muxsel = { 2, 3, 1, 1 },
2114 .needs_tvaudio = 1,
2115 .no_msp34xx = 1,
2116 .pll = PLL_28,
2117 .tuner_type = 5,
2118 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002119 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002120 /* Notes:
2121 - card lacks subsystem ID
2122 - stereo variant w/ daughter board with tda9874a @0xb0
2123 - Audio Routing:
2124 always from tda9874 independent of GPIO (?)
2125 external line in: unknown
2126 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2127 hef4053 (instead 4052) for unknown function
2128 */
2129 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002130 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002131 .name = "Pace TV & Radio Card",
2132 .video_inputs = 4,
2133 .audio_inputs = 1,
2134 .tuner = 0,
2135 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002136 .muxsel = { 2, 3, 1, 1 }, /* Tuner, CVid, SVid, CVid over SVid connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002137 .gpiomask = 0,
2138 .no_tda9875 = 1,
2139 .no_tda7432 = 1,
2140 .tuner_type = 1,
2141 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002142 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002143 .has_radio = 1,
2144 .pll = PLL_28,
2145 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2146 only internal line out: (4pin header) RGGL
2147 Radio must be decoded by msp3410d (not routed through)*/
2148 /*
2149 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2150 */
2151 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002152 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002153 /* Chris Willing <chris@vislab.usyd.edu.au> */
2154 .name = "IVC-200",
2155 .video_inputs = 1,
2156 .audio_inputs = 0,
2157 .tuner = -1,
2158 .tuner_type = -1,
2159 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002160 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002161 .svhs = -1,
2162 .gpiomask = 0xdf,
2163 .muxsel = { 2 },
2164 .pll = PLL_28,
2165 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002166 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002167 .name = "Grand X-Guard / Trust 814PCI",
2168 .video_inputs = 16,
2169 .audio_inputs = 0,
2170 .tuner = -1,
2171 .svhs = -1,
2172 .tuner_type = 4,
2173 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002174 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002175 .gpiomask2 = 0xff,
2176 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2177 .muxsel_hook = xguard_muxsel,
2178 .no_msp34xx = 1,
2179 .no_tda9875 = 1,
2180 .no_tda7432 = 1,
2181 .pll = PLL_28,
2182 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002183
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002184 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002185 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002186 .name = "Nebula Electronics DigiTV",
2187 .video_inputs = 1,
2188 .tuner = -1,
2189 .svhs = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002190 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002191 .no_msp34xx = 1,
2192 .no_tda9875 = 1,
2193 .no_tda7432 = 1,
2194 .pll = PLL_28,
2195 .tuner_type = -1,
2196 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002197 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002198 .has_dvb = 1,
Mark Weaver6c6c0b22005-11-13 16:07:52 -08002199 .has_remote = 1,
2200 .gpiomask = 0x1b,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002201 .no_gpioirq = 1,
2202 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002203 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002204 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2205 .name = "ProVideo PV143",
2206 .video_inputs = 4,
2207 .audio_inputs = 0,
2208 .tuner = -1,
2209 .svhs = -1,
2210 .gpiomask = 0,
2211 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002212 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002213 .needs_tvaudio = 0,
2214 .no_msp34xx = 1,
2215 .pll = PLL_28,
2216 .tuner_type = -1,
2217 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002218 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002219 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002220 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002221 /* M.Klahr@phytec.de */
2222 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2223 .video_inputs = 4,
2224 .audio_inputs = 0,
2225 .tuner = -1, /* card has no tuner */
2226 .svhs = 3,
2227 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002228 .muxsel = { 2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002229 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002230 .needs_tvaudio = 1,
2231 .pll = PLL_28,
2232 .tuner_type = -1,
2233 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002234 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002235 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002236 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002237 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2238 .video_inputs = 4,
2239 .audio_inputs = 0,
2240 .tuner = -1, /* card has no tuner */
2241 .svhs = 3,
2242 .gpiomask = 0x00,
Michael Krufkybc286362006-01-11 19:40:17 -02002243 .muxsel = { 2, 3, 1, 1 },
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 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002251
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002252 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002253 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002254 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2255 .video_inputs = 10,
2256 .audio_inputs = 0,
2257 .tuner = -1, /* card has no tuner */
2258 .svhs = 9,
2259 .gpiomask = 0x00,
2260 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2261 via the upper nibble of muxsel. here: used for
2262 xternal video-mux */
2263 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002264 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002265 .needs_tvaudio = 1,
2266 .pll = PLL_28,
2267 .tuner_type = -1,
2268 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002269 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002270 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002271 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002272 .name = "PHYTEC VD-009 Combi (bt878)",
2273 .video_inputs = 10,
2274 .audio_inputs = 0,
2275 .tuner = -1, /* card has no tuner */
2276 .svhs = 9,
2277 .gpiomask = 0x00,
2278 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2279 via the upper nibble of muxsel. here: used for
2280 xternal video-mux */
2281 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002282 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002283 .needs_tvaudio = 1,
2284 .pll = PLL_28,
2285 .tuner_type = -1,
2286 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002287 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002288 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002289 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002290 .name = "IVC-100",
2291 .video_inputs = 4,
2292 .audio_inputs = 0,
2293 .tuner = -1,
2294 .tuner_type = -1,
2295 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002296 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002297 .svhs = -1,
2298 .gpiomask = 0xdf,
2299 .muxsel = { 2, 3, 1, 0 },
2300 .pll = PLL_28,
2301 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002302 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002303 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2304 .name = "IVC-120G",
2305 .video_inputs = 16,
2306 .audio_inputs = 0, /* card has no audio */
2307 .tuner = -1, /* card has no tuner */
2308 .tuner_type = -1,
2309 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002310 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002311 .svhs = -1, /* card has no svhs */
2312 .needs_tvaudio = 0,
2313 .no_msp34xx = 1,
2314 .no_tda9875 = 1,
2315 .no_tda7432 = 1,
2316 .gpiomask = 0x00,
2317 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2318 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2319 .muxsel_hook = ivc120_muxsel,
2320 .pll = PLL_28,
2321 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002322
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002323 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002324 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002325 .name = "pcHDTV HD-2000 TV",
2326 .video_inputs = 4,
2327 .audio_inputs = 1,
2328 .tuner = 0,
2329 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002330 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002331 .tuner_type = TUNER_PHILIPS_ATSC,
2332 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002333 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002334 .has_dvb = 1,
2335 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002336 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002337 .name = "Twinhan DST + clones",
2338 .no_msp34xx = 1,
2339 .no_tda9875 = 1,
2340 .no_tda7432 = 1,
2341 .tuner_type = TUNER_ABSENT,
2342 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002343 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002344 .no_video = 1,
2345 .has_dvb = 1,
2346 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002347 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002348 .name = "Winfast VC100",
2349 .video_inputs = 3,
2350 .audio_inputs = 0,
2351 .svhs = 1,
2352 .tuner = -1,
Michael Krufkybc286362006-01-11 19:40:17 -02002353 .muxsel = { 3, 1, 1, 3 }, /* Vid In, SVid In, Vid over SVid in connector */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002354 .no_msp34xx = 1,
2355 .no_tda9875 = 1,
2356 .no_tda7432 = 1,
2357 .tuner_type = TUNER_ABSENT,
2358 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002359 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002360 .pll = PLL_28,
2361 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002362 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002363 .name = "Teppro TEV-560/InterVision IV-560",
2364 .video_inputs = 3,
2365 .audio_inputs = 1,
2366 .tuner = 0,
2367 .svhs = 2,
2368 .gpiomask = 3,
Michael Krufkybc286362006-01-11 19:40:17 -02002369 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002370 .gpiomux = { 1, 1, 1, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002371 .needs_tvaudio = 1,
2372 .tuner_type = TUNER_PHILIPS_PAL,
2373 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002374 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002375 .pll = PLL_35,
2376 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002377
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002378 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002379 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002380 .name = "SIMUS GVC1100",
2381 .video_inputs = 4,
2382 .audio_inputs = 0,
2383 .tuner = -1,
2384 .svhs = -1,
2385 .tuner_type = -1,
2386 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002387 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002388 .pll = PLL_28,
Michael Krufkybc286362006-01-11 19:40:17 -02002389 .muxsel = { 2, 2, 2, 2 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002390 .gpiomask = 0x3F,
2391 .muxsel_hook = gvc1100_muxsel,
2392 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002393 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002394 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2395 .name = "NGS NGSTV+",
2396 .video_inputs = 3,
2397 .tuner = 0,
2398 .svhs = 2,
2399 .gpiomask = 0x008007,
Michael Krufkybc286362006-01-11 19:40:17 -02002400 .muxsel = { 2, 3, 0, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002401 .gpiomux = { 0, 0, 0, 0 },
2402 .gpiomute = 0x000003,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002403 .pll = PLL_28,
2404 .tuner_type = TUNER_PHILIPS_PAL,
2405 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002406 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002407 .has_remote = 1,
2408 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002409 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002410 /* http://linuxmedialabs.com */
2411 .name = "LMLBT4",
2412 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2413 .audio_inputs = 0,
2414 .tuner = -1,
2415 .svhs = -1,
2416 .muxsel = { 2, 3, 1, 0 },
2417 .no_msp34xx = 1,
2418 .no_tda9875 = 1,
2419 .no_tda7432 = 1,
2420 .needs_tvaudio = 0,
2421 .tuner_type = -1,
2422 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002423 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002424 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002425 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002426 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2427 .name = "Tekram M205 PRO",
2428 .video_inputs = 3,
2429 .audio_inputs = 1,
2430 .tuner = 0,
2431 .tuner_type = TUNER_PHILIPS_PAL,
2432 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002433 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002434 .svhs = 2,
2435 .needs_tvaudio = 0,
2436 .gpiomask = 0x68,
Michael Krufkybc286362006-01-11 19:40:17 -02002437 .muxsel = { 2, 3, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002438 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002439 .pll = PLL_28,
2440 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002441
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002442 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002443 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002444 /* Javier Cendan Ares <jcendan@lycos.es> */
2445 /* bt878 TV + FM without subsystem ID */
2446 .name = "Conceptronic CONTVFMi",
2447 .video_inputs = 3,
2448 .audio_inputs = 1,
2449 .tuner = 0,
2450 .svhs = 2,
2451 .gpiomask = 0x008007,
2452 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002453 .gpiomux = { 0, 1, 2, 2 },
2454 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002455 .needs_tvaudio = 0,
2456 .pll = PLL_28,
2457 .tuner_type = TUNER_PHILIPS_PAL,
2458 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002459 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002460 .has_remote = 1,
2461 .has_radio = 1,
2462 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002463 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002464 /*Eric DEBIEF <debief@telemsa.com>*/
2465 /*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 -08002466 /* 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 -08002467 /*0x79 in bttv.h*/
2468 .name = "Euresys Picolo Tetra",
2469 .video_inputs = 4,
2470 .audio_inputs = 0,
2471 .tuner = -1,
2472 .svhs = -1,
2473 .gpiomask = 0,
2474 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2475 .no_msp34xx = 1,
2476 .no_tda9875 = 1,
2477 .no_tda7432 = 1,
2478 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002479 .gpiomux = { 0, 0, 0, 0 }, /* card has no audio */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002480 .pll = PLL_28,
2481 .needs_tvaudio = 0,
2482 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2483 .tuner_type = -1,
2484 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002485 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002486 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002487 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002488 /* Spirit TV Tuner from http://spiritmodems.com.au */
2489 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2490 .name = "Spirit TV Tuner",
2491 .video_inputs = 3,
2492 .audio_inputs = 1,
2493 .tuner = 0,
2494 .svhs = 2,
2495 .gpiomask = 0x0000000f,
2496 .muxsel = { 2, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002497 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002498 .tuner_type = TUNER_TEMIC_PAL,
2499 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002500 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002501 .no_msp34xx = 1,
2502 .no_tda9875 = 1,
2503 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002504 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002505 /* Wolfram Joost <wojo@frokaschwei.de> */
2506 .name = "AVerMedia AVerTV DVB-T 771",
2507 .video_inputs = 2,
2508 .svhs = 1,
2509 .tuner = -1,
2510 .tuner_type = TUNER_ABSENT,
2511 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002512 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002513 .muxsel = { 3 , 3 },
2514 .no_msp34xx = 1,
2515 .no_tda9875 = 1,
2516 .no_tda7432 = 1,
2517 .pll = PLL_28,
2518 .has_dvb = 1,
2519 .no_gpioirq = 1,
2520 .has_remote = 1,
2521 },
2522 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002523 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002524 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002525 /* 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 -08002526 .name = "AverMedia AverTV DVB-T 761",
2527 .video_inputs = 2,
2528 .tuner = -1,
2529 .svhs = 1,
Michael Krufkybc286362006-01-11 19:40:17 -02002530 .muxsel = { 3, 1, 2, 0 }, /* Comp0, S-Video, ?, ? */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002531 .no_msp34xx = 1,
2532 .no_tda9875 = 1,
2533 .no_tda7432 = 1,
2534 .pll = PLL_28,
2535 .tuner_type = -1,
2536 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002537 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002538 .has_dvb = 1,
2539 .no_gpioirq = 1,
2540 .has_remote = 1,
2541 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002542 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002543 /* andre.schwarz@matrix-vision.de */
2544 .name = "MATRIX Vision Sigma-SQ",
2545 .video_inputs = 16,
2546 .audio_inputs = 0,
2547 .tuner = -1,
2548 .svhs = -1,
2549 .gpiomask = 0x0,
2550 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2551 3, 3, 3, 3, 3, 3, 3, 3 },
2552 .muxsel_hook = sigmaSQ_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002553 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002554 .no_msp34xx = 1,
2555 .pll = PLL_28,
2556 .tuner_type = -1,
2557 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002558 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002559 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002560 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002561 /* andre.schwarz@matrix-vision.de */
2562 .name = "MATRIX Vision Sigma-SLC",
2563 .video_inputs = 4,
2564 .audio_inputs = 0,
2565 .tuner = -1,
2566 .svhs = -1,
2567 .gpiomask = 0x0,
2568 .muxsel = { 2, 2, 2, 2 },
2569 .muxsel_hook = sigmaSLC_muxsel,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002570 .gpiomux = { 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002571 .no_msp34xx = 1,
2572 .pll = PLL_28,
2573 .tuner_type = -1,
2574 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002575 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002576 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002577 /* BTTV_BOARD_APAC_VIEWCOMP */
2578 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002579 /* Attila Kondoros <attila.kondoros@chello.hu> */
2580 /* bt878 TV + FM 0x00000000 subsystem ID */
2581 .name = "APAC Viewcomp 878(AMAX)",
2582 .video_inputs = 2,
2583 .audio_inputs = 1,
2584 .tuner = 0,
2585 .svhs = -1,
2586 .gpiomask = 0xFF,
Michael Krufkybc286362006-01-11 19:40:17 -02002587 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002588 .gpiomux = { 2, 0, 0, 0 },
2589 .gpiomute = 10,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002590 .needs_tvaudio = 0,
2591 .pll = PLL_28,
2592 .tuner_type = TUNER_PHILIPS_PAL,
2593 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002594 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002595 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2596 .has_radio = 1, /* not every card has radio */
2597 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002598
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002599 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002600 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002601 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2602 .name = "DViCO FusionHDTV DVB-T Lite",
2603 .tuner = -1,
2604 .no_msp34xx = 1,
2605 .no_tda9875 = 1,
2606 .no_tda7432 = 1,
2607 .pll = PLL_28,
2608 .no_video = 1,
2609 .has_dvb = 1,
2610 .tuner_type = -1,
2611 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002612 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002613 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002614 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002615 /* Steven <photon38@pchome.com.tw> */
2616 .name = "V-Gear MyVCD",
2617 .video_inputs = 3,
2618 .audio_inputs = 1,
2619 .tuner = 0,
2620 .svhs = 2,
2621 .gpiomask = 0x3f,
Michael Krufkybc286362006-01-11 19:40:17 -02002622 .muxsel = {2, 3, 1, 0 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002623 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2624 .gpiomute = 0x31,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002625 .no_msp34xx = 1,
2626 .pll = PLL_28,
2627 .tuner_type = TUNER_PHILIPS_NTSC_M,
2628 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002629 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002630 .has_radio = 0,
2631 #if 0
2632 .has_remote = 1,
2633 #endif
2634 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002635 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002636 /* Rick C <cryptdragoon@gmail.com> */
2637 .name = "Super TV Tuner",
2638 .video_inputs = 4,
2639 .audio_inputs = 1,
2640 .tuner = 0,
2641 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002642 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002643 .tuner_type = TUNER_PHILIPS_NTSC,
2644 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002645 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002646 .gpiomask = 0x008007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002647 .gpiomux = { 0, 0x000001,0,0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002648 .needs_tvaudio = 1,
2649 .has_radio = 1,
2650 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002651 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002652 /* Chris Fanning <video4linux@haydon.net> */
2653 .name = "Tibet Systems 'Progress DVR' CS16",
2654 .video_inputs = 16,
2655 .audio_inputs = 0,
2656 .tuner = -1,
2657 .svhs = -1,
2658 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2659 .pll = PLL_28,
2660 .no_msp34xx = 1,
2661 .no_tda9875 = 1,
2662 .no_tda7432 = 1,
2663 .tuner_type = -1,
2664 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002665 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002666 .muxsel_hook = tibetCS16_muxsel,
2667 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002668 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002669 /* Bill Brack <wbrack@mmm.com.hk> */
2670 /*
2671 * Note that, because of the card's wiring, the "master"
2672 * BT878A chip (i.e. the one which controls the analog switch
2673 * and must use this card type) is the 2nd one detected. The
2674 * other 3 chips should use card type 0x85, whose description
2675 * follows this one. There is a EEPROM on the card (which is
2676 * connected to the I2C of one of those other chips), but is
2677 * not currently handled. There is also a facility for a
2678 * "monitor", which is also not currently implemented.
2679 */
2680 .name = "Kodicom 4400R (master)",
2681 .video_inputs = 16,
2682 .audio_inputs = 0,
2683 .tuner = -1,
2684 .tuner_type = -1,
2685 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002686 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002687 .svhs = -1,
2688 /* GPIO bits 0-9 used for analog switch:
2689 * 00 - 03: camera selector
2690 * 04 - 06: channel (controller) selector
2691 * 07: data (1->on, 0->off)
2692 * 08: strobe
2693 * 09: reset
2694 * bit 16 is input from sync separator for the channel
2695 */
2696 .gpiomask = 0x0003ff,
2697 .no_gpioirq = 1,
2698 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2699 .pll = PLL_28,
2700 .no_msp34xx = 1,
2701 .no_tda7432 = 1,
2702 .no_tda9875 = 1,
2703 .muxsel_hook = kodicom4400r_muxsel,
2704 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002705 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002706 /* Bill Brack <wbrack@mmm.com.hk> */
2707 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2708 * one which controls the analog switch, and must use the card type)
2709 * is the 2nd one detected. The other 3 chips should use this card
2710 * type
2711 */
2712 .name = "Kodicom 4400R (slave)",
2713 .video_inputs = 16,
2714 .audio_inputs = 0,
2715 .tuner = -1,
2716 .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 .svhs = -1,
2720 .gpiomask = 0x010000,
2721 .no_gpioirq = 1,
2722 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2723 .pll = PLL_28,
2724 .no_msp34xx = 1,
2725 .no_tda7432 = 1,
2726 .no_tda9875 = 1,
2727 .muxsel_hook = kodicom4400r_muxsel,
2728 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002729 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002730 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002731 /* Michael Henson <mhenson@clarityvi.com> */
2732 /* Adlink RTV24 with special unlock codes */
2733 .name = "Adlink RTV24",
2734 .video_inputs = 4,
2735 .audio_inputs = 1,
2736 .tuner = 0,
2737 .svhs = 2,
Michael Krufkybc286362006-01-11 19:40:17 -02002738 .muxsel = { 2, 3, 1, 0 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002739 .tuner_type = -1,
2740 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002741 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002742 .pll = PLL_28,
2743 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002744 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002745 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002746 /* Michael Krufky <mkrufky@m1k.net> */
2747 .name = "DViCO FusionHDTV 5 Lite",
2748 .tuner = 0,
Michael Krufky9c26c8b2006-04-27 01:29:17 -03002749 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002750 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002751 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002752 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002753 .audio_inputs = 1,
2754 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002755 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002756 .gpiomask = 0x00e00007,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002757 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2758 .gpiomute = 0x00c00007,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002759 .no_msp34xx = 1,
2760 .no_tda9875 = 1,
2761 .no_tda7432 = 1,
2762 .has_dvb = 1,
2763 },
2764 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002765 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2e7c6dc2006-04-03 07:53:40 -03002766 /* Mauro Carvalho Chehab <mchehab@infradead.org> */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002767 .name = "Acorp Y878F",
2768 .video_inputs = 3,
2769 .audio_inputs = 1,
2770 .tuner = 0,
2771 .svhs = 2,
2772 .gpiomask = 0x01fe00,
Michael Krufkybc286362006-01-11 19:40:17 -02002773 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002774 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2775 .gpiomute = 0x002000,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002776 .needs_tvaudio = 1,
2777 .pll = PLL_28,
2778 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2779 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002780 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002781 .has_radio = 1,
2782 },
2783 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002784 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002785 .name = "Conceptronic CTVFMi v2",
2786 .video_inputs = 3,
2787 .audio_inputs = 1,
2788 .tuner = 0,
2789 .svhs = 2,
2790 .gpiomask = 0x001c0007,
2791 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002792 .gpiomux = { 0, 1, 2, 2 },
2793 .gpiomute = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002794 .needs_tvaudio = 0,
2795 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002796 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002797 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002798 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002799 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002800 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002801 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002802 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002803 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002804 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2805 .video_inputs = 5,
2806 .audio_inputs = 1,
2807 .tuner = 0,
2808 .svhs = 3,
2809 .gpiomask = 0x01fe00,
2810 .muxsel = { 2,3,1,1,-1 },
2811 .digital_mode = DIGITAL_MODE_CAMERA,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002812 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2813 .gpiomute = 0x12400,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002814 .no_msp34xx = 1,
2815 .pll = PLL_28,
2816 .tuner_type = TUNER_LG_PAL_FM,
2817 .tuner_addr = ADDR_UNSET,
2818 .radio_addr = ADDR_UNSET,
2819 .has_remote = 1,
2820 },
2821 /* ---- card 0x8b ---------------------------------- */
2822 [BTTV_BOARD_PV_M4900] = {
2823 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2824 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2825 .video_inputs = 3,
2826 .audio_inputs = 1,
2827 .tuner = 0,
2828 .svhs = 2,
2829 .gpiomask = 0x3f,
2830 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002831 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2832 .gpiomute = 0x29,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002833 .no_msp34xx = 1,
2834 .pll = PLL_28,
2835 .tuner_type = TUNER_YMEC_TVF_5533MF,
2836 .tuner_addr = ADDR_UNSET,
2837 .radio_addr = ADDR_UNSET,
2838 .has_radio = 1,
2839 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002840 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002841 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002842 [BTTV_BOARD_OSPREY440] = {
2843 .name = "Osprey 440",
2844 .video_inputs = 1,
2845 .audio_inputs = 1,
2846 .tuner = -1,
2847 .svhs = 1,
2848 .muxsel = { 2 },
2849 .pll = PLL_28,
2850 .tuner_type = UNSET,
2851 .tuner_addr = ADDR_UNSET,
2852 .radio_addr = ADDR_UNSET,
2853 .no_msp34xx = 1,
2854 .no_tda9875 = 1,
2855 .no_tda7432 = 1,
2856 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002857 /* ---- card 0x8d ---------------------------------- */
2858 [BTTV_BOARD_ASOUND_SKYEYE] = {
2859 .name = "Asound Skyeye PCTV",
2860 .video_inputs = 3,
2861 .audio_inputs = 1,
2862 .tuner = 0,
2863 .svhs = 2,
2864 .gpiomask = 15,
Michael Krufkybc286362006-01-11 19:40:17 -02002865 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002866 .gpiomux = { 2, 0, 0, 0 },
2867 .gpiomute = 1,
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002868 .needs_tvaudio = 1,
2869 .pll = PLL_28,
2870 .tuner_type = 2,
2871 .tuner_addr = ADDR_UNSET,
2872 .radio_addr = ADDR_UNSET,
2873 },
Bill Pechter633323f2005-11-13 16:07:50 -08002874 /* ---- card 0x8e ---------------------------------- */
2875 [BTTV_BOARD_SABRENT_TVFM] = {
2876 .name = "Sabrent TV-FM (bttv version)",
2877 .video_inputs = 3,
2878 .audio_inputs = 1,
2879 .tuner = 0,
2880 .svhs = 2,
2881 .gpiomask = 0x108007,
Michael Krufkybc286362006-01-11 19:40:17 -02002882 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002883 .gpiomux = { 100000, 100002, 100002, 100000 },
Bill Pechter633323f2005-11-13 16:07:50 -08002884 .no_msp34xx = 1,
2885 .no_tda9875 = 1,
2886 .no_tda7432 = 1,
2887 .pll = PLL_28,
2888 .tuner_type = TUNER_TNF_5335MF,
2889 .tuner_addr = ADDR_UNSET,
2890 .has_radio = 1,
2891 },
Steven Tothcd1257d2006-01-09 15:25:01 -02002892 /* ---- card 0x8f ---------------------------------- */
2893 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2894 .name = "Hauppauge ImpactVCB (bt878)",
2895 .video_inputs = 4,
2896 .audio_inputs = 0,
2897 .tuner = -1,
2898 .svhs = -1,
2899 .gpiomask = 0x0f, /* old: 7 */
Michael Krufkybc286362006-01-11 19:40:17 -02002900 .muxsel = { 0, 1, 3, 2 }, /* Composite 0-3 */
Steven Tothcd1257d2006-01-09 15:25:01 -02002901 .no_msp34xx = 1,
2902 .no_tda9875 = 1,
2903 .no_tda7432 = 1,
2904 .tuner_type = -1,
2905 .tuner_addr = ADDR_UNSET,
2906 .radio_addr = ADDR_UNSET,
2907 },
Julian Calaby2d05ae62006-01-11 19:40:09 -02002908 [BTTV_BOARD_MACHTV_MAGICTV] = {
2909 /* Julian Calaby <julian.calaby@gmail.com>
2910 * Slightly different from original MachTV definition (0x60)
2911
2912 * FIXME: RegSpy says gpiomask should be "0x001c800f", but it
2913 * stuffs up remote chip. Bug is a pin on the jaecs is not set
2914 * properly (methinks) causing no keyup bits being set */
2915
2916 .name = "MagicTV", /* rebranded MachTV */
2917 .video_inputs = 3,
2918 .audio_inputs = 1,
2919 .tuner = 0,
2920 .svhs = 2,
2921 .gpiomask = 7,
2922 .muxsel = { 2, 3, 1, 1 },
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002923 .gpiomux = { 0, 1, 2, 3 },
2924 .gpiomute = 4,
Julian Calaby2d05ae62006-01-11 19:40:09 -02002925 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2926 .tuner_addr = ADDR_UNSET,
2927 .radio_addr = ADDR_UNSET,
2928 .pll = PLL_28,
2929 .has_radio = 1,
2930 .has_remote = 1,
2931 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002932};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002933
2934static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2935
2936/* ----------------------------------------------------------------------- */
2937
2938static unsigned char eeprom_data[256];
2939
2940/*
2941 * identify card
2942 */
2943void __devinit bttv_idcard(struct bttv *btv)
2944{
2945 unsigned int gpiobits;
2946 int i,type;
2947 unsigned short tmp;
2948
2949 /* read PCI subsystem ID */
2950 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2951 btv->cardid = tmp << 16;
2952 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2953 btv->cardid |= tmp;
2954
2955 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2956 /* look for the card */
2957 for (type = -1, i = 0; cards[i].id != 0; i++)
2958 if (cards[i].id == btv->cardid)
2959 type = i;
2960
2961 if (type != -1) {
2962 /* found it */
2963 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2964 "PCI subsystem ID is %04x:%04x\n",
2965 btv->c.nr,cards[type].name,cards[type].cardnr,
2966 btv->cardid & 0xffff,
2967 (btv->cardid >> 16) & 0xffff);
2968 btv->c.type = cards[type].cardnr;
2969 } else {
2970 /* 404 */
2971 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2972 btv->c.nr, btv->cardid & 0xffff,
2973 (btv->cardid >> 16) & 0xffff);
2974 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002975 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002976 }
2977 }
2978
2979 /* let the user override the autodetected type */
2980 if (card[btv->c.nr] < bttv_num_tvcards)
2981 btv->c.type=card[btv->c.nr];
2982
2983 /* print which card config we are using */
2984 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2985 bttv_tvcards[btv->c.type].name, btv->c.type,
2986 card[btv->c.nr] < bttv_num_tvcards
2987 ? "insmod option" : "autodetected");
2988
2989 /* overwrite gpio stuff ?? */
2990 if (UNSET == audioall && UNSET == audiomux[0])
2991 return;
2992
2993 if (UNSET != audiomux[0]) {
2994 gpiobits = 0;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03002995 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03002996 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
Linus Torvalds1da177e2005-04-16 15:20:36 -07002997 gpiobits |= audiomux[i];
2998 }
2999 } else {
3000 gpiobits = audioall;
Adrian Bunk68a26ae2006-04-28 10:48:41 -03003001 for (i = 0; i < 4; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003002 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003003 }
3004 }
3005 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
3006 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
3007 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
3008 for (i = 0; i < 5; i++) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003009 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003010 }
3011 printk("\n");
3012}
3013
3014/*
3015 * (most) board specific initialisations goes here
3016 */
3017
3018/* Some Modular Technology cards have an eeprom, but no subsystem ID */
Adrian Bunk943a4902005-12-01 00:51:35 -08003019static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003020{
3021 int type = -1;
3022
3023 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003024 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003025 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003026 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003027 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003028 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003029
3030 if (-1 != type) {
3031 btv->c.type = type;
3032 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
3033 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
3034 }
3035}
3036
3037static void flyvideo_gpio(struct bttv *btv)
3038{
3039 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
3040 int tuner=-1,ttype;
3041
3042 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003043 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003044 gpio = gpio_read();
3045 /* FIXME: must restore OUR_EN ??? */
3046
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003047 /* all cards provide GPIO info, some have an additional eeprom
3048 * LR50: GPIO coding can be found lower right CP1 .. CP9
3049 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
3050 * GPIO14-12: n.c.
3051 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003052
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003053 * lowest 3 bytes are remote control codes (no handshake needed)
3054 * xxxFFF: No remote control chip soldered
3055 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
3056 * Note: Some bits are Audio_Mask !
3057 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003058 ttype=(gpio&0x0f0000)>>16;
3059 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003060 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003061 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003062 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003063 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003064 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003065 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003066 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003067 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003068 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003069 break;
3070 default:
3071 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
3072 }
3073
3074 has_remote = gpio & 0x800000;
3075 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003076 /* unknown 0x200000;
3077 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003078 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003079 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003080 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
3081 /*
3082 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003083
3084 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003085 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003086
3087 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3088 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
3089 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3090 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
3091 is_capture_only?"yes":"no ");
3092
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003093 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003094 btv->tuner_type = tuner;
3095 btv->has_radio = has_radio;
3096
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003097 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
3098 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
3099 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003100 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003101 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003102}
3103
3104static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3105 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3106static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3107 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3108
3109static void miro_pinnacle_gpio(struct bttv *btv)
3110{
3111 int id,msp,gpio;
3112 char *info;
3113
3114 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003115 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003116 id = ((gpio>>10) & 63) -1;
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003117 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
Linus Torvalds1da177e2005-04-16 15:20:36 -07003118 if (id < 32) {
3119 btv->tuner_type = miro_tunermap[id];
3120 if (0 == (gpio & 0x20)) {
3121 btv->has_radio = 1;
3122 if (!miro_fmtuner[id]) {
3123 btv->has_matchbox = 1;
3124 btv->mbox_we = (1<<6);
3125 btv->mbox_most = (1<<7);
3126 btv->mbox_clk = (1<<8);
3127 btv->mbox_data = (1<<9);
3128 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3129 }
3130 } else {
3131 btv->has_radio = 0;
3132 }
3133 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003134 if (btv->c.type == BTTV_BOARD_MIRO)
3135 btv->c.type = BTTV_BOARD_MIROPRO;
3136 if (btv->c.type == BTTV_BOARD_PINNACLE)
3137 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003138 }
3139 printk(KERN_INFO
3140 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3141 btv->c.nr, id+1, btv->tuner_type,
3142 !btv->has_radio ? "no" :
3143 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3144 (-1 == msp) ? "no" : "yes");
3145 } else {
3146 /* new cards with microtune tuner */
3147 id = 63 - id;
3148 btv->has_radio = 0;
3149 switch (id) {
3150 case 1:
3151 info = "PAL / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003152 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003153 break;
3154 case 2:
3155 info = "PAL+SECAM / stereo";
3156 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003157 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003158 break;
3159 case 3:
3160 info = "NTSC / stereo";
3161 btv->has_radio = 1;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003162 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003163 break;
3164 case 4:
3165 info = "PAL+SECAM / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003166 btv->tda9887_conf = TDA9887_QSS;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003167 break;
3168 case 5:
3169 info = "NTSC / mono";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003170 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003171 break;
3172 case 6:
3173 info = "NTSC / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003174 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003175 break;
3176 case 7:
3177 info = "PAL / stereo";
Hans Verkuil39e8f402006-01-09 15:25:16 -02003178 btv->tda9887_conf = TDA9887_INTERCARRIER;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003179 break;
3180 default:
3181 info = "oops: unknown card";
3182 break;
3183 }
3184 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003185 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003186 printk(KERN_INFO
3187 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3188 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
Hans Verkuil39e8f402006-01-09 15:25:16 -02003189 btv->tuner_type = TUNER_MT2032;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003190 }
3191}
3192
3193/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3194#define LM1882_SYNC_DRIVE 0x200000L
3195
3196static void init_ids_eagle(struct bttv *btv)
3197{
3198 gpio_inout(0xffffff,0xFFFF37);
3199 gpio_write(0x200020);
3200
3201 /* flash strobe inverter ?! */
3202 gpio_write(0x200024);
3203
3204 /* switch sync drive off */
3205 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3206
3207 /* set BT848 muxel to 2 */
3208 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3209}
3210
3211/* Muxsel helper for the IDS Eagle.
3212 * the eagles does not use the standard muxsel-bits but
3213 * has its own multiplexer */
3214static void eagle_muxsel(struct bttv *btv, unsigned int input)
3215{
3216 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3217 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3218
Linus Torvalds1da177e2005-04-16 15:20:36 -07003219 /* composite */
3220 /* set chroma ADC to sleep */
3221 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3222 /* set to composite video */
3223 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3224 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003225
3226 /* switch sync drive off */
3227 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3228}
3229
3230static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3231{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003232 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003233 gpio_write(masks[input%4]);
3234}
3235
3236/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3237 alarms output
3238
3239 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3240 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3241
3242 IN - sensor inputs, INx - sensor inputs and TI XORed together
3243 O1,O2,O3 - alarm outputs (relays)
3244
3245 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3246
3247*/
3248
3249static void init_lmlbt4x(struct bttv *btv)
3250{
3251 printk(KERN_DEBUG "LMLBT4x init\n");
3252 btwrite(0x000000, BT848_GPIO_REG_INP);
3253 gpio_inout(0xffffff, 0x0006C0);
3254 gpio_write(0x000000);
3255}
3256
3257static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3258{
3259 unsigned int inmux = input % 8;
3260 gpio_inout( 0xf, 0xf );
3261 gpio_bits( 0xf, inmux );
3262}
3263
3264static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3265{
3266 unsigned int inmux = input % 4;
3267 gpio_inout( 3<<9, 3<<9 );
3268 gpio_bits( 3<<9, inmux<<9 );
3269}
3270
3271/* ----------------------------------------------------------------------- */
3272
3273static void bttv_reset_audio(struct bttv *btv)
3274{
3275 /*
3276 * BT878A has a audio-reset register.
3277 * 1. This register is an audio reset function but it is in
3278 * function-0 (video capture) address space.
3279 * 2. It is enough to do this once per power-up of the card.
3280 * 3. There is a typo in the Conexant doc -- it is not at
3281 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3282 * --//Shrikumar 030609
3283 */
3284 if (btv->id != 878)
3285 return;
3286
3287 if (bttv_debug)
3288 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3289 btwrite((1<<7), 0x058);
3290 udelay(10);
3291 btwrite( 0, 0x058);
3292}
3293
3294/* initialization part one -- before registering i2c bus */
3295void __devinit bttv_init_card1(struct bttv *btv)
3296{
3297 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003298 case BTTV_BOARD_HAUPPAUGE:
3299 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003300 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003301 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003302 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003303 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003304 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003305 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003306 boot_msp34xx(btv,11);
3307 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003308 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003309 pvr_boot(btv);
3310 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003311 case BTTV_BOARD_TWINHAN_DST:
3312 case BTTV_BOARD_AVDVBT_771:
3313 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003314 btv->use_i2c_hw = 1;
3315 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003316 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003317 init_RTV24( btv );
3318 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003319
Linus Torvalds1da177e2005-04-16 15:20:36 -07003320 }
3321 if (!bttv_tvcards[btv->c.type].has_dvb)
3322 bttv_reset_audio(btv);
3323}
3324
3325/* initialization part two -- after registering i2c bus */
3326void __devinit bttv_init_card2(struct bttv *btv)
3327{
3328 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003329 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003330
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003331 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003332
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003333 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003334 bttv_readee(btv,eeprom_data,0xa0);
3335 identify_by_eeprom(btv,eeprom_data);
3336 }
3337
3338 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003339 case BTTV_BOARD_MIRO:
3340 case BTTV_BOARD_MIROPRO:
3341 case BTTV_BOARD_PINNACLE:
3342 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003343 /* miro/pinnacle */
3344 miro_pinnacle_gpio(btv);
3345 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003346 case BTTV_BOARD_FLYVIDEO_98:
3347 case BTTV_BOARD_MAXI:
3348 case BTTV_BOARD_LIFE_FLYKIT:
3349 case BTTV_BOARD_FLYVIDEO:
3350 case BTTV_BOARD_TYPHOON_TVIEW:
3351 case BTTV_BOARD_CHRONOS_VS2:
3352 case BTTV_BOARD_FLYVIDEO_98FM:
3353 case BTTV_BOARD_FLYVIDEO2000:
3354 case BTTV_BOARD_FLYVIDEO98EZ:
3355 case BTTV_BOARD_CONFERENCETV:
3356 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003357 flyvideo_gpio(btv);
3358 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003359 case BTTV_BOARD_HAUPPAUGE:
3360 case BTTV_BOARD_HAUPPAUGE878:
3361 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003362 /* pick up some config infos from the eeprom */
3363 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003364 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003365 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003366 case BTTV_BOARD_AVERMEDIA98:
3367 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003368 bttv_readee(btv,eeprom_data,0xa0);
3369 avermedia_eeprom(btv);
3370 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003371 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003372 init_PXC200(btv);
3373 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003374 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003375 picolo_tetra_init(btv);
3376 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003377 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003378 btv->has_radio = 1;
3379 btv->has_matchbox = 1;
3380 btv->mbox_we = 0x20;
3381 btv->mbox_most = 0;
3382 btv->mbox_clk = 0x08;
3383 btv->mbox_data = 0x10;
3384 btv->mbox_mask = 0x38;
3385 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003386 case BTTV_BOARD_VOBIS_BOOSTAR:
3387 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003388 terratec_active_radio_upgrade(btv);
3389 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003390 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003391 if (btv->cardid == 0x3002144f) {
3392 btv->has_radio=1;
3393 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3394 }
3395 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003396 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003397 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003398 /* Fix up entry for 3DFX VoodooTV 100,
3399 which is an OEM STB card variant. */
3400 btv->has_radio=0;
3401 btv->tuner_type=TUNER_TEMIC_NTSC;
3402 }
3403 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003404 case BTTV_BOARD_OSPREY1x0:
3405 case BTTV_BOARD_OSPREY1x0_848:
3406 case BTTV_BOARD_OSPREY101_848:
3407 case BTTV_BOARD_OSPREY1x1:
3408 case BTTV_BOARD_OSPREY1x1_SVID:
3409 case BTTV_BOARD_OSPREY2xx:
3410 case BTTV_BOARD_OSPREY2x0_SVID:
3411 case BTTV_BOARD_OSPREY2x0:
3412 case BTTV_BOARD_OSPREY500:
3413 case BTTV_BOARD_OSPREY540:
3414 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003415 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003416 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003417 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003418 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003419 init_ids_eagle(btv);
3420 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003421 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003422 bttv_readee(btv,eeprom_data,0xa0);
3423 modtec_eeprom(btv);
3424 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003425 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003426 init_lmlbt4x(btv);
3427 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003428 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003429 tibetCS16_init(btv);
3430 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003431 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003432 kodicom4400r_init(btv);
3433 break;
3434 }
3435
3436 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003437 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003438 /* defaults from card list */
3439 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3440 btv->pll.pll_ifreq=28636363;
3441 btv->pll.pll_crystal=BT848_IFORM_XT0;
3442 }
3443 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3444 btv->pll.pll_ifreq=35468950;
3445 btv->pll.pll_crystal=BT848_IFORM_XT1;
3446 }
3447 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003448 switch (pll[btv->c.nr]) {
3449 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003450 btv->pll.pll_crystal = 0;
3451 btv->pll.pll_ifreq = 0;
3452 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003453 break;
3454 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003455 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003456 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003457 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003458 btv->pll.pll_crystal = BT848_IFORM_XT0;
3459 break;
3460 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003461 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003462 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003463 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003464 btv->pll.pll_crystal = BT848_IFORM_XT1;
3465 break;
3466 }
3467 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003468 btv->pll.pll_current = -1;
3469
Linus Torvalds1da177e2005-04-16 15:20:36 -07003470 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003471 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3472 addr = bttv_tvcards[btv->c.type].tuner_addr;
3473
3474 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003475 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003476 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003477 if (UNSET != tuner[btv->c.nr])
3478 btv->tuner_type = tuner[btv->c.nr];
3479 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003480
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003481 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003482 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003483
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003484 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003485 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003486 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003487
3488 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3489 }
3490
Hans Verkuil39e8f402006-01-09 15:25:16 -02003491 if (btv->tda9887_conf) {
3492 bttv_call_i2c_clients(btv, TDA9887_SET_CONFIG,
3493 &btv->tda9887_conf);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003494 }
3495
Linus Torvalds1da177e2005-04-16 15:20:36 -07003496 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3497 if (svhs[btv->c.nr] != UNSET)
3498 btv->svhs = svhs[btv->c.nr];
3499 if (remote[btv->c.nr] != UNSET)
3500 btv->has_remote = remote[btv->c.nr];
3501
3502 if (bttv_tvcards[btv->c.type].has_radio)
3503 btv->has_radio=1;
3504 if (bttv_tvcards[btv->c.type].has_remote)
3505 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003506 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3507 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003508 if (bttv_tvcards[btv->c.type].audio_hook)
3509 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3510
3511 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3512 /* detect Bt832 chip for quartzsight digital camera */
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003513 if ((bttv_I2CRead(btv, I2C_ADDR_BT832_ALT1, "Bt832") >=0) ||
3514 (bttv_I2CRead(btv, I2C_ADDR_BT832_ALT2, "Bt832") >=0))
Linus Torvalds1da177e2005-04-16 15:20:36 -07003515 boot_bt832(btv);
3516 }
3517
3518 if (!autoload)
3519 return;
3520
3521 /* try to detect audio/fader chips */
3522 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003523 bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003524 request_module("msp3400");
3525
3526 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003527 bttv_I2CRead(btv, I2C_ADDR_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003528 request_module("msp3400");
3529
3530 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003531 bttv_I2CRead(btv, I2C_ADDR_TDA9875, "TDA9875") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003532 request_module("tda9875");
3533
3534 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003535 bttv_I2CRead(btv, I2C_ADDR_TDA7432, "TDA7432") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003536 request_module("tda7432");
3537
3538 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3539 request_module("tvaudio");
3540
3541 /* tuner modules */
3542 tda9887 = 0;
Hans Verkuil39e8f402006-01-09 15:25:16 -02003543 if (btv->tda9887_conf)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003544 tda9887 = 1;
3545 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
Mauro Carvalho Chehab09df1c12006-03-18 08:31:34 -03003546 bttv_I2CRead(btv, I2C_ADDR_TDA9887, "TDA9887") >=0)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003547 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003548 /* Hybrid DVB card, DOES have a tda9887 */
3549 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3550 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003551 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3552 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3553 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3554 tda9887)
3555 request_module("tda9887");
3556 if (btv->tuner_type != UNSET)
3557 request_module("tuner");
3558}
3559
3560
3561/* ----------------------------------------------------------------------- */
3562
3563static void modtec_eeprom(struct bttv *btv)
3564{
3565 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3566 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3567 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3568 btv->c.nr,&eeprom_data[0x1e]);
3569 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3570 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3571 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003572 btv->c.nr,&eeprom_data[0x1e]);
3573 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3574 btv->tuner_type=TUNER_PHILIPS_NTSC;
3575 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3576 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003577 } else {
3578 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3579 btv->c.nr,&eeprom_data[0x1e]);
3580 }
3581}
3582
3583static void __devinit hauppauge_eeprom(struct bttv *btv)
3584{
3585 struct tveeprom tv;
3586
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003587 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003588 btv->tuner_type = tv.tuner_type;
3589 btv->has_radio = tv.has_radio;
Steven Tothcd1257d2006-01-09 15:25:01 -02003590
3591 printk("bttv%d: Hauppauge eeprom indicates model#%d\n",
3592 btv->c.nr, tv.model);
3593
3594 /*
3595 * Some of the 878 boards have duplicate PCI IDs. Switch the board
3596 * type based on model #.
3597 */
3598 if(tv.model == 64900) {
3599 printk("bttv%d: Switching board type from %s to %s\n",
3600 btv->c.nr,
3601 bttv_tvcards[btv->c.type].name,
3602 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3603 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3604 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003605}
3606
3607static int terratec_active_radio_upgrade(struct bttv *btv)
3608{
3609 int freq;
3610
3611 btv->has_radio = 1;
3612 btv->has_matchbox = 1;
3613 btv->mbox_we = 0x10;
3614 btv->mbox_most = 0x20;
3615 btv->mbox_clk = 0x08;
3616 btv->mbox_data = 0x04;
3617 btv->mbox_mask = 0x3c;
3618
3619 btv->mbox_iow = 1 << 8;
3620 btv->mbox_ior = 1 << 9;
3621 btv->mbox_csel = 1 << 10;
3622
3623 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003624 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003625 if (0x1ed8 == tea5757_read(btv)) {
3626 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3627 btv->c.nr);
3628 btv->has_radio = 1;
3629 btv->has_matchbox = 1;
3630 } else {
3631 btv->has_radio = 0;
3632 btv->has_matchbox = 0;
3633 }
3634 return 0;
3635}
3636
3637
3638/* ----------------------------------------------------------------------- */
3639
3640/*
3641 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3642 *
3643 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3644 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3645 * unpacked with unzip).
3646 */
3647#define PVR_GPIO_DELAY 10
3648
3649#define BTTV_ALT_DATA 0x000001
3650#define BTTV_ALT_DCLK 0x100000
3651#define BTTV_ALT_NCONFIG 0x800000
3652
3653static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3654{
3655 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003656 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003657 int i;
3658
3659 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3660 gpio_write(0);
3661 udelay(PVR_GPIO_DELAY);
3662
3663 gpio_write(BTTV_ALT_NCONFIG);
3664 udelay(PVR_GPIO_DELAY);
3665
3666 for (n = 0; n < microlen; n++) {
3667 bits = micro[n];
3668 for ( i = 0 ; i < 8 ; i++ ) {
3669 gpio_bits(BTTV_ALT_DCLK,0);
3670 if (bits & 0x01)
3671 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3672 else
3673 gpio_bits(BTTV_ALT_DATA,0);
3674 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3675 bits >>= 1;
3676 }
3677 }
3678 gpio_bits(BTTV_ALT_DCLK,0);
3679 udelay(PVR_GPIO_DELAY);
3680
3681 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3682 for (i = 0 ; i < 30 ; i++) {
3683 gpio_bits(BTTV_ALT_DCLK,0);
3684 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3685 }
3686 gpio_bits(BTTV_ALT_DCLK,0);
3687 return 0;
3688}
3689
3690static int __devinit pvr_boot(struct bttv *btv)
3691{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003692 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003693 int rc;
3694
3695 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3696 if (rc != 0) {
3697 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3698 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003699 return rc;
3700 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003701 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3702 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3703 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003704 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003705 return rc;
3706}
3707
3708/* ----------------------------------------------------------------------- */
3709/* some osprey specific stuff */
3710
3711static void __devinit osprey_eeprom(struct bttv *btv)
3712{
3713 int i = 0;
3714 unsigned char *ee = eeprom_data;
3715 unsigned long serial = 0;
3716
3717 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003718 /* this might be an antique... check for MMAC label in eeprom */
3719 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3720 unsigned char checksum = 0;
3721 for (i =0; i<21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003722 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003723 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003724 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003725 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003726 for (i = 12; i < 21; i++)
3727 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003728 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003729 } else {
3730 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003731 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003732
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003733 for(; offset < 8*16; offset += 16) {
3734 unsigned short checksum = 0;
3735 /* verify the checksum */
3736 for(i = 0; i<14; i++) checksum += ee[i+offset];
3737 checksum = ~checksum; /* no idea why */
3738 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003739 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003740 break;
3741 }
3742 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003743
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003744 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003745 return;
3746
3747 /* found a valid descriptor */
3748 type = (ee[offset+4]<<8) | (ee[offset+5]);
3749
3750 switch(type) {
3751
3752 /* 848 based */
3753 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003754 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003755 break;
3756 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003757 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003758 break;
3759
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003760 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003761 case 0x0012:
3762 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003763 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003764 break;
3765 case 0x0014:
3766 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003767 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003768 break;
3769 case 0x0016:
3770 case 0x0017:
3771 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003772 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003773 break;
3774 case 0x0018:
3775 case 0x0019:
3776 case 0x001E:
3777 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003778 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003779 break;
3780 case 0x001A:
3781 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003782 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003783 break;
3784 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003785 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003786 break;
3787 case 0x0050:
3788 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003789 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003790 /* bttv_osprey_540_init(btv); */
3791 break;
3792 case 0x0060:
3793 case 0x0070:
Michael Krufky52398ef2006-05-26 02:13:15 -03003794 case 0x00A0:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003795 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003796 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003797 gpio_inout(0xffffff,0x000303);
3798 break;
3799 default:
3800 /* unknown...leave generic, but get serial # */
3801 break;
3802 }
3803 serial = (ee[offset+6] << 24)
3804 | (ee[offset+7] << 16)
3805 | (ee[offset+8] << 8)
3806 | (ee[offset+9]);
3807 }
3808
3809 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3810 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3811}
3812
3813/* ----------------------------------------------------------------------- */
3814/* AVermedia specific stuff, from bktr_card.c */
3815
3816static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003817 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3818 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3819 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3820 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3821 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003822 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003823
3824static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003825 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003826 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3827 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003828 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3829 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003830
3831static void __devinit avermedia_eeprom(struct bttv *btv)
3832{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003833 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003834
3835 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003836 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3837 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003838 btv->has_remote = (eeprom_data[0x42] & 0x01);
3839
3840 if (tuner_make == 0 || tuner_make == 2)
3841 if(tuner_format <=0x0a)
3842 tuner = tuner_0_table[tuner_format];
3843 if (tuner_make == 1)
3844 if(tuner_format <=9)
3845 tuner = tuner_1_table[tuner_format];
3846
3847 if (tuner_make == 4)
3848 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003849 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003850
3851 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3852 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3853 if(tuner) {
3854 btv->tuner_type=tuner;
3855 printk("%d",tuner);
3856 } else
3857 printk("Unknown type");
3858 printk(" radio:%s remote control:%s\n",
3859 tuner_tv_fm ? "yes" : "no",
3860 btv->has_remote ? "yes" : "no");
3861}
3862
3863/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3864void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3865{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003866 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003867 if(norm==VIDEO_MODE_NTSC) {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003868 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x957fff;
3869 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003870 dprintk("bttv_tda9880_setnorm to NTSC\n");
3871 }
3872 else {
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003873 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomux[TVAUDIO_INPUT_TUNER]=0x947fff;
3874 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].gpiomute=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003875 dprintk("bttv_tda9880_setnorm to PAL\n");
3876 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003877 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003878 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
Hans Verkuil8bf2f8e2006-03-18 21:31:00 -03003879 bttv_tvcards[btv->c.type].gpiomux[btv->audio]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003880}
3881
3882
3883/*
3884 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003885 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003886 *
3887 * Hauppauge: pin 5
3888 * Voodoo: pin 20
3889 */
3890static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3891{
3892 int mask = (1 << pin);
3893
3894 gpio_inout(mask,mask);
3895 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003896 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003897 gpio_bits(mask,mask);
3898
3899 if (bttv_gpio)
3900 bttv_gpio_tracking(btv,"msp34xx");
3901 if (bttv_verbose)
3902 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3903 "init [%d]\n", btv->c.nr, pin);
3904}
3905
3906static void __devinit boot_bt832(struct bttv *btv)
3907{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003908}
3909
3910/* ----------------------------------------------------------------------- */
3911/* Imagenation L-Model PXC200 Framegrabber */
3912/* This is basically the same procedure as
3913 * used by Alessandro Rubini in his pxc200
3914 * driver, but using BTTV functions */
3915
3916static void __devinit init_PXC200(struct bttv *btv)
3917{
3918 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3919 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3920 0x00 };
3921 unsigned int i;
3922 int tmp;
3923 u32 val;
3924
3925 /* Initialise GPIO-connevted stuff */
3926 gpio_inout(0xffffff, (1<<13));
3927 gpio_write(0);
3928 udelay(3);
3929 gpio_write(1<<13);
3930 /* GPIO inputs are pulled up, so no need to drive
3931 * reset pin any longer */
3932 gpio_bits(0xffffff, 0);
3933 if (bttv_gpio)
3934 bttv_gpio_tracking(btv,"pxc200");
3935
3936 /* we could/should try and reset/control the AD pots? but
3937 right now we simply turned off the crushing. Without
3938 this the AGC drifts drifts
3939 remember the EN is reverse logic -->
3940 setting BT848_ADC_AGC_EN disable the AGC
3941 tboult@eecs.lehigh.edu
3942 */
3943
3944 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3945
3946 /* Initialise MAX517 DAC */
3947 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3948 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3949
3950 /* Initialise 12C508 PIC */
3951 /* The I2CWrite and I2CRead commmands are actually to the
3952 * same chips - but the R/W bit is included in the address
3953 * argument so the numbers are different */
3954
3955
3956 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3957
3958 /* First of all, enable the clock line. This is used in the PXC200-F */
3959 val = btread(BT848_GPIO_DMA_CTL);
3960 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3961 btwrite(val, BT848_GPIO_DMA_CTL);
3962
3963 /* Then, push to 0 the reset pin long enough to reset the *
3964 * device same as above for the reset line, but not the same
3965 * value sent to the GPIO-connected stuff
3966 * which one is the good one? */
3967 gpio_inout(0xffffff,(1<<2));
3968 gpio_write(0);
3969 udelay(10);
3970 gpio_write(1<<2);
3971
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003972 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003973 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3974 if (tmp != -1) {
3975 printk(KERN_INFO
3976 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3977 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3978 }
3979 }
3980
3981 printk(KERN_INFO "PXC200 Initialised.\n");
3982}
3983
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003984
3985
Peter Skipworth93b43f12005-06-23 22:04:45 -07003986/* ----------------------------------------------------------------------- */
3987/*
3988 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3989 * it. This apparently involves the following procedure for each 878 chip:
3990 *
3991 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3992 *
3993 * 2) write to GPIO_DATA
3994 * - 0x0E
3995 * - sleep 1ms
3996 * - 0x10 + 0x0E
3997 * - sleep 10ms
3998 * - 0x0E
3999 * read from GPIO_DATA into buf (uint_32)
4000 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
4001 * error. ERROR_CPLD_Check_Failed stop.
4002 *
4003 * 3) write to GPIO_DATA
4004 * - write 0x4400 + 0x0E
4005 * - sleep 10ms
4006 * - write 0x4410 + 0x0E
4007 * - sleep 1ms
4008 * - write 0x0E
4009 * read from GPIO_DATA into buf (uint_32)
4010 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
4011 * error. ERROR_CPLD_Check_Failed.
4012 */
4013/* ----------------------------------------------------------------------- */
Adrian Bunk943a4902005-12-01 00:51:35 -08004014static void
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004015init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07004016{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004017 uint32_t dataRead = 0;
4018 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07004019
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004020 printk (KERN_INFO
4021 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07004022 btv->c.nr);
4023
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004024 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004025
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004026 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4027 msleep (1);
4028 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4029 msleep (10);
4030 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004031
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004032 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004033
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004034 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4035 printk (KERN_INFO
4036 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4037 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004038 }
4039
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004040 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4041 msleep (10);
4042 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4043 msleep (1);
4044 btwrite (watchdog_value, BT848_GPIO_DATA);
4045 msleep (1);
4046 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004047
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004048 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4049 printk (KERN_INFO
4050 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4051 btv->c.nr, dataRead);
4052
Peter Skipworth93b43f12005-06-23 22:04:45 -07004053 return;
4054 }
4055
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004056 printk (KERN_INFO
4057 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07004058}
Linus Torvalds1da177e2005-04-16 15:20:36 -07004059
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07004060
4061
Linus Torvalds1da177e2005-04-16 15:20:36 -07004062/* ----------------------------------------------------------------------- */
4063/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
4064/*
4065 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
4066 * This code is placed under the terms of the GNU General Public License
4067 *
4068 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
4069 */
4070
4071static void bus_low(struct bttv *btv, int bit)
4072{
4073 if (btv->mbox_ior) {
4074 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4075 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4076 udelay(5);
4077 }
4078
4079 gpio_bits(bit,0);
4080 udelay(5);
4081
4082 if (btv->mbox_ior) {
4083 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4084 udelay(5);
4085 }
4086}
4087
4088static void bus_high(struct bttv *btv, int bit)
4089{
4090 if (btv->mbox_ior) {
4091 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4092 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4093 udelay(5);
4094 }
4095
4096 gpio_bits(bit,bit);
4097 udelay(5);
4098
4099 if (btv->mbox_ior) {
4100 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4101 udelay(5);
4102 }
4103}
4104
4105static int bus_in(struct bttv *btv, int bit)
4106{
4107 if (btv->mbox_ior) {
4108 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4109 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4110 udelay(5);
4111
4112 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
4113 udelay(5);
4114 }
4115 return gpio_read() & (bit);
4116}
4117
4118/* TEA5757 register bits */
4119#define TEA_FREQ 0:14
4120#define TEA_BUFFER 15:15
4121
4122#define TEA_SIGNAL_STRENGTH 16:17
4123
4124#define TEA_PORT1 18:18
4125#define TEA_PORT0 19:19
4126
4127#define TEA_BAND 20:21
4128#define TEA_BAND_FM 0
4129#define TEA_BAND_MW 1
4130#define TEA_BAND_LW 2
4131#define TEA_BAND_SW 3
4132
4133#define TEA_MONO 22:22
4134#define TEA_ALLOW_STEREO 0
4135#define TEA_FORCE_MONO 1
4136
4137#define TEA_SEARCH_DIRECTION 23:23
4138#define TEA_SEARCH_DOWN 0
4139#define TEA_SEARCH_UP 1
4140
4141#define TEA_STATUS 24:24
4142#define TEA_STATUS_TUNED 0
4143#define TEA_STATUS_SEARCHING 1
4144
4145/* Low-level stuff */
4146static int tea5757_read(struct bttv *btv)
4147{
4148 unsigned long timeout;
4149 int value = 0;
4150 int i;
4151
4152 /* better safe than sorry */
4153 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4154
4155 if (btv->mbox_ior) {
4156 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4157 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4158 udelay(5);
4159 }
4160
4161 if (bttv_gpio)
4162 bttv_gpio_tracking(btv,"tea5757 read");
4163
4164 bus_low(btv,btv->mbox_we);
4165 bus_low(btv,btv->mbox_clk);
4166
4167 udelay(10);
4168 timeout= jiffies + HZ;
4169
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004170 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004171 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4172 schedule();
4173 if (bus_in(btv,btv->mbox_data)) {
4174 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4175 return -1;
4176 }
4177
4178 dprintk("bttv%d: tea5757:",btv->c.nr);
4179 for(i = 0; i < 24; i++)
4180 {
4181 udelay(5);
4182 bus_high(btv,btv->mbox_clk);
4183 udelay(5);
4184 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4185 bus_low(btv,btv->mbox_clk);
4186 value <<= 1;
4187 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4188 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4189 }
4190 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4191 return value;
4192}
4193
4194static int tea5757_write(struct bttv *btv, int value)
4195{
4196 int i;
4197 int reg = value;
4198
4199 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4200
4201 if (btv->mbox_ior) {
4202 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4203 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4204 udelay(5);
4205 }
4206 if (bttv_gpio)
4207 bttv_gpio_tracking(btv,"tea5757 write");
4208
4209 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4210 bus_low(btv,btv->mbox_clk);
4211 bus_high(btv,btv->mbox_we);
4212 for(i = 0; i < 25; i++)
4213 {
4214 if (reg & 0x1000000)
4215 bus_high(btv,btv->mbox_data);
4216 else
4217 bus_low(btv,btv->mbox_data);
4218 reg <<= 1;
4219 bus_high(btv,btv->mbox_clk);
4220 udelay(10);
4221 bus_low(btv,btv->mbox_clk);
4222 udelay(10);
4223 }
4224 bus_low(btv,btv->mbox_we); /* unmute !!! */
4225 return 0;
4226}
4227
4228void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4229{
4230 dprintk("tea5757_set_freq %d\n",freq);
4231 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004232}
4233
4234
4235/* ----------------------------------------------------------------------- */
4236/* winview */
4237
Adrian Bunk943a4902005-12-01 00:51:35 -08004238static void winview_audio(struct bttv *btv, struct video_audio *v, int set)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004239{
4240 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4241 int bits_out, loops, vol, data;
4242
4243 if (!set) {
4244 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4245 v->flags |= VIDEO_AUDIO_VOLUME;
4246 return;
4247 }
4248
4249 /* 32 levels logarithmic */
4250 vol = 32 - ((v->volume>>11));
4251 /* units */
4252 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4253 /* tens */
4254 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4255 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4256 data = gpio_read();
4257 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4258 WINVIEW_PT2254_STROBE);
4259 for (loops = 17; loops >= 0 ; loops--) {
4260 if (bits_out & (1<<loops))
4261 data |= WINVIEW_PT2254_DATA;
4262 else
4263 data &= ~WINVIEW_PT2254_DATA;
4264 gpio_write(data);
4265 udelay(5);
4266 data |= WINVIEW_PT2254_CLK;
4267 gpio_write(data);
4268 udelay(5);
4269 data &= ~WINVIEW_PT2254_CLK;
4270 gpio_write(data);
4271 }
4272 data |= WINVIEW_PT2254_STROBE;
4273 data &= ~WINVIEW_PT2254_DATA;
4274 gpio_write(data);
4275 udelay(10);
4276 data &= ~WINVIEW_PT2254_STROBE;
4277 gpio_write(data);
4278}
4279
4280/* ----------------------------------------------------------------------- */
4281/* mono/stereo control for various cards (which don't use i2c chips but */
4282/* connect something to the GPIO pins */
4283
4284static void
4285gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4286{
4287 unsigned int con = 0;
4288
4289 if (set) {
4290 gpio_inout(0x300, 0x300);
4291 if (v->mode & VIDEO_SOUND_LANG1)
4292 con = 0x000;
4293 if (v->mode & VIDEO_SOUND_LANG2)
4294 con = 0x300;
4295 if (v->mode & VIDEO_SOUND_STEREO)
4296 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004297/* if (v->mode & VIDEO_SOUND_MONO)
4298 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004299 gpio_bits(0x300, con);
4300 } else {
4301 v->mode = VIDEO_SOUND_STEREO |
4302 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4303 }
4304}
4305
4306static void
4307gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4308{
4309 unsigned int val, con;
4310
Linus Torvalds1da177e2005-04-16 15:20:36 -07004311 if (btv->radio_user)
4312 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004313
4314 val = gpio_read();
4315 if (set) {
4316 con = 0x000;
4317 if (v->mode & VIDEO_SOUND_LANG2) {
4318 if (v->mode & VIDEO_SOUND_LANG1) {
4319 /* LANG1 + LANG2 */
4320 con = 0x100;
4321 }
4322 else {
4323 /* LANG2 */
4324 con = 0x300;
4325 }
4326 }
4327 if (con != (val & 0x300)) {
4328 gpio_bits(0x300, con);
4329 if (bttv_gpio)
4330 bttv_gpio_tracking(btv,"gvbctv5pci");
4331 }
4332 } else {
4333 switch (val & 0x70) {
4334 case 0x10:
4335 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4336 break;
4337 case 0x30:
4338 v->mode = VIDEO_SOUND_LANG2;
4339 break;
4340 case 0x50:
4341 v->mode = VIDEO_SOUND_LANG1;
4342 break;
4343 case 0x60:
4344 v->mode = VIDEO_SOUND_STEREO;
4345 break;
4346 case 0x70:
4347 v->mode = VIDEO_SOUND_MONO;
4348 break;
4349 default:
4350 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4351 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4352 }
4353 }
4354}
4355
4356/*
4357 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4358 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4359 * 0xdde enables mono and 0xccd enables sap
4360 *
4361 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4362 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4363 * input/output sound connection, so both must be set for output mode.
4364 *
4365 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4366 * handles this with a tda9840
4367 *
4368 */
4369static void
4370avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4371{
4372 int val = 0;
4373
4374 if (set) {
4375 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4376 val = 0x02;
4377 if (v->mode & VIDEO_SOUND_STEREO)
4378 val = 0x01;
4379 if (val) {
4380 gpio_bits(0x03,val);
4381 if (bttv_gpio)
4382 bttv_gpio_tracking(btv,"avermedia");
4383 }
4384 } else {
4385 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4386 VIDEO_SOUND_LANG1;
4387 return;
4388 }
4389}
4390
4391static void
4392avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4393{
4394 int val = 0;
4395
4396 if (set) {
4397 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4398 val = 0x01;
4399 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4400 val = 0x02;
4401 btaor(val, ~0x03, BT848_GPIO_DATA);
4402 if (bttv_gpio)
4403 bttv_gpio_tracking(btv,"avermedia");
4404 } else {
4405 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4406 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4407 return;
4408 }
4409}
4410
4411/* Lifetec 9415 handling */
4412static void
4413lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4414{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004415 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004416
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004417 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004418 v->mode = VIDEO_SOUND_MONO;
4419 return;
4420 }
4421
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004422 if (set) {
4423 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4424 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004425 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004426 val = 0x0880;
4427 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004428 (v->mode & VIDEO_SOUND_MONO))
4429 val = 0;
4430 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004431 if (bttv_gpio)
4432 bttv_gpio_tracking(btv,"lt9415");
4433 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004434 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004435 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004436 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004437 return;
4438 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004439}
4440
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004441/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004442static void
4443terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4444{
4445 unsigned int con = 0;
4446
4447 if (set) {
4448 gpio_inout(0x180000,0x180000);
4449 if (v->mode & VIDEO_SOUND_LANG2)
4450 con = 0x080000;
4451 if (v->mode & VIDEO_SOUND_STEREO)
4452 con = 0x180000;
4453 gpio_bits(0x180000, con);
4454 if (bttv_gpio)
4455 bttv_gpio_tracking(btv,"terratv");
4456 } else {
4457 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4458 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4459 }
4460}
4461
4462static void
4463winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4464{
4465 unsigned long val = 0;
4466
4467 if (set) {
4468 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4469 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4470 val = 0x420000;
4471 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4472 val = 0x420000;
4473 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4474 val = 0x410000;
4475 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4476 val = 0x020000;
4477 if (val) {
4478 gpio_bits(0x430000, val);
4479 if (bttv_gpio)
4480 bttv_gpio_tracking(btv,"winfast2000");
4481 }
4482 } else {
4483 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4484 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4485 }
4486}
4487
4488/*
4489 * Dariusz Kowalewski <darekk@automex.pl>
4490 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4491 * revision 9B has on-board TDA9874A sound decoder).
4492 *
4493 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4494 * will mute this cards.
4495 */
4496static void
4497pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4498{
4499 unsigned int val = 0;
4500
Linus Torvalds1da177e2005-04-16 15:20:36 -07004501 if (btv->radio_user)
4502 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004503
4504 if (set) {
4505 if (v->mode & VIDEO_SOUND_MONO) {
4506 val = 0x01;
4507 }
4508 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4509 || (v->mode & VIDEO_SOUND_STEREO)) {
4510 val = 0x02;
4511 }
4512 if (val) {
4513 gpio_bits(0x03,val);
4514 if (bttv_gpio)
4515 bttv_gpio_tracking(btv,"pvbt878p9b");
4516 }
4517 } else {
4518 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4519 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4520 }
4521}
4522
4523/*
4524 * Dariusz Kowalewski <darekk@automex.pl>
4525 * sound control for FlyVideo 2000S (with tda9874 decoder)
4526 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4527 */
4528static void
4529fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4530{
4531 unsigned int val = 0xffff;
4532
Linus Torvalds1da177e2005-04-16 15:20:36 -07004533 if (btv->radio_user)
4534 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004535 if (set) {
4536 if (v->mode & VIDEO_SOUND_MONO) {
4537 val = 0x0000;
4538 }
4539 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4540 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004541 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004542 }
4543 if (val != 0xffff) {
4544 gpio_bits(0x1800, val);
4545 if (bttv_gpio)
4546 bttv_gpio_tracking(btv,"fv2000s");
4547 }
4548 } else {
4549 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4550 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4551 }
4552}
4553
4554/*
4555 * sound control for Canopus WinDVR PCI
4556 * Masaki Suzuki <masaki@btree.org>
4557 */
4558static void
4559windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4560{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004561 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004562
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004563 if (set) {
4564 if (v->mode & VIDEO_SOUND_MONO)
4565 val = 0x040000;
4566 if (v->mode & VIDEO_SOUND_LANG1)
4567 val = 0;
4568 if (v->mode & VIDEO_SOUND_LANG2)
4569 val = 0x100000;
4570 if (v->mode & VIDEO_SOUND_STEREO)
4571 val = 0;
4572 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004573 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004574 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004575 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004576 }
4577 } else {
4578 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4579 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4580 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004581}
4582
4583/*
4584 * sound control for AD-TVK503
4585 * Hiroshi Takekawa <sian@big.or.jp>
4586 */
4587static void
4588adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4589{
4590 unsigned int con = 0xffffff;
4591
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004592 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004593
4594 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004595 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004596 if (v->mode & VIDEO_SOUND_LANG1)
4597 con = 0x00000000;
4598 if (v->mode & VIDEO_SOUND_LANG2)
4599 con = 0x00180000;
4600 if (v->mode & VIDEO_SOUND_STEREO)
4601 con = 0x00000000;
4602 if (v->mode & VIDEO_SOUND_MONO)
4603 con = 0x00060000;
4604 if (con != 0xffffff) {
4605 gpio_bits(0x1e0000,con);
4606 if (bttv_gpio)
4607 bttv_gpio_tracking(btv, "adtvk503");
4608 }
4609 } else {
4610 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4611 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4612 }
4613}
4614
4615/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4616 *
4617 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4618 * switch instead (CD22M3494E). This IC can have multiple active connections
4619 * between Xn (input) and Yn (output) pins. We need to clear any existing
4620 * connection prior to establish a new one, pulsing the STROBE pin.
4621 *
4622 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4623 * GPIO pins are wired as:
4624 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4625 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4626 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4627 * GPIO[8] - - P3[5] (microcontroler)
4628 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4629 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4630 * GPINTR - - P3[4] (microcontroler)
4631 *
4632 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4633 * configuration either directly (as we are doing) or using the microcontroler
4634 * which is also wired to I2C interface. I have no further info on the
4635 * microcontroler features, one would need to disassembly the firmware.
4636 * note: the vendor refused to give any information on this product, all
4637 * that stuff was found using a multimeter! :)
4638 */
4639static void rv605_muxsel(struct bttv *btv, unsigned int input)
4640{
4641 /* reset all conections */
4642 gpio_bits(0x200,0x200);
4643 mdelay(1);
4644 gpio_bits(0x200,0x000);
4645 mdelay(1);
4646
4647 /* create a new conection */
4648 gpio_bits(0x480,0x080);
4649 gpio_bits(0x480,0x480);
4650 mdelay(1);
4651 gpio_bits(0x480,0x080);
4652 mdelay(1);
4653}
4654
4655/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4656 *
4657 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4658 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4659 * chips, ten eight input analog multiplexors, a not chip and a few
4660 * other components.
4661 *
4662 * 16 inputs on a secondary bracket are provided and can be selected
4663 * from each of the four capture chips. Two of the eight input
4664 * multiplexors are used to select from any of the 16 input signals.
4665 *
4666 * Unsupported hardware capabilities:
4667 * . A video output monitor on the secondary bracket can be selected from
4668 * one of the 878A chips.
4669 * . Another passthrough but I haven't spent any time investigating it.
4670 * . Digital I/O (logic level connected to GPIO) is available from an
4671 * onboard header.
4672 *
4673 * The on chip input mux should always be set to 2.
4674 * GPIO[16:19] - Video input selection
4675 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4676 * GPIO[?:?] - Digital I/O.
4677 *
4678 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4679 * determined what function (if any) it provides. With the microcontroller
4680 * and sync seperator chips a guess is that it might have to do with video
4681 * switching and maybe some digital I/O.
4682 */
4683static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4684{
4685 /* video mux */
4686 gpio_bits(0x0f0000, input << 16);
4687}
4688
4689static void tibetCS16_init(struct bttv *btv)
4690{
4691 /* enable gpio bits, mask obtained via btSpy */
4692 gpio_inout(0xffffff, 0x0f7fff);
4693 gpio_write(0x0f7fff);
4694}
4695
4696/*
4697 * The following routines for the Kodicom-4400r get a little mind-twisting.
4698 * There is a "master" controller and three "slave" controllers, together
4699 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4700 * The analog switch is controlled by the "master", but the detection order
4701 * of the four BT878A chips is in an order which I just don't understand.
4702 * The "master" is actually the second controller to be detected. The
4703 * logic on the board uses logical numbers for the 4 controlers, but
4704 * those numbers are different from the detection sequence. When working
4705 * with the analog switch, we need to "map" from the detection sequence
4706 * over to the board's logical controller number. This mapping sequence
4707 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4708 * unit 3, the second (which is the master) is logical unit 0, etc.
4709 * We need to maintain the status of the analog switch (which of the 16
4710 * cameras is connected to which of the 4 controllers). Rather than
4711 * add to the bttv structure for this, we use the data reserved for
4712 * the mbox (unused for this card type).
4713 */
4714
4715/*
4716 * First a routine to set the analog switch, which controls which camera
4717 * is routed to which controller. The switch comprises an X-address
4718 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4719 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4720 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4721 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4722 * specified address. The idea is to set the address and data, then bring
4723 * STROBE high, and finally bring STROBE back to low.
4724 */
4725static void kodicom4400r_write(struct bttv *btv,
4726 unsigned char xaddr,
4727 unsigned char yaddr,
4728 unsigned char data) {
4729 unsigned int udata;
4730
4731 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4732 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4733 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4734 gpio_bits(0x1ff, udata); /* strobe low */
4735}
4736
4737/*
4738 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4739 * use this routine. The routine finds the "master" for the card, maps
4740 * the controller number from the detected position over to the logical
4741 * number, writes the appropriate data to the analog switch, and housekeeps
4742 * the local copy of the switch information. The parameter 'input' is the
4743 * requested camera number (0 - 15).
4744 */
4745static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4746{
4747 char *sw_status;
4748 int xaddr, yaddr;
4749 struct bttv *mctlr;
4750 static unsigned char map[4] = {3, 0, 2, 1};
4751
4752 mctlr = master[btv->c.nr];
4753 if (mctlr == NULL) { /* ignore if master not yet detected */
4754 return;
4755 }
4756 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4757 yaddr = map[yaddr];
4758 sw_status = (char *)(&mctlr->mbox_we);
4759 xaddr = input & 0xf;
4760 /* Check if the controller/camera pair has changed, else ignore */
4761 if (sw_status[yaddr] != xaddr)
4762 {
4763 /* "open" the old switch, "close" the new one, save the new */
4764 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4765 sw_status[yaddr] = xaddr;
4766 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4767 }
4768}
4769
4770/*
4771 * During initialisation, we need to reset the analog switch. We
4772 * also preset the switch to map the 4 connectors on the card to the
4773 * *user's* (see above description of kodicom4400r_muxsel) channels
4774 * 0 through 3
4775 */
4776static void kodicom4400r_init(struct bttv *btv)
4777{
4778 char *sw_status = (char *)(&btv->mbox_we);
4779 int ix;
4780
4781 gpio_inout(0x0003ff, 0x0003ff);
4782 gpio_write(1 << 9); /* reset MUX */
4783 gpio_write(0);
4784 /* Preset camera 0 to the 4 controllers */
4785 for (ix=0; ix<4; ix++) {
4786 sw_status[ix] = ix;
4787 kodicom4400r_write(btv, ix, ix, 1);
4788 }
4789 /*
4790 * Since this is the "master", we need to set up the
4791 * other three controller chips' pointers to this structure
4792 * for later use in the muxsel routine.
4793 */
4794 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4795 return;
4796 master[btv->c.nr-1] = btv;
4797 master[btv->c.nr] = btv;
4798 master[btv->c.nr+1] = btv;
4799 master[btv->c.nr+2] = btv;
4800}
4801
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004802/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4803 * video multiplexers to provide up to 16 video inputs. These
4804 * multiplexers are controlled by the lower 8 GPIO pins of the
4805 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004806
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004807 * xxx0 is pin xxx of multiplexer U5,
4808 * yyy1 is pin yyy of multiplexer U2
4809 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004810#define ENA0 0x01
4811#define ENB0 0x02
4812#define ENA1 0x04
4813#define ENB1 0x08
4814
4815#define IN10 0x10
4816#define IN00 0x20
4817#define IN11 0x40
4818#define IN01 0x80
4819
4820static void xguard_muxsel(struct bttv *btv, unsigned int input)
4821{
4822 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004823 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4824 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4825 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4826 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004827 };
4828 gpio_write(masks[input%16]);
4829}
4830static void picolo_tetra_init(struct bttv *btv)
4831{
4832 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4833 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4834 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4835}
4836static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4837{
4838
4839 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4840 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4841 /*GPIO[20]&GPIO[21] used to choose the right input*/
4842 btwrite (input<<20,BT848_GPIO_DATA);
4843
4844}
4845
4846/*
4847 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4848 *
4849 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4850 * swichers to provide 16 channels to MUX0. The TDA8540's have
Andreas Mohrd6e05ed2006-06-26 18:35:02 +02004851 * 4 independent outputs and as such the IVC120G also has the
Linus Torvalds1da177e2005-04-16 15:20:36 -07004852 * optional "Monitor Out" bus. This allows the card to be looking
4853 * at one input while the monitor is looking at another.
4854 *
4855 * Since I've couldn't be bothered figuring out how to add an
4856 * independant muxsel for the monitor bus, I've just set it to
4857 * whatever the card is looking at.
4858 *
4859 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4860 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4861 *
4862 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4863 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4864 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4865 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4866 *
4867 */
4868
4869/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4870#define I2C_TDA8540 0x90
4871#define I2C_TDA8540_ALT1 0x92
4872#define I2C_TDA8540_ALT2 0x94
4873#define I2C_TDA8540_ALT3 0x96
4874#define I2C_TDA8540_ALT4 0x98
4875#define I2C_TDA8540_ALT5 0x9a
4876#define I2C_TDA8540_ALT6 0x9c
4877
4878static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4879{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004880 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004881 int key = input % 4;
4882 int matrix = input / 4;
4883
4884 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4885 btv->c.nr, input, matrix, key);
4886
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004887 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004888 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4889 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4890 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4891 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4892 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4893 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4894 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4895 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4896
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004897 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004898 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004899 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004900 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004901 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004902 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004903 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004904 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004905 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004906
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004907 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004908 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4909}
4910
4911
4912/* PXC200 muxsel helper
4913 * luke@syseng.anu.edu.au
4914 * another transplant
4915 * from Alessandro Rubini (rubini@linux.it)
4916 *
4917 * There are 4 kinds of cards:
4918 * PXC200L which is bt848
4919 * PXC200F which is bt848 with PIC controlling mux
4920 * PXC200AL which is bt878
4921 * PXC200AF which is bt878 with PIC controlling mux
4922 */
4923#define PX_CFG_PXC200F 0x01
4924#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4925#define PX_I2C_PIC 0x0f
4926#define PX_PXC200A_CARDID 0x200a1295
4927#define PX_I2C_CMD_CFG 0x00
4928
4929static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4930{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004931 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004932 long mux;
4933 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004934 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004935
4936 /* Read PIC config to determine if this is a PXC200F */
4937 /* PX_I2C_CMD_CFG*/
4938 buf[0]=0;
4939 buf[1]=0;
4940 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4941 if (rc) {
4942 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4943 /* not PXC ? do nothing */
4944 return;
4945 }
4946
4947 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4948 if (!(rc & PX_CFG_PXC200F)) {
4949 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4950 return;
4951 }
4952
4953
4954 /* The multiplexer in the 200F is handled by the GPIO port */
4955 /* get correct mapping between inputs */
4956 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4957 /* ** not needed!? */
4958 mux = input;
4959
4960 /* make sure output pins are enabled */
4961 /* bitmask=0x30f; */
4962 bitmask=0x302;
4963 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004964 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004965 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4966 bitmask |= 7<<4; /* the DAC */
4967 }
4968 btwrite(bitmask, BT848_GPIO_OUT_EN);
4969
4970 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004971 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004972 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4973 else /* older device */
4974 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4975 btwrite(bitmask,BT848_GPIO_DATA);
4976
4977 /*
4978 * Was "to be safe, set the bt848 to input 0"
4979 * Actually, since it's ok at load time, better not messing
4980 * with these bits (on PXC200AF you need to set mux 2 here)
4981 *
4982 * needed because bttv-driver sets mux before calling this function
4983 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004984 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004985 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4986 else /* older device */
4987 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4988
4989 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4990}
4991
4992/* ----------------------------------------------------------------------- */
4993/* motherboard chipset specific stuff */
4994
4995void __devinit bttv_check_chipset(void)
4996{
4997 int pcipci_fail = 0;
4998 struct pci_dev *dev = NULL;
4999
5000 if (pci_pci_problems & PCIPCI_FAIL)
5001 pcipci_fail = 1;
5002 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
5003 triton1 = 1;
5004 if (pci_pci_problems & PCIPCI_VSFX)
5005 vsfx = 1;
5006#ifdef PCIPCI_ALIMAGIK
5007 if (pci_pci_problems & PCIPCI_ALIMAGIK)
5008 latency = 0x0A;
5009#endif
5010
Linus Torvalds1da177e2005-04-16 15:20:36 -07005011
5012 /* print warnings about any quirks found */
5013 if (triton1)
5014 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
5015 if (vsfx)
5016 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
5017 if (pcipci_fail) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005018 printk(KERN_INFO "bttv: bttv and your chipset may not work "
5019 "together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005020 if (!no_overlay) {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005021 printk(KERN_INFO "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005022 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07005023 } else {
Mauro Carvalho Chehab9050d942006-03-10 16:46:50 -03005024 printk(KERN_INFO "bttv: overlay forced. Use this "
5025 "option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07005026 }
5027 }
5028 if (UNSET != latency)
5029 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08005030 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005031 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005032 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005033 pci_read_config_byte(dev, 0x53, &b);
5034 if (bttv_debug)
5035 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
5036 "bufcon=0x%02x\n",b);
5037 }
5038}
5039
5040int __devinit bttv_handle_chipset(struct bttv *btv)
5041{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005042 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07005043
5044 if (!triton1 && !vsfx && UNSET == latency)
5045 return 0;
5046
5047 if (bttv_verbose) {
5048 if (triton1)
5049 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
5050 if (vsfx && btv->id >= 878)
5051 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
5052 if (UNSET != latency)
5053 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
5054 btv->c.nr,latency);
5055 }
5056
5057 if (btv->id < 878) {
5058 /* bt848 (mis)uses a bit in the irq mask for etbf */
5059 if (triton1)
5060 btv->triton1 = BT848_INT_ETBF;
5061 } else {
5062 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005063 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07005064 if (triton1)
5065 command |= BT878_EN_TBFX;
5066 if (vsfx)
5067 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08005068 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
5069 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07005070 if (UNSET != latency)
5071 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
5072 return 0;
5073}
5074
5075
5076/*
5077 * Local variables:
5078 * c-basic-offset: 8
5079 * End:
5080 */