blob: 66ed9ea64180f7f916934af52b424dfd89c41b8c [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"
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
42/* fwd decl */
43static void boot_msp34xx(struct bttv *btv, int pin);
44static void boot_bt832(struct bttv *btv);
45static void hauppauge_eeprom(struct bttv *btv);
46static void avermedia_eeprom(struct bttv *btv);
47static void osprey_eeprom(struct bttv *btv);
48static void modtec_eeprom(struct bttv *btv);
49static void init_PXC200(struct bttv *btv);
Peter Skipworth93b43f12005-06-23 22:04:45 -070050static void init_RTV24(struct bttv *btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
52static void winview_audio(struct bttv *btv, struct video_audio *v, int set);
53static void lt9415_audio(struct bttv *btv, struct video_audio *v, int set);
54static void avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v,
55 int set);
56static void avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v,
57 int set);
58static void terratv_audio(struct bttv *btv, struct video_audio *v, int set);
59static void gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set);
60static void gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set);
61static void winfast2000_audio(struct bttv *btv, struct video_audio *v, int set);
62static void pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set);
63static void fv2000s_audio(struct bttv *btv, struct video_audio *v, int set);
64static void windvr_audio(struct bttv *btv, struct video_audio *v, int set);
65static void adtvk503_audio(struct bttv *btv, struct video_audio *v, int set);
66static void rv605_muxsel(struct bttv *btv, unsigned int input);
67static void eagle_muxsel(struct bttv *btv, unsigned int input);
68static void xguard_muxsel(struct bttv *btv, unsigned int input);
69static void ivc120_muxsel(struct bttv *btv, unsigned int input);
70static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
71
72static void PXC200_muxsel(struct bttv *btv, unsigned int input);
73
74static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
75static void picolo_tetra_init(struct bttv *btv);
76
77static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
78static void tibetCS16_init(struct bttv *btv);
79
80static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
81static void kodicom4400r_init(struct bttv *btv);
82
83static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
84static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
85
86static int terratec_active_radio_upgrade(struct bttv *btv);
87static int tea5757_read(struct bttv *btv);
88static int tea5757_write(struct bttv *btv, int value);
89static void identify_by_eeprom(struct bttv *btv,
90 unsigned char eeprom_data[256]);
91static int __devinit pvr_boot(struct bttv *btv);
92
93/* config variables */
94static unsigned int triton1=0;
95static unsigned int vsfx=0;
96static unsigned int latency = UNSET;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -070097int no_overlay=-1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070098
99static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
104static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
105#ifdef MODULE
106static unsigned int autoload = 1;
107#else
108static unsigned int autoload = 0;
109#endif
110static unsigned int gpiomask = UNSET;
111static unsigned int audioall = UNSET;
112static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
113
114/* insmod options */
115module_param(triton1, int, 0444);
116module_param(vsfx, int, 0444);
117module_param(no_overlay, int, 0444);
118module_param(latency, int, 0444);
119module_param(gpiomask, int, 0444);
120module_param(audioall, int, 0444);
121module_param(autoload, int, 0444);
122
123module_param_array(card, int, NULL, 0444);
124module_param_array(pll, int, NULL, 0444);
125module_param_array(tuner, int, NULL, 0444);
126module_param_array(svhs, int, NULL, 0444);
127module_param_array(remote, int, NULL, 0444);
128module_param_array(audiomux, int, NULL, 0444);
129
130MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
131 "[enable bug compatibility for triton1 + others]");
132MODULE_PARM_DESC(vsfx,"set VSFX pci config bit "
133 "[yet another chipset flaw workaround]");
134MODULE_PARM_DESC(latency,"pci latency timer");
135MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
136MODULE_PARM_DESC(pll,"specify installed crystal (0=none, 28=28 MHz, 35=35 MHz)");
137MODULE_PARM_DESC(tuner,"specify installed tuner type");
138MODULE_PARM_DESC(autoload,"automatically load i2c modules like tuner.o, default is 1 (yes)");
139
140/* ----------------------------------------------------------------------- */
141/* list of card IDs for bt878+ cards */
142
143static struct CARD {
144 unsigned id;
145 int cardnr;
146 char *name;
147} cards[] __devinitdata = {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800148 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
149 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
150 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
151 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
152 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
153 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
154 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
155 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
Kenth Anderssonf718e6e2005-11-08 21:37:02 -0800156 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800158 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
159 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800161 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
162 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
163 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
164 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
165 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800166 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800167 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
168 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800169 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800171 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700172 /* some cards ship with byteswapped IDs ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800173 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
174 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700175 /* this seems to happen as well ... */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800176 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800178 { 0x3000121a, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
179 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM/ VoodooTV 200" },
180 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800182 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
183 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
184 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
185 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
186 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
187 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
188 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800190 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
191 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
192 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
193 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
194 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700195
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800196 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
197 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
198 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
199 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800201 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
202 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700203 /* clashes with FlyVideo
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800204 *{ 0x18521852, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.10)" }, */
205 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
206 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* LR102 */
207 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" }, /* ?? */
208 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" }, /* ?? */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800210 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
211 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
212 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
213 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
214 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800216 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
217 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
218 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
219 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
220 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800222 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
223 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
224 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
225 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700226
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800227 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
228 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
229 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
230 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800232 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
233 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
234 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
235 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
236 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
237 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
238 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
239 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
240 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
241 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
242 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
243 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
244 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
245 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
246 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
247 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
248 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
249 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700257
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800258 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
259 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800261 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
262 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
263 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
264 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
265 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
266 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800268 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
269 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800271 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
272 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
273 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
274 { 0x03116000, BTTV_BOARD_SENSORAY311, "Sensoray 311" },
275 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
276 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
277 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
278 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
279 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -0800280 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800282 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
283 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800285 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
286 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
287 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
288 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800290 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700291
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700292 /* likely broken, vendor id doesn't match the other magic views ...
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800293 * { 0xa0fca04f, BTTV_BOARD_MAGICTVIEW063, "Guillemot Maxi TV Video 3" }, */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700294
295 /* DVB cards (using pci function .1 for mpeg data xfer) */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800296 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
297 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
298 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
299 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
300 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
301 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
302 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
303 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
304 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305
306 { 0, -1, NULL }
307};
308
309/* ----------------------------------------------------------------------- */
310/* array with description for bt848 / bt878 tv/grabber cards */
311
312struct tvcard bttv_tvcards[] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800313 /* ---- card 0x00 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800314 [BTTV_BOARD_UNKNOWN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800315 .name = " *** UNKNOWN/GENERIC *** ",
316 .video_inputs = 4,
317 .audio_inputs = 1,
318 .tuner = 0,
319 .svhs = 2,
320 .muxsel = { 2, 3, 1, 0},
321 .tuner_type = -1,
322 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800323 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800324 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800325 [BTTV_BOARD_MIRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800326 .name = "MIRO PCTV",
327 .video_inputs = 4,
328 .audio_inputs = 1,
329 .tuner = 0,
330 .svhs = 2,
331 .gpiomask = 15,
332 .muxsel = { 2, 3, 1, 1},
333 .audiomux = { 2, 0, 0, 0, 10},
334 .needs_tvaudio = 1,
335 .tuner_type = -1,
336 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800337 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800338 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800339 [BTTV_BOARD_HAUPPAUGE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800340 .name = "Hauppauge (bt848)",
341 .video_inputs = 4,
342 .audio_inputs = 1,
343 .tuner = 0,
344 .svhs = 2,
345 .gpiomask = 7,
346 .muxsel = { 2, 3, 1, 1},
347 .audiomux = { 0, 1, 2, 3, 4},
348 .needs_tvaudio = 1,
349 .tuner_type = -1,
350 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800351 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800352 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800353 [BTTV_BOARD_STB] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800354 .name = "STB, Gateway P/N 6000699 (bt848)",
355 .video_inputs = 3,
356 .audio_inputs = 1,
357 .tuner = 0,
358 .svhs = 2,
359 .gpiomask = 7,
360 .muxsel = { 2, 3, 1, 1},
361 .audiomux = { 4, 0, 2, 3, 1},
362 .no_msp34xx = 1,
363 .needs_tvaudio = 1,
364 .tuner_type = TUNER_PHILIPS_NTSC,
365 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800366 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800367 .pll = PLL_28,
368 .has_radio = 1,
369 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800371 /* ---- card 0x04 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800372 [BTTV_BOARD_INTEL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800373 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
374 .video_inputs = 4,
375 .audio_inputs = 0,
376 .tuner = -1,
377 .svhs = 2,
378 .gpiomask = 0,
379 .muxsel = { 2, 3, 1, 1},
380 .audiomux = { 0 },
381 .needs_tvaudio = 0,
382 .tuner_type = 4,
383 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800384 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800385 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800386 [BTTV_BOARD_DIAMOND] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800387 .name = "Diamond DTV2000",
388 .video_inputs = 4,
389 .audio_inputs = 1,
390 .tuner = 0,
391 .svhs = 2,
392 .gpiomask = 3,
393 .muxsel = { 2, 3, 1, 0},
394 .audiomux = { 0, 1, 0, 1, 3},
395 .needs_tvaudio = 1,
396 .tuner_type = -1,
397 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800398 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800399 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800400 [BTTV_BOARD_AVERMEDIA] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800401 .name = "AVerMedia TVPhone",
402 .video_inputs = 3,
403 .audio_inputs = 1,
404 .tuner = 0,
405 .svhs = 3,
406 .muxsel = { 2, 3, 1, 1},
407 .gpiomask = 0x0f,
408 .audiomux = { 0x0c, 0x04, 0x08, 0x04, 0},
409 /* 0x04 for some cards ?? */
410 .needs_tvaudio = 1,
411 .tuner_type = -1,
412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800414 .audio_hook = avermedia_tvphone_audio,
415 .has_remote = 1,
416 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800417 [BTTV_BOARD_MATRIX_VISION] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800418 .name = "MATRIX-Vision MV-Delta",
419 .video_inputs = 5,
420 .audio_inputs = 1,
421 .tuner = -1,
422 .svhs = 3,
423 .gpiomask = 0,
424 .muxsel = { 2, 3, 1, 0, 0},
425 .audiomux = {0 },
426 .needs_tvaudio = 1,
427 .tuner_type = -1,
428 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800429 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800430 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800432 /* ---- card 0x08 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800433 [BTTV_BOARD_FLYVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800434 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
435 .video_inputs = 4,
436 .audio_inputs = 1,
437 .tuner = 0,
438 .svhs = 2,
439 .gpiomask = 0xc00,
440 .muxsel = { 2, 3, 1, 1},
441 .audiomux = { 0, 0xc00, 0x800, 0x400, 0xc00, 0},
442 .needs_tvaudio = 1,
443 .pll = PLL_28,
444 .tuner_type = -1,
445 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800446 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800447 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800448 [BTTV_BOARD_TURBOTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800449 .name = "IMS/IXmicro TurboTV",
450 .video_inputs = 3,
451 .audio_inputs = 1,
452 .tuner = 0,
453 .svhs = 2,
454 .gpiomask = 3,
455 .muxsel = { 2, 3, 1, 1},
456 .audiomux = { 1, 1, 2, 3, 0},
457 .needs_tvaudio = 0,
458 .pll = PLL_28,
459 .tuner_type = TUNER_TEMIC_PAL,
460 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800461 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800462 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800463 [BTTV_BOARD_HAUPPAUGE878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800464 .name = "Hauppauge (bt878)",
465 .video_inputs = 4,
466 .audio_inputs = 1,
467 .tuner = 0,
468 .svhs = 2,
469 .gpiomask = 0x0f, /* old: 7 */
470 .muxsel = { 2, 0, 1, 1},
471 .audiomux = { 0, 1, 2, 3, 4},
472 .needs_tvaudio = 1,
473 .pll = PLL_28,
474 .tuner_type = -1,
475 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800476 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800477 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800478 [BTTV_BOARD_MIROPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800479 .name = "MIRO PCTV pro",
480 .video_inputs = 3,
481 .audio_inputs = 1,
482 .tuner = 0,
483 .svhs = 2,
484 .gpiomask = 0x3014f,
485 .muxsel = { 2, 3, 1, 1},
486 .audiomux = { 0x20001,0x10001, 0, 0,10},
487 .needs_tvaudio = 1,
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 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800493 /* ---- card 0x0c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800494 [BTTV_BOARD_ADSTECH_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800495 .name = "ADS Technologies Channel Surfer TV (bt848)",
496 .video_inputs = 3,
497 .audio_inputs = 1,
498 .tuner = 0,
499 .svhs = 2,
500 .gpiomask = 15,
501 .muxsel = { 2, 3, 1, 1},
502 .audiomux = { 13, 14, 11, 7, 0, 0},
503 .needs_tvaudio = 1,
504 .tuner_type = -1,
505 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800506 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800507 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800508 [BTTV_BOARD_AVERMEDIA98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800509 .name = "AVerMedia TVCapture 98",
510 .video_inputs = 3,
511 .audio_inputs = 4,
512 .tuner = 0,
513 .svhs = 2,
514 .gpiomask = 15,
515 .muxsel = { 2, 3, 1, 1},
516 .audiomux = { 13, 14, 11, 7, 0, 0},
517 .needs_tvaudio = 1,
518 .msp34xx_alt = 1,
519 .pll = PLL_28,
520 .tuner_type = TUNER_PHILIPS_PAL,
521 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800522 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800523 .audio_hook = avermedia_tv_stereo_audio,
Ray Colea8900fc2005-11-08 21:37:43 -0800524 .no_gpioirq = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800525 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800526 [BTTV_BOARD_VHX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800527 .name = "Aimslab Video Highway Xtreme (VHX)",
528 .video_inputs = 3,
529 .audio_inputs = 1,
530 .tuner = 0,
531 .svhs = 2,
532 .gpiomask = 7,
533 .muxsel = { 2, 3, 1, 1},
534 .audiomux = { 0, 2, 1, 3, 4}, /* old: { 0, 1, 2, 3, 4} */
535 .needs_tvaudio = 1,
536 .pll = PLL_28,
537 .tuner_type = -1,
538 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800539 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800540 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800541 [BTTV_BOARD_ZOLTRIX] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800542 .name = "Zoltrix TV-Max",
543 .video_inputs = 3,
544 .audio_inputs = 1,
545 .tuner = 0,
546 .svhs = 2,
547 .gpiomask = 15,
548 .muxsel = { 2, 3, 1, 1},
549 .audiomux = {0 , 0, 1 , 0, 10},
550 .needs_tvaudio = 1,
551 .tuner_type = -1,
552 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800553 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800554 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800556 /* ---- card 0x10 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800557 [BTTV_BOARD_PIXVIEWPLAYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800558 .name = "Prolink Pixelview PlayTV (bt878)",
559 .video_inputs = 3,
560 .audio_inputs = 1,
561 .tuner = 0,
562 .svhs = 2,
563 .gpiomask = 0x01fe00,
564 .muxsel = { 2, 3, 1, 1},
565 #if 0
566 /* old */
567 .audiomux = { 0x01c000, 0, 0x018000, 0x014000, 0x002000, 0 },
568 #else
569 /* 2003-10-20 by "Anton A. Arapov" <arapov@mail.ru> */
570 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
571 #endif
572 .needs_tvaudio = 1,
573 .pll = PLL_28,
574 .tuner_type = -1,
575 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800576 [BTTV_BOARD_WINVIEW_601] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800577 .name = "Leadtek WinView 601",
578 .video_inputs = 3,
579 .audio_inputs = 1,
580 .tuner = 0,
581 .svhs = 2,
582 .gpiomask = 0x8300f8,
583 .muxsel = { 2, 3, 1, 1,0},
584 .audiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007,0xcfa007},
585 .needs_tvaudio = 1,
586 .tuner_type = -1,
587 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800588 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800589 .audio_hook = winview_audio,
590 .has_radio = 1,
591 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800592 [BTTV_BOARD_AVEC_INTERCAP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800593 .name = "AVEC Intercapture",
594 .video_inputs = 3,
595 .audio_inputs = 2,
596 .tuner = 0,
597 .svhs = 2,
598 .gpiomask = 0,
599 .muxsel = {2, 3, 1, 1},
600 .audiomux = {1, 0, 0, 0, 0},
601 .needs_tvaudio = 1,
602 .tuner_type = -1,
603 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800604 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800605 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800606 [BTTV_BOARD_LIFE_FLYKIT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800607 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
608 .video_inputs = 4,
609 .audio_inputs = 1,
610 .tuner = -1,
611 .svhs = -1,
612 .gpiomask = 0x8dff00,
613 .muxsel = { 2, 3, 1, 1},
614 .audiomux = { 0 },
615 .no_msp34xx = 1,
616 .tuner_type = -1,
617 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800618 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800619 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700620
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800621 /* ---- card 0x14 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800622 [BTTV_BOARD_CEI_RAFFLES] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800623 .name = "CEI Raffles Card",
624 .video_inputs = 3,
625 .audio_inputs = 3,
626 .tuner = 0,
627 .svhs = 2,
628 .muxsel = {2, 3, 1, 1},
629 .tuner_type = -1,
630 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800631 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800632 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800633 [BTTV_BOARD_CONFERENCETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800634 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
635 .video_inputs = 4,
636 .audio_inputs = 2, /* tuner, line in */
637 .tuner = 0,
638 .svhs = 2,
639 .gpiomask = 0x1800,
640 .muxsel = { 2, 3, 1, 1},
641 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
642 .pll = PLL_28,
643 .tuner_type = TUNER_PHILIPS_PAL_I,
644 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800645 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800646 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800647 [BTTV_BOARD_PHOEBE_TVMAS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800648 .name = "Askey CPH050/ Phoebe Tv Master + FM",
649 .video_inputs = 3,
650 .audio_inputs = 1,
651 .tuner = 0,
652 .svhs = 2,
653 .gpiomask = 0xc00,
654 .muxsel = { 2, 3, 1, 1},
655 .audiomux = {0, 1, 0x800, 0x400, 0xc00, 0},
656 .needs_tvaudio = 1,
657 .pll = PLL_28,
658 .tuner_type = -1,
659 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800660 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800661 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800662 [BTTV_BOARD_MODTEC_205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800663 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
664 .video_inputs = 3,
665 .audio_inputs = 1,
666 .tuner = 0,
667 .svhs = -1,
668 .gpiomask = 7,
669 .muxsel = { 2, 3, -1 },
670 .digital_mode = DIGITAL_MODE_CAMERA,
671 .audiomux = { 0, 0, 0, 0, 0 },
672 .no_msp34xx = 1,
673 .pll = PLL_28,
674 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
675 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800676 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800677 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800679 /* ---- card 0x18 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800680 [BTTV_BOARD_MAGICTVIEW061] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800681 .name = "Askey CPH05X/06X (bt878) [many vendors]",
682 .video_inputs = 3,
683 .audio_inputs = 1,
684 .tuner = 0,
685 .svhs = 2,
686 .gpiomask = 0xe00,
687 .muxsel = { 2, 3, 1, 1},
688 .audiomux = {0x400, 0x400, 0x400, 0x400, 0xc00},
689 .needs_tvaudio = 1,
690 .pll = PLL_28,
691 .tuner_type = -1,
692 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800693 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800694 .has_remote = 1,
695 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800696 [BTTV_BOARD_VOBIS_BOOSTAR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800697 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
698 .video_inputs = 3,
699 .audio_inputs = 1,
700 .tuner = 0,
701 .svhs = 2,
702 .gpiomask = 0x1f0fff,
703 .muxsel = { 2, 3, 1, 1},
704 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000},
705 .needs_tvaudio = 0,
706 .tuner_type = TUNER_PHILIPS_PAL,
707 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800708 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800709 .audio_hook = terratv_audio,
710 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800711 [BTTV_BOARD_HAUPPAUG_WCAM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800712 .name = "Hauppauge WinCam newer (bt878)",
713 .video_inputs = 4,
714 .audio_inputs = 1,
715 .tuner = 0,
716 .svhs = 3,
717 .gpiomask = 7,
718 .muxsel = { 2, 0, 1, 1},
719 .audiomux = { 0, 1, 2, 3, 4},
720 .needs_tvaudio = 1,
721 .tuner_type = -1,
722 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800723 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800724 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800725 [BTTV_BOARD_MAXI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800726 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
727 .video_inputs = 4,
728 .audio_inputs = 2,
729 .tuner = 0,
730 .svhs = 2,
731 .gpiomask = 0x1800,
732 .muxsel = { 2, 3, 1, 1},
733 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
734 .pll = PLL_28,
735 .tuner_type = TUNER_PHILIPS_SECAM,
736 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800737 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800738 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800740 /* ---- card 0x1c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800741 [BTTV_BOARD_TERRATV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800742 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
743 .video_inputs = 3,
744 .audio_inputs = 1,
745 .tuner = 0,
746 .svhs = 2,
747 .gpiomask = 0x1f0fff,
748 .muxsel = { 2, 3, 1, 1},
749 .audiomux = { 0x20000, 0x30000, 0x10000, 0x00000, 0x40000},
750 .needs_tvaudio = 0,
751 .tuner_type = TUNER_PHILIPS_PAL,
752 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800753 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800754 .audio_hook = terratv_audio,
755 /* GPIO wiring:
756 External 20 pin connector (for Active Radio Upgrade board)
757 gpio00: i2c-sda
758 gpio01: i2c-scl
759 gpio02: om5610-data
760 gpio03: om5610-clk
761 gpio04: om5610-wre
762 gpio05: om5610-stereo
763 gpio06: rds6588-davn
764 gpio07: Pin 7 n.c.
765 gpio08: nIOW
766 gpio09+10: nIOR, nSEL ?? (bt878)
767 gpio09: nIOR (bt848)
768 gpio10: nSEL (bt848)
769 Sound Routing:
770 gpio16: u2-A0 (1st 4052bt)
771 gpio17: u2-A1
772 gpio18: u2-nEN
773 gpio19: u4-A0 (2nd 4052)
774 gpio20: u4-A1
775 u4-nEN - GND
776 Btspy:
777 00000 : Cdrom (internal audio input)
778 10000 : ext. Video audio input
779 20000 : TV Mono
780 a0000 : TV Mono/2
781 1a0000 : TV Stereo
782 30000 : Radio
783 40000 : Mute
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -0700784 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800786 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800787 [BTTV_BOARD_PXC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800788 /* Jannik Fritsch <jannik@techfak.uni-bielefeld.de> */
789 .name = "Imagenation PXC200",
790 .video_inputs = 5,
791 .audio_inputs = 1,
792 .tuner = -1,
793 .svhs = 1, /* was: 4 */
794 .gpiomask = 0,
795 .muxsel = { 2, 3, 1, 0, 0},
796 .audiomux = { 0 },
797 .needs_tvaudio = 1,
798 .tuner_type = -1,
799 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800800 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800801 .muxsel_hook = PXC200_muxsel,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800803 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800804 [BTTV_BOARD_FLYVIDEO_98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800805 .name = "Lifeview FlyVideo 98 LR50",
806 .video_inputs = 4,
807 .audio_inputs = 1,
808 .tuner = 0,
809 .svhs = 2,
810 .gpiomask = 0x1800, /* 0x8dfe00 */
811 .muxsel = { 2, 3, 1, 1},
812 .audiomux = { 0, 0x0800, 0x1000, 0x1000, 0x1800, 0 },
813 .pll = PLL_28,
814 .tuner_type = -1,
815 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800816 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800817 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800818 [BTTV_BOARD_IPROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800819 .name = "Formac iProTV, Formac ProTV I (bt848)",
820 .video_inputs = 4,
821 .audio_inputs = 1,
822 .tuner = 0,
823 .svhs = 3,
824 .gpiomask = 1,
825 .muxsel = { 2, 3, 1, 1},
826 .audiomux = { 1, 0, 0, 0, 0 },
827 .pll = PLL_28,
828 .tuner_type = TUNER_PHILIPS_PAL,
829 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800830 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800831 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700832
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800833 /* ---- card 0x20 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800834 [BTTV_BOARD_INTEL_C_S_PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800835 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
836 .video_inputs = 4,
837 .audio_inputs = 0,
838 .tuner = -1,
839 .svhs = 2,
840 .gpiomask = 0,
841 .muxsel = { 2, 3, 1, 1},
842 .audiomux = { 0 },
843 .needs_tvaudio = 0,
844 .tuner_type = 4,
845 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800846 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800847 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800848 [BTTV_BOARD_TERRATVALUE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800849 .name = "Terratec TerraTValue Version Bt878",
850 .video_inputs = 3,
851 .audio_inputs = 1,
852 .tuner = 0,
853 .svhs = 2,
854 .gpiomask = 0xffff00,
855 .muxsel = { 2, 3, 1, 1},
856 .audiomux = { 0x500, 0, 0x300, 0x900, 0x900},
857 .needs_tvaudio = 1,
858 .pll = PLL_28,
859 .tuner_type = TUNER_PHILIPS_PAL,
860 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800861 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800862 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800863 [BTTV_BOARD_WINFAST2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800864 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
865 .video_inputs = 4,
866 .audio_inputs = 1,
867 .tuner = 0,
868 .svhs = 2,
869 .muxsel = { 2, 3, 1, 1, 0}, /* TV, CVid, SVid, CVid over SVid connector */
870 #if 0
871 .gpiomask = 0xc33000,
872 .audiomux = { 0x422000,0x1000,0x0000,0x620000,0x800000 },
873 #else
874 /* Alexander Varakin <avarakin@hotmail.com> [stereo version] */
875 .gpiomask = 0xb33000,
876 .audiomux = { 0x122000,0x1000,0x0000,0x620000,0x800000 },
877 #endif
878 /* Audio Routing for "WinFast 2000 XP" (no tv stereo !)
879 gpio23 -- hef4052:nEnable (0x800000)
880 gpio12 -- hef4052:A1
881 gpio13 -- hef4052:A0
882 0x0000: external audio
883 0x1000: FM
884 0x2000: TV
885 0x3000: n.c.
886 Note: There exists another variant "Winfast 2000" with tv stereo !?
887 Note: eeprom only contains FF and pci subsystem id 107d:6606
888 */
889 .needs_tvaudio = 0,
890 .pll = PLL_28,
891 .has_radio = 1,
892 .tuner_type = 5, /* default for now, gpio reads BFFF06 for Pal bg+dk */
893 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800894 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800895 .audio_hook = winfast2000_audio,
896 .has_remote = 1,
897 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800898 [BTTV_BOARD_CHRONOS_VS2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800899 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
900 .video_inputs = 4,
901 .audio_inputs = 3,
902 .tuner = 0,
903 .svhs = 2,
904 .gpiomask = 0x1800,
905 .muxsel = { 2, 3, 1, 1},
906 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800},
907 .pll = PLL_28,
908 .tuner_type = -1,
909 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800910 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800911 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700912
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800913 /* ---- card 0x24 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800914 [BTTV_BOARD_TYPHOON_TVIEW] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800915 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
916 .video_inputs = 4,
917 .audio_inputs = 3,
918 .tuner = 0,
919 .svhs = 2,
920 .gpiomask = 0x1800,
921 .muxsel = { 2, 3, 1, 1},
922 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
923 .pll = PLL_28,
924 .tuner_type = -1,
925 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800926 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800927 .has_radio = 1,
928 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800929 [BTTV_BOARD_PXELVWPLTVPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800930 .name = "Prolink PixelView PlayTV pro",
931 .video_inputs = 3,
932 .audio_inputs = 1,
933 .tuner = 0,
934 .svhs = 2,
935 .gpiomask = 0xff,
936 .muxsel = { 2, 3, 1, 1 },
937 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
938 .no_msp34xx = 1,
939 .pll = PLL_28,
940 .tuner_type = -1,
941 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800942 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800943 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800944 [BTTV_BOARD_MAGICTVIEW063] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800945 .name = "Askey CPH06X TView99",
946 .video_inputs = 4,
947 .audio_inputs = 1,
948 .tuner = 0,
949 .svhs = 2,
950 .gpiomask = 0x551e00,
951 .muxsel = { 2, 3, 1, 0},
952 .audiomux = { 0x551400, 0x551200, 0, 0, 0x551c00, 0x551200 },
953 .needs_tvaudio = 1,
954 .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_remote = 1,
959 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800960 [BTTV_BOARD_PINNACLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800961 .name = "Pinnacle PCTV Studio/Rave",
962 .video_inputs = 3,
963 .audio_inputs = 1,
964 .tuner = 0,
965 .svhs = 2,
966 .gpiomask = 0x03000F,
967 .muxsel = { 2, 3, 1, 1},
968 .audiomux = { 2, 0xd0001, 0, 0, 1},
969 .needs_tvaudio = 0,
970 .pll = PLL_28,
971 .tuner_type = -1,
972 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -0800973 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800974 },
975
976 /* ---- card 0x28 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800977 [BTTV_BOARD_STB2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800978 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
979 .video_inputs = 3,
980 .audio_inputs = 1,
981 .tuner = 0,
982 .svhs = 2,
983 .gpiomask = 7,
984 .muxsel = { 2, 3, 1, 1},
985 .audiomux = { 4, 0, 2, 3, 1},
986 .no_msp34xx = 1,
987 .needs_tvaudio = 1,
988 .tuner_type = TUNER_PHILIPS_NTSC,
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 .pll = PLL_28,
992 .has_radio = 1,
993 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -0800994 [BTTV_BOARD_AVPHONE98] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -0800995 .name = "AVerMedia TVPhone 98",
996 .video_inputs = 3,
997 .audio_inputs = 4,
998 .tuner = 0,
999 .svhs = 2,
1000 .gpiomask = 15,
1001 .muxsel = { 2, 3, 1, 1},
1002 .audiomux = { 13, 4, 11, 7, 0, 0},
1003 .needs_tvaudio = 1,
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 .has_radio = 1,
1009 .audio_hook = avermedia_tvphone_audio,
1010 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001011 [BTTV_BOARD_PV951] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001012 .name = "ProVideo PV951", /* pic16c54 */
1013 .video_inputs = 3,
1014 .audio_inputs = 1,
1015 .tuner = 0,
1016 .svhs = 2,
1017 .gpiomask = 0,
1018 .muxsel = { 2, 3, 1, 1},
1019 .audiomux = { 0, 0, 0, 0, 0},
1020 .needs_tvaudio = 1,
1021 .no_msp34xx = 1,
1022 .pll = PLL_28,
1023 .tuner_type = 1,
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 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001027 [BTTV_BOARD_ONAIR_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001028 .name = "Little OnAir TV",
1029 .video_inputs = 3,
1030 .audio_inputs = 1,
1031 .tuner = 0,
1032 .svhs = 2,
1033 .gpiomask = 0xe00b,
1034 .muxsel = {2, 3, 1, 1},
1035 .audiomux = {0xff9ff6, 0xff9ff6, 0xff1ff7, 0, 0xff3ffc},
1036 .no_msp34xx = 1,
1037 .tuner_type = -1,
1038 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001039 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001040 },
1041
1042 /* ---- card 0x2c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001043 [BTTV_BOARD_SIGMA_TVII_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001044 .name = "Sigma TVII-FM",
1045 .video_inputs = 2,
1046 .audio_inputs = 1,
1047 .tuner = 0,
1048 .svhs = -1,
1049 .gpiomask = 3,
1050 .muxsel = {2, 3, 1, 1},
1051 .audiomux = {1, 1, 0, 2, 3},
1052 .no_msp34xx = 1,
1053 .pll = PLL_NONE,
1054 .tuner_type = -1,
1055 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001056 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001057 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001058 [BTTV_BOARD_MATRIX_VISION2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001059 .name = "MATRIX-Vision MV-Delta 2",
1060 .video_inputs = 5,
1061 .audio_inputs = 1,
1062 .tuner = -1,
1063 .svhs = 3,
1064 .gpiomask = 0,
1065 .muxsel = { 2, 3, 1, 0, 0},
1066 .audiomux = {0 },
1067 .no_msp34xx = 1,
1068 .pll = PLL_28,
1069 .tuner_type = -1,
1070 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001071 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001072 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001073 [BTTV_BOARD_ZOLTRIX_GENIE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001074 .name = "Zoltrix Genie TV/FM",
1075 .video_inputs = 3,
1076 .audio_inputs = 1,
1077 .tuner = 0,
1078 .svhs = 2,
1079 .gpiomask = 0xbcf03f,
1080 .muxsel = { 2, 3, 1, 1},
1081 .audiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0, 0xbcb03f},
1082 .no_msp34xx = 1,
1083 .pll = PLL_28,
1084 .tuner_type = 21,
1085 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001086 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001087 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001088 [BTTV_BOARD_TERRATVRADIO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001089 .name = "Terratec TV/Radio+",
1090 .video_inputs = 3,
1091 .audio_inputs = 1,
1092 .tuner = 0,
1093 .svhs = 2,
1094 .gpiomask = 0x70000,
1095 .muxsel = { 2, 3, 1, 1},
1096 .audiomux = { 0x20000, 0x30000, 0x10000, 0, 0x40000, 0x20000 },
1097 .needs_tvaudio = 1,
1098 .no_msp34xx = 1,
1099 .pll = PLL_35,
1100 .tuner_type = 1,
1101 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001102 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001103 .has_radio = 1,
1104 },
1105
1106 /* ---- card 0x30 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001107 [BTTV_BOARD_DYNALINK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001108 .name = "Askey CPH03x/ Dynalink Magic TView",
1109 .video_inputs = 3,
1110 .audio_inputs = 1,
1111 .tuner = 0,
1112 .svhs = 2,
1113 .gpiomask = 15,
1114 .muxsel = { 2, 3, 1, 1},
1115 .audiomux = {2,0,0,0,1},
1116 .needs_tvaudio = 1,
1117 .pll = PLL_28,
1118 .tuner_type = -1,
1119 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001120 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001121 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001122 [BTTV_BOARD_GVBCTV3PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001123 .name = "IODATA GV-BCTV3/PCI",
1124 .video_inputs = 3,
1125 .audio_inputs = 1,
1126 .tuner = 0,
1127 .svhs = 2,
1128 .gpiomask = 0x010f00,
1129 .muxsel = {2, 3, 0, 0},
1130 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1131 .no_msp34xx = 1,
1132 .pll = PLL_28,
1133 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1134 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001135 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001136 .audio_hook = gvbctv3pci_audio,
1137 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001138 [BTTV_BOARD_PXELVWPLTVPAK] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001139 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1140 .video_inputs = 5,
1141 .audio_inputs = 1,
1142 .tuner = 0,
1143 .svhs = 3,
1144 .gpiomask = 0xAA0000,
1145 .muxsel = { 2,3,1,1,-1 },
1146 .digital_mode = DIGITAL_MODE_CAMERA,
1147 .audiomux = { 0x20000, 0, 0x80000, 0x80000, 0xa8000, 0x46000 },
1148 .no_msp34xx = 1,
1149 .pll = PLL_28,
1150 .tuner_type = TUNER_PHILIPS_PAL_I,
1151 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001152 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001153 .has_remote = 1,
1154 /* GPIO wiring: (different from Rev.4C !)
1155 GPIO17: U4.A0 (first hef4052bt)
1156 GPIO19: U4.A1
1157 GPIO20: U5.A1 (second hef4052bt)
1158 GPIO21: U4.nEN
1159 GPIO22: BT832 Reset Line
1160 GPIO23: A5,A0, U5,nEN
1161 Note: At i2c=0x8a is a Bt832 chip, which changes to 0x88 after being reset via GPIO22
1162 */
1163 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001164 [BTTV_BOARD_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001165 .name = "Eagle Wireless Capricorn2 (bt878A)",
1166 .video_inputs = 4,
1167 .audio_inputs = 1,
1168 .tuner = 0,
1169 .svhs = 2,
1170 .gpiomask = 7,
1171 .muxsel = { 2, 0, 1, 1},
1172 .audiomux = { 0, 1, 2, 3, 4},
1173 .pll = PLL_28,
1174 .tuner_type = -1 /* TUNER_ALPS_TMDH2_NTSC */,
1175 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001176 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001177 },
1178
1179 /* ---- card 0x34 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001180 [BTTV_BOARD_PINNACLEPRO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001181 /* David Härdeman <david@2gen.com> */
1182 .name = "Pinnacle PCTV Studio Pro",
1183 .video_inputs = 4,
1184 .audio_inputs = 1,
1185 .tuner = 0,
1186 .svhs = 3,
1187 .gpiomask = 0x03000F,
1188 .muxsel = { 2, 3, 1, 1},
1189 .audiomux = { 1, 0xd0001, 0, 0, 10},
1190 /* sound path (5 sources):
1191 MUX1 (mask 0x03), Enable Pin 0x08 (0=enable, 1=disable)
1192 0= ext. Audio IN
1193 1= from MUX2
1194 2= Mono TV sound from Tuner
1195 3= not connected
1196 MUX2 (mask 0x30000):
1197 0,2,3= from MSP34xx
1198 1= FM stereo Radio from Tuner */
1199 .needs_tvaudio = 0,
1200 .pll = PLL_28,
1201 .tuner_type = -1,
1202 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001203 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001204 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001205 [BTTV_BOARD_TVIEW_RDS_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001206 /* Claas Langbehn <claas@bigfoot.com>,
1207 Sven Grothklags <sven@upb.de> */
1208 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1209 .video_inputs = 4,
1210 .audio_inputs = 3,
1211 .tuner = 0,
1212 .svhs = 2,
1213 .gpiomask = 0x1c,
1214 .muxsel = { 2, 3, 1, 1},
1215 .audiomux = { 0, 0, 0x10, 8, 4 },
1216 .needs_tvaudio = 1,
1217 .pll = PLL_28,
1218 .tuner_type = TUNER_PHILIPS_PAL,
1219 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001220 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001221 .has_radio = 1,
1222 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001223 [BTTV_BOARD_LIFETEC_9415] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001224 /* Tim Röstermundt <rosterm@uni-muenster.de>
1225 in de.comp.os.unix.linux.hardware:
1226 options bttv card=0 pll=1 radio=1 gpiomask=0x18e0
1227 audiomux=0x44c71f,0x44d71f,0,0x44d71f,0x44dfff
1228 options tuner type=5 */
1229 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1230 .video_inputs = 4,
1231 .audio_inputs = 1,
1232 .tuner = 0,
1233 .svhs = 2,
1234 .gpiomask = 0x18e0,
1235 .muxsel = { 2, 3, 1, 1},
1236 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x18e0 },
1237 /* For cards with tda9820/tda9821:
1238 0x0000: Tuner normal stereo
1239 0x0080: Tuner A2 SAP (second audio program = Zweikanalton)
1240 0x0880: Tuner A2 stereo */
1241 .pll = PLL_28,
1242 .tuner_type = -1,
1243 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001244 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001245 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001246 [BTTV_BOARD_BESTBUY_EASYTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001247 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1248 old Easy TV BT848 version (model CPH031) */
1249 .name = "Askey CPH031/ BESTBUY Easy TV",
1250 .video_inputs = 4,
1251 .audio_inputs = 1,
1252 .tuner = 0,
1253 .svhs = 2,
1254 .gpiomask = 0xF,
1255 .muxsel = { 2, 3, 1, 0},
1256 .audiomux = { 2, 0, 0, 0, 10},
1257 .needs_tvaudio = 0,
1258 .pll = PLL_28,
1259 .tuner_type = TUNER_TEMIC_PAL,
1260 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001261 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001262 },
1263
1264 /* ---- card 0x38 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001265 [BTTV_BOARD_FLYVIDEO_98FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001266 /* Gordon Heydon <gjheydon@bigfoot.com ('98) */
1267 .name = "Lifeview FlyVideo 98FM LR50",
1268 .video_inputs = 4,
1269 .audio_inputs = 3,
1270 .tuner = 0,
1271 .svhs = 2,
1272 .gpiomask = 0x1800,
1273 .muxsel = { 2, 3, 1, 1},
1274 .audiomux = { 0, 0x800, 0x1000, 0x1000, 0x1800, 0 },
1275 .pll = PLL_28,
1276 .tuner_type = 5,
1277 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001278 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001279 },
1280 /* This is the ultimate cheapo capture card
1281 * just a BT848A on a small PCB!
1282 * Steve Hosgood <steve@equiinet.com> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001283 [BTTV_BOARD_GRANDTEC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001284 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1285 .video_inputs = 2,
1286 .audio_inputs = 0,
1287 .tuner = -1,
1288 .svhs = 1,
1289 .gpiomask = 0,
1290 .muxsel = { 3, 1 },
1291 .audiomux = { 0 },
1292 .needs_tvaudio = 0,
1293 .no_msp34xx = 1,
1294 .pll = PLL_35,
1295 .tuner_type = -1,
1296 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001297 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001298 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001299 [BTTV_BOARD_ASKEY_CPH060] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001300 /* Daniel Herrington <daniel.herrington@home.com> */
1301 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1302 .video_inputs = 3,
1303 .audio_inputs = 1,
1304 .tuner = 0,
1305 .svhs = 2,
1306 .gpiomask = 0xe00,
1307 .muxsel = { 2, 3, 1, 1},
1308 .audiomux = { 0x400, 0x400, 0x400, 0x400, 0x800, 0x400 },
1309 .needs_tvaudio = 1,
1310 .pll = PLL_28,
1311 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1312 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001313 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001314 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001315 [BTTV_BOARD_ASKEY_CPH03X] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001316 /* Matti Mottus <mottus@physic.ut.ee> */
1317 .name = "Askey CPH03x TV Capturer",
1318 .video_inputs = 4,
1319 .audio_inputs = 1,
1320 .tuner = 0,
1321 .svhs = 2,
1322 .gpiomask = 0x03000F,
1323 .muxsel = { 2, 3, 1, 0},
1324 .audiomux = { 2,0,0,0,1 },
1325 .pll = PLL_28,
1326 .tuner_type = 0,
1327 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001328 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001329 },
1330
1331 /* ---- card 0x3c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001332 [BTTV_BOARD_MM100PCTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001333 /* Philip Blundell <philb@gnu.org> */
1334 .name = "Modular Technology MM100PCTV",
1335 .video_inputs = 2,
1336 .audio_inputs = 2,
1337 .tuner = 0,
1338 .svhs = -1,
1339 .gpiomask = 11,
1340 .muxsel = { 2, 3, 1, 1},
1341 .audiomux = { 2, 0, 0, 1, 8},
1342 .pll = PLL_35,
1343 .tuner_type = TUNER_TEMIC_PAL,
1344 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001345 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001346 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001347 [BTTV_BOARD_GMV1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001348 /* Adrian Cox <adrian@humboldt.co.uk */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001349 .name = "AG Electronics GMV1",
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001350 .video_inputs = 2,
1351 .audio_inputs = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001352 .tuner = -1,
1353 .svhs = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001354 .gpiomask = 0xF,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001355 .muxsel = { 2, 2},
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001356 .audiomux = { },
1357 .no_msp34xx = 1,
1358 .needs_tvaudio = 0,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08001359 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001360 .tuner_type = -1,
1361 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001362 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001363 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001364 [BTTV_BOARD_BESTBUY_EASYTV2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001365 /* Miguel Angel Alvarez <maacruz@navegalia.com>
1366 new Easy TV BT878 version (model CPH061)
1367 special thanks to Informatica Mieres for providing the card */
1368 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1369 .video_inputs = 3,
1370 .audio_inputs = 2,
1371 .tuner = 0,
1372 .svhs = 2,
1373 .gpiomask = 0xFF,
1374 .muxsel = { 2, 3, 1, 0},
1375 .audiomux = { 1, 0, 4, 4, 9},
1376 .needs_tvaudio = 0,
1377 .pll = PLL_28,
1378 .tuner_type = TUNER_PHILIPS_PAL,
1379 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001380 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001381 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001382 [BTTV_BOARD_ATI_TVWONDER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001383 /* Lukas Gebauer <geby@volny.cz> */
1384 .name = "ATI TV-Wonder",
1385 .video_inputs = 3,
1386 .audio_inputs = 1,
1387 .tuner = 0,
1388 .svhs = 2,
1389 .gpiomask = 0xf03f,
1390 .muxsel = { 2, 3, 1, 0 },
1391 .audiomux = { 0xbffe, 0, 0xbfff, 0, 0xbffe},
1392 .pll = PLL_28,
1393 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_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 },
1397
1398 /* ---- card 0x40 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001399 [BTTV_BOARD_ATI_TVWONDERVE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001400 /* Lukas Gebauer <geby@volny.cz> */
1401 .name = "ATI TV-Wonder VE",
1402 .video_inputs = 2,
1403 .audio_inputs = 1,
1404 .tuner = 0,
1405 .svhs = -1,
1406 .gpiomask = 1,
1407 .muxsel = { 2, 3, 0, 1},
1408 .audiomux = { 0, 0, 1, 0, 0},
1409 .no_msp34xx = 1,
1410 .pll = PLL_28,
1411 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1412 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001413 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001414 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001415 [BTTV_BOARD_FLYVIDEO2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001416 /* DeeJay <deejay@westel900.net (2000S) */
1417 .name = "Lifeview FlyVideo 2000S LR90",
1418 .video_inputs = 3,
1419 .audio_inputs = 3,
1420 .tuner = 0,
1421 .svhs = 2,
1422 .gpiomask = 0x18e0,
1423 .muxsel = { 2, 3, 0, 1},
1424 /* Radio changed from 1e80 to 0x800 to make
1425 FlyVideo2000S in .hu happy (gm)*/
1426 /* -dk-???: set mute=0x1800 for tda9874h daughterboard */
1427 .audiomux = { 0x0000,0x0800,0x1000,0x1000,0x1800, 0x1080 },
1428 .audio_hook = fv2000s_audio,
1429 .no_msp34xx = 1,
1430 .no_tda9875 = 1,
1431 .needs_tvaudio = 1,
1432 .pll = PLL_28,
1433 .tuner_type = 5,
1434 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001435 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001436 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001437 [BTTV_BOARD_TERRATVALUER] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001438 .name = "Terratec TValueRadio",
1439 .video_inputs = 3,
1440 .audio_inputs = 1,
1441 .tuner = 0,
1442 .svhs = 2,
1443 .gpiomask = 0xffff00,
1444 .muxsel = { 2, 3, 1, 1},
1445 .audiomux = { 0x500, 0x500, 0x300, 0x900, 0x900},
1446 .needs_tvaudio = 1,
1447 .pll = PLL_28,
1448 .tuner_type = TUNER_PHILIPS_PAL,
1449 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001450 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001451 .has_radio = 1,
1452 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001453 [BTTV_BOARD_GVBCTV4PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001454 /* TANAKA Kei <peg00625@nifty.com> */
1455 .name = "IODATA GV-BCTV4/PCI",
1456 .video_inputs = 3,
1457 .audio_inputs = 1,
1458 .tuner = 0,
1459 .svhs = 2,
1460 .gpiomask = 0x010f00,
1461 .muxsel = {2, 3, 0, 0},
1462 .audiomux = {0x10000, 0, 0x10000, 0, 0, 0},
1463 .no_msp34xx = 1,
1464 .pll = PLL_28,
1465 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1466 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001467 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001468 .audio_hook = gvbctv3pci_audio,
1469 },
1470
1471 /* ---- card 0x44 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001472 [BTTV_BOARD_VOODOOTV_FM] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001473 .name = "3Dfx VoodooTV FM (Euro), VoodooTV 200 (USA)",
1474 /* try "insmod msp3400 simple=0" if you have
1475 * sound problems with this card. */
1476 .video_inputs = 4,
1477 .audio_inputs = 1,
1478 .tuner = 0,
1479 .svhs = -1,
1480 .gpiomask = 0x4f8a00,
1481 /* 0x100000: 1=MSP enabled (0=disable again)
1482 * 0x010000: Connected to "S0" on tda9880 (0=Pal/BG, 1=NTSC) */
1483 .audiomux = {0x947fff, 0x987fff,0x947fff,0x947fff, 0x947fff},
1484 /* tvtuner, radio, external,internal, mute, stereo
1485 * tuner, Composit, SVid, Composit-on-Svid-adapter */
1486 .muxsel = { 2, 3 ,0 ,1},
1487 .tuner_type = TUNER_MT2032,
1488 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001489 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001490 .pll = PLL_28,
1491 .has_radio = 1,
1492 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001493 [BTTV_BOARD_AIMMS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001494 /* Philip Blundell <pb@nexus.co.uk> */
1495 .name = "Active Imaging AIMMS",
1496 .video_inputs = 1,
1497 .audio_inputs = 0,
1498 .tuner = -1,
1499 .tuner_type = -1,
1500 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001501 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001502 .pll = PLL_28,
1503 .muxsel = { 2 },
1504 .gpiomask = 0
1505 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001506 [BTTV_BOARD_PV_BT878P_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001507 /* Tomasz Pyra <hellfire@sedez.iq.pl> */
1508 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1509 .video_inputs = 3,
1510 .audio_inputs = 4,
1511 .tuner = 0,
1512 .svhs = 2,
1513 .gpiomask = 15,
1514 .muxsel = { 2, 3, 1, 1},
1515 .audiomux = { 0, 0, 11, 7, 13, 0}, /* TV and Radio with same GPIO ! */
1516 .needs_tvaudio = 1,
1517 .pll = PLL_28,
1518 .tuner_type = 25,
1519 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001520 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001521 .has_remote = 1,
1522 /* GPIO wiring:
1523 GPIO0: U4.A0 (hef4052bt)
1524 GPIO1: U4.A1
1525 GPIO2: U4.A1 (second hef4052bt)
1526 GPIO3: U4.nEN, U5.A0, A5.nEN
1527 GPIO8-15: vrd866b ?
1528 */
1529 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001530 [BTTV_BOARD_FLYVIDEO98EZ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001531 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1532 .video_inputs = 4,
1533 .audio_inputs = 0,
1534 .tuner = -1,
1535 .svhs = 2,
1536 .muxsel = { 2, 3, 1, 1}, /* AV1, AV2, SVHS, CVid adapter on SVHS */
1537 .pll = PLL_28,
1538 .no_msp34xx = 1,
1539 .tuner_type = UNSET,
1540 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001541 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001542 },
1543
1544 /* ---- card 0x48 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001545 [BTTV_BOARD_PV_BT878P_9B] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001546 /* Dariusz Kowalewski <darekk@automex.pl> */
1547 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1548 .video_inputs = 4,
1549 .audio_inputs = 1,
1550 .tuner = 0,
1551 .svhs = 2,
1552 .gpiomask = 0x3f,
1553 .muxsel = { 2, 3, 1, 1 },
1554 .audiomux = { 0x01, 0x00, 0x03, 0x03, 0x09, 0x02 },
1555 .needs_tvaudio = 1,
1556 .no_msp34xx = 1,
1557 .no_tda9875 = 1,
1558 .pll = PLL_28,
1559 .tuner_type = 5,
1560 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001561 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001562 .audio_hook = pvbt878p9b_audio, /* Note: not all cards have stereo */
1563 .has_radio = 1, /* Note: not all cards have radio */
1564 .has_remote = 1,
1565 /* GPIO wiring:
1566 GPIO0: A0 hef4052
1567 GPIO1: A1 hef4052
1568 GPIO3: nEN hef4052
1569 GPIO8-15: vrd866b
1570 GPIO20,22,23: R30,R29,R28
1571 */
1572 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001573 [BTTV_BOARD_SENSORAY311] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001574 /* Clay Kunz <ckunz@mail.arc.nasa.gov> */
1575 /* you must jumper JP5 for the card to work */
1576 .name = "Sensoray 311",
1577 .video_inputs = 5,
1578 .audio_inputs = 0,
1579 .tuner = -1,
1580 .svhs = 4,
1581 .gpiomask = 0,
1582 .muxsel = { 2, 3, 1, 0, 0},
1583 .audiomux = { 0 },
1584 .needs_tvaudio = 0,
1585 .tuner_type = -1,
1586 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001587 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001588 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001589 [BTTV_BOARD_RV605] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001590 /* Miguel Freitas <miguel@cetuc.puc-rio.br> */
1591 .name = "RemoteVision MX (RV605)",
1592 .video_inputs = 16,
1593 .audio_inputs = 0,
1594 .tuner = -1,
1595 .svhs = -1,
1596 .gpiomask = 0x00,
1597 .gpiomask2 = 0x07ff,
1598 .muxsel = { 0x33, 0x13, 0x23, 0x43, 0xf3, 0x73, 0xe3, 0x03,
1599 0xd3, 0xb3, 0xc3, 0x63, 0x93, 0x53, 0x83, 0xa3 },
1600 .no_msp34xx = 1,
1601 .no_tda9875 = 1,
1602 .tuner_type = -1,
1603 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001604 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001605 .muxsel_hook = rv605_muxsel,
1606 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001607 [BTTV_BOARD_POWERCLR_MTV878] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001608 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1609 .video_inputs = 3,
1610 .audio_inputs = 2,
1611 .tuner = 0,
1612 .svhs = 2,
1613 .gpiomask = 0x1C800F, /* Bit0-2: Audio select, 8-12:remote control 14:remote valid 15:remote reset */
1614 .muxsel = { 2, 1, 1, },
1615 .audiomux = { 0, 1, 2, 2, 4 },
1616 .needs_tvaudio = 0,
1617 .tuner_type = TUNER_PHILIPS_PAL,
1618 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001619 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001620 .pll = PLL_28,
1621 .has_radio = 1,
1622 },
1623
1624 /* ---- card 0x4c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001625 [BTTV_BOARD_WINDVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001626 /* Masaki Suzuki <masaki@btree.org> */
1627 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1628 .video_inputs = 3,
1629 .audio_inputs = 1,
1630 .tuner = 0,
1631 .svhs = 2,
1632 .gpiomask = 0x140007,
1633 .muxsel = { 2, 3, 1, 1 },
1634 .audiomux = { 0, 1, 2, 3, 4, 0 },
1635 .tuner_type = TUNER_PHILIPS_NTSC,
1636 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001637 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001638 .audio_hook = windvr_audio,
1639 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001640 [BTTV_BOARD_GRANDTEC_MULTI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001641 .name = "GrandTec Multi Capture Card (Bt878)",
1642 .video_inputs = 4,
1643 .audio_inputs = 0,
1644 .tuner = -1,
1645 .svhs = -1,
1646 .gpiomask = 0,
1647 .muxsel = { 2, 3, 1, 0 },
1648 .audiomux = { 0 },
1649 .needs_tvaudio = 0,
1650 .no_msp34xx = 1,
1651 .pll = PLL_28,
1652 .tuner_type = -1,
1653 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001654 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001655 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001656 [BTTV_BOARD_KWORLD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001657 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1658 .video_inputs = 4,
1659 .audio_inputs = 3,
1660 .tuner = 0,
1661 .svhs = 2,
1662 .gpiomask = 7,
1663 .muxsel = { 2, 3, 1, 1 }, /* Tuner, SVid, SVHS, SVid to SVHS connector */
1664 .audiomux = { 0 ,0 ,4, 4,4,4},/* Yes, this tuner uses the same audio output for TV and FM radio!
1665 * This card lacks external Audio In, so we mute it on Ext. & Int.
1666 * The PCB can take a sbx1637/sbx1673, wiring unknown.
1667 * This card lacks PCI subsystem ID, sigh.
1668 * audiomux=1: lower volume, 2+3: mute
1669 * btwincap uses 0x80000/0x80003
1670 */
1671 .needs_tvaudio = 0,
1672 .no_msp34xx = 1,
1673 .pll = PLL_28,
1674 .tuner_type = 5,
1675 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001676 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001677 /* Samsung TCPA9095PC27A (BG+DK), philips compatible, w/FM, stereo and
1678 radio signal strength indicators work fine. */
1679 .has_radio = 1,
1680 /* GPIO Info:
1681 GPIO0,1: HEF4052 A0,A1
1682 GPIO2: HEF4052 nENABLE
1683 GPIO3-7: n.c.
1684 GPIO8-13: IRDC357 data0-5 (data6 n.c. ?) [chip not present on my card]
1685 GPIO14,15: ??
1686 GPIO16-21: n.c.
1687 GPIO22,23: ??
1688 ?? : mtu8b56ep microcontroller for IR (GPIO wiring unknown)*/
1689 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001690 [BTTV_BOARD_DSP_TCVIDEO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001691 /* Arthur Tetzlaff-Deas, DSP Design Ltd <software@dspdesign.com> */
1692 .name = "DSP Design TCVIDEO",
1693 .video_inputs = 4,
1694 .svhs = -1,
1695 .muxsel = { 2, 3, 1, 0},
1696 .pll = PLL_28,
1697 .tuner_type = -1,
1698 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001699 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001700 },
1701
1702 /* ---- card 0x50 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001703 [BTTV_BOARD_HAUPPAUGEPVR] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001704 .name = "Hauppauge WinTV PVR",
1705 .video_inputs = 4,
1706 .audio_inputs = 1,
1707 .tuner = 0,
1708 .svhs = 2,
1709 .muxsel = { 2, 0, 1, 1},
1710 .needs_tvaudio = 1,
1711 .pll = PLL_28,
1712 .tuner_type = -1,
1713 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001714 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001715
1716 .gpiomask = 7,
1717 .audiomux = {7},
1718 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001719 [BTTV_BOARD_GVBCTV5PCI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001720 .name = "IODATA GV-BCTV5/PCI",
1721 .video_inputs = 3,
1722 .audio_inputs = 1,
1723 .tuner = 0,
1724 .svhs = 2,
1725 .gpiomask = 0x0f0f80,
1726 .muxsel = {2, 3, 1, 0},
1727 .audiomux = {0x030000, 0x010000, 0, 0, 0x020000, 0},
1728 .no_msp34xx = 1,
1729 .pll = PLL_28,
1730 .tuner_type = TUNER_PHILIPS_NTSC_M,
1731 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001732 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001733 .audio_hook = gvbctv5pci_audio,
1734 .has_radio = 1,
1735 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001736 [BTTV_BOARD_OSPREY1x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001737 .name = "Osprey 100/150 (878)", /* 0x1(2|3)-45C6-C1 */
1738 .video_inputs = 4, /* id-inputs-clock */
1739 .audio_inputs = 0,
1740 .tuner = -1,
1741 .svhs = 3,
1742 .muxsel = { 3, 2, 0, 1 },
1743 .pll = PLL_28,
1744 .tuner_type = -1,
1745 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001746 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001747 .no_msp34xx = 1,
1748 .no_tda9875 = 1,
1749 .no_tda7432 = 1,
1750 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001751 [BTTV_BOARD_OSPREY1x0_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001752 .name = "Osprey 100/150 (848)", /* 0x04-54C0-C1 & older boards */
1753 .video_inputs = 3,
1754 .audio_inputs = 0,
1755 .tuner = -1,
1756 .svhs = 2,
1757 .muxsel = { 2, 3, 1 },
1758 .pll = PLL_28,
1759 .tuner_type = -1,
1760 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001761 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001762 .no_msp34xx = 1,
1763 .no_tda9875 = 1,
1764 .no_tda7432 = 1,
1765 },
1766
1767 /* ---- card 0x54 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001768 [BTTV_BOARD_OSPREY101_848] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001769 .name = "Osprey 101 (848)", /* 0x05-40C0-C1 */
1770 .video_inputs = 2,
1771 .audio_inputs = 0,
1772 .tuner = -1,
1773 .svhs = 1,
1774 .muxsel = { 3, 1 },
1775 .pll = PLL_28,
1776 .tuner_type = -1,
1777 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001778 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001779 .no_msp34xx = 1,
1780 .no_tda9875 = 1,
1781 .no_tda7432 = 1,
1782 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001783 [BTTV_BOARD_OSPREY1x1] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001784 .name = "Osprey 101/151", /* 0x1(4|5)-0004-C4 */
1785 .video_inputs = 1,
1786 .audio_inputs = 0,
1787 .tuner = -1,
1788 .svhs = -1,
1789 .muxsel = { 0 },
1790 .pll = PLL_28,
1791 .tuner_type = -1,
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 .no_msp34xx = 1,
1795 .no_tda9875 = 1,
1796 .no_tda7432 = 1,
1797 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001798 [BTTV_BOARD_OSPREY1x1_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001799 .name = "Osprey 101/151 w/ svid", /* 0x(16|17|20)-00C4-C1 */
1800 .video_inputs = 2,
1801 .audio_inputs = 0,
1802 .tuner = -1,
1803 .svhs = 1,
1804 .muxsel = { 0, 1 },
1805 .pll = PLL_28,
1806 .tuner_type = -1,
1807 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001808 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001809 .no_msp34xx = 1,
1810 .no_tda9875 = 1,
1811 .no_tda7432 = 1,
1812 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001813 [BTTV_BOARD_OSPREY2xx] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001814 .name = "Osprey 200/201/250/251", /* 0x1(8|9|E|F)-0004-C4 */
1815 .video_inputs = 1,
1816 .audio_inputs = 1,
1817 .tuner = -1,
1818 .svhs = -1,
1819 .muxsel = { 0 },
1820 .pll = PLL_28,
1821 .tuner_type = UNSET,
1822 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001823 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001824 .no_msp34xx = 1,
1825 .no_tda9875 = 1,
1826 .no_tda7432 = 1,
1827 },
1828
1829 /* ---- card 0x58 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001830 [BTTV_BOARD_OSPREY2x0_SVID] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001831 .name = "Osprey 200/250", /* 0x1(A|B)-00C4-C1 */
1832 .video_inputs = 2,
1833 .audio_inputs = 1,
1834 .tuner = -1,
1835 .svhs = 1,
1836 .muxsel = { 0, 1 },
1837 .pll = PLL_28,
1838 .tuner_type = UNSET,
1839 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001840 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001841 .no_msp34xx = 1,
1842 .no_tda9875 = 1,
1843 .no_tda7432 = 1,
1844 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001845 [BTTV_BOARD_OSPREY2x0] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001846 .name = "Osprey 210/220", /* 0x1(A|B)-04C0-C1 */
1847 .video_inputs = 2,
1848 .audio_inputs = 1,
1849 .tuner = -1,
1850 .svhs = 1,
1851 .muxsel = { 2, 3 },
1852 .pll = PLL_28,
1853 .tuner_type = UNSET,
1854 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001855 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001856 .no_msp34xx = 1,
1857 .no_tda9875 = 1,
1858 .no_tda7432 = 1,
1859 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001860 [BTTV_BOARD_OSPREY500] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001861 .name = "Osprey 500", /* 500 */
1862 .video_inputs = 2,
1863 .audio_inputs = 1,
1864 .tuner = -1,
1865 .svhs = 1,
1866 .muxsel = { 2, 3 },
1867 .pll = PLL_28,
1868 .tuner_type = -1,
1869 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001870 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001871 .no_msp34xx = 1,
1872 .no_tda9875 = 1,
1873 .no_tda7432 = 1,
1874 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001875 [BTTV_BOARD_OSPREY540] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001876 .name = "Osprey 540", /* 540 */
1877 .video_inputs = 4,
1878 .audio_inputs = 1,
1879 .tuner = -1,
1880 #if 0 /* TODO ... */
1881 .svhs = OSPREY540_SVID_ANALOG,
1882 .muxsel = { [OSPREY540_COMP_ANALOG] = 2,
1883 [OSPREY540_SVID_ANALOG] = 3, },
1884 #endif
1885 .pll = PLL_28,
1886 .tuner_type = -1,
1887 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001888 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001889 .no_msp34xx = 1,
1890 .no_tda9875 = 1,
1891 .no_tda7432 = 1,
1892 #if 0 /* TODO ... */
1893 .muxsel_hook = osprey_540_muxsel,
1894 .picture_hook = osprey_540_set_picture,
1895 #endif
1896 },
1897
1898 /* ---- card 0x5C ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001899 [BTTV_BOARD_OSPREY2000] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001900 .name = "Osprey 2000", /* 2000 */
1901 .video_inputs = 2,
1902 .audio_inputs = 1,
1903 .tuner = -1,
1904 .svhs = 1,
1905 .muxsel = { 2, 3 },
1906 .pll = PLL_28,
1907 .tuner_type = UNSET,
1908 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001909 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001910 .no_msp34xx = 1,
1911 .no_tda9875 = 1,
1912 .no_tda7432 = 1, /* must avoid, conflicts with the bt860 */
1913 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001914 [BTTV_BOARD_IDS_EAGLE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001915 /* M G Berberich <berberic@forwiss.uni-passau.de> */
1916 .name = "IDS Eagle",
1917 .video_inputs = 4,
1918 .audio_inputs = 0,
1919 .tuner = -1,
1920 .tuner_type = -1,
1921 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001922 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001923 .svhs = -1,
1924 .gpiomask = 0,
1925 .muxsel = { 0, 1, 2, 3 },
1926 .muxsel_hook = eagle_muxsel,
1927 .no_msp34xx = 1,
1928 .no_tda9875 = 1,
1929 .pll = PLL_28,
1930 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001931 [BTTV_BOARD_PINNACLESAT] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001932 .name = "Pinnacle PCTV Sat",
1933 .video_inputs = 2,
1934 .audio_inputs = 0,
1935 .svhs = 1,
1936 .tuner = -1,
1937 .tuner_type = -1,
1938 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001939 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001940 .no_msp34xx = 1,
1941 .no_tda9875 = 1,
1942 .no_tda7432 = 1,
1943 .muxsel = { 3, 0, 1, 2},
1944 .pll = PLL_28,
1945 .no_gpioirq = 1,
1946 .has_dvb = 1,
1947 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001948 [BTTV_BOARD_FORMAC_PROTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001949 .name = "Formac ProTV II (bt878)",
1950 .video_inputs = 4,
1951 .audio_inputs = 1,
1952 .tuner = 0,
1953 .svhs = 3,
1954 .gpiomask = 2,
1955 /* TV, Comp1, Composite over SVID con, SVID */
1956 .muxsel = { 2, 3, 1, 1},
1957 .audiomux = { 2, 2, 0, 0, 0 },
1958 .pll = PLL_28,
1959 .has_radio = 1,
1960 .tuner_type = TUNER_PHILIPS_PAL,
1961 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001962 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001963 /* sound routing:
1964 GPIO=0x00,0x01,0x03: mute (?)
1965 0x02: both TV and radio (tuner: FM1216/I)
1966 The card has onboard audio connectors labeled "cdrom" and "board",
1967 not soldered here, though unknown wiring.
1968 Card lacks: external audio in, pci subsystem id.
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07001969 */
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001970 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001971
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001972 /* ---- card 0x60 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001973 [BTTV_BOARD_MACHTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001974 .name = "MachTV",
1975 .video_inputs = 3,
1976 .audio_inputs = 1,
1977 .tuner = 0,
1978 .svhs = -1,
1979 .gpiomask = 7,
1980 .muxsel = { 2, 3, 1, 1},
1981 .audiomux = { 0, 1, 2, 3, 4},
1982 .needs_tvaudio = 1,
1983 .tuner_type = 5,
1984 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08001985 .radio_addr = ADDR_UNSET,
Michael Krufkycf583ac2005-11-08 21:37:03 -08001986 .pll = PLL_28,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001987 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08001988 [BTTV_BOARD_EURESYS_PICOLO] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08001989 .name = "Euresys Picolo",
1990 .video_inputs = 3,
1991 .audio_inputs = 0,
1992 .tuner = -1,
1993 .svhs = 2,
1994 .gpiomask = 0,
1995 .no_msp34xx = 1,
1996 .no_tda9875 = 1,
1997 .no_tda7432 = 1,
1998 .muxsel = { 2, 0, 1},
1999 .pll = PLL_28,
2000 .tuner_type = UNSET,
2001 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002002 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002003 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002004 [BTTV_BOARD_PV150] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002005 /* Luc Van Hoeylandt <luc@e-magic.be> */
2006 .name = "ProVideo PV150", /* 0x4f */
2007 .video_inputs = 2,
2008 .audio_inputs = 0,
2009 .tuner = -1,
2010 .svhs = -1,
2011 .gpiomask = 0,
2012 .muxsel = { 2, 3 },
2013 .audiomux = { 0 },
2014 .needs_tvaudio = 0,
2015 .no_msp34xx = 1,
2016 .pll = PLL_28,
2017 .tuner_type = UNSET,
2018 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002019 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002020 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002021 [BTTV_BOARD_AD_TVK503] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002022 /* Hiroshi Takekawa <sian@big.or.jp> */
2023 /* This card lacks subsystem ID */
2024 .name = "AD-TVK503", /* 0x63 */
2025 .video_inputs = 4,
2026 .audio_inputs = 1,
2027 .tuner = 0,
2028 .svhs = 2,
2029 .gpiomask = 0x001e8007,
2030 .muxsel = { 2, 3, 1, 0 },
2031 /* Tuner, Radio, external, internal, off, on */
2032 .audiomux = { 0x08, 0x0f, 0x0a, 0x08, 0x0f, 0x08 },
2033 .needs_tvaudio = 0,
2034 .no_msp34xx = 1,
2035 .pll = PLL_28,
2036 .tuner_type = 2,
2037 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002038 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002039 .audio_hook = adtvk503_audio,
2040 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002041
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002042 /* ---- card 0x64 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002043 [BTTV_BOARD_HERCULES_SM_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002044 .name = "Hercules Smart TV Stereo",
2045 .video_inputs = 4,
2046 .audio_inputs = 1,
2047 .tuner = 0,
2048 .svhs = 2,
2049 .gpiomask = 0x00,
2050 .muxsel = { 2, 3, 1, 1 },
2051 .needs_tvaudio = 1,
2052 .no_msp34xx = 1,
2053 .pll = PLL_28,
2054 .tuner_type = 5,
2055 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002056 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002057 /* Notes:
2058 - card lacks subsystem ID
2059 - stereo variant w/ daughter board with tda9874a @0xb0
2060 - Audio Routing:
2061 always from tda9874 independent of GPIO (?)
2062 external line in: unknown
2063 - Other chips: em78p156elp @ 0x96 (probably IR remote control)
2064 hef4053 (instead 4052) for unknown function
2065 */
2066 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002067 [BTTV_BOARD_PACETV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002068 .name = "Pace TV & Radio Card",
2069 .video_inputs = 4,
2070 .audio_inputs = 1,
2071 .tuner = 0,
2072 .svhs = 2,
2073 .muxsel = { 2, 3, 1, 1}, /* Tuner, CVid, SVid, CVid over SVid connector */
2074 .gpiomask = 0,
2075 .no_tda9875 = 1,
2076 .no_tda7432 = 1,
2077 .tuner_type = 1,
2078 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002079 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002080 .has_radio = 1,
2081 .pll = PLL_28,
2082 /* Bt878, Bt832, FI1246 tuner; no pci subsystem id
2083 only internal line out: (4pin header) RGGL
2084 Radio must be decoded by msp3410d (not routed through)*/
2085 /*
2086 .digital_mode = DIGITAL_MODE_CAMERA, todo!
2087 */
2088 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002089 [BTTV_BOARD_IVC200] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002090 /* Chris Willing <chris@vislab.usyd.edu.au> */
2091 .name = "IVC-200",
2092 .video_inputs = 1,
2093 .audio_inputs = 0,
2094 .tuner = -1,
2095 .tuner_type = -1,
2096 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002097 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002098 .svhs = -1,
2099 .gpiomask = 0xdf,
2100 .muxsel = { 2 },
2101 .pll = PLL_28,
2102 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002103 [BTTV_BOARD_XGUARD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002104 .name = "Grand X-Guard / Trust 814PCI",
2105 .video_inputs = 16,
2106 .audio_inputs = 0,
2107 .tuner = -1,
2108 .svhs = -1,
2109 .tuner_type = 4,
2110 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002111 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002112 .gpiomask2 = 0xff,
2113 .muxsel = { 2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0 },
2114 .muxsel_hook = xguard_muxsel,
2115 .no_msp34xx = 1,
2116 .no_tda9875 = 1,
2117 .no_tda7432 = 1,
2118 .pll = PLL_28,
2119 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002120
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002121 /* ---- card 0x68 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002122 [BTTV_BOARD_NEBULA_DIGITV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002123 .name = "Nebula Electronics DigiTV",
2124 .video_inputs = 1,
2125 .tuner = -1,
2126 .svhs = -1,
2127 .muxsel = { 2, 3, 1, 0},
2128 .no_msp34xx = 1,
2129 .no_tda9875 = 1,
2130 .no_tda7432 = 1,
2131 .pll = PLL_28,
2132 .tuner_type = -1,
2133 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002134 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002135 .has_dvb = 1,
2136 .no_gpioirq = 1,
2137 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002138 [BTTV_BOARD_PV143] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002139 /* Jorge Boncompte - DTI2 <jorge@dti2.net> */
2140 .name = "ProVideo PV143",
2141 .video_inputs = 4,
2142 .audio_inputs = 0,
2143 .tuner = -1,
2144 .svhs = -1,
2145 .gpiomask = 0,
2146 .muxsel = { 2, 3, 1, 0 },
2147 .audiomux = { 0 },
2148 .needs_tvaudio = 0,
2149 .no_msp34xx = 1,
2150 .pll = PLL_28,
2151 .tuner_type = -1,
2152 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002153 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002154 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002155 [BTTV_BOARD_VD009X1_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002156 /* M.Klahr@phytec.de */
2157 .name = "PHYTEC VD-009-X1 MiniDIN (bt878)",
2158 .video_inputs = 4,
2159 .audio_inputs = 0,
2160 .tuner = -1, /* card has no tuner */
2161 .svhs = 3,
2162 .gpiomask = 0x00,
2163 .muxsel = { 2, 3, 1, 0},
2164 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2165 .needs_tvaudio = 1,
2166 .pll = PLL_28,
2167 .tuner_type = -1,
2168 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002169 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002170 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002171 [BTTV_BOARD_VD009X1_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002172 .name = "PHYTEC VD-009-X1 Combi (bt878)",
2173 .video_inputs = 4,
2174 .audio_inputs = 0,
2175 .tuner = -1, /* card has no tuner */
2176 .svhs = 3,
2177 .gpiomask = 0x00,
2178 .muxsel = { 2, 3, 1, 1},
2179 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2180 .needs_tvaudio = 1,
2181 .pll = PLL_28,
2182 .tuner_type = -1,
2183 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002184 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002185 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002186
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002187 /* ---- card 0x6c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002188 [BTTV_BOARD_VD009_MINIDIN] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002189 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2190 .video_inputs = 10,
2191 .audio_inputs = 0,
2192 .tuner = -1, /* card has no tuner */
2193 .svhs = 9,
2194 .gpiomask = 0x00,
2195 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2196 via the upper nibble of muxsel. here: used for
2197 xternal video-mux */
2198 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x00 },
2199 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2200 .needs_tvaudio = 1,
2201 .pll = PLL_28,
2202 .tuner_type = -1,
2203 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002204 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002205 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002206 [BTTV_BOARD_VD009_COMBI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002207 .name = "PHYTEC VD-009 Combi (bt878)",
2208 .video_inputs = 10,
2209 .audio_inputs = 0,
2210 .tuner = -1, /* card has no tuner */
2211 .svhs = 9,
2212 .gpiomask = 0x00,
2213 .gpiomask2 = 0x03, /* gpiomask2 defines the bits used to switch audio
2214 via the upper nibble of muxsel. here: used for
2215 xternal video-mux */
2216 .muxsel = { 0x02, 0x12, 0x22, 0x32, 0x03, 0x13, 0x23, 0x33, 0x01, 0x01 },
2217 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2218 .needs_tvaudio = 1,
2219 .pll = PLL_28,
2220 .tuner_type = -1,
2221 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002222 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002223 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002224 [BTTV_BOARD_IVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002225 .name = "IVC-100",
2226 .video_inputs = 4,
2227 .audio_inputs = 0,
2228 .tuner = -1,
2229 .tuner_type = -1,
2230 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002231 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002232 .svhs = -1,
2233 .gpiomask = 0xdf,
2234 .muxsel = { 2, 3, 1, 0 },
2235 .pll = PLL_28,
2236 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002237 [BTTV_BOARD_IVC120] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002238 /* IVC-120G - Alan Garfield <alan@fromorbit.com> */
2239 .name = "IVC-120G",
2240 .video_inputs = 16,
2241 .audio_inputs = 0, /* card has no audio */
2242 .tuner = -1, /* card has no tuner */
2243 .tuner_type = -1,
2244 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002245 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002246 .svhs = -1, /* card has no svhs */
2247 .needs_tvaudio = 0,
2248 .no_msp34xx = 1,
2249 .no_tda9875 = 1,
2250 .no_tda7432 = 1,
2251 .gpiomask = 0x00,
2252 .muxsel = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
2253 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10 },
2254 .muxsel_hook = ivc120_muxsel,
2255 .pll = PLL_28,
2256 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002257
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002258 /* ---- card 0x70 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002259 [BTTV_BOARD_PC_HDTV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002260 .name = "pcHDTV HD-2000 TV",
2261 .video_inputs = 4,
2262 .audio_inputs = 1,
2263 .tuner = 0,
2264 .svhs = 2,
2265 .muxsel = { 2, 3, 1, 0},
2266 .tuner_type = TUNER_PHILIPS_ATSC,
2267 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002268 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002269 .has_dvb = 1,
2270 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002271 [BTTV_BOARD_TWINHAN_DST] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002272 .name = "Twinhan DST + clones",
2273 .no_msp34xx = 1,
2274 .no_tda9875 = 1,
2275 .no_tda7432 = 1,
2276 .tuner_type = TUNER_ABSENT,
2277 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002278 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002279 .no_video = 1,
2280 .has_dvb = 1,
2281 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002282 [BTTV_BOARD_WINFASTVC100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002283 .name = "Winfast VC100",
2284 .video_inputs = 3,
2285 .audio_inputs = 0,
2286 .svhs = 1,
2287 .tuner = -1,
2288 .muxsel = { 3, 1, 1, 3}, /* Vid In, SVid In, Vid over SVid in connector */
2289 .no_msp34xx = 1,
2290 .no_tda9875 = 1,
2291 .no_tda7432 = 1,
2292 .tuner_type = TUNER_ABSENT,
2293 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002294 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002295 .pll = PLL_28,
2296 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002297 [BTTV_BOARD_TEV560] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002298 .name = "Teppro TEV-560/InterVision IV-560",
2299 .video_inputs = 3,
2300 .audio_inputs = 1,
2301 .tuner = 0,
2302 .svhs = 2,
2303 .gpiomask = 3,
2304 .muxsel = { 2, 3, 1, 1},
2305 .audiomux = { 1, 1, 1, 1, 0},
2306 .needs_tvaudio = 1,
2307 .tuner_type = TUNER_PHILIPS_PAL,
2308 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002309 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002310 .pll = PLL_35,
2311 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002312
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002313 /* ---- card 0x74 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002314 [BTTV_BOARD_SIMUS_GVC1100] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002315 .name = "SIMUS GVC1100",
2316 .video_inputs = 4,
2317 .audio_inputs = 0,
2318 .tuner = -1,
2319 .svhs = -1,
2320 .tuner_type = -1,
2321 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002322 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002323 .pll = PLL_28,
2324 .muxsel = { 2, 2, 2, 2},
2325 .gpiomask = 0x3F,
2326 .muxsel_hook = gvc1100_muxsel,
2327 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002328 [BTTV_BOARD_NGSTV_PLUS] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002329 /* Carlos Silva r3pek@r3pek.homelinux.org || card 0x75 */
2330 .name = "NGS NGSTV+",
2331 .video_inputs = 3,
2332 .tuner = 0,
2333 .svhs = 2,
2334 .gpiomask = 0x008007,
2335 .muxsel = {2, 3, 0, 0},
2336 .audiomux = {0, 0, 0, 0, 0x000003, 0},
2337 .pll = PLL_28,
2338 .tuner_type = TUNER_PHILIPS_PAL,
2339 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002340 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002341 .has_remote = 1,
2342 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002343 [BTTV_BOARD_LMLBT4] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002344 /* http://linuxmedialabs.com */
2345 .name = "LMLBT4",
2346 .video_inputs = 4, /* IN1,IN2,IN3,IN4 */
2347 .audio_inputs = 0,
2348 .tuner = -1,
2349 .svhs = -1,
2350 .muxsel = { 2, 3, 1, 0 },
2351 .no_msp34xx = 1,
2352 .no_tda9875 = 1,
2353 .no_tda7432 = 1,
2354 .needs_tvaudio = 0,
2355 .tuner_type = -1,
2356 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002357 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002358 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002359 [BTTV_BOARD_TEKRAM_M205] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002360 /* Helmroos Harri <harri.helmroos@pp.inet.fi> */
2361 .name = "Tekram M205 PRO",
2362 .video_inputs = 3,
2363 .audio_inputs = 1,
2364 .tuner = 0,
2365 .tuner_type = TUNER_PHILIPS_PAL,
2366 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002367 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002368 .svhs = 2,
2369 .needs_tvaudio = 0,
2370 .gpiomask = 0x68,
2371 .muxsel = { 2, 3, 1},
2372 .audiomux = { 0x68, 0x68, 0x61, 0x61, 0x00 },
2373 .pll = PLL_28,
2374 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002375
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002376 /* ---- card 0x78 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002377 [BTTV_BOARD_CONTVFMI] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002378 /* Javier Cendan Ares <jcendan@lycos.es> */
2379 /* bt878 TV + FM without subsystem ID */
2380 .name = "Conceptronic CONTVFMi",
2381 .video_inputs = 3,
2382 .audio_inputs = 1,
2383 .tuner = 0,
2384 .svhs = 2,
2385 .gpiomask = 0x008007,
2386 .muxsel = { 2, 3, 1, 1 },
2387 .audiomux = { 0, 1, 2, 2, 3 },
2388 .needs_tvaudio = 0,
2389 .pll = PLL_28,
2390 .tuner_type = TUNER_PHILIPS_PAL,
2391 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002392 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002393 .has_remote = 1,
2394 .has_radio = 1,
2395 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002396 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002397 /*Eric DEBIEF <debief@telemsa.com>*/
2398 /*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 -08002399 /* 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 -08002400 /*0x79 in bttv.h*/
2401 .name = "Euresys Picolo Tetra",
2402 .video_inputs = 4,
2403 .audio_inputs = 0,
2404 .tuner = -1,
2405 .svhs = -1,
2406 .gpiomask = 0,
2407 .gpiomask2 = 0x3C<<16,/*Set the GPIO[18]->GPIO[21] as output pin.==> drive the video inputs through analog multiplexers*/
2408 .no_msp34xx = 1,
2409 .no_tda9875 = 1,
2410 .no_tda7432 = 1,
2411 .muxsel = {2,2,2,2},/*878A input is always MUX0, see above.*/
2412 .audiomux = { 0, 0, 0, 0, 0, 0 }, /* card has no audio */
2413 .pll = PLL_28,
2414 .needs_tvaudio = 0,
2415 .muxsel_hook = picolo_tetra_muxsel,/*Required as it doesn't follow the classic input selection policy*/
2416 .tuner_type = -1,
2417 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002418 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002419 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002420 [BTTV_BOARD_SPIRIT_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002421 /* Spirit TV Tuner from http://spiritmodems.com.au */
2422 /* Stafford Goodsell <surge@goliath.homeunix.org> */
2423 .name = "Spirit TV Tuner",
2424 .video_inputs = 3,
2425 .audio_inputs = 1,
2426 .tuner = 0,
2427 .svhs = 2,
2428 .gpiomask = 0x0000000f,
2429 .muxsel = { 2, 1, 1 },
2430 .audiomux = { 0x02, 0x00, 0x00, 0x00, 0x00},
2431 .tuner_type = TUNER_TEMIC_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 .no_msp34xx = 1,
2435 .no_tda9875 = 1,
2436 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002437 [BTTV_BOARD_AVDVBT_771] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002438 /* Wolfram Joost <wojo@frokaschwei.de> */
2439 .name = "AVerMedia AVerTV DVB-T 771",
2440 .video_inputs = 2,
2441 .svhs = 1,
2442 .tuner = -1,
2443 .tuner_type = TUNER_ABSENT,
2444 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002445 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002446 .muxsel = { 3 , 3 },
2447 .no_msp34xx = 1,
2448 .no_tda9875 = 1,
2449 .no_tda7432 = 1,
2450 .pll = PLL_28,
2451 .has_dvb = 1,
2452 .no_gpioirq = 1,
2453 .has_remote = 1,
2454 },
2455 /* ---- card 0x7c ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002456 [BTTV_BOARD_AVDVBT_761] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002457 /* Matt Jesson <dvb@jesson.eclipse.co.uk> */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002458 /* 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 -08002459 .name = "AverMedia AverTV DVB-T 761",
2460 .video_inputs = 2,
2461 .tuner = -1,
2462 .svhs = 1,
2463 .muxsel = { 3, 1, 2, 0}, /* Comp0, S-Video, ?, ? */
2464 .no_msp34xx = 1,
2465 .no_tda9875 = 1,
2466 .no_tda7432 = 1,
2467 .pll = PLL_28,
2468 .tuner_type = -1,
2469 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002470 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002471 .has_dvb = 1,
2472 .no_gpioirq = 1,
2473 .has_remote = 1,
2474 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002475 [BTTV_BOARD_MATRIX_VISIONSQ] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002476 /* andre.schwarz@matrix-vision.de */
2477 .name = "MATRIX Vision Sigma-SQ",
2478 .video_inputs = 16,
2479 .audio_inputs = 0,
2480 .tuner = -1,
2481 .svhs = -1,
2482 .gpiomask = 0x0,
2483 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2,
2484 3, 3, 3, 3, 3, 3, 3, 3 },
2485 .muxsel_hook = sigmaSQ_muxsel,
2486 .audiomux = { 0 },
2487 .no_msp34xx = 1,
2488 .pll = PLL_28,
2489 .tuner_type = -1,
2490 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002491 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002492 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002493 [BTTV_BOARD_MATRIX_VISIONSLC] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002494 /* andre.schwarz@matrix-vision.de */
2495 .name = "MATRIX Vision Sigma-SLC",
2496 .video_inputs = 4,
2497 .audio_inputs = 0,
2498 .tuner = -1,
2499 .svhs = -1,
2500 .gpiomask = 0x0,
2501 .muxsel = { 2, 2, 2, 2 },
2502 .muxsel_hook = sigmaSLC_muxsel,
2503 .audiomux = { 0 },
2504 .no_msp34xx = 1,
2505 .pll = PLL_28,
2506 .tuner_type = -1,
2507 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002508 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002509 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002510 /* BTTV_BOARD_APAC_VIEWCOMP */
2511 [BTTV_BOARD_APAC_VIEWCOMP] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002512 /* Attila Kondoros <attila.kondoros@chello.hu> */
2513 /* bt878 TV + FM 0x00000000 subsystem ID */
2514 .name = "APAC Viewcomp 878(AMAX)",
2515 .video_inputs = 2,
2516 .audio_inputs = 1,
2517 .tuner = 0,
2518 .svhs = -1,
2519 .gpiomask = 0xFF,
2520 .muxsel = { 2, 3, 1, 1},
2521 .audiomux = { 2, 0, 0, 0, 10},
2522 .needs_tvaudio = 0,
2523 .pll = PLL_28,
2524 .tuner_type = TUNER_PHILIPS_PAL,
2525 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002526 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002527 .has_remote = 1, /* miniremote works, see ir-kbd-gpio.c */
2528 .has_radio = 1, /* not every card has radio */
2529 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07002530
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002531 /* ---- card 0x80 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002532 [BTTV_BOARD_DVICO_DVBT_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002533 /* Chris Pascoe <c.pascoe@itee.uq.edu.au> */
2534 .name = "DViCO FusionHDTV DVB-T Lite",
2535 .tuner = -1,
2536 .no_msp34xx = 1,
2537 .no_tda9875 = 1,
2538 .no_tda7432 = 1,
2539 .pll = PLL_28,
2540 .no_video = 1,
2541 .has_dvb = 1,
2542 .tuner_type = -1,
2543 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002544 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002545 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002546 [BTTV_BOARD_VGEAR_MYVCD] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002547 /* Steven <photon38@pchome.com.tw> */
2548 .name = "V-Gear MyVCD",
2549 .video_inputs = 3,
2550 .audio_inputs = 1,
2551 .tuner = 0,
2552 .svhs = 2,
2553 .gpiomask = 0x3f,
2554 .muxsel = {2, 3, 1, 0},
2555 .audiomux = {0x31, 0x31, 0x31, 0x31, 0x31, 0x31},
2556 .no_msp34xx = 1,
2557 .pll = PLL_28,
2558 .tuner_type = TUNER_PHILIPS_NTSC_M,
2559 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002560 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002561 .has_radio = 0,
2562 #if 0
2563 .has_remote = 1,
2564 #endif
2565 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002566 [BTTV_BOARD_SUPER_TV] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002567 /* Rick C <cryptdragoon@gmail.com> */
2568 .name = "Super TV Tuner",
2569 .video_inputs = 4,
2570 .audio_inputs = 1,
2571 .tuner = 0,
2572 .svhs = 2,
2573 .muxsel = { 2, 3, 1, 0},
2574 .tuner_type = TUNER_PHILIPS_NTSC,
2575 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002576 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002577 .gpiomask = 0x008007,
2578 .audiomux = { 0, 0x000001,0,0, 0},
2579 .needs_tvaudio = 1,
2580 .has_radio = 1,
2581 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002582 [BTTV_BOARD_TIBET_CS16] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002583 /* Chris Fanning <video4linux@haydon.net> */
2584 .name = "Tibet Systems 'Progress DVR' CS16",
2585 .video_inputs = 16,
2586 .audio_inputs = 0,
2587 .tuner = -1,
2588 .svhs = -1,
2589 .muxsel = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 },
2590 .pll = PLL_28,
2591 .no_msp34xx = 1,
2592 .no_tda9875 = 1,
2593 .no_tda7432 = 1,
2594 .tuner_type = -1,
2595 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002596 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002597 .muxsel_hook = tibetCS16_muxsel,
2598 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002599 [BTTV_BOARD_KODICOM_4400R] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002600 /* Bill Brack <wbrack@mmm.com.hk> */
2601 /*
2602 * Note that, because of the card's wiring, the "master"
2603 * BT878A chip (i.e. the one which controls the analog switch
2604 * and must use this card type) is the 2nd one detected. The
2605 * other 3 chips should use card type 0x85, whose description
2606 * follows this one. There is a EEPROM on the card (which is
2607 * connected to the I2C of one of those other chips), but is
2608 * not currently handled. There is also a facility for a
2609 * "monitor", which is also not currently implemented.
2610 */
2611 .name = "Kodicom 4400R (master)",
2612 .video_inputs = 16,
2613 .audio_inputs = 0,
2614 .tuner = -1,
2615 .tuner_type = -1,
2616 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002617 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002618 .svhs = -1,
2619 /* GPIO bits 0-9 used for analog switch:
2620 * 00 - 03: camera selector
2621 * 04 - 06: channel (controller) selector
2622 * 07: data (1->on, 0->off)
2623 * 08: strobe
2624 * 09: reset
2625 * bit 16 is input from sync separator for the channel
2626 */
2627 .gpiomask = 0x0003ff,
2628 .no_gpioirq = 1,
2629 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2630 .pll = PLL_28,
2631 .no_msp34xx = 1,
2632 .no_tda7432 = 1,
2633 .no_tda9875 = 1,
2634 .muxsel_hook = kodicom4400r_muxsel,
2635 },
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002636 [BTTV_BOARD_KODICOM_4400R_SL] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002637 /* Bill Brack <wbrack@mmm.com.hk> */
2638 /* Note that, for reasons unknown, the "master" BT878A chip (i.e. the
2639 * one which controls the analog switch, and must use the card type)
2640 * is the 2nd one detected. The other 3 chips should use this card
2641 * type
2642 */
2643 .name = "Kodicom 4400R (slave)",
2644 .video_inputs = 16,
2645 .audio_inputs = 0,
2646 .tuner = -1,
2647 .tuner_type = -1,
2648 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002649 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002650 .svhs = -1,
2651 .gpiomask = 0x010000,
2652 .no_gpioirq = 1,
2653 .muxsel = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
2654 .pll = PLL_28,
2655 .no_msp34xx = 1,
2656 .no_tda7432 = 1,
2657 .no_tda9875 = 1,
2658 .muxsel_hook = kodicom4400r_muxsel,
2659 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002660 /* ---- card 0x86---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002661 [BTTV_BOARD_ADLINK_RTV24] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002662 /* Michael Henson <mhenson@clarityvi.com> */
2663 /* Adlink RTV24 with special unlock codes */
2664 .name = "Adlink RTV24",
2665 .video_inputs = 4,
2666 .audio_inputs = 1,
2667 .tuner = 0,
2668 .svhs = 2,
2669 .muxsel = { 2, 3, 1, 0},
2670 .tuner_type = -1,
2671 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002672 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002673 .pll = PLL_28,
2674 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002675 /* ---- card 0x87---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002676 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002677 /* Michael Krufky <mkrufky@m1k.net> */
2678 .name = "DViCO FusionHDTV 5 Lite",
2679 .tuner = 0,
2680 .tuner_type = TUNER_LG_TDVS_H062F,
2681 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002682 .radio_addr = ADDR_UNSET,
Michael Krufky4b017412005-11-08 21:37:06 -08002683 .video_inputs = 3,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002684 .audio_inputs = 1,
2685 .svhs = 2,
Michael Krufky4b017412005-11-08 21:37:06 -08002686 .muxsel = { 2, 3, 1 },
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002687 .gpiomask = 0x00e00007,
2688 .audiomux = { 0x00400005, 0, 0x00000001, 0, 0x00c00007, 0 },
2689 .no_msp34xx = 1,
2690 .no_tda9875 = 1,
2691 .no_tda7432 = 1,
2692 .has_dvb = 1,
2693 },
2694 /* ---- card 0x88---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002695 [BTTV_BOARD_ACORP_Y878F] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002696 /* Mauro Carvalho Chehab <mchehab@brturbo.com.br> */
2697 .name = "Acorp Y878F",
2698 .video_inputs = 3,
2699 .audio_inputs = 1,
2700 .tuner = 0,
2701 .svhs = 2,
2702 .gpiomask = 0x01fe00,
2703 .muxsel = { 2, 3, 1, 1},
2704 .audiomux = { 0x001e00, 0, 0x018000, 0x014000, 0x002000, 0 },
2705 .needs_tvaudio = 1,
2706 .pll = PLL_28,
2707 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2708 .tuner_addr = 0xc1 >>1,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002709 .radio_addr = 0xc1 >>1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002710 .has_radio = 1,
2711 },
2712 /* ---- card 0x89 ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002713 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002714 .name = "Conceptronic CTVFMi v2",
2715 .video_inputs = 3,
2716 .audio_inputs = 1,
2717 .tuner = 0,
2718 .svhs = 2,
2719 .gpiomask = 0x001c0007,
2720 .muxsel = { 2, 3, 1, 1 },
2721 .audiomux = { 0, 1, 2, 2, 3 },
2722 .needs_tvaudio = 0,
2723 .pll = PLL_28,
Ricardo Cerqueira24d41222005-11-08 21:38:21 -08002724 .tuner_type = TUNER_TENA_9533_DI,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002725 .tuner_addr = ADDR_UNSET,
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002726 .radio_addr = ADDR_UNSET,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002727 .has_remote = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002728 .has_radio = 1,
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08002729 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002730 /* ---- card 0x8a ---------------------------------- */
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002731 [BTTV_BOARD_PV_BT878P_2E] = {
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002732 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2733 .video_inputs = 5,
2734 .audio_inputs = 1,
2735 .tuner = 0,
2736 .svhs = 3,
2737 .gpiomask = 0x01fe00,
2738 .muxsel = { 2,3,1,1,-1 },
2739 .digital_mode = DIGITAL_MODE_CAMERA,
2740 .audiomux = { 0x00400, 0x10400, 0x04400, 0x80000, 0x12400, 0x46000 },
2741 .no_msp34xx = 1,
2742 .pll = PLL_28,
2743 .tuner_type = TUNER_LG_PAL_FM,
2744 .tuner_addr = ADDR_UNSET,
2745 .radio_addr = ADDR_UNSET,
2746 .has_remote = 1,
2747 },
2748 /* ---- card 0x8b ---------------------------------- */
2749 [BTTV_BOARD_PV_M4900] = {
2750 /* Sérgio Fortier <sergiofortier@yahoo.com.br> */
2751 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2752 .video_inputs = 3,
2753 .audio_inputs = 1,
2754 .tuner = 0,
2755 .svhs = 2,
2756 .gpiomask = 0x3f,
2757 .muxsel = { 2, 3, 1, 1 },
2758 .audiomux = { 0x21, 0x20, 0x24, 0x2c, 0x29, 0x29 },
2759 .no_msp34xx = 1,
2760 .pll = PLL_28,
2761 .tuner_type = TUNER_YMEC_TVF_5533MF,
2762 .tuner_addr = ADDR_UNSET,
2763 .radio_addr = ADDR_UNSET,
2764 .has_radio = 1,
2765 .has_remote = 1,
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002766 },
Michael Krufkycf583ac2005-11-08 21:37:03 -08002767 /* ---- card 0x8c ---------------------------------- */
Kenth Anderssonf718e6e2005-11-08 21:37:02 -08002768 [BTTV_BOARD_OSPREY440] = {
2769 .name = "Osprey 440",
2770 .video_inputs = 1,
2771 .audio_inputs = 1,
2772 .tuner = -1,
2773 .svhs = 1,
2774 .muxsel = { 2 },
2775 .pll = PLL_28,
2776 .tuner_type = UNSET,
2777 .tuner_addr = ADDR_UNSET,
2778 .radio_addr = ADDR_UNSET,
2779 .no_msp34xx = 1,
2780 .no_tda9875 = 1,
2781 .no_tda7432 = 1,
2782 },
nshmyrev@yandex.ru71633c02005-11-08 21:37:38 -08002783 /* ---- card 0x8d ---------------------------------- */
2784 [BTTV_BOARD_ASOUND_SKYEYE] = {
2785 .name = "Asound Skyeye PCTV",
2786 .video_inputs = 3,
2787 .audio_inputs = 1,
2788 .tuner = 0,
2789 .svhs = 2,
2790 .gpiomask = 15,
2791 .muxsel = { 2, 3, 1, 1},
2792 .audiomux = {2,0,0,0,1},
2793 .needs_tvaudio = 1,
2794 .pll = PLL_28,
2795 .tuner_type = 2,
2796 .tuner_addr = ADDR_UNSET,
2797 .radio_addr = ADDR_UNSET,
2798 },
Bill Pechter633323f2005-11-13 16:07:50 -08002799 /* ---- card 0x8e ---------------------------------- */
2800 [BTTV_BOARD_SABRENT_TVFM] = {
2801 .name = "Sabrent TV-FM (bttv version)",
2802 .video_inputs = 3,
2803 .audio_inputs = 1,
2804 .tuner = 0,
2805 .svhs = 2,
2806 .gpiomask = 0x108007,
2807 .muxsel = { 2, 3, 1, 1},
2808 .audiomux = { 100000, 100002, 100002, 100000},
2809 .no_msp34xx = 1,
2810 .no_tda9875 = 1,
2811 .no_tda7432 = 1,
2812 .pll = PLL_28,
2813 .tuner_type = TUNER_TNF_5335MF,
2814 .tuner_addr = ADDR_UNSET,
2815 .has_radio = 1,
2816 },
Mauro Carvalho Chehab10c2c8b2005-11-08 21:36:56 -08002817};
Linus Torvalds1da177e2005-04-16 15:20:36 -07002818
2819static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2820
2821/* ----------------------------------------------------------------------- */
2822
2823static unsigned char eeprom_data[256];
2824
2825/*
2826 * identify card
2827 */
2828void __devinit bttv_idcard(struct bttv *btv)
2829{
2830 unsigned int gpiobits;
2831 int i,type;
2832 unsigned short tmp;
2833
2834 /* read PCI subsystem ID */
2835 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_ID, &tmp);
2836 btv->cardid = tmp << 16;
2837 pci_read_config_word(btv->c.pci, PCI_SUBSYSTEM_VENDOR_ID, &tmp);
2838 btv->cardid |= tmp;
2839
2840 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2841 /* look for the card */
2842 for (type = -1, i = 0; cards[i].id != 0; i++)
2843 if (cards[i].id == btv->cardid)
2844 type = i;
2845
2846 if (type != -1) {
2847 /* found it */
2848 printk(KERN_INFO "bttv%d: detected: %s [card=%d], "
2849 "PCI subsystem ID is %04x:%04x\n",
2850 btv->c.nr,cards[type].name,cards[type].cardnr,
2851 btv->cardid & 0xffff,
2852 (btv->cardid >> 16) & 0xffff);
2853 btv->c.type = cards[type].cardnr;
2854 } else {
2855 /* 404 */
2856 printk(KERN_INFO "bttv%d: subsystem: %04x:%04x (UNKNOWN)\n",
2857 btv->c.nr, btv->cardid & 0xffff,
2858 (btv->cardid >> 16) & 0xffff);
2859 printk(KERN_DEBUG "please mail id, board name and "
Michael Krufky2a2d8572005-11-08 21:37:24 -08002860 "the correct card= insmod option to video4linux-list@redhat.com\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07002861 }
2862 }
2863
2864 /* let the user override the autodetected type */
2865 if (card[btv->c.nr] < bttv_num_tvcards)
2866 btv->c.type=card[btv->c.nr];
2867
2868 /* print which card config we are using */
2869 printk(KERN_INFO "bttv%d: using: %s [card=%d,%s]\n",btv->c.nr,
2870 bttv_tvcards[btv->c.type].name, btv->c.type,
2871 card[btv->c.nr] < bttv_num_tvcards
2872 ? "insmod option" : "autodetected");
2873
2874 /* overwrite gpio stuff ?? */
2875 if (UNSET == audioall && UNSET == audiomux[0])
2876 return;
2877
2878 if (UNSET != audiomux[0]) {
2879 gpiobits = 0;
2880 for (i = 0; i < 5; i++) {
2881 bttv_tvcards[btv->c.type].audiomux[i] = audiomux[i];
2882 gpiobits |= audiomux[i];
2883 }
2884 } else {
2885 gpiobits = audioall;
2886 for (i = 0; i < 5; i++) {
2887 bttv_tvcards[btv->c.type].audiomux[i] = audioall;
2888 }
2889 }
2890 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2891 printk(KERN_INFO "bttv%d: gpio config override: mask=0x%x, mux=",
2892 btv->c.nr,bttv_tvcards[btv->c.type].gpiomask);
2893 for (i = 0; i < 5; i++) {
2894 printk("%s0x%x", i ? "," : "", bttv_tvcards[btv->c.type].audiomux[i]);
2895 }
2896 printk("\n");
2897}
2898
2899/*
2900 * (most) board specific initialisations goes here
2901 */
2902
2903/* Some Modular Technology cards have an eeprom, but no subsystem ID */
2904void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2905{
2906 int type = -1;
2907
2908 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002909 type = BTTV_BOARD_MODTEC_205;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002910 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08002911 type = BTTV_BOARD_EURESYS_PICOLO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07002912 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08002913 type = BTTV_BOARD_HAUPPAUGE; /* old bt848 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002914
2915 if (-1 != type) {
2916 btv->c.type = type;
2917 printk("bttv%d: detected by eeprom: %s [card=%d]\n",
2918 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2919 }
2920}
2921
2922static void flyvideo_gpio(struct bttv *btv)
2923{
2924 int gpio,has_remote,has_radio,is_capture_only,is_lr90,has_tda9820_tda9821;
2925 int tuner=-1,ttype;
2926
2927 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002928 udelay(8); /* without this we would see the 0x1800 mask */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002929 gpio = gpio_read();
2930 /* FIXME: must restore OUR_EN ??? */
2931
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002932 /* all cards provide GPIO info, some have an additional eeprom
2933 * LR50: GPIO coding can be found lower right CP1 .. CP9
2934 * CP9=GPIO23 .. CP1=GPIO15; when OPEN, the corresponding GPIO reads 1.
2935 * GPIO14-12: n.c.
2936 * LR90: GP9=GPIO23 .. GP1=GPIO15 (right above the bt878)
Linus Torvalds1da177e2005-04-16 15:20:36 -07002937
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002938 * lowest 3 bytes are remote control codes (no handshake needed)
2939 * xxxFFF: No remote control chip soldered
2940 * xxxF00(LR26/LR50), xxxFE0(LR90): Remote control chip (LVA001 or CF45) soldered
2941 * Note: Some bits are Audio_Mask !
2942 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002943 ttype=(gpio&0x0f0000)>>16;
2944 switch(ttype) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002945 case 0x0: tuner=2; /* NTSC, e.g. TPI8NSR11P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002946 break;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08002947 case 0x2: tuner=39;/* LG NTSC (newer TAPC series) TAPC-H701P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002948 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002949 case 0x4: tuner=5; /* Philips PAL TPI8PSB02P, TPI8PSB12P, TPI8PSB12D or FI1216, FM1216 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002950 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002951 case 0x6: tuner=37;/* LG PAL (newer TAPC series) TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002952 break;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002953 case 0xC: tuner=3; /* Philips SECAM(+PAL) FQ1216ME or FI1216MF */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002954 break;
2955 default:
2956 printk(KERN_INFO "bttv%d: FlyVideo_gpio: unknown tuner type.\n", btv->c.nr);
2957 }
2958
2959 has_remote = gpio & 0x800000;
2960 has_radio = gpio & 0x400000;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002961 /* unknown 0x200000;
2962 * unknown2 0x100000; */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08002963 is_capture_only = !(gpio & 0x008000); /* GPIO15 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002964 has_tda9820_tda9821 = !(gpio & 0x004000);
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002965 is_lr90 = !(gpio & 0x002000); /* else LR26/LR50 (LR38/LR51 f. capture only) */
2966 /*
2967 * gpio & 0x001000 output bit for audio routing */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002968
2969 if(is_capture_only)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002970 tuner=4; /* No tuner present */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002971
2972 printk(KERN_INFO "bttv%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
2973 btv->c.nr, has_radio? "yes":"no ", has_remote? "yes":"no ", tuner, gpio);
2974 printk(KERN_INFO "bttv%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
2975 btv->c.nr, is_lr90?"yes":"no ", has_tda9820_tda9821?"yes":"no ",
2976 is_capture_only?"yes":"no ");
2977
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002978 if(tuner!= -1) /* only set if known tuner autodetected, else let insmod option through */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002979 btv->tuner_type = tuner;
2980 btv->has_radio = has_radio;
2981
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002982 /* LR90 Audio Routing is done by 2 hef4052, so Audio_Mask has 4 bits: 0x001c80
2983 * LR26/LR50 only has 1 hef4052, Audio_Mask 0x000c00
2984 * Audio options: from tuner, from tda9821/tda9821(mono,stereo,sap), from tda9874, ext., mute */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002985 if(has_tda9820_tda9821) btv->audio_hook = lt9415_audio;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07002986 /* todo: if(has_tda9874) btv->audio_hook = fv2000s_audio; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07002987}
2988
2989static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
2990 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
2991static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
2992 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
2993
2994static void miro_pinnacle_gpio(struct bttv *btv)
2995{
2996 int id,msp,gpio;
2997 char *info;
2998
2999 gpio_inout(0xffffff, 0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003000 gpio = gpio_read();
Linus Torvalds1da177e2005-04-16 15:20:36 -07003001 id = ((gpio>>10) & 63) -1;
3002 msp = bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx");
3003 if (id < 32) {
3004 btv->tuner_type = miro_tunermap[id];
3005 if (0 == (gpio & 0x20)) {
3006 btv->has_radio = 1;
3007 if (!miro_fmtuner[id]) {
3008 btv->has_matchbox = 1;
3009 btv->mbox_we = (1<<6);
3010 btv->mbox_most = (1<<7);
3011 btv->mbox_clk = (1<<8);
3012 btv->mbox_data = (1<<9);
3013 btv->mbox_mask = (1<<6)|(1<<7)|(1<<8)|(1<<9);
3014 }
3015 } else {
3016 btv->has_radio = 0;
3017 }
3018 if (-1 != msp) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003019 if (btv->c.type == BTTV_BOARD_MIRO)
3020 btv->c.type = BTTV_BOARD_MIROPRO;
3021 if (btv->c.type == BTTV_BOARD_PINNACLE)
3022 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003023 }
3024 printk(KERN_INFO
3025 "bttv%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3026 btv->c.nr, id+1, btv->tuner_type,
3027 !btv->has_radio ? "no" :
3028 (btv->has_matchbox ? "matchbox" : "fmtuner"),
3029 (-1 == msp) ? "no" : "yes");
3030 } else {
3031 /* new cards with microtune tuner */
3032 id = 63 - id;
3033 btv->has_radio = 0;
3034 switch (id) {
3035 case 1:
3036 info = "PAL / mono";
3037 break;
3038 case 2:
3039 info = "PAL+SECAM / stereo";
3040 btv->has_radio = 1;
3041 break;
3042 case 3:
3043 info = "NTSC / stereo";
3044 btv->has_radio = 1;
3045 break;
3046 case 4:
3047 info = "PAL+SECAM / mono";
3048 break;
3049 case 5:
3050 info = "NTSC / mono";
3051 break;
3052 case 6:
3053 info = "NTSC / stereo";
3054 break;
3055 case 7:
3056 info = "PAL / stereo";
3057 break;
3058 default:
3059 info = "oops: unknown card";
3060 break;
3061 }
3062 if (-1 != msp)
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003063 btv->c.type = BTTV_BOARD_PINNACLEPRO;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003064 printk(KERN_INFO
3065 "bttv%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3066 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3067 btv->tuner_type = 33;
3068 btv->pinnacle_id = id;
3069 }
3070}
3071
3072/* GPIO21 L: Buffer aktiv, H: Buffer inaktiv */
3073#define LM1882_SYNC_DRIVE 0x200000L
3074
3075static void init_ids_eagle(struct bttv *btv)
3076{
3077 gpio_inout(0xffffff,0xFFFF37);
3078 gpio_write(0x200020);
3079
3080 /* flash strobe inverter ?! */
3081 gpio_write(0x200024);
3082
3083 /* switch sync drive off */
3084 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3085
3086 /* set BT848 muxel to 2 */
3087 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3088}
3089
3090/* Muxsel helper for the IDS Eagle.
3091 * the eagles does not use the standard muxsel-bits but
3092 * has its own multiplexer */
3093static void eagle_muxsel(struct bttv *btv, unsigned int input)
3094{
3095 btaor((2)<<5, ~(3<<5), BT848_IFORM);
3096 gpio_bits(3,bttv_tvcards[btv->c.type].muxsel[input&7]);
3097
Linus Torvalds1da177e2005-04-16 15:20:36 -07003098 /* composite */
3099 /* set chroma ADC to sleep */
3100 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3101 /* set to composite video */
3102 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3103 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003104
3105 /* switch sync drive off */
3106 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3107}
3108
3109static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3110{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003111 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003112 gpio_write(masks[input%4]);
3113}
3114
3115/* LMLBT4x initialization - to allow access to GPIO bits for sensors input and
3116 alarms output
3117
3118 GPIObit | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
3119 assignment | TI | O3|INx| O2| O1|IN4|IN3|IN2|IN1| | |
3120
3121 IN - sensor inputs, INx - sensor inputs and TI XORed together
3122 O1,O2,O3 - alarm outputs (relays)
3123
3124 OUT ENABLE 1 1 0 . 1 1 0 0 . 0 0 0 0 = 0x6C0
3125
3126*/
3127
3128static void init_lmlbt4x(struct bttv *btv)
3129{
3130 printk(KERN_DEBUG "LMLBT4x init\n");
3131 btwrite(0x000000, BT848_GPIO_REG_INP);
3132 gpio_inout(0xffffff, 0x0006C0);
3133 gpio_write(0x000000);
3134}
3135
3136static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3137{
3138 unsigned int inmux = input % 8;
3139 gpio_inout( 0xf, 0xf );
3140 gpio_bits( 0xf, inmux );
3141}
3142
3143static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3144{
3145 unsigned int inmux = input % 4;
3146 gpio_inout( 3<<9, 3<<9 );
3147 gpio_bits( 3<<9, inmux<<9 );
3148}
3149
3150/* ----------------------------------------------------------------------- */
3151
3152static void bttv_reset_audio(struct bttv *btv)
3153{
3154 /*
3155 * BT878A has a audio-reset register.
3156 * 1. This register is an audio reset function but it is in
3157 * function-0 (video capture) address space.
3158 * 2. It is enough to do this once per power-up of the card.
3159 * 3. There is a typo in the Conexant doc -- it is not at
3160 * 0x5B, but at 0x058. (B is an odd-number, obviously a typo!).
3161 * --//Shrikumar 030609
3162 */
3163 if (btv->id != 878)
3164 return;
3165
3166 if (bttv_debug)
3167 printk("bttv%d: BT878A ARESET\n",btv->c.nr);
3168 btwrite((1<<7), 0x058);
3169 udelay(10);
3170 btwrite( 0, 0x058);
3171}
3172
3173/* initialization part one -- before registering i2c bus */
3174void __devinit bttv_init_card1(struct bttv *btv)
3175{
3176 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003177 case BTTV_BOARD_HAUPPAUGE:
3178 case BTTV_BOARD_HAUPPAUGE878:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003179 boot_msp34xx(btv,5);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003180 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003181 case BTTV_BOARD_VOODOOTV_FM:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003182 boot_msp34xx(btv,20);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003183 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003184 case BTTV_BOARD_AVERMEDIA98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003185 boot_msp34xx(btv,11);
3186 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003187 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003188 pvr_boot(btv);
3189 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003190 case BTTV_BOARD_TWINHAN_DST:
3191 case BTTV_BOARD_AVDVBT_771:
3192 case BTTV_BOARD_PINNACLESAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003193 btv->use_i2c_hw = 1;
3194 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003195 case BTTV_BOARD_ADLINK_RTV24:
Michael Krufky7c08fb02005-11-08 21:36:21 -08003196 init_RTV24( btv );
3197 break;
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003198
Linus Torvalds1da177e2005-04-16 15:20:36 -07003199 }
3200 if (!bttv_tvcards[btv->c.type].has_dvb)
3201 bttv_reset_audio(btv);
3202}
3203
3204/* initialization part two -- after registering i2c bus */
3205void __devinit bttv_init_card2(struct bttv *btv)
3206{
3207 int tda9887;
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003208 int addr=ADDR_UNSET;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003209
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003210 btv->tuner_type = -1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003211
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003212 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003213 bttv_readee(btv,eeprom_data,0xa0);
3214 identify_by_eeprom(btv,eeprom_data);
3215 }
3216
3217 switch (btv->c.type) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003218 case BTTV_BOARD_MIRO:
3219 case BTTV_BOARD_MIROPRO:
3220 case BTTV_BOARD_PINNACLE:
3221 case BTTV_BOARD_PINNACLEPRO:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003222 /* miro/pinnacle */
3223 miro_pinnacle_gpio(btv);
3224 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003225 case BTTV_BOARD_FLYVIDEO_98:
3226 case BTTV_BOARD_MAXI:
3227 case BTTV_BOARD_LIFE_FLYKIT:
3228 case BTTV_BOARD_FLYVIDEO:
3229 case BTTV_BOARD_TYPHOON_TVIEW:
3230 case BTTV_BOARD_CHRONOS_VS2:
3231 case BTTV_BOARD_FLYVIDEO_98FM:
3232 case BTTV_BOARD_FLYVIDEO2000:
3233 case BTTV_BOARD_FLYVIDEO98EZ:
3234 case BTTV_BOARD_CONFERENCETV:
3235 case BTTV_BOARD_LIFETEC_9415:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003236 flyvideo_gpio(btv);
3237 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003238 case BTTV_BOARD_HAUPPAUGE:
3239 case BTTV_BOARD_HAUPPAUGE878:
3240 case BTTV_BOARD_HAUPPAUGEPVR:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003241 /* pick up some config infos from the eeprom */
3242 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003243 hauppauge_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003244 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003245 case BTTV_BOARD_AVERMEDIA98:
3246 case BTTV_BOARD_AVPHONE98:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003247 bttv_readee(btv,eeprom_data,0xa0);
3248 avermedia_eeprom(btv);
3249 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003250 case BTTV_BOARD_PXC200:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003251 init_PXC200(btv);
3252 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003253 case BTTV_BOARD_PICOLO_TETRA_CHIP:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003254 picolo_tetra_init(btv);
3255 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003256 case BTTV_BOARD_VHX:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003257 btv->has_radio = 1;
3258 btv->has_matchbox = 1;
3259 btv->mbox_we = 0x20;
3260 btv->mbox_most = 0;
3261 btv->mbox_clk = 0x08;
3262 btv->mbox_data = 0x10;
3263 btv->mbox_mask = 0x38;
3264 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003265 case BTTV_BOARD_VOBIS_BOOSTAR:
3266 case BTTV_BOARD_TERRATV:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003267 terratec_active_radio_upgrade(btv);
3268 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003269 case BTTV_BOARD_MAGICTVIEW061:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003270 if (btv->cardid == 0x3002144f) {
3271 btv->has_radio=1;
3272 printk("bttv%d: radio detected by subsystem id (CPH05x)\n",btv->c.nr);
3273 }
3274 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003275 case BTTV_BOARD_STB2:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003276 if (btv->cardid == 0x3060121a) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003277 /* Fix up entry for 3DFX VoodooTV 100,
3278 which is an OEM STB card variant. */
3279 btv->has_radio=0;
3280 btv->tuner_type=TUNER_TEMIC_NTSC;
3281 }
3282 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003283 case BTTV_BOARD_OSPREY1x0:
3284 case BTTV_BOARD_OSPREY1x0_848:
3285 case BTTV_BOARD_OSPREY101_848:
3286 case BTTV_BOARD_OSPREY1x1:
3287 case BTTV_BOARD_OSPREY1x1_SVID:
3288 case BTTV_BOARD_OSPREY2xx:
3289 case BTTV_BOARD_OSPREY2x0_SVID:
3290 case BTTV_BOARD_OSPREY2x0:
3291 case BTTV_BOARD_OSPREY500:
3292 case BTTV_BOARD_OSPREY540:
3293 case BTTV_BOARD_OSPREY2000:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003294 bttv_readee(btv,eeprom_data,0xa0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003295 osprey_eeprom(btv);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003296 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003297 case BTTV_BOARD_IDS_EAGLE:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003298 init_ids_eagle(btv);
3299 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003300 case BTTV_BOARD_MODTEC_205:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003301 bttv_readee(btv,eeprom_data,0xa0);
3302 modtec_eeprom(btv);
3303 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003304 case BTTV_BOARD_LMLBT4:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003305 init_lmlbt4x(btv);
3306 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003307 case BTTV_BOARD_TIBET_CS16:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003308 tibetCS16_init(btv);
3309 break;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003310 case BTTV_BOARD_KODICOM_4400R:
Linus Torvalds1da177e2005-04-16 15:20:36 -07003311 kodicom4400r_init(btv);
3312 break;
3313 }
3314
3315 /* pll configuration */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003316 if (!(btv->id==848 && btv->revision==0x11)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003317 /* defaults from card list */
3318 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3319 btv->pll.pll_ifreq=28636363;
3320 btv->pll.pll_crystal=BT848_IFORM_XT0;
3321 }
3322 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3323 btv->pll.pll_ifreq=35468950;
3324 btv->pll.pll_crystal=BT848_IFORM_XT1;
3325 }
3326 /* insmod options can override */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003327 switch (pll[btv->c.nr]) {
3328 case 0: /* none */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003329 btv->pll.pll_crystal = 0;
3330 btv->pll.pll_ifreq = 0;
3331 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003332 break;
3333 case 1: /* 28 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003334 case 28:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003335 btv->pll.pll_ifreq = 28636363;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003336 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003337 btv->pll.pll_crystal = BT848_IFORM_XT0;
3338 break;
3339 case 2: /* 35 MHz */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003340 case 35:
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003341 btv->pll.pll_ifreq = 35468950;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003342 btv->pll.pll_ofreq = 0;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003343 btv->pll.pll_crystal = BT848_IFORM_XT1;
3344 break;
3345 }
3346 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003347 btv->pll.pll_current = -1;
3348
Linus Torvalds1da177e2005-04-16 15:20:36 -07003349 /* tuner configuration (from card list / autodetect / insmod option) */
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003350 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3351 addr = bttv_tvcards[btv->c.type].tuner_addr;
3352
3353 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003354 if(UNSET == btv->tuner_type)
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003355 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003356 if (UNSET != tuner[btv->c.nr])
3357 btv->tuner_type = tuner[btv->c.nr];
3358 printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003359
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003360 if (btv->tuner_type != UNSET) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003361 struct tuner_setup tun_setup;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003362
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003363 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003364 tun_setup.type = btv->tuner_type;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003365 tun_setup.addr = addr;
Mauro Carvalho Chehabfa9846a2005-07-12 13:58:42 -07003366
3367 bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_setup);
3368 }
3369
Mauro Carvalho Chehabf3b512f2005-11-08 21:38:23 -08003370 if (btv->pinnacle_id != UNSET) {
3371 bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
3372 &btv->pinnacle_id);
3373 }
3374
Linus Torvalds1da177e2005-04-16 15:20:36 -07003375 btv->svhs = bttv_tvcards[btv->c.type].svhs;
3376 if (svhs[btv->c.nr] != UNSET)
3377 btv->svhs = svhs[btv->c.nr];
3378 if (remote[btv->c.nr] != UNSET)
3379 btv->has_remote = remote[btv->c.nr];
3380
3381 if (bttv_tvcards[btv->c.type].has_radio)
3382 btv->has_radio=1;
3383 if (bttv_tvcards[btv->c.type].has_remote)
3384 btv->has_remote=1;
Michael Krufky7c08fb02005-11-08 21:36:21 -08003385 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3386 btv->gpioirq=1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003387 if (bttv_tvcards[btv->c.type].audio_hook)
3388 btv->audio_hook=bttv_tvcards[btv->c.type].audio_hook;
3389
3390 if (bttv_tvcards[btv->c.type].digital_mode == DIGITAL_MODE_CAMERA) {
3391 /* detect Bt832 chip for quartzsight digital camera */
3392 if ((bttv_I2CRead(btv, I2C_BT832_ALT1, "Bt832") >=0) ||
3393 (bttv_I2CRead(btv, I2C_BT832_ALT2, "Bt832") >=0))
3394 boot_bt832(btv);
3395 }
3396
3397 if (!autoload)
3398 return;
3399
3400 /* try to detect audio/fader chips */
3401 if (!bttv_tvcards[btv->c.type].no_msp34xx &&
3402 bttv_I2CRead(btv, I2C_MSP3400, "MSP34xx") >=0)
3403 request_module("msp3400");
3404
3405 if (bttv_tvcards[btv->c.type].msp34xx_alt &&
3406 bttv_I2CRead(btv, I2C_MSP3400_ALT, "MSP34xx (alternate address)") >=0)
3407 request_module("msp3400");
3408
3409 if (!bttv_tvcards[btv->c.type].no_tda9875 &&
3410 bttv_I2CRead(btv, I2C_TDA9875, "TDA9875") >=0)
3411 request_module("tda9875");
3412
3413 if (!bttv_tvcards[btv->c.type].no_tda7432 &&
3414 bttv_I2CRead(btv, I2C_TDA7432, "TDA7432") >=0)
3415 request_module("tda7432");
3416
3417 if (bttv_tvcards[btv->c.type].needs_tvaudio)
3418 request_module("tvaudio");
3419
3420 /* tuner modules */
3421 tda9887 = 0;
3422 if (btv->pinnacle_id != UNSET)
3423 tda9887 = 1;
3424 if (0 == tda9887 && 0 == bttv_tvcards[btv->c.type].has_dvb &&
3425 bttv_I2CRead(btv, I2C_TDA9887, "TDA9887") >=0)
3426 tda9887 = 1;
Ricardo Cerqueira6e45f5d2005-11-08 21:38:34 -08003427 /* Hybrid DVB card, DOES have a tda9887 */
3428 if (btv->c.type == BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE)
3429 tda9887 = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003430 if((btv->tuner_type == TUNER_PHILIPS_FM1216ME_MK3) ||
3431 (btv->tuner_type == TUNER_PHILIPS_FM1236_MK3) ||
3432 (btv->tuner_type == TUNER_PHILIPS_FM1256_IH3) ||
3433 tda9887)
3434 request_module("tda9887");
3435 if (btv->tuner_type != UNSET)
3436 request_module("tuner");
3437}
3438
3439
3440/* ----------------------------------------------------------------------- */
3441
3442static void modtec_eeprom(struct bttv *btv)
3443{
3444 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3445 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3446 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3447 btv->c.nr,&eeprom_data[0x1e]);
3448 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3449 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3450 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003451 btv->c.nr,&eeprom_data[0x1e]);
3452 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3453 btv->tuner_type=TUNER_PHILIPS_NTSC;
3454 printk("bttv%d: Modtec: Tuner autodetected by eeprom: %s\n",
3455 btv->c.nr,&eeprom_data[0x1e]);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003456 } else {
3457 printk("bttv%d: Modtec: Unknown TunerString: %s\n",
3458 btv->c.nr,&eeprom_data[0x1e]);
3459 }
3460}
3461
3462static void __devinit hauppauge_eeprom(struct bttv *btv)
3463{
3464 struct tveeprom tv;
3465
Mauro Carvalho Chehab0f97a932005-09-09 13:04:05 -07003466 tveeprom_hauppauge_analog(&btv->i2c_client, &tv, eeprom_data);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003467 btv->tuner_type = tv.tuner_type;
3468 btv->has_radio = tv.has_radio;
3469}
3470
3471static int terratec_active_radio_upgrade(struct bttv *btv)
3472{
3473 int freq;
3474
3475 btv->has_radio = 1;
3476 btv->has_matchbox = 1;
3477 btv->mbox_we = 0x10;
3478 btv->mbox_most = 0x20;
3479 btv->mbox_clk = 0x08;
3480 btv->mbox_data = 0x04;
3481 btv->mbox_mask = 0x3c;
3482
3483 btv->mbox_iow = 1 << 8;
3484 btv->mbox_ior = 1 << 9;
3485 btv->mbox_csel = 1 << 10;
3486
3487 freq=88000/62.5;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003488 tea5757_write(btv, 5 * freq + 0x358); /* write 0x1ed8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003489 if (0x1ed8 == tea5757_read(btv)) {
3490 printk("bttv%d: Terratec Active Radio Upgrade found.\n",
3491 btv->c.nr);
3492 btv->has_radio = 1;
3493 btv->has_matchbox = 1;
3494 } else {
3495 btv->has_radio = 0;
3496 btv->has_matchbox = 0;
3497 }
3498 return 0;
3499}
3500
3501
3502/* ----------------------------------------------------------------------- */
3503
3504/*
3505 * minimal bootstrap for the WinTV/PVR -- upload altera firmware.
3506 *
3507 * The hcwamc.rbf firmware file is on the Hauppauge driver CD. Have
3508 * a look at Pvr/pvr45xxx.EXE (self-extracting zip archive, can be
3509 * unpacked with unzip).
3510 */
3511#define PVR_GPIO_DELAY 10
3512
3513#define BTTV_ALT_DATA 0x000001
3514#define BTTV_ALT_DCLK 0x100000
3515#define BTTV_ALT_NCONFIG 0x800000
3516
3517static int __devinit pvr_altera_load(struct bttv *btv, u8 *micro, u32 microlen)
3518{
3519 u32 n;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003520 u8 bits;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003521 int i;
3522
3523 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3524 gpio_write(0);
3525 udelay(PVR_GPIO_DELAY);
3526
3527 gpio_write(BTTV_ALT_NCONFIG);
3528 udelay(PVR_GPIO_DELAY);
3529
3530 for (n = 0; n < microlen; n++) {
3531 bits = micro[n];
3532 for ( i = 0 ; i < 8 ; i++ ) {
3533 gpio_bits(BTTV_ALT_DCLK,0);
3534 if (bits & 0x01)
3535 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3536 else
3537 gpio_bits(BTTV_ALT_DATA,0);
3538 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3539 bits >>= 1;
3540 }
3541 }
3542 gpio_bits(BTTV_ALT_DCLK,0);
3543 udelay(PVR_GPIO_DELAY);
3544
3545 /* begin Altera init loop (Not necessary,but doesn't hurt) */
3546 for (i = 0 ; i < 30 ; i++) {
3547 gpio_bits(BTTV_ALT_DCLK,0);
3548 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3549 }
3550 gpio_bits(BTTV_ALT_DCLK,0);
3551 return 0;
3552}
3553
3554static int __devinit pvr_boot(struct bttv *btv)
3555{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003556 const struct firmware *fw_entry;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003557 int rc;
3558
3559 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3560 if (rc != 0) {
3561 printk(KERN_WARNING "bttv%d: no altera firmware [via hotplug]\n",
3562 btv->c.nr);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003563 return rc;
3564 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003565 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3566 printk(KERN_INFO "bttv%d: altera firmware upload %s\n",
3567 btv->c.nr, (rc < 0) ? "failed" : "ok");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003568 release_firmware(fw_entry);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003569 return rc;
3570}
3571
3572/* ----------------------------------------------------------------------- */
3573/* some osprey specific stuff */
3574
3575static void __devinit osprey_eeprom(struct bttv *btv)
3576{
3577 int i = 0;
3578 unsigned char *ee = eeprom_data;
3579 unsigned long serial = 0;
3580
3581 if (btv->c.type == 0) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003582 /* this might be an antique... check for MMAC label in eeprom */
3583 if ((ee[0]=='M') && (ee[1]=='M') && (ee[2]=='A') && (ee[3]=='C')) {
3584 unsigned char checksum = 0;
3585 for (i =0; i<21; i++)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003586 checksum += ee[i];
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003587 if (checksum != ee[21])
Linus Torvalds1da177e2005-04-16 15:20:36 -07003588 return;
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003589 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003590 for (i = 12; i < 21; i++)
3591 serial *= 10, serial += ee[i] - '0';
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003592 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003593 } else {
3594 unsigned short type;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003595 int offset = 4*16;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003596
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003597 for(; offset < 8*16; offset += 16) {
3598 unsigned short checksum = 0;
3599 /* verify the checksum */
3600 for(i = 0; i<14; i++) checksum += ee[i+offset];
3601 checksum = ~checksum; /* no idea why */
3602 if ((((checksum>>8)&0x0FF) == ee[offset+14]) &&
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08003603 ((checksum & 0x0FF) == ee[offset+15])) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003604 break;
3605 }
3606 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07003607
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003608 if (offset >= 8*16)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003609 return;
3610
3611 /* found a valid descriptor */
3612 type = (ee[offset+4]<<8) | (ee[offset+5]);
3613
3614 switch(type) {
3615
3616 /* 848 based */
3617 case 0x0004:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003618 btv->c.type = BTTV_BOARD_OSPREY1x0_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003619 break;
3620 case 0x0005:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003621 btv->c.type = BTTV_BOARD_OSPREY101_848;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003622 break;
3623
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003624 /* 878 based */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003625 case 0x0012:
3626 case 0x0013:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003627 btv->c.type = BTTV_BOARD_OSPREY1x0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003628 break;
3629 case 0x0014:
3630 case 0x0015:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003631 btv->c.type = BTTV_BOARD_OSPREY1x1;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003632 break;
3633 case 0x0016:
3634 case 0x0017:
3635 case 0x0020:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003636 btv->c.type = BTTV_BOARD_OSPREY1x1_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003637 break;
3638 case 0x0018:
3639 case 0x0019:
3640 case 0x001E:
3641 case 0x001F:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003642 btv->c.type = BTTV_BOARD_OSPREY2xx;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003643 break;
3644 case 0x001A:
3645 case 0x001B:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003646 btv->c.type = BTTV_BOARD_OSPREY2x0_SVID;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003647 break;
3648 case 0x0040:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003649 btv->c.type = BTTV_BOARD_OSPREY500;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003650 break;
3651 case 0x0050:
3652 case 0x0056:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003653 btv->c.type = BTTV_BOARD_OSPREY540;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003654 /* bttv_osprey_540_init(btv); */
3655 break;
3656 case 0x0060:
3657 case 0x0070:
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003658 btv->c.type = BTTV_BOARD_OSPREY2x0;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003659 /* enable output on select control lines */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003660 gpio_inout(0xffffff,0x000303);
3661 break;
3662 default:
3663 /* unknown...leave generic, but get serial # */
3664 break;
3665 }
3666 serial = (ee[offset+6] << 24)
3667 | (ee[offset+7] << 16)
3668 | (ee[offset+8] << 8)
3669 | (ee[offset+9]);
3670 }
3671
3672 printk(KERN_INFO "bttv%d: osprey eeprom: card=%d name=%s serial=%ld\n",
3673 btv->c.nr, btv->c.type, bttv_tvcards[btv->c.type].name,serial);
3674}
3675
3676/* ----------------------------------------------------------------------- */
3677/* AVermedia specific stuff, from bktr_card.c */
3678
3679static int tuner_0_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003680 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL /* PAL-BG*/,
3681 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL /* PAL-I*/,
3682 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
3683 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
3684 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003685 TUNER_PHILIPS_FM1216ME_MK3 };
Linus Torvalds1da177e2005-04-16 15:20:36 -07003686
3687static int tuner_1_table[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003688 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07003689 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
3690 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003691 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5, /* TUNER_TEMIC_SECAM */
3692 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
Linus Torvalds1da177e2005-04-16 15:20:36 -07003693
3694static void __devinit avermedia_eeprom(struct bttv *btv)
3695{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003696 int tuner_make,tuner_tv_fm,tuner_format,tuner=0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003697
3698 tuner_make = (eeprom_data[0x41] & 0x7);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003699 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
3700 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003701 btv->has_remote = (eeprom_data[0x42] & 0x01);
3702
3703 if (tuner_make == 0 || tuner_make == 2)
3704 if(tuner_format <=0x0a)
3705 tuner = tuner_0_table[tuner_format];
3706 if (tuner_make == 1)
3707 if(tuner_format <=9)
3708 tuner = tuner_1_table[tuner_format];
3709
3710 if (tuner_make == 4)
3711 if(tuner_format == 0x09)
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003712 tuner = TUNER_LG_NTSC_NEW_TAPC; /* TAPC-G702P */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003713
3714 printk(KERN_INFO "bttv%d: Avermedia eeprom[0x%02x%02x]: tuner=",
3715 btv->c.nr,eeprom_data[0x41],eeprom_data[0x42]);
3716 if(tuner) {
3717 btv->tuner_type=tuner;
3718 printk("%d",tuner);
3719 } else
3720 printk("Unknown type");
3721 printk(" radio:%s remote control:%s\n",
3722 tuner_tv_fm ? "yes" : "no",
3723 btv->has_remote ? "yes" : "no");
3724}
3725
3726/* used on Voodoo TV/FM (Voodoo 200), S0 wired to 0x10000 */
3727void bttv_tda9880_setnorm(struct bttv *btv, int norm)
3728{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003729 /* fix up our card entry */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003730 if(norm==VIDEO_MODE_NTSC) {
Mauro Carvalho Chehab5a25e842005-11-08 21:36:52 -08003731 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x957fff;
3732 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x957fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003733 dprintk("bttv_tda9880_setnorm to NTSC\n");
3734 }
3735 else {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003736 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[0]=0x947fff;
3737 bttv_tvcards[BTTV_BOARD_VOODOOTV_FM].audiomux[4]=0x947fff;
Linus Torvalds1da177e2005-04-16 15:20:36 -07003738 dprintk("bttv_tda9880_setnorm to PAL\n");
3739 }
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07003740 /* set GPIO according */
Linus Torvalds1da177e2005-04-16 15:20:36 -07003741 gpio_bits(bttv_tvcards[btv->c.type].gpiomask,
3742 bttv_tvcards[btv->c.type].audiomux[btv->audio]);
3743}
3744
3745
3746/*
3747 * reset/enable the MSP on some Hauppauge cards
David Woodhouse93e960f2005-11-08 21:36:46 -08003748 * Thanks to Kyösti Mälkki (kmalkki@cc.hut.fi)!
Linus Torvalds1da177e2005-04-16 15:20:36 -07003749 *
3750 * Hauppauge: pin 5
3751 * Voodoo: pin 20
3752 */
3753static void __devinit boot_msp34xx(struct bttv *btv, int pin)
3754{
3755 int mask = (1 << pin);
3756
3757 gpio_inout(mask,mask);
3758 gpio_bits(mask,0);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003759 udelay(2500);
Linus Torvalds1da177e2005-04-16 15:20:36 -07003760 gpio_bits(mask,mask);
3761
3762 if (bttv_gpio)
3763 bttv_gpio_tracking(btv,"msp34xx");
3764 if (bttv_verbose)
3765 printk(KERN_INFO "bttv%d: Hauppauge/Voodoo msp34xx: reset line "
3766 "init [%d]\n", btv->c.nr, pin);
3767}
3768
3769static void __devinit boot_bt832(struct bttv *btv)
3770{
Linus Torvalds1da177e2005-04-16 15:20:36 -07003771}
3772
3773/* ----------------------------------------------------------------------- */
3774/* Imagenation L-Model PXC200 Framegrabber */
3775/* This is basically the same procedure as
3776 * used by Alessandro Rubini in his pxc200
3777 * driver, but using BTTV functions */
3778
3779static void __devinit init_PXC200(struct bttv *btv)
3780{
3781 static int vals[] __devinitdata = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d,
3782 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
3783 0x00 };
3784 unsigned int i;
3785 int tmp;
3786 u32 val;
3787
3788 /* Initialise GPIO-connevted stuff */
3789 gpio_inout(0xffffff, (1<<13));
3790 gpio_write(0);
3791 udelay(3);
3792 gpio_write(1<<13);
3793 /* GPIO inputs are pulled up, so no need to drive
3794 * reset pin any longer */
3795 gpio_bits(0xffffff, 0);
3796 if (bttv_gpio)
3797 bttv_gpio_tracking(btv,"pxc200");
3798
3799 /* we could/should try and reset/control the AD pots? but
3800 right now we simply turned off the crushing. Without
3801 this the AGC drifts drifts
3802 remember the EN is reverse logic -->
3803 setting BT848_ADC_AGC_EN disable the AGC
3804 tboult@eecs.lehigh.edu
3805 */
3806
3807 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
3808
3809 /* Initialise MAX517 DAC */
3810 printk(KERN_INFO "Setting DAC reference voltage level ...\n");
3811 bttv_I2CWrite(btv,0x5E,0,0x80,1);
3812
3813 /* Initialise 12C508 PIC */
3814 /* The I2CWrite and I2CRead commmands are actually to the
3815 * same chips - but the R/W bit is included in the address
3816 * argument so the numbers are different */
3817
3818
3819 printk(KERN_INFO "Initialising 12C508 PIC chip ...\n");
3820
3821 /* First of all, enable the clock line. This is used in the PXC200-F */
3822 val = btread(BT848_GPIO_DMA_CTL);
3823 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
3824 btwrite(val, BT848_GPIO_DMA_CTL);
3825
3826 /* Then, push to 0 the reset pin long enough to reset the *
3827 * device same as above for the reset line, but not the same
3828 * value sent to the GPIO-connected stuff
3829 * which one is the good one? */
3830 gpio_inout(0xffffff,(1<<2));
3831 gpio_write(0);
3832 udelay(10);
3833 gpio_write(1<<2);
3834
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08003835 for (i = 0; i < ARRAY_SIZE(vals); i++) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07003836 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
3837 if (tmp != -1) {
3838 printk(KERN_INFO
3839 "I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
3840 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
3841 }
3842 }
3843
3844 printk(KERN_INFO "PXC200 Initialised.\n");
3845}
3846
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003847
3848
Peter Skipworth93b43f12005-06-23 22:04:45 -07003849/* ----------------------------------------------------------------------- */
3850/*
3851 * The Adlink RTV-24 (aka Angelo) has some special initialisation to unlock
3852 * it. This apparently involves the following procedure for each 878 chip:
3853 *
3854 * 1) write 0x00C3FEFF to the GPIO_OUT_EN register
3855 *
3856 * 2) write to GPIO_DATA
3857 * - 0x0E
3858 * - sleep 1ms
3859 * - 0x10 + 0x0E
3860 * - sleep 10ms
3861 * - 0x0E
3862 * read from GPIO_DATA into buf (uint_32)
3863 * - if ( data>>18 & 0x01 != 0) || ( buf>>19 & 0x01 != 1 )
3864 * error. ERROR_CPLD_Check_Failed stop.
3865 *
3866 * 3) write to GPIO_DATA
3867 * - write 0x4400 + 0x0E
3868 * - sleep 10ms
3869 * - write 0x4410 + 0x0E
3870 * - sleep 1ms
3871 * - write 0x0E
3872 * read from GPIO_DATA into buf (uint_32)
3873 * - if ( buf>>18 & 0x01 ) || ( buf>>19 && 0x01 != 0 )
3874 * error. ERROR_CPLD_Check_Failed.
3875 */
3876/* ----------------------------------------------------------------------- */
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003877void
3878init_RTV24 (struct bttv *btv)
Peter Skipworth93b43f12005-06-23 22:04:45 -07003879{
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003880 uint32_t dataRead = 0;
3881 long watchdog_value = 0x0E;
Peter Skipworth93b43f12005-06-23 22:04:45 -07003882
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003883 printk (KERN_INFO
3884 "bttv%d: Adlink RTV-24 initialisation in progress ...\n",
Peter Skipworth93b43f12005-06-23 22:04:45 -07003885 btv->c.nr);
3886
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003887 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003888
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003889 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
3890 msleep (1);
3891 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
3892 msleep (10);
3893 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003894
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003895 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003896
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003897 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
3898 printk (KERN_INFO
3899 "bttv%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
3900 btv->c.nr, dataRead);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003901 }
3902
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003903 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
3904 msleep (10);
3905 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
3906 msleep (1);
3907 btwrite (watchdog_value, BT848_GPIO_DATA);
3908 msleep (1);
3909 dataRead = btread (BT848_GPIO_DATA);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003910
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003911 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
3912 printk (KERN_INFO
3913 "bttv%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
3914 btv->c.nr, dataRead);
3915
Peter Skipworth93b43f12005-06-23 22:04:45 -07003916 return;
3917 }
3918
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003919 printk (KERN_INFO
3920 "bttv%d: Adlink RTV-24 initialisation complete.\n", btv->c.nr);
Peter Skipworth93b43f12005-06-23 22:04:45 -07003921}
Linus Torvalds1da177e2005-04-16 15:20:36 -07003922
Mauro Carvalho Chehab2d03e282005-06-23 22:04:58 -07003923
3924
Linus Torvalds1da177e2005-04-16 15:20:36 -07003925/* ----------------------------------------------------------------------- */
3926/* Miro Pro radio stuff -- the tea5757 is connected to some GPIO ports */
3927/*
3928 * Copyright (c) 1999 Csaba Halasz <qgehali@uni-miskolc.hu>
3929 * This code is placed under the terms of the GNU General Public License
3930 *
3931 * Brutally hacked by Dan Sheridan <dan.sheridan@contact.org.uk> djs52 8/3/00
3932 */
3933
3934static void bus_low(struct bttv *btv, int bit)
3935{
3936 if (btv->mbox_ior) {
3937 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3938 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3939 udelay(5);
3940 }
3941
3942 gpio_bits(bit,0);
3943 udelay(5);
3944
3945 if (btv->mbox_ior) {
3946 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3947 udelay(5);
3948 }
3949}
3950
3951static void bus_high(struct bttv *btv, int bit)
3952{
3953 if (btv->mbox_ior) {
3954 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3955 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3956 udelay(5);
3957 }
3958
3959 gpio_bits(bit,bit);
3960 udelay(5);
3961
3962 if (btv->mbox_ior) {
3963 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3964 udelay(5);
3965 }
3966}
3967
3968static int bus_in(struct bttv *btv, int bit)
3969{
3970 if (btv->mbox_ior) {
3971 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3972 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3973 udelay(5);
3974
3975 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3976 udelay(5);
3977 }
3978 return gpio_read() & (bit);
3979}
3980
3981/* TEA5757 register bits */
3982#define TEA_FREQ 0:14
3983#define TEA_BUFFER 15:15
3984
3985#define TEA_SIGNAL_STRENGTH 16:17
3986
3987#define TEA_PORT1 18:18
3988#define TEA_PORT0 19:19
3989
3990#define TEA_BAND 20:21
3991#define TEA_BAND_FM 0
3992#define TEA_BAND_MW 1
3993#define TEA_BAND_LW 2
3994#define TEA_BAND_SW 3
3995
3996#define TEA_MONO 22:22
3997#define TEA_ALLOW_STEREO 0
3998#define TEA_FORCE_MONO 1
3999
4000#define TEA_SEARCH_DIRECTION 23:23
4001#define TEA_SEARCH_DOWN 0
4002#define TEA_SEARCH_UP 1
4003
4004#define TEA_STATUS 24:24
4005#define TEA_STATUS_TUNED 0
4006#define TEA_STATUS_SEARCHING 1
4007
4008/* Low-level stuff */
4009static int tea5757_read(struct bttv *btv)
4010{
4011 unsigned long timeout;
4012 int value = 0;
4013 int i;
4014
4015 /* better safe than sorry */
4016 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we);
4017
4018 if (btv->mbox_ior) {
4019 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4020 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4021 udelay(5);
4022 }
4023
4024 if (bttv_gpio)
4025 bttv_gpio_tracking(btv,"tea5757 read");
4026
4027 bus_low(btv,btv->mbox_we);
4028 bus_low(btv,btv->mbox_clk);
4029
4030 udelay(10);
4031 timeout= jiffies + HZ;
4032
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004033 /* wait for DATA line to go low; error if it doesn't */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004034 while (bus_in(btv,btv->mbox_data) && time_before(jiffies, timeout))
4035 schedule();
4036 if (bus_in(btv,btv->mbox_data)) {
4037 printk(KERN_WARNING "bttv%d: tea5757: read timeout\n",btv->c.nr);
4038 return -1;
4039 }
4040
4041 dprintk("bttv%d: tea5757:",btv->c.nr);
4042 for(i = 0; i < 24; i++)
4043 {
4044 udelay(5);
4045 bus_high(btv,btv->mbox_clk);
4046 udelay(5);
4047 dprintk("%c",(bus_in(btv,btv->mbox_most) == 0)?'T':'-');
4048 bus_low(btv,btv->mbox_clk);
4049 value <<= 1;
4050 value |= (bus_in(btv,btv->mbox_data) == 0)?0:1; /* MSB first */
4051 dprintk("%c", (bus_in(btv,btv->mbox_most) == 0)?'S':'M');
4052 }
4053 dprintk("\nbttv%d: tea5757: read 0x%X\n", btv->c.nr, value);
4054 return value;
4055}
4056
4057static int tea5757_write(struct bttv *btv, int value)
4058{
4059 int i;
4060 int reg = value;
4061
4062 gpio_inout(btv->mbox_mask, btv->mbox_clk | btv->mbox_we | btv->mbox_data);
4063
4064 if (btv->mbox_ior) {
4065 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
4066 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
4067 udelay(5);
4068 }
4069 if (bttv_gpio)
4070 bttv_gpio_tracking(btv,"tea5757 write");
4071
4072 dprintk("bttv%d: tea5757: write 0x%X\n", btv->c.nr, value);
4073 bus_low(btv,btv->mbox_clk);
4074 bus_high(btv,btv->mbox_we);
4075 for(i = 0; i < 25; i++)
4076 {
4077 if (reg & 0x1000000)
4078 bus_high(btv,btv->mbox_data);
4079 else
4080 bus_low(btv,btv->mbox_data);
4081 reg <<= 1;
4082 bus_high(btv,btv->mbox_clk);
4083 udelay(10);
4084 bus_low(btv,btv->mbox_clk);
4085 udelay(10);
4086 }
4087 bus_low(btv,btv->mbox_we); /* unmute !!! */
4088 return 0;
4089}
4090
4091void tea5757_set_freq(struct bttv *btv, unsigned short freq)
4092{
4093 dprintk("tea5757_set_freq %d\n",freq);
4094 tea5757_write(btv, 5 * freq + 0x358); /* add 10.7MHz (see docs) */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004095}
4096
4097
4098/* ----------------------------------------------------------------------- */
4099/* winview */
4100
4101void winview_audio(struct bttv *btv, struct video_audio *v, int set)
4102{
4103 /* PT2254A programming Jon Tombs, jon@gte.esi.us.es */
4104 int bits_out, loops, vol, data;
4105
4106 if (!set) {
4107 /* Fixed by Leandro Lucarella <luca@linuxmendoza.org.ar (07/31/01) */
4108 v->flags |= VIDEO_AUDIO_VOLUME;
4109 return;
4110 }
4111
4112 /* 32 levels logarithmic */
4113 vol = 32 - ((v->volume>>11));
4114 /* units */
4115 bits_out = (PT2254_DBS_IN_2>>(vol%5));
4116 /* tens */
4117 bits_out |= (PT2254_DBS_IN_10>>(vol/5));
4118 bits_out |= PT2254_L_CHANNEL | PT2254_R_CHANNEL;
4119 data = gpio_read();
4120 data &= ~(WINVIEW_PT2254_CLK| WINVIEW_PT2254_DATA|
4121 WINVIEW_PT2254_STROBE);
4122 for (loops = 17; loops >= 0 ; loops--) {
4123 if (bits_out & (1<<loops))
4124 data |= WINVIEW_PT2254_DATA;
4125 else
4126 data &= ~WINVIEW_PT2254_DATA;
4127 gpio_write(data);
4128 udelay(5);
4129 data |= WINVIEW_PT2254_CLK;
4130 gpio_write(data);
4131 udelay(5);
4132 data &= ~WINVIEW_PT2254_CLK;
4133 gpio_write(data);
4134 }
4135 data |= WINVIEW_PT2254_STROBE;
4136 data &= ~WINVIEW_PT2254_DATA;
4137 gpio_write(data);
4138 udelay(10);
4139 data &= ~WINVIEW_PT2254_STROBE;
4140 gpio_write(data);
4141}
4142
4143/* ----------------------------------------------------------------------- */
4144/* mono/stereo control for various cards (which don't use i2c chips but */
4145/* connect something to the GPIO pins */
4146
4147static void
4148gvbctv3pci_audio(struct bttv *btv, struct video_audio *v, int set)
4149{
4150 unsigned int con = 0;
4151
4152 if (set) {
4153 gpio_inout(0x300, 0x300);
4154 if (v->mode & VIDEO_SOUND_LANG1)
4155 con = 0x000;
4156 if (v->mode & VIDEO_SOUND_LANG2)
4157 con = 0x300;
4158 if (v->mode & VIDEO_SOUND_STEREO)
4159 con = 0x200;
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004160/* if (v->mode & VIDEO_SOUND_MONO)
4161 * con = 0x100; */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004162 gpio_bits(0x300, con);
4163 } else {
4164 v->mode = VIDEO_SOUND_STEREO |
4165 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4166 }
4167}
4168
4169static void
4170gvbctv5pci_audio(struct bttv *btv, struct video_audio *v, int set)
4171{
4172 unsigned int val, con;
4173
Linus Torvalds1da177e2005-04-16 15:20:36 -07004174 if (btv->radio_user)
4175 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004176
4177 val = gpio_read();
4178 if (set) {
4179 con = 0x000;
4180 if (v->mode & VIDEO_SOUND_LANG2) {
4181 if (v->mode & VIDEO_SOUND_LANG1) {
4182 /* LANG1 + LANG2 */
4183 con = 0x100;
4184 }
4185 else {
4186 /* LANG2 */
4187 con = 0x300;
4188 }
4189 }
4190 if (con != (val & 0x300)) {
4191 gpio_bits(0x300, con);
4192 if (bttv_gpio)
4193 bttv_gpio_tracking(btv,"gvbctv5pci");
4194 }
4195 } else {
4196 switch (val & 0x70) {
4197 case 0x10:
4198 v->mode = VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4199 break;
4200 case 0x30:
4201 v->mode = VIDEO_SOUND_LANG2;
4202 break;
4203 case 0x50:
4204 v->mode = VIDEO_SOUND_LANG1;
4205 break;
4206 case 0x60:
4207 v->mode = VIDEO_SOUND_STEREO;
4208 break;
4209 case 0x70:
4210 v->mode = VIDEO_SOUND_MONO;
4211 break;
4212 default:
4213 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4214 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4215 }
4216 }
4217}
4218
4219/*
4220 * Mario Medina Nussbaum <medisoft@alohabbs.org.mx>
4221 * I discover that on BT848_GPIO_DATA address a byte 0xcce enable stereo,
4222 * 0xdde enables mono and 0xccd enables sap
4223 *
4224 * Petr Vandrovec <VANDROVE@vc.cvut.cz>
4225 * P.S.: At least mask in line above is wrong - GPIO pins 3,2 select
4226 * input/output sound connection, so both must be set for output mode.
4227 *
4228 * Looks like it's needed only for the "tvphone", the "tvphone 98"
4229 * handles this with a tda9840
4230 *
4231 */
4232static void
4233avermedia_tvphone_audio(struct bttv *btv, struct video_audio *v, int set)
4234{
4235 int val = 0;
4236
4237 if (set) {
4238 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4239 val = 0x02;
4240 if (v->mode & VIDEO_SOUND_STEREO)
4241 val = 0x01;
4242 if (val) {
4243 gpio_bits(0x03,val);
4244 if (bttv_gpio)
4245 bttv_gpio_tracking(btv,"avermedia");
4246 }
4247 } else {
4248 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4249 VIDEO_SOUND_LANG1;
4250 return;
4251 }
4252}
4253
4254static void
4255avermedia_tv_stereo_audio(struct bttv *btv, struct video_audio *v, int set)
4256{
4257 int val = 0;
4258
4259 if (set) {
4260 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4261 val = 0x01;
4262 if (v->mode & VIDEO_SOUND_STEREO) /* STEREO */
4263 val = 0x02;
4264 btaor(val, ~0x03, BT848_GPIO_DATA);
4265 if (bttv_gpio)
4266 bttv_gpio_tracking(btv,"avermedia");
4267 } else {
4268 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4269 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4270 return;
4271 }
4272}
4273
4274/* Lifetec 9415 handling */
4275static void
4276lt9415_audio(struct bttv *btv, struct video_audio *v, int set)
4277{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004278 int val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004279
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004280 if (gpio_read() & 0x4000) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004281 v->mode = VIDEO_SOUND_MONO;
4282 return;
4283 }
4284
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004285 if (set) {
4286 if (v->mode & VIDEO_SOUND_LANG2) /* A2 SAP */
4287 val = 0x0080;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004288 if (v->mode & VIDEO_SOUND_STEREO) /* A2 stereo */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004289 val = 0x0880;
4290 if ((v->mode & VIDEO_SOUND_LANG1) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -07004291 (v->mode & VIDEO_SOUND_MONO))
4292 val = 0;
4293 gpio_bits(0x0880, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004294 if (bttv_gpio)
4295 bttv_gpio_tracking(btv,"lt9415");
4296 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004297 /* autodetect doesn't work with this card :-( */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004298 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
Linus Torvalds1da177e2005-04-16 15:20:36 -07004299 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004300 return;
4301 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004302}
4303
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004304/* TDA9821 on TerraTV+ Bt848, Bt878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004305static void
4306terratv_audio(struct bttv *btv, struct video_audio *v, int set)
4307{
4308 unsigned int con = 0;
4309
4310 if (set) {
4311 gpio_inout(0x180000,0x180000);
4312 if (v->mode & VIDEO_SOUND_LANG2)
4313 con = 0x080000;
4314 if (v->mode & VIDEO_SOUND_STEREO)
4315 con = 0x180000;
4316 gpio_bits(0x180000, con);
4317 if (bttv_gpio)
4318 bttv_gpio_tracking(btv,"terratv");
4319 } else {
4320 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4321 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4322 }
4323}
4324
4325static void
4326winfast2000_audio(struct bttv *btv, struct video_audio *v, int set)
4327{
4328 unsigned long val = 0;
4329
4330 if (set) {
4331 /*btor (0xc32000, BT848_GPIO_OUT_EN);*/
4332 if (v->mode & VIDEO_SOUND_MONO) /* Mono */
4333 val = 0x420000;
4334 if (v->mode & VIDEO_SOUND_LANG1) /* Mono */
4335 val = 0x420000;
4336 if (v->mode & VIDEO_SOUND_LANG2) /* SAP */
4337 val = 0x410000;
4338 if (v->mode & VIDEO_SOUND_STEREO) /* Stereo */
4339 val = 0x020000;
4340 if (val) {
4341 gpio_bits(0x430000, val);
4342 if (bttv_gpio)
4343 bttv_gpio_tracking(btv,"winfast2000");
4344 }
4345 } else {
4346 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4347 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4348 }
4349}
4350
4351/*
4352 * Dariusz Kowalewski <darekk@automex.pl>
4353 * sound control for Prolink PV-BT878P+9B (PixelView PlayTV Pro FM+NICAM
4354 * revision 9B has on-board TDA9874A sound decoder).
4355 *
4356 * Note: There are card variants without tda9874a. Forcing the "stereo sound route"
4357 * will mute this cards.
4358 */
4359static void
4360pvbt878p9b_audio(struct bttv *btv, struct video_audio *v, int set)
4361{
4362 unsigned int val = 0;
4363
Linus Torvalds1da177e2005-04-16 15:20:36 -07004364 if (btv->radio_user)
4365 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004366
4367 if (set) {
4368 if (v->mode & VIDEO_SOUND_MONO) {
4369 val = 0x01;
4370 }
4371 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4372 || (v->mode & VIDEO_SOUND_STEREO)) {
4373 val = 0x02;
4374 }
4375 if (val) {
4376 gpio_bits(0x03,val);
4377 if (bttv_gpio)
4378 bttv_gpio_tracking(btv,"pvbt878p9b");
4379 }
4380 } else {
4381 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4382 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4383 }
4384}
4385
4386/*
4387 * Dariusz Kowalewski <darekk@automex.pl>
4388 * sound control for FlyVideo 2000S (with tda9874 decoder)
4389 * based on pvbt878p9b_audio() - this is not tested, please fix!!!
4390 */
4391static void
4392fv2000s_audio(struct bttv *btv, struct video_audio *v, int set)
4393{
4394 unsigned int val = 0xffff;
4395
Linus Torvalds1da177e2005-04-16 15:20:36 -07004396 if (btv->radio_user)
4397 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004398 if (set) {
4399 if (v->mode & VIDEO_SOUND_MONO) {
4400 val = 0x0000;
4401 }
4402 if ((v->mode & (VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2))
4403 || (v->mode & VIDEO_SOUND_STEREO)) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004404 val = 0x1080; /*-dk-???: 0x0880, 0x0080, 0x1800 ... */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004405 }
4406 if (val != 0xffff) {
4407 gpio_bits(0x1800, val);
4408 if (bttv_gpio)
4409 bttv_gpio_tracking(btv,"fv2000s");
4410 }
4411 } else {
4412 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4413 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4414 }
4415}
4416
4417/*
4418 * sound control for Canopus WinDVR PCI
4419 * Masaki Suzuki <masaki@btree.org>
4420 */
4421static void
4422windvr_audio(struct bttv *btv, struct video_audio *v, int set)
4423{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004424 unsigned long val = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004425
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004426 if (set) {
4427 if (v->mode & VIDEO_SOUND_MONO)
4428 val = 0x040000;
4429 if (v->mode & VIDEO_SOUND_LANG1)
4430 val = 0;
4431 if (v->mode & VIDEO_SOUND_LANG2)
4432 val = 0x100000;
4433 if (v->mode & VIDEO_SOUND_STEREO)
4434 val = 0;
4435 if (val) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004436 gpio_bits(0x140000, val);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004437 if (bttv_gpio)
Mauro Carvalho Chehabf2421ca2005-11-08 21:37:45 -08004438 bttv_gpio_tracking(btv,"windvr");
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004439 }
4440 } else {
4441 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4442 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4443 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004444}
4445
4446/*
4447 * sound control for AD-TVK503
4448 * Hiroshi Takekawa <sian@big.or.jp>
4449 */
4450static void
4451adtvk503_audio(struct bttv *btv, struct video_audio *v, int set)
4452{
4453 unsigned int con = 0xffffff;
4454
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004455 /* btaor(0x1e0000, ~0x1e0000, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004456
4457 if (set) {
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004458 /* btor(***, BT848_GPIO_OUT_EN); */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004459 if (v->mode & VIDEO_SOUND_LANG1)
4460 con = 0x00000000;
4461 if (v->mode & VIDEO_SOUND_LANG2)
4462 con = 0x00180000;
4463 if (v->mode & VIDEO_SOUND_STEREO)
4464 con = 0x00000000;
4465 if (v->mode & VIDEO_SOUND_MONO)
4466 con = 0x00060000;
4467 if (con != 0xffffff) {
4468 gpio_bits(0x1e0000,con);
4469 if (bttv_gpio)
4470 bttv_gpio_tracking(btv, "adtvk503");
4471 }
4472 } else {
4473 v->mode = VIDEO_SOUND_MONO | VIDEO_SOUND_STEREO |
4474 VIDEO_SOUND_LANG1 | VIDEO_SOUND_LANG2;
4475 }
4476}
4477
4478/* RemoteVision MX (rv605) muxsel helper [Miguel Freitas]
4479 *
4480 * This is needed because rv605 don't use a normal multiplex, but a crosspoint
4481 * switch instead (CD22M3494E). This IC can have multiple active connections
4482 * between Xn (input) and Yn (output) pins. We need to clear any existing
4483 * connection prior to establish a new one, pulsing the STROBE pin.
4484 *
4485 * The board hardwire Y0 (xpoint) to MUX1 and MUXOUT to Yin.
4486 * GPIO pins are wired as:
4487 * GPIO[0:3] - AX[0:3] (xpoint) - P1[0:3] (microcontroler)
4488 * GPIO[4:6] - AY[0:2] (xpoint) - P1[4:6] (microcontroler)
4489 * GPIO[7] - DATA (xpoint) - P1[7] (microcontroler)
4490 * GPIO[8] - - P3[5] (microcontroler)
4491 * GPIO[9] - RESET (xpoint) - P3[6] (microcontroler)
4492 * GPIO[10] - STROBE (xpoint) - P3[7] (microcontroler)
4493 * GPINTR - - P3[4] (microcontroler)
4494 *
4495 * The microcontroler is a 80C32 like. It should be possible to change xpoint
4496 * configuration either directly (as we are doing) or using the microcontroler
4497 * which is also wired to I2C interface. I have no further info on the
4498 * microcontroler features, one would need to disassembly the firmware.
4499 * note: the vendor refused to give any information on this product, all
4500 * that stuff was found using a multimeter! :)
4501 */
4502static void rv605_muxsel(struct bttv *btv, unsigned int input)
4503{
4504 /* reset all conections */
4505 gpio_bits(0x200,0x200);
4506 mdelay(1);
4507 gpio_bits(0x200,0x000);
4508 mdelay(1);
4509
4510 /* create a new conection */
4511 gpio_bits(0x480,0x080);
4512 gpio_bits(0x480,0x480);
4513 mdelay(1);
4514 gpio_bits(0x480,0x080);
4515 mdelay(1);
4516}
4517
4518/* Tibet Systems 'Progress DVR' CS16 muxsel helper [Chris Fanning]
4519 *
4520 * The CS16 (available on eBay cheap) is a PCI board with four Fusion
4521 * 878A chips, a PCI bridge, an Atmel microcontroller, four sync seperator
4522 * chips, ten eight input analog multiplexors, a not chip and a few
4523 * other components.
4524 *
4525 * 16 inputs on a secondary bracket are provided and can be selected
4526 * from each of the four capture chips. Two of the eight input
4527 * multiplexors are used to select from any of the 16 input signals.
4528 *
4529 * Unsupported hardware capabilities:
4530 * . A video output monitor on the secondary bracket can be selected from
4531 * one of the 878A chips.
4532 * . Another passthrough but I haven't spent any time investigating it.
4533 * . Digital I/O (logic level connected to GPIO) is available from an
4534 * onboard header.
4535 *
4536 * The on chip input mux should always be set to 2.
4537 * GPIO[16:19] - Video input selection
4538 * GPIO[0:3] - Video output monitor select (only available from one 878A)
4539 * GPIO[?:?] - Digital I/O.
4540 *
4541 * There is an ATMEL microcontroller with an 8031 core on board. I have not
4542 * determined what function (if any) it provides. With the microcontroller
4543 * and sync seperator chips a guess is that it might have to do with video
4544 * switching and maybe some digital I/O.
4545 */
4546static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4547{
4548 /* video mux */
4549 gpio_bits(0x0f0000, input << 16);
4550}
4551
4552static void tibetCS16_init(struct bttv *btv)
4553{
4554 /* enable gpio bits, mask obtained via btSpy */
4555 gpio_inout(0xffffff, 0x0f7fff);
4556 gpio_write(0x0f7fff);
4557}
4558
4559/*
4560 * The following routines for the Kodicom-4400r get a little mind-twisting.
4561 * There is a "master" controller and three "slave" controllers, together
4562 * an analog switch which connects any of 16 cameras to any of the BT87A's.
4563 * The analog switch is controlled by the "master", but the detection order
4564 * of the four BT878A chips is in an order which I just don't understand.
4565 * The "master" is actually the second controller to be detected. The
4566 * logic on the board uses logical numbers for the 4 controlers, but
4567 * those numbers are different from the detection sequence. When working
4568 * with the analog switch, we need to "map" from the detection sequence
4569 * over to the board's logical controller number. This mapping sequence
4570 * is {3, 0, 2, 1}, i.e. the first controller to be detected is logical
4571 * unit 3, the second (which is the master) is logical unit 0, etc.
4572 * We need to maintain the status of the analog switch (which of the 16
4573 * cameras is connected to which of the 4 controllers). Rather than
4574 * add to the bttv structure for this, we use the data reserved for
4575 * the mbox (unused for this card type).
4576 */
4577
4578/*
4579 * First a routine to set the analog switch, which controls which camera
4580 * is routed to which controller. The switch comprises an X-address
4581 * (gpio bits 0-3, representing the camera, ranging from 0-15), and a
4582 * Y-address (gpio bits 4-6, representing the controller, ranging from 0-3).
4583 * A data value (gpio bit 7) of '1' enables the switch, and '0' disables
4584 * the switch. A STROBE bit (gpio bit 8) latches the data value into the
4585 * specified address. The idea is to set the address and data, then bring
4586 * STROBE high, and finally bring STROBE back to low.
4587 */
4588static void kodicom4400r_write(struct bttv *btv,
4589 unsigned char xaddr,
4590 unsigned char yaddr,
4591 unsigned char data) {
4592 unsigned int udata;
4593
4594 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4595 gpio_bits(0x1ff, udata); /* write ADDR and DAT */
4596 gpio_bits(0x1ff, udata | (1 << 8)); /* strobe high */
4597 gpio_bits(0x1ff, udata); /* strobe low */
4598}
4599
4600/*
4601 * Next the mux select. Both the "master" and "slave" 'cards' (controllers)
4602 * use this routine. The routine finds the "master" for the card, maps
4603 * the controller number from the detected position over to the logical
4604 * number, writes the appropriate data to the analog switch, and housekeeps
4605 * the local copy of the switch information. The parameter 'input' is the
4606 * requested camera number (0 - 15).
4607 */
4608static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4609{
4610 char *sw_status;
4611 int xaddr, yaddr;
4612 struct bttv *mctlr;
4613 static unsigned char map[4] = {3, 0, 2, 1};
4614
4615 mctlr = master[btv->c.nr];
4616 if (mctlr == NULL) { /* ignore if master not yet detected */
4617 return;
4618 }
4619 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3; /* the '&' is for safety */
4620 yaddr = map[yaddr];
4621 sw_status = (char *)(&mctlr->mbox_we);
4622 xaddr = input & 0xf;
4623 /* Check if the controller/camera pair has changed, else ignore */
4624 if (sw_status[yaddr] != xaddr)
4625 {
4626 /* "open" the old switch, "close" the new one, save the new */
4627 kodicom4400r_write(mctlr, sw_status[yaddr], yaddr, 0);
4628 sw_status[yaddr] = xaddr;
4629 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4630 }
4631}
4632
4633/*
4634 * During initialisation, we need to reset the analog switch. We
4635 * also preset the switch to map the 4 connectors on the card to the
4636 * *user's* (see above description of kodicom4400r_muxsel) channels
4637 * 0 through 3
4638 */
4639static void kodicom4400r_init(struct bttv *btv)
4640{
4641 char *sw_status = (char *)(&btv->mbox_we);
4642 int ix;
4643
4644 gpio_inout(0x0003ff, 0x0003ff);
4645 gpio_write(1 << 9); /* reset MUX */
4646 gpio_write(0);
4647 /* Preset camera 0 to the 4 controllers */
4648 for (ix=0; ix<4; ix++) {
4649 sw_status[ix] = ix;
4650 kodicom4400r_write(btv, ix, ix, 1);
4651 }
4652 /*
4653 * Since this is the "master", we need to set up the
4654 * other three controller chips' pointers to this structure
4655 * for later use in the muxsel routine.
4656 */
4657 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4658 return;
4659 master[btv->c.nr-1] = btv;
4660 master[btv->c.nr] = btv;
4661 master[btv->c.nr+1] = btv;
4662 master[btv->c.nr+2] = btv;
4663}
4664
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004665/* The Grandtec X-Guard framegrabber card uses two Dual 4-channel
4666 * video multiplexers to provide up to 16 video inputs. These
4667 * multiplexers are controlled by the lower 8 GPIO pins of the
4668 * bt878. The multiplexers probably Pericom PI5V331Q or similar.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004669
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004670 * xxx0 is pin xxx of multiplexer U5,
4671 * yyy1 is pin yyy of multiplexer U2
4672 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004673#define ENA0 0x01
4674#define ENB0 0x02
4675#define ENA1 0x04
4676#define ENB1 0x08
4677
4678#define IN10 0x10
4679#define IN00 0x20
4680#define IN11 0x40
4681#define IN01 0x80
4682
4683static void xguard_muxsel(struct bttv *btv, unsigned int input)
4684{
4685 static const int masks[] = {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004686 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4687 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4688 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4689 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004690 };
4691 gpio_write(masks[input%16]);
4692}
4693static void picolo_tetra_init(struct bttv *btv)
4694{
4695 /*This is the video input redirection fonctionality : I DID NOT USED IT. */
4696 btwrite (0x08<<16,BT848_GPIO_DATA);/*GPIO[19] [==> 4053 B+C] set to 1 */
4697 btwrite (0x04<<16,BT848_GPIO_DATA);/*GPIO[18] [==> 4053 A] set to 1*/
4698}
4699static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4700{
4701
4702 dprintk (KERN_DEBUG "bttv%d : picolo_tetra_muxsel => input = %d\n",btv->c.nr,input);
4703 /*Just set the right path in the analog multiplexers : channel 1 -> 4 ==> Analog Mux ==> MUX0*/
4704 /*GPIO[20]&GPIO[21] used to choose the right input*/
4705 btwrite (input<<20,BT848_GPIO_DATA);
4706
4707}
4708
4709/*
4710 * ivc120_muxsel [Added by Alan Garfield <alan@fromorbit.com>]
4711 *
4712 * The IVC120G security card has 4 i2c controlled TDA8540 matrix
4713 * swichers to provide 16 channels to MUX0. The TDA8540's have
4714 * 4 indepedant outputs and as such the IVC120G also has the
4715 * optional "Monitor Out" bus. This allows the card to be looking
4716 * at one input while the monitor is looking at another.
4717 *
4718 * Since I've couldn't be bothered figuring out how to add an
4719 * independant muxsel for the monitor bus, I've just set it to
4720 * whatever the card is looking at.
4721 *
4722 * OUT0 of the TDA8540's is connected to MUX0 (0x03)
4723 * OUT1 of the TDA8540's is connected to "Monitor Out" (0x0C)
4724 *
4725 * TDA8540_ALT3 IN0-3 = Channel 13 - 16 (0x03)
4726 * TDA8540_ALT4 IN0-3 = Channel 1 - 4 (0x03)
4727 * TDA8540_ALT5 IN0-3 = Channel 5 - 8 (0x03)
4728 * TDA8540_ALT6 IN0-3 = Channel 9 - 12 (0x03)
4729 *
4730 */
4731
4732/* All 7 possible sub-ids for the TDA8540 Matrix Switcher */
4733#define I2C_TDA8540 0x90
4734#define I2C_TDA8540_ALT1 0x92
4735#define I2C_TDA8540_ALT2 0x94
4736#define I2C_TDA8540_ALT3 0x96
4737#define I2C_TDA8540_ALT4 0x98
4738#define I2C_TDA8540_ALT5 0x9a
4739#define I2C_TDA8540_ALT6 0x9c
4740
4741static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4742{
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004743 /* Simple maths */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004744 int key = input % 4;
4745 int matrix = input / 4;
4746
4747 dprintk("bttv%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4748 btv->c.nr, input, matrix, key);
4749
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004750 /* Handles the input selection on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004751 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4752 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4753 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4754 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4755 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4756 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4757 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4758 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4759
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004760 /* Handles the output enables on the TDA8540's */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004761 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004762 ((matrix == 3) ? 0x03 : 0x00), 1); /* 13 - 16 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004763 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004764 ((matrix == 0) ? 0x03 : 0x00), 1); /* 1-4 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004765 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004766 ((matrix == 1) ? 0x03 : 0x00), 1); /* 5-8 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004767 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004768 ((matrix == 2) ? 0x03 : 0x00), 1); /* 9-12 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004769
Mauro Carvalho Chehab24a70fd2005-09-09 13:03:39 -07004770 /* Selects MUX0 for input on the 878 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07004771 btaor((0)<<5, ~(3<<5), BT848_IFORM);
4772}
4773
4774
4775/* PXC200 muxsel helper
4776 * luke@syseng.anu.edu.au
4777 * another transplant
4778 * from Alessandro Rubini (rubini@linux.it)
4779 *
4780 * There are 4 kinds of cards:
4781 * PXC200L which is bt848
4782 * PXC200F which is bt848 with PIC controlling mux
4783 * PXC200AL which is bt878
4784 * PXC200AF which is bt878 with PIC controlling mux
4785 */
4786#define PX_CFG_PXC200F 0x01
4787#define PX_FLAG_PXC200A 0x00001000 /* a pxc200A is bt-878 based */
4788#define PX_I2C_PIC 0x0f
4789#define PX_PXC200A_CARDID 0x200a1295
4790#define PX_I2C_CMD_CFG 0x00
4791
4792static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4793{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004794 int rc;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004795 long mux;
4796 int bitmask;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004797 unsigned char buf[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -07004798
4799 /* Read PIC config to determine if this is a PXC200F */
4800 /* PX_I2C_CMD_CFG*/
4801 buf[0]=0;
4802 buf[1]=0;
4803 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4804 if (rc) {
4805 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: pic cfg write failed:%d\n", btv->c.nr,rc);
4806 /* not PXC ? do nothing */
4807 return;
4808 }
4809
4810 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4811 if (!(rc & PX_CFG_PXC200F)) {
4812 printk(KERN_DEBUG "bttv%d: PXC200_muxsel: not PXC200F rc:%d \n", btv->c.nr,rc);
4813 return;
4814 }
4815
4816
4817 /* The multiplexer in the 200F is handled by the GPIO port */
4818 /* get correct mapping between inputs */
4819 /* mux = bttv_tvcards[btv->type].muxsel[input] & 3; */
4820 /* ** not needed!? */
4821 mux = input;
4822
4823 /* make sure output pins are enabled */
4824 /* bitmask=0x30f; */
4825 bitmask=0x302;
4826 /* check whether we have a PXC200A */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004827 if (btv->cardid == PX_PXC200A_CARDID) {
Linus Torvalds1da177e2005-04-16 15:20:36 -07004828 bitmask ^= 0x180; /* use 7 and 9, not 8 and 9 */
4829 bitmask |= 7<<4; /* the DAC */
4830 }
4831 btwrite(bitmask, BT848_GPIO_OUT_EN);
4832
4833 bitmask = btread(BT848_GPIO_DATA);
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004834 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004835 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4836 else /* older device */
4837 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4838 btwrite(bitmask,BT848_GPIO_DATA);
4839
4840 /*
4841 * Was "to be safe, set the bt848 to input 0"
4842 * Actually, since it's ok at load time, better not messing
4843 * with these bits (on PXC200AF you need to set mux 2 here)
4844 *
4845 * needed because bttv-driver sets mux before calling this function
4846 */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004847 if (btv->cardid == PX_PXC200A_CARDID)
Linus Torvalds1da177e2005-04-16 15:20:36 -07004848 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4849 else /* older device */
4850 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4851
4852 printk(KERN_DEBUG "bttv%d: setting input channel to:%d\n", btv->c.nr,(int)mux);
4853}
4854
4855/* ----------------------------------------------------------------------- */
4856/* motherboard chipset specific stuff */
4857
4858void __devinit bttv_check_chipset(void)
4859{
4860 int pcipci_fail = 0;
4861 struct pci_dev *dev = NULL;
4862
4863 if (pci_pci_problems & PCIPCI_FAIL)
4864 pcipci_fail = 1;
4865 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4866 triton1 = 1;
4867 if (pci_pci_problems & PCIPCI_VSFX)
4868 vsfx = 1;
4869#ifdef PCIPCI_ALIMAGIK
4870 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4871 latency = 0x0A;
4872#endif
4873
Linus Torvalds1da177e2005-04-16 15:20:36 -07004874
4875 /* print warnings about any quirks found */
4876 if (triton1)
4877 printk(KERN_INFO "bttv: Host bridge needs ETBF enabled.\n");
4878 if (vsfx)
4879 printk(KERN_INFO "bttv: Host bridge needs VSFX enabled.\n");
4880 if (pcipci_fail) {
4881 printk(KERN_WARNING "bttv: BT848 and your chipset may not work together.\n");
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004882 if (!no_overlay) {
4883 printk(KERN_WARNING "bttv: overlay will be disabled.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004884 no_overlay = 1;
Mauro Carvalho Chehab4dcef522005-08-04 12:53:30 -07004885 } else {
4886 printk(KERN_WARNING "bttv: overlay forced. Use this option at your own risk.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -07004887 }
4888 }
4889 if (UNSET != latency)
4890 printk(KERN_INFO "bttv: pci latency fixup [%d]\n",latency);
Mauro Carvalho Chehab2bfa1ac2005-11-08 21:36:51 -08004891 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
Linus Torvalds1da177e2005-04-16 15:20:36 -07004892 PCI_DEVICE_ID_INTEL_82441, dev))) {
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004893 unsigned char b;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004894 pci_read_config_byte(dev, 0x53, &b);
4895 if (bttv_debug)
4896 printk(KERN_INFO "bttv: Host bridge: 82441FX Natoma, "
4897 "bufcon=0x%02x\n",b);
4898 }
4899}
4900
4901int __devinit bttv_handle_chipset(struct bttv *btv)
4902{
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004903 unsigned char command;
Linus Torvalds1da177e2005-04-16 15:20:36 -07004904
4905 if (!triton1 && !vsfx && UNSET == latency)
4906 return 0;
4907
4908 if (bttv_verbose) {
4909 if (triton1)
4910 printk(KERN_INFO "bttv%d: enabling ETBF (430FX/VP3 compatibilty)\n",btv->c.nr);
4911 if (vsfx && btv->id >= 878)
4912 printk(KERN_INFO "bttv%d: enabling VSFX\n",btv->c.nr);
4913 if (UNSET != latency)
4914 printk(KERN_INFO "bttv%d: setting pci timer to %d\n",
4915 btv->c.nr,latency);
4916 }
4917
4918 if (btv->id < 878) {
4919 /* bt848 (mis)uses a bit in the irq mask for etbf */
4920 if (triton1)
4921 btv->triton1 = BT848_INT_ETBF;
4922 } else {
4923 /* bt878 has a bit in the pci config space for it */
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004924 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
Linus Torvalds1da177e2005-04-16 15:20:36 -07004925 if (triton1)
4926 command |= BT878_EN_TBFX;
4927 if (vsfx)
4928 command |= BT878_EN_VSFX;
Mauro Carvalho Chehab4ac97912005-11-08 21:37:43 -08004929 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4930 }
Linus Torvalds1da177e2005-04-16 15:20:36 -07004931 if (UNSET != latency)
4932 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4933 return 0;
4934}
4935
4936
4937/*
4938 * Local variables:
4939 * c-basic-offset: 8
4940 * End:
4941 */