3 * device driver for Conexant 2388x based TV cards
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>
31 static unsigned int tuner[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
32 static unsigned int radio[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
33 static unsigned int card[] = {[0 ... (CX88_MAXBOARDS - 1)] = UNSET };
35 module_param_array(tuner, int, NULL, 0444);
36 module_param_array(radio, int, NULL, 0444);
37 module_param_array(card, int, NULL, 0444);
39 MODULE_PARM_DESC(tuner,"tuner type");
40 MODULE_PARM_DESC(radio,"radio tuner type");
41 MODULE_PARM_DESC(card,"card type");
43 static unsigned int latency = UNSET;
44 module_param(latency,int,0444);
45 MODULE_PARM_DESC(latency,"pci latency timer");
47 #define info_printk(core, fmt, arg...) \
48 printk(KERN_INFO "%s: " fmt, core->name , ## arg)
50 #define warn_printk(core, fmt, arg...) \
51 printk(KERN_WARNING "%s: " fmt, core->name , ## arg)
53 #define err_printk(core, fmt, arg...) \
54 printk(KERN_ERR "%s: " fmt, core->name , ## arg)
57 /* ------------------------------------------------------------------ */
58 /* board config info */
60 static const struct cx88_board cx88_boards[] = {
61 [CX88_BOARD_UNKNOWN] = {
62 .name = "UNKNOWN/GENERIC",
65 .tuner_addr = ADDR_UNSET,
66 .radio_addr = ADDR_UNSET,
68 .type = CX88_VMUX_COMPOSITE1,
71 .type = CX88_VMUX_COMPOSITE2,
74 .type = CX88_VMUX_COMPOSITE3,
77 .type = CX88_VMUX_COMPOSITE4,
81 [CX88_BOARD_HAUPPAUGE] = {
82 .name = "Hauppauge WinTV 34xxx models",
85 .tuner_addr = ADDR_UNSET,
86 .radio_addr = ADDR_UNSET,
87 .tda9887_conf = TDA9887_PRESENT,
89 .type = CX88_VMUX_TELEVISION,
91 .gpio0 = 0xff00, // internal decoder
93 .type = CX88_VMUX_DEBUG,
95 .gpio0 = 0xff01, // mono from tuner chip
97 .type = CX88_VMUX_COMPOSITE1,
101 .type = CX88_VMUX_SVIDEO,
111 .name = "GDI Black Gold",
114 .tuner_addr = ADDR_UNSET,
115 .radio_addr = ADDR_UNSET,
117 .type = CX88_VMUX_TELEVISION,
120 .type = CX88_VMUX_SVIDEO,
124 [CX88_BOARD_PIXELVIEW] = {
126 .tuner_type = TUNER_PHILIPS_PAL,
128 .tuner_addr = ADDR_UNSET,
129 .radio_addr = ADDR_UNSET,
131 .type = CX88_VMUX_TELEVISION,
133 .gpio0 = 0xff00, // internal decoder
135 .type = CX88_VMUX_COMPOSITE1,
138 .type = CX88_VMUX_SVIDEO,
146 [CX88_BOARD_ATI_WONDER_PRO] = {
147 .name = "ATI TV Wonder Pro",
148 .tuner_type = TUNER_PHILIPS_4IN1,
150 .tuner_addr = ADDR_UNSET,
151 .radio_addr = ADDR_UNSET,
152 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER,
154 .type = CX88_VMUX_TELEVISION,
158 .type = CX88_VMUX_COMPOSITE1,
162 .type = CX88_VMUX_SVIDEO,
167 [CX88_BOARD_WINFAST2000XP_EXPERT] = {
168 .name = "Leadtek Winfast 2000XP Expert",
169 .tuner_type = TUNER_PHILIPS_4IN1,
171 .tuner_addr = ADDR_UNSET,
172 .radio_addr = ADDR_UNSET,
173 .tda9887_conf = TDA9887_PRESENT,
175 .type = CX88_VMUX_TELEVISION,
182 .type = CX88_VMUX_COMPOSITE1,
189 .type = CX88_VMUX_SVIDEO,
204 [CX88_BOARD_AVERTV_STUDIO_303] = {
205 .name = "AverTV Studio 303 (M126)",
206 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
208 .tuner_addr = ADDR_UNSET,
209 .radio_addr = ADDR_UNSET,
210 .tda9887_conf = TDA9887_PRESENT,
212 .type = CX88_VMUX_TELEVISION,
216 .type = CX88_VMUX_COMPOSITE1,
220 .type = CX88_VMUX_SVIDEO,
229 [CX88_BOARD_MSI_TVANYWHERE_MASTER] = {
230 // added gpio values thanks to Michal
231 // values for PAL from DScaler
232 .name = "MSI TV-@nywhere Master",
233 .tuner_type = TUNER_MT2032,
235 .tuner_addr = ADDR_UNSET,
236 .radio_addr = ADDR_UNSET,
237 .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER_NTSC,
239 .type = CX88_VMUX_TELEVISION,
245 .type = CX88_VMUX_COMPOSITE1,
251 .type = CX88_VMUX_SVIDEO,
265 [CX88_BOARD_WINFAST_DV2000] = {
266 .name = "Leadtek Winfast DV2000",
267 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
269 .tuner_addr = ADDR_UNSET,
270 .radio_addr = ADDR_UNSET,
271 .tda9887_conf = TDA9887_PRESENT,
273 .type = CX88_VMUX_TELEVISION,
281 .type = CX88_VMUX_COMPOSITE1,
288 .type = CX88_VMUX_SVIDEO,
303 [CX88_BOARD_LEADTEK_PVR2000] = {
304 // gpio values for PAL version from regspy by DScaler
305 .name = "Leadtek PVR 2000",
306 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
308 .tuner_addr = ADDR_UNSET,
309 .radio_addr = ADDR_UNSET,
310 .tda9887_conf = TDA9887_PRESENT,
312 .type = CX88_VMUX_TELEVISION,
317 .type = CX88_VMUX_COMPOSITE1,
322 .type = CX88_VMUX_SVIDEO,
332 .mpeg = CX88_MPEG_BLACKBIRD,
334 [CX88_BOARD_IODATA_GVVCP3PCI] = {
335 .name = "IODATA GV-VCP3/PCI",
336 .tuner_type = TUNER_ABSENT,
338 .tuner_addr = ADDR_UNSET,
339 .radio_addr = ADDR_UNSET,
341 .type = CX88_VMUX_COMPOSITE1,
344 .type = CX88_VMUX_COMPOSITE2,
347 .type = CX88_VMUX_SVIDEO,
351 [CX88_BOARD_PROLINK_PLAYTVPVR] = {
352 .name = "Prolink PlayTV PVR",
353 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
355 .tuner_addr = ADDR_UNSET,
356 .radio_addr = ADDR_UNSET,
357 .tda9887_conf = TDA9887_PRESENT,
359 .type = CX88_VMUX_TELEVISION,
363 .type = CX88_VMUX_COMPOSITE1,
367 .type = CX88_VMUX_SVIDEO,
376 [CX88_BOARD_ASUS_PVR_416] = {
377 .name = "ASUS PVR-416",
378 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
380 .tuner_addr = ADDR_UNSET,
381 .radio_addr = ADDR_UNSET,
382 .tda9887_conf = TDA9887_PRESENT,
384 .type = CX88_VMUX_TELEVISION,
388 .type = CX88_VMUX_SVIDEO,
390 .gpio0 = 0x0000fde6, // 0x0000fda6 L,R RCA audio in?
397 .mpeg = CX88_MPEG_BLACKBIRD,
399 [CX88_BOARD_MSI_TVANYWHERE] = {
400 .name = "MSI TV-@nywhere",
401 .tuner_type = TUNER_MT2032,
403 .tuner_addr = ADDR_UNSET,
404 .radio_addr = ADDR_UNSET,
405 .tda9887_conf = TDA9887_PRESENT,
407 .type = CX88_VMUX_TELEVISION,
412 .type = CX88_VMUX_COMPOSITE1,
417 .type = CX88_VMUX_SVIDEO,
423 [CX88_BOARD_KWORLD_DVB_T] = {
424 .name = "KWorld/VStream XPert DVB-T",
425 .tuner_type = TUNER_ABSENT,
427 .tuner_addr = ADDR_UNSET,
428 .radio_addr = ADDR_UNSET,
430 .type = CX88_VMUX_COMPOSITE1,
435 .type = CX88_VMUX_SVIDEO,
440 .mpeg = CX88_MPEG_DVB,
442 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1] = {
443 .name = "DViCO FusionHDTV DVB-T1",
444 .tuner_type = TUNER_ABSENT, /* No analog tuner */
446 .tuner_addr = ADDR_UNSET,
447 .radio_addr = ADDR_UNSET,
449 .type = CX88_VMUX_COMPOSITE1,
453 .type = CX88_VMUX_SVIDEO,
457 .mpeg = CX88_MPEG_DVB,
459 [CX88_BOARD_KWORLD_LTV883] = {
460 .name = "KWorld LTV883RF",
461 .tuner_type = TUNER_TNF_8831BGFF,
463 .tuner_addr = ADDR_UNSET,
464 .radio_addr = ADDR_UNSET,
466 .type = CX88_VMUX_TELEVISION,
470 .type = CX88_VMUX_DEBUG,
472 .gpio0 = 0x07f9, // mono from tuner chip
474 .type = CX88_VMUX_COMPOSITE1,
478 .type = CX88_VMUX_SVIDEO,
487 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q] = {
488 .name = "DViCO FusionHDTV 3 Gold-Q",
489 .tuner_type = TUNER_MICROTUNE_4042FI5,
491 .tuner_addr = ADDR_UNSET,
492 .radio_addr = ADDR_UNSET,
494 GPIO[0] resets DT3302 DTV receiver
497 GPIO[1] mutes analog audio output connector
498 0 - enable selected source
500 GPIO[2] selects source for analog audio output connector
501 0 - analog audio input connector on tab
502 1 - analog DAC output from CX23881 chip
503 GPIO[3] selects RF input connector on tuner module
504 0 - RF connector labeled CABLE
505 1 - RF connector labeled ANT
506 GPIO[4] selects high RF for QAM256 mode
511 .type = CX88_VMUX_TELEVISION,
515 .type = CX88_VMUX_CABLE,
519 .type = CX88_VMUX_COMPOSITE1,
523 .type = CX88_VMUX_SVIDEO,
527 .mpeg = CX88_MPEG_DVB,
529 [CX88_BOARD_HAUPPAUGE_DVB_T1] = {
530 .name = "Hauppauge Nova-T DVB-T",
531 .tuner_type = TUNER_ABSENT,
533 .tuner_addr = ADDR_UNSET,
534 .radio_addr = ADDR_UNSET,
536 .type = CX88_VMUX_DVB,
539 .mpeg = CX88_MPEG_DVB,
541 [CX88_BOARD_CONEXANT_DVB_T1] = {
542 .name = "Conexant DVB-T reference design",
543 .tuner_type = TUNER_ABSENT,
545 .tuner_addr = ADDR_UNSET,
546 .radio_addr = ADDR_UNSET,
548 .type = CX88_VMUX_DVB,
551 .mpeg = CX88_MPEG_DVB,
553 [CX88_BOARD_PROVIDEO_PV259] = {
554 .name = "Provideo PV259",
555 .tuner_type = TUNER_PHILIPS_FQ1216ME,
557 .tuner_addr = ADDR_UNSET,
558 .radio_addr = ADDR_UNSET,
560 .type = CX88_VMUX_TELEVISION,
564 .mpeg = CX88_MPEG_BLACKBIRD,
566 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS] = {
567 .name = "DViCO FusionHDTV DVB-T Plus",
568 .tuner_type = TUNER_ABSENT, /* No analog tuner */
570 .tuner_addr = ADDR_UNSET,
571 .radio_addr = ADDR_UNSET,
573 .type = CX88_VMUX_COMPOSITE1,
577 .type = CX88_VMUX_SVIDEO,
581 .mpeg = CX88_MPEG_DVB,
583 [CX88_BOARD_DNTV_LIVE_DVB_T] = {
584 .name = "digitalnow DNTV Live! DVB-T",
585 .tuner_type = TUNER_ABSENT,
587 .tuner_addr = ADDR_UNSET,
588 .radio_addr = ADDR_UNSET,
590 .type = CX88_VMUX_COMPOSITE1,
595 .type = CX88_VMUX_SVIDEO,
600 .mpeg = CX88_MPEG_DVB,
602 [CX88_BOARD_PCHDTV_HD3000] = {
603 .name = "pcHDTV HD3000 HDTV",
604 .tuner_type = TUNER_THOMSON_DTT761X,
606 .tuner_addr = ADDR_UNSET,
607 .radio_addr = ADDR_UNSET,
608 .tda9887_conf = TDA9887_PRESENT,
609 /* GPIO[2] = audio source for analog audio out connector
610 * 0 = analog audio input connector
611 * 1 = CX88 audio DACs
613 * GPIO[7] = input to CX88's audio/chroma ADC
615 * 1 = Sound 4.5 MHz IF
617 * GPIO[1,5,6] = Oren 51132 pins 27,35,28 respectively
619 * GPIO[16] = Remote control input
622 .type = CX88_VMUX_TELEVISION,
626 .type = CX88_VMUX_COMPOSITE1,
630 .type = CX88_VMUX_SVIDEO,
638 .mpeg = CX88_MPEG_DVB,
640 [CX88_BOARD_HAUPPAUGE_ROSLYN] = {
641 // entry added by Kaustubh D. Bhalerao <bhalerao.1@osu.edu>
642 // GPIO values obtained from regspy, courtesy Sean Covel
643 .name = "Hauppauge WinTV 28xxx (Roslyn) models",
646 .tuner_addr = ADDR_UNSET,
647 .radio_addr = ADDR_UNSET,
649 .type = CX88_VMUX_TELEVISION,
654 .type = CX88_VMUX_DEBUG,
658 .type = CX88_VMUX_COMPOSITE1,
662 .type = CX88_VMUX_SVIDEO,
672 .mpeg = CX88_MPEG_BLACKBIRD,
674 [CX88_BOARD_DIGITALLOGIC_MEC] = {
675 .name = "Digital-Logic MICROSPACE Entertainment Center (MEC)",
676 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
678 .tuner_addr = ADDR_UNSET,
679 .radio_addr = ADDR_UNSET,
680 .tda9887_conf = TDA9887_PRESENT,
682 .type = CX88_VMUX_TELEVISION,
687 .type = CX88_VMUX_COMPOSITE1,
692 .type = CX88_VMUX_SVIDEO,
702 .mpeg = CX88_MPEG_BLACKBIRD,
704 [CX88_BOARD_IODATA_GVBCTV7E] = {
705 .name = "IODATA GV/BCTV7E",
706 .tuner_type = TUNER_PHILIPS_FQ1286,
708 .tuner_addr = ADDR_UNSET,
709 .radio_addr = ADDR_UNSET,
710 .tda9887_conf = TDA9887_PRESENT,
712 .type = CX88_VMUX_TELEVISION,
716 .type = CX88_VMUX_COMPOSITE1,
720 .type = CX88_VMUX_SVIDEO,
725 [CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO] = {
726 .name = "PixelView PlayTV Ultra Pro (Stereo)",
727 /* May be also TUNER_YMEC_TVF_5533MF for NTSC/M or PAL/M */
728 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
730 .tuner_addr = ADDR_UNSET,
731 .radio_addr = ADDR_UNSET,
733 .type = CX88_VMUX_TELEVISION,
735 .gpio0 = 0xbf61, /* internal decoder */
737 .type = CX88_VMUX_COMPOSITE1,
741 .type = CX88_VMUX_SVIDEO,
750 [CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T] = {
751 .name = "DViCO FusionHDTV 3 Gold-T",
752 .tuner_type = TUNER_THOMSON_DTT761X,
754 .tuner_addr = ADDR_UNSET,
755 .radio_addr = ADDR_UNSET,
756 .tda9887_conf = TDA9887_PRESENT,
758 .type = CX88_VMUX_TELEVISION,
762 .type = CX88_VMUX_COMPOSITE1,
766 .type = CX88_VMUX_SVIDEO,
770 .mpeg = CX88_MPEG_DVB,
772 [CX88_BOARD_ADSTECH_DVB_T_PCI] = {
773 .name = "ADS Tech Instant TV DVB-T PCI",
774 .tuner_type = TUNER_ABSENT,
776 .tuner_addr = ADDR_UNSET,
777 .radio_addr = ADDR_UNSET,
779 .type = CX88_VMUX_COMPOSITE1,
784 .type = CX88_VMUX_SVIDEO,
789 .mpeg = CX88_MPEG_DVB,
791 [CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1] = {
792 .name = "TerraTec Cinergy 1400 DVB-T",
793 .tuner_type = TUNER_ABSENT,
795 .type = CX88_VMUX_DVB,
798 .type = CX88_VMUX_COMPOSITE1,
801 .type = CX88_VMUX_SVIDEO,
804 .mpeg = CX88_MPEG_DVB,
806 [CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD] = {
807 .name = "DViCO FusionHDTV 5 Gold",
808 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H062F */
810 .tuner_addr = ADDR_UNSET,
811 .radio_addr = ADDR_UNSET,
812 .tda9887_conf = TDA9887_PRESENT,
814 .type = CX88_VMUX_TELEVISION,
818 .type = CX88_VMUX_COMPOSITE1,
822 .type = CX88_VMUX_SVIDEO,
826 .mpeg = CX88_MPEG_DVB,
828 [CX88_BOARD_AVERMEDIA_ULTRATV_MC_550] = {
829 .name = "AverMedia UltraTV Media Center PCI 550",
830 .tuner_type = TUNER_PHILIPS_FM1236_MK3,
832 .tuner_addr = ADDR_UNSET,
833 .radio_addr = ADDR_UNSET,
834 .tda9887_conf = TDA9887_PRESENT,
836 .type = CX88_VMUX_COMPOSITE1,
841 .type = CX88_VMUX_SVIDEO,
846 .type = CX88_VMUX_TELEVISION,
857 .mpeg = CX88_MPEG_BLACKBIRD,
859 [CX88_BOARD_KWORLD_VSTREAM_EXPERT_DVD] = {
860 /* Alexander Wold <awold@bigfoot.com> */
861 .name = "Kworld V-Stream Xpert DVD",
864 .type = CX88_VMUX_COMPOSITE1,
871 .type = CX88_VMUX_SVIDEO,
879 [CX88_BOARD_ATI_HDTVWONDER] = {
880 .name = "ATI HDTV Wonder",
881 .tuner_type = TUNER_PHILIPS_TUV1236D,
883 .tuner_addr = ADDR_UNSET,
884 .radio_addr = ADDR_UNSET,
886 .type = CX88_VMUX_TELEVISION,
893 .type = CX88_VMUX_COMPOSITE1,
900 .type = CX88_VMUX_SVIDEO,
907 .mpeg = CX88_MPEG_DVB,
909 [CX88_BOARD_WINFAST_DTV1000] = {
910 .name = "WinFast DTV1000-T",
911 .tuner_type = TUNER_ABSENT,
913 .tuner_addr = ADDR_UNSET,
914 .radio_addr = ADDR_UNSET,
916 .type = CX88_VMUX_DVB,
919 .type = CX88_VMUX_COMPOSITE1,
922 .type = CX88_VMUX_SVIDEO,
925 .mpeg = CX88_MPEG_DVB,
927 [CX88_BOARD_AVERTV_303] = {
928 .name = "AVerTV 303 (M126)",
929 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
931 .tuner_addr = ADDR_UNSET,
932 .radio_addr = ADDR_UNSET,
933 .tda9887_conf = TDA9887_PRESENT,
935 .type = CX88_VMUX_TELEVISION,
942 .type = CX88_VMUX_COMPOSITE1,
949 .type = CX88_VMUX_SVIDEO,
957 [CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1] = {
958 .name = "Hauppauge Nova-S-Plus DVB-S",
959 .tuner_type = TUNER_ABSENT,
961 .tuner_addr = ADDR_UNSET,
962 .radio_addr = ADDR_UNSET,
964 .type = CX88_VMUX_DVB,
967 .type = CX88_VMUX_COMPOSITE1,
970 .type = CX88_VMUX_SVIDEO,
973 .mpeg = CX88_MPEG_DVB,
975 [CX88_BOARD_HAUPPAUGE_NOVASE2_S1] = {
976 .name = "Hauppauge Nova-SE2 DVB-S",
977 .tuner_type = TUNER_ABSENT,
979 .tuner_addr = ADDR_UNSET,
980 .radio_addr = ADDR_UNSET,
982 .type = CX88_VMUX_DVB,
985 .mpeg = CX88_MPEG_DVB,
987 [CX88_BOARD_KWORLD_DVBS_100] = {
988 .name = "KWorld DVB-S 100",
989 .tuner_type = TUNER_ABSENT,
991 .tuner_addr = ADDR_UNSET,
992 .radio_addr = ADDR_UNSET,
994 .type = CX88_VMUX_DVB,
997 .type = CX88_VMUX_COMPOSITE1,
1000 .type = CX88_VMUX_SVIDEO,
1003 .mpeg = CX88_MPEG_DVB,
1005 [CX88_BOARD_HAUPPAUGE_HVR1100] = {
1006 .name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid",
1007 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1008 .radio_type = UNSET,
1009 .tuner_addr = ADDR_UNSET,
1010 .radio_addr = ADDR_UNSET,
1011 .tda9887_conf = TDA9887_PRESENT,
1013 .type = CX88_VMUX_TELEVISION,
1016 .type = CX88_VMUX_COMPOSITE1,
1019 .type = CX88_VMUX_SVIDEO,
1022 /* fixme: Add radio support */
1023 .mpeg = CX88_MPEG_DVB,
1025 [CX88_BOARD_HAUPPAUGE_HVR1100LP] = {
1026 .name = "Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profile)",
1027 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1028 .radio_type = UNSET,
1029 .tuner_addr = ADDR_UNSET,
1030 .radio_addr = ADDR_UNSET,
1031 .tda9887_conf = TDA9887_PRESENT,
1033 .type = CX88_VMUX_TELEVISION,
1036 .type = CX88_VMUX_COMPOSITE1,
1039 /* fixme: Add radio support */
1040 .mpeg = CX88_MPEG_DVB,
1042 [CX88_BOARD_DNTV_LIVE_DVB_T_PRO] = {
1043 .name = "digitalnow DNTV Live! DVB-T Pro",
1044 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1045 .radio_type = UNSET,
1046 .tuner_addr = ADDR_UNSET,
1047 .radio_addr = ADDR_UNSET,
1048 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1049 TDA9887_PORT2_ACTIVE,
1051 .type = CX88_VMUX_TELEVISION,
1055 .type = CX88_VMUX_COMPOSITE1,
1059 .type = CX88_VMUX_SVIDEO,
1067 .mpeg = CX88_MPEG_DVB,
1069 [CX88_BOARD_KWORLD_DVB_T_CX22702] = {
1070 /* Kworld V-stream Xpert DVB-T with Thomson tuner */
1071 /* DTT 7579 Conexant CX22702-19 Conexant CX2388x */
1072 /* Manenti Marco <marco_manenti@colman.it> */
1073 .name = "KWorld/VStream XPert DVB-T with cx22702",
1074 .tuner_type = TUNER_ABSENT,
1075 .radio_type = UNSET,
1076 .tuner_addr = ADDR_UNSET,
1077 .radio_addr = ADDR_UNSET,
1079 .type = CX88_VMUX_COMPOSITE1,
1084 .type = CX88_VMUX_SVIDEO,
1089 .mpeg = CX88_MPEG_DVB,
1091 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL] = {
1092 .name = "DViCO FusionHDTV DVB-T Dual Digital",
1093 .tuner_type = TUNER_ABSENT, /* No analog tuner */
1094 .radio_type = UNSET,
1095 .tuner_addr = ADDR_UNSET,
1096 .radio_addr = ADDR_UNSET,
1098 .type = CX88_VMUX_COMPOSITE1,
1100 .gpio0 = 0x000067df,
1102 .type = CX88_VMUX_SVIDEO,
1104 .gpio0 = 0x000067df,
1106 .mpeg = CX88_MPEG_DVB,
1108 [CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT] = {
1109 .name = "KWorld HardwareMpegTV XPert",
1110 .tuner_type = TUNER_PHILIPS_TDA8290,
1111 .radio_type = UNSET,
1112 .tuner_addr = ADDR_UNSET,
1113 .radio_addr = ADDR_UNSET,
1115 .type = CX88_VMUX_TELEVISION,
1120 .type = CX88_VMUX_COMPOSITE1,
1125 .type = CX88_VMUX_SVIDEO,
1135 .mpeg = CX88_MPEG_BLACKBIRD,
1137 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID] = {
1138 .name = "DViCO FusionHDTV DVB-T Hybrid",
1139 .tuner_type = TUNER_THOMSON_FE6600,
1140 .radio_type = UNSET,
1141 .tuner_addr = ADDR_UNSET,
1142 .radio_addr = ADDR_UNSET,
1144 .type = CX88_VMUX_TELEVISION,
1146 .gpio0 = 0x0000a75f,
1148 .type = CX88_VMUX_COMPOSITE1,
1150 .gpio0 = 0x0000a75b,
1152 .type = CX88_VMUX_SVIDEO,
1154 .gpio0 = 0x0000a75b,
1156 .mpeg = CX88_MPEG_DVB,
1158 [CX88_BOARD_PCHDTV_HD5500] = {
1159 .name = "pcHDTV HD5500 HDTV",
1160 .tuner_type = TUNER_LG_TDVS_H06XF, /* TDVS-H064F */
1161 .radio_type = UNSET,
1162 .tuner_addr = ADDR_UNSET,
1163 .radio_addr = ADDR_UNSET,
1164 .tda9887_conf = TDA9887_PRESENT,
1166 .type = CX88_VMUX_TELEVISION,
1170 .type = CX88_VMUX_COMPOSITE1,
1174 .type = CX88_VMUX_SVIDEO,
1178 .mpeg = CX88_MPEG_DVB,
1180 [CX88_BOARD_KWORLD_MCE200_DELUXE] = {
1181 /* FIXME: tested TV input only, disabled composite,
1182 svideo and radio until they can be tested also. */
1183 .name = "Kworld MCE 200 Deluxe",
1184 .tuner_type = TUNER_TENA_9533_DI,
1185 .radio_type = UNSET,
1186 .tda9887_conf = TDA9887_PRESENT,
1187 .tuner_addr = ADDR_UNSET,
1188 .radio_addr = ADDR_UNSET,
1190 .type = CX88_VMUX_TELEVISION,
1194 .mpeg = CX88_MPEG_BLACKBIRD,
1196 [CX88_BOARD_PIXELVIEW_PLAYTV_P7000] = {
1197 /* FIXME: SVideo, Composite and FM inputs are untested */
1198 .name = "PixelView PlayTV P7000",
1199 .tuner_type = TUNER_PHILIPS_FM1216ME_MK3,
1200 .radio_type = UNSET,
1201 .tuner_addr = ADDR_UNSET,
1202 .radio_addr = ADDR_UNSET,
1203 .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE |
1204 TDA9887_PORT2_ACTIVE,
1206 .type = CX88_VMUX_TELEVISION,
1210 .mpeg = CX88_MPEG_BLACKBIRD,
1212 [CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
1213 .name = "NPG Tech Real TV FM Top 10",
1214 .tuner_type = TUNER_TNF_5335MF, /* Actually a TNF9535 */
1215 .radio_type = UNSET,
1216 .tuner_addr = ADDR_UNSET,
1217 .radio_addr = ADDR_UNSET,
1219 .type = CX88_VMUX_TELEVISION,
1223 .type = CX88_VMUX_COMPOSITE1,
1227 .type = CX88_VMUX_SVIDEO,
1236 [CX88_BOARD_WINFAST_DTV2000H] = {
1237 /* video inputs and radio still in testing */
1238 .name = "WinFast DTV2000 H",
1239 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1240 .radio_type = UNSET,
1241 .tuner_addr = ADDR_UNSET,
1242 .radio_addr = ADDR_UNSET,
1243 .tda9887_conf = TDA9887_PRESENT,
1245 .type = CX88_VMUX_TELEVISION,
1247 .gpio0 = 0x00017304,
1248 .gpio1 = 0x00008203,
1249 .gpio2 = 0x00017304,
1250 .gpio3 = 0x02000000,
1252 .mpeg = CX88_MPEG_DVB,
1254 [CX88_BOARD_GENIATECH_DVBS] = {
1255 .name = "Geniatech DVB-S",
1256 .tuner_type = TUNER_ABSENT,
1257 .radio_type = UNSET,
1258 .tuner_addr = ADDR_UNSET,
1259 .radio_addr = ADDR_UNSET,
1261 .type = CX88_VMUX_DVB,
1264 .type = CX88_VMUX_COMPOSITE1,
1267 .mpeg = CX88_MPEG_DVB,
1269 [CX88_BOARD_HAUPPAUGE_HVR3000] = {
1270 /* FIXME: Add dvb & radio support */
1271 .name = "Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DVB-T",
1272 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1273 .radio_type = UNSET,
1274 .tuner_addr = ADDR_UNSET,
1275 .radio_addr = ADDR_UNSET,
1276 .tda9887_conf = TDA9887_PRESENT,
1278 .type = CX88_VMUX_TELEVISION,
1282 .type = CX88_VMUX_COMPOSITE1,
1286 .type = CX88_VMUX_SVIDEO,
1290 .mpeg = CX88_MPEG_DVB,
1292 [CX88_BOARD_NORWOOD_MICRO] = {
1293 .name = "Norwood Micro TV Tuner",
1294 .tuner_type = TUNER_TNF_5335MF,
1295 .radio_type = UNSET,
1296 .tuner_addr = ADDR_UNSET,
1297 .radio_addr = ADDR_UNSET,
1299 .type = CX88_VMUX_TELEVISION,
1303 .type = CX88_VMUX_COMPOSITE1,
1307 .type = CX88_VMUX_SVIDEO,
1312 [CX88_BOARD_TE_DTV_250_OEM_SWANN] = {
1313 .name = "Shenzhen Tungsten Ages Tech TE-DTV-250 / Swann OEM",
1314 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
1315 .radio_type = UNSET,
1316 .tuner_addr = ADDR_UNSET,
1317 .radio_addr = ADDR_UNSET,
1319 .type = CX88_VMUX_TELEVISION,
1321 .gpio0 = 0x003fffff,
1322 .gpio1 = 0x00e00000,
1323 .gpio2 = 0x003fffff,
1324 .gpio3 = 0x02000000,
1326 .type = CX88_VMUX_COMPOSITE1,
1328 .gpio0 = 0x003fffff,
1329 .gpio1 = 0x00e00000,
1330 .gpio2 = 0x003fffff,
1331 .gpio3 = 0x02000000,
1333 .type = CX88_VMUX_SVIDEO,
1335 .gpio0 = 0x003fffff,
1336 .gpio1 = 0x00e00000,
1337 .gpio2 = 0x003fffff,
1338 .gpio3 = 0x02000000,
1341 [CX88_BOARD_HAUPPAUGE_HVR1300] = {
1342 .name = "Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encoder",
1343 .tuner_type = TUNER_PHILIPS_FMD1216ME_MK3,
1344 .radio_type = UNSET,
1345 .tuner_addr = ADDR_UNSET,
1346 .radio_addr = ADDR_UNSET,
1347 .tda9887_conf = TDA9887_PRESENT,
1348 .audio_chip = AUDIO_CHIP_WM8775,
1350 .type = CX88_VMUX_TELEVISION,
1355 .type = CX88_VMUX_COMPOSITE1,
1360 .type = CX88_VMUX_SVIDEO,
1365 /* fixme: Add radio support */
1366 .mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
1368 [CX88_BOARD_ADSTECH_PTV_390] = {
1369 .name = "ADS Tech Instant Video PCI",
1370 .tuner_type = TUNER_ABSENT,
1371 .radio_type = UNSET,
1372 .tuner_addr = ADDR_UNSET,
1373 .radio_addr = ADDR_UNSET,
1375 .type = CX88_VMUX_DEBUG,
1379 .type = CX88_VMUX_COMPOSITE1,
1383 .type = CX88_VMUX_SVIDEO,
1388 [CX88_BOARD_PINNACLE_PCTV_HD_800i] = {
1389 .name = "Pinnacle PCTV HD 800i",
1390 .tuner_type = TUNER_XC5000,
1391 .radio_type = UNSET,
1392 .tuner_addr = ADDR_UNSET,
1393 .radio_addr = ADDR_UNSET,
1395 .type = CX88_VMUX_TELEVISION,
1400 .type = CX88_VMUX_COMPOSITE1,
1406 .type = CX88_VMUX_SVIDEO,
1412 .mpeg = CX88_MPEG_DVB,
1414 [CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO] = {
1415 .name = "DViCO FusionHDTV 5 PCI nano",
1416 /* xc3008 tuner, digital only for now */
1417 .tuner_type = TUNER_ABSENT,
1418 .radio_type = UNSET,
1419 .tuner_addr = ADDR_UNSET,
1420 .radio_addr = ADDR_UNSET,
1422 .type = CX88_VMUX_TELEVISION,
1424 .gpio0 = 0x000027df, /* Unconfirmed */
1426 .type = CX88_VMUX_COMPOSITE1,
1428 .gpio0 = 0x000027df, /* Unconfirmed */
1431 .type = CX88_VMUX_SVIDEO,
1433 .gpio0 = 0x000027df, /* Unconfirmed */
1436 .mpeg = CX88_MPEG_DVB,
1438 [CX88_BOARD_PINNACLE_HYBRID_PCTV] = {
1439 .name = "Pinnacle Hybrid PCTV",
1440 .tuner_type = TUNER_XC2028,
1443 .type = CX88_VMUX_TELEVISION,
1446 .type = CX88_VMUX_COMPOSITE1,
1449 .type = CX88_VMUX_SVIDEO,
1459 [CX88_BOARD_WINFAST_TV2000_XP_GLOBAL] = {
1460 .name = "Winfast TV2000 XP Global",
1461 .tuner_type = TUNER_XC2028,
1464 .type = CX88_VMUX_TELEVISION,
1466 .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */
1468 .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */
1471 .type = CX88_VMUX_COMPOSITE1,
1473 .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */
1475 .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */
1478 .type = CX88_VMUX_SVIDEO,
1488 [CX88_BOARD_POWERCOLOR_REAL_ANGEL] = {
1489 .name = "PowerColor Real Angel 330",
1490 .tuner_type = TUNER_XC2028,
1493 .type = CX88_VMUX_TELEVISION,
1495 .gpio0 = 0x0400, /* pin 2:mute = 0 (off?) */
1497 .gpio2 = 0x0800, /* pin 19:audio = 0 (tv) */
1499 .type = CX88_VMUX_COMPOSITE1,
1501 .gpio0 = 0x0400, /* probably? or 0x0404 to turn mute on */
1503 .gpio2 = 0x0808, /* pin 19:audio = 1 (line) */
1505 .type = CX88_VMUX_SVIDEO,
1520 [CX88_BOARD_GENIATECH_X8000_MT] = {
1521 /* Also PowerColor Real Angel 330 and Geniatech X800 OEM */
1522 .name = "Geniatech X8000-MT DVBT",
1523 .tuner_type = TUNER_XC2028,
1526 .type = CX88_VMUX_TELEVISION,
1528 .gpio0 = 0x00000000,
1529 .gpio1 = 0x00e3e341,
1530 .gpio2 = 0x00000000,
1531 .gpio3 = 0x00000000,
1533 .type = CX88_VMUX_COMPOSITE1,
1535 .gpio0 = 0x00000000,
1536 .gpio1 = 0x00e3e361,
1537 .gpio2 = 0x00000000,
1538 .gpio3 = 0x00000000,
1540 .type = CX88_VMUX_SVIDEO,
1542 .gpio0 = 0x00000000,
1543 .gpio1 = 0x00e3e361,
1544 .gpio2 = 0x00000000,
1545 .gpio3 = 0x00000000,
1549 .gpio0 = 0x00000000,
1550 .gpio1 = 0x00e3e341,
1551 .gpio2 = 0x00000000,
1552 .gpio3 = 0x00000000,
1554 .mpeg = CX88_MPEG_DVB,
1556 [CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO] = {
1557 .name = "DViCO FusionHDTV DVB-T PRO",
1558 .tuner_type = TUNER_ABSENT, /* XXX: Has XC3028 */
1559 .radio_type = UNSET,
1560 .tuner_addr = ADDR_UNSET,
1561 .radio_addr = ADDR_UNSET,
1563 .type = CX88_VMUX_COMPOSITE1,
1565 .gpio0 = 0x000067df,
1567 .type = CX88_VMUX_SVIDEO,
1569 .gpio0 = 0x000067df,
1571 .mpeg = CX88_MPEG_DVB,
1573 [CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD] = {
1574 .name = "DViCO FusionHDTV 7 Gold",
1575 .tuner_type = TUNER_XC5000,
1576 .radio_type = UNSET,
1577 .tuner_addr = ADDR_UNSET,
1578 .radio_addr = ADDR_UNSET,
1580 .type = CX88_VMUX_TELEVISION,
1584 .type = CX88_VMUX_COMPOSITE1,
1588 .type = CX88_VMUX_SVIDEO,
1593 [CX88_BOARD_PROLINK_PV_8000GT] = {
1594 .name = "Prolink Pixelview MPEG 8000GT",
1595 .tuner_type = TUNER_XC2028,
1598 .type = CX88_VMUX_TELEVISION,
1603 .type = CX88_VMUX_COMPOSITE1,
1607 .type = CX88_VMUX_SVIDEO,
1616 /* Both radio, analog and ATSC work with this board.
1617 However, for analog to work, s5h1409 gate should be open,
1618 otherwise, tuner-xc3028 won't be detected.
1619 A proper fix require using the newer i2c methods to add
1620 tuner-xc3028 without doing an i2c probe.
1622 [CX88_BOARD_KWORLD_ATSC_120] = {
1623 .name = "Kworld PlusTV HD PCI 120 (ATSC 120)",
1624 .tuner_type = TUNER_XC2028,
1625 .radio_type = UNSET,
1626 .tuner_addr = ADDR_UNSET,
1627 .radio_addr = ADDR_UNSET,
1629 .type = CX88_VMUX_TELEVISION,
1631 .gpio0 = 0x000000ff,
1632 .gpio1 = 0x0000f35d,
1633 .gpio2 = 0x00000000,
1635 .type = CX88_VMUX_COMPOSITE1,
1637 .gpio0 = 0x000000ff,
1638 .gpio1 = 0x0000f37e,
1639 .gpio2 = 0x00000000,
1641 .type = CX88_VMUX_SVIDEO,
1643 .gpio0 = 0x000000ff,
1644 .gpio1 = 0x0000f37e,
1645 .gpio2 = 0x00000000,
1649 .gpio0 = 0x000000ff,
1650 .gpio1 = 0x0000f35d,
1651 .gpio2 = 0x00000000,
1653 .mpeg = CX88_MPEG_DVB,
1657 /* ------------------------------------------------------------------ */
1658 /* PCI subsystem IDs */
1660 static const struct cx88_subid cx88_subids[] = {
1662 .subvendor = 0x0070,
1663 .subdevice = 0x3400,
1664 .card = CX88_BOARD_HAUPPAUGE,
1666 .subvendor = 0x0070,
1667 .subdevice = 0x3401,
1668 .card = CX88_BOARD_HAUPPAUGE,
1670 .subvendor = 0x14c7,
1671 .subdevice = 0x0106,
1672 .card = CX88_BOARD_GDI,
1674 .subvendor = 0x14c7,
1675 .subdevice = 0x0107, /* with mpeg encoder */
1676 .card = CX88_BOARD_GDI,
1678 .subvendor = PCI_VENDOR_ID_ATI,
1679 .subdevice = 0x00f8,
1680 .card = CX88_BOARD_ATI_WONDER_PRO,
1682 .subvendor = 0x107d,
1683 .subdevice = 0x6611,
1684 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
1686 .subvendor = 0x107d,
1687 .subdevice = 0x6613, /* NTSC */
1688 .card = CX88_BOARD_WINFAST2000XP_EXPERT,
1690 .subvendor = 0x107d,
1691 .subdevice = 0x6620,
1692 .card = CX88_BOARD_WINFAST_DV2000,
1694 .subvendor = 0x107d,
1695 .subdevice = 0x663b,
1696 .card = CX88_BOARD_LEADTEK_PVR2000,
1698 .subvendor = 0x107d,
1699 .subdevice = 0x663c,
1700 .card = CX88_BOARD_LEADTEK_PVR2000,
1702 .subvendor = 0x1461,
1703 .subdevice = 0x000b,
1704 .card = CX88_BOARD_AVERTV_STUDIO_303,
1706 .subvendor = 0x1462,
1707 .subdevice = 0x8606,
1708 .card = CX88_BOARD_MSI_TVANYWHERE_MASTER,
1710 .subvendor = 0x10fc,
1711 .subdevice = 0xd003,
1712 .card = CX88_BOARD_IODATA_GVVCP3PCI,
1714 .subvendor = 0x1043,
1715 .subdevice = 0x4823, /* with mpeg encoder */
1716 .card = CX88_BOARD_ASUS_PVR_416,
1718 .subvendor = 0x17de,
1719 .subdevice = 0x08a6,
1720 .card = CX88_BOARD_KWORLD_DVB_T,
1722 .subvendor = 0x18ac,
1723 .subdevice = 0xd810,
1724 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
1726 .subvendor = 0x18ac,
1727 .subdevice = 0xd820,
1728 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T,
1730 .subvendor = 0x18ac,
1731 .subdevice = 0xdb00,
1732 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1,
1734 .subvendor = 0x0070,
1735 .subdevice = 0x9002,
1736 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
1738 .subvendor = 0x14f1,
1739 .subdevice = 0x0187,
1740 .card = CX88_BOARD_CONEXANT_DVB_T1,
1742 .subvendor = 0x1540,
1743 .subdevice = 0x2580,
1744 .card = CX88_BOARD_PROVIDEO_PV259,
1746 .subvendor = 0x18ac,
1747 .subdevice = 0xdb10,
1748 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
1750 .subvendor = 0x1554,
1751 .subdevice = 0x4811,
1752 .card = CX88_BOARD_PIXELVIEW,
1754 .subvendor = 0x7063,
1755 .subdevice = 0x3000, /* HD-3000 card */
1756 .card = CX88_BOARD_PCHDTV_HD3000,
1758 .subvendor = 0x17de,
1759 .subdevice = 0xa8a6,
1760 .card = CX88_BOARD_DNTV_LIVE_DVB_T,
1762 .subvendor = 0x0070,
1763 .subdevice = 0x2801,
1764 .card = CX88_BOARD_HAUPPAUGE_ROSLYN,
1766 .subvendor = 0x14f1,
1767 .subdevice = 0x0342,
1768 .card = CX88_BOARD_DIGITALLOGIC_MEC,
1770 .subvendor = 0x10fc,
1771 .subdevice = 0xd035,
1772 .card = CX88_BOARD_IODATA_GVBCTV7E,
1774 .subvendor = 0x1421,
1775 .subdevice = 0x0334,
1776 .card = CX88_BOARD_ADSTECH_DVB_T_PCI,
1778 .subvendor = 0x153b,
1779 .subdevice = 0x1166,
1780 .card = CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1,
1782 .subvendor = 0x18ac,
1783 .subdevice = 0xd500,
1784 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD,
1786 .subvendor = 0x1461,
1787 .subdevice = 0x8011,
1788 .card = CX88_BOARD_AVERMEDIA_ULTRATV_MC_550,
1790 .subvendor = PCI_VENDOR_ID_ATI,
1791 .subdevice = 0xa101,
1792 .card = CX88_BOARD_ATI_HDTVWONDER,
1794 .subvendor = 0x107d,
1795 .subdevice = 0x665f,
1796 .card = CX88_BOARD_WINFAST_DTV1000,
1798 .subvendor = 0x1461,
1799 .subdevice = 0x000a,
1800 .card = CX88_BOARD_AVERTV_303,
1802 .subvendor = 0x0070,
1803 .subdevice = 0x9200,
1804 .card = CX88_BOARD_HAUPPAUGE_NOVASE2_S1,
1806 .subvendor = 0x0070,
1807 .subdevice = 0x9201,
1808 .card = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
1810 .subvendor = 0x0070,
1811 .subdevice = 0x9202,
1812 .card = CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1,
1814 .subvendor = 0x17de,
1815 .subdevice = 0x08b2,
1816 .card = CX88_BOARD_KWORLD_DVBS_100,
1818 .subvendor = 0x0070,
1819 .subdevice = 0x9400,
1820 .card = CX88_BOARD_HAUPPAUGE_HVR1100,
1822 .subvendor = 0x0070,
1823 .subdevice = 0x9402,
1824 .card = CX88_BOARD_HAUPPAUGE_HVR1100,
1826 .subvendor = 0x0070,
1827 .subdevice = 0x9800,
1828 .card = CX88_BOARD_HAUPPAUGE_HVR1100LP,
1830 .subvendor = 0x0070,
1831 .subdevice = 0x9802,
1832 .card = CX88_BOARD_HAUPPAUGE_HVR1100LP,
1834 .subvendor = 0x0070,
1835 .subdevice = 0x9001,
1836 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
1838 .subvendor = 0x1822,
1839 .subdevice = 0x0025,
1840 .card = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
1842 .subvendor = 0x17de,
1843 .subdevice = 0x08a1,
1844 .card = CX88_BOARD_KWORLD_DVB_T_CX22702,
1846 .subvendor = 0x18ac,
1847 .subdevice = 0xdb50,
1848 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1850 .subvendor = 0x18ac,
1851 .subdevice = 0xdb54,
1852 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL,
1853 /* Re-branded DViCO: DigitalNow DVB-T Dual */
1855 .subvendor = 0x18ac,
1856 .subdevice = 0xdb11,
1857 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS,
1858 /* Re-branded DViCO: UltraView DVB-T Plus */
1860 .subvendor = 0x18ac,
1861 .subdevice = 0xdb30,
1862 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO,
1864 .subvendor = 0x17de,
1865 .subdevice = 0x0840,
1866 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1868 .subvendor = 0x1421,
1869 .subdevice = 0x0305,
1870 .card = CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT,
1872 .subvendor = 0x18ac,
1873 .subdevice = 0xdb40,
1874 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1876 .subvendor = 0x18ac,
1877 .subdevice = 0xdb44,
1878 .card = CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID,
1880 .subvendor = 0x7063,
1881 .subdevice = 0x5500,
1882 .card = CX88_BOARD_PCHDTV_HD5500,
1884 .subvendor = 0x17de,
1885 .subdevice = 0x0841,
1886 .card = CX88_BOARD_KWORLD_MCE200_DELUXE,
1888 .subvendor = 0x1822,
1889 .subdevice = 0x0019,
1890 .card = CX88_BOARD_DNTV_LIVE_DVB_T_PRO,
1892 .subvendor = 0x1554,
1893 .subdevice = 0x4813,
1894 .card = CX88_BOARD_PIXELVIEW_PLAYTV_P7000,
1896 .subvendor = 0x14f1,
1897 .subdevice = 0x0842,
1898 .card = CX88_BOARD_NPGTECH_REALTV_TOP10FM,
1900 .subvendor = 0x107d,
1901 .subdevice = 0x665e,
1902 .card = CX88_BOARD_WINFAST_DTV2000H,
1904 .subvendor = 0x18ac,
1905 .subdevice = 0xd800, /* FusionHDTV 3 Gold (original revision) */
1906 .card = CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q,
1908 .subvendor = 0x14f1,
1909 .subdevice = 0x0084,
1910 .card = CX88_BOARD_GENIATECH_DVBS,
1912 .subvendor = 0x0070,
1913 .subdevice = 0x1404,
1914 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1916 .subvendor = 0x1461,
1917 .subdevice = 0xc111, /* AverMedia M150-D */
1918 /* This board is known to work with the ASUS PVR416 config */
1919 .card = CX88_BOARD_ASUS_PVR_416,
1921 .subvendor = 0xc180,
1922 .subdevice = 0xc980,
1923 .card = CX88_BOARD_TE_DTV_250_OEM_SWANN,
1925 .subvendor = 0x0070,
1926 .subdevice = 0x9600,
1927 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1929 .subvendor = 0x0070,
1930 .subdevice = 0x9601,
1931 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1933 .subvendor = 0x0070,
1934 .subdevice = 0x9602,
1935 .card = CX88_BOARD_HAUPPAUGE_HVR1300,
1937 .subvendor = 0x107d,
1938 .subdevice = 0x6632,
1939 .card = CX88_BOARD_LEADTEK_PVR2000,
1941 .subvendor = 0x12ab,
1942 .subdevice = 0x2300, /* Club3D Zap TV2100 */
1943 .card = CX88_BOARD_KWORLD_DVB_T_CX22702,
1945 .subvendor = 0x0070,
1946 .subdevice = 0x9000,
1947 .card = CX88_BOARD_HAUPPAUGE_DVB_T1,
1949 .subvendor = 0x0070,
1950 .subdevice = 0x1400,
1951 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1953 .subvendor = 0x0070,
1954 .subdevice = 0x1401,
1955 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1957 .subvendor = 0x0070,
1958 .subdevice = 0x1402,
1959 .card = CX88_BOARD_HAUPPAUGE_HVR3000,
1961 .subvendor = 0x1421,
1962 .subdevice = 0x0341, /* ADS Tech InstantTV DVB-S */
1963 .card = CX88_BOARD_KWORLD_DVBS_100,
1965 .subvendor = 0x1421,
1966 .subdevice = 0x0390,
1967 .card = CX88_BOARD_ADSTECH_PTV_390,
1969 .subvendor = 0x11bd,
1970 .subdevice = 0x0051,
1971 .card = CX88_BOARD_PINNACLE_PCTV_HD_800i,
1973 .subvendor = 0x18ac,
1974 .subdevice = 0xd530,
1975 .card = CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO,
1977 .subvendor = 0x12ab,
1978 .subdevice = 0x1788,
1979 .card = CX88_BOARD_PINNACLE_HYBRID_PCTV,
1981 .subvendor = 0x14f1,
1982 .subdevice = 0xea3d,
1983 .card = CX88_BOARD_POWERCOLOR_REAL_ANGEL,
1985 .subvendor = 0x107d,
1986 .subdevice = 0x6f18,
1987 .card = CX88_BOARD_WINFAST_TV2000_XP_GLOBAL,
1989 .subvendor = 0x14f1,
1990 .subdevice = 0x8852,
1991 .card = CX88_BOARD_GENIATECH_X8000_MT,
1993 .subvendor = 0x18ac,
1994 .subdevice = 0xd610,
1995 .card = CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD,
1997 .subvendor = 0x1554,
1998 .subdevice = 0x4935,
1999 .card = CX88_BOARD_PROLINK_PV_8000GT,
2001 .subvendor = 0x17de,
2002 .subdevice = 0x08c1,
2003 .card = CX88_BOARD_KWORLD_ATSC_120,
2007 /* ----------------------------------------------------------------------- */
2008 /* some leadtek specific stuff */
2010 static void leadtek_eeprom(struct cx88_core *core, u8 *eeprom_data)
2012 /* This is just for the "Winfast 2000XP Expert" board ATM; I don't have data on
2015 * Byte 0 is 1 on the NTSC board.
2018 if (eeprom_data[4] != 0x7d ||
2019 eeprom_data[5] != 0x10 ||
2020 eeprom_data[7] != 0x66) {
2021 warn_printk(core, "Leadtek eeprom invalid.\n");
2025 core->board.tuner_type = (eeprom_data[6] == 0x13) ?
2026 TUNER_PHILIPS_FM1236_MK3 : TUNER_PHILIPS_FM1216ME_MK3;
2028 info_printk(core, "Leadtek Winfast 2000XP Expert config: "
2029 "tuner=%d, eeprom[0]=0x%02x\n",
2030 core->board.tuner_type, eeprom_data[0]);
2033 static void hauppauge_eeprom(struct cx88_core *core, u8 *eeprom_data)
2037 tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
2038 core->board.tuner_type = tv.tuner_type;
2039 core->tuner_formats = tv.tuner_formats;
2040 core->board.radio.type = tv.has_radio ? CX88_RADIO : 0;
2042 /* Make sure we support the board model */
2045 case 14009: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in) */
2046 case 14019: /* WinTV-HVR3000 (Retail, IR Blaster, b/panel video, 3.5mm audio in) */
2047 case 14029: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge) */
2048 case 14109: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - low profile) */
2049 case 14129: /* WinTV-HVR3000 (Retail, IR, b/panel video, 3.5mm audio in - 880 bridge - LP) */
2050 case 14559: /* WinTV-HVR3000 (OEM, no IR, b/panel video, 3.5mm audio in) */
2051 case 14569: /* WinTV-HVR3000 (OEM, no IR, no back panel video) */
2052 case 14659: /* WinTV-HVR3000 (OEM, no IR, b/panel video, RCA audio in - Low profile) */
2053 case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low profile) */
2054 case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
2055 case 34519: /* WinTV-PCI-FM */
2056 case 90002: /* Nova-T-PCI (9002) */
2057 case 92001: /* Nova-S-Plus (Video and IR) */
2058 case 92002: /* Nova-S-Plus (Video and IR) */
2059 case 90003: /* Nova-T-PCI (9002 No RF out) */
2060 case 90500: /* Nova-T-PCI (oem) */
2061 case 90501: /* Nova-T-PCI (oem/IR) */
2062 case 92000: /* Nova-SE2 (OEM, No Video or IR) */
2063 case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
2064 case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
2065 case 96009: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX) */
2066 case 96019: /* WinTV-HVR1300 (PAL Video, MPEG Video and IR RX/TX) */
2067 case 96559: /* WinTV-HVR1300 (PAL Video, MPEG Video no IR) */
2068 case 96569: /* WinTV-HVR1300 () */
2069 case 96659: /* WinTV-HVR1300 () */
2070 case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
2074 warn_printk(core, "warning: unknown hauppauge model #%d\n",
2079 info_printk(core, "hauppauge eeprom: model=%d\n", tv.model);
2082 /* ----------------------------------------------------------------------- */
2083 /* some GDI (was: Modular Technology) specific stuff */
2090 [ 0x01 ] = { .id = TUNER_ABSENT,
2092 [ 0x02 ] = { .id = TUNER_ABSENT,
2094 [ 0x03 ] = { .id = TUNER_ABSENT,
2096 [ 0x04 ] = { .id = TUNER_ABSENT,
2098 [ 0x05 ] = { .id = TUNER_ABSENT,
2101 [ 0x10 ] = { .id = TUNER_ABSENT,
2103 .name = "TEMIC_4049" },
2104 [ 0x11 ] = { .id = TUNER_TEMIC_4136FY5,
2105 .name = "TEMIC_4136" },
2106 [ 0x12 ] = { .id = TUNER_ABSENT,
2107 .name = "TEMIC_4146" },
2109 [ 0x20 ] = { .id = TUNER_PHILIPS_FQ1216ME,
2111 .name = "PHILIPS_FQ1216_MK3" },
2112 [ 0x21 ] = { .id = TUNER_ABSENT, .fm = 1,
2113 .name = "PHILIPS_FQ1236_MK3" },
2114 [ 0x22 ] = { .id = TUNER_ABSENT,
2115 .name = "PHILIPS_FI1236_MK3" },
2116 [ 0x23 ] = { .id = TUNER_ABSENT,
2117 .name = "PHILIPS_FI1216_MK3" },
2120 static void gdi_eeprom(struct cx88_core *core, u8 *eeprom_data)
2122 char *name = (eeprom_data[0x0d] < ARRAY_SIZE(gdi_tuner))
2123 ? gdi_tuner[eeprom_data[0x0d]].name : NULL;
2125 info_printk(core, "GDI: tuner=%s\n", name ? name : "unknown");
2128 core->board.tuner_type = gdi_tuner[eeprom_data[0x0d]].id;
2129 core->board.radio.type = gdi_tuner[eeprom_data[0x0d]].fm ?
2133 /* ------------------------------------------------------------------- */
2134 /* some Divco specific stuff */
2135 static int cx88_dvico_xc2028_callback(struct cx88_core *core,
2136 int command, int arg)
2139 case XC2028_TUNER_RESET:
2140 cx_write(MO_GP0_IO, 0x101000);
2142 cx_set(MO_GP0_IO, 0x101010);
2152 /* ----------------------------------------------------------------------- */
2153 /* some Geniatech specific stuff */
2155 static int cx88_xc3028_geniatech_tuner_callback(struct cx88_core *core,
2156 int command, int mode)
2159 case XC2028_TUNER_RESET:
2160 switch (INPUT(core->input).type) {
2164 cx_write(MO_GP1_IO, 0x030302);
2168 cx_write(MO_GP1_IO, 0x030301);
2171 cx_write(MO_GP1_IO, 0x101010);
2173 cx_write(MO_GP1_IO, 0x101000);
2175 cx_write(MO_GP1_IO, 0x101010);
2182 /* ------------------------------------------------------------------- */
2183 /* some Divco specific stuff */
2184 static int cx88_pv_8000gt_callback(struct cx88_core *core,
2185 int command, int arg)
2188 case XC2028_TUNER_RESET:
2189 cx_write(MO_GP2_IO, 0xcf7);
2191 cx_write(MO_GP2_IO, 0xef5);
2193 cx_write(MO_GP2_IO, 0xcf7);
2202 /* ----------------------------------------------------------------------- */
2203 /* some DViCO specific stuff */
2205 static void dvico_fusionhdtv_hybrid_init(struct cx88_core *core)
2207 struct i2c_msg msg = { .addr = 0x45, .flags = 0 };
2209 static u8 init_bufs[13][5] = {
2210 { 0x10, 0x00, 0x20, 0x01, 0x03 },
2211 { 0x10, 0x10, 0x01, 0x00, 0x21 },
2212 { 0x10, 0x10, 0x10, 0x00, 0xCA },
2213 { 0x10, 0x10, 0x12, 0x00, 0x08 },
2214 { 0x10, 0x10, 0x13, 0x00, 0x0A },
2215 { 0x10, 0x10, 0x16, 0x01, 0xC0 },
2216 { 0x10, 0x10, 0x22, 0x01, 0x3D },
2217 { 0x10, 0x10, 0x73, 0x01, 0x2E },
2218 { 0x10, 0x10, 0x72, 0x00, 0xC5 },
2219 { 0x10, 0x10, 0x71, 0x01, 0x97 },
2220 { 0x10, 0x10, 0x70, 0x00, 0x0F },
2221 { 0x10, 0x10, 0xB0, 0x00, 0x01 },
2225 for (i = 0; i < ARRAY_SIZE(init_bufs); i++) {
2226 msg.buf = init_bufs[i];
2227 msg.len = (i != 12 ? 5 : 2);
2228 err = i2c_transfer(&core->i2c_adap, &msg, 1);
2230 warn_printk(core, "dvico_fusionhdtv_hybrid_init buf %d "
2231 "failed (err = %d)!\n", i, err);
2237 static int cx88_xc2028_tuner_callback(struct cx88_core *core,
2238 int command, int arg)
2240 /* Board-specific callbacks */
2241 switch (core->boardnr) {
2242 case CX88_BOARD_WINFAST_TV2000_XP_GLOBAL:
2243 case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
2244 case CX88_BOARD_GENIATECH_X8000_MT:
2245 case CX88_BOARD_KWORLD_ATSC_120:
2246 return cx88_xc3028_geniatech_tuner_callback(core,
2248 case CX88_BOARD_PROLINK_PV_8000GT:
2249 return cx88_pv_8000gt_callback(core, command, arg);
2250 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
2251 return cx88_dvico_xc2028_callback(core, command, arg);
2255 case XC2028_TUNER_RESET:
2256 switch (INPUT(core->input).type) {
2258 info_printk(core, "setting GPIO to radio!\n");
2259 cx_write(MO_GP0_IO, 0x4ff);
2261 cx_write(MO_GP2_IO, 0xff);
2264 case CX88_VMUX_DVB: /* Digital TV*/
2265 default: /* Analog TV */
2266 info_printk(core, "setting GPIO to TV!\n");
2269 cx_write(MO_GP1_IO, 0x101010);
2271 cx_write(MO_GP1_IO, 0x101000);
2273 cx_write(MO_GP1_IO, 0x101010);
2280 /* ----------------------------------------------------------------------- */
2281 /* Tuner callback function. Currently only needed for the Pinnacle *
2282 * PCTV HD 800i with an xc5000 sillicon tuner. This is used for both *
2283 * analog tuner attach (tuner-core.c) and dvb tuner attach (cx88-dvb.c) */
2285 static int cx88_xc5000_tuner_callback(struct cx88_core *core,
2286 int command, int arg)
2288 switch (core->boardnr) {
2289 case CX88_BOARD_PINNACLE_PCTV_HD_800i:
2290 if (command == 0) { /* This is the reset command from xc5000 */
2291 /* Reset XC5000 tuner via SYS_RSTO_pin */
2292 cx_write(MO_SRST_IO, 0);
2294 cx_write(MO_SRST_IO, 1);
2297 err_printk(core, "xc5000: unknown tuner "
2298 "callback command.\n");
2302 case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
2303 if (command == 0) { /* This is the reset command from xc5000 */
2304 cx_clear(MO_GP0_IO, 0x00000010);
2306 cx_set(MO_GP0_IO, 0x00000010);
2310 "xc5000: unknown tuner callback command.\n");
2315 return 0; /* Should never be here */
2318 int cx88_tuner_callback(void *priv, int command, int arg)
2320 struct i2c_algo_bit_data *i2c_algo = priv;
2321 struct cx88_core *core;
2324 printk(KERN_ERR "cx88: Error - i2c private data undefined.\n");
2328 core = i2c_algo->data;
2331 printk(KERN_ERR "cx88: Error - device struct undefined.\n");
2335 switch (core->board.tuner_type) {
2337 info_printk(core, "Calling XC2028/3028 callback\n");
2338 return cx88_xc2028_tuner_callback(core, command, arg);
2340 info_printk(core, "Calling XC5000 callback\n");
2341 return cx88_xc5000_tuner_callback(core, command, arg);
2343 err_printk(core, "Error: Calling callback for tuner %d\n",
2344 core->board.tuner_type);
2347 EXPORT_SYMBOL(cx88_tuner_callback);
2349 /* ----------------------------------------------------------------------- */
2351 static void cx88_card_list(struct cx88_core *core, struct pci_dev *pci)
2355 if (0 == pci->subsystem_vendor &&
2356 0 == pci->subsystem_device) {
2358 "%s: Your board has no valid PCI Subsystem ID and thus can't\n"
2359 "%s: be autodetected. Please pass card=<n> insmod option to\n"
2360 "%s: workaround that. Redirect complaints to the vendor of\n"
2361 "%s: the TV card. Best regards,\n"
2363 core->name,core->name,core->name,core->name,core->name);
2366 "%s: Your board isn't known (yet) to the driver. You can\n"
2367 "%s: try to pick one of the existing card configs via\n"
2368 "%s: card=<n> insmod option. Updating to the latest\n"
2369 "%s: version might help as well.\n",
2370 core->name,core->name,core->name,core->name);
2372 err_printk(core, "Here is a list of valid choices for the card=<n> "
2373 "insmod option:\n");
2374 for (i = 0; i < ARRAY_SIZE(cx88_boards); i++)
2375 printk(KERN_ERR "%s: card=%d -> %s\n",
2376 core->name, i, cx88_boards[i].name);
2379 static void cx88_card_setup_pre_i2c(struct cx88_core *core)
2381 switch (core->boardnr) {
2382 case CX88_BOARD_HAUPPAUGE_HVR1300:
2383 /* Bring the 702 demod up before i2c scanning/attach or devices are hidden */
2384 /* We leave here with the 702 on the bus */
2385 cx_write(MO_GP0_IO, 0x0000e780);
2387 cx_clear(MO_GP0_IO, 0x00000080);
2389 cx_set(MO_GP0_IO, 0x00000080); /* 702 out of reset */
2393 case CX88_BOARD_PROLINK_PV_8000GT:
2394 cx_write(MO_GP2_IO, 0xcf7);
2396 cx_write(MO_GP2_IO, 0xef5);
2398 cx_write(MO_GP2_IO, 0xcf7);
2402 case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
2403 /* Enable the xc5000 tuner */
2404 cx_set(MO_GP0_IO, 0x00001010);
2410 * Sets board-dependent xc3028 configuration
2412 void cx88_setup_xc3028(struct cx88_core *core, struct xc2028_ctrl *ctl)
2414 memset(ctl, 0, sizeof(*ctl));
2416 ctl->fname = XC2028_DEFAULT_FIRMWARE;
2419 switch (core->boardnr) {
2420 case CX88_BOARD_POWERCOLOR_REAL_ANGEL:
2421 /* Doesn't work with firmware version 2.7 */
2422 ctl->fname = "xc3028-v25.fw";
2424 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
2425 ctl->scode_table = XC3028_FE_ZARLINK456;
2427 case CX88_BOARD_KWORLD_ATSC_120:
2428 case CX88_BOARD_DVICO_FUSIONHDTV_5_PCI_NANO:
2429 ctl->demod = XC3028_FE_OREN538;
2431 case CX88_BOARD_PROLINK_PV_8000GT:
2433 * This board uses non-MTS firmware
2437 ctl->demod = XC3028_FE_OREN538;
2441 EXPORT_SYMBOL_GPL(cx88_setup_xc3028);
2443 static void cx88_card_setup(struct cx88_core *core)
2445 static u8 eeprom[256];
2447 if (0 == core->i2c_rc) {
2448 core->i2c_client.addr = 0xa0 >> 1;
2449 tveeprom_read(&core->i2c_client,eeprom,sizeof(eeprom));
2452 switch (core->boardnr) {
2453 case CX88_BOARD_HAUPPAUGE:
2454 case CX88_BOARD_HAUPPAUGE_ROSLYN:
2455 if (0 == core->i2c_rc)
2456 hauppauge_eeprom(core,eeprom+8);
2458 case CX88_BOARD_GDI:
2459 if (0 == core->i2c_rc)
2460 gdi_eeprom(core,eeprom);
2462 case CX88_BOARD_WINFAST2000XP_EXPERT:
2463 if (0 == core->i2c_rc)
2464 leadtek_eeprom(core,eeprom);
2466 case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
2467 case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
2468 case CX88_BOARD_HAUPPAUGE_DVB_T1:
2469 case CX88_BOARD_HAUPPAUGE_HVR1100:
2470 case CX88_BOARD_HAUPPAUGE_HVR1100LP:
2471 case CX88_BOARD_HAUPPAUGE_HVR3000:
2472 case CX88_BOARD_HAUPPAUGE_HVR1300:
2473 if (0 == core->i2c_rc)
2474 hauppauge_eeprom(core,eeprom);
2476 case CX88_BOARD_KWORLD_DVBS_100:
2477 cx_write(MO_GP0_IO, 0x000007f8);
2478 cx_write(MO_GP1_IO, 0x00000001);
2480 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PRO:
2481 /* GPIO0:0 is hooked to demod reset */
2482 /* GPIO0:4 is hooked to xc3028 reset */
2483 cx_write(MO_GP0_IO, 0x00111100);
2485 cx_write(MO_GP0_IO, 0x00111111);
2487 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
2488 /* GPIO0:6 is hooked to FX2 reset pin */
2489 cx_set(MO_GP0_IO, 0x00004040);
2490 cx_clear(MO_GP0_IO, 0x00000040);
2492 cx_set(MO_GP0_IO, 0x00004040);
2494 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
2495 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
2496 case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID:
2497 /* GPIO0:0 is hooked to mt352 reset pin */
2498 cx_set(MO_GP0_IO, 0x00000101);
2499 cx_clear(MO_GP0_IO, 0x00000001);
2501 cx_set(MO_GP0_IO, 0x00000101);
2502 if (0 == core->i2c_rc &&
2503 core->boardnr == CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID)
2504 dvico_fusionhdtv_hybrid_init(core);
2506 case CX88_BOARD_KWORLD_DVB_T:
2507 case CX88_BOARD_DNTV_LIVE_DVB_T:
2508 cx_set(MO_GP0_IO, 0x00000707);
2509 cx_set(MO_GP2_IO, 0x00000101);
2510 cx_clear(MO_GP2_IO, 0x00000001);
2512 cx_clear(MO_GP0_IO, 0x00000007);
2513 cx_set(MO_GP2_IO, 0x00000101);
2515 case CX88_BOARD_DNTV_LIVE_DVB_T_PRO:
2516 cx_write(MO_GP0_IO, 0x00080808);
2518 case CX88_BOARD_ATI_HDTVWONDER:
2519 if (0 == core->i2c_rc) {
2522 static const u8 buffer [][2] = {
2529 core->i2c_client.addr = 0x0a;
2531 for (i = 0; i < ARRAY_SIZE(buffer); i++)
2532 if (2 != i2c_master_send(&core->i2c_client,
2534 warn_printk(core, "Unable to enable "
2538 case CX88_BOARD_MSI_TVANYWHERE_MASTER:
2540 struct v4l2_priv_tun_config tea5767_cfg;
2541 struct tea5767_ctrl ctl;
2543 memset(&ctl, 0, sizeof(ctl));
2548 ctl.xtal_freq = TEA5767_HIGH_LO_13MHz;
2550 tea5767_cfg.tuner = TUNER_TEA5767;
2551 tea5767_cfg.priv = &ctl;
2553 cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &tea5767_cfg);
2557 if (core->board.tuner_type == TUNER_XC2028) {
2558 struct v4l2_priv_tun_config xc2028_cfg;
2559 struct xc2028_ctrl ctl;
2561 /* Fills device-dependent initialization parameters */
2562 cx88_setup_xc3028(core, &ctl);
2564 /* Sends parameters to xc2028/3028 tuner */
2565 memset(&xc2028_cfg, 0, sizeof(xc2028_cfg));
2566 xc2028_cfg.tuner = TUNER_XC2028;
2567 xc2028_cfg.priv = &ctl;
2568 info_printk(core, "Asking xc2028/3028 to load firmware %s\n",
2570 cx88_call_i2c_clients(core, TUNER_SET_CONFIG, &xc2028_cfg);
2574 /* ------------------------------------------------------------------ */
2576 static int cx88_pci_quirks(const char *name, struct pci_dev *pci)
2578 unsigned int lat = UNSET;
2582 /* check pci quirks */
2583 if (pci_pci_problems & PCIPCI_TRITON) {
2584 printk(KERN_INFO "%s: quirk: PCIPCI_TRITON -- set TBFX\n",
2586 ctrl |= CX88X_EN_TBFX;
2588 if (pci_pci_problems & PCIPCI_NATOMA) {
2589 printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA -- set TBFX\n",
2591 ctrl |= CX88X_EN_TBFX;
2593 if (pci_pci_problems & PCIPCI_VIAETBF) {
2594 printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF -- set TBFX\n",
2596 ctrl |= CX88X_EN_TBFX;
2598 if (pci_pci_problems & PCIPCI_VSFX) {
2599 printk(KERN_INFO "%s: quirk: PCIPCI_VSFX -- set VSFX\n",
2601 ctrl |= CX88X_EN_VSFX;
2603 #ifdef PCIPCI_ALIMAGIK
2604 if (pci_pci_problems & PCIPCI_ALIMAGIK) {
2605 printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",
2611 /* check insmod options */
2612 if (UNSET != latency)
2617 pci_read_config_byte(pci, CX88X_DEVCTRL, &value);
2619 pci_write_config_byte(pci, CX88X_DEVCTRL, value);
2622 printk(KERN_INFO "%s: setting pci latency timer to %d\n",
2624 pci_write_config_byte(pci, PCI_LATENCY_TIMER, latency);
2629 int cx88_get_resources(const struct cx88_core *core, struct pci_dev *pci)
2631 if (request_mem_region(pci_resource_start(pci,0),
2632 pci_resource_len(pci,0),
2636 "%s/%d: Can't get MMIO memory @ 0x%llx, subsystem: %04x:%04x\n",
2637 core->name, PCI_FUNC(pci->devfn),
2638 (unsigned long long)pci_resource_start(pci, 0),
2639 pci->subsystem_vendor, pci->subsystem_device);
2643 /* Allocate and initialize the cx88 core struct. One should hold the
2644 * devlist mutex before calling this. */
2645 struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
2647 struct cx88_core *core;
2650 core = kzalloc(sizeof(*core), GFP_KERNEL);
2652 atomic_inc(&core->refcount);
2653 core->pci_bus = pci->bus->number;
2654 core->pci_slot = PCI_SLOT(pci->devfn);
2655 core->pci_irqmask = PCI_INT_RISC_RD_BERRINT | PCI_INT_RISC_WR_BERRINT |
2656 PCI_INT_BRDG_BERRINT | PCI_INT_SRC_DMA_BERRINT |
2657 PCI_INT_DST_DMA_BERRINT | PCI_INT_IPB_DMA_BERRINT;
2658 mutex_init(&core->lock);
2661 sprintf(core->name, "cx88[%d]", core->nr);
2662 if (0 != cx88_get_resources(core, pci)) {
2668 cx88_pci_quirks(core->name, pci);
2669 core->lmmio = ioremap(pci_resource_start(pci, 0),
2670 pci_resource_len(pci, 0));
2671 core->bmmio = (u8 __iomem *)core->lmmio;
2674 core->boardnr = UNSET;
2675 if (card[core->nr] < ARRAY_SIZE(cx88_boards))
2676 core->boardnr = card[core->nr];
2677 for (i = 0; UNSET == core->boardnr && i < ARRAY_SIZE(cx88_subids); i++)
2678 if (pci->subsystem_vendor == cx88_subids[i].subvendor &&
2679 pci->subsystem_device == cx88_subids[i].subdevice)
2680 core->boardnr = cx88_subids[i].card;
2681 if (UNSET == core->boardnr) {
2682 core->boardnr = CX88_BOARD_UNKNOWN;
2683 cx88_card_list(core, pci);
2686 memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
2688 info_printk(core, "subsystem: %04x:%04x, board: %s [card=%d,%s]\n",
2689 pci->subsystem_vendor, pci->subsystem_device, core->board.name,
2690 core->boardnr, card[core->nr] == core->boardnr ?
2691 "insmod option" : "autodetected");
2693 if (tuner[core->nr] != UNSET)
2694 core->board.tuner_type = tuner[core->nr];
2695 if (radio[core->nr] != UNSET)
2696 core->board.radio_type = radio[core->nr];
2698 info_printk(core, "TV tuner type %d, Radio tuner type %d\n",
2699 core->board.tuner_type, core->board.radio_type);
2703 cx88_card_setup_pre_i2c(core);
2704 cx88_i2c_init(core, pci);
2706 /* load tuner module, if needed */
2707 if (TUNER_ABSENT != core->board.tuner_type)
2708 request_module("tuner");
2710 cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL);
2711 cx88_card_setup(core);
2712 cx88_ir_init(core, pci);