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