1/*
2 *
3 * device driver for Conexant 2388x based TV cards
4 * card-specific stuff.
5 *
6 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
7 *
8 *  This program is free software; you can redistribute it and/or modify
9 *  it under the terms of the GNU General Public License as published by
10 *  the Free Software Foundation; either version 2 of the License, or
11 *  (at your option) any later version.
12 *
13 *  This program is distributed in the hope that it will be useful,
14 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *  GNU General Public License for more details.
17 *
18 *  You should have received a copy of the GNU General Public License
19 *  along with this program; if not, write to the Free Software
20 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23#include <linux/init.h>
24#include <linux/module.h>
25#include <linux/pci.h>
26#include <linux/delay.h>
27
28#include "cx88.h"
29
30/* ------------------------------------------------------------------ */
31/* board config info                                                  */
32
33struct cx88_board cx88_boards[] = {
34	[CX88_BOARD_UNKNOWN] = {
35		.name		= "UNKNOWN/GENERIC",
36		.tuner_type     = UNSET,
37		.radio_type     = UNSET,
38		.tuner_addr	= ADDR_UNSET,
39		.radio_addr	= ADDR_UNSET,
40		.input          = {{
41			.type   = CX88_VMUX_COMPOSITE1,
42			.vmux   = 0,
43		},{
44			.type   = CX88_VMUX_COMPOSITE2,
45			.vmux   = 1,
46		},{
47			.type   = CX88_VMUX_COMPOSITE3,
48			.vmux   = 2,
49		},{
50			.type   = CX88_VMUX_COMPOSITE4,
51			.vmux   = 3,
52		}},
53	},
54	[CX88_BOARD_HAUPPAUGE] = {
55		.name		= "Hauppauge WinTV 34xxx models",
56		.tuner_type     = UNSET,
57		.radio_type     = UNSET,
58		.tuner_addr	= ADDR_UNSET,
59		.radio_addr	= ADDR_UNSET,
60		.tda9887_conf   = TDA9887_PRESENT,
61		.input          = {{
62			.type   = CX88_VMUX_TELEVISION,
63			.vmux   = 0,
64			.gpio0  = 0xff00,  // internal decoder
65		},{
66			.type   = CX88_VMUX_DEBUG,
67			.vmux   = 0,
68			.gpio0  = 0xff01,  // mono from tuner chip
69		},{
70			.type   = CX88_VMUX_COMPOSITE1,
71			.vmux   = 1,
72			.gpio0  = 0xff02,
73		},{
74			.type   = CX88_VMUX_SVIDEO,
75			.vmux   = 2,
76			.gpio0  = 0xff02,
77		}},
78		.radio = {
79			.type   = CX88_RADIO,
80			.gpio0  = 0xff01,
81		},
82	},
83	[CX88_BOARD_GDI] = {
84		.name		= "GDI Black Gold",
85		.tuner_type     = UNSET,
86		.radio_type     = UNSET,
87		.tuner_addr	= ADDR_UNSET,
88		.radio_addr	= ADDR_UNSET,
89		.input          = {{
90			.type   = CX88_VMUX_TELEVISION,
91			.vmux   = 0,
92		},{
93			.type   = CX88_VMUX_SVIDEO,
94			.vmux   = 2,
95		}},
96	},
97	[CX88_BOARD_PIXELVIEW] = {
98		.name           = "PixelView",
99		.tuner_type     = TUNER_PHILIPS_PAL,
100		.radio_type     = UNSET,
101		.tuner_addr	= ADDR_UNSET,
102		.radio_addr	= ADDR_UNSET,
103		.input          = {{
104			.type   = CX88_VMUX_TELEVISION,
105			.vmux   = 0,
106			.gpio0  = 0xff00,  // internal decoder
107		},{
108			.type   = CX88_VMUX_COMPOSITE1,
109			.vmux   = 1,
110		},{
111			.type   = CX88_VMUX_SVIDEO,
112			.vmux   = 2,
113		}},
114		.radio = {
115			 .type  = CX88_RADIO,
116			 .gpio0 = 0xff10,
117		},
118	},
119	[CX88_BOARD_ATI_WONDER_PRO] = {
120		.name           = "ATI TV Wonder Pro",
121		.tuner_type     = TUNER_PHILIPS_4IN1,
122		.radio_type     = UNSET,
123		.tuner_addr	= ADDR_UNSET,
124		.radio_addr	= ADDR_UNSET,
125		.tda9887_conf   = TDA9887_PRESENT | TDA9887_INTERCARRIER,
126		.input          = {{
127			.type   = CX88_VMUX_TELEVISION,
128			.vmux   = 0,
129			.gpio0  = 0x03ff,
130		},{
131			.type   = CX88_VMUX_COMPOSITE1,
132			.vmux   = 1,
133			.gpio0  = 0x03fe,
134		},{
135			.type   = CX88_VMUX_SVIDEO,
136			.vmux   = 2,
137			.gpio0  = 0x03fe,
138		}},
139	},
140	[CX88_BOARD_WINFAST2000XP_EXPERT] = {
141		.name           = "Leadtek Winfast 2000XP Expert",
142		.tuner_type     = TUNER_PHILIPS_4IN1,
143		.radio_type     = UNSET,
144		.tuner_addr	= ADDR_UNSET,
145		.radio_addr	= ADDR_UNSET,
146		.tda9887_conf   = TDA9887_PRESENT,
147		.input          = {{
148			.type   = CX88_VMUX_TELEVISION,
149			.vmux   = 0,
150			.gpio0	= 0x00F5e700,
151			.gpio1  = 0x00003004,
152			.gpio2  = 0x00F5e700,
153			.gpio3  = 0x02000000,
154		},{
155			.type   = CX88_VMUX_COMPOSITE1,
156			.vmux   = 1,
157			.gpio0	= 0x00F5c700,
158			.gpio1  = 0x00003004,
159			.gpio2  = 0x00F5c700,
160			.gpio3  = 0x02000000,
161		},{
162			.type   = CX88_VMUX_SVIDEO,
163			.vmux   = 2,
164			.gpio0	= 0x00F5c700,
165			.gpio1  = 0x00003004,
166			.gpio2  = 0x00F5c700,
167			.gpio3  = 0x02000000,
168		}},
169		.radio = {
170			.type   = CX88_RADIO,
171			.gpio0	= 0x00F5d700,
172			.gpio1  = 0x00003004,
173			.gpio2  = 0x00F5d700,
174			.gpio3  = 0x02000000,
175		},
176	},
177	[CX88_BOARD_AVERTV_STUDIO_303] = {
178		.name           = "AverTV Studio 303 (M126)",
179		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
180		.radio_type     = UNSET,
181		.tuner_addr	= ADDR_UNSET,
182		.radio_addr	= ADDR_UNSET,
183		.tda9887_conf   = TDA9887_PRESENT,
184		.input          = {{
185			.type   = CX88_VMUX_TELEVISION,
186			.vmux   = 0,
187			.gpio1  = 0xe09f,
188		},{
189			.type   = CX88_VMUX_COMPOSITE1,
190			.vmux   = 1,
191			.gpio1  = 0xe05f,
192		},{
193			.type   = CX88_VMUX_SVIDEO,
194			.vmux   = 2,
195			.gpio1  = 0xe05f,
196		}},
197		.radio = {
198			.gpio1  = 0xe0df,
199			.type   = CX88_RADIO,
200		},
201	},
202	[CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
203		// added gpio values thanks to Michal
204		// values for PAL from DScaler
205		.name           = "MSI TV-@nywhere Master",
206		.tuner_type     = TUNER_MT2032,
207		.radio_type     = UNSET,
208		.tuner_addr	= ADDR_UNSET,
209		.radio_addr	= ADDR_UNSET,
210		.tda9887_conf	= TDA9887_PRESENT | TDA9887_INTERCARRIER_NTSC,
211		.input          = {{
212			.type   = CX88_VMUX_TELEVISION,
213			.vmux   = 0,
214			.gpio0  = 0x000040bf,
215			.gpio1  = 0x000080c0,
216			.gpio2  = 0x0000ff40,
217		},{
218			.type   = CX88_VMUX_COMPOSITE1,
219			.vmux   = 1,
220			.gpio0  = 0x000040bf,
221			.gpio1  = 0x000080c0,
222			.gpio2  = 0x0000ff40,
223		},{
224			.type   = CX88_VMUX_SVIDEO,
225			.vmux   = 2,
226			.gpio0  = 0x000040bf,
227			.gpio1  = 0x000080c0,
228			.gpio2  = 0x0000ff40,
229		}},
230		.radio = {
231			 .type   = CX88_RADIO,
232		},
233	},
234	[CX88_BOARD_WINFAST_DV2000] = {
235		.name           = "Leadtek Winfast DV2000",
236		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
237		.radio_type     = UNSET,
238		.tuner_addr	= ADDR_UNSET,
239		.radio_addr	= ADDR_UNSET,
240		.tda9887_conf   = TDA9887_PRESENT,
241		.input          = {{
242			.type   = CX88_VMUX_TELEVISION,
243			.vmux   = 0,
244			.gpio0  = 0x0035e700,
245			.gpio1  = 0x00003004,
246			.gpio2  = 0x0035e700,
247			.gpio3  = 0x02000000,
248		},{
249
250			.type   = CX88_VMUX_COMPOSITE1,
251			.vmux   = 1,
252			.gpio0  = 0x0035c700,
253			.gpio1  = 0x00003004,
254			.gpio2  = 0x0035c700,
255			.gpio3  = 0x02000000,
256		},{
257			.type   = CX88_VMUX_SVIDEO,
258			.vmux   = 2,
259			.gpio0  = 0x0035c700,
260			.gpio1  = 0x0035c700,
261			.gpio2  = 0x02000000,
262			.gpio3  = 0x02000000,
263		}},
264		.radio = {
265			.type   = CX88_RADIO,
266			.gpio0  = 0x0035d700,
267			.gpio1  = 0x00007004,
268			.gpio2  = 0x0035d700,
269			.gpio3  = 0x02000000,
270		},
271	},
272	[CX88_BOARD_LEADTEK_PVR2000] = {
273		// gpio values for PAL version from regspy by DScaler
274		.name           = "Leadtek PVR 2000",
275		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
276		.radio_type     = UNSET,
277		.tuner_addr	= ADDR_UNSET,
278		.radio_addr	= ADDR_UNSET,
279		.tda9887_conf   = TDA9887_PRESENT,
280		.input          = {{
281			.type   = CX88_VMUX_TELEVISION,
282			.vmux   = 0,
283			.gpio0  = 0x0000bde2,
284			.extadc = 1,
285		},{
286			.type   = CX88_VMUX_COMPOSITE1,
287			.vmux   = 1,
288			.gpio0  = 0x0000bde6,
289			.extadc = 1,
290		},{
291			.type   = CX88_VMUX_SVIDEO,
292			.vmux   = 2,
293			.gpio0  = 0x0000bde6,
294			.extadc = 1,
295		}},
296		.radio = {
297			.type   = CX88_RADIO,
298			.gpio0  = 0x0000bd62,
299			.extadc = 1,
300		},
301		.mpeg           = CX88_MPEG_BLACKBIRD,
302	},
303	[CX88_BOARD_IODATA_GVVCP3PCI] = {
304		.name		= "IODATA GV-VCP3/PCI",
305		.tuner_type     = TUNER_ABSENT,
306		.radio_type     = UNSET,
307		.tuner_addr	= ADDR_UNSET,
308		.radio_addr	= ADDR_UNSET,
309		.input          = {{
310			.type   = CX88_VMUX_COMPOSITE1,
311			.vmux   = 0,
312		},{
313			.type   = CX88_VMUX_COMPOSITE2,
314			.vmux   = 1,
315		},{
316			.type   = CX88_VMUX_SVIDEO,
317			.vmux   = 2,
318		}},
319	},
320	[CX88_BOARD_PROLINK_PLAYTVPVR] = {
321		.name           = "Prolink PlayTV PVR",
322		.tuner_type     = TUNER_PHILIPS_FM1236_MK3,
323		.radio_type     = UNSET,
324		.tuner_addr	= ADDR_UNSET,
325		.radio_addr	= ADDR_UNSET,
326		.tda9887_conf	= TDA9887_PRESENT,
327		.input          = {{
328			.type   = CX88_VMUX_TELEVISION,
329			.vmux   = 0,
330			.gpio0  = 0xbff0,
331		},{
332			.type   = CX88_VMUX_COMPOSITE1,
333			.vmux   = 1,
334			.gpio0  = 0xbff3,
335		},{
336			.type   = CX88_VMUX_SVIDEO,
337			.vmux   = 2,
338			.gpio0  = 0xbff3,
339		}},
340		.radio = {
341			.type   = CX88_RADIO,
342			.gpio0  = 0xbff0,
343		},
344	},
345	[CX88_BOARD_ASUS_PVR_416] = {
346		.name		= "ASUS PVR-416",
347		.tuner_type     = TUNER_PHILIPS_FM1236_MK3,
348		.radio_type     = UNSET,
349		.tuner_addr	= ADDR_UNSET,
350		.radio_addr	= ADDR_UNSET,
351		.tda9887_conf   = TDA9887_PRESENT,
352		.input          = {{
353			.type   = CX88_VMUX_TELEVISION,
354			.vmux   = 0,
355			.gpio0  = 0x0000fde6,
356		},{
357			.type   = CX88_VMUX_SVIDEO,
358			.vmux   = 2,
359			.gpio0  = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
360			.extadc = 1,
361		}},
362		.radio = {
363			.type   = CX88_RADIO,
364			.gpio0  = 0x0000fde2,
365		},
366		.mpeg           = CX88_MPEG_BLACKBIRD,
367	},
368	[CX88_BOARD_MSI_TVANYWHERE] = {
369		.name           = "MSI TV-@nywhere",
370		.tuner_type     = TUNER_MT2032,
371		.radio_type     = UNSET,
372		.tuner_addr	= ADDR_UNSET,
373		.radio_addr	= ADDR_UNSET,
374		.tda9887_conf   = TDA9887_PRESENT,
375		.input          = {{
376			.type   = CX88_VMUX_TELEVISION,
377			.vmux   = 0,
378			.gpio0  = 0x00000fbf,
379			.gpio2  = 0x0000fc08,
380		},{
381			.type   = CX88_VMUX_COMPOSITE1,
382			.vmux   = 1,
383			.gpio0  = 0x00000fbf,
384			.gpio2  = 0x0000fc68,
385		},{
386			.type   = CX88_VMUX_SVIDEO,
387			.vmux   = 2,
388			.gpio0  = 0x00000fbf,
389			.gpio2  = 0x0000fc68,
390		}},
391	},
392	[CX88_BOARD_KWORLD_DVB_T] = {
393		.name           = "KWorld/VStream XPert DVB-T",
394		.tuner_type     = TUNER_ABSENT,
395		.radio_type     = UNSET,
396		.tuner_addr	= ADDR_UNSET,
397		.radio_addr	= ADDR_UNSET,
398		.input          = {{
399			.type   = CX88_VMUX_COMPOSITE1,
400			.vmux   = 1,
401			.gpio0  = 0x0700,
402			.gpio2  = 0x0101,
403		},{
404			.type   = CX88_VMUX_SVIDEO,
405			.vmux   = 2,
406			.gpio0  = 0x0700,
407			.gpio2  = 0x0101,
408		}},
409		.mpeg           = CX88_MPEG_DVB,
410	},
411	[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
412		.name           = "DViCO FusionHDTV DVB-T1",
413		.tuner_type     = TUNER_ABSENT, /* No analog tuner */
414		.radio_type     = UNSET,
415		.tuner_addr	= ADDR_UNSET,
416		.radio_addr	= ADDR_UNSET,
417		.input          = {{
418			.type   = CX88_VMUX_COMPOSITE1,
419			.vmux   = 1,
420			.gpio0  = 0x000027df,
421		},{
422			.type   = CX88_VMUX_SVIDEO,
423			.vmux   = 2,
424			.gpio0  = 0x000027df,
425		}},
426		.mpeg           = CX88_MPEG_DVB,
427	},
428	[CX88_BOARD_KWORLD_LTV883] = {
429		.name           = "KWorld LTV883RF",
430		.tuner_type     = TUNER_TNF_8831BGFF,
431		.radio_type     = UNSET,
432		.tuner_addr	= ADDR_UNSET,
433		.radio_addr	= ADDR_UNSET,
434		.input          = {{
435			.type   = CX88_VMUX_TELEVISION,
436			.vmux   = 0,
437			.gpio0  = 0x07f8,
438		},{
439			.type   = CX88_VMUX_DEBUG,
440			.vmux   = 0,
441			.gpio0  = 0x07f9,  // mono from tuner chip
442		},{
443			.type   = CX88_VMUX_COMPOSITE1,
444			.vmux   = 1,
445			.gpio0  = 0x000007fa,
446		},{
447			.type   = CX88_VMUX_SVIDEO,
448			.vmux   = 2,
449			.gpio0  = 0x000007fa,
450		}},
451		.radio = {
452			.type   = CX88_RADIO,
453			.gpio0  = 0x000007f8,
454		},
455	},
456	[CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
457		.name		= "DViCO FusionHDTV 3 Gold-Q",
458		.tuner_type     = TUNER_MICROTUNE_4042FI5,
459		.radio_type     = UNSET,
460		.tuner_addr	= ADDR_UNSET,
461		.radio_addr	= ADDR_UNSET,
462		/*
463		   GPIO[0] resets DT3302 DTV receiver
464		    0 - reset asserted
465		    1 - normal operation
466		   GPIO[1] mutes analog audio output connector
467		    0 - enable selected source
468		    1 - mute
469		   GPIO[2] selects source for analog audio output connector
470		    0 - analog audio input connector on tab
471		    1 - analog DAC output from CX23881 chip
472		   GPIO[3] selects RF input connector on tuner module
473		    0 - RF connector labeled CABLE
474		    1 - RF connector labeled ANT
475		   GPIO[4] selects high RF for QAM256 mode
476		    0 - normal RF
477		    1 - high RF
478		*/
479		.input          = {{
480			.type   = CX88_VMUX_TELEVISION,
481			.vmux   = 0,
482			.gpio0	= 0x0f0d,
483		},{
484			.type   = CX88_VMUX_CABLE,
485			.vmux   = 0,
486			.gpio0	= 0x0f05,
487		},{
488			.type   = CX88_VMUX_COMPOSITE1,
489			.vmux   = 1,
490			.gpio0	= 0x0f00,
491		},{
492			.type   = CX88_VMUX_SVIDEO,
493			.vmux   = 2,
494			.gpio0	= 0x0f00,
495		}},
496		.mpeg           = CX88_MPEG_DVB,
497	},
498	[CX88_BOARD_HAUPPAUGE_DVB_T1] = {
499		.name           = "Hauppauge Nova-T DVB-T",
500		.tuner_type     = TUNER_ABSENT,
501		.radio_type     = UNSET,
502		.tuner_addr	= ADDR_UNSET,
503		.radio_addr	= ADDR_UNSET,
504		.input          = {{
505			.type   = CX88_VMUX_DVB,
506			.vmux   = 0,
507		}},
508		.mpeg           = CX88_MPEG_DVB,
509	},
510	[CX88_BOARD_CONEXANT_DVB_T1] = {
511		.name           = "Conexant DVB-T reference design",
512		.tuner_type     = TUNER_ABSENT,
513		.radio_type     = UNSET,
514		.tuner_addr	= ADDR_UNSET,
515		.radio_addr	= ADDR_UNSET,
516		.input          = {{
517			.type   = CX88_VMUX_DVB,
518			.vmux   = 0,
519		}},
520		.mpeg           = CX88_MPEG_DVB,
521	},
522	[CX88_BOARD_PROVIDEO_PV259] = {
523		.name		= "Provideo PV259",
524		.tuner_type     = TUNER_PHILIPS_FQ1216ME,
525		.radio_type     = UNSET,
526		.tuner_addr	= ADDR_UNSET,
527		.radio_addr	= ADDR_UNSET,
528		.input          = {{
529			.type   = CX88_VMUX_TELEVISION,
530			.vmux   = 0,
531			.extadc = 1,
532		}},
533		.mpeg           = CX88_MPEG_BLACKBIRD,
534	},
535	[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
536		.name           = "DViCO FusionHDTV DVB-T Plus",
537		.tuner_type     = TUNER_ABSENT, /* No analog tuner */
538		.radio_type     = UNSET,
539		.tuner_addr	= ADDR_UNSET,
540		.radio_addr	= ADDR_UNSET,
541		.input          = {{
542			.type   = CX88_VMUX_COMPOSITE1,
543			.vmux   = 1,
544			.gpio0  = 0x000027df,
545		},{
546			.type   = CX88_VMUX_SVIDEO,
547			.vmux   = 2,
548			.gpio0  = 0x000027df,
549		}},
550		.mpeg           = CX88_MPEG_DVB,
551	},
552	[CX88_BOARD_DNTV_LIVE_DVB_T] = {
553		.name		= "digitalnow DNTV Live! DVB-T",
554		.tuner_type     = TUNER_ABSENT,
555		.radio_type     = UNSET,
556		.tuner_addr	= ADDR_UNSET,
557		.radio_addr	= ADDR_UNSET,
558		.input		= {{
559			.type   = CX88_VMUX_COMPOSITE1,
560			.vmux   = 1,
561			.gpio0  = 0x00000700,
562			.gpio2  = 0x00000101,
563		},{
564			.type   = CX88_VMUX_SVIDEO,
565			.vmux   = 2,
566			.gpio0  = 0x00000700,
567			.gpio2  = 0x00000101,
568		}},
569		.mpeg           = CX88_MPEG_DVB,
570	},
571	[CX88_BOARD_PCHDTV_HD3000] = {
572		.name           = "pcHDTV HD3000 HDTV",
573		.tuner_type     = TUNER_THOMSON_DTT761X,
574		.radio_type     = UNSET,
575		.tuner_addr	= ADDR_UNSET,
576		.radio_addr	= ADDR_UNSET,
577		.tda9887_conf   = TDA9887_PRESENT,
578		.input          = {{
579			.type   = CX88_VMUX_TELEVISION,
580			.vmux   = 0,
581			.gpio0  = 0x00008484,
582			.gpio1  = 0x00000000,
583			.gpio2  = 0x00000000,
584			.gpio3  = 0x00000000,
585		},{
586			.type   = CX88_VMUX_COMPOSITE1,
587			.vmux   = 1,
588			.gpio0  = 0x00008400,
589			.gpio1  = 0x00000000,
590			.gpio2  = 0x00000000,
591			.gpio3  = 0x00000000,
592		},{
593			.type   = CX88_VMUX_SVIDEO,
594			.vmux   = 2,
595			.gpio0  = 0x00008400,
596			.gpio1  = 0x00000000,
597			.gpio2  = 0x00000000,
598			.gpio3  = 0x00000000,
599		}},
600		.radio = {
601			.type   = CX88_RADIO,
602			.vmux   = 2,
603			.gpio0  = 0x00008400,
604			.gpio1  = 0x00000000,
605			.gpio2  = 0x00000000,
606			.gpio3  = 0x00000000,
607		},
608		.mpeg           = CX88_MPEG_DVB,
609	},
610	[CX88_BOARD_HAUPPAUGE_ROSLYN] = {
611		// entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
612		// GPIO values obtained from regspy, courtesy Sean Covel
613		.name           = "Hauppauge WinTV 28xxx (Roslyn) models",
614		.tuner_type     = UNSET,
615		.radio_type     = UNSET,
616		.tuner_addr	= ADDR_UNSET,
617		.radio_addr	= ADDR_UNSET,
618		.input          = {{
619			.type   = CX88_VMUX_TELEVISION,
620			.vmux   = 0,
621			.gpio0  = 0xed1a,
622			.gpio2  = 0x00ff,
623		},{
624			.type   = CX88_VMUX_DEBUG,
625			.vmux   = 0,
626			.gpio0  = 0xff01,
627		},{
628			.type   = CX88_VMUX_COMPOSITE1,
629			.vmux   = 1,
630			.gpio0  = 0xff02,
631		},{
632			.type   = CX88_VMUX_SVIDEO,
633			.vmux   = 2,
634			.gpio0  = 0xed92,
635			.gpio2  = 0x00ff,
636		}},
637		.radio = {
638			 .type   = CX88_RADIO,
639			 .gpio0  = 0xed96,
640			 .gpio2  = 0x00ff,
641		 },
642		.mpeg           = CX88_MPEG_BLACKBIRD,
643	},
644	[CX88_BOARD_DIGITALLOGIC_MEC] = {
645		.name           = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
646		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
647		.radio_type     = UNSET,
648		.tuner_addr	= ADDR_UNSET,
649		.radio_addr	= ADDR_UNSET,
650		.tda9887_conf   = TDA9887_PRESENT,
651		.input          = {{
652			.type   = CX88_VMUX_TELEVISION,
653			.vmux   = 0,
654			.gpio0  = 0x00009d80,
655			.extadc = 1,
656		},{
657			.type   = CX88_VMUX_COMPOSITE1,
658			.vmux   = 1,
659			.gpio0  = 0x00009d76,
660			.extadc = 1,
661		},{
662			.type   = CX88_VMUX_SVIDEO,
663			.vmux   = 2,
664			.gpio0  = 0x00009d76,
665			.extadc = 1,
666		}},
667		.radio = {
668			.type   = CX88_RADIO,
669			.gpio0  = 0x00009d00,
670			.extadc = 1,
671		},
672		.mpeg           = CX88_MPEG_BLACKBIRD,
673	},
674	[CX88_BOARD_IODATA_GVBCTV7E] = {
675		.name           = "IODATA GV/BCTV7E",
676		.tuner_type     = TUNER_PHILIPS_FQ1286,
677		.radio_type     = UNSET,
678		.tuner_addr	= ADDR_UNSET,
679		.radio_addr	= ADDR_UNSET,
680		.tda9887_conf   = TDA9887_PRESENT,
681		.input          = {{
682			.type   = CX88_VMUX_TELEVISION,
683			.vmux   = 1,
684			.gpio1  = 0x0000e03f,
685		},{
686			.type   = CX88_VMUX_COMPOSITE1,
687			.vmux   = 2,
688			.gpio1  = 0x0000e07f,
689		},{
690			.type   = CX88_VMUX_SVIDEO,
691			.vmux   = 3,
692			.gpio1  = 0x0000e07f,
693		}}
694	},
695	[CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
696		.name           = "PixelView PlayTV Ultra Pro (Stereo)",
697		/* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
698		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
699		.radio_type     = UNSET,
700		.tuner_addr	= ADDR_UNSET,
701		.radio_addr	= ADDR_UNSET,
702		.input          = {{
703			.type   = CX88_VMUX_TELEVISION,
704			.vmux   = 0,
705			.gpio0  = 0xbf61,  /* internal decoder */
706		},{
707			.type   = CX88_VMUX_COMPOSITE1,
708			.vmux   = 1,
709			.gpio0	= 0xbf63,
710		},{
711			.type   = CX88_VMUX_SVIDEO,
712			.vmux   = 2,
713			.gpio0	= 0xbf63,
714		}},
715		.radio = {
716			 .type  = CX88_RADIO,
717			 .gpio0 = 0xbf60,
718		 },
719	},
720	[CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
721		.name           = "DViCO FusionHDTV 3 Gold-T",
722		.tuner_type     = TUNER_THOMSON_DTT761X,
723		.radio_type     = UNSET,
724		.tuner_addr	= ADDR_UNSET,
725		.radio_addr	= ADDR_UNSET,
726		.tda9887_conf   = TDA9887_PRESENT,
727		.input          = {{
728			.type   = CX88_VMUX_TELEVISION,
729			.vmux   = 0,
730			.gpio0  = 0x97ed,
731		},{
732			.type   = CX88_VMUX_COMPOSITE1,
733			.vmux   = 1,
734			.gpio0  = 0x97e9,
735		},{
736			.type   = CX88_VMUX_SVIDEO,
737			.vmux   = 2,
738			.gpio0  = 0x97e9,
739		}},
740		.mpeg           = CX88_MPEG_DVB,
741	},
742	[CX88_BOARD_ADSTECH_DVB_T_PCI] = {
743		.name           = "ADS Tech Instant TV DVB-T PCI",
744		.tuner_type     = TUNER_ABSENT,
745		.radio_type     = UNSET,
746		.tuner_addr	= ADDR_UNSET,
747		.radio_addr	= ADDR_UNSET,
748		.input          = {{
749			.type   = CX88_VMUX_COMPOSITE1,
750			.vmux   = 1,
751			.gpio0  = 0x0700,
752			.gpio2  = 0x0101,
753		},{
754			.type   = CX88_VMUX_SVIDEO,
755			.vmux   = 2,
756			.gpio0  = 0x0700,
757			.gpio2  = 0x0101,
758		}},
759		.mpeg           = CX88_MPEG_DVB,
760	},
761	[CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
762		.name           = "TerraTec Cinergy 1400 DVB-T",
763		.tuner_type     = TUNER_ABSENT,
764		.input          = {{
765			.type   = CX88_VMUX_DVB,
766			.vmux   = 0,
767		},{
768			.type   = CX88_VMUX_COMPOSITE1,
769			.vmux   = 2,
770		},{
771			.type   = CX88_VMUX_SVIDEO,
772			.vmux   = 2,
773		}},
774		.mpeg           = CX88_MPEG_DVB,
775	},
776	[CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
777		.name           = "DViCO FusionHDTV 5 Gold",
778		.tuner_type     = TUNER_LG_TDVS_H06XF, /* TDVS-H062F */
779		.radio_type     = UNSET,
780		.tuner_addr	= ADDR_UNSET,
781		.radio_addr	= ADDR_UNSET,
782		.tda9887_conf   = TDA9887_PRESENT,
783		.input          = {{
784			.type   = CX88_VMUX_TELEVISION,
785			.vmux   = 0,
786			.gpio0  = 0x87fd,
787		},{
788			.type   = CX88_VMUX_COMPOSITE1,
789			.vmux   = 1,
790			.gpio0  = 0x87f9,
791		},{
792			.type   = CX88_VMUX_SVIDEO,
793			.vmux   = 2,
794			.gpio0  = 0x87f9,
795		}},
796		.mpeg           = CX88_MPEG_DVB,
797	},
798	[CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
799		.name           = "AverMedia UltraTV Media Center PCI 550",
800		.tuner_type     = TUNER_PHILIPS_FM1236_MK3,
801		.radio_type     = UNSET,
802		.tuner_addr     = ADDR_UNSET,
803		.radio_addr     = ADDR_UNSET,
804		.tda9887_conf   = TDA9887_PRESENT,
805		.input          = {{
806			.type   = CX88_VMUX_COMPOSITE1,
807			.vmux   = 0,
808			.gpio0  = 0x0000cd73,
809			.extadc = 1,
810		},{
811			.type   = CX88_VMUX_SVIDEO,
812			.vmux   = 1,
813			.gpio0  = 0x0000cd73,
814			.extadc = 1,
815		},{
816			.type   = CX88_VMUX_TELEVISION,
817			.vmux   = 3,
818			.gpio0  = 0x0000cdb3,
819			.extadc = 1,
820		}},
821		.radio = {
822			.type   = CX88_RADIO,
823			.vmux   = 2,
824			.gpio0  = 0x0000cdf3,
825			.extadc = 1,
826		},
827		.mpeg           = CX88_MPEG_BLACKBIRD,
828	},
829	[CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = {
830		 /* Alexander Wold <awold@bigfoot.com> */
831		 .name           = "Kworld V-Stream Xpert DVD",
832		 .tuner_type     = UNSET,
833		 .input          = {{
834			 .type   = CX88_VMUX_COMPOSITE1,
835			 .vmux   = 1,
836			 .gpio0  = 0x03000000,
837			 .gpio1  = 0x01000000,
838			 .gpio2  = 0x02000000,
839			 .gpio3  = 0x00100000,
840		 },{
841			 .type   = CX88_VMUX_SVIDEO,
842			 .vmux   = 2,
843			 .gpio0  = 0x03000000,
844			 .gpio1  = 0x01000000,
845			 .gpio2  = 0x02000000,
846			 .gpio3  = 0x00100000,
847		 }},
848	},
849	[CX88_BOARD_ATI_HDTVWONDER] = {
850		.name           = "ATI HDTV Wonder",
851		.tuner_type     = TUNER_PHILIPS_TUV1236D,
852		.radio_type     = UNSET,
853		.tuner_addr	= ADDR_UNSET,
854		.radio_addr	= ADDR_UNSET,
855		.input          = {{
856			.type   = CX88_VMUX_TELEVISION,
857			.vmux   = 0,
858			.gpio0  = 0x00000ff7,
859			.gpio1  = 0x000000ff,
860			.gpio2  = 0x00000001,
861			.gpio3  = 0x00000000,
862		},{
863			.type   = CX88_VMUX_COMPOSITE1,
864			.vmux   = 1,
865			.gpio0  = 0x00000ffe,
866			.gpio1  = 0x000000ff,
867			.gpio2  = 0x00000001,
868			.gpio3  = 0x00000000,
869		},{
870			.type   = CX88_VMUX_SVIDEO,
871			.vmux   = 2,
872			.gpio0  = 0x00000ffe,
873			.gpio1  = 0x000000ff,
874			.gpio2  = 0x00000001,
875			.gpio3  = 0x00000000,
876		}},
877		.mpeg           = CX88_MPEG_DVB,
878	},
879	[CX88_BOARD_WINFAST_DTV1000] = {
880		.name           = "WinFast DTV1000-T",
881		.tuner_type     = TUNER_ABSENT,
882		.radio_type     = UNSET,
883		.tuner_addr	= ADDR_UNSET,
884		.radio_addr	= ADDR_UNSET,
885		.input          = {{
886			.type   = CX88_VMUX_DVB,
887			.vmux   = 0,
888		},{
889			.type   = CX88_VMUX_COMPOSITE1,
890			.vmux   = 1,
891		},{
892			.type   = CX88_VMUX_SVIDEO,
893			.vmux   = 2,
894		}},
895		.mpeg           = CX88_MPEG_DVB,
896	},
897	[CX88_BOARD_AVERTV_303] = {
898		.name           = "AVerTV 303 (M126)",
899		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
900		.radio_type     = UNSET,
901		.tuner_addr	= ADDR_UNSET,
902		.radio_addr	= ADDR_UNSET,
903		.tda9887_conf   = TDA9887_PRESENT,
904		.input          = {{
905			.type   = CX88_VMUX_TELEVISION,
906			.vmux   = 0,
907			.gpio0  = 0x00ff,
908			.gpio1  = 0xe09f,
909			.gpio2  = 0x0010,
910			.gpio3  = 0x0000,
911		},{
912			.type   = CX88_VMUX_COMPOSITE1,
913			.vmux   = 1,
914			.gpio0  = 0x00ff,
915			.gpio1  = 0xe05f,
916			.gpio2  = 0x0010,
917			.gpio3  = 0x0000,
918		},{
919			.type   = CX88_VMUX_SVIDEO,
920			.vmux   = 2,
921			.gpio0  = 0x00ff,
922			.gpio1  = 0xe05f,
923			.gpio2  = 0x0010,
924			.gpio3  = 0x0000,
925		}},
926	},
927	[CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1] = {
928		.name		= "Hauppauge Nova-S-Plus DVB-S",
929		.tuner_type	= TUNER_ABSENT,
930		.radio_type	= UNSET,
931		.tuner_addr	= ADDR_UNSET,
932		.radio_addr	= ADDR_UNSET,
933		.input		= {{
934			.type	= CX88_VMUX_DVB,
935			.vmux	= 0,
936		},{
937			.type	= CX88_VMUX_COMPOSITE1,
938			.vmux	= 1,
939		},{
940			.type	= CX88_VMUX_SVIDEO,
941			.vmux	= 2,
942		}},
943		.mpeg           = CX88_MPEG_DVB,
944	},
945	[CX88_BOARD_HAUPPAUGE_NOVASE2_S1] = {
946		.name		= "Hauppauge Nova-SE2 DVB-S",
947		.tuner_type	= TUNER_ABSENT,
948		.radio_type	= UNSET,
949		.tuner_addr	= ADDR_UNSET,
950		.radio_addr	= ADDR_UNSET,
951		.input		= {{
952			.type	= CX88_VMUX_DVB,
953			.vmux	= 0,
954		}},
955		.mpeg           = CX88_MPEG_DVB,
956	},
957	[CX88_BOARD_KWORLD_DVBS_100] = {
958		.name		= "KWorld DVB-S 100",
959		.tuner_type	= TUNER_ABSENT,
960		.radio_type	= UNSET,
961		.tuner_addr	= ADDR_UNSET,
962		.radio_addr	= ADDR_UNSET,
963		.input		= {{
964			.type	= CX88_VMUX_DVB,
965			.vmux	= 0,
966		},{
967			.type	= CX88_VMUX_COMPOSITE1,
968			.vmux	= 1,
969		},{
970			.type	= CX88_VMUX_SVIDEO,
971			.vmux	= 2,
972		}},
973		.mpeg           = CX88_MPEG_DVB,
974	},
975	[CX88_BOARD_HAUPPAUGE_HVR1100] = {
976		.name		= "Hauppauge WinTV-HVR1100 DVB-T/Hybrid",
977		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
978		.radio_type	= UNSET,
979		.tuner_addr	= ADDR_UNSET,
980		.radio_addr	= ADDR_UNSET,
981		.tda9887_conf   = TDA9887_PRESENT,
982		.input		= {{
983			.type   = CX88_VMUX_TELEVISION,
984			.vmux   = 0,
985		},{
986			.type	= CX88_VMUX_COMPOSITE1,
987			.vmux	= 1,
988		},{
989			.type	= CX88_VMUX_SVIDEO,
990			.vmux	= 2,
991		}},
992		.mpeg           = CX88_MPEG_DVB,
993	},
994	[CX88_BOARD_HAUPPAUGE_HVR1100LP] = {
995		.name		= "Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile)",
996		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
997		.radio_type	= UNSET,
998		.tuner_addr	= ADDR_UNSET,
999		.radio_addr	= ADDR_UNSET,
1000		.tda9887_conf   = TDA9887_PRESENT,
1001		.input		= {{
1002			.type   = CX88_VMUX_TELEVISION,
1003			.vmux   = 0,
1004		},{
1005			.type	= CX88_VMUX_COMPOSITE1,
1006			.vmux	= 1,
1007		}},
1008		.mpeg           = CX88_MPEG_DVB,
1009	},
1010	[CX88_BOARD_DNTV_LIVE_DVB_T_PRO] = {
1011		.name           = "digitalnow DNTV Live! DVB-T Pro",
1012		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
1013		.radio_type     = UNSET,
1014		.tuner_addr	= ADDR_UNSET,
1015		.radio_addr	= ADDR_UNSET,
1016		.tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1017				  TDA9887_PORT2_ACTIVE,
1018		.input          = {{
1019			.type   = CX88_VMUX_TELEVISION,
1020			.vmux   = 0,
1021			.gpio0  = 0xf80808,
1022		},{
1023			.type   = CX88_VMUX_COMPOSITE1,
1024			.vmux   = 1,
1025			.gpio0	= 0xf80808,
1026		},{
1027			.type   = CX88_VMUX_SVIDEO,
1028			.vmux   = 2,
1029			.gpio0	= 0xf80808,
1030		}},
1031		.radio = {
1032			 .type  = CX88_RADIO,
1033			 .gpio0 = 0xf80808,
1034		},
1035		.mpeg           = CX88_MPEG_DVB,
1036	},
1037	[CX88_BOARD_KWORLD_DVB_T_CX22702] = {
1038		/* Kworld V-stream Xpert DVB-T with Thomson tuner */
1039		/* DTT 7579 Conexant CX22702-19 Conexant CX2388x  */
1040		/* Manenti Marco <marco_manenti@colman.it> */
1041		.name           = "KWorld/VStream XPert DVB-T with cx22702",
1042		.tuner_type     = TUNER_ABSENT,
1043		.radio_type     = UNSET,
1044		.tuner_addr	= ADDR_UNSET,
1045		.radio_addr	= ADDR_UNSET,
1046		.input          = {{
1047			.type   = CX88_VMUX_COMPOSITE1,
1048			.vmux   = 1,
1049			.gpio0  = 0x0700,
1050			.gpio2  = 0x0101,
1051		},{
1052			.type   = CX88_VMUX_SVIDEO,
1053			.vmux   = 2,
1054			.gpio0  = 0x0700,
1055			.gpio2  = 0x0101,
1056		}},
1057		.mpeg           = CX88_MPEG_DVB,
1058	},
1059	[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL] = {
1060		.name           = "DViCO FusionHDTV DVB-T Dual Digital",
1061		.tuner_type     = TUNER_ABSENT, /* No analog tuner */
1062		.radio_type     = UNSET,
1063		.tuner_addr	= ADDR_UNSET,
1064		.radio_addr	= ADDR_UNSET,
1065		.input          = {{
1066			.type   = CX88_VMUX_COMPOSITE1,
1067			.vmux   = 1,
1068			.gpio0  = 0x000067df,
1069		 },{
1070			.type   = CX88_VMUX_SVIDEO,
1071			.vmux   = 2,
1072			.gpio0  = 0x000067df,
1073		}},
1074		.mpeg           = CX88_MPEG_DVB,
1075	},
1076	[CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = {
1077		.name           = "KWorld HardwareMpegTV XPert",
1078		.tuner_type     = TUNER_PHILIPS_TDA8290,
1079		.radio_type     = UNSET,
1080		.tuner_addr	= ADDR_UNSET,
1081		.radio_addr	= ADDR_UNSET,
1082		.input          = {{
1083			.type   = CX88_VMUX_TELEVISION,
1084			.vmux   = 0,
1085			.gpio0  = 0x3de2,
1086			.gpio2  = 0x00ff,
1087		},{
1088			.type   = CX88_VMUX_COMPOSITE1,
1089			.vmux   = 1,
1090			.gpio0  = 0x3de6,
1091			.extadc = 1,
1092		},{
1093			.type   = CX88_VMUX_SVIDEO,
1094			.vmux   = 2,
1095			.gpio0  = 0x3de6,
1096			.extadc = 1,
1097		}},
1098		.radio = {
1099			.type   = CX88_RADIO,
1100			.gpio0  = 0x3de6,
1101			.gpio2  = 0x00ff,
1102		},
1103		.mpeg           = CX88_MPEG_BLACKBIRD,
1104	},
1105	[CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID] = {
1106		.name           = "DViCO FusionHDTV DVB-T Hybrid",
1107		.tuner_type     = TUNER_THOMSON_FE6600,
1108		.radio_type     = UNSET,
1109		.tuner_addr	= ADDR_UNSET,
1110		.radio_addr	= ADDR_UNSET,
1111		.input          = {{
1112			.type   = CX88_VMUX_TELEVISION,
1113			.vmux   = 0,
1114			.gpio0  = 0x0000a75f,
1115		},{
1116			.type   = CX88_VMUX_COMPOSITE1,
1117			.vmux   = 1,
1118			.gpio0  = 0x0000a75b,
1119		},{
1120			.type   = CX88_VMUX_SVIDEO,
1121			.vmux   = 2,
1122			.gpio0  = 0x0000a75b,
1123		}},
1124		.mpeg           = CX88_MPEG_DVB,
1125	},
1126	[CX88_BOARD_PCHDTV_HD5500] = {
1127		.name           = "pcHDTV HD5500 HDTV",
1128		.tuner_type     = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
1129		.radio_type     = UNSET,
1130		.tuner_addr	= ADDR_UNSET,
1131		.radio_addr	= ADDR_UNSET,
1132		.tda9887_conf   = TDA9887_PRESENT,
1133		.input          = {{
1134			.type   = CX88_VMUX_TELEVISION,
1135			.vmux   = 0,
1136			.gpio0  = 0x87fd,
1137		},{
1138			.type   = CX88_VMUX_COMPOSITE1,
1139			.vmux   = 1,
1140			.gpio0  = 0x87f9,
1141		},{
1142			.type   = CX88_VMUX_SVIDEO,
1143			.vmux   = 2,
1144			.gpio0  = 0x87f9,
1145		}},
1146		.mpeg           = CX88_MPEG_DVB,
1147	},
1148	[CX88_BOARD_KWORLD_MCE200_DELUXE] = {
1149		.name           = "Kworld MCE 200 Deluxe",
1150		.tuner_type     = TUNER_TENA_9533_DI,
1151		.radio_type     = UNSET,
1152		.tda9887_conf   = TDA9887_PRESENT,
1153		.tuner_addr     = ADDR_UNSET,
1154		.radio_addr     = ADDR_UNSET,
1155		.input          = {{
1156			.type   = CX88_VMUX_TELEVISION,
1157			.vmux   = 0,
1158			.gpio0  = 0x0000BDE6
1159		}},
1160		.mpeg           = CX88_MPEG_BLACKBIRD,
1161	},
1162	[CX88_BOARD_PIXELVIEW_PLAYTV_P7000] = {
1163		.name           = "PixelView PlayTV P7000",
1164		.tuner_type     = TUNER_PHILIPS_FM1216ME_MK3,
1165		.radio_type     = UNSET,
1166		.tuner_addr	= ADDR_UNSET,
1167		.radio_addr	= ADDR_UNSET,
1168		.tda9887_conf   = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1169				  TDA9887_PORT2_ACTIVE,
1170		.input          = {{
1171			.type   = CX88_VMUX_TELEVISION,
1172			.vmux   = 0,
1173			.gpio0  = 0x5da6,
1174		}},
1175		.mpeg           = CX88_MPEG_BLACKBIRD,
1176	},
1177	[CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
1178		.name           = "NPG Tech Real TV FM Top 10",
1179		.tuner_type     = TUNER_TNF_5335MF, /* Actually a TNF9535 */
1180		.radio_type     = UNSET,
1181		.tuner_addr	= ADDR_UNSET,
1182		.radio_addr	= ADDR_UNSET,
1183		.input          = {{
1184			.type   = CX88_VMUX_TELEVISION,
1185			.vmux   = 0,
1186			.gpio0	= 0x0788,
1187		},{
1188			.type   = CX88_VMUX_COMPOSITE1,
1189			.vmux   = 1,
1190			.gpio0	= 0x078b,
1191		},{
1192			.type   = CX88_VMUX_SVIDEO,
1193			.vmux   = 2,
1194			.gpio0	= 0x078b,
1195		}},
1196		.radio = {
1197			 .type  = CX88_RADIO,
1198			 .gpio0 = 0x074a,
1199		},
1200	},
1201	[CX88_BOARD_WINFAST_DTV2000H] = {
1202		/* video inputs and radio still in testing */
1203		.name           = "WinFast DTV2000 H",
1204		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
1205		.radio_type     = UNSET,
1206		.tuner_addr     = ADDR_UNSET,
1207		.radio_addr     = ADDR_UNSET,
1208		.tda9887_conf   = TDA9887_PRESENT,
1209		.input          = {{
1210			.type   = CX88_VMUX_TELEVISION,
1211			.vmux   = 0,
1212			.gpio0  = 0x00017304,
1213			.gpio1  = 0x00008203,
1214			.gpio2  = 0x00017304,
1215			.gpio3  = 0x02000000,
1216		}},
1217		.mpeg           = CX88_MPEG_DVB,
1218	},
1219	[CX88_BOARD_GENIATECH_DVBS] = {
1220		.name          = "Geniatech DVB-S",
1221		.tuner_type    = TUNER_ABSENT,
1222		.radio_type    = UNSET,
1223		.tuner_addr    = ADDR_UNSET,
1224		.radio_addr    = ADDR_UNSET,
1225		.input  = {{
1226			.type  = CX88_VMUX_DVB,
1227			.vmux  = 0,
1228		},{
1229			.type  = CX88_VMUX_COMPOSITE1,
1230			.vmux  = 1,
1231		}},
1232		.mpeg           = CX88_MPEG_DVB,
1233	},
1234	[CX88_BOARD_HAUPPAUGE_HVR3000] = {
1235		.name           = "Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T",
1236		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
1237		.radio_type     = UNSET,
1238		.tuner_addr     = ADDR_UNSET,
1239		.radio_addr     = ADDR_UNSET,
1240		.tda9887_conf   = TDA9887_PRESENT,
1241		.input          = {{
1242			.type   = CX88_VMUX_TELEVISION,
1243			.vmux   = 0,
1244			.gpio0  = 0x84bf,
1245		},{
1246			.type   = CX88_VMUX_COMPOSITE1,
1247			.vmux   = 1,
1248			.gpio0  = 0x84bf,
1249		},{
1250			.type   = CX88_VMUX_SVIDEO,
1251			.vmux   = 2,
1252			.gpio0  = 0x84bf,
1253		}},
1254		.mpeg           = CX88_MPEG_DVB,
1255	},
1256	[CX88_BOARD_NORWOOD_MICRO] = {
1257		.name           = "Norwood Micro TV Tuner",
1258		.tuner_type     = TUNER_TNF_5335MF,
1259		.radio_type     = UNSET,
1260		.tuner_addr     = ADDR_UNSET,
1261		.radio_addr     = ADDR_UNSET,
1262		.input          = {{
1263			.type   = CX88_VMUX_TELEVISION,
1264			.vmux   = 0,
1265			.gpio0  = 0x0709,
1266		},{
1267			.type   = CX88_VMUX_COMPOSITE1,
1268			.vmux   = 1,
1269			.gpio0  = 0x070b,
1270		},{
1271			.type   = CX88_VMUX_SVIDEO,
1272			.vmux   = 2,
1273			.gpio0  = 0x070b,
1274		}},
1275	},
1276	[CX88_BOARD_TE_DTV_250_OEM_SWANN] = {
1277		.name           = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM",
1278		.tuner_type     = TUNER_LG_PAL_NEW_TAPC,
1279		.radio_type     = UNSET,
1280		.tuner_addr     = ADDR_UNSET,
1281		.radio_addr     = ADDR_UNSET,
1282		.input          = {{
1283			.type   = CX88_VMUX_TELEVISION,
1284			.vmux   = 0,
1285			.gpio0  = 0x003fffff,
1286			.gpio1  = 0x00e00000,
1287			.gpio2  = 0x003fffff,
1288			.gpio3  = 0x02000000,
1289		},{
1290			.type   = CX88_VMUX_COMPOSITE1,
1291			.vmux   = 1,
1292			.gpio0  = 0x003fffff,
1293			.gpio1  = 0x00e00000,
1294			.gpio2  = 0x003fffff,
1295			.gpio3  = 0x02000000,
1296		},{
1297			.type   = CX88_VMUX_SVIDEO,
1298			.vmux   = 2,
1299			.gpio0  = 0x003fffff,
1300			.gpio1  = 0x00e00000,
1301			.gpio2  = 0x003fffff,
1302			.gpio3  = 0x02000000,
1303		}},
1304	},
1305	[CX88_BOARD_HAUPPAUGE_HVR1300] = {
1306		.name		= "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder",
1307		.tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
1308		.radio_type	= UNSET,
1309		.tuner_addr	= ADDR_UNSET,
1310		.radio_addr	= ADDR_UNSET,
1311		.tda9887_conf   = TDA9887_PRESENT,
1312		.audio_chip     = AUDIO_CHIP_WM8775,
1313		.input		= {{
1314			.type   = CX88_VMUX_TELEVISION,
1315			.vmux   = 0,
1316			.gpio0	= 0xe780,
1317			.extadc = 1,
1318		},{
1319			.type	= CX88_VMUX_COMPOSITE1,
1320			.vmux	= 1,
1321			.gpio0	= 0xe780,
1322			.extadc = 1,
1323		},{
1324			.type	= CX88_VMUX_SVIDEO,
1325			.vmux	= 2,
1326			.gpio0	= 0xe780,
1327			.extadc = 1,
1328		}},
1329		.mpeg           = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
1330	},
1331};
1332const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
1333
1334/* ------------------------------------------------------------------ */
1335/* PCI subsystem IDs                                                  */
1336
1337struct cx88_subid cx88_subids[] = {
1338	{
1339		.subvendor = 0x0070,
1340		.subdevice = 0x3400,
1341		.card      = CX88_BOARD_HAUPPAUGE,
1342	},{
1343		.subvendor = 0x0070,
1344		.subdevice = 0x3401,
1345		.card      = CX88_BOARD_HAUPPAUGE,
1346	},{
1347		.subvendor = 0x14c7,
1348		.subdevice = 0x0106,
1349		.card      = CX88_BOARD_GDI,
1350	},{
1351		.subvendor = 0x14c7,
1352		.subdevice = 0x0107, /* with mpeg encoder */
1353		.card      = CX88_BOARD_GDI,
1354	},{
1355		.subvendor = PCI_VENDOR_ID_ATI,
1356		.subdevice = 0x00f8,
1357		.card      = CX88_BOARD_ATI_WONDER_PRO,
1358	},{
1359		.subvendor = 0x107d,
1360		.subdevice = 0x6611,
1361		.card      = CX88_BOARD_WINFAST2000XP_EXPERT,
1362	},{
1363		.subvendor = 0x107d,
1364		.subdevice = 0x6613,	/* NTSC */
1365		.card      = CX88_BOARD_WINFAST2000XP_EXPERT,
1366	},{
1367		.subvendor = 0x107d,
1368		.subdevice = 0x6620,
1369		.card      = CX88_BOARD_WINFAST_DV2000,
1370	},{
1371		.subvendor = 0x107d,
1372		.subdevice = 0x663b,
1373		.card      = CX88_BOARD_LEADTEK_PVR2000,
1374	},{
1375		.subvendor = 0x107d,
1376		.subdevice = 0x663c,
1377		.card      = CX88_BOARD_LEADTEK_PVR2000,
1378	},{
1379		.subvendor = 0x1461,
1380		.subdevice = 0x000b,
1381		.card      = CX88_BOARD_AVERTV_STUDIO_303,
1382	},{
1383		.subvendor = 0x1462,
1384		.subdevice = 0x8606,
1385		.card      = CX88_BOARD_MSI_TVANYWHERE_MASTER,
1386	},{
1387		.subvendor = 0x10fc,
1388		.subdevice = 0xd003,
1389		.card      = CX88_BOARD_IODATA_GVVCP3PCI,
1390	},{
1391		.subvendor = 0x1043,
1392		.subdevice = 0x4823,  /* with mpeg encoder */
1393		.card      = CX88_BOARD_ASUS_PVR_416,
1394	},{
1395		.subvendor = 0x17de,
1396		.subdevice = 0x08a6,
1397		.card      = CX88_BOARD_KWORLD_DVB_T,
1398	},{
1399		.subvendor = 0x18ac,
1400		.subdevice = 0xd810,
1401		.card      = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
1402	},{
1403		.subvendor = 0x18ac,
1404		.subdevice = 0xd820,
1405		.card      = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
1406	},{
1407		.subvendor = 0x18ac,
1408		.subdevice = 0xdb00,
1409		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
1410	},{
1411		.subvendor = 0x0070,
1412		.subdevice = 0x9002,
1413		.card      = CX88_BOARD_HAUPPAUGE_DVB_T1,
1414	},{
1415		.subvendor = 0x14f1,
1416		.subdevice = 0x0187,
1417		.card      = CX88_BOARD_CONEXANT_DVB_T1,
1418	},{
1419		.subvendor = 0x1540,
1420		.subdevice = 0x2580,
1421		.card      = CX88_BOARD_PROVIDEO_PV259,
1422	},{
1423		.subvendor = 0x18ac,
1424		.subdevice = 0xdb10,
1425		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
1426	},{
1427		.subvendor = 0x1554,
1428		.subdevice = 0x4811,
1429		.card      = CX88_BOARD_PIXELVIEW,
1430	},{
1431		.subvendor = 0x7063,
1432		.subdevice = 0x3000, /* HD-3000 card */
1433		.card      = CX88_BOARD_PCHDTV_HD3000,
1434	},{
1435		.subvendor = 0x17de,
1436		.subdevice = 0xa8a6,
1437		.card      = CX88_BOARD_DNTV_LIVE_DVB_T,
1438	},{
1439		.subvendor = 0x0070,
1440		.subdevice = 0x2801,
1441		.card      = CX88_BOARD_HAUPPAUGE_ROSLYN,
1442	},{
1443		.subvendor = 0x14f1,
1444		.subdevice = 0x0342,
1445		.card      = CX88_BOARD_DIGITALLOGIC_MEC,
1446	},{
1447		.subvendor = 0x10fc,
1448		.subdevice = 0xd035,
1449		.card      = CX88_BOARD_IODATA_GVBCTV7E,
1450	},{
1451		.subvendor = 0x1421,
1452		.subdevice = 0x0334,
1453		.card      = CX88_BOARD_ADSTECH_DVB_T_PCI,
1454	},{
1455		.subvendor = 0x153b,
1456		.subdevice = 0x1166,
1457		.card      = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
1458	},{
1459		.subvendor = 0x18ac,
1460		.subdevice = 0xd500,
1461		.card      = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
1462	},{
1463		.subvendor = 0x1461,
1464		.subdevice = 0x8011,
1465		.card      = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550,
1466	},{
1467		.subvendor = PCI_VENDOR_ID_ATI,
1468		.subdevice = 0xa101,
1469		.card      = CX88_BOARD_ATI_HDTVWONDER,
1470	},{
1471		.subvendor = 0x107d,
1472		.subdevice = 0x665f,
1473		.card      = CX88_BOARD_WINFAST_DTV1000,
1474	},{
1475		.subvendor = 0x1461,
1476		.subdevice = 0x000a,
1477		.card      = CX88_BOARD_AVERTV_303,
1478	},{
1479		.subvendor = 0x0070,
1480		.subdevice = 0x9200,
1481		.card      = CX88_BOARD_HAUPPAUGE_NOVASE2_S1,
1482	},{
1483		.subvendor = 0x0070,
1484		.subdevice = 0x9201,
1485		.card      = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
1486	},{
1487		.subvendor = 0x0070,
1488		.subdevice = 0x9202,
1489		.card      = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
1490	},{
1491		.subvendor = 0x17de,
1492		.subdevice = 0x08b2,
1493		.card      = CX88_BOARD_KWORLD_DVBS_100,
1494	},{
1495		.subvendor = 0x0070,
1496		.subdevice = 0x9400,
1497		.card      = CX88_BOARD_HAUPPAUGE_HVR1100,
1498	},{
1499		.subvendor = 0x0070,
1500		.subdevice = 0x9402,
1501		.card      = CX88_BOARD_HAUPPAUGE_HVR1100,
1502	},{
1503		.subvendor = 0x0070,
1504		.subdevice = 0x9800,
1505		.card      = CX88_BOARD_HAUPPAUGE_HVR1100LP,
1506	},{
1507		.subvendor = 0x0070,
1508		.subdevice = 0x9802,
1509		.card      = CX88_BOARD_HAUPPAUGE_HVR1100LP,
1510	},{
1511		.subvendor = 0x0070,
1512		.subdevice = 0x9001,
1513		.card      = CX88_BOARD_HAUPPAUGE_DVB_T1,
1514	},{
1515		.subvendor = 0x1822,
1516		.subdevice = 0x0025,
1517		.card      = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
1518	},{
1519		.subvendor = 0x17de,
1520		.subdevice = 0x08a1,
1521		.card      = CX88_BOARD_KWORLD_DVB_T_CX22702,
1522	},{
1523		.subvendor = 0x18ac,
1524		.subdevice = 0xdb50,
1525		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1526	},{
1527		.subvendor = 0x18ac,
1528		.subdevice = 0xdb54,
1529		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1530		/* Re-branded DViCO: DigitalNow DVB-T Dual */
1531	},{
1532		.subvendor = 0x18ac,
1533		.subdevice = 0xdb11,
1534		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
1535		/* Re-branded DViCO: UltraView DVB-T Plus */
1536	},{
1537		.subvendor = 0x17de,
1538		.subdevice = 0x0840,
1539		.card      = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1540	},{
1541		.subvendor = 0x1421,
1542		.subdevice = 0x0305,
1543		.card      = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1544	},{
1545		.subvendor = 0x18ac,
1546		.subdevice = 0xdb40,
1547		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1548	},{
1549		.subvendor = 0x18ac,
1550		.subdevice = 0xdb44,
1551		.card      = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1552	},{
1553		.subvendor = 0x7063,
1554		.subdevice = 0x5500,
1555		.card      = CX88_BOARD_PCHDTV_HD5500,
1556	},{
1557		.subvendor = 0x17de,
1558		.subdevice = 0x0841,
1559		.card      = CX88_BOARD_KWORLD_MCE200_DELUXE,
1560	},{
1561		.subvendor = 0x1822,
1562		.subdevice = 0x0019,
1563		.card      = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
1564	},{
1565		.subvendor = 0x1554,
1566		.subdevice = 0x4813,
1567		.card      = CX88_BOARD_PIXELVIEW_PLAYTV_P7000,
1568	},{
1569		.subvendor = 0x14f1,
1570		.subdevice = 0x0842,
1571		.card      = CX88_BOARD_NPGTECH_REALTV_TOP10FM,
1572	},{
1573		.subvendor = 0x107d,
1574		.subdevice = 0x665e,
1575		.card      = CX88_BOARD_WINFAST_DTV2000H,
1576	},{
1577		.subvendor = 0x18ac,
1578		.subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
1579		.card      = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
1580	},{
1581		.subvendor = 0x14f1,
1582		.subdevice = 0x0084,
1583		.card      = CX88_BOARD_GENIATECH_DVBS,
1584	},{
1585		.subvendor = 0x0070,
1586		.subdevice = 0x1404,
1587		.card      = CX88_BOARD_HAUPPAUGE_HVR3000,
1588	},{
1589		.subvendor = 0x1461,
1590		.subdevice = 0xc111, /* AverMedia M150-D */
1591		/* This board is known to work with the ASUS PVR416 config */
1592		.card      = CX88_BOARD_ASUS_PVR_416,
1593	},{
1594		.subvendor = 0xc180,
1595		.subdevice = 0xc980,
1596		.card      = CX88_BOARD_TE_DTV_250_OEM_SWANN,
1597	},{
1598		.subvendor = 0x0070,
1599		.subdevice = 0x9600,
1600		.card      = CX88_BOARD_HAUPPAUGE_HVR1300,
1601	},{
1602		.subvendor = 0x0070,
1603		.subdevice = 0x9601,
1604		.card      = CX88_BOARD_HAUPPAUGE_HVR1300,
1605	},{
1606		.subvendor = 0x0070,
1607		.subdevice = 0x9602,
1608		.card      = CX88_BOARD_HAUPPAUGE_HVR1300,
1609	},{
1610		.subvendor = 0x107d,
1611		.subdevice = 0x6632,
1612		.card      = CX88_BOARD_LEADTEK_PVR2000,
1613	},{
1614		.subvendor = 0x12ab,
1615		.subdevice = 0x2300, /* Club3D Zap TV2100 */
1616		.card      = CX88_BOARD_KWORLD_DVB_T_CX22702,
1617	},{
1618		.subvendor = 0x0070,
1619		.subdevice = 0x9000,
1620		.card      = CX88_BOARD_HAUPPAUGE_DVB_T1,
1621	},{
1622		.subvendor = 0x0070,
1623		.subdevice = 0x1400,
1624		.card      = CX88_BOARD_HAUPPAUGE_HVR3000,
1625	},{
1626		.subvendor = 0x0070,
1627		.subdevice = 0x1401,
1628		.card      = CX88_BOARD_HAUPPAUGE_HVR3000,
1629	},{
1630		.subvendor = 0x0070,
1631		.subdevice = 0x1402,
1632		.card      = CX88_BOARD_HAUPPAUGE_HVR3000,
1633	},{
1634		.subvendor = 0x1421,
1635		.subdevice = 0x0341, /* ADS Tech InstantTV DVB-S */
1636		.card      = CX88_BOARD_KWORLD_DVBS_100,
1637	},
1638};
1639const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
1640
1641/* ----------------------------------------------------------------------- */
1642/* some leadtek specific stuff                                             */
1643
1644static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
1645{
1646	/* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
1647	 * any others.
1648	 *
1649	 * Byte 0 is 1 on the NTSC board.
1650	 */
1651
1652	if (eeprom_data[4] != 0x7d ||
1653	    eeprom_data[5] != 0x10 ||
1654	    eeprom_data[7] != 0x66) {
1655		printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
1656		       core->name);
1657		return;
1658	}
1659
1660	core->has_radio  = 1;
1661	core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
1662
1663	printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
1664	       "tuner=%d, eeprom[0]=0x%02x\n",
1665	       core->name, core->tuner_type, eeprom_data[0]);
1666}
1667
1668static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1669{
1670	struct tveeprom tv;
1671
1672	tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
1673	core->tuner_type = tv.tuner_type;
1674	core->tuner_formats = tv.tuner_formats;
1675	core->has_radio  = tv.has_radio;
1676
1677	/* Make sure we support the board model */
1678	switch (tv.model)
1679	{
1680	case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
1681	case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
1682	case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
1683	case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
1684	case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
1685	case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
1686	case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
1687	case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
1688	case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
1689	case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
1690	case 34519: /* WinTV-PCI-FM */
1691	case 90002: /* Nova-T-PCI (9002) */
1692	case 92001: /* Nova-S-Plus (Video and IR) */
1693	case 92002: /* Nova-S-Plus (Video and IR) */
1694	case 90003: /* Nova-T-PCI (9002 No RF out) */
1695	case 90500: /* Nova-T-PCI (oem) */
1696	case 90501: /* Nova-T-PCI (oem/IR) */
1697	case 92000: /* Nova-SE2 (OEM, No Video or IR) */
1698	case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
1699	case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
1700	case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
1701	case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
1702	case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
1703	case 96569: /* WinTV-HVR1300 () */
1704	case 96659: /* WinTV-HVR1300 () */
1705	case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
1706		/* known */
1707		break;
1708	default:
1709		printk("%s: warning: unknown hauppauge model #%d\n",
1710		       core->name, tv.model);
1711		break;
1712	}
1713
1714	printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
1715			core->name, tv.model);
1716}
1717
1718/* ----------------------------------------------------------------------- */
1719/* some GDI (was: Modular Technology) specific stuff                       */
1720
1721static struct {
1722	int  id;
1723	int  fm;
1724	char *name;
1725} gdi_tuner[] = {
1726	[ 0x01 ] = { .id   = TUNER_ABSENT,
1727		     .name = "NTSC_M" },
1728	[ 0x02 ] = { .id   = TUNER_ABSENT,
1729		     .name = "PAL_B" },
1730	[ 0x03 ] = { .id   = TUNER_ABSENT,
1731		     .name = "PAL_I" },
1732	[ 0x04 ] = { .id   = TUNER_ABSENT,
1733		     .name = "PAL_D" },
1734	[ 0x05 ] = { .id   = TUNER_ABSENT,
1735		     .name = "SECAM" },
1736
1737	[ 0x10 ] = { .id   = TUNER_ABSENT,
1738		     .fm   = 1,
1739		     .name = "TEMIC_4049" },
1740	[ 0x11 ] = { .id   = TUNER_TEMIC_4136FY5,
1741		     .name = "TEMIC_4136" },
1742	[ 0x12 ] = { .id   = TUNER_ABSENT,
1743		     .name = "TEMIC_4146" },
1744
1745	[ 0x20 ] = { .id   = TUNER_PHILIPS_FQ1216ME,
1746		     .fm   = 1,
1747		     .name = "PHILIPS_FQ1216_MK3" },
1748	[ 0x21 ] = { .id   = TUNER_ABSENT, .fm = 1,
1749		     .name = "PHILIPS_FQ1236_MK3" },
1750	[ 0x22 ] = { .id   = TUNER_ABSENT,
1751		     .name = "PHILIPS_FI1236_MK3" },
1752	[ 0x23 ] = { .id   = TUNER_ABSENT,
1753		     .name = "PHILIPS_FI1216_MK3" },
1754};
1755
1756static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
1757{
1758	char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
1759		? gdi_tuner[eeprom_data[0x0d]].name : NULL;
1760
1761	printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
1762	       name ? name : "unknown");
1763	if (NULL == name)
1764		return;
1765	core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
1766	core->has_radio  = gdi_tuner[eeprom_data[0x0d]].fm;
1767}
1768
1769/* ----------------------------------------------------------------------- */
1770/* some DViCO specific stuff                                               */
1771
1772static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
1773{
1774	struct i2c_msg msg = { .addr = 0x45, .flags = 0 };
1775	int i, err;
1776	static u8 init_bufs[13][5] = {
1777		{ 0x10, 0x00, 0x20, 0x01, 0x03 },
1778		{ 0x10, 0x10, 0x01, 0x00, 0x21 },
1779		{ 0x10, 0x10, 0x10, 0x00, 0xCA },
1780		{ 0x10, 0x10, 0x12, 0x00, 0x08 },
1781		{ 0x10, 0x10, 0x13, 0x00, 0x0A },
1782		{ 0x10, 0x10, 0x16, 0x01, 0xC0 },
1783		{ 0x10, 0x10, 0x22, 0x01, 0x3D },
1784		{ 0x10, 0x10, 0x73, 0x01, 0x2E },
1785		{ 0x10, 0x10, 0x72, 0x00, 0xC5 },
1786		{ 0x10, 0x10, 0x71, 0x01, 0x97 },
1787		{ 0x10, 0x10, 0x70, 0x00, 0x0F },
1788		{ 0x10, 0x10, 0xB0, 0x00, 0x01 },
1789		{ 0x03, 0x0C },
1790	};
1791
1792	for (i = 0; i < ARRAY_SIZE(init_bufs); i++) {
1793		msg.buf = init_bufs[i];
1794		msg.len = (i != 12 ? 5 : 2);
1795		err = i2c_transfer(&core->i2c_adap, &msg, 1);
1796		if (err != 1) {
1797			printk("dvico_fusionhdtv_hybrid_init buf %d failed (err = %d)!\n", i, err);
1798			return;
1799		}
1800	}
1801}
1802
1803/* ----------------------------------------------------------------------- */
1804
1805void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1806{
1807	int i;
1808
1809	if (0 == pci->subsystem_vendor &&
1810	    0 == pci->subsystem_device) {
1811		printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
1812		       "%s: be autodetected.  Please pass card=<n> insmod option to\n"
1813		       "%s: workaround that.  Redirect complaints to the vendor of\n"
1814		       "%s: the TV card.  Best regards,\n"
1815		       "%s:         -- tux\n",
1816		       core->name,core->name,core->name,core->name,core->name);
1817	} else {
1818		printk("%s: Your board isn't known (yet) to the driver.  You can\n"
1819		       "%s: try to pick one of the existing card configs via\n"
1820		       "%s: card=<n> insmod option.  Updating to the latest\n"
1821		       "%s: version might help as well.\n",
1822		       core->name,core->name,core->name,core->name);
1823	}
1824	printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
1825	       core->name);
1826	for (i = 0; i < cx88_bcount; i++)
1827		printk("%s:    card=%d -> %s\n",
1828		       core->name, i, cx88_boards[i].name);
1829}
1830
1831void cx88_card_setup_pre_i2c(struct cx88_core *core)
1832{
1833	switch (core->board) {
1834	case CX88_BOARD_HAUPPAUGE_HVR1300:
1835		/* Bring the 702 demod up before i2c scanning/attach or devices are hidden */
1836		/* We leave here with the 702 on the bus */
1837		cx_write(MO_GP0_IO, 0x0000e780);
1838		udelay(1000);
1839		cx_clear(MO_GP0_IO, 0x00000080);
1840		udelay(50);
1841		cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
1842		udelay(1000);
1843		break;
1844	}
1845}
1846
1847void cx88_card_setup(struct cx88_core *core)
1848{
1849	static u8 eeprom[256];
1850
1851	if (0 == core->i2c_rc) {
1852		core->i2c_client.addr = 0xa0 >> 1;
1853		tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
1854	}
1855
1856	switch (core->board) {
1857	case CX88_BOARD_HAUPPAUGE:
1858	case CX88_BOARD_HAUPPAUGE_ROSLYN:
1859		if (0 == core->i2c_rc)
1860			hauppauge_eeprom(core,eeprom+8);
1861		break;
1862	case CX88_BOARD_GDI:
1863		if (0 == core->i2c_rc)
1864			gdi_eeprom(core,eeprom);
1865		break;
1866	case CX88_BOARD_WINFAST2000XP_EXPERT:
1867		if (0 == core->i2c_rc)
1868			leadtek_eeprom(core,eeprom);
1869		break;
1870	case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
1871	case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
1872	case CX88_BOARD_HAUPPAUGE_DVB_T1:
1873	case CX88_BOARD_HAUPPAUGE_HVR1100:
1874	case CX88_BOARD_HAUPPAUGE_HVR1100LP:
1875	case CX88_BOARD_HAUPPAUGE_HVR3000:
1876	case CX88_BOARD_HAUPPAUGE_HVR1300:
1877		if (0 == core->i2c_rc)
1878			hauppauge_eeprom(core,eeprom);
1879		break;
1880	case CX88_BOARD_KWORLD_DVBS_100:
1881		cx_write(MO_GP0_IO, 0x000007f8);
1882		cx_write(MO_GP1_IO, 0x00000001);
1883		break;
1884	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
1885		/* GPIO0:6 is hooked to FX2 reset pin */
1886		cx_set(MO_GP0_IO, 0x00004040);
1887		cx_clear(MO_GP0_IO, 0x00000040);
1888		msleep(1000);
1889		cx_set(MO_GP0_IO, 0x00004040);
1890		/* FALLTHROUGH */
1891	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
1892	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
1893	case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
1894		/* GPIO0:0 is hooked to mt352 reset pin */
1895		cx_set(MO_GP0_IO, 0x00000101);
1896		cx_clear(MO_GP0_IO, 0x00000001);
1897		msleep(1);
1898		cx_set(MO_GP0_IO, 0x00000101);
1899		if (0 == core->i2c_rc &&
1900		    core->board == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
1901			dvico_fusionhdtv_hybrid_init(core);
1902		break;
1903	case CX88_BOARD_KWORLD_DVB_T:
1904	case CX88_BOARD_DNTV_LIVE_DVB_T:
1905		cx_set(MO_GP0_IO, 0x00000707);
1906		cx_set(MO_GP2_IO, 0x00000101);
1907		cx_clear(MO_GP2_IO, 0x00000001);
1908		msleep(1);
1909		cx_clear(MO_GP0_IO, 0x00000007);
1910		cx_set(MO_GP2_IO, 0x00000101);
1911		break;
1912	case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
1913		cx_write(MO_GP0_IO, 0x00080808);
1914		break;
1915	case CX88_BOARD_ATI_HDTVWONDER:
1916		if (0 == core->i2c_rc) {
1917			/* enable tuner */
1918			int i;
1919			static const u8 buffer [][2] = {
1920				{0x10,0x12},
1921				{0x13,0x04},
1922				{0x16,0x00},
1923				{0x14,0x04},
1924				{0x17,0x00}
1925			};
1926			core->i2c_client.addr = 0x0a;
1927
1928			for (i = 0; i < ARRAY_SIZE(buffer); i++)
1929				if (2 != i2c_master_send(&core->i2c_client,
1930							buffer[i],2))
1931					printk(KERN_WARNING
1932						"%s: Unable to enable "
1933						"tuner(%i).\n",
1934						core->name, i);
1935		}
1936		break;
1937	}
1938	if (cx88_boards[core->board].radio.type == CX88_RADIO)
1939		core->has_radio = 1;
1940}
1941
1942/* ------------------------------------------------------------------ */
1943
1944EXPORT_SYMBOL(cx88_boards);
1945
1946/*
1947 * Local variables:
1948 * c-basic-offset: 8
1949 * End:
1950 * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off
1951 */
1952