1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
29
30#include <linux/delay.h>
31#include <linux/module.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#include <net/checksum.h>
38
39#include <asm/unaligned.h>
40#include <asm/io.h>
41
42#include "bttvp.h"
43#include <media/v4l2-common.h>
44#include <media/i2c/tvaudio.h>
45#include "bttv-audio-hook.h"
46
47
48static void boot_msp34xx(struct bttv *btv, int pin);
49static void hauppauge_eeprom(struct bttv *btv);
50static void avermedia_eeprom(struct bttv *btv);
51static void osprey_eeprom(struct bttv *btv, const u8 ee[256]);
52static void modtec_eeprom(struct bttv *btv);
53static void init_PXC200(struct bttv *btv);
54static void init_RTV24(struct bttv *btv);
55static void init_PCI8604PW(struct bttv *btv);
56
57static void rv605_muxsel(struct bttv *btv, unsigned int input);
58static void eagle_muxsel(struct bttv *btv, unsigned int input);
59static void xguard_muxsel(struct bttv *btv, unsigned int input);
60static void ivc120_muxsel(struct bttv *btv, unsigned int input);
61static void gvc1100_muxsel(struct bttv *btv, unsigned int input);
62
63static void PXC200_muxsel(struct bttv *btv, unsigned int input);
64
65static void picolo_tetra_muxsel(struct bttv *btv, unsigned int input);
66static void picolo_tetra_init(struct bttv *btv);
67
68static void tibetCS16_muxsel(struct bttv *btv, unsigned int input);
69static void tibetCS16_init(struct bttv *btv);
70
71static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input);
72static void kodicom4400r_init(struct bttv *btv);
73
74static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input);
75static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input);
76
77static void geovision_muxsel(struct bttv *btv, unsigned int input);
78
79static void phytec_muxsel(struct bttv *btv, unsigned int input);
80
81static void gv800s_muxsel(struct bttv *btv, unsigned int input);
82static void gv800s_init(struct bttv *btv);
83
84static void td3116_muxsel(struct bttv *btv, unsigned int input);
85
86static int terratec_active_radio_upgrade(struct bttv *btv);
87static int tea575x_init(struct bttv *btv);
88static void identify_by_eeprom(struct bttv *btv,
89 unsigned char eeprom_data[256]);
90static int pvr_boot(struct bttv *btv);
91
92
93static unsigned int triton1;
94static unsigned int vsfx;
95static unsigned int latency = UNSET;
96int no_overlay=-1;
97
98static unsigned int card[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
99static unsigned int pll[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
100static unsigned int tuner[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
101static unsigned int svhs[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
102static unsigned int remote[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = UNSET };
103static unsigned int audiodev[BTTV_MAX];
104static unsigned int saa6588[BTTV_MAX];
105static struct bttv *master[BTTV_MAX] = { [ 0 ... (BTTV_MAX-1) ] = NULL };
106static unsigned int autoload = UNSET;
107static unsigned int gpiomask = UNSET;
108static unsigned int audioall = UNSET;
109static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
110
111
112module_param(triton1, int, 0444);
113module_param(vsfx, int, 0444);
114module_param(no_overlay, int, 0444);
115module_param(latency, int, 0444);
116module_param(gpiomask, int, 0444);
117module_param(audioall, int, 0444);
118module_param(autoload, int, 0444);
119
120module_param_array(card, int, NULL, 0444);
121module_param_array(pll, int, NULL, 0444);
122module_param_array(tuner, int, NULL, 0444);
123module_param_array(svhs, int, NULL, 0444);
124module_param_array(remote, int, NULL, 0444);
125module_param_array(audiodev, int, NULL, 0444);
126module_param_array(audiomux, int, NULL, 0444);
127
128MODULE_PARM_DESC(triton1, "set ETBF pci config bit [enable bug compatibility for triton1 + others]");
129MODULE_PARM_DESC(vsfx, "set VSFX pci config bit [yet another chipset flaw workaround]");
130MODULE_PARM_DESC(latency,"pci latency timer");
131MODULE_PARM_DESC(card,"specify TV/grabber card model, see CARDLIST file for a list");
132MODULE_PARM_DESC(pll, "specify installed crystal (0=none, 28=28 MHz, 35=35 MHz, 14=14 MHz)");
133MODULE_PARM_DESC(tuner,"specify installed tuner type");
134MODULE_PARM_DESC(autoload, "obsolete option, please do not use anymore");
135MODULE_PARM_DESC(audiodev, "specify audio device:\n"
136 "\t\t-1 = no audio\n"
137 "\t\t 0 = autodetect (default)\n"
138 "\t\t 1 = msp3400\n"
139 "\t\t 2 = tda7432\n"
140 "\t\t 3 = tvaudio");
141MODULE_PARM_DESC(saa6588, "if 1, then load the saa6588 RDS module, default (0) is to use the card definition.");
142MODULE_PARM_DESC(no_overlay, "allow override overlay default (0 disables, 1 enables) [some VIA/SIS chipsets are known to have problem with overlay]");
143
144
145
146
147static struct CARD {
148 unsigned id;
149 int cardnr;
150 char *name;
151} cards[] = {
152 { 0x13eb0070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV" },
153 { 0x39000070, BTTV_BOARD_HAUPPAUGE878, "Hauppauge WinTV-D" },
154 { 0x45000070, BTTV_BOARD_HAUPPAUGEPVR, "Hauppauge WinTV/PVR" },
155 { 0xff000070, BTTV_BOARD_OSPREY1x0, "Osprey-100" },
156 { 0xff010070, BTTV_BOARD_OSPREY2x0_SVID,"Osprey-200" },
157 { 0xff020070, BTTV_BOARD_OSPREY500, "Osprey-500" },
158 { 0xff030070, BTTV_BOARD_OSPREY2000, "Osprey-2000" },
159 { 0xff040070, BTTV_BOARD_OSPREY540, "Osprey-540" },
160 { 0xff070070, BTTV_BOARD_OSPREY440, "Osprey-440" },
161
162 { 0x00011002, BTTV_BOARD_ATI_TVWONDER, "ATI TV Wonder" },
163 { 0x00031002, BTTV_BOARD_ATI_TVWONDERVE,"ATI TV Wonder/VE" },
164
165 { 0x6606107d, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
166 { 0x6607107d, BTTV_BOARD_WINFASTVC100, "Leadtek WinFast VC 100" },
167 { 0x6609107d, BTTV_BOARD_WINFAST2000, "Leadtek TV 2000 XP" },
168 { 0x263610b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
169 { 0x264510b4, BTTV_BOARD_STB2, "STB TV PCI FM, Gateway P/N 6000704" },
170 { 0x402010fc, BTTV_BOARD_GVBCTV3PCI, "I-O Data Co. GV-BCTV3/PCI" },
171 { 0x405010fc, BTTV_BOARD_GVBCTV4PCI, "I-O Data Co. GV-BCTV4/PCI" },
172 { 0x407010fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
173 { 0xd01810fc, BTTV_BOARD_GVBCTV5PCI, "I-O Data Co. GV-BCTV5/PCI" },
174
175 { 0x001211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
176
177 { 0x1200bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
178 { 0xff00bd11, BTTV_BOARD_PINNACLE, "Pinnacle PCTV [bswap]" },
179
180 { 0xff1211bd, BTTV_BOARD_PINNACLE, "Pinnacle PCTV" },
181
182 { 0x3000121a, BTTV_BOARD_VOODOOTV_200, "3Dfx VoodooTV 200" },
183 { 0x263710b4, BTTV_BOARD_VOODOOTV_FM, "3Dfx VoodooTV FM" },
184 { 0x3060121a, BTTV_BOARD_STB2, "3Dfx VoodooTV 100/ STB OEM" },
185
186 { 0x3000144f, BTTV_BOARD_MAGICTVIEW063, "(Askey Magic/others) TView99 CPH06x" },
187 { 0xa005144f, BTTV_BOARD_MAGICTVIEW063, "CPH06X TView99-Card" },
188 { 0x3002144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH05x" },
189 { 0x3005144f, BTTV_BOARD_MAGICTVIEW061, "(Askey Magic/others) TView99 CPH061/06L (T1/LC)" },
190 { 0x5000144f, BTTV_BOARD_MAGICTVIEW061, "Askey CPH050" },
191 { 0x300014ff, BTTV_BOARD_MAGICTVIEW061, "TView 99 (CPH061)" },
192 { 0x300214ff, BTTV_BOARD_PHOEBE_TVMAS, "Phoebe TV Master (CPH060)" },
193
194 { 0x00011461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
195 { 0x00021461, BTTV_BOARD_AVERMEDIA98, "AVermedia TVCapture 98" },
196 { 0x00031461, BTTV_BOARD_AVPHONE98, "AVerMedia TVPhone98" },
197 { 0x00041461, BTTV_BOARD_AVERMEDIA98, "AVerMedia TVCapture 98" },
198 { 0x03001461, BTTV_BOARD_AVERMEDIA98, "VDOMATE TV TUNER CARD" },
199
200 { 0x1117153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL B/G)" },
201 { 0x1118153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL B/G)" },
202 { 0x1119153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Philips PAL I)" },
203 { 0x111a153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (Temic PAL I)" },
204
205 { 0x1123153b, BTTV_BOARD_TERRATVRADIO, "Terratec TV Radio+" },
206 { 0x1127153b, BTTV_BOARD_TERRATV, "Terratec TV+ (V1.05)" },
207
208
209 { 0x1134153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue (LR102)" },
210 { 0x1135153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" },
211 { 0x5018153b, BTTV_BOARD_TERRATVALUE, "Terratec TValue" },
212 { 0xff3b153b, BTTV_BOARD_TERRATVALUER, "Terratec TValue Radio" },
213
214 { 0x400015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
215 { 0x400a15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV" },
216 { 0x400d15b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
217 { 0x401015b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
218 { 0x401615b0, BTTV_BOARD_ZOLTRIX_GENIE, "Zoltrix Genie TV / Radio" },
219
220 { 0x1430aa00, BTTV_BOARD_PV143, "Provideo PV143A" },
221 { 0x1431aa00, BTTV_BOARD_PV143, "Provideo PV143B" },
222 { 0x1432aa00, BTTV_BOARD_PV143, "Provideo PV143C" },
223 { 0x1433aa00, BTTV_BOARD_PV143, "Provideo PV143D" },
224 { 0x1433aa03, BTTV_BOARD_PV143, "Security Eyes" },
225
226 { 0x1460aa00, BTTV_BOARD_PV150, "Provideo PV150A-1" },
227 { 0x1461aa01, BTTV_BOARD_PV150, "Provideo PV150A-2" },
228 { 0x1462aa02, BTTV_BOARD_PV150, "Provideo PV150A-3" },
229 { 0x1463aa03, BTTV_BOARD_PV150, "Provideo PV150A-4" },
230
231 { 0x1464aa04, BTTV_BOARD_PV150, "Provideo PV150B-1" },
232 { 0x1465aa05, BTTV_BOARD_PV150, "Provideo PV150B-2" },
233 { 0x1466aa06, BTTV_BOARD_PV150, "Provideo PV150B-3" },
234 { 0x1467aa07, BTTV_BOARD_PV150, "Provideo PV150B-4" },
235
236 { 0xa132ff00, BTTV_BOARD_IVC100, "IVC-100" },
237 { 0xa1550000, BTTV_BOARD_IVC200, "IVC-200" },
238 { 0xa1550001, BTTV_BOARD_IVC200, "IVC-200" },
239 { 0xa1550002, BTTV_BOARD_IVC200, "IVC-200" },
240 { 0xa1550003, BTTV_BOARD_IVC200, "IVC-200" },
241 { 0xa1550100, BTTV_BOARD_IVC200, "IVC-200G" },
242 { 0xa1550101, BTTV_BOARD_IVC200, "IVC-200G" },
243 { 0xa1550102, BTTV_BOARD_IVC200, "IVC-200G" },
244 { 0xa1550103, BTTV_BOARD_IVC200, "IVC-200G" },
245 { 0xa1550800, BTTV_BOARD_IVC200, "IVC-200" },
246 { 0xa1550801, BTTV_BOARD_IVC200, "IVC-200" },
247 { 0xa1550802, BTTV_BOARD_IVC200, "IVC-200" },
248 { 0xa1550803, BTTV_BOARD_IVC200, "IVC-200" },
249 { 0xa182ff00, BTTV_BOARD_IVC120, "IVC-120G" },
250 { 0xa182ff01, BTTV_BOARD_IVC120, "IVC-120G" },
251 { 0xa182ff02, BTTV_BOARD_IVC120, "IVC-120G" },
252 { 0xa182ff03, BTTV_BOARD_IVC120, "IVC-120G" },
253 { 0xa182ff04, BTTV_BOARD_IVC120, "IVC-120G" },
254 { 0xa182ff05, BTTV_BOARD_IVC120, "IVC-120G" },
255 { 0xa182ff06, BTTV_BOARD_IVC120, "IVC-120G" },
256 { 0xa182ff07, BTTV_BOARD_IVC120, "IVC-120G" },
257 { 0xa182ff08, BTTV_BOARD_IVC120, "IVC-120G" },
258 { 0xa182ff09, BTTV_BOARD_IVC120, "IVC-120G" },
259 { 0xa182ff0a, BTTV_BOARD_IVC120, "IVC-120G" },
260 { 0xa182ff0b, BTTV_BOARD_IVC120, "IVC-120G" },
261 { 0xa182ff0c, BTTV_BOARD_IVC120, "IVC-120G" },
262 { 0xa182ff0d, BTTV_BOARD_IVC120, "IVC-120G" },
263 { 0xa182ff0e, BTTV_BOARD_IVC120, "IVC-120G" },
264 { 0xa182ff0f, BTTV_BOARD_IVC120, "IVC-120G" },
265 { 0xf0500000, BTTV_BOARD_IVCE8784, "IVCE-8784" },
266 { 0xf0500001, BTTV_BOARD_IVCE8784, "IVCE-8784" },
267 { 0xf0500002, BTTV_BOARD_IVCE8784, "IVCE-8784" },
268 { 0xf0500003, BTTV_BOARD_IVCE8784, "IVCE-8784" },
269
270 { 0x41424344, BTTV_BOARD_GRANDTEC, "GrandTec Multi Capture" },
271 { 0x01020304, BTTV_BOARD_XGUARD, "Grandtec Grand X-Guard" },
272
273 { 0x18501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
274 { 0xa0501851, BTTV_BOARD_CHRONOS_VS2, "FlyVideo 98 (LR50)/ Chronos Video Shuttle II" },
275 { 0x18511851, BTTV_BOARD_FLYVIDEO98EZ, "FlyVideo 98EZ (LR51)/ CyberMail AV" },
276 { 0x18521852, BTTV_BOARD_TYPHOON_TVIEW, "FlyVideo 98FM (LR50)/ Typhoon TView TV/FM Tuner" },
277 { 0x41a0a051, BTTV_BOARD_FLYVIDEO_98FM, "Lifeview FlyVideo 98 LR50 Rev Q" },
278 { 0x18501f7f, BTTV_BOARD_FLYVIDEO_98, "Lifeview Flyvideo 98" },
279
280 { 0x010115cb, BTTV_BOARD_GMV1, "AG GMV1" },
281 { 0x010114c7, BTTV_BOARD_MODTEC_205, "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV" },
282
283 { 0x10b42636, BTTV_BOARD_HAUPPAUGE878, "STB ???" },
284 { 0x217d6606, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
285 { 0xfff6f6ff, BTTV_BOARD_WINFAST2000, "Leadtek WinFast TV 2000" },
286 { 0x03116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 311" },
287 { 0x06116000, BTTV_BOARD_SENSORAY311_611, "Sensoray 611" },
288 { 0x00790e11, BTTV_BOARD_WINDVR, "Canopus WinDVR PCI" },
289 { 0xa0fca1a0, BTTV_BOARD_ZOLTRIX, "Face to Face Tvmax" },
290 { 0x82b2aa6a, BTTV_BOARD_SIMUS_GVC1100, "SIMUS GVC1100" },
291 { 0x146caa0c, BTTV_BOARD_PV951, "ituner spectra8" },
292 { 0x200a1295, BTTV_BOARD_PXC200, "ImageNation PXC200A" },
293
294 { 0x40111554, BTTV_BOARD_PV_BT878P_9B, "Prolink Pixelview PV-BT" },
295 { 0x17de0a01, BTTV_BOARD_KWORLD, "Mecer TV/FM/Video Tuner" },
296
297 { 0x01051805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #1" },
298 { 0x01061805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #2" },
299 { 0x01071805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #3" },
300 { 0x01081805, BTTV_BOARD_PICOLO_TETRA_CHIP, "Picolo Tetra Chip #4" },
301
302 { 0x15409511, BTTV_BOARD_ACORP_Y878F, "Acorp Y878F" },
303
304 { 0x53534149, BTTV_BOARD_SSAI_SECURITY, "SSAI Security Video Interface" },
305 { 0x5353414a, BTTV_BOARD_SSAI_ULTRASOUND, "SSAI Ultrasound Video Interface" },
306
307
308
309
310
311
312
313 { 0x109e036e, BTTV_BOARD_CONCEPTRONIC_CTVFMI2, "Conceptronic CTVFMi v2"},
314
315
316 { 0x001c11bd, BTTV_BOARD_PINNACLESAT, "Pinnacle PCTV Sat" },
317 { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" },
318 { 0x20007063, BTTV_BOARD_PC_HDTV, "pcHDTV HD-2000 TV"},
319 { 0x002611bd, BTTV_BOARD_TWINHAN_DST, "Pinnacle PCTV SAT CI" },
320 { 0x00011822, BTTV_BOARD_TWINHAN_DST, "Twinhan VisionPlus DVB" },
321 { 0xfc00270f, BTTV_BOARD_TWINHAN_DST, "ChainTech digitop DST-1000 DVB-S" },
322 { 0x07711461, BTTV_BOARD_AVDVBT_771, "AVermedia AverTV DVB-T 771" },
323 { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" },
324 { 0xdb1018ac, BTTV_BOARD_DVICO_DVBT_LITE, "DViCO FusionHDTV DVB-T Lite" },
325 { 0xdb1118ac, BTTV_BOARD_DVICO_DVBT_LITE, "Ultraview DVB-T Lite" },
326 { 0xd50018ac, BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE, "DViCO FusionHDTV 5 Lite" },
327 { 0x00261822, BTTV_BOARD_TWINHAN_DST, "DNTV Live! Mini "},
328 { 0xd200dbc0, BTTV_BOARD_DVICO_FUSIONHDTV_2, "DViCO FusionHDTV 2" },
329 { 0x763c008a, BTTV_BOARD_GEOVISION_GV600, "GeoVision GV-600" },
330 { 0x18011000, BTTV_BOARD_ENLTV_FM_2, "Encore ENL TV-FM-2" },
331 { 0x763d800a, BTTV_BOARD_GEOVISION_GV800S, "GeoVision GV-800(S) (master)" },
332 { 0x763d800b, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
333 { 0x763d800c, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
334 { 0x763d800d, BTTV_BOARD_GEOVISION_GV800S_SL, "GeoVision GV-800(S) (slave)" },
335
336 { 0x15401830, BTTV_BOARD_PV183, "Provideo PV183-1" },
337 { 0x15401831, BTTV_BOARD_PV183, "Provideo PV183-2" },
338 { 0x15401832, BTTV_BOARD_PV183, "Provideo PV183-3" },
339 { 0x15401833, BTTV_BOARD_PV183, "Provideo PV183-4" },
340 { 0x15401834, BTTV_BOARD_PV183, "Provideo PV183-5" },
341 { 0x15401835, BTTV_BOARD_PV183, "Provideo PV183-6" },
342 { 0x15401836, BTTV_BOARD_PV183, "Provideo PV183-7" },
343 { 0x15401837, BTTV_BOARD_PV183, "Provideo PV183-8" },
344 { 0x3116f200, BTTV_BOARD_TVT_TD3116, "Tongwei Video Technology TD-3116" },
345 { 0x02280279, BTTV_BOARD_APOSONIC_WDVR, "Aposonic W-DVR" },
346 { 0, -1, NULL }
347};
348
349
350
351
352struct tvcard bttv_tvcards[] = {
353
354 [BTTV_BOARD_UNKNOWN] = {
355 .name = " *** UNKNOWN/GENERIC *** ",
356 .video_inputs = 4,
357 .svhs = 2,
358 .muxsel = MUXSEL(2, 3, 1, 0),
359 .tuner_type = UNSET,
360 .tuner_addr = ADDR_UNSET,
361 },
362 [BTTV_BOARD_MIRO] = {
363 .name = "MIRO PCTV",
364 .video_inputs = 4,
365
366 .svhs = 2,
367 .gpiomask = 15,
368 .muxsel = MUXSEL(2, 3, 1, 1),
369 .gpiomux = { 2, 0, 0, 0 },
370 .gpiomute = 10,
371 .tuner_type = UNSET,
372 .tuner_addr = ADDR_UNSET,
373 },
374 [BTTV_BOARD_HAUPPAUGE] = {
375 .name = "Hauppauge (bt848)",
376 .video_inputs = 4,
377
378 .svhs = 2,
379 .gpiomask = 7,
380 .muxsel = MUXSEL(2, 3, 1, 1),
381 .gpiomux = { 0, 1, 2, 3 },
382 .gpiomute = 4,
383 .tuner_type = UNSET,
384 .tuner_addr = ADDR_UNSET,
385 },
386 [BTTV_BOARD_STB] = {
387 .name = "STB, Gateway P/N 6000699 (bt848)",
388 .video_inputs = 3,
389
390 .svhs = 2,
391 .gpiomask = 7,
392 .muxsel = MUXSEL(2, 3, 1, 1),
393 .gpiomux = { 4, 0, 2, 3 },
394 .gpiomute = 1,
395 .no_msp34xx = 1,
396 .tuner_type = TUNER_PHILIPS_NTSC,
397 .tuner_addr = ADDR_UNSET,
398 .pll = PLL_28,
399 .has_radio = 1,
400 },
401
402
403 [BTTV_BOARD_INTEL] = {
404 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
405 .video_inputs = 4,
406
407 .svhs = 2,
408 .gpiomask = 0,
409 .muxsel = MUXSEL(2, 3, 1, 1),
410 .gpiomux = { 0 },
411 .tuner_type = TUNER_ABSENT,
412 .tuner_addr = ADDR_UNSET,
413 },
414 [BTTV_BOARD_DIAMOND] = {
415 .name = "Diamond DTV2000",
416 .video_inputs = 4,
417
418 .svhs = 2,
419 .gpiomask = 3,
420 .muxsel = MUXSEL(2, 3, 1, 0),
421 .gpiomux = { 0, 1, 0, 1 },
422 .gpiomute = 3,
423 .tuner_type = UNSET,
424 .tuner_addr = ADDR_UNSET,
425 },
426 [BTTV_BOARD_AVERMEDIA] = {
427 .name = "AVerMedia TVPhone",
428 .video_inputs = 3,
429
430 .svhs = 3,
431 .muxsel = MUXSEL(2, 3, 1, 1),
432 .gpiomask = 0x0f,
433 .gpiomux = { 0x0c, 0x04, 0x08, 0x04 },
434
435 .tuner_type = UNSET,
436 .tuner_addr = ADDR_UNSET,
437 .audio_mode_gpio= avermedia_tvphone_audio,
438 .has_remote = 1,
439 },
440 [BTTV_BOARD_MATRIX_VISION] = {
441 .name = "MATRIX-Vision MV-Delta",
442 .video_inputs = 5,
443
444 .svhs = 3,
445 .gpiomask = 0,
446 .muxsel = MUXSEL(2, 3, 1, 0, 0),
447 .gpiomux = { 0 },
448 .tuner_type = TUNER_ABSENT,
449 .tuner_addr = ADDR_UNSET,
450 },
451
452
453 [BTTV_BOARD_FLYVIDEO] = {
454 .name = "Lifeview FlyVideo II (Bt848) LR26 / MAXI TV Video PCI2 LR26",
455 .video_inputs = 4,
456
457 .svhs = 2,
458 .gpiomask = 0xc00,
459 .muxsel = MUXSEL(2, 3, 1, 1),
460 .gpiomux = { 0, 0xc00, 0x800, 0x400 },
461 .gpiomute = 0xc00,
462 .pll = PLL_28,
463 .tuner_type = UNSET,
464 .tuner_addr = ADDR_UNSET,
465 },
466 [BTTV_BOARD_TURBOTV] = {
467 .name = "IMS/IXmicro TurboTV",
468 .video_inputs = 3,
469
470 .svhs = 2,
471 .gpiomask = 3,
472 .muxsel = MUXSEL(2, 3, 1, 1),
473 .gpiomux = { 1, 1, 2, 3 },
474 .pll = PLL_28,
475 .tuner_type = TUNER_TEMIC_PAL,
476 .tuner_addr = ADDR_UNSET,
477 },
478 [BTTV_BOARD_HAUPPAUGE878] = {
479 .name = "Hauppauge (bt878)",
480 .video_inputs = 4,
481
482 .svhs = 2,
483 .gpiomask = 0x0f,
484 .muxsel = MUXSEL(2, 0, 1, 1),
485 .gpiomux = { 0, 1, 2, 3 },
486 .gpiomute = 4,
487 .pll = PLL_28,
488 .tuner_type = UNSET,
489 .tuner_addr = ADDR_UNSET,
490 },
491 [BTTV_BOARD_MIROPRO] = {
492 .name = "MIRO PCTV pro",
493 .video_inputs = 3,
494
495 .svhs = 2,
496 .gpiomask = 0x3014f,
497 .muxsel = MUXSEL(2, 3, 1, 1),
498 .gpiomux = { 0x20001,0x10001, 0, 0 },
499 .gpiomute = 10,
500 .tuner_type = UNSET,
501 .tuner_addr = ADDR_UNSET,
502 },
503
504
505 [BTTV_BOARD_ADSTECH_TV] = {
506 .name = "ADS Technologies Channel Surfer TV (bt848)",
507 .video_inputs = 3,
508
509 .svhs = 2,
510 .gpiomask = 15,
511 .muxsel = MUXSEL(2, 3, 1, 1),
512 .gpiomux = { 13, 14, 11, 7 },
513 .tuner_type = UNSET,
514 .tuner_addr = ADDR_UNSET,
515 },
516 [BTTV_BOARD_AVERMEDIA98] = {
517 .name = "AVerMedia TVCapture 98",
518 .video_inputs = 3,
519
520 .svhs = 2,
521 .gpiomask = 15,
522 .muxsel = MUXSEL(2, 3, 1, 1),
523 .gpiomux = { 13, 14, 11, 7 },
524 .msp34xx_alt = 1,
525 .pll = PLL_28,
526 .tuner_type = TUNER_PHILIPS_PAL,
527 .tuner_addr = ADDR_UNSET,
528 .audio_mode_gpio= avermedia_tv_stereo_audio,
529 .no_gpioirq = 1,
530 },
531 [BTTV_BOARD_VHX] = {
532 .name = "Aimslab Video Highway Xtreme (VHX)",
533 .video_inputs = 3,
534
535 .svhs = 2,
536 .gpiomask = 7,
537 .muxsel = MUXSEL(2, 3, 1, 1),
538 .gpiomux = { 0, 2, 1, 3 },
539 .gpiomute = 4,
540 .pll = PLL_28,
541 .tuner_type = UNSET,
542 .tuner_addr = ADDR_UNSET,
543 },
544 [BTTV_BOARD_ZOLTRIX] = {
545 .name = "Zoltrix TV-Max",
546 .video_inputs = 3,
547
548 .svhs = 2,
549 .gpiomask = 15,
550 .muxsel = MUXSEL(2, 3, 1, 1),
551 .gpiomux = { 0, 0, 1, 0 },
552 .gpiomute = 10,
553 .tuner_type = UNSET,
554 .tuner_addr = ADDR_UNSET,
555 },
556
557
558 [BTTV_BOARD_PIXVIEWPLAYTV] = {
559 .name = "Prolink Pixelview PlayTV (bt878)",
560 .video_inputs = 3,
561
562 .svhs = 2,
563 .gpiomask = 0x01fe00,
564 .muxsel = MUXSEL(2, 3, 1, 1),
565
566 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
567 .gpiomute = 0x002000,
568 .pll = PLL_28,
569 .tuner_type = UNSET,
570 .tuner_addr = ADDR_UNSET,
571 },
572 [BTTV_BOARD_WINVIEW_601] = {
573 .name = "Leadtek WinView 601",
574 .video_inputs = 3,
575
576 .svhs = 2,
577 .gpiomask = 0x8300f8,
578 .muxsel = MUXSEL(2, 3, 1, 1, 0),
579 .gpiomux = { 0x4fa007,0xcfa007,0xcfa007,0xcfa007 },
580 .gpiomute = 0xcfa007,
581 .tuner_type = UNSET,
582 .tuner_addr = ADDR_UNSET,
583 .volume_gpio = winview_volume,
584 .has_radio = 1,
585 },
586 [BTTV_BOARD_AVEC_INTERCAP] = {
587 .name = "AVEC Intercapture",
588 .video_inputs = 3,
589
590 .svhs = 2,
591 .gpiomask = 0,
592 .muxsel = MUXSEL(2, 3, 1, 1),
593 .gpiomux = { 1, 0, 0, 0 },
594 .tuner_type = UNSET,
595 .tuner_addr = ADDR_UNSET,
596 },
597 [BTTV_BOARD_LIFE_FLYKIT] = {
598 .name = "Lifeview FlyVideo II EZ /FlyKit LR38 Bt848 (capture only)",
599 .video_inputs = 4,
600
601 .svhs = NO_SVHS,
602 .gpiomask = 0x8dff00,
603 .muxsel = MUXSEL(2, 3, 1, 1),
604 .gpiomux = { 0 },
605 .no_msp34xx = 1,
606 .tuner_type = TUNER_ABSENT,
607 .tuner_addr = ADDR_UNSET,
608 },
609
610
611 [BTTV_BOARD_CEI_RAFFLES] = {
612 .name = "CEI Raffles Card",
613 .video_inputs = 3,
614
615 .svhs = 2,
616 .muxsel = MUXSEL(2, 3, 1, 1),
617 .tuner_type = UNSET,
618 .tuner_addr = ADDR_UNSET,
619 },
620 [BTTV_BOARD_CONFERENCETV] = {
621 .name = "Lifeview FlyVideo 98/ Lucky Star Image World ConferenceTV LR50",
622 .video_inputs = 4,
623
624 .svhs = 2,
625 .gpiomask = 0x1800,
626 .muxsel = MUXSEL(2, 3, 1, 1),
627 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
628 .gpiomute = 0x1800,
629 .pll = PLL_28,
630 .tuner_type = TUNER_PHILIPS_PAL_I,
631 .tuner_addr = ADDR_UNSET,
632 },
633 [BTTV_BOARD_PHOEBE_TVMAS] = {
634 .name = "Askey CPH050/ Phoebe Tv Master + FM",
635 .video_inputs = 3,
636
637 .svhs = 2,
638 .gpiomask = 0xc00,
639 .muxsel = MUXSEL(2, 3, 1, 1),
640 .gpiomux = { 0, 1, 0x800, 0x400 },
641 .gpiomute = 0xc00,
642 .pll = PLL_28,
643 .tuner_type = UNSET,
644 .tuner_addr = ADDR_UNSET,
645 },
646 [BTTV_BOARD_MODTEC_205] = {
647 .name = "Modular Technology MM201/MM202/MM205/MM210/MM215 PCTV, bt878",
648 .video_inputs = 3,
649
650 .svhs = NO_SVHS,
651 .has_dig_in = 1,
652 .gpiomask = 7,
653 .muxsel = MUXSEL(2, 3, 0),
654
655 .gpiomux = { 0, 0, 0, 0 },
656 .no_msp34xx = 1,
657 .pll = PLL_28,
658 .tuner_type = TUNER_ALPS_TSBB5_PAL_I,
659 .tuner_addr = ADDR_UNSET,
660 },
661
662
663 [BTTV_BOARD_MAGICTVIEW061] = {
664 .name = "Askey CPH05X/06X (bt878) [many vendors]",
665 .video_inputs = 3,
666
667 .svhs = 2,
668 .gpiomask = 0xe00,
669 .muxsel = MUXSEL(2, 3, 1, 1),
670 .gpiomux = {0x400, 0x400, 0x400, 0x400 },
671 .gpiomute = 0xc00,
672 .pll = PLL_28,
673 .tuner_type = UNSET,
674 .tuner_addr = ADDR_UNSET,
675 .has_remote = 1,
676 .has_radio = 1,
677 },
678 [BTTV_BOARD_VOBIS_BOOSTAR] = {
679 .name = "Terratec TerraTV+ Version 1.0 (Bt848)/ Terra TValue Version 1.0/ Vobis TV-Boostar",
680 .video_inputs = 3,
681
682 .svhs = 2,
683 .gpiomask = 0x1f0fff,
684 .muxsel = MUXSEL(2, 3, 1, 1),
685 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
686 .gpiomute = 0x40000,
687 .tuner_type = TUNER_PHILIPS_PAL,
688 .tuner_addr = ADDR_UNSET,
689 .audio_mode_gpio= terratv_audio,
690 },
691 [BTTV_BOARD_HAUPPAUG_WCAM] = {
692 .name = "Hauppauge WinCam newer (bt878)",
693 .video_inputs = 4,
694
695 .svhs = 3,
696 .gpiomask = 7,
697 .muxsel = MUXSEL(2, 0, 1, 1),
698 .gpiomux = { 0, 1, 2, 3 },
699 .gpiomute = 4,
700 .tuner_type = UNSET,
701 .tuner_addr = ADDR_UNSET,
702 },
703 [BTTV_BOARD_MAXI] = {
704 .name = "Lifeview FlyVideo 98/ MAXI TV Video PCI2 LR50",
705 .video_inputs = 4,
706
707 .svhs = 2,
708 .gpiomask = 0x1800,
709 .muxsel = MUXSEL(2, 3, 1, 1),
710 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
711 .gpiomute = 0x1800,
712 .pll = PLL_28,
713 .tuner_type = TUNER_PHILIPS_SECAM,
714 .tuner_addr = ADDR_UNSET,
715 },
716
717
718 [BTTV_BOARD_TERRATV] = {
719 .name = "Terratec TerraTV+ Version 1.1 (bt878)",
720 .video_inputs = 3,
721
722 .svhs = 2,
723 .gpiomask = 0x1f0fff,
724 .muxsel = MUXSEL(2, 3, 1, 1),
725 .gpiomux = { 0x20000, 0x30000, 0x10000, 0x00000 },
726 .gpiomute = 0x40000,
727 .tuner_type = TUNER_PHILIPS_PAL,
728 .tuner_addr = ADDR_UNSET,
729 .audio_mode_gpio= terratv_audio,
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761 },
762 [BTTV_BOARD_PXC200] = {
763
764 .name = "Imagenation PXC200",
765 .video_inputs = 5,
766
767 .svhs = 1,
768 .gpiomask = 0,
769 .muxsel = MUXSEL(2, 3, 1, 0, 0),
770 .gpiomux = { 0 },
771 .tuner_type = TUNER_ABSENT,
772 .tuner_addr = ADDR_UNSET,
773 .muxsel_hook = PXC200_muxsel,
774
775 },
776 [BTTV_BOARD_FLYVIDEO_98] = {
777 .name = "Lifeview FlyVideo 98 LR50",
778 .video_inputs = 4,
779
780 .svhs = 2,
781 .gpiomask = 0x1800,
782 .muxsel = MUXSEL(2, 3, 1, 1),
783 .gpiomux = { 0, 0x0800, 0x1000, 0x1000 },
784 .gpiomute = 0x1800,
785 .pll = PLL_28,
786 .tuner_type = UNSET,
787 .tuner_addr = ADDR_UNSET,
788 },
789 [BTTV_BOARD_IPROTV] = {
790 .name = "Formac iProTV, Formac ProTV I (bt848)",
791 .video_inputs = 4,
792
793 .svhs = 3,
794 .gpiomask = 1,
795 .muxsel = MUXSEL(2, 3, 1, 1),
796 .gpiomux = { 1, 0, 0, 0 },
797 .pll = PLL_28,
798 .tuner_type = TUNER_PHILIPS_PAL,
799 .tuner_addr = ADDR_UNSET,
800 },
801
802
803 [BTTV_BOARD_INTEL_C_S_PCI] = {
804 .name = "Intel Create and Share PCI/ Smart Video Recorder III",
805 .video_inputs = 4,
806
807 .svhs = 2,
808 .gpiomask = 0,
809 .muxsel = MUXSEL(2, 3, 1, 1),
810 .gpiomux = { 0 },
811 .tuner_type = TUNER_ABSENT,
812 .tuner_addr = ADDR_UNSET,
813 },
814 [BTTV_BOARD_TERRATVALUE] = {
815 .name = "Terratec TerraTValue Version Bt878",
816 .video_inputs = 3,
817
818 .svhs = 2,
819 .gpiomask = 0xffff00,
820 .muxsel = MUXSEL(2, 3, 1, 1),
821 .gpiomux = { 0x500, 0, 0x300, 0x900 },
822 .gpiomute = 0x900,
823 .pll = PLL_28,
824 .tuner_type = TUNER_PHILIPS_PAL,
825 .tuner_addr = ADDR_UNSET,
826 },
827 [BTTV_BOARD_WINFAST2000] = {
828 .name = "Leadtek WinFast 2000/ WinFast 2000 XP",
829 .video_inputs = 4,
830
831 .svhs = 2,
832
833 .muxsel = MUXSEL(2, 3, 1, 1, 0),
834
835 .gpiomask = 0xb33000,
836 .gpiomux = { 0x122000,0x1000,0x0000,0x620000 },
837 .gpiomute = 0x800000,
838
839
840
841
842
843
844
845
846
847
848
849 .pll = PLL_28,
850 .has_radio = 1,
851 .tuner_type = TUNER_PHILIPS_PAL,
852 .tuner_addr = ADDR_UNSET,
853 .audio_mode_gpio= winfast2000_audio,
854 .has_remote = 1,
855 },
856 [BTTV_BOARD_CHRONOS_VS2] = {
857 .name = "Lifeview FlyVideo 98 LR50 / Chronos Video Shuttle II",
858 .video_inputs = 4,
859
860 .svhs = 2,
861 .gpiomask = 0x1800,
862 .muxsel = MUXSEL(2, 3, 1, 1),
863 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
864 .gpiomute = 0x1800,
865 .pll = PLL_28,
866 .tuner_type = UNSET,
867 .tuner_addr = ADDR_UNSET,
868 },
869
870
871 [BTTV_BOARD_TYPHOON_TVIEW] = {
872 .name = "Lifeview FlyVideo 98FM LR50 / Typhoon TView TV/FM Tuner",
873 .video_inputs = 4,
874
875 .svhs = 2,
876 .gpiomask = 0x1800,
877 .muxsel = MUXSEL(2, 3, 1, 1),
878 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
879 .gpiomute = 0x1800,
880 .pll = PLL_28,
881 .tuner_type = UNSET,
882 .tuner_addr = ADDR_UNSET,
883 .has_radio = 1,
884 },
885 [BTTV_BOARD_PXELVWPLTVPRO] = {
886 .name = "Prolink PixelView PlayTV pro",
887 .video_inputs = 3,
888
889 .svhs = 2,
890 .gpiomask = 0xff,
891 .muxsel = MUXSEL(2, 3, 1, 1),
892 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
893 .gpiomute = 0x29,
894 .no_msp34xx = 1,
895 .pll = PLL_28,
896 .tuner_type = UNSET,
897 .tuner_addr = ADDR_UNSET,
898 },
899 [BTTV_BOARD_MAGICTVIEW063] = {
900 .name = "Askey CPH06X TView99",
901 .video_inputs = 4,
902
903 .svhs = 2,
904 .gpiomask = 0x551e00,
905 .muxsel = MUXSEL(2, 3, 1, 0),
906 .gpiomux = { 0x551400, 0x551200, 0, 0 },
907 .gpiomute = 0x551c00,
908 .pll = PLL_28,
909 .tuner_type = TUNER_PHILIPS_PAL_I,
910 .tuner_addr = ADDR_UNSET,
911 .has_remote = 1,
912 },
913 [BTTV_BOARD_PINNACLE] = {
914 .name = "Pinnacle PCTV Studio/Rave",
915 .video_inputs = 3,
916
917 .svhs = 2,
918 .gpiomask = 0x03000F,
919 .muxsel = MUXSEL(2, 3, 1, 1),
920 .gpiomux = { 2, 0xd0001, 0, 0 },
921 .gpiomute = 1,
922 .pll = PLL_28,
923 .tuner_type = UNSET,
924 .tuner_addr = ADDR_UNSET,
925 },
926
927
928 [BTTV_BOARD_STB2] = {
929 .name = "STB TV PCI FM, Gateway P/N 6000704 (bt878), 3Dfx VoodooTV 100",
930 .video_inputs = 3,
931
932 .svhs = 2,
933 .gpiomask = 7,
934 .muxsel = MUXSEL(2, 3, 1, 1),
935 .gpiomux = { 4, 0, 2, 3 },
936 .gpiomute = 1,
937 .no_msp34xx = 1,
938 .tuner_type = TUNER_PHILIPS_NTSC,
939 .tuner_addr = ADDR_UNSET,
940 .pll = PLL_28,
941 .has_radio = 1,
942 },
943 [BTTV_BOARD_AVPHONE98] = {
944 .name = "AVerMedia TVPhone 98",
945 .video_inputs = 3,
946
947 .svhs = 2,
948 .gpiomask = 15,
949 .muxsel = MUXSEL(2, 3, 1, 1),
950 .gpiomux = { 13, 4, 11, 7 },
951 .pll = PLL_28,
952 .tuner_type = UNSET,
953 .tuner_addr = ADDR_UNSET,
954 .has_radio = 1,
955 .audio_mode_gpio= avermedia_tvphone_audio,
956 },
957 [BTTV_BOARD_PV951] = {
958 .name = "ProVideo PV951",
959 .video_inputs = 3,
960
961 .svhs = 2,
962 .gpiomask = 0,
963 .muxsel = MUXSEL(2, 3, 1, 1),
964 .gpiomux = { 0, 0, 0, 0},
965 .no_msp34xx = 1,
966 .pll = PLL_28,
967 .tuner_type = TUNER_PHILIPS_PAL_I,
968 .tuner_addr = ADDR_UNSET,
969 },
970 [BTTV_BOARD_ONAIR_TV] = {
971 .name = "Little OnAir TV",
972 .video_inputs = 3,
973
974 .svhs = 2,
975 .gpiomask = 0xe00b,
976 .muxsel = MUXSEL(2, 3, 1, 1),
977 .gpiomux = { 0xff9ff6, 0xff9ff6, 0xff1ff7, 0 },
978 .gpiomute = 0xff3ffc,
979 .no_msp34xx = 1,
980 .tuner_type = UNSET,
981 .tuner_addr = ADDR_UNSET,
982 },
983
984
985 [BTTV_BOARD_SIGMA_TVII_FM] = {
986 .name = "Sigma TVII-FM",
987 .video_inputs = 2,
988
989 .svhs = NO_SVHS,
990 .gpiomask = 3,
991 .muxsel = MUXSEL(2, 3, 1, 1),
992 .gpiomux = { 1, 1, 0, 2 },
993 .gpiomute = 3,
994 .no_msp34xx = 1,
995 .pll = PLL_NONE,
996 .tuner_type = UNSET,
997 .tuner_addr = ADDR_UNSET,
998 },
999 [BTTV_BOARD_MATRIX_VISION2] = {
1000 .name = "MATRIX-Vision MV-Delta 2",
1001 .video_inputs = 5,
1002
1003 .svhs = 3,
1004 .gpiomask = 0,
1005 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1006 .gpiomux = { 0 },
1007 .no_msp34xx = 1,
1008 .pll = PLL_28,
1009 .tuner_type = TUNER_ABSENT,
1010 .tuner_addr = ADDR_UNSET,
1011 },
1012 [BTTV_BOARD_ZOLTRIX_GENIE] = {
1013 .name = "Zoltrix Genie TV/FM",
1014 .video_inputs = 3,
1015
1016 .svhs = 2,
1017 .gpiomask = 0xbcf03f,
1018 .muxsel = MUXSEL(2, 3, 1, 1),
1019 .gpiomux = { 0xbc803f, 0xbc903f, 0xbcb03f, 0 },
1020 .gpiomute = 0xbcb03f,
1021 .no_msp34xx = 1,
1022 .pll = PLL_28,
1023 .tuner_type = TUNER_TEMIC_4039FR5_NTSC,
1024 .tuner_addr = ADDR_UNSET,
1025 },
1026 [BTTV_BOARD_TERRATVRADIO] = {
1027 .name = "Terratec TV/Radio+",
1028 .video_inputs = 3,
1029
1030 .svhs = 2,
1031 .gpiomask = 0x70000,
1032 .muxsel = MUXSEL(2, 3, 1, 1),
1033 .gpiomux = { 0x20000, 0x30000, 0x10000, 0 },
1034 .gpiomute = 0x40000,
1035 .no_msp34xx = 1,
1036 .pll = PLL_35,
1037 .tuner_type = TUNER_PHILIPS_PAL_I,
1038 .tuner_addr = ADDR_UNSET,
1039 .has_radio = 1,
1040 },
1041
1042
1043 [BTTV_BOARD_DYNALINK] = {
1044 .name = "Askey CPH03x/ Dynalink Magic TView",
1045 .video_inputs = 3,
1046
1047 .svhs = 2,
1048 .gpiomask = 15,
1049 .muxsel = MUXSEL(2, 3, 1, 1),
1050 .gpiomux = {2,0,0,0 },
1051 .gpiomute = 1,
1052 .pll = PLL_28,
1053 .tuner_type = UNSET,
1054 .tuner_addr = ADDR_UNSET,
1055 },
1056 [BTTV_BOARD_GVBCTV3PCI] = {
1057 .name = "IODATA GV-BCTV3/PCI",
1058 .video_inputs = 3,
1059
1060 .svhs = 2,
1061 .gpiomask = 0x010f00,
1062 .muxsel = MUXSEL(2, 3, 0, 0),
1063 .gpiomux = {0x10000, 0, 0x10000, 0 },
1064 .no_msp34xx = 1,
1065 .pll = PLL_28,
1066 .tuner_type = TUNER_ALPS_TSHC6_NTSC,
1067 .tuner_addr = ADDR_UNSET,
1068 .audio_mode_gpio= gvbctv3pci_audio,
1069 },
1070 [BTTV_BOARD_PXELVWPLTVPAK] = {
1071 .name = "Prolink PV-BT878P+4E / PixelView PlayTV PAK / Lenco MXTV-9578 CP",
1072 .video_inputs = 5,
1073
1074 .svhs = 3,
1075 .has_dig_in = 1,
1076 .gpiomask = 0xAA0000,
1077 .muxsel = MUXSEL(2, 3, 1, 1, 0),
1078
1079 .gpiomux = { 0x20000, 0, 0x80000, 0x80000 },
1080 .gpiomute = 0xa8000,
1081 .no_msp34xx = 1,
1082 .pll = PLL_28,
1083 .tuner_type = TUNER_PHILIPS_PAL_I,
1084 .tuner_addr = ADDR_UNSET,
1085 .has_remote = 1,
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095 },
1096 [BTTV_BOARD_EAGLE] = {
1097 .name = "Eagle Wireless Capricorn2 (bt878A)",
1098 .video_inputs = 4,
1099
1100 .svhs = 2,
1101 .gpiomask = 7,
1102 .muxsel = MUXSEL(2, 0, 1, 1),
1103 .gpiomux = { 0, 1, 2, 3 },
1104 .gpiomute = 4,
1105 .pll = PLL_28,
1106 .tuner_type = UNSET ,
1107 .tuner_addr = ADDR_UNSET,
1108 },
1109
1110
1111 [BTTV_BOARD_PINNACLEPRO] = {
1112
1113 .name = "Pinnacle PCTV Studio Pro",
1114 .video_inputs = 4,
1115
1116 .svhs = 3,
1117 .gpiomask = 0x03000F,
1118 .muxsel = MUXSEL(2, 3, 1, 1),
1119 .gpiomux = { 1, 0xd0001, 0, 0 },
1120 .gpiomute = 10,
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130 .pll = PLL_28,
1131 .tuner_type = UNSET,
1132 .tuner_addr = ADDR_UNSET,
1133 },
1134 [BTTV_BOARD_TVIEW_RDS_FM] = {
1135
1136
1137 .name = "Typhoon TView RDS + FM Stereo / KNC1 TV Station RDS",
1138 .video_inputs = 4,
1139
1140 .svhs = 2,
1141 .gpiomask = 0x1c,
1142 .muxsel = MUXSEL(2, 3, 1, 1),
1143 .gpiomux = { 0, 0, 0x10, 8 },
1144 .gpiomute = 4,
1145 .pll = PLL_28,
1146 .tuner_type = TUNER_PHILIPS_PAL,
1147 .tuner_addr = ADDR_UNSET,
1148 .has_radio = 1,
1149 },
1150 [BTTV_BOARD_LIFETEC_9415] = {
1151
1152
1153
1154
1155
1156 .name = "Lifeview FlyVideo 2000 /FlyVideo A2/ Lifetec LT 9415 TV [LR90]",
1157 .video_inputs = 4,
1158
1159 .svhs = 2,
1160 .gpiomask = 0x18e0,
1161 .muxsel = MUXSEL(2, 3, 1, 1),
1162 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1163 .gpiomute = 0x18e0,
1164
1165
1166
1167
1168 .pll = PLL_28,
1169 .tuner_type = UNSET,
1170 .tuner_addr = ADDR_UNSET,
1171 },
1172 [BTTV_BOARD_BESTBUY_EASYTV] = {
1173
1174
1175 .name = "Askey CPH031/ BESTBUY Easy TV",
1176 .video_inputs = 4,
1177
1178 .svhs = 2,
1179 .gpiomask = 0xF,
1180 .muxsel = MUXSEL(2, 3, 1, 0),
1181 .gpiomux = { 2, 0, 0, 0 },
1182 .gpiomute = 10,
1183 .pll = PLL_28,
1184 .tuner_type = TUNER_TEMIC_PAL,
1185 .tuner_addr = ADDR_UNSET,
1186 },
1187
1188
1189 [BTTV_BOARD_FLYVIDEO_98FM] = {
1190
1191 .name = "Lifeview FlyVideo 98FM LR50",
1192 .video_inputs = 4,
1193
1194 .svhs = 2,
1195 .gpiomask = 0x1800,
1196 .muxsel = MUXSEL(2, 3, 1, 1),
1197 .gpiomux = { 0, 0x800, 0x1000, 0x1000 },
1198 .gpiomute = 0x1800,
1199 .pll = PLL_28,
1200 .tuner_type = TUNER_PHILIPS_PAL,
1201 .tuner_addr = ADDR_UNSET,
1202 },
1203
1204
1205
1206 [BTTV_BOARD_GRANDTEC] = {
1207 .name = "GrandTec 'Grand Video Capture' (Bt848)",
1208 .video_inputs = 2,
1209
1210 .svhs = 1,
1211 .gpiomask = 0,
1212 .muxsel = MUXSEL(3, 1),
1213 .gpiomux = { 0 },
1214 .no_msp34xx = 1,
1215 .pll = PLL_35,
1216 .tuner_type = TUNER_ABSENT,
1217 .tuner_addr = ADDR_UNSET,
1218 },
1219 [BTTV_BOARD_ASKEY_CPH060] = {
1220
1221 .name = "Askey CPH060/ Phoebe TV Master Only (No FM)",
1222 .video_inputs = 3,
1223
1224 .svhs = 2,
1225 .gpiomask = 0xe00,
1226 .muxsel = MUXSEL(2, 3, 1, 1),
1227 .gpiomux = { 0x400, 0x400, 0x400, 0x400 },
1228 .gpiomute = 0x800,
1229 .pll = PLL_28,
1230 .tuner_type = TUNER_TEMIC_4036FY5_NTSC,
1231 .tuner_addr = ADDR_UNSET,
1232 },
1233 [BTTV_BOARD_ASKEY_CPH03X] = {
1234
1235 .name = "Askey CPH03x TV Capturer",
1236 .video_inputs = 4,
1237
1238 .svhs = 2,
1239 .gpiomask = 0x03000F,
1240 .muxsel = MUXSEL(2, 3, 1, 0),
1241 .gpiomux = { 2, 0, 0, 0 },
1242 .gpiomute = 1,
1243 .pll = PLL_28,
1244 .tuner_type = TUNER_TEMIC_PAL,
1245 .tuner_addr = ADDR_UNSET,
1246 .has_remote = 1,
1247 },
1248
1249
1250 [BTTV_BOARD_MM100PCTV] = {
1251
1252 .name = "Modular Technology MM100PCTV",
1253 .video_inputs = 2,
1254
1255 .svhs = NO_SVHS,
1256 .gpiomask = 11,
1257 .muxsel = MUXSEL(2, 3, 1, 1),
1258 .gpiomux = { 2, 0, 0, 1 },
1259 .gpiomute = 8,
1260 .pll = PLL_35,
1261 .tuner_type = TUNER_TEMIC_PAL,
1262 .tuner_addr = ADDR_UNSET,
1263 },
1264 [BTTV_BOARD_GMV1] = {
1265
1266 .name = "AG Electronics GMV1",
1267 .video_inputs = 2,
1268
1269 .svhs = 1,
1270 .gpiomask = 0xF,
1271 .muxsel = MUXSEL(2, 2),
1272 .gpiomux = { },
1273 .no_msp34xx = 1,
1274 .pll = PLL_28,
1275 .tuner_type = TUNER_ABSENT,
1276 .tuner_addr = ADDR_UNSET,
1277 },
1278 [BTTV_BOARD_BESTBUY_EASYTV2] = {
1279
1280
1281
1282 .name = "Askey CPH061/ BESTBUY Easy TV (bt878)",
1283 .video_inputs = 3,
1284
1285 .svhs = 2,
1286 .gpiomask = 0xFF,
1287 .muxsel = MUXSEL(2, 3, 1, 0),
1288 .gpiomux = { 1, 0, 4, 4 },
1289 .gpiomute = 9,
1290 .pll = PLL_28,
1291 .tuner_type = TUNER_PHILIPS_PAL,
1292 .tuner_addr = ADDR_UNSET,
1293 },
1294 [BTTV_BOARD_ATI_TVWONDER] = {
1295
1296 .name = "ATI TV-Wonder",
1297 .video_inputs = 3,
1298
1299 .svhs = 2,
1300 .gpiomask = 0xf03f,
1301 .muxsel = MUXSEL(2, 3, 1, 0),
1302 .gpiomux = { 0xbffe, 0, 0xbfff, 0 },
1303 .gpiomute = 0xbffe,
1304 .pll = PLL_28,
1305 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1306 .tuner_addr = ADDR_UNSET,
1307 },
1308
1309
1310 [BTTV_BOARD_ATI_TVWONDERVE] = {
1311
1312 .name = "ATI TV-Wonder VE",
1313 .video_inputs = 2,
1314
1315 .svhs = NO_SVHS,
1316 .gpiomask = 1,
1317 .muxsel = MUXSEL(2, 3, 0, 1),
1318 .gpiomux = { 0, 0, 1, 0 },
1319 .no_msp34xx = 1,
1320 .pll = PLL_28,
1321 .tuner_type = TUNER_TEMIC_4006FN5_MULTI_PAL,
1322 .tuner_addr = ADDR_UNSET,
1323 },
1324 [BTTV_BOARD_FLYVIDEO2000] = {
1325
1326 .name = "Lifeview FlyVideo 2000S LR90",
1327 .video_inputs = 3,
1328
1329 .svhs = 2,
1330 .gpiomask = 0x18e0,
1331 .muxsel = MUXSEL(2, 3, 0, 1),
1332
1333
1334
1335 .gpiomux = { 0x0000,0x0800,0x1000,0x1000 },
1336 .gpiomute = 0x1800,
1337 .audio_mode_gpio= fv2000s_audio,
1338 .no_msp34xx = 1,
1339 .pll = PLL_28,
1340 .tuner_type = TUNER_PHILIPS_PAL,
1341 .tuner_addr = ADDR_UNSET,
1342 },
1343 [BTTV_BOARD_TERRATVALUER] = {
1344 .name = "Terratec TValueRadio",
1345 .video_inputs = 3,
1346
1347 .svhs = 2,
1348 .gpiomask = 0xffff00,
1349 .muxsel = MUXSEL(2, 3, 1, 1),
1350 .gpiomux = { 0x500, 0x500, 0x300, 0x900 },
1351 .gpiomute = 0x900,
1352 .pll = PLL_28,
1353 .tuner_type = TUNER_PHILIPS_PAL,
1354 .tuner_addr = ADDR_UNSET,
1355 .has_radio = 1,
1356 },
1357 [BTTV_BOARD_GVBCTV4PCI] = {
1358
1359 .name = "IODATA GV-BCTV4/PCI",
1360 .video_inputs = 3,
1361
1362 .svhs = 2,
1363 .gpiomask = 0x010f00,
1364 .muxsel = MUXSEL(2, 3, 0, 0),
1365 .gpiomux = {0x10000, 0, 0x10000, 0 },
1366 .no_msp34xx = 1,
1367 .pll = PLL_28,
1368 .tuner_type = TUNER_SHARP_2U5JF5540_NTSC,
1369 .tuner_addr = ADDR_UNSET,
1370 .audio_mode_gpio= gvbctv3pci_audio,
1371 },
1372
1373
1374 [BTTV_BOARD_VOODOOTV_FM] = {
1375 .name = "3Dfx VoodooTV FM (Euro)",
1376
1377
1378 .video_inputs = 4,
1379
1380 .svhs = NO_SVHS,
1381 .gpiomask = 0x4f8a00,
1382
1383
1384 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1385 .gpiomute = 0x947fff,
1386
1387
1388 .muxsel = MUXSEL(2, 3, 0, 1),
1389 .tuner_type = TUNER_MT2032,
1390 .tuner_addr = ADDR_UNSET,
1391 .pll = PLL_28,
1392 .has_radio = 1,
1393 },
1394 [BTTV_BOARD_VOODOOTV_200] = {
1395 .name = "VoodooTV 200 (USA)",
1396
1397
1398 .video_inputs = 4,
1399
1400 .svhs = NO_SVHS,
1401 .gpiomask = 0x4f8a00,
1402
1403
1404 .gpiomux = {0x947fff, 0x987fff,0x947fff,0x947fff },
1405 .gpiomute = 0x947fff,
1406
1407
1408 .muxsel = MUXSEL(2, 3, 0, 1),
1409 .tuner_type = TUNER_MT2032,
1410 .tuner_addr = ADDR_UNSET,
1411 .pll = PLL_28,
1412 .has_radio = 1,
1413 },
1414 [BTTV_BOARD_AIMMS] = {
1415
1416 .name = "Active Imaging AIMMS",
1417 .video_inputs = 1,
1418
1419 .tuner_type = TUNER_ABSENT,
1420 .tuner_addr = ADDR_UNSET,
1421 .pll = PLL_28,
1422 .muxsel = MUXSEL(2),
1423 .gpiomask = 0
1424 },
1425 [BTTV_BOARD_PV_BT878P_PLUS] = {
1426
1427 .name = "Prolink Pixelview PV-BT878P+ (Rev.4C,8E)",
1428 .video_inputs = 3,
1429
1430 .svhs = 2,
1431 .gpiomask = 15,
1432 .muxsel = MUXSEL(2, 3, 1, 1),
1433 .gpiomux = { 0, 0, 11, 7 },
1434 .gpiomute = 13,
1435 .pll = PLL_28,
1436 .tuner_type = TUNER_LG_PAL_I_FM,
1437 .tuner_addr = ADDR_UNSET,
1438 .has_remote = 1,
1439
1440
1441
1442
1443
1444
1445
1446 },
1447 [BTTV_BOARD_FLYVIDEO98EZ] = {
1448 .name = "Lifeview FlyVideo 98EZ (capture only) LR51",
1449 .video_inputs = 4,
1450
1451 .svhs = 2,
1452
1453 .muxsel = MUXSEL(2, 3, 1, 1),
1454 .pll = PLL_28,
1455 .no_msp34xx = 1,
1456 .tuner_type = TUNER_ABSENT,
1457 .tuner_addr = ADDR_UNSET,
1458 },
1459
1460
1461 [BTTV_BOARD_PV_BT878P_9B] = {
1462
1463 .name = "Prolink Pixelview PV-BT878P+9B (PlayTV Pro rev.9B FM+NICAM)",
1464 .video_inputs = 4,
1465
1466 .svhs = 2,
1467 .gpiomask = 0x3f,
1468 .muxsel = MUXSEL(2, 3, 1, 1),
1469 .gpiomux = { 0x01, 0x00, 0x03, 0x03 },
1470 .gpiomute = 0x09,
1471 .no_msp34xx = 1,
1472 .pll = PLL_28,
1473 .tuner_type = TUNER_PHILIPS_PAL,
1474 .tuner_addr = ADDR_UNSET,
1475 .audio_mode_gpio= pvbt878p9b_audio,
1476 .has_radio = 1,
1477 .has_remote = 1,
1478
1479
1480
1481
1482
1483
1484
1485 },
1486 [BTTV_BOARD_SENSORAY311_611] = {
1487
1488
1489 .name = "Sensoray 311/611",
1490 .video_inputs = 5,
1491
1492 .svhs = 4,
1493 .gpiomask = 0,
1494 .muxsel = MUXSEL(2, 3, 1, 0, 0),
1495 .gpiomux = { 0 },
1496 .tuner_type = TUNER_ABSENT,
1497 .tuner_addr = ADDR_UNSET,
1498 },
1499 [BTTV_BOARD_RV605] = {
1500
1501 .name = "RemoteVision MX (RV605)",
1502 .video_inputs = 16,
1503
1504 .svhs = NO_SVHS,
1505 .gpiomask = 0x00,
1506 .gpiomask2 = 0x07ff,
1507 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
1508 .no_msp34xx = 1,
1509 .tuner_type = TUNER_ABSENT,
1510 .tuner_addr = ADDR_UNSET,
1511 .muxsel_hook = rv605_muxsel,
1512 },
1513 [BTTV_BOARD_POWERCLR_MTV878] = {
1514 .name = "Powercolor MTV878/ MTV878R/ MTV878F",
1515 .video_inputs = 3,
1516
1517 .svhs = 2,
1518 .gpiomask = 0x1C800F,
1519 .muxsel = MUXSEL(2, 1, 1),
1520 .gpiomux = { 0, 1, 2, 2 },
1521 .gpiomute = 4,
1522 .tuner_type = TUNER_PHILIPS_PAL,
1523 .tuner_addr = ADDR_UNSET,
1524 .pll = PLL_28,
1525 .has_radio = 1,
1526 },
1527
1528
1529 [BTTV_BOARD_WINDVR] = {
1530
1531 .name = "Canopus WinDVR PCI (COMPAQ Presario 3524JP, 5112JP)",
1532 .video_inputs = 3,
1533
1534 .svhs = 2,
1535 .gpiomask = 0x140007,
1536 .muxsel = MUXSEL(2, 3, 1, 1),
1537 .gpiomux = { 0, 1, 2, 3 },
1538 .gpiomute = 4,
1539 .tuner_type = TUNER_PHILIPS_NTSC,
1540 .tuner_addr = ADDR_UNSET,
1541 .audio_mode_gpio= windvr_audio,
1542 },
1543 [BTTV_BOARD_GRANDTEC_MULTI] = {
1544 .name = "GrandTec Multi Capture Card (Bt878)",
1545 .video_inputs = 4,
1546
1547 .svhs = NO_SVHS,
1548 .gpiomask = 0,
1549 .muxsel = MUXSEL(2, 3, 1, 0),
1550 .gpiomux = { 0 },
1551 .no_msp34xx = 1,
1552 .pll = PLL_28,
1553 .tuner_type = TUNER_ABSENT,
1554 .tuner_addr = ADDR_UNSET,
1555 },
1556 [BTTV_BOARD_KWORLD] = {
1557 .name = "Jetway TV/Capture JW-TV878-FBK, Kworld KW-TV878RF",
1558 .video_inputs = 4,
1559
1560 .svhs = 2,
1561 .gpiomask = 7,
1562
1563 .muxsel = MUXSEL(2, 3, 1, 1),
1564 .gpiomux = { 0, 0, 4, 4 },
1565
1566
1567
1568
1569
1570
1571 .gpiomute = 4,
1572 .no_msp34xx = 1,
1573 .pll = PLL_28,
1574 .tuner_type = TUNER_PHILIPS_PAL,
1575 .tuner_addr = ADDR_UNSET,
1576
1577
1578 .has_radio = 1,
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588 },
1589 [BTTV_BOARD_DSP_TCVIDEO] = {
1590
1591 .name = "DSP Design TCVIDEO",
1592 .video_inputs = 4,
1593 .svhs = NO_SVHS,
1594 .muxsel = MUXSEL(2, 3, 1, 0),
1595 .pll = PLL_28,
1596 .tuner_type = UNSET,
1597 .tuner_addr = ADDR_UNSET,
1598 },
1599
1600
1601 [BTTV_BOARD_HAUPPAUGEPVR] = {
1602 .name = "Hauppauge WinTV PVR",
1603 .video_inputs = 4,
1604
1605 .svhs = 2,
1606 .muxsel = MUXSEL(2, 0, 1, 1),
1607 .pll = PLL_28,
1608 .tuner_type = UNSET,
1609 .tuner_addr = ADDR_UNSET,
1610
1611 .gpiomask = 7,
1612 .gpiomux = {7},
1613 },
1614 [BTTV_BOARD_GVBCTV5PCI] = {
1615 .name = "IODATA GV-BCTV5/PCI",
1616 .video_inputs = 3,
1617
1618 .svhs = 2,
1619 .gpiomask = 0x0f0f80,
1620 .muxsel = MUXSEL(2, 3, 1, 0),
1621 .gpiomux = {0x030000, 0x010000, 0, 0 },
1622 .gpiomute = 0x020000,
1623 .no_msp34xx = 1,
1624 .pll = PLL_28,
1625 .tuner_type = TUNER_PHILIPS_NTSC_M,
1626 .tuner_addr = ADDR_UNSET,
1627 .audio_mode_gpio= gvbctv5pci_audio,
1628 .has_radio = 1,
1629 },
1630 [BTTV_BOARD_OSPREY1x0] = {
1631 .name = "Osprey 100/150 (878)",
1632 .video_inputs = 4,
1633
1634 .svhs = 3,
1635 .muxsel = MUXSEL(3, 2, 0, 1),
1636 .pll = PLL_28,
1637 .tuner_type = TUNER_ABSENT,
1638 .tuner_addr = ADDR_UNSET,
1639 .no_msp34xx = 1,
1640 .no_tda7432 = 1,
1641 },
1642 [BTTV_BOARD_OSPREY1x0_848] = {
1643 .name = "Osprey 100/150 (848)",
1644 .video_inputs = 3,
1645
1646 .svhs = 2,
1647 .muxsel = MUXSEL(2, 3, 1),
1648 .pll = PLL_28,
1649 .tuner_type = TUNER_ABSENT,
1650 .tuner_addr = ADDR_UNSET,
1651 .no_msp34xx = 1,
1652 .no_tda7432 = 1,
1653 },
1654
1655
1656 [BTTV_BOARD_OSPREY101_848] = {
1657 .name = "Osprey 101 (848)",
1658 .video_inputs = 2,
1659
1660 .svhs = 1,
1661 .muxsel = MUXSEL(3, 1),
1662 .pll = PLL_28,
1663 .tuner_type = TUNER_ABSENT,
1664 .tuner_addr = ADDR_UNSET,
1665 .no_msp34xx = 1,
1666 .no_tda7432 = 1,
1667 },
1668 [BTTV_BOARD_OSPREY1x1] = {
1669 .name = "Osprey 101/151",
1670 .video_inputs = 1,
1671
1672 .svhs = NO_SVHS,
1673 .muxsel = MUXSEL(0),
1674 .pll = PLL_28,
1675 .tuner_type = TUNER_ABSENT,
1676 .tuner_addr = ADDR_UNSET,
1677 .no_msp34xx = 1,
1678 .no_tda7432 = 1,
1679 },
1680 [BTTV_BOARD_OSPREY1x1_SVID] = {
1681 .name = "Osprey 101/151 w/ svid",
1682 .video_inputs = 2,
1683
1684 .svhs = 1,
1685 .muxsel = MUXSEL(0, 1),
1686 .pll = PLL_28,
1687 .tuner_type = TUNER_ABSENT,
1688 .tuner_addr = ADDR_UNSET,
1689 .no_msp34xx = 1,
1690 .no_tda7432 = 1,
1691 },
1692 [BTTV_BOARD_OSPREY2xx] = {
1693 .name = "Osprey 200/201/250/251",
1694 .video_inputs = 1,
1695
1696 .svhs = NO_SVHS,
1697 .muxsel = MUXSEL(0),
1698 .pll = PLL_28,
1699 .tuner_type = TUNER_ABSENT,
1700 .tuner_addr = ADDR_UNSET,
1701 .no_msp34xx = 1,
1702 .no_tda7432 = 1,
1703 },
1704
1705
1706 [BTTV_BOARD_OSPREY2x0_SVID] = {
1707 .name = "Osprey 200/250",
1708 .video_inputs = 2,
1709
1710 .svhs = 1,
1711 .muxsel = MUXSEL(0, 1),
1712 .pll = PLL_28,
1713 .tuner_type = TUNER_ABSENT,
1714 .tuner_addr = ADDR_UNSET,
1715 .no_msp34xx = 1,
1716 .no_tda7432 = 1,
1717 },
1718 [BTTV_BOARD_OSPREY2x0] = {
1719 .name = "Osprey 210/220/230",
1720 .video_inputs = 2,
1721
1722 .svhs = 1,
1723 .muxsel = MUXSEL(2, 3),
1724 .pll = PLL_28,
1725 .tuner_type = TUNER_ABSENT,
1726 .tuner_addr = ADDR_UNSET,
1727 .no_msp34xx = 1,
1728 .no_tda7432 = 1,
1729 },
1730 [BTTV_BOARD_OSPREY500] = {
1731 .name = "Osprey 500",
1732 .video_inputs = 2,
1733
1734 .svhs = 1,
1735 .muxsel = MUXSEL(2, 3),
1736 .pll = PLL_28,
1737 .tuner_type = TUNER_ABSENT,
1738 .tuner_addr = ADDR_UNSET,
1739 .no_msp34xx = 1,
1740 .no_tda7432 = 1,
1741 },
1742 [BTTV_BOARD_OSPREY540] = {
1743 .name = "Osprey 540",
1744 .video_inputs = 4,
1745
1746 .pll = PLL_28,
1747 .tuner_type = TUNER_ABSENT,
1748 .tuner_addr = ADDR_UNSET,
1749 .no_msp34xx = 1,
1750 .no_tda7432 = 1,
1751 },
1752
1753
1754 [BTTV_BOARD_OSPREY2000] = {
1755 .name = "Osprey 2000",
1756 .video_inputs = 2,
1757
1758 .svhs = 1,
1759 .muxsel = MUXSEL(2, 3),
1760 .pll = PLL_28,
1761 .tuner_type = TUNER_ABSENT,
1762 .tuner_addr = ADDR_UNSET,
1763 .no_msp34xx = 1,
1764 .no_tda7432 = 1,
1765 },
1766 [BTTV_BOARD_IDS_EAGLE] = {
1767
1768 .name = "IDS Eagle",
1769 .video_inputs = 4,
1770
1771 .tuner_type = TUNER_ABSENT,
1772 .tuner_addr = ADDR_UNSET,
1773 .svhs = NO_SVHS,
1774 .gpiomask = 0,
1775 .muxsel = MUXSEL(2, 2, 2, 2),
1776 .muxsel_hook = eagle_muxsel,
1777 .no_msp34xx = 1,
1778 .pll = PLL_28,
1779 },
1780 [BTTV_BOARD_PINNACLESAT] = {
1781 .name = "Pinnacle PCTV Sat",
1782 .video_inputs = 2,
1783
1784 .svhs = 1,
1785 .tuner_type = TUNER_ABSENT,
1786 .tuner_addr = ADDR_UNSET,
1787 .no_msp34xx = 1,
1788 .no_tda7432 = 1,
1789 .muxsel = MUXSEL(3, 1),
1790 .pll = PLL_28,
1791 .no_gpioirq = 1,
1792 .has_dvb = 1,
1793 },
1794 [BTTV_BOARD_FORMAC_PROTV] = {
1795 .name = "Formac ProTV II (bt878)",
1796 .video_inputs = 4,
1797
1798 .svhs = 3,
1799 .gpiomask = 2,
1800
1801 .muxsel = MUXSEL(2, 3, 1, 1),
1802 .gpiomux = { 2, 2, 0, 0 },
1803 .pll = PLL_28,
1804 .has_radio = 1,
1805 .tuner_type = TUNER_PHILIPS_PAL,
1806 .tuner_addr = ADDR_UNSET,
1807
1808
1809
1810
1811
1812
1813
1814 },
1815
1816
1817 [BTTV_BOARD_MACHTV] = {
1818 .name = "MachTV",
1819 .video_inputs = 3,
1820
1821 .svhs = NO_SVHS,
1822 .gpiomask = 7,
1823 .muxsel = MUXSEL(2, 3, 1, 1),
1824 .gpiomux = { 0, 1, 2, 3},
1825 .gpiomute = 4,
1826 .tuner_type = TUNER_PHILIPS_PAL,
1827 .tuner_addr = ADDR_UNSET,
1828 .pll = PLL_28,
1829 },
1830 [BTTV_BOARD_EURESYS_PICOLO] = {
1831 .name = "Euresys Picolo",
1832 .video_inputs = 3,
1833
1834 .svhs = 2,
1835 .gpiomask = 0,
1836 .no_msp34xx = 1,
1837 .no_tda7432 = 1,
1838 .muxsel = MUXSEL(2, 0, 1),
1839 .pll = PLL_28,
1840 .tuner_type = TUNER_ABSENT,
1841 .tuner_addr = ADDR_UNSET,
1842 },
1843 [BTTV_BOARD_PV150] = {
1844
1845 .name = "ProVideo PV150",
1846 .video_inputs = 2,
1847
1848 .svhs = NO_SVHS,
1849 .gpiomask = 0,
1850 .muxsel = MUXSEL(2, 3),
1851 .gpiomux = { 0 },
1852 .no_msp34xx = 1,
1853 .pll = PLL_28,
1854 .tuner_type = TUNER_ABSENT,
1855 .tuner_addr = ADDR_UNSET,
1856 },
1857 [BTTV_BOARD_AD_TVK503] = {
1858
1859
1860 .name = "AD-TVK503",
1861 .video_inputs = 4,
1862
1863 .svhs = 2,
1864 .gpiomask = 0x001e8007,
1865 .muxsel = MUXSEL(2, 3, 1, 0),
1866
1867 .gpiomux = { 0x08, 0x0f, 0x0a, 0x08 },
1868 .gpiomute = 0x0f,
1869 .no_msp34xx = 1,
1870 .pll = PLL_28,
1871 .tuner_type = TUNER_PHILIPS_NTSC,
1872 .tuner_addr = ADDR_UNSET,
1873 .audio_mode_gpio= adtvk503_audio,
1874 },
1875
1876
1877 [BTTV_BOARD_HERCULES_SM_TV] = {
1878 .name = "Hercules Smart TV Stereo",
1879 .video_inputs = 4,
1880
1881 .svhs = 2,
1882 .gpiomask = 0x00,
1883 .muxsel = MUXSEL(2, 3, 1, 1),
1884 .no_msp34xx = 1,
1885 .pll = PLL_28,
1886 .tuner_type = TUNER_PHILIPS_PAL,
1887 .tuner_addr = ADDR_UNSET,
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897 },
1898 [BTTV_BOARD_PACETV] = {
1899 .name = "Pace TV & Radio Card",
1900 .video_inputs = 4,
1901
1902 .svhs = 2,
1903
1904 .muxsel = MUXSEL(2, 3, 1, 1),
1905 .gpiomask = 0,
1906 .no_tda7432 = 1,
1907 .tuner_type = TUNER_PHILIPS_PAL_I,
1908 .tuner_addr = ADDR_UNSET,
1909 .has_radio = 1,
1910 .pll = PLL_28,
1911
1912
1913
1914
1915
1916
1917 },
1918 [BTTV_BOARD_IVC200] = {
1919
1920 .name = "IVC-200",
1921 .video_inputs = 1,
1922
1923 .tuner_type = TUNER_ABSENT,
1924 .tuner_addr = ADDR_UNSET,
1925 .svhs = NO_SVHS,
1926 .gpiomask = 0xdf,
1927 .muxsel = MUXSEL(2),
1928 .pll = PLL_28,
1929 },
1930 [BTTV_BOARD_IVCE8784] = {
1931 .name = "IVCE-8784",
1932 .video_inputs = 1,
1933
1934 .tuner_type = TUNER_ABSENT,
1935 .tuner_addr = ADDR_UNSET,
1936 .svhs = NO_SVHS,
1937 .gpiomask = 0xdf,
1938 .muxsel = MUXSEL(2),
1939 .pll = PLL_28,
1940 },
1941 [BTTV_BOARD_XGUARD] = {
1942 .name = "Grand X-Guard / Trust 814PCI",
1943 .video_inputs = 16,
1944
1945 .svhs = NO_SVHS,
1946 .tuner_type = TUNER_ABSENT,
1947 .tuner_addr = ADDR_UNSET,
1948 .gpiomask2 = 0xff,
1949 .muxsel = MUXSEL(2,2,2,2, 3,3,3,3, 1,1,1,1, 0,0,0,0),
1950 .muxsel_hook = xguard_muxsel,
1951 .no_msp34xx = 1,
1952 .no_tda7432 = 1,
1953 .pll = PLL_28,
1954 },
1955
1956
1957 [BTTV_BOARD_NEBULA_DIGITV] = {
1958 .name = "Nebula Electronics DigiTV",
1959 .video_inputs = 1,
1960 .svhs = NO_SVHS,
1961 .muxsel = MUXSEL(2, 3, 1, 0),
1962 .no_msp34xx = 1,
1963 .no_tda7432 = 1,
1964 .pll = PLL_28,
1965 .tuner_type = TUNER_ABSENT,
1966 .tuner_addr = ADDR_UNSET,
1967 .has_dvb = 1,
1968 .has_remote = 1,
1969 .gpiomask = 0x1b,
1970 .no_gpioirq = 1,
1971 },
1972 [BTTV_BOARD_PV143] = {
1973
1974 .name = "ProVideo PV143",
1975 .video_inputs = 4,
1976
1977 .svhs = NO_SVHS,
1978 .gpiomask = 0,
1979 .muxsel = MUXSEL(2, 3, 1, 0),
1980 .gpiomux = { 0 },
1981 .no_msp34xx = 1,
1982 .pll = PLL_28,
1983 .tuner_type = TUNER_ABSENT,
1984 .tuner_addr = ADDR_UNSET,
1985 },
1986 [BTTV_BOARD_VD009X1_VD011_MINIDIN] = {
1987
1988 .name = "PHYTEC VD-009-X1 VD-011 MiniDIN (bt878)",
1989 .video_inputs = 4,
1990
1991 .svhs = 3,
1992 .gpiomask = 0x00,
1993 .muxsel = MUXSEL(2, 3, 1, 0),
1994 .gpiomux = { 0, 0, 0, 0 },
1995 .pll = PLL_28,
1996 .tuner_type = TUNER_ABSENT,
1997 .tuner_addr = ADDR_UNSET,
1998 },
1999 [BTTV_BOARD_VD009X1_VD011_COMBI] = {
2000 .name = "PHYTEC VD-009-X1 VD-011 Combi (bt878)",
2001 .video_inputs = 4,
2002
2003 .svhs = 3,
2004 .gpiomask = 0x00,
2005 .muxsel = MUXSEL(2, 3, 1, 1),
2006 .gpiomux = { 0, 0, 0, 0 },
2007 .pll = PLL_28,
2008 .tuner_type = TUNER_ABSENT,
2009 .tuner_addr = ADDR_UNSET,
2010 },
2011
2012
2013 [BTTV_BOARD_VD009_MINIDIN] = {
2014 .name = "PHYTEC VD-009 MiniDIN (bt878)",
2015 .video_inputs = 10,
2016
2017 .svhs = 9,
2018 .gpiomask = 0x00,
2019 .gpiomask2 = 0x03,
2020 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 0),
2021 .muxsel_hook = phytec_muxsel,
2022 .gpiomux = { 0, 0, 0, 0 },
2023 .pll = PLL_28,
2024 .tuner_type = TUNER_ABSENT,
2025 .tuner_addr = ADDR_UNSET,
2026 },
2027 [BTTV_BOARD_VD009_COMBI] = {
2028 .name = "PHYTEC VD-009 Combi (bt878)",
2029 .video_inputs = 10,
2030
2031 .svhs = 9,
2032 .gpiomask = 0x00,
2033 .gpiomask2 = 0x03,
2034 .muxsel = MUXSEL(2, 2, 2, 2, 3, 3, 3, 3, 1, 1),
2035 .muxsel_hook = phytec_muxsel,
2036 .gpiomux = { 0, 0, 0, 0 },
2037 .pll = PLL_28,
2038 .tuner_type = TUNER_ABSENT,
2039 .tuner_addr = ADDR_UNSET,
2040 },
2041 [BTTV_BOARD_IVC100] = {
2042 .name = "IVC-100",
2043 .video_inputs = 4,
2044
2045 .tuner_type = TUNER_ABSENT,
2046 .tuner_addr = ADDR_UNSET,
2047 .svhs = NO_SVHS,
2048 .gpiomask = 0xdf,
2049 .muxsel = MUXSEL(2, 3, 1, 0),
2050 .pll = PLL_28,
2051 },
2052 [BTTV_BOARD_IVC120] = {
2053
2054 .name = "IVC-120G",
2055 .video_inputs = 16,
2056
2057 .tuner_type = TUNER_ABSENT,
2058 .tuner_addr = ADDR_UNSET,
2059 .svhs = NO_SVHS,
2060 .no_msp34xx = 1,
2061 .no_tda7432 = 1,
2062 .gpiomask = 0x00,
2063 .muxsel = MUXSEL(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
2064 .muxsel_hook = ivc120_muxsel,
2065 .pll = PLL_28,
2066 },
2067
2068
2069 [BTTV_BOARD_PC_HDTV] = {
2070 .name = "pcHDTV HD-2000 TV",
2071 .video_inputs = 4,
2072
2073 .svhs = 2,
2074 .muxsel = MUXSEL(2, 3, 1, 0),
2075 .tuner_type = TUNER_PHILIPS_FCV1236D,
2076 .tuner_addr = ADDR_UNSET,
2077 .has_dvb = 1,
2078 },
2079 [BTTV_BOARD_TWINHAN_DST] = {
2080 .name = "Twinhan DST + clones",
2081 .no_msp34xx = 1,
2082 .no_tda7432 = 1,
2083 .tuner_type = TUNER_ABSENT,
2084 .tuner_addr = ADDR_UNSET,
2085 .no_video = 1,
2086 .has_dvb = 1,
2087 },
2088 [BTTV_BOARD_WINFASTVC100] = {
2089 .name = "Winfast VC100",
2090 .video_inputs = 3,
2091
2092 .svhs = 1,
2093
2094 .muxsel = MUXSEL(3, 1, 1, 3),
2095 .no_msp34xx = 1,
2096 .no_tda7432 = 1,
2097 .tuner_type = TUNER_ABSENT,
2098 .tuner_addr = ADDR_UNSET,
2099 .pll = PLL_28,
2100 },
2101 [BTTV_BOARD_TEV560] = {
2102 .name = "Teppro TEV-560/InterVision IV-560",
2103 .video_inputs = 3,
2104
2105 .svhs = 2,
2106 .gpiomask = 3,
2107 .muxsel = MUXSEL(2, 3, 1, 1),
2108 .gpiomux = { 1, 1, 1, 1 },
2109 .tuner_type = TUNER_PHILIPS_PAL,
2110 .tuner_addr = ADDR_UNSET,
2111 .pll = PLL_35,
2112 },
2113
2114
2115 [BTTV_BOARD_SIMUS_GVC1100] = {
2116 .name = "SIMUS GVC1100",
2117 .video_inputs = 4,
2118
2119 .svhs = NO_SVHS,
2120 .tuner_type = TUNER_ABSENT,
2121 .tuner_addr = ADDR_UNSET,
2122 .pll = PLL_28,
2123 .muxsel = MUXSEL(2, 2, 2, 2),
2124 .gpiomask = 0x3F,
2125 .muxsel_hook = gvc1100_muxsel,
2126 },
2127 [BTTV_BOARD_NGSTV_PLUS] = {
2128
2129 .name = "NGS NGSTV+",
2130 .video_inputs = 3,
2131 .svhs = 2,
2132 .gpiomask = 0x008007,
2133 .muxsel = MUXSEL(2, 3, 0, 0),
2134 .gpiomux = { 0, 0, 0, 0 },
2135 .gpiomute = 0x000003,
2136 .pll = PLL_28,
2137 .tuner_type = TUNER_PHILIPS_PAL,
2138 .tuner_addr = ADDR_UNSET,
2139 .has_remote = 1,
2140 },
2141 [BTTV_BOARD_LMLBT4] = {
2142
2143 .name = "LMLBT4",
2144 .video_inputs = 4,
2145
2146 .svhs = NO_SVHS,
2147 .muxsel = MUXSEL(2, 3, 1, 0),
2148 .no_msp34xx = 1,
2149 .no_tda7432 = 1,
2150 .tuner_type = TUNER_ABSENT,
2151 .tuner_addr = ADDR_UNSET,
2152 },
2153 [BTTV_BOARD_TEKRAM_M205] = {
2154
2155 .name = "Tekram M205 PRO",
2156 .video_inputs = 3,
2157
2158 .tuner_type = TUNER_PHILIPS_PAL,
2159 .tuner_addr = ADDR_UNSET,
2160 .svhs = 2,
2161 .gpiomask = 0x68,
2162 .muxsel = MUXSEL(2, 3, 1),
2163 .gpiomux = { 0x68, 0x68, 0x61, 0x61 },
2164 .pll = PLL_28,
2165 },
2166
2167
2168 [BTTV_BOARD_CONTVFMI] = {
2169
2170
2171 .name = "Conceptronic CONTVFMi",
2172 .video_inputs = 3,
2173
2174 .svhs = 2,
2175 .gpiomask = 0x008007,
2176 .muxsel = MUXSEL(2, 3, 1, 1),
2177 .gpiomux = { 0, 1, 2, 2 },
2178 .gpiomute = 3,
2179 .pll = PLL_28,
2180 .tuner_type = TUNER_PHILIPS_PAL,
2181 .tuner_addr = ADDR_UNSET,
2182 .has_remote = 1,
2183 .has_radio = 1,
2184 },
2185 [BTTV_BOARD_PICOLO_TETRA_CHIP] = {
2186
2187
2188
2189
2190 .name = "Euresys Picolo Tetra",
2191 .video_inputs = 4,
2192
2193 .svhs = NO_SVHS,
2194 .gpiomask = 0,
2195 .gpiomask2 = 0x3C<<16,
2196 .no_msp34xx = 1,
2197 .no_tda7432 = 1,
2198
2199 .muxsel = MUXSEL(2, 2, 2, 2),
2200 .gpiomux = { 0, 0, 0, 0 },
2201 .pll = PLL_28,
2202 .muxsel_hook = picolo_tetra_muxsel,
2203 .tuner_type = TUNER_ABSENT,
2204 .tuner_addr = ADDR_UNSET,
2205 },
2206 [BTTV_BOARD_SPIRIT_TV] = {
2207
2208
2209 .name = "Spirit TV Tuner",
2210 .video_inputs = 3,
2211
2212 .svhs = 2,
2213 .gpiomask = 0x0000000f,
2214 .muxsel = MUXSEL(2, 1, 1),
2215 .gpiomux = { 0x02, 0x00, 0x00, 0x00 },
2216 .tuner_type = TUNER_TEMIC_PAL,
2217 .tuner_addr = ADDR_UNSET,
2218 .no_msp34xx = 1,
2219 },
2220 [BTTV_BOARD_AVDVBT_771] = {
2221
2222 .name = "AVerMedia AVerTV DVB-T 771",
2223 .video_inputs = 2,
2224 .svhs = 1,
2225 .tuner_type = TUNER_ABSENT,
2226 .tuner_addr = ADDR_UNSET,
2227 .muxsel = MUXSEL(3, 3),
2228 .no_msp34xx = 1,
2229 .no_tda7432 = 1,
2230 .pll = PLL_28,
2231 .has_dvb = 1,
2232 .no_gpioirq = 1,
2233 .has_remote = 1,
2234 },
2235
2236 [BTTV_BOARD_AVDVBT_761] = {
2237
2238
2239 .name = "AverMedia AverTV DVB-T 761",
2240 .video_inputs = 2,
2241 .svhs = 1,
2242 .muxsel = MUXSEL(3, 1, 2, 0),
2243 .no_msp34xx = 1,
2244 .no_tda7432 = 1,
2245 .pll = PLL_28,
2246 .tuner_type = TUNER_ABSENT,
2247 .tuner_addr = ADDR_UNSET,
2248 .has_dvb = 1,
2249 .no_gpioirq = 1,
2250 .has_remote = 1,
2251 },
2252 [BTTV_BOARD_MATRIX_VISIONSQ] = {
2253
2254 .name = "MATRIX Vision Sigma-SQ",
2255 .video_inputs = 16,
2256
2257 .svhs = NO_SVHS,
2258 .gpiomask = 0x0,
2259 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3),
2260 .muxsel_hook = sigmaSQ_muxsel,
2261 .gpiomux = { 0 },
2262 .no_msp34xx = 1,
2263 .pll = PLL_28,
2264 .tuner_type = TUNER_ABSENT,
2265 .tuner_addr = ADDR_UNSET,
2266 },
2267 [BTTV_BOARD_MATRIX_VISIONSLC] = {
2268
2269 .name = "MATRIX Vision Sigma-SLC",
2270 .video_inputs = 4,
2271
2272 .svhs = NO_SVHS,
2273 .gpiomask = 0x0,
2274 .muxsel = MUXSEL(2, 2, 2, 2),
2275 .muxsel_hook = sigmaSLC_muxsel,
2276 .gpiomux = { 0 },
2277 .no_msp34xx = 1,
2278 .pll = PLL_28,
2279 .tuner_type = TUNER_ABSENT,
2280 .tuner_addr = ADDR_UNSET,
2281 },
2282
2283 [BTTV_BOARD_APAC_VIEWCOMP] = {
2284
2285
2286 .name = "APAC Viewcomp 878(AMAX)",
2287 .video_inputs = 2,
2288
2289 .svhs = NO_SVHS,
2290 .gpiomask = 0xFF,
2291 .muxsel = MUXSEL(2, 3, 1, 1),
2292 .gpiomux = { 2, 0, 0, 0 },
2293 .gpiomute = 10,
2294 .pll = PLL_28,
2295 .tuner_type = TUNER_PHILIPS_PAL,
2296 .tuner_addr = ADDR_UNSET,
2297 .has_remote = 1,
2298 .has_radio = 1,
2299 },
2300
2301
2302 [BTTV_BOARD_DVICO_DVBT_LITE] = {
2303
2304 .name = "DViCO FusionHDTV DVB-T Lite",
2305 .no_msp34xx = 1,
2306 .no_tda7432 = 1,
2307 .pll = PLL_28,
2308 .no_video = 1,
2309 .has_dvb = 1,
2310 .tuner_type = TUNER_ABSENT,
2311 .tuner_addr = ADDR_UNSET,
2312 },
2313 [BTTV_BOARD_VGEAR_MYVCD] = {
2314
2315 .name = "V-Gear MyVCD",
2316 .video_inputs = 3,
2317
2318 .svhs = 2,
2319 .gpiomask = 0x3f,
2320 .muxsel = MUXSEL(2, 3, 1, 0),
2321 .gpiomux = {0x31, 0x31, 0x31, 0x31 },
2322 .gpiomute = 0x31,
2323 .no_msp34xx = 1,
2324 .pll = PLL_28,
2325 .tuner_type = TUNER_PHILIPS_NTSC_M,
2326 .tuner_addr = ADDR_UNSET,
2327 .has_radio = 0,
2328 },
2329 [BTTV_BOARD_SUPER_TV] = {
2330
2331 .name = "Super TV Tuner",
2332 .video_inputs = 4,
2333
2334 .svhs = 2,
2335 .muxsel = MUXSEL(2, 3, 1, 0),
2336 .tuner_type = TUNER_PHILIPS_NTSC,
2337 .tuner_addr = ADDR_UNSET,
2338 .gpiomask = 0x008007,
2339 .gpiomux = { 0, 0x000001,0,0 },
2340 .has_radio = 1,
2341 },
2342 [BTTV_BOARD_TIBET_CS16] = {
2343
2344 .name = "Tibet Systems 'Progress DVR' CS16",
2345 .video_inputs = 16,
2346
2347 .svhs = NO_SVHS,
2348 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2349 .pll = PLL_28,
2350 .no_msp34xx = 1,
2351 .no_tda7432 = 1,
2352 .tuner_type = TUNER_ABSENT,
2353 .tuner_addr = ADDR_UNSET,
2354 .muxsel_hook = tibetCS16_muxsel,
2355 },
2356 [BTTV_BOARD_KODICOM_4400R] = {
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368 .name = "Kodicom 4400R (master)",
2369 .video_inputs = 16,
2370
2371 .tuner_type = TUNER_ABSENT,
2372 .tuner_addr = ADDR_UNSET,
2373 .svhs = NO_SVHS,
2374
2375
2376
2377
2378
2379
2380
2381
2382 .gpiomask = 0x0003ff,
2383 .no_gpioirq = 1,
2384 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2385 .pll = PLL_28,
2386 .no_msp34xx = 1,
2387 .no_tda7432 = 1,
2388 .muxsel_hook = kodicom4400r_muxsel,
2389 },
2390 [BTTV_BOARD_KODICOM_4400R_SL] = {
2391
2392
2393
2394
2395
2396
2397 .name = "Kodicom 4400R (slave)",
2398 .video_inputs = 16,
2399
2400 .tuner_type = TUNER_ABSENT,
2401 .tuner_addr = ADDR_UNSET,
2402 .svhs = NO_SVHS,
2403 .gpiomask = 0x010000,
2404 .no_gpioirq = 1,
2405 .muxsel = MUXSEL(3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3),
2406 .pll = PLL_28,
2407 .no_msp34xx = 1,
2408 .no_tda7432 = 1,
2409 .muxsel_hook = kodicom4400r_muxsel,
2410 },
2411
2412 [BTTV_BOARD_ADLINK_RTV24] = {
2413
2414
2415 .name = "Adlink RTV24",
2416 .video_inputs = 4,
2417
2418 .svhs = 2,
2419 .muxsel = MUXSEL(2, 3, 1, 0),
2420 .tuner_type = UNSET,
2421 .tuner_addr = ADDR_UNSET,
2422 .pll = PLL_28,
2423 },
2424
2425 [BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE] = {
2426
2427 .name = "DViCO FusionHDTV 5 Lite",
2428 .tuner_type = TUNER_LG_TDVS_H06XF,
2429 .tuner_addr = ADDR_UNSET,
2430 .video_inputs = 3,
2431
2432 .svhs = 2,
2433 .muxsel = MUXSEL(2, 3, 1),
2434 .gpiomask = 0x00e00007,
2435 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2436 .gpiomute = 0x00c00007,
2437 .no_msp34xx = 1,
2438 .no_tda7432 = 1,
2439 .has_dvb = 1,
2440 },
2441
2442 [BTTV_BOARD_ACORP_Y878F] = {
2443
2444 .name = "Acorp Y878F",
2445 .video_inputs = 3,
2446
2447 .svhs = 2,
2448 .gpiomask = 0x01fe00,
2449 .muxsel = MUXSEL(2, 3, 1, 1),
2450 .gpiomux = { 0x001e00, 0, 0x018000, 0x014000 },
2451 .gpiomute = 0x002000,
2452 .pll = PLL_28,
2453 .tuner_type = TUNER_YMEC_TVF66T5_B_DFF,
2454 .tuner_addr = 0xc1 >>1,
2455 .has_radio = 1,
2456 },
2457
2458 [BTTV_BOARD_CONCEPTRONIC_CTVFMI2] = {
2459 .name = "Conceptronic CTVFMi v2",
2460 .video_inputs = 3,
2461
2462 .svhs = 2,
2463 .gpiomask = 0x001c0007,
2464 .muxsel = MUXSEL(2, 3, 1, 1),
2465 .gpiomux = { 0, 1, 2, 2 },
2466 .gpiomute = 3,
2467 .pll = PLL_28,
2468 .tuner_type = TUNER_TENA_9533_DI,
2469 .tuner_addr = ADDR_UNSET,
2470 .has_remote = 1,
2471 .has_radio = 1,
2472 },
2473
2474 [BTTV_BOARD_PV_BT878P_2E] = {
2475 .name = "Prolink Pixelview PV-BT878P+ (Rev.2E)",
2476 .video_inputs = 5,
2477
2478 .svhs = 3,
2479 .has_dig_in = 1,
2480 .gpiomask = 0x01fe00,
2481 .muxsel = MUXSEL(2, 3, 1, 1, 0),
2482
2483 .gpiomux = { 0x00400, 0x10400, 0x04400, 0x80000 },
2484 .gpiomute = 0x12400,
2485 .no_msp34xx = 1,
2486 .pll = PLL_28,
2487 .tuner_type = TUNER_LG_PAL_FM,
2488 .tuner_addr = ADDR_UNSET,
2489 .has_remote = 1,
2490 },
2491
2492 [BTTV_BOARD_PV_M4900] = {
2493
2494 .name = "Prolink PixelView PlayTV MPEG2 PV-M4900",
2495 .video_inputs = 3,
2496
2497 .svhs = 2,
2498 .gpiomask = 0x3f,
2499 .muxsel = MUXSEL(2, 3, 1, 1),
2500 .gpiomux = { 0x21, 0x20, 0x24, 0x2c },
2501 .gpiomute = 0x29,
2502 .no_msp34xx = 1,
2503 .pll = PLL_28,
2504 .tuner_type = TUNER_YMEC_TVF_5533MF,
2505 .tuner_addr = ADDR_UNSET,
2506 .has_radio = 1,
2507 .has_remote = 1,
2508 },
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522 [BTTV_BOARD_OSPREY440] = {
2523 .name = "Osprey 440",
2524 .video_inputs = 4,
2525
2526 .svhs = NO_SVHS,
2527 .muxsel = MUXSEL(2, 3, 0, 1),
2528 .gpiomask = 0x303,
2529 .gpiomute = 0x000,
2530 .gpiomux = { 0, 0, 0x000, 0x100},
2531 .pll = PLL_28,
2532 .tuner_type = TUNER_ABSENT,
2533 .tuner_addr = ADDR_UNSET,
2534 .no_msp34xx = 1,
2535 .no_tda7432 = 1,
2536 },
2537
2538 [BTTV_BOARD_ASOUND_SKYEYE] = {
2539 .name = "Asound Skyeye PCTV",
2540 .video_inputs = 3,
2541
2542 .svhs = 2,
2543 .gpiomask = 15,
2544 .muxsel = MUXSEL(2, 3, 1, 1),
2545 .gpiomux = { 2, 0, 0, 0 },
2546 .gpiomute = 1,
2547 .pll = PLL_28,
2548 .tuner_type = TUNER_PHILIPS_NTSC,
2549 .tuner_addr = ADDR_UNSET,
2550 },
2551
2552 [BTTV_BOARD_SABRENT_TVFM] = {
2553 .name = "Sabrent TV-FM (bttv version)",
2554 .video_inputs = 3,
2555
2556 .svhs = 2,
2557 .gpiomask = 0x108007,
2558 .muxsel = MUXSEL(2, 3, 1, 1),
2559 .gpiomux = { 100000, 100002, 100002, 100000 },
2560 .no_msp34xx = 1,
2561 .no_tda7432 = 1,
2562 .pll = PLL_28,
2563 .tuner_type = TUNER_TNF_5335MF,
2564 .tuner_addr = ADDR_UNSET,
2565 .has_radio = 1,
2566 },
2567
2568 [BTTV_BOARD_HAUPPAUGE_IMPACTVCB] = {
2569 .name = "Hauppauge ImpactVCB (bt878)",
2570 .video_inputs = 4,
2571
2572 .svhs = NO_SVHS,
2573 .gpiomask = 0x0f,
2574 .muxsel = MUXSEL(0, 1, 3, 2),
2575 .no_msp34xx = 1,
2576 .no_tda7432 = 1,
2577 .tuner_type = TUNER_ABSENT,
2578 .tuner_addr = ADDR_UNSET,
2579 },
2580 [BTTV_BOARD_MACHTV_MAGICTV] = {
2581
2582
2583
2584
2585
2586
2587
2588 .name = "MagicTV",
2589 .video_inputs = 3,
2590
2591 .svhs = 2,
2592 .gpiomask = 7,
2593 .muxsel = MUXSEL(2, 3, 1, 1),
2594 .gpiomux = { 0, 1, 2, 3 },
2595 .gpiomute = 4,
2596 .tuner_type = TUNER_TEMIC_4009FR5_PAL,
2597 .tuner_addr = ADDR_UNSET,
2598 .pll = PLL_28,
2599 .has_radio = 1,
2600 .has_remote = 1,
2601 },
2602 [BTTV_BOARD_SSAI_SECURITY] = {
2603 .name = "SSAI Security Video Interface",
2604 .video_inputs = 4,
2605
2606 .svhs = NO_SVHS,
2607 .muxsel = MUXSEL(0, 1, 2, 3),
2608 .tuner_type = TUNER_ABSENT,
2609 .tuner_addr = ADDR_UNSET,
2610 },
2611 [BTTV_BOARD_SSAI_ULTRASOUND] = {
2612 .name = "SSAI Ultrasound Video Interface",
2613 .video_inputs = 2,
2614
2615 .svhs = 1,
2616 .muxsel = MUXSEL(2, 0, 1, 3),
2617 .tuner_type = TUNER_ABSENT,
2618 .tuner_addr = ADDR_UNSET,
2619 },
2620
2621 [BTTV_BOARD_DVICO_FUSIONHDTV_2] = {
2622 .name = "DViCO FusionHDTV 2",
2623 .tuner_type = TUNER_PHILIPS_FCV1236D,
2624 .tuner_addr = ADDR_UNSET,
2625 .video_inputs = 3,
2626
2627 .svhs = 2,
2628 .muxsel = MUXSEL(2, 3, 1),
2629 .gpiomask = 0x00e00007,
2630 .gpiomux = { 0x00400005, 0, 0x00000001, 0 },
2631 .gpiomute = 0x00c00007,
2632 .no_msp34xx = 1,
2633 .no_tda7432 = 1,
2634 },
2635
2636 [BTTV_BOARD_TYPHOON_TVTUNERPCI] = {
2637 .name = "Typhoon TV-Tuner PCI (50684)",
2638 .video_inputs = 3,
2639
2640 .svhs = 2,
2641 .gpiomask = 0x3014f,
2642 .muxsel = MUXSEL(2, 3, 1, 1),
2643 .gpiomux = { 0x20001,0x10001, 0, 0 },
2644 .gpiomute = 10,
2645 .pll = PLL_28,
2646 .tuner_type = TUNER_PHILIPS_PAL_I,
2647 .tuner_addr = ADDR_UNSET,
2648 },
2649 [BTTV_BOARD_GEOVISION_GV600] = {
2650
2651 .name = "Geovision GV-600",
2652 .video_inputs = 16,
2653
2654 .svhs = NO_SVHS,
2655 .gpiomask = 0x0,
2656 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2657 .muxsel_hook = geovision_muxsel,
2658 .gpiomux = { 0 },
2659 .no_msp34xx = 1,
2660 .pll = PLL_28,
2661 .tuner_type = TUNER_ABSENT,
2662 .tuner_addr = ADDR_UNSET,
2663 },
2664 [BTTV_BOARD_KOZUMI_KTV_01C] = {
2665
2666
2667
2668 .name = "Kozumi KTV-01C",
2669 .video_inputs = 3,
2670
2671 .svhs = 2,
2672 .gpiomask = 0x008007,
2673 .muxsel = MUXSEL(2, 3, 1, 1),
2674 .gpiomux = { 0, 1, 2, 2 },
2675 .gpiomute = 3,
2676 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
2677 .tuner_addr = ADDR_UNSET,
2678 .pll = PLL_28,
2679 .has_radio = 1,
2680 .has_remote = 1,
2681 },
2682 [BTTV_BOARD_ENLTV_FM_2] = {
2683
2684
2685 .name = "Encore ENL TV-FM-2",
2686 .video_inputs = 3,
2687
2688 .svhs = 2,
2689
2690
2691
2692
2693
2694
2695 .gpiomask = 0x060040,
2696 .muxsel = MUXSEL(2, 3, 3),
2697 .gpiomux = { 0x60000, 0x60000, 0x20000, 0x20000 },
2698 .gpiomute = 0,
2699 .tuner_type = TUNER_TCL_MF02GIP_5N,
2700 .tuner_addr = ADDR_UNSET,
2701 .pll = PLL_28,
2702 .has_radio = 1,
2703 .has_remote = 1,
2704 },
2705 [BTTV_BOARD_VD012] = {
2706
2707 .name = "PHYTEC VD-012 (bt878)",
2708 .video_inputs = 4,
2709
2710 .svhs = NO_SVHS,
2711 .gpiomask = 0x00,
2712 .muxsel = MUXSEL(0, 2, 3, 1),
2713 .gpiomux = { 0, 0, 0, 0 },
2714 .pll = PLL_28,
2715 .tuner_type = TUNER_ABSENT,
2716 .tuner_addr = ADDR_UNSET,
2717 },
2718 [BTTV_BOARD_VD012_X1] = {
2719
2720 .name = "PHYTEC VD-012-X1 (bt878)",
2721 .video_inputs = 4,
2722
2723 .svhs = 3,
2724 .gpiomask = 0x00,
2725 .muxsel = MUXSEL(2, 3, 1),
2726 .gpiomux = { 0, 0, 0, 0 },
2727 .pll = PLL_28,
2728 .tuner_type = TUNER_ABSENT,
2729 .tuner_addr = ADDR_UNSET,
2730 },
2731 [BTTV_BOARD_VD012_X2] = {
2732
2733 .name = "PHYTEC VD-012-X2 (bt878)",
2734 .video_inputs = 4,
2735
2736 .svhs = 3,
2737 .gpiomask = 0x00,
2738 .muxsel = MUXSEL(3, 2, 1),
2739 .gpiomux = { 0, 0, 0, 0 },
2740 .pll = PLL_28,
2741 .tuner_type = TUNER_ABSENT,
2742 .tuner_addr = ADDR_UNSET,
2743 },
2744 [BTTV_BOARD_GEOVISION_GV800S] = {
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757 .name = "Geovision GV-800(S) (master)",
2758 .video_inputs = 4,
2759
2760 .tuner_type = TUNER_ABSENT,
2761 .tuner_addr = ADDR_UNSET,
2762 .svhs = NO_SVHS,
2763 .gpiomask = 0xf107f,
2764 .no_gpioirq = 1,
2765 .muxsel = MUXSEL(2, 2, 2, 2),
2766 .pll = PLL_28,
2767 .no_msp34xx = 1,
2768 .no_tda7432 = 1,
2769 .muxsel_hook = gv800s_muxsel,
2770 },
2771 [BTTV_BOARD_GEOVISION_GV800S_SL] = {
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781 .name = "Geovision GV-800(S) (slave)",
2782 .video_inputs = 4,
2783
2784 .tuner_type = TUNER_ABSENT,
2785 .tuner_addr = ADDR_UNSET,
2786 .svhs = NO_SVHS,
2787 .gpiomask = 0x00,
2788 .no_gpioirq = 1,
2789 .muxsel = MUXSEL(2, 2, 2, 2),
2790 .pll = PLL_28,
2791 .no_msp34xx = 1,
2792 .no_tda7432 = 1,
2793 .muxsel_hook = gv800s_muxsel,
2794 },
2795 [BTTV_BOARD_PV183] = {
2796 .name = "ProVideo PV183",
2797 .video_inputs = 2,
2798
2799 .svhs = NO_SVHS,
2800 .gpiomask = 0,
2801 .muxsel = MUXSEL(2, 3),
2802 .gpiomux = { 0 },
2803 .no_msp34xx = 1,
2804 .pll = PLL_28,
2805 .tuner_type = TUNER_ABSENT,
2806 .tuner_addr = ADDR_UNSET,
2807 },
2808
2809 [BTTV_BOARD_TVT_TD3116] = {
2810 .name = "Tongwei Video Technology TD-3116",
2811 .video_inputs = 16,
2812 .gpiomask = 0xc00ff,
2813 .muxsel = MUXSEL(2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2),
2814 .muxsel_hook = td3116_muxsel,
2815 .svhs = NO_SVHS,
2816 .pll = PLL_28,
2817 .tuner_type = TUNER_ABSENT,
2818 },
2819 [BTTV_BOARD_APOSONIC_WDVR] = {
2820 .name = "Aposonic W-DVR",
2821 .video_inputs = 4,
2822 .svhs = NO_SVHS,
2823 .muxsel = MUXSEL(2, 3, 1, 0),
2824 .tuner_type = TUNER_ABSENT,
2825 },
2826 [BTTV_BOARD_ADLINK_MPG24] = {
2827
2828 .name = "Adlink MPG24",
2829 .video_inputs = 1,
2830
2831 .svhs = NO_SVHS,
2832 .muxsel = MUXSEL(2, 2, 2, 2),
2833 .tuner_type = UNSET,
2834 .tuner_addr = ADDR_UNSET,
2835 .pll = PLL_28,
2836 },
2837 [BTTV_BOARD_BT848_CAP_14] = {
2838 .name = "Bt848 Capture 14MHz",
2839 .video_inputs = 4,
2840 .svhs = 2,
2841 .muxsel = MUXSEL(2, 3, 1, 0),
2842 .pll = PLL_14,
2843 .tuner_type = TUNER_ABSENT,
2844 },
2845 [BTTV_BOARD_CYBERVISION_CV06] = {
2846 .name = "CyberVision CV06 (SV)",
2847 .video_inputs = 4,
2848
2849 .svhs = NO_SVHS,
2850 .muxsel = MUXSEL(2, 3, 1, 0),
2851 .pll = PLL_28,
2852 .tuner_type = TUNER_ABSENT,
2853 .tuner_addr = ADDR_UNSET,
2854 },
2855 [BTTV_BOARD_KWORLD_VSTREAM_XPERT] = {
2856
2857 .name = "Kworld V-Stream Xpert TV PVR878",
2858 .video_inputs = 3,
2859
2860 .svhs = 2,
2861 .gpiomask = 0x001c0007,
2862 .muxsel = MUXSEL(2, 3, 1, 1),
2863 .gpiomux = { 0, 1, 2, 2 },
2864 .gpiomute = 3,
2865 .pll = PLL_28,
2866 .tuner_type = TUNER_TENA_9533_DI,
2867 .tuner_addr = ADDR_UNSET,
2868 .has_remote = 1,
2869 .has_radio = 1,
2870 },
2871
2872 [BTTV_BOARD_PCI_8604PW] = {
2873
2874 .name = "PCI-8604PW",
2875 .video_inputs = 2,
2876
2877 .svhs = NO_SVHS,
2878
2879
2880
2881 .muxsel = MUXSEL(2, 3),
2882 .tuner_type = TUNER_ABSENT,
2883 .no_msp34xx = 1,
2884 .no_tda7432 = 1,
2885 .pll = PLL_35,
2886 },
2887};
2888
2889static const unsigned int bttv_num_tvcards = ARRAY_SIZE(bttv_tvcards);
2890
2891
2892
2893static unsigned char eeprom_data[256];
2894
2895
2896
2897
2898void bttv_idcard(struct bttv *btv)
2899{
2900 unsigned int gpiobits;
2901 int i,type;
2902
2903
2904 btv->cardid = btv->c.pci->subsystem_device << 16;
2905 btv->cardid |= btv->c.pci->subsystem_vendor;
2906
2907 if (0 != btv->cardid && 0xffffffff != btv->cardid) {
2908
2909 for (type = -1, i = 0; cards[i].id != 0; i++)
2910 if (cards[i].id == btv->cardid)
2911 type = i;
2912
2913 if (type != -1) {
2914
2915 pr_info("%d: detected: %s [card=%d], PCI subsystem ID is %04x:%04x\n",
2916 btv->c.nr, cards[type].name, cards[type].cardnr,
2917 btv->cardid & 0xffff,
2918 (btv->cardid >> 16) & 0xffff);
2919 btv->c.type = cards[type].cardnr;
2920 } else {
2921
2922 pr_info("%d: subsystem: %04x:%04x (UNKNOWN)\n",
2923 btv->c.nr, btv->cardid & 0xffff,
2924 (btv->cardid >> 16) & 0xffff);
2925 pr_debug("please mail id, board name and the correct card= insmod option to linux-media@vger.kernel.org\n");
2926 }
2927 }
2928
2929
2930 if (card[btv->c.nr] < bttv_num_tvcards)
2931 btv->c.type=card[btv->c.nr];
2932
2933
2934 pr_info("%d: using: %s [card=%d,%s]\n",
2935 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type,
2936 card[btv->c.nr] < bttv_num_tvcards
2937 ? "insmod option" : "autodetected");
2938
2939
2940 if (UNSET == audioall && UNSET == audiomux[0])
2941 return;
2942
2943 if (UNSET != audiomux[0]) {
2944 gpiobits = 0;
2945 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2946 bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i];
2947 gpiobits |= audiomux[i];
2948 }
2949 } else {
2950 gpiobits = audioall;
2951 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2952 bttv_tvcards[btv->c.type].gpiomux[i] = audioall;
2953 }
2954 }
2955 bttv_tvcards[btv->c.type].gpiomask = (UNSET != gpiomask) ? gpiomask : gpiobits;
2956 pr_info("%d: gpio config override: mask=0x%x, mux=",
2957 btv->c.nr, bttv_tvcards[btv->c.type].gpiomask);
2958 for (i = 0; i < ARRAY_SIZE(bttv_tvcards->gpiomux); i++) {
2959 pr_cont("%s0x%x",
2960 i ? "," : "", bttv_tvcards[btv->c.type].gpiomux[i]);
2961 }
2962 pr_cont("\n");
2963}
2964
2965
2966
2967
2968
2969
2970static void identify_by_eeprom(struct bttv *btv, unsigned char eeprom_data[256])
2971{
2972 int type = -1;
2973
2974 if (0 == strncmp(eeprom_data,"GET MM20xPCTV",13))
2975 type = BTTV_BOARD_MODTEC_205;
2976 else if (0 == strncmp(eeprom_data+20,"Picolo",7))
2977 type = BTTV_BOARD_EURESYS_PICOLO;
2978 else if (eeprom_data[0] == 0x84 && eeprom_data[2]== 0)
2979 type = BTTV_BOARD_HAUPPAUGE;
2980
2981 if (-1 != type) {
2982 btv->c.type = type;
2983 pr_info("%d: detected by eeprom: %s [card=%d]\n",
2984 btv->c.nr, bttv_tvcards[btv->c.type].name, btv->c.type);
2985 }
2986}
2987
2988static void flyvideo_gpio(struct bttv *btv)
2989{
2990 int gpio, has_remote, has_radio, is_capture_only;
2991 int is_lr90, has_tda9820_tda9821;
2992 int tuner_type = UNSET, ttype;
2993
2994 gpio_inout(0xffffff, 0);
2995 udelay(8);
2996 gpio = gpio_read();
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010 ttype = (gpio & 0x0f0000) >> 16;
3011 switch (ttype) {
3012 case 0x0:
3013 tuner_type = 2;
3014 break;
3015 case 0x2:
3016 tuner_type = 39;
3017 break;
3018 case 0x4:
3019 tuner_type = 5;
3020 break;
3021 case 0x6:
3022 tuner_type = 37;
3023 break;
3024 case 0xC:
3025 tuner_type = 3;
3026 break;
3027 default:
3028 pr_info("%d: FlyVideo_gpio: unknown tuner type\n", btv->c.nr);
3029 break;
3030 }
3031
3032 has_remote = gpio & 0x800000;
3033 has_radio = gpio & 0x400000;
3034
3035
3036 is_capture_only = !(gpio & 0x008000);
3037 has_tda9820_tda9821 = !(gpio & 0x004000);
3038 is_lr90 = !(gpio & 0x002000);
3039
3040
3041
3042 if (is_capture_only)
3043 tuner_type = TUNER_ABSENT;
3044
3045 pr_info("%d: FlyVideo Radio=%s RemoteControl=%s Tuner=%d gpio=0x%06x\n",
3046 btv->c.nr, has_radio ? "yes" : "no",
3047 has_remote ? "yes" : "no", tuner_type, gpio);
3048 pr_info("%d: FlyVideo LR90=%s tda9821/tda9820=%s capture_only=%s\n",
3049 btv->c.nr, is_lr90 ? "yes" : "no",
3050 has_tda9820_tda9821 ? "yes" : "no",
3051 is_capture_only ? "yes" : "no");
3052
3053 if (tuner_type != UNSET)
3054 btv->tuner_type = tuner_type;
3055 btv->has_radio = has_radio;
3056
3057
3058
3059
3060 if (has_tda9820_tda9821)
3061 btv->audio_mode_gpio = lt9415_audio;
3062
3063}
3064
3065static int miro_tunermap[] = { 0,6,2,3, 4,5,6,0, 3,0,4,5, 5,2,16,1,
3066 14,2,17,1, 4,1,4,3, 1,2,16,1, 4,4,4,4 };
3067static int miro_fmtuner[] = { 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1,
3068 1,1,1,1, 1,1,1,0, 0,0,0,0, 0,1,0,0 };
3069
3070static void miro_pinnacle_gpio(struct bttv *btv)
3071{
3072 int id,msp,gpio;
3073 char *info;
3074
3075 gpio_inout(0xffffff, 0);
3076 gpio = gpio_read();
3077 id = ((gpio>>10) & 63) -1;
3078 msp = bttv_I2CRead(btv, I2C_ADDR_MSP3400, "MSP34xx");
3079 if (id < 32) {
3080 btv->tuner_type = miro_tunermap[id];
3081 if (0 == (gpio & 0x20)) {
3082 btv->has_radio = 1;
3083 if (!miro_fmtuner[id]) {
3084 btv->has_tea575x = 1;
3085 btv->tea_gpio.wren = 6;
3086 btv->tea_gpio.most = 7;
3087 btv->tea_gpio.clk = 8;
3088 btv->tea_gpio.data = 9;
3089 tea575x_init(btv);
3090 }
3091 } else {
3092 btv->has_radio = 0;
3093 }
3094 if (-1 != msp) {
3095 if (btv->c.type == BTTV_BOARD_MIRO)
3096 btv->c.type = BTTV_BOARD_MIROPRO;
3097 if (btv->c.type == BTTV_BOARD_PINNACLE)
3098 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3099 }
3100 pr_info("%d: miro: id=%d tuner=%d radio=%s stereo=%s\n",
3101 btv->c.nr, id+1, btv->tuner_type,
3102 !btv->has_radio ? "no" :
3103 (btv->has_tea575x ? "tea575x" : "fmtuner"),
3104 (-1 == msp) ? "no" : "yes");
3105 } else {
3106
3107 id = 63 - id;
3108 btv->has_radio = 0;
3109 switch (id) {
3110 case 1:
3111 info = "PAL / mono";
3112 btv->tda9887_conf = TDA9887_INTERCARRIER;
3113 break;
3114 case 2:
3115 info = "PAL+SECAM / stereo";
3116 btv->has_radio = 1;
3117 btv->tda9887_conf = TDA9887_QSS;
3118 break;
3119 case 3:
3120 info = "NTSC / stereo";
3121 btv->has_radio = 1;
3122 btv->tda9887_conf = TDA9887_QSS;
3123 break;
3124 case 4:
3125 info = "PAL+SECAM / mono";
3126 btv->tda9887_conf = TDA9887_QSS;
3127 break;
3128 case 5:
3129 info = "NTSC / mono";
3130 btv->tda9887_conf = TDA9887_INTERCARRIER;
3131 break;
3132 case 6:
3133 info = "NTSC / stereo";
3134 btv->tda9887_conf = TDA9887_INTERCARRIER;
3135 break;
3136 case 7:
3137 info = "PAL / stereo";
3138 btv->tda9887_conf = TDA9887_INTERCARRIER;
3139 break;
3140 default:
3141 info = "oops: unknown card";
3142 break;
3143 }
3144 if (-1 != msp)
3145 btv->c.type = BTTV_BOARD_PINNACLEPRO;
3146 pr_info("%d: pinnacle/mt: id=%d info=\"%s\" radio=%s\n",
3147 btv->c.nr, id, info, btv->has_radio ? "yes" : "no");
3148 btv->tuner_type = TUNER_MT2032;
3149 }
3150}
3151
3152
3153#define LM1882_SYNC_DRIVE 0x200000L
3154
3155static void init_ids_eagle(struct bttv *btv)
3156{
3157 gpio_inout(0xffffff,0xFFFF37);
3158 gpio_write(0x200020);
3159
3160
3161 gpio_write(0x200024);
3162
3163
3164 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3165
3166
3167 btaor((2)<<5, ~(2<<5), BT848_IFORM);
3168}
3169
3170
3171
3172
3173static void eagle_muxsel(struct bttv *btv, unsigned int input)
3174{
3175 gpio_bits(3, input & 3);
3176
3177
3178
3179 btor(BT848_ADC_C_SLEEP, BT848_ADC);
3180
3181 btand(~BT848_CONTROL_COMP, BT848_E_CONTROL);
3182 btand(~BT848_CONTROL_COMP, BT848_O_CONTROL);
3183
3184
3185 gpio_bits(LM1882_SYNC_DRIVE,LM1882_SYNC_DRIVE);
3186}
3187
3188static void gvc1100_muxsel(struct bttv *btv, unsigned int input)
3189{
3190 static const int masks[] = {0x30, 0x01, 0x12, 0x23};
3191 gpio_write(masks[input%4]);
3192}
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207static void init_lmlbt4x(struct bttv *btv)
3208{
3209 pr_debug("LMLBT4x init\n");
3210 btwrite(0x000000, BT848_GPIO_REG_INP);
3211 gpio_inout(0xffffff, 0x0006C0);
3212 gpio_write(0x000000);
3213}
3214
3215static void sigmaSQ_muxsel(struct bttv *btv, unsigned int input)
3216{
3217 unsigned int inmux = input % 8;
3218 gpio_inout( 0xf, 0xf );
3219 gpio_bits( 0xf, inmux );
3220}
3221
3222static void sigmaSLC_muxsel(struct bttv *btv, unsigned int input)
3223{
3224 unsigned int inmux = input % 4;
3225 gpio_inout( 3<<9, 3<<9 );
3226 gpio_bits( 3<<9, inmux<<9 );
3227}
3228
3229static void geovision_muxsel(struct bttv *btv, unsigned int input)
3230{
3231 unsigned int inmux = input % 16;
3232 gpio_inout(0xf, 0xf);
3233 gpio_bits(0xf, inmux);
3234}
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246static void td3116_latch_value(struct bttv *btv, u32 value)
3247{
3248 gpio_bits((1<<18) | 0xff, value);
3249 gpio_bits((1<<18) | 0xff, (1<<18) | value);
3250 udelay(1);
3251 gpio_bits((1<<18) | 0xff, value);
3252}
3253
3254static void td3116_muxsel(struct bttv *btv, unsigned int input)
3255{
3256 u32 value;
3257 u32 highbit;
3258
3259 highbit = (input & 0x8) >> 3 ;
3260
3261
3262 value = 0x11;
3263 value |= ((input & 0x7) << 1) << (4 * highbit);
3264 td3116_latch_value(btv, value);
3265
3266
3267 value &= ~0x11;
3268 value |= ((highbit ^ 0x1) << 4) | highbit;
3269 td3116_latch_value(btv, value);
3270}
3271
3272
3273
3274static void bttv_reset_audio(struct bttv *btv)
3275{
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285 if (btv->id != 878)
3286 return;
3287
3288 if (bttv_debug)
3289 pr_debug("%d: BT878A ARESET\n", btv->c.nr);
3290 btwrite((1<<7), 0x058);
3291 udelay(10);
3292 btwrite( 0, 0x058);
3293}
3294
3295
3296void bttv_init_card1(struct bttv *btv)
3297{
3298 switch (btv->c.type) {
3299 case BTTV_BOARD_HAUPPAUGE:
3300 case BTTV_BOARD_HAUPPAUGE878:
3301 boot_msp34xx(btv,5);
3302 break;
3303 case BTTV_BOARD_VOODOOTV_200:
3304 case BTTV_BOARD_VOODOOTV_FM:
3305 boot_msp34xx(btv,20);
3306 break;
3307 case BTTV_BOARD_AVERMEDIA98:
3308 boot_msp34xx(btv,11);
3309 break;
3310 case BTTV_BOARD_HAUPPAUGEPVR:
3311 pvr_boot(btv);
3312 break;
3313 case BTTV_BOARD_TWINHAN_DST:
3314 case BTTV_BOARD_AVDVBT_771:
3315 case BTTV_BOARD_PINNACLESAT:
3316 btv->use_i2c_hw = 1;
3317 break;
3318 case BTTV_BOARD_ADLINK_RTV24:
3319 init_RTV24( btv );
3320 break;
3321 case BTTV_BOARD_PCI_8604PW:
3322 init_PCI8604PW(btv);
3323 break;
3324
3325 }
3326 if (!bttv_tvcards[btv->c.type].has_dvb)
3327 bttv_reset_audio(btv);
3328}
3329
3330
3331void bttv_init_card2(struct bttv *btv)
3332{
3333 btv->tuner_type = UNSET;
3334
3335 if (BTTV_BOARD_UNKNOWN == btv->c.type) {
3336 bttv_readee(btv,eeprom_data,0xa0);
3337 identify_by_eeprom(btv,eeprom_data);
3338 }
3339
3340 switch (btv->c.type) {
3341 case BTTV_BOARD_MIRO:
3342 case BTTV_BOARD_MIROPRO:
3343 case BTTV_BOARD_PINNACLE:
3344 case BTTV_BOARD_PINNACLEPRO:
3345
3346 miro_pinnacle_gpio(btv);
3347 break;
3348 case BTTV_BOARD_FLYVIDEO_98:
3349 case BTTV_BOARD_MAXI:
3350 case BTTV_BOARD_LIFE_FLYKIT:
3351 case BTTV_BOARD_FLYVIDEO:
3352 case BTTV_BOARD_TYPHOON_TVIEW:
3353 case BTTV_BOARD_CHRONOS_VS2:
3354 case BTTV_BOARD_FLYVIDEO_98FM:
3355 case BTTV_BOARD_FLYVIDEO2000:
3356 case BTTV_BOARD_FLYVIDEO98EZ:
3357 case BTTV_BOARD_CONFERENCETV:
3358 case BTTV_BOARD_LIFETEC_9415:
3359 flyvideo_gpio(btv);
3360 break;
3361 case BTTV_BOARD_HAUPPAUGE:
3362 case BTTV_BOARD_HAUPPAUGE878:
3363 case BTTV_BOARD_HAUPPAUGEPVR:
3364
3365 bttv_readee(btv,eeprom_data,0xa0);
3366 hauppauge_eeprom(btv);
3367 break;
3368 case BTTV_BOARD_AVERMEDIA98:
3369 case BTTV_BOARD_AVPHONE98:
3370 bttv_readee(btv,eeprom_data,0xa0);
3371 avermedia_eeprom(btv);
3372 break;
3373 case BTTV_BOARD_PXC200:
3374 init_PXC200(btv);
3375 break;
3376 case BTTV_BOARD_PICOLO_TETRA_CHIP:
3377 picolo_tetra_init(btv);
3378 break;
3379 case BTTV_BOARD_VHX:
3380 btv->has_radio = 1;
3381 btv->has_tea575x = 1;
3382 btv->tea_gpio.wren = 5;
3383 btv->tea_gpio.most = 6;
3384 btv->tea_gpio.clk = 3;
3385 btv->tea_gpio.data = 4;
3386 tea575x_init(btv);
3387 break;
3388 case BTTV_BOARD_VOBIS_BOOSTAR:
3389 case BTTV_BOARD_TERRATV:
3390 terratec_active_radio_upgrade(btv);
3391 break;
3392 case BTTV_BOARD_MAGICTVIEW061:
3393 if (btv->cardid == 0x3002144f) {
3394 btv->has_radio=1;
3395 pr_info("%d: radio detected by subsystem id (CPH05x)\n",
3396 btv->c.nr);
3397 }
3398 break;
3399 case BTTV_BOARD_STB2:
3400 if (btv->cardid == 0x3060121a) {
3401
3402
3403 btv->has_radio=0;
3404 btv->tuner_type=TUNER_TEMIC_NTSC;
3405 }
3406 break;
3407 case BTTV_BOARD_OSPREY1x0:
3408 case BTTV_BOARD_OSPREY1x0_848:
3409 case BTTV_BOARD_OSPREY101_848:
3410 case BTTV_BOARD_OSPREY1x1:
3411 case BTTV_BOARD_OSPREY1x1_SVID:
3412 case BTTV_BOARD_OSPREY2xx:
3413 case BTTV_BOARD_OSPREY2x0_SVID:
3414 case BTTV_BOARD_OSPREY2x0:
3415 case BTTV_BOARD_OSPREY440:
3416 case BTTV_BOARD_OSPREY500:
3417 case BTTV_BOARD_OSPREY540:
3418 case BTTV_BOARD_OSPREY2000:
3419 bttv_readee(btv,eeprom_data,0xa0);
3420 osprey_eeprom(btv, eeprom_data);
3421 break;
3422 case BTTV_BOARD_IDS_EAGLE:
3423 init_ids_eagle(btv);
3424 break;
3425 case BTTV_BOARD_MODTEC_205:
3426 bttv_readee(btv,eeprom_data,0xa0);
3427 modtec_eeprom(btv);
3428 break;
3429 case BTTV_BOARD_LMLBT4:
3430 init_lmlbt4x(btv);
3431 break;
3432 case BTTV_BOARD_TIBET_CS16:
3433 tibetCS16_init(btv);
3434 break;
3435 case BTTV_BOARD_KODICOM_4400R:
3436 kodicom4400r_init(btv);
3437 break;
3438 case BTTV_BOARD_GEOVISION_GV800S:
3439 gv800s_init(btv);
3440 break;
3441 }
3442
3443
3444 if (!(btv->id==848 && btv->revision==0x11)) {
3445
3446 if (PLL_28 == bttv_tvcards[btv->c.type].pll) {
3447 btv->pll.pll_ifreq=28636363;
3448 btv->pll.pll_crystal=BT848_IFORM_XT0;
3449 }
3450 if (PLL_35 == bttv_tvcards[btv->c.type].pll) {
3451 btv->pll.pll_ifreq=35468950;
3452 btv->pll.pll_crystal=BT848_IFORM_XT1;
3453 }
3454 if (PLL_14 == bttv_tvcards[btv->c.type].pll) {
3455 btv->pll.pll_ifreq = 14318181;
3456 btv->pll.pll_crystal = BT848_IFORM_XT0;
3457 }
3458
3459 switch (pll[btv->c.nr]) {
3460 case 0:
3461 btv->pll.pll_crystal = 0;
3462 btv->pll.pll_ifreq = 0;
3463 btv->pll.pll_ofreq = 0;
3464 break;
3465 case 1:
3466 case 28:
3467 btv->pll.pll_ifreq = 28636363;
3468 btv->pll.pll_ofreq = 0;
3469 btv->pll.pll_crystal = BT848_IFORM_XT0;
3470 break;
3471 case 2:
3472 case 35:
3473 btv->pll.pll_ifreq = 35468950;
3474 btv->pll.pll_ofreq = 0;
3475 btv->pll.pll_crystal = BT848_IFORM_XT1;
3476 break;
3477 case 3:
3478 case 14:
3479 btv->pll.pll_ifreq = 14318181;
3480 btv->pll.pll_ofreq = 0;
3481 btv->pll.pll_crystal = BT848_IFORM_XT0;
3482 break;
3483 }
3484 }
3485 btv->pll.pll_current = -1;
3486
3487
3488 if (UNSET != bttv_tvcards[btv->c.type].tuner_type)
3489 if (UNSET == btv->tuner_type)
3490 btv->tuner_type = bttv_tvcards[btv->c.type].tuner_type;
3491 if (UNSET != tuner[btv->c.nr])
3492 btv->tuner_type = tuner[btv->c.nr];
3493
3494 if (btv->tuner_type == TUNER_ABSENT)
3495 pr_info("%d: tuner absent\n", btv->c.nr);
3496 else if (btv->tuner_type == UNSET)
3497 pr_warn("%d: tuner type unset\n", btv->c.nr);
3498 else
3499 pr_info("%d: tuner type=%d\n", btv->c.nr, btv->tuner_type);
3500
3501 if (autoload != UNSET) {
3502 pr_warn("%d: the autoload option is obsolete\n", btv->c.nr);
3503 pr_warn("%d: use option msp3400, tda7432 or tvaudio to override which audio module should be used\n",
3504 btv->c.nr);
3505 }
3506
3507 if (UNSET == btv->tuner_type)
3508 btv->tuner_type = TUNER_ABSENT;
3509
3510 btv->dig = bttv_tvcards[btv->c.type].has_dig_in ?
3511 bttv_tvcards[btv->c.type].video_inputs - 1 : UNSET;
3512 btv->svhs = bttv_tvcards[btv->c.type].svhs == NO_SVHS ?
3513 UNSET : bttv_tvcards[btv->c.type].svhs;
3514 if (svhs[btv->c.nr] != UNSET)
3515 btv->svhs = svhs[btv->c.nr];
3516 if (remote[btv->c.nr] != UNSET)
3517 btv->has_remote = remote[btv->c.nr];
3518
3519 if (bttv_tvcards[btv->c.type].has_radio)
3520 btv->has_radio = 1;
3521 if (bttv_tvcards[btv->c.type].has_remote)
3522 btv->has_remote = 1;
3523 if (!bttv_tvcards[btv->c.type].no_gpioirq)
3524 btv->gpioirq = 1;
3525 if (bttv_tvcards[btv->c.type].volume_gpio)
3526 btv->volume_gpio = bttv_tvcards[btv->c.type].volume_gpio;
3527 if (bttv_tvcards[btv->c.type].audio_mode_gpio)
3528 btv->audio_mode_gpio = bttv_tvcards[btv->c.type].audio_mode_gpio;
3529
3530 if (btv->tuner_type == TUNER_ABSENT)
3531 return;
3532
3533 if (btv->has_saa6588 || saa6588[btv->c.nr]) {
3534
3535 static const unsigned short addrs[] = {
3536 0x20 >> 1,
3537 0x22 >> 1,
3538 I2C_CLIENT_END
3539 };
3540 struct v4l2_subdev *sd;
3541
3542 sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3543 &btv->c.i2c_adap, "saa6588", 0, addrs);
3544 btv->has_saa6588 = (sd != NULL);
3545 }
3546
3547
3548
3549
3550
3551
3552 switch (audiodev[btv->c.nr]) {
3553 case -1:
3554 return;
3555
3556 case 0:
3557 break;
3558
3559 case 1: {
3560
3561 static const unsigned short addrs[] = {
3562 I2C_ADDR_MSP3400 >> 1,
3563 I2C_ADDR_MSP3400_ALT >> 1,
3564 I2C_CLIENT_END
3565 };
3566
3567 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3568 &btv->c.i2c_adap, "msp3400", 0, addrs);
3569 if (btv->sd_msp34xx)
3570 return;
3571 goto no_audio;
3572 }
3573
3574 case 2: {
3575
3576 static const unsigned short addrs[] = {
3577 I2C_ADDR_TDA7432 >> 1,
3578 I2C_CLIENT_END
3579 };
3580
3581 if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3582 &btv->c.i2c_adap, "tda7432", 0, addrs))
3583 return;
3584 goto no_audio;
3585 }
3586
3587 case 3: {
3588
3589 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3590 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3591 if (btv->sd_tvaudio)
3592 return;
3593 goto no_audio;
3594 }
3595
3596 default:
3597 pr_warn("%d: unknown audiodev value!\n", btv->c.nr);
3598 return;
3599 }
3600
3601
3602
3603
3604
3605
3606
3607 if (!bttv_tvcards[btv->c.type].no_msp34xx) {
3608 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3609 &btv->c.i2c_adap, "msp3400",
3610 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
3611 } else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
3612 btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3613 &btv->c.i2c_adap, "msp3400",
3614 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
3615 }
3616
3617
3618 if (btv->sd_msp34xx)
3619 return;
3620
3621
3622 btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3623 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3624 if (btv->sd_tvaudio) {
3625
3626
3627 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3628 &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
3629 }
3630
3631
3632 if (!bttv_tvcards[btv->c.type].no_tda7432) {
3633 static const unsigned short addrs[] = {
3634 I2C_ADDR_TDA7432 >> 1,
3635 I2C_CLIENT_END
3636 };
3637
3638 btv->sd_tda7432 = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3639 &btv->c.i2c_adap, "tda7432", 0, addrs);
3640 if (btv->sd_tda7432)
3641 return;
3642 }
3643 if (btv->sd_tvaudio)
3644 return;
3645
3646no_audio:
3647 pr_warn("%d: audio absent, no audio device found!\n", btv->c.nr);
3648}
3649
3650
3651
3652void bttv_init_tuner(struct bttv *btv)
3653{
3654 int addr = ADDR_UNSET;
3655
3656 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
3657 addr = bttv_tvcards[btv->c.type].tuner_addr;
3658
3659 if (btv->tuner_type != TUNER_ABSENT) {
3660 struct tuner_setup tun_setup;
3661
3662
3663 if (btv->has_radio)
3664 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3665 &btv->c.i2c_adap, "tuner",
3666 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
3667 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3668 &btv->c.i2c_adap, "tuner",
3669 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
3670 v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
3671 &btv->c.i2c_adap, "tuner",
3672 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
3673
3674 tun_setup.mode_mask = T_ANALOG_TV;
3675 tun_setup.type = btv->tuner_type;
3676 tun_setup.addr = addr;
3677
3678 if (btv->has_radio)
3679 tun_setup.mode_mask |= T_RADIO;
3680
3681 bttv_call_all(btv, tuner, s_type_addr, &tun_setup);
3682 }
3683
3684 if (btv->tda9887_conf) {
3685 struct v4l2_priv_tun_config tda9887_cfg;
3686
3687 tda9887_cfg.tuner = TUNER_TDA9887;
3688 tda9887_cfg.priv = &btv->tda9887_conf;
3689
3690 bttv_call_all(btv, tuner, s_config, &tda9887_cfg);
3691 }
3692}
3693
3694
3695
3696static void modtec_eeprom(struct bttv *btv)
3697{
3698 if( strncmp(&(eeprom_data[0x1e]),"Temic 4066 FY5",14) ==0) {
3699 btv->tuner_type=TUNER_TEMIC_4066FY5_PAL_I;
3700 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3701 btv->c.nr, &eeprom_data[0x1e]);
3702 } else if (strncmp(&(eeprom_data[0x1e]),"Alps TSBB5",10) ==0) {
3703 btv->tuner_type=TUNER_ALPS_TSBB5_PAL_I;
3704 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3705 btv->c.nr, &eeprom_data[0x1e]);
3706 } else if (strncmp(&(eeprom_data[0x1e]),"Philips FM1246",14) ==0) {
3707 btv->tuner_type=TUNER_PHILIPS_NTSC;
3708 pr_info("%d: Modtec: Tuner autodetected by eeprom: %s\n",
3709 btv->c.nr, &eeprom_data[0x1e]);
3710 } else {
3711 pr_info("%d: Modtec: Unknown TunerString: %s\n",
3712 btv->c.nr, &eeprom_data[0x1e]);
3713 }
3714}
3715
3716static void hauppauge_eeprom(struct bttv *btv)
3717{
3718 struct tveeprom tv;
3719
3720 tveeprom_hauppauge_analog(&tv, eeprom_data);
3721 btv->tuner_type = tv.tuner_type;
3722 btv->has_radio = tv.has_radio;
3723
3724 pr_info("%d: Hauppauge eeprom indicates model#%d\n",
3725 btv->c.nr, tv.model);
3726
3727
3728
3729
3730
3731 if(tv.model == 64900) {
3732 pr_info("%d: Switching board type from %s to %s\n",
3733 btv->c.nr,
3734 bttv_tvcards[btv->c.type].name,
3735 bttv_tvcards[BTTV_BOARD_HAUPPAUGE_IMPACTVCB].name);
3736 btv->c.type = BTTV_BOARD_HAUPPAUGE_IMPACTVCB;
3737 }
3738
3739
3740 if (tv.model == 61334)
3741 btv->radio_uses_msp_demodulator = 1;
3742}
3743
3744
3745
3746static void bttv_tea575x_set_pins(struct snd_tea575x *tea, u8 pins)
3747{
3748 struct bttv *btv = tea->private_data;
3749 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3750 u16 val = 0;
3751
3752 val |= (pins & TEA575X_DATA) ? (1 << gpio.data) : 0;
3753 val |= (pins & TEA575X_CLK) ? (1 << gpio.clk) : 0;
3754 val |= (pins & TEA575X_WREN) ? (1 << gpio.wren) : 0;
3755
3756 gpio_bits((1 << gpio.data) | (1 << gpio.clk) | (1 << gpio.wren), val);
3757 if (btv->mbox_ior) {
3758
3759 gpio_bits(btv->mbox_iow | btv->mbox_csel, 0);
3760 udelay(5);
3761
3762 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3763 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3764 }
3765}
3766
3767static u8 bttv_tea575x_get_pins(struct snd_tea575x *tea)
3768{
3769 struct bttv *btv = tea->private_data;
3770 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3771 u8 ret = 0;
3772 u16 val;
3773
3774 if (btv->mbox_ior) {
3775
3776 gpio_bits(btv->mbox_ior | btv->mbox_csel, 0);
3777 udelay(5);
3778 }
3779 val = gpio_read();
3780 if (btv->mbox_ior) {
3781
3782 gpio_bits(btv->mbox_ior | btv->mbox_iow | btv->mbox_csel,
3783 btv->mbox_ior | btv->mbox_iow | btv->mbox_csel);
3784 }
3785
3786 if (val & (1 << gpio.data))
3787 ret |= TEA575X_DATA;
3788 if (val & (1 << gpio.most))
3789 ret |= TEA575X_MOST;
3790
3791 return ret;
3792}
3793
3794static void bttv_tea575x_set_direction(struct snd_tea575x *tea, bool output)
3795{
3796 struct bttv *btv = tea->private_data;
3797 struct bttv_tea575x_gpio gpio = btv->tea_gpio;
3798 u32 mask = (1 << gpio.clk) | (1 << gpio.wren) | (1 << gpio.data) |
3799 (1 << gpio.most);
3800
3801 if (output)
3802 gpio_inout(mask, (1 << gpio.data) | (1 << gpio.clk) |
3803 (1 << gpio.wren));
3804 else
3805 gpio_inout(mask, (1 << gpio.clk) | (1 << gpio.wren));
3806}
3807
3808static const struct snd_tea575x_ops bttv_tea_ops = {
3809 .set_pins = bttv_tea575x_set_pins,
3810 .get_pins = bttv_tea575x_get_pins,
3811 .set_direction = bttv_tea575x_set_direction,
3812};
3813
3814static int tea575x_init(struct bttv *btv)
3815{
3816 btv->tea.private_data = btv;
3817 btv->tea.ops = &bttv_tea_ops;
3818 if (!snd_tea575x_hw_init(&btv->tea)) {
3819 pr_info("%d: detected TEA575x radio\n", btv->c.nr);
3820 btv->tea.mute = false;
3821 return 0;
3822 }
3823
3824 btv->has_tea575x = 0;
3825 btv->has_radio = 0;
3826
3827 return -ENODEV;
3828}
3829
3830
3831
3832static int terratec_active_radio_upgrade(struct bttv *btv)
3833{
3834 btv->has_radio = 1;
3835 btv->has_tea575x = 1;
3836 btv->tea_gpio.wren = 4;
3837 btv->tea_gpio.most = 5;
3838 btv->tea_gpio.clk = 3;
3839 btv->tea_gpio.data = 2;
3840
3841 btv->mbox_iow = 1 << 8;
3842 btv->mbox_ior = 1 << 9;
3843 btv->mbox_csel = 1 << 10;
3844
3845 if (!tea575x_init(btv)) {
3846 pr_info("%d: Terratec Active Radio Upgrade found\n", btv->c.nr);
3847 btv->has_saa6588 = 1;
3848 }
3849
3850 return 0;
3851}
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863#define PVR_GPIO_DELAY 10
3864
3865#define BTTV_ALT_DATA 0x000001
3866#define BTTV_ALT_DCLK 0x100000
3867#define BTTV_ALT_NCONFIG 0x800000
3868
3869static int pvr_altera_load(struct bttv *btv, const u8 *micro, u32 microlen)
3870{
3871 u32 n;
3872 u8 bits;
3873 int i;
3874
3875 gpio_inout(0xffffff,BTTV_ALT_DATA|BTTV_ALT_DCLK|BTTV_ALT_NCONFIG);
3876 gpio_write(0);
3877 udelay(PVR_GPIO_DELAY);
3878
3879 gpio_write(BTTV_ALT_NCONFIG);
3880 udelay(PVR_GPIO_DELAY);
3881
3882 for (n = 0; n < microlen; n++) {
3883 bits = micro[n];
3884 for (i = 0 ; i < 8 ; i++) {
3885 gpio_bits(BTTV_ALT_DCLK,0);
3886 if (bits & 0x01)
3887 gpio_bits(BTTV_ALT_DATA,BTTV_ALT_DATA);
3888 else
3889 gpio_bits(BTTV_ALT_DATA,0);
3890 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3891 bits >>= 1;
3892 }
3893 }
3894 gpio_bits(BTTV_ALT_DCLK,0);
3895 udelay(PVR_GPIO_DELAY);
3896
3897
3898 for (i = 0 ; i < 30 ; i++) {
3899 gpio_bits(BTTV_ALT_DCLK,0);
3900 gpio_bits(BTTV_ALT_DCLK,BTTV_ALT_DCLK);
3901 }
3902 gpio_bits(BTTV_ALT_DCLK,0);
3903 return 0;
3904}
3905
3906static int pvr_boot(struct bttv *btv)
3907{
3908 const struct firmware *fw_entry;
3909 int rc;
3910
3911 rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
3912 if (rc != 0) {
3913 pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
3914 return rc;
3915 }
3916 rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
3917 pr_info("%d: altera firmware upload %s\n",
3918 btv->c.nr, (rc < 0) ? "failed" : "ok");
3919 release_firmware(fw_entry);
3920 return rc;
3921}
3922
3923
3924
3925
3926static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
3927{
3928 int i;
3929 u32 serial = 0;
3930 int cardid = -1;
3931
3932
3933 if (btv->c.type == BTTV_BOARD_UNKNOWN) {
3934
3935 if (!strncmp(ee, "MMAC", 4)) {
3936 u8 checksum = 0;
3937 for (i = 0; i < 21; i++)
3938 checksum += ee[i];
3939 if (checksum != ee[21])
3940 return;
3941 cardid = BTTV_BOARD_OSPREY1x0_848;
3942 for (i = 12; i < 21; i++)
3943 serial *= 10, serial += ee[i] - '0';
3944 }
3945 } else {
3946 unsigned short type;
3947
3948 for (i = 4 * 16; i < 8 * 16; i += 16) {
3949 u16 checksum = (__force u16)ip_compute_csum(ee + i, 16);
3950
3951 if ((checksum & 0xff) + (checksum >> 8) == 0xff)
3952 break;
3953 }
3954 if (i >= 8*16)
3955 return;
3956 ee += i;
3957
3958
3959 type = get_unaligned_be16((__be16 *)(ee+4));
3960
3961 switch(type) {
3962
3963 case 0x0004:
3964 cardid = BTTV_BOARD_OSPREY1x0_848;
3965 break;
3966 case 0x0005:
3967 cardid = BTTV_BOARD_OSPREY101_848;
3968 break;
3969
3970
3971 case 0x0012:
3972 case 0x0013:
3973 cardid = BTTV_BOARD_OSPREY1x0;
3974 break;
3975 case 0x0014:
3976 case 0x0015:
3977 cardid = BTTV_BOARD_OSPREY1x1;
3978 break;
3979 case 0x0016:
3980 case 0x0017:
3981 case 0x0020:
3982 cardid = BTTV_BOARD_OSPREY1x1_SVID;
3983 break;
3984 case 0x0018:
3985 case 0x0019:
3986 case 0x001E:
3987 case 0x001F:
3988 cardid = BTTV_BOARD_OSPREY2xx;
3989 break;
3990 case 0x001A:
3991 case 0x001B:
3992 cardid = BTTV_BOARD_OSPREY2x0_SVID;
3993 break;
3994 case 0x0040:
3995 cardid = BTTV_BOARD_OSPREY500;
3996 break;
3997 case 0x0050:
3998 case 0x0056:
3999 cardid = BTTV_BOARD_OSPREY540;
4000
4001 break;
4002 case 0x0060:
4003 case 0x0070:
4004 case 0x00A0:
4005 cardid = BTTV_BOARD_OSPREY2x0;
4006
4007 gpio_inout(0xffffff,0x000303);
4008 break;
4009 case 0x00D8:
4010 cardid = BTTV_BOARD_OSPREY440;
4011 break;
4012 default:
4013
4014 pr_info("%d: osprey eeprom: unknown card type 0x%04x\n",
4015 btv->c.nr, type);
4016 break;
4017 }
4018 serial = get_unaligned_be32((__be32 *)(ee+6));
4019 }
4020
4021 pr_info("%d: osprey eeprom: card=%d '%s' serial=%u\n",
4022 btv->c.nr, cardid,
4023 cardid > 0 ? bttv_tvcards[cardid].name : "Unknown", serial);
4024
4025 if (cardid<0 || btv->c.type == cardid)
4026 return;
4027
4028
4029 if (card[btv->c.nr] < bttv_num_tvcards) {
4030 pr_warn("%d: osprey eeprom: Not overriding user specified card type\n",
4031 btv->c.nr);
4032 } else {
4033 pr_info("%d: osprey eeprom: Changing card type from %d to %d\n",
4034 btv->c.nr, btv->c.type, cardid);
4035 btv->c.type = cardid;
4036 }
4037}
4038
4039
4040
4041
4042static int tuner_0_table[] = {
4043 TUNER_PHILIPS_NTSC, TUNER_PHILIPS_PAL ,
4044 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL ,
4045 TUNER_PHILIPS_PAL, TUNER_PHILIPS_PAL,
4046 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_SECAM,
4047 TUNER_PHILIPS_SECAM, TUNER_PHILIPS_PAL,
4048 TUNER_PHILIPS_FM1216ME_MK3 };
4049
4050static int tuner_1_table[] = {
4051 TUNER_TEMIC_NTSC, TUNER_TEMIC_PAL,
4052 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4053 TUNER_TEMIC_PAL, TUNER_TEMIC_PAL,
4054 TUNER_TEMIC_4012FY5, TUNER_TEMIC_4012FY5,
4055 TUNER_TEMIC_4012FY5, TUNER_TEMIC_PAL};
4056
4057static void avermedia_eeprom(struct bttv *btv)
4058{
4059 int tuner_make, tuner_tv_fm, tuner_format, tuner_type = 0;
4060
4061 tuner_make = (eeprom_data[0x41] & 0x7);
4062 tuner_tv_fm = (eeprom_data[0x41] & 0x18) >> 3;
4063 tuner_format = (eeprom_data[0x42] & 0xf0) >> 4;
4064 btv->has_remote = (eeprom_data[0x42] & 0x01);
4065
4066 if (tuner_make == 0 || tuner_make == 2)
4067 if (tuner_format <= 0x0a)
4068 tuner_type = tuner_0_table[tuner_format];
4069 if (tuner_make == 1)
4070 if (tuner_format <= 9)
4071 tuner_type = tuner_1_table[tuner_format];
4072
4073 if (tuner_make == 4)
4074 if (tuner_format == 0x09)
4075 tuner_type = TUNER_LG_NTSC_NEW_TAPC;
4076
4077 pr_info("%d: Avermedia eeprom[0x%02x%02x]: tuner=",
4078 btv->c.nr, eeprom_data[0x41], eeprom_data[0x42]);
4079 if (tuner_type) {
4080 btv->tuner_type = tuner_type;
4081 pr_cont("%d", tuner_type);
4082 } else
4083 pr_cont("Unknown type");
4084 pr_cont(" radio:%s remote control:%s\n",
4085 tuner_tv_fm ? "yes" : "no",
4086 btv->has_remote ? "yes" : "no");
4087}
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097u32 bttv_tda9880_setnorm(struct bttv *btv, u32 gpiobits)
4098{
4099
4100 if (btv->audio_input == TVAUDIO_INPUT_TUNER) {
4101 if (bttv_tvnorms[btv->tvnorm].v4l2_id & V4L2_STD_MN)
4102 gpiobits |= 0x10000;
4103 else
4104 gpiobits &= ~0x10000;
4105 }
4106
4107 gpio_bits(bttv_tvcards[btv->c.type].gpiomask, gpiobits);
4108 return gpiobits;
4109}
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119static void boot_msp34xx(struct bttv *btv, int pin)
4120{
4121 int mask = (1 << pin);
4122
4123 gpio_inout(mask,mask);
4124 gpio_bits(mask,0);
4125 mdelay(2);
4126 udelay(500);
4127 gpio_bits(mask,mask);
4128
4129 if (bttv_gpio)
4130 bttv_gpio_tracking(btv,"msp34xx");
4131 if (bttv_verbose)
4132 pr_info("%d: Hauppauge/Voodoo msp34xx: reset line init [%d]\n",
4133 btv->c.nr, pin);
4134}
4135
4136
4137
4138
4139
4140
4141
4142static void init_PXC200(struct bttv *btv)
4143{
4144 static int vals[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0d, 0x0d, 0x01, 0x02,
4145 0x03, 0x04, 0x05, 0x06, 0x00 };
4146 unsigned int i;
4147 int tmp;
4148 u32 val;
4149
4150
4151 gpio_inout(0xffffff, (1<<13));
4152 gpio_write(0);
4153 udelay(3);
4154 gpio_write(1<<13);
4155
4156
4157 gpio_bits(0xffffff, 0);
4158 if (bttv_gpio)
4159 bttv_gpio_tracking(btv,"pxc200");
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169 btwrite(BT848_ADC_RESERVED|BT848_ADC_AGC_EN, BT848_ADC);
4170
4171
4172 pr_info("Setting DAC reference voltage level ...\n");
4173 bttv_I2CWrite(btv,0x5E,0,0x80,1);
4174
4175
4176
4177
4178
4179
4180
4181 pr_info("Initialising 12C508 PIC chip ...\n");
4182
4183
4184 val = btread(BT848_GPIO_DMA_CTL);
4185 val |= BT848_GPIO_DMA_CTL_GPCLKMODE;
4186 btwrite(val, BT848_GPIO_DMA_CTL);
4187
4188
4189
4190
4191
4192 gpio_inout(0xffffff,(1<<2));
4193 gpio_write(0);
4194 udelay(10);
4195 gpio_write(1<<2);
4196
4197 for (i = 0; i < ARRAY_SIZE(vals); i++) {
4198 tmp=bttv_I2CWrite(btv,0x1E,0,vals[i],1);
4199 if (tmp != -1) {
4200 pr_info("I2C Write(%2.2x) = %i\nI2C Read () = %2.2x\n\n",
4201 vals[i],tmp,bttv_I2CRead(btv,0x1F,NULL));
4202 }
4203 }
4204
4205 pr_info("PXC200 Initialised\n");
4206}
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238static void
4239init_RTV24 (struct bttv *btv)
4240{
4241 uint32_t dataRead = 0;
4242 long watchdog_value = 0x0E;
4243
4244 pr_info("%d: Adlink RTV-24 initialisation in progress ...\n",
4245 btv->c.nr);
4246
4247 btwrite (0x00c3feff, BT848_GPIO_OUT_EN);
4248
4249 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4250 msleep (1);
4251 btwrite (0x10 + watchdog_value, BT848_GPIO_DATA);
4252 msleep (10);
4253 btwrite (0 + watchdog_value, BT848_GPIO_DATA);
4254
4255 dataRead = btread (BT848_GPIO_DATA);
4256
4257 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 1)) {
4258 pr_info("%d: Adlink RTV-24 initialisation(1) ERROR_CPLD_Check_Failed (read %d)\n",
4259 btv->c.nr, dataRead);
4260 }
4261
4262 btwrite (0x4400 + watchdog_value, BT848_GPIO_DATA);
4263 msleep (10);
4264 btwrite (0x4410 + watchdog_value, BT848_GPIO_DATA);
4265 msleep (1);
4266 btwrite (watchdog_value, BT848_GPIO_DATA);
4267 msleep (1);
4268 dataRead = btread (BT848_GPIO_DATA);
4269
4270 if ((((dataRead >> 18) & 0x01) != 0) || (((dataRead >> 19) & 0x01) != 0)) {
4271 pr_info("%d: Adlink RTV-24 initialisation(2) ERROR_CPLD_Check_Failed (read %d)\n",
4272 btv->c.nr, dataRead);
4273
4274 return;
4275 }
4276
4277 pr_info("%d: Adlink RTV-24 initialisation complete\n", btv->c.nr);
4278}
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303static void
4304init_PCI8604PW(struct bttv *btv)
4305{
4306 int state;
4307
4308 if ((PCI_SLOT(btv->c.pci->devfn) & ~3) != 0xC) {
4309 pr_warn("This is not a PCI-8604PW\n");
4310 return;
4311 }
4312
4313 if (PCI_SLOT(btv->c.pci->devfn) != 0xD)
4314 return;
4315
4316 btwrite(0x080002, BT848_GPIO_OUT_EN);
4317
4318 state = (btread(BT848_GPIO_DATA) >> 21) & 7;
4319
4320 for (;;) {
4321 switch (state) {
4322 case 1:
4323 case 5:
4324 case 6:
4325 case 4:
4326 pr_debug("PCI-8604PW in state %i, toggling pin\n",
4327 state);
4328 btwrite(0x080000, BT848_GPIO_DATA);
4329 msleep(1);
4330 btwrite(0x000000, BT848_GPIO_DATA);
4331 msleep(1);
4332 break;
4333 case 7:
4334 pr_info("PCI-8604PW unlocked\n");
4335 return;
4336 case 0:
4337
4338
4339
4340
4341
4342 pr_err("PCI-8604PW locked until reset\n");
4343 return;
4344 default:
4345 pr_err("PCI-8604PW in unknown state %i\n", state);
4346 return;
4347 }
4348
4349 state = (state << 4) | ((btread(BT848_GPIO_DATA) >> 21) & 7);
4350
4351 switch (state) {
4352 case 0x15:
4353 case 0x56:
4354 case 0x64:
4355 case 0x47:
4356
4357
4358
4359
4360 break;
4361 default:
4362 pr_err("PCI-8604PW invalid transition %i -> %i\n",
4363 state >> 4, state & 7);
4364 return;
4365 }
4366 state &= 7;
4367 }
4368}
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394static void rv605_muxsel(struct bttv *btv, unsigned int input)
4395{
4396 static const u8 muxgpio[] = { 0x3, 0x1, 0x2, 0x4, 0xf, 0x7, 0xe, 0x0,
4397 0xd, 0xb, 0xc, 0x6, 0x9, 0x5, 0x8, 0xa };
4398
4399 gpio_bits(0x07f, muxgpio[input]);
4400
4401
4402 gpio_bits(0x200,0x200);
4403 mdelay(1);
4404 gpio_bits(0x200,0x000);
4405 mdelay(1);
4406
4407
4408 gpio_bits(0x480,0x480);
4409 mdelay(1);
4410 gpio_bits(0x480,0x080);
4411 mdelay(1);
4412}
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442static void tibetCS16_muxsel(struct bttv *btv, unsigned int input)
4443{
4444
4445 gpio_bits(0x0f0000, input << 16);
4446}
4447
4448static void tibetCS16_init(struct bttv *btv)
4449{
4450
4451 gpio_inout(0xffffff, 0x0f7fff);
4452 gpio_write(0x0f7fff);
4453}
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482static void kodicom4400r_write(struct bttv *btv,
4483 unsigned char xaddr,
4484 unsigned char yaddr,
4485 unsigned char data) {
4486 unsigned int udata;
4487
4488 udata = (data << 7) | ((yaddr&3) << 4) | (xaddr&0xf);
4489 gpio_bits(0x1ff, udata);
4490 gpio_bits(0x1ff, udata | (1 << 8));
4491 gpio_bits(0x1ff, udata);
4492}
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502static void kodicom4400r_muxsel(struct bttv *btv, unsigned int input)
4503{
4504 int xaddr, yaddr;
4505 struct bttv *mctlr;
4506 static unsigned char map[4] = {3, 0, 2, 1};
4507
4508 mctlr = master[btv->c.nr];
4509 if (mctlr == NULL) {
4510 return;
4511 }
4512 yaddr = (btv->c.nr - mctlr->c.nr + 1) & 3;
4513 yaddr = map[yaddr];
4514 xaddr = input & 0xf;
4515
4516 if (mctlr->sw_status[yaddr] != xaddr)
4517 {
4518
4519 kodicom4400r_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4520 mctlr->sw_status[yaddr] = xaddr;
4521 kodicom4400r_write(mctlr, xaddr, yaddr, 1);
4522 }
4523}
4524
4525
4526
4527
4528
4529
4530
4531static void kodicom4400r_init(struct bttv *btv)
4532{
4533 int ix;
4534
4535 gpio_inout(0x0003ff, 0x0003ff);
4536 gpio_write(1 << 9);
4537 gpio_write(0);
4538
4539 for (ix = 0; ix < 4; ix++) {
4540 btv->sw_status[ix] = ix;
4541 kodicom4400r_write(btv, ix, ix, 1);
4542 }
4543
4544
4545
4546
4547
4548 if ((btv->c.nr<1) || (btv->c.nr>BTTV_MAX-3))
4549 return;
4550 master[btv->c.nr-1] = btv;
4551 master[btv->c.nr] = btv;
4552 master[btv->c.nr+1] = btv;
4553 master[btv->c.nr+2] = btv;
4554}
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564#define ENA0 0x01
4565#define ENB0 0x02
4566#define ENA1 0x04
4567#define ENB1 0x08
4568
4569#define IN10 0x10
4570#define IN00 0x20
4571#define IN11 0x40
4572#define IN01 0x80
4573
4574static void xguard_muxsel(struct bttv *btv, unsigned int input)
4575{
4576 static const int masks[] = {
4577 ENB0, ENB0|IN00, ENB0|IN10, ENB0|IN00|IN10,
4578 ENA0, ENA0|IN00, ENA0|IN10, ENA0|IN00|IN10,
4579 ENB1, ENB1|IN01, ENB1|IN11, ENB1|IN01|IN11,
4580 ENA1, ENA1|IN01, ENA1|IN11, ENA1|IN01|IN11,
4581 };
4582 gpio_write(masks[input%16]);
4583}
4584static void picolo_tetra_init(struct bttv *btv)
4585{
4586
4587 btwrite (0x08<<16,BT848_GPIO_DATA);
4588 btwrite (0x04<<16,BT848_GPIO_DATA);
4589}
4590static void picolo_tetra_muxsel (struct bttv* btv, unsigned int input)
4591{
4592
4593 dprintk("%d : picolo_tetra_muxsel => input = %d\n", btv->c.nr, input);
4594
4595
4596 btwrite (input<<20,BT848_GPIO_DATA);
4597
4598}
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624#define I2C_TDA8540 0x90
4625#define I2C_TDA8540_ALT1 0x92
4626#define I2C_TDA8540_ALT2 0x94
4627#define I2C_TDA8540_ALT3 0x96
4628#define I2C_TDA8540_ALT4 0x98
4629#define I2C_TDA8540_ALT5 0x9a
4630#define I2C_TDA8540_ALT6 0x9c
4631
4632static void ivc120_muxsel(struct bttv *btv, unsigned int input)
4633{
4634
4635 int key = input % 4;
4636 int matrix = input / 4;
4637
4638 dprintk("%d: ivc120_muxsel: Input - %02d | TDA - %02d | In - %02d\n",
4639 btv->c.nr, input, matrix, key);
4640
4641
4642 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x00,
4643 ((matrix == 3) ? (key | key << 2) : 0x00), 1);
4644 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x00,
4645 ((matrix == 0) ? (key | key << 2) : 0x00), 1);
4646 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x00,
4647 ((matrix == 1) ? (key | key << 2) : 0x00), 1);
4648 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x00,
4649 ((matrix == 2) ? (key | key << 2) : 0x00), 1);
4650
4651
4652 bttv_I2CWrite(btv, I2C_TDA8540_ALT3, 0x02,
4653 ((matrix == 3) ? 0x03 : 0x00), 1);
4654 bttv_I2CWrite(btv, I2C_TDA8540_ALT4, 0x02,
4655 ((matrix == 0) ? 0x03 : 0x00), 1);
4656 bttv_I2CWrite(btv, I2C_TDA8540_ALT5, 0x02,
4657 ((matrix == 1) ? 0x03 : 0x00), 1);
4658 bttv_I2CWrite(btv, I2C_TDA8540_ALT6, 0x02,
4659 ((matrix == 2) ? 0x03 : 0x00), 1);
4660
4661
4662}
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676#define PX_CFG_PXC200F 0x01
4677#define PX_FLAG_PXC200A 0x00001000
4678#define PX_I2C_PIC 0x0f
4679#define PX_PXC200A_CARDID 0x200a1295
4680#define PX_I2C_CMD_CFG 0x00
4681
4682static void PXC200_muxsel(struct bttv *btv, unsigned int input)
4683{
4684 int rc;
4685 long mux;
4686 int bitmask;
4687 unsigned char buf[2];
4688
4689
4690
4691 buf[0]=0;
4692 buf[1]=0;
4693 rc=bttv_I2CWrite(btv,(PX_I2C_PIC<<1),buf[0],buf[1],1);
4694 if (rc) {
4695 pr_debug("%d: PXC200_muxsel: pic cfg write failed:%d\n",
4696 btv->c.nr, rc);
4697
4698 return;
4699 }
4700
4701 rc=bttv_I2CRead(btv,(PX_I2C_PIC<<1),NULL);
4702 if (!(rc & PX_CFG_PXC200F)) {
4703 pr_debug("%d: PXC200_muxsel: not PXC200F rc:%d\n",
4704 btv->c.nr, rc);
4705 return;
4706 }
4707
4708
4709
4710
4711
4712
4713 mux = input;
4714
4715
4716
4717 bitmask=0x302;
4718
4719 if (btv->cardid == PX_PXC200A_CARDID) {
4720 bitmask ^= 0x180;
4721 bitmask |= 7<<4;
4722 }
4723 btwrite(bitmask, BT848_GPIO_OUT_EN);
4724
4725 bitmask = btread(BT848_GPIO_DATA);
4726 if (btv->cardid == PX_PXC200A_CARDID)
4727 bitmask = (bitmask & ~0x280) | ((mux & 2) << 8) | ((mux & 1) << 7);
4728 else
4729 bitmask = (bitmask & ~0x300) | ((mux & 3) << 8);
4730 btwrite(bitmask,BT848_GPIO_DATA);
4731
4732
4733
4734
4735
4736
4737
4738
4739 if (btv->cardid == PX_PXC200A_CARDID)
4740 btaor(2<<5, ~BT848_IFORM_MUXSEL, BT848_IFORM);
4741 else
4742 btand(~BT848_IFORM_MUXSEL,BT848_IFORM);
4743
4744 pr_debug("%d: setting input channel to:%d\n", btv->c.nr, (int)mux);
4745}
4746
4747static void phytec_muxsel(struct bttv *btv, unsigned int input)
4748{
4749 unsigned int mux = input % 4;
4750
4751 if (input == btv->svhs)
4752 mux = 0;
4753
4754 gpio_bits(0x3, mux);
4755}
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772static void gv800s_write(struct bttv *btv,
4773 unsigned char xaddr,
4774 unsigned char yaddr,
4775 unsigned char data) {
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785 const u32 ADDRESS = ((xaddr&0xf) | (yaddr&3)<<4);
4786 const u32 CSELECT = 1<<16;
4787 const u32 STROBE = 1<<17;
4788 const u32 DATA = data<<18;
4789
4790 gpio_bits(0x1007f, ADDRESS | CSELECT);
4791 gpio_bits(0x20000, STROBE);
4792 gpio_bits(0x40000, DATA);
4793 gpio_bits(0x20000, ~STROBE);
4794}
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814static void gv800s_muxsel(struct bttv *btv, unsigned int input)
4815{
4816 struct bttv *mctlr;
4817 int xaddr, yaddr;
4818 static unsigned int map[4][4] = { { 0x0, 0x4, 0xa, 0x6 },
4819 { 0x1, 0x5, 0xb, 0x7 },
4820 { 0x2, 0x8, 0xc, 0xe },
4821 { 0x3, 0x9, 0xd, 0xf } };
4822 input = input%4;
4823 mctlr = master[btv->c.nr];
4824 if (mctlr == NULL) {
4825
4826 return;
4827 }
4828 yaddr = (btv->c.nr - mctlr->c.nr) & 3;
4829 xaddr = map[yaddr][input] & 0xf;
4830
4831
4832 if (mctlr->sw_status[yaddr] != xaddr) {
4833
4834 gv800s_write(mctlr, mctlr->sw_status[yaddr], yaddr, 0);
4835 mctlr->sw_status[yaddr] = xaddr;
4836 gv800s_write(mctlr, xaddr, yaddr, 1);
4837 }
4838}
4839
4840
4841static void gv800s_init(struct bttv *btv)
4842{
4843 int ix;
4844
4845 gpio_inout(0xf107f, 0xf107f);
4846 gpio_write(1<<19);
4847 gpio_write(0);
4848
4849
4850 for (ix = 0; ix < 4; ix++) {
4851 btv->sw_status[ix] = ix;
4852 gv800s_write(btv, ix, ix, 1);
4853 }
4854
4855
4856 bttv_I2CWrite(btv, 0x18, 0x5, 0x90, 1);
4857
4858 if (btv->c.nr > BTTV_MAX-4)
4859 return;
4860
4861
4862
4863
4864 master[btv->c.nr] = btv;
4865 master[btv->c.nr+1] = btv;
4866 master[btv->c.nr+2] = btv;
4867 master[btv->c.nr+3] = btv;
4868}
4869
4870
4871
4872
4873void __init bttv_check_chipset(void)
4874{
4875 int pcipci_fail = 0;
4876 struct pci_dev *dev = NULL;
4877
4878 if (pci_pci_problems & (PCIPCI_FAIL|PCIAGP_FAIL))
4879 pcipci_fail = 1;
4880 if (pci_pci_problems & (PCIPCI_TRITON|PCIPCI_NATOMA|PCIPCI_VIAETBF))
4881 triton1 = 1;
4882 if (pci_pci_problems & PCIPCI_VSFX)
4883 vsfx = 1;
4884#ifdef PCIPCI_ALIMAGIK
4885 if (pci_pci_problems & PCIPCI_ALIMAGIK)
4886 latency = 0x0A;
4887#endif
4888
4889
4890
4891 if (triton1)
4892 pr_info("Host bridge needs ETBF enabled\n");
4893 if (vsfx)
4894 pr_info("Host bridge needs VSFX enabled\n");
4895 if (pcipci_fail) {
4896 pr_info("bttv and your chipset may not work together\n");
4897 if (!no_overlay) {
4898 pr_info("overlay will be disabled\n");
4899 no_overlay = 1;
4900 } else {
4901 pr_info("overlay forced. Use this option at your own risk.\n");
4902 }
4903 }
4904 if (UNSET != latency)
4905 pr_info("pci latency fixup [%d]\n", latency);
4906 while ((dev = pci_get_device(PCI_VENDOR_ID_INTEL,
4907 PCI_DEVICE_ID_INTEL_82441, dev))) {
4908 unsigned char b;
4909 pci_read_config_byte(dev, 0x53, &b);
4910 if (bttv_debug)
4911 pr_info("Host bridge: 82441FX Natoma, bufcon=0x%02x\n",
4912 b);
4913 }
4914}
4915
4916int bttv_handle_chipset(struct bttv *btv)
4917{
4918 unsigned char command;
4919
4920 if (!triton1 && !vsfx && UNSET == latency)
4921 return 0;
4922
4923 if (bttv_verbose) {
4924 if (triton1)
4925 pr_info("%d: enabling ETBF (430FX/VP3 compatibility)\n",
4926 btv->c.nr);
4927 if (vsfx && btv->id >= 878)
4928 pr_info("%d: enabling VSFX\n", btv->c.nr);
4929 if (UNSET != latency)
4930 pr_info("%d: setting pci timer to %d\n",
4931 btv->c.nr, latency);
4932 }
4933
4934 if (btv->id < 878) {
4935
4936 if (triton1)
4937 btv->triton1 = BT848_INT_ETBF;
4938 } else {
4939
4940 pci_read_config_byte(btv->c.pci, BT878_DEVCTRL, &command);
4941 if (triton1)
4942 command |= BT878_EN_TBFX;
4943 if (vsfx)
4944 command |= BT878_EN_VSFX;
4945 pci_write_config_byte(btv->c.pci, BT878_DEVCTRL, command);
4946 }
4947 if (UNSET != latency)
4948 pci_write_config_byte(btv->c.pci, PCI_LATENCY_TIMER, latency);
4949 return 0;
4950}
4951