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