Linux v2.6.15-rc7
[pohmelfs.git] / drivers / media / video / cx88 / cx88-cards.c
blob951709aa88ba37e77fe63f901162736f0306d300
1 /*
3 * device driver for Conexant 2388x based TV cards
4 * card-specific stuff.
6 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
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.
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.
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.
23 #include <linux/init.h>
24 #include <linux/module.h>
25 #include <linux/pci.h>
26 #include <linux/delay.h>
28 #include "cx88.h"
30 /* ------------------------------------------------------------------ */
31 /* board config info */
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 }},
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,
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 }},
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
108 .type = CX88_VMUX_COMPOSITE1,
109 .vmux = 1,
111 .type = CX88_VMUX_SVIDEO,
112 .vmux = 2,
114 .radio = {
115 .type = CX88_RADIO,
116 .gpio0 = 0xff10,
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,
131 .type = CX88_VMUX_COMPOSITE1,
132 .vmux = 1,
133 .gpio0 = 0x03fe,
135 .type = CX88_VMUX_SVIDEO,
136 .vmux = 2,
137 .gpio0 = 0x03fe,
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,
155 .type = CX88_VMUX_COMPOSITE1,
156 .vmux = 1,
157 .gpio0 = 0x00F5c700,
158 .gpio1 = 0x00003004,
159 .gpio2 = 0x00F5c700,
160 .gpio3 = 0x02000000,
162 .type = CX88_VMUX_SVIDEO,
163 .vmux = 2,
164 .gpio0 = 0x00F5c700,
165 .gpio1 = 0x00003004,
166 .gpio2 = 0x00F5c700,
167 .gpio3 = 0x02000000,
169 .radio = {
170 .type = CX88_RADIO,
171 .gpio0 = 0x00F5d700,
172 .gpio1 = 0x00003004,
173 .gpio2 = 0x00F5d700,
174 .gpio3 = 0x02000000,
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 = 0x309f,
189 .type = CX88_VMUX_COMPOSITE1,
190 .vmux = 1,
191 .gpio1 = 0x305f,
193 .type = CX88_VMUX_SVIDEO,
194 .vmux = 2,
195 .gpio1 = 0x305f,
197 .radio = {
198 .type = CX88_RADIO,
201 [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
202 // added gpio values thanks to Michal
203 // values for PAL from DScaler
204 .name = "MSI TV-@nywhere Master",
205 .tuner_type = TUNER_MT2032,
206 .radio_type = UNSET,
207 .tuner_addr = ADDR_UNSET,
208 .radio_addr = ADDR_UNSET,
209 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER_NTSC,
210 .input = {{
211 .type = CX88_VMUX_TELEVISION,
212 .vmux = 0,
213 .gpio0 = 0x000040bf,
214 .gpio1 = 0x000080c0,
215 .gpio2 = 0x0000ff40,
217 .type = CX88_VMUX_COMPOSITE1,
218 .vmux = 1,
219 .gpio0 = 0x000040bf,
220 .gpio1 = 0x000080c0,
221 .gpio2 = 0x0000ff40,
223 .type = CX88_VMUX_SVIDEO,
224 .vmux = 2,
225 .gpio0 = 0x000040bf,
226 .gpio1 = 0x000080c0,
227 .gpio2 = 0x0000ff40,
229 .radio = {
230 .type = CX88_RADIO,
233 [CX88_BOARD_WINFAST_DV2000] = {
234 .name = "Leadtek Winfast DV2000",
235 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
236 .radio_type = UNSET,
237 .tuner_addr = ADDR_UNSET,
238 .radio_addr = ADDR_UNSET,
239 .tda9887_conf = TDA9887_PRESENT,
240 .input = {{
241 .type = CX88_VMUX_TELEVISION,
242 .vmux = 0,
243 .gpio0 = 0x0035e700,
244 .gpio1 = 0x00003004,
245 .gpio2 = 0x0035e700,
246 .gpio3 = 0x02000000,
249 .type = CX88_VMUX_COMPOSITE1,
250 .vmux = 1,
251 .gpio0 = 0x0035c700,
252 .gpio1 = 0x00003004,
253 .gpio2 = 0x0035c700,
254 .gpio3 = 0x02000000,
256 .type = CX88_VMUX_SVIDEO,
257 .vmux = 2,
258 .gpio0 = 0x0035c700,
259 .gpio1 = 0x0035c700,
260 .gpio2 = 0x02000000,
261 .gpio3 = 0x02000000,
263 .radio = {
264 .type = CX88_RADIO,
265 .gpio0 = 0x0035d700,
266 .gpio1 = 0x00007004,
267 .gpio2 = 0x0035d700,
268 .gpio3 = 0x02000000,
271 [CX88_BOARD_LEADTEK_PVR2000] = {
272 // gpio values for PAL version from regspy by DScaler
273 .name = "Leadtek PVR 2000",
274 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
275 .radio_type = UNSET,
276 .tuner_addr = ADDR_UNSET,
277 .radio_addr = ADDR_UNSET,
278 .tda9887_conf = TDA9887_PRESENT,
279 .input = {{
280 .type = CX88_VMUX_TELEVISION,
281 .vmux = 0,
282 .gpio0 = 0x0000bde2,
284 .type = CX88_VMUX_COMPOSITE1,
285 .vmux = 1,
286 .gpio0 = 0x0000bde6,
288 .type = CX88_VMUX_SVIDEO,
289 .vmux = 2,
290 .gpio0 = 0x0000bde6,
292 .radio = {
293 .type = CX88_RADIO,
294 .gpio0 = 0x0000bd62,
296 .blackbird = 1,
298 [CX88_BOARD_IODATA_GVVCP3PCI] = {
299 .name = "IODATA GV-VCP3/PCI",
300 .tuner_type = TUNER_ABSENT,
301 .radio_type = UNSET,
302 .tuner_addr = ADDR_UNSET,
303 .radio_addr = ADDR_UNSET,
304 .input = {{
305 .type = CX88_VMUX_COMPOSITE1,
306 .vmux = 0,
308 .type = CX88_VMUX_COMPOSITE2,
309 .vmux = 1,
311 .type = CX88_VMUX_SVIDEO,
312 .vmux = 2,
315 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
316 .name = "Prolink PlayTV PVR",
317 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
318 .radio_type = UNSET,
319 .tuner_addr = ADDR_UNSET,
320 .radio_addr = ADDR_UNSET,
321 .tda9887_conf = TDA9887_PRESENT,
322 .input = {{
323 .type = CX88_VMUX_TELEVISION,
324 .vmux = 0,
325 .gpio0 = 0xff00,
327 .type = CX88_VMUX_COMPOSITE1,
328 .vmux = 1,
329 .gpio0 = 0xff03,
331 .type = CX88_VMUX_SVIDEO,
332 .vmux = 2,
333 .gpio0 = 0xff03,
335 .radio = {
336 .type = CX88_RADIO,
337 .gpio0 = 0xff00,
340 [CX88_BOARD_ASUS_PVR_416] = {
341 .name = "ASUS PVR-416",
342 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
343 .radio_type = UNSET,
344 .tuner_addr = ADDR_UNSET,
345 .radio_addr = ADDR_UNSET,
346 .tda9887_conf = TDA9887_PRESENT,
347 .input = {{
348 .type = CX88_VMUX_TELEVISION,
349 .vmux = 0,
350 .gpio0 = 0x0000fde6,
352 .type = CX88_VMUX_SVIDEO,
353 .vmux = 2,
354 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
356 .radio = {
357 .type = CX88_RADIO,
358 .gpio0 = 0x0000fde2,
360 .blackbird = 1,
362 [CX88_BOARD_MSI_TVANYWHERE] = {
363 .name = "MSI TV-@nywhere",
364 .tuner_type = TUNER_MT2032,
365 .radio_type = UNSET,
366 .tuner_addr = ADDR_UNSET,
367 .radio_addr = ADDR_UNSET,
368 .tda9887_conf = TDA9887_PRESENT,
369 .input = {{
370 .type = CX88_VMUX_TELEVISION,
371 .vmux = 0,
372 .gpio0 = 0x00000fbf,
373 .gpio2 = 0x0000fc08,
375 .type = CX88_VMUX_COMPOSITE1,
376 .vmux = 1,
377 .gpio0 = 0x00000fbf,
378 .gpio2 = 0x0000fc68,
380 .type = CX88_VMUX_SVIDEO,
381 .vmux = 2,
382 .gpio0 = 0x00000fbf,
383 .gpio2 = 0x0000fc68,
386 [CX88_BOARD_KWORLD_DVB_T] = {
387 .name = "KWorld/VStream XPert DVB-T",
388 .tuner_type = TUNER_ABSENT,
389 .radio_type = UNSET,
390 .tuner_addr = ADDR_UNSET,
391 .radio_addr = ADDR_UNSET,
392 .input = {{
393 .type = CX88_VMUX_COMPOSITE1,
394 .vmux = 1,
395 .gpio0 = 0x0700,
396 .gpio2 = 0x0101,
398 .type = CX88_VMUX_SVIDEO,
399 .vmux = 2,
400 .gpio0 = 0x0700,
401 .gpio2 = 0x0101,
403 .dvb = 1,
405 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
406 .name = "DViCO FusionHDTV DVB-T1",
407 .tuner_type = TUNER_ABSENT, /* No analog tuner */
408 .radio_type = UNSET,
409 .tuner_addr = ADDR_UNSET,
410 .radio_addr = ADDR_UNSET,
411 .input = {{
412 .type = CX88_VMUX_COMPOSITE1,
413 .vmux = 1,
414 .gpio0 = 0x000027df,
416 .type = CX88_VMUX_SVIDEO,
417 .vmux = 2,
418 .gpio0 = 0x000027df,
420 .dvb = 1,
422 [CX88_BOARD_KWORLD_LTV883] = {
423 .name = "KWorld LTV883RF",
424 .tuner_type = TUNER_TNF_8831BGFF,
425 .radio_type = UNSET,
426 .tuner_addr = ADDR_UNSET,
427 .radio_addr = ADDR_UNSET,
428 .input = {{
429 .type = CX88_VMUX_TELEVISION,
430 .vmux = 0,
431 .gpio0 = 0x07f8,
433 .type = CX88_VMUX_DEBUG,
434 .vmux = 0,
435 .gpio0 = 0x07f9, // mono from tuner chip
437 .type = CX88_VMUX_COMPOSITE1,
438 .vmux = 1,
439 .gpio0 = 0x000007fa,
441 .type = CX88_VMUX_SVIDEO,
442 .vmux = 2,
443 .gpio0 = 0x000007fa,
445 .radio = {
446 .type = CX88_RADIO,
447 .gpio0 = 0x000007f8,
450 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
451 .name = "DViCO FusionHDTV 3 Gold-Q",
452 .tuner_type = TUNER_MICROTUNE_4042FI5,
453 .radio_type = UNSET,
454 .tuner_addr = ADDR_UNSET,
455 .radio_addr = ADDR_UNSET,
457 GPIO[0] resets DT3302 DTV receiver
458 0 - reset asserted
459 1 - normal operation
460 GPIO[1] mutes analog audio output connector
461 0 - enable selected source
462 1 - mute
463 GPIO[2] selects source for analog audio output connector
464 0 - analog audio input connector on tab
465 1 - analog DAC output from CX23881 chip
466 GPIO[3] selects RF input connector on tuner module
467 0 - RF connector labeled CABLE
468 1 - RF connector labeled ANT
469 GPIO[4] selects high RF for QAM256 mode
470 0 - normal RF
471 1 - high RF
473 .input = {{
474 .type = CX88_VMUX_TELEVISION,
475 .vmux = 0,
476 .gpio0 = 0x0f0d,
478 .type = CX88_VMUX_CABLE,
479 .vmux = 0,
480 .gpio0 = 0x0f05,
482 .type = CX88_VMUX_COMPOSITE1,
483 .vmux = 1,
484 .gpio0 = 0x0f00,
486 .type = CX88_VMUX_SVIDEO,
487 .vmux = 2,
488 .gpio0 = 0x0f00,
490 .dvb = 1,
492 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
493 .name = "Hauppauge Nova-T DVB-T",
494 .tuner_type = TUNER_ABSENT,
495 .radio_type = UNSET,
496 .tuner_addr = ADDR_UNSET,
497 .radio_addr = ADDR_UNSET,
498 .input = {{
499 .type = CX88_VMUX_DVB,
500 .vmux = 0,
502 .dvb = 1,
504 [CX88_BOARD_CONEXANT_DVB_T1] = {
505 .name = "Conexant DVB-T reference design",
506 .tuner_type = TUNER_ABSENT,
507 .radio_type = UNSET,
508 .tuner_addr = ADDR_UNSET,
509 .radio_addr = ADDR_UNSET,
510 .input = {{
511 .type = CX88_VMUX_DVB,
512 .vmux = 0,
514 .dvb = 1,
516 [CX88_BOARD_PROVIDEO_PV259] = {
517 .name = "Provideo PV259",
518 .tuner_type = TUNER_PHILIPS_FQ1216ME,
519 .radio_type = UNSET,
520 .tuner_addr = ADDR_UNSET,
521 .radio_addr = ADDR_UNSET,
522 .input = {{
523 .type = CX88_VMUX_TELEVISION,
524 .vmux = 0,
526 .blackbird = 1,
528 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
529 .name = "DViCO FusionHDTV DVB-T Plus",
530 .tuner_type = TUNER_ABSENT, /* No analog tuner */
531 .radio_type = UNSET,
532 .tuner_addr = ADDR_UNSET,
533 .radio_addr = ADDR_UNSET,
534 .input = {{
535 .type = CX88_VMUX_COMPOSITE1,
536 .vmux = 1,
537 .gpio0 = 0x000027df,
539 .type = CX88_VMUX_SVIDEO,
540 .vmux = 2,
541 .gpio0 = 0x000027df,
543 .dvb = 1,
545 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
546 .name = "digitalnow DNTV Live! DVB-T",
547 .tuner_type = TUNER_ABSENT,
548 .radio_type = UNSET,
549 .tuner_addr = ADDR_UNSET,
550 .radio_addr = ADDR_UNSET,
551 .input = {{
552 .type = CX88_VMUX_COMPOSITE1,
553 .vmux = 1,
554 .gpio0 = 0x00000700,
555 .gpio2 = 0x00000101,
557 .type = CX88_VMUX_SVIDEO,
558 .vmux = 2,
559 .gpio0 = 0x00000700,
560 .gpio2 = 0x00000101,
562 .dvb = 1,
564 [CX88_BOARD_PCHDTV_HD3000] = {
565 .name = "pcHDTV HD3000 HDTV",
566 .tuner_type = TUNER_THOMSON_DTT7610,
567 .radio_type = UNSET,
568 .tuner_addr = ADDR_UNSET,
569 .radio_addr = ADDR_UNSET,
570 .tda9887_conf = TDA9887_PRESENT,
571 .input = {{
572 .type = CX88_VMUX_TELEVISION,
573 .vmux = 0,
574 .gpio0 = 0x00008484,
575 .gpio1 = 0x00000000,
576 .gpio2 = 0x00000000,
577 .gpio3 = 0x00000000,
579 .type = CX88_VMUX_COMPOSITE1,
580 .vmux = 1,
581 .gpio0 = 0x00008400,
582 .gpio1 = 0x00000000,
583 .gpio2 = 0x00000000,
584 .gpio3 = 0x00000000,
586 .type = CX88_VMUX_SVIDEO,
587 .vmux = 2,
588 .gpio0 = 0x00008400,
589 .gpio1 = 0x00000000,
590 .gpio2 = 0x00000000,
591 .gpio3 = 0x00000000,
593 .radio = {
594 .type = CX88_RADIO,
595 .vmux = 2,
596 .gpio0 = 0x00008400,
597 .gpio1 = 0x00000000,
598 .gpio2 = 0x00000000,
599 .gpio3 = 0x00000000,
601 .dvb = 1,
603 [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
604 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
605 // GPIO values obtained from regspy, courtesy Sean Covel
606 .name = "Hauppauge WinTV 28xxx (Roslyn) models",
607 .tuner_type = UNSET,
608 .radio_type = UNSET,
609 .tuner_addr = ADDR_UNSET,
610 .radio_addr = ADDR_UNSET,
611 .input = {{
612 .type = CX88_VMUX_TELEVISION,
613 .vmux = 0,
614 .gpio0 = 0xed12, /* internal decoder */
615 .gpio2 = 0x00ff,
617 .type = CX88_VMUX_DEBUG,
618 .vmux = 0,
619 .gpio0 = 0xff01, /* mono from tuner chip */
621 .type = CX88_VMUX_COMPOSITE1,
622 .vmux = 1,
623 .gpio0 = 0xff02,
625 .type = CX88_VMUX_SVIDEO,
626 .vmux = 2,
627 .gpio0 = 0xed92,
628 .gpio2 = 0x00ff,
630 .radio = {
631 .type = CX88_RADIO,
632 .gpio0 = 0xed96,
633 .gpio2 = 0x00ff,
635 .blackbird = 1,
637 [CX88_BOARD_DIGITALLOGIC_MEC] = {
638 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
639 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
640 .radio_type = UNSET,
641 .tuner_addr = ADDR_UNSET,
642 .radio_addr = ADDR_UNSET,
643 .tda9887_conf = TDA9887_PRESENT,
644 .input = {{
645 .type = CX88_VMUX_TELEVISION,
646 .vmux = 0,
647 .gpio0 = 0x00009d80,
649 .type = CX88_VMUX_COMPOSITE1,
650 .vmux = 1,
651 .gpio0 = 0x00009d76,
653 .type = CX88_VMUX_SVIDEO,
654 .vmux = 2,
655 .gpio0 = 0x00009d76,
657 .radio = {
658 .type = CX88_RADIO,
659 .gpio0 = 0x00009d00,
661 .blackbird = 1,
663 [CX88_BOARD_IODATA_GVBCTV7E] = {
664 .name = "IODATA GV/BCTV7E",
665 .tuner_type = TUNER_PHILIPS_FQ1286,
666 .radio_type = UNSET,
667 .tuner_addr = ADDR_UNSET,
668 .radio_addr = ADDR_UNSET,
669 .tda9887_conf = TDA9887_PRESENT,
670 .input = {{
671 .type = CX88_VMUX_TELEVISION,
672 .vmux = 1,
673 .gpio1 = 0x0000e03f,
675 .type = CX88_VMUX_COMPOSITE1,
676 .vmux = 2,
677 .gpio1 = 0x0000e07f,
679 .type = CX88_VMUX_SVIDEO,
680 .vmux = 3,
681 .gpio1 = 0x0000e07f,
684 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
685 .name = "PixelView PlayTV Ultra Pro (Stereo)",
686 /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
687 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
688 .radio_type = UNSET,
689 .tuner_addr = ADDR_UNSET,
690 .radio_addr = ADDR_UNSET,
691 .input = {{
692 .type = CX88_VMUX_TELEVISION,
693 .vmux = 0,
694 .gpio0 = 0xbf61, /* internal decoder */
696 .type = CX88_VMUX_COMPOSITE1,
697 .vmux = 1,
698 .gpio0 = 0xbf63,
700 .type = CX88_VMUX_SVIDEO,
701 .vmux = 2,
702 .gpio0 = 0xbf63,
704 .radio = {
705 .type = CX88_RADIO,
706 .gpio0 = 0xbf60,
709 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
710 .name = "DViCO FusionHDTV 3 Gold-T",
711 .tuner_type = TUNER_THOMSON_DTT7611,
712 .radio_type = UNSET,
713 .tuner_addr = ADDR_UNSET,
714 .radio_addr = ADDR_UNSET,
715 .tda9887_conf = TDA9887_PRESENT,
716 .input = {{
717 .type = CX88_VMUX_TELEVISION,
718 .vmux = 0,
719 .gpio0 = 0x97ed,
721 .type = CX88_VMUX_COMPOSITE1,
722 .vmux = 1,
723 .gpio0 = 0x97e9,
725 .type = CX88_VMUX_SVIDEO,
726 .vmux = 2,
727 .gpio0 = 0x97e9,
729 .dvb = 1,
731 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
732 .name = "ADS Tech Instant TV DVB-T PCI",
733 .tuner_type = TUNER_ABSENT,
734 .radio_type = UNSET,
735 .tuner_addr = ADDR_UNSET,
736 .radio_addr = ADDR_UNSET,
737 .input = {{
738 .type = CX88_VMUX_COMPOSITE1,
739 .vmux = 1,
740 .gpio0 = 0x0700,
741 .gpio2 = 0x0101,
743 .type = CX88_VMUX_SVIDEO,
744 .vmux = 2,
745 .gpio0 = 0x0700,
746 .gpio2 = 0x0101,
748 .dvb = 1,
750 [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
751 .name = "TerraTec Cinergy 1400 DVB-T",
752 .tuner_type = TUNER_ABSENT,
753 .input = {{
754 .type = CX88_VMUX_DVB,
755 .vmux = 0,
757 .dvb = 1,
759 [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
760 .name = "DViCO FusionHDTV 5 Gold",
761 .tuner_type = TUNER_LG_TDVS_H062F,
762 .radio_type = UNSET,
763 .tuner_addr = ADDR_UNSET,
764 .radio_addr = ADDR_UNSET,
765 .tda9887_conf = TDA9887_PRESENT,
766 .input = {{
767 .type = CX88_VMUX_TELEVISION,
768 .vmux = 0,
769 .gpio0 = 0x87fd,
771 .type = CX88_VMUX_COMPOSITE1,
772 .vmux = 1,
773 .gpio0 = 0x87f9,
775 .type = CX88_VMUX_SVIDEO,
776 .vmux = 2,
777 .gpio0 = 0x87f9,
779 .dvb = 1,
781 [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
782 .name = "AverMedia UltraTV Media Center PCI 550",
783 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
784 .radio_type = UNSET,
785 .tuner_addr = ADDR_UNSET,
786 .radio_addr = ADDR_UNSET,
787 .tda9887_conf = TDA9887_PRESENT,
788 .blackbird = 1,
789 .input = {{
790 .type = CX88_VMUX_COMPOSITE1,
791 .vmux = 0,
792 .gpio0 = 0x0000cd73,
794 .type = CX88_VMUX_SVIDEO,
795 .vmux = 1,
796 .gpio0 = 0x0000cd73,
798 .type = CX88_VMUX_TELEVISION,
799 .vmux = 3,
800 .gpio0 = 0x0000cdb3,
802 .radio = {
803 .type = CX88_RADIO,
804 .vmux = 2,
805 .gpio0 = 0x0000cdf3,
808 [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = {
809 /* Alexander Wold <awold@bigfoot.com> */
810 .name = "Kworld V-Stream Xpert DVD",
811 .tuner_type = UNSET,
812 .input = {{
813 .type = CX88_VMUX_COMPOSITE1,
814 .vmux = 1,
815 .gpio0 = 0x03000000,
816 .gpio1 = 0x01000000,
817 .gpio2 = 0x02000000,
818 .gpio3 = 0x00100000,
820 .type = CX88_VMUX_SVIDEO,
821 .vmux = 2,
822 .gpio0 = 0x03000000,
823 .gpio1 = 0x01000000,
824 .gpio2 = 0x02000000,
825 .gpio3 = 0x00100000,
828 [CX88_BOARD_ATI_HDTVWONDER] = {
829 .name = "ATI HDTV Wonder",
830 .tuner_type = TUNER_PHILIPS_TUV1236D,
831 .radio_type = UNSET,
832 .tuner_addr = ADDR_UNSET,
833 .radio_addr = ADDR_UNSET,
834 .input = {{
835 .type = CX88_VMUX_TELEVISION,
836 .vmux = 0,
837 .gpio0 = 0x00000ff7,
838 .gpio1 = 0x000000ff,
839 .gpio2 = 0x00000001,
840 .gpio3 = 0x00000000,
842 .type = CX88_VMUX_COMPOSITE1,
843 .vmux = 1,
844 .gpio0 = 0x00000ffe,
845 .gpio1 = 0x000000ff,
846 .gpio2 = 0x00000001,
847 .gpio3 = 0x00000000,
849 .type = CX88_VMUX_SVIDEO,
850 .vmux = 2,
851 .gpio0 = 0x00000ffe,
852 .gpio1 = 0x000000ff,
853 .gpio2 = 0x00000001,
854 .gpio3 = 0x00000000,
856 .dvb = 1,
858 [CX88_BOARD_WINFAST_DTV1000] = {
859 .name = "WinFast DTV1000-T",
860 .tuner_type = TUNER_ABSENT,
861 .radio_type = UNSET,
862 .tuner_addr = ADDR_UNSET,
863 .radio_addr = ADDR_UNSET,
864 .input = {{
865 .type = CX88_VMUX_DVB,
866 .vmux = 0,
868 .dvb = 1,
870 [CX88_BOARD_AVERTV_303] = {
871 .name = "AVerTV 303 (M126)",
872 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
873 .radio_type = UNSET,
874 .tuner_addr = ADDR_UNSET,
875 .radio_addr = ADDR_UNSET,
876 .tda9887_conf = TDA9887_PRESENT,
877 .input = {{
878 .type = CX88_VMUX_TELEVISION,
879 .vmux = 0,
880 .gpio0 = 0x00ff,
881 .gpio1 = 0xe09f,
882 .gpio2 = 0x0010,
883 .gpio3 = 0x0000,
885 .type = CX88_VMUX_COMPOSITE1,
886 .vmux = 1,
887 .gpio0 = 0x00ff,
888 .gpio1 = 0xe05f,
889 .gpio2 = 0x0010,
890 .gpio3 = 0x0000,
892 .type = CX88_VMUX_SVIDEO,
893 .vmux = 2,
894 .gpio0 = 0x00ff,
895 .gpio1 = 0xe05f,
896 .gpio2 = 0x0010,
897 .gpio3 = 0x0000,
901 const unsigned int cx88_bcount = ARRAY_SIZE(cx88_boards);
903 /* ------------------------------------------------------------------ */
904 /* PCI subsystem IDs */
906 struct cx88_subid cx88_subids[] = {
908 .subvendor = 0x0070,
909 .subdevice = 0x3400,
910 .card = CX88_BOARD_HAUPPAUGE,
912 .subvendor = 0x0070,
913 .subdevice = 0x3401,
914 .card = CX88_BOARD_HAUPPAUGE,
916 .subvendor = 0x14c7,
917 .subdevice = 0x0106,
918 .card = CX88_BOARD_GDI,
920 .subvendor = 0x14c7,
921 .subdevice = 0x0107, /* with mpeg encoder */
922 .card = CX88_BOARD_GDI,
924 .subvendor = PCI_VENDOR_ID_ATI,
925 .subdevice = 0x00f8,
926 .card = CX88_BOARD_ATI_WONDER_PRO,
928 .subvendor = 0x107d,
929 .subdevice = 0x6611,
930 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
932 .subvendor = 0x107d,
933 .subdevice = 0x6613, /* NTSC */
934 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
936 .subvendor = 0x107d,
937 .subdevice = 0x6620,
938 .card = CX88_BOARD_WINFAST_DV2000,
940 .subvendor = 0x107d,
941 .subdevice = 0x663b,
942 .card = CX88_BOARD_LEADTEK_PVR2000,
944 .subvendor = 0x107d,
945 .subdevice = 0x663C,
946 .card = CX88_BOARD_LEADTEK_PVR2000,
948 .subvendor = 0x1461,
949 .subdevice = 0x000b,
950 .card = CX88_BOARD_AVERTV_STUDIO_303,
952 .subvendor = 0x1462,
953 .subdevice = 0x8606,
954 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
956 .subvendor = 0x10fc,
957 .subdevice = 0xd003,
958 .card = CX88_BOARD_IODATA_GVVCP3PCI,
960 .subvendor = 0x1043,
961 .subdevice = 0x4823, /* with mpeg encoder */
962 .card = CX88_BOARD_ASUS_PVR_416,
964 .subvendor = 0x17de,
965 .subdevice = 0x08a6,
966 .card = CX88_BOARD_KWORLD_DVB_T,
968 .subvendor = 0x18ac,
969 .subdevice = 0xd810,
970 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
972 .subvendor = 0x18ac,
973 .subdevice = 0xd820,
974 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
976 .subvendor = 0x18ac,
977 .subdevice = 0xdb00,
978 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
980 .subvendor = 0x0070,
981 .subdevice = 0x9002,
982 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
984 .subvendor = 0x14f1,
985 .subdevice = 0x0187,
986 .card = CX88_BOARD_CONEXANT_DVB_T1,
988 .subvendor = 0x1540,
989 .subdevice = 0x2580,
990 .card = CX88_BOARD_PROVIDEO_PV259,
992 .subvendor = 0x18ac,
993 .subdevice = 0xdb10,
994 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
996 .subvendor = 0x1554,
997 .subdevice = 0x4811,
998 .card = CX88_BOARD_PIXELVIEW,
1000 .subvendor = 0x7063,
1001 .subdevice = 0x3000, /* HD-3000 card */
1002 .card = CX88_BOARD_PCHDTV_HD3000,
1004 .subvendor = 0x17de,
1005 .subdevice = 0xa8a6,
1006 .card = CX88_BOARD_DNTV_LIVE_DVB_T,
1008 .subvendor = 0x0070,
1009 .subdevice = 0x2801,
1010 .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
1012 .subvendor = 0x14f1,
1013 .subdevice = 0x0342,
1014 .card = CX88_BOARD_DIGITALLOGIC_MEC,
1016 .subvendor = 0x10fc,
1017 .subdevice = 0xd035,
1018 .card = CX88_BOARD_IODATA_GVBCTV7E,
1020 .subvendor = 0x1421,
1021 .subdevice = 0x0334,
1022 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
1024 .subvendor = 0x153b,
1025 .subdevice = 0x1166,
1026 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
1028 .subvendor = 0x18ac,
1029 .subdevice = 0xd500,
1030 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
1032 .subvendor = 0x1461,
1033 .subdevice = 0x8011,
1034 .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550,
1036 .subvendor = PCI_VENDOR_ID_ATI,
1037 .subdevice = 0xa101,
1038 .card = CX88_BOARD_ATI_HDTVWONDER,
1040 .subvendor = 0x107d,
1041 .subdevice = 0x665f,
1042 .card = CX88_BOARD_WINFAST_DTV1000,
1044 .subvendor = 0x1461,
1045 .subdevice = 0x000a,
1046 .card = CX88_BOARD_AVERTV_303,
1049 const unsigned int cx88_idcount = ARRAY_SIZE(cx88_subids);
1051 /* ----------------------------------------------------------------------- */
1052 /* some leadtek specific stuff */
1054 static void __devinit leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
1056 /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
1057 * any others.
1059 * Byte 0 is 1 on the NTSC board.
1062 if (eeprom_data[4] != 0x7d ||
1063 eeprom_data[5] != 0x10 ||
1064 eeprom_data[7] != 0x66) {
1065 printk(KERN_WARNING "%s: Leadtek eeprom invalid.\n",
1066 core->name);
1067 return;
1070 core->has_radio = 1;
1071 core->tuner_type = (eeprom_data[6] == 0x13) ? 43 : 38;
1073 printk(KERN_INFO "%s: Leadtek Winfast 2000XP Expert config: "
1074 "tuner=%d, eeprom[0]=0x%02x\n",
1075 core->name, core->tuner_type, eeprom_data[0]);
1079 /* ----------------------------------------------------------------------- */
1081 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
1083 struct tveeprom tv;
1085 tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
1086 core->tuner_type = tv.tuner_type;
1087 core->has_radio = tv.has_radio;
1089 /* Make sure we support the board model */
1090 switch (tv.model)
1092 case 90002: /* Nova-T-PCI (9002) */
1093 case 92001: /* Nova-S-Plus (Video and IR) */
1094 case 92002: /* Nova-S-Plus (Video and IR) */
1095 case 90003: /* Nova-T-PCI (9002 No RF out) */
1096 case 90500: /* Nova-T-PCI (oem) */
1097 case 90501: /* Nova-T-PCI (oem/IR) */
1098 case 92000: /* Nova-SE2 (OEM, No Video or IR) */
1100 /* known */
1101 break;
1102 default:
1103 printk("%s: warning: unknown hauppauge model #%d\n",
1104 core->name, tv.model);
1105 break;
1108 printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
1109 core->name, tv.model);
1112 /* ----------------------------------------------------------------------- */
1113 /* some GDI (was: Modular Technology) specific stuff */
1115 static struct {
1116 int id;
1117 int fm;
1118 char *name;
1119 } gdi_tuner[] = {
1120 [ 0x01 ] = { .id = TUNER_ABSENT,
1121 .name = "NTSC_M" },
1122 [ 0x02 ] = { .id = TUNER_ABSENT,
1123 .name = "PAL_B" },
1124 [ 0x03 ] = { .id = TUNER_ABSENT,
1125 .name = "PAL_I" },
1126 [ 0x04 ] = { .id = TUNER_ABSENT,
1127 .name = "PAL_D" },
1128 [ 0x05 ] = { .id = TUNER_ABSENT,
1129 .name = "SECAM" },
1131 [ 0x10 ] = { .id = TUNER_ABSENT,
1132 .fm = 1,
1133 .name = "TEMIC_4049" },
1134 [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
1135 .name = "TEMIC_4136" },
1136 [ 0x12 ] = { .id = TUNER_ABSENT,
1137 .name = "TEMIC_4146" },
1139 [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
1140 .fm = 1,
1141 .name = "PHILIPS_FQ1216_MK3" },
1142 [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
1143 .name = "PHILIPS_FQ1236_MK3" },
1144 [ 0x22 ] = { .id = TUNER_ABSENT,
1145 .name = "PHILIPS_FI1236_MK3" },
1146 [ 0x23 ] = { .id = TUNER_ABSENT,
1147 .name = "PHILIPS_FI1216_MK3" },
1150 static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
1152 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
1153 ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
1155 printk(KERN_INFO "%s: GDI: tuner=%s\n", core->name,
1156 name ? name : "unknown");
1157 if (NULL == name)
1158 return;
1159 core->tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
1160 core->has_radio = gdi_tuner[eeprom_data[0x0d]].fm;
1163 /* ----------------------------------------------------------------------- */
1165 void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
1167 int i;
1169 if (0 == pci->subsystem_vendor &&
1170 0 == pci->subsystem_device) {
1171 printk("%s: Your board has no valid PCI Subsystem ID and thus can't\n"
1172 "%s: be autodetected. Please pass card=<n> insmod option to\n"
1173 "%s: workaround that. Redirect complaints to the vendor of\n"
1174 "%s: the TV card. Best regards,\n"
1175 "%s: -- tux\n",
1176 core->name,core->name,core->name,core->name,core->name);
1177 } else {
1178 printk("%s: Your board isn't known (yet) to the driver. You can\n"
1179 "%s: try to pick one of the existing card configs via\n"
1180 "%s: card=<n> insmod option. Updating to the latest\n"
1181 "%s: version might help as well.\n",
1182 core->name,core->name,core->name,core->name);
1184 printk("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
1185 core->name);
1186 for (i = 0; i < cx88_bcount; i++)
1187 printk("%s: card=%d -> %s\n",
1188 core->name, i, cx88_boards[i].name);
1191 void cx88_card_setup(struct cx88_core *core)
1193 static u8 eeprom[256];
1195 if (0 == core->i2c_rc) {
1196 core->i2c_client.addr = 0xa0 >> 1;
1197 tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
1200 switch (core->board) {
1201 case CX88_BOARD_HAUPPAUGE:
1202 case CX88_BOARD_HAUPPAUGE_ROSLYN:
1203 if (0 == core->i2c_rc)
1204 hauppauge_eeprom(core,eeprom+8);
1205 break;
1206 case CX88_BOARD_GDI:
1207 if (0 == core->i2c_rc)
1208 gdi_eeprom(core,eeprom);
1209 break;
1210 case CX88_BOARD_WINFAST2000XP_EXPERT:
1211 if (0 == core->i2c_rc)
1212 leadtek_eeprom(core,eeprom);
1213 break;
1214 case CX88_BOARD_HAUPPAUGE_DVB_T1:
1215 if (0 == core->i2c_rc)
1216 hauppauge_eeprom(core,eeprom);
1217 break;
1218 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
1219 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
1220 /* GPIO0:0 is hooked to mt352 reset pin */
1221 cx_set(MO_GP0_IO, 0x00000101);
1222 cx_clear(MO_GP0_IO, 0x00000001);
1223 msleep(1);
1224 cx_set(MO_GP0_IO, 0x00000101);
1225 break;
1226 case CX88_BOARD_KWORLD_DVB_T:
1227 case CX88_BOARD_DNTV_LIVE_DVB_T:
1228 cx_set(MO_GP0_IO, 0x00000707);
1229 cx_set(MO_GP2_IO, 0x00000101);
1230 cx_clear(MO_GP2_IO, 0x00000001);
1231 msleep(1);
1232 cx_clear(MO_GP0_IO, 0x00000007);
1233 cx_set(MO_GP2_IO, 0x00000101);
1234 break;
1235 case CX88_BOARD_ATI_HDTVWONDER:
1236 if (0 == core->i2c_rc) {
1237 /* enable tuner */
1238 int i;
1239 u8 buffer [] = { 0x10,0x12,0x13,0x04,0x16,0x00,0x14,0x04,0x017,0x00 };
1240 core->i2c_client.addr = 0x0a;
1242 for (i = 0; i < 5; i++)
1243 if (2 != i2c_master_send(&core->i2c_client,&buffer[i*2],2))
1244 printk(KERN_WARNING "%s: Unable to enable tuner(%i).\n",
1245 core->name, i);
1247 break;
1249 if (cx88_boards[core->board].radio.type == CX88_RADIO)
1250 core->has_radio = 1;
1253 /* ------------------------------------------------------------------ */
1255 EXPORT_SYMBOL(cx88_boards);
1256 EXPORT_SYMBOL(cx88_bcount);
1257 EXPORT_SYMBOL(cx88_subids);
1258 EXPORT_SYMBOL(cx88_idcount);
1259 EXPORT_SYMBOL(cx88_card_list);
1260 EXPORT_SYMBOL(cx88_card_setup);
1263 * Local variables:
1264 * c-basic-offset: 8
1265 * End:
1266 * 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