2 * Driver for the Conexant CX23885 PCIe bridge
4 * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #include <linux/init.h>
19 #include <linux/module.h>
20 #include <linux/pci.h>
21 #include <linux/delay.h>
22 #include <media/cx25840.h>
23 #include <linux/firmware.h>
24 #include <misc/altera.h>
27 #include "tuner-xc2028.h"
28 #include "netup-eeprom.h"
29 #include "netup-init.h"
30 #include "altera-ci.h"
33 #include "cx23888-ir.h"
35 static unsigned int netup_card_rev
= 4;
36 module_param(netup_card_rev
, int, 0644);
37 MODULE_PARM_DESC(netup_card_rev
,
38 "NetUP Dual DVB-T/C CI card revision");
39 static unsigned int enable_885_ir
;
40 module_param(enable_885_ir
, int, 0644);
41 MODULE_PARM_DESC(enable_885_ir
,
42 "Enable integrated IR controller for supported\n"
43 "\t\t CX2388[57] boards that are wired for it:\n"
44 "\t\t\tHVR-1250 (reported safe)\n"
45 "\t\t\tTerraTec Cinergy T PCIe Dual (not well tested, appears to be safe)\n"
46 "\t\t\tTeVii S470 (reported unsafe)\n"
47 "\t\t This can cause an interrupt storm with some cards.\n"
48 "\t\t Default: 0 [Disabled]");
50 /* ------------------------------------------------------------------ */
51 /* board config info */
53 struct cx23885_board cx23885_boards
[] = {
54 [CX23885_BOARD_UNKNOWN
] = {
55 .name
= "UNKNOWN/GENERIC",
56 /* Ensure safe default for unknown boards */
59 .type
= CX23885_VMUX_COMPOSITE1
,
62 .type
= CX23885_VMUX_COMPOSITE2
,
65 .type
= CX23885_VMUX_COMPOSITE3
,
68 .type
= CX23885_VMUX_COMPOSITE4
,
72 [CX23885_BOARD_HAUPPAUGE_HVR1800lp
] = {
73 .name
= "Hauppauge WinTV-HVR1800lp",
74 .portc
= CX23885_MPEG_DVB
,
76 .type
= CX23885_VMUX_TELEVISION
,
80 .type
= CX23885_VMUX_DEBUG
,
84 .type
= CX23885_VMUX_COMPOSITE1
,
88 .type
= CX23885_VMUX_SVIDEO
,
93 [CX23885_BOARD_HAUPPAUGE_HVR1800
] = {
94 .name
= "Hauppauge WinTV-HVR1800",
95 .porta
= CX23885_ANALOG_VIDEO
,
96 .portb
= CX23885_MPEG_ENCODER
,
97 .portc
= CX23885_MPEG_DVB
,
98 .tuner_type
= TUNER_PHILIPS_TDA8290
,
99 .tuner_addr
= 0x42, /* 0x84 >> 1 */
102 .type
= CX23885_VMUX_TELEVISION
,
103 .vmux
= CX25840_VIN7_CH3
|
106 .amux
= CX25840_AUDIO8
,
109 .type
= CX23885_VMUX_COMPOSITE1
,
110 .vmux
= CX25840_VIN7_CH3
|
113 .amux
= CX25840_AUDIO7
,
116 .type
= CX23885_VMUX_SVIDEO
,
117 .vmux
= CX25840_VIN7_CH3
|
121 .amux
= CX25840_AUDIO7
,
125 [CX23885_BOARD_HAUPPAUGE_HVR1250
] = {
126 .name
= "Hauppauge WinTV-HVR1250",
127 .porta
= CX23885_ANALOG_VIDEO
,
128 .portc
= CX23885_MPEG_DVB
,
129 #ifdef MT2131_NO_ANALOG_SUPPORT_YET
130 .tuner_type
= TUNER_PHILIPS_TDA8290
,
131 .tuner_addr
= 0x42, /* 0x84 >> 1 */
136 #ifdef MT2131_NO_ANALOG_SUPPORT_YET
137 .type
= CX23885_VMUX_TELEVISION
,
138 .vmux
= CX25840_VIN7_CH3
|
141 .amux
= CX25840_AUDIO8
,
145 .type
= CX23885_VMUX_COMPOSITE1
,
146 .vmux
= CX25840_VIN7_CH3
|
149 .amux
= CX25840_AUDIO7
,
152 .type
= CX23885_VMUX_SVIDEO
,
153 .vmux
= CX25840_VIN7_CH3
|
157 .amux
= CX25840_AUDIO7
,
161 [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
] = {
162 .name
= "DViCO FusionHDTV5 Express",
163 .portb
= CX23885_MPEG_DVB
,
165 [CX23885_BOARD_HAUPPAUGE_HVR1500Q
] = {
166 .name
= "Hauppauge WinTV-HVR1500Q",
167 .portc
= CX23885_MPEG_DVB
,
169 [CX23885_BOARD_HAUPPAUGE_HVR1500
] = {
170 .name
= "Hauppauge WinTV-HVR1500",
171 .porta
= CX23885_ANALOG_VIDEO
,
172 .portc
= CX23885_MPEG_DVB
,
173 .tuner_type
= TUNER_XC2028
,
174 .tuner_addr
= 0x61, /* 0xc2 >> 1 */
176 .type
= CX23885_VMUX_TELEVISION
,
177 .vmux
= CX25840_VIN7_CH3
|
182 .type
= CX23885_VMUX_COMPOSITE1
,
183 .vmux
= CX25840_VIN7_CH3
|
188 .type
= CX23885_VMUX_SVIDEO
,
189 .vmux
= CX25840_VIN7_CH3
|
196 [CX23885_BOARD_HAUPPAUGE_HVR1200
] = {
197 .name
= "Hauppauge WinTV-HVR1200",
198 .portc
= CX23885_MPEG_DVB
,
200 [CX23885_BOARD_HAUPPAUGE_HVR1700
] = {
201 .name
= "Hauppauge WinTV-HVR1700",
202 .portc
= CX23885_MPEG_DVB
,
204 [CX23885_BOARD_HAUPPAUGE_HVR1400
] = {
205 .name
= "Hauppauge WinTV-HVR1400",
206 .portc
= CX23885_MPEG_DVB
,
208 [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
] = {
209 .name
= "DViCO FusionHDTV7 Dual Express",
210 .portb
= CX23885_MPEG_DVB
,
211 .portc
= CX23885_MPEG_DVB
,
213 [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
] = {
214 .name
= "DViCO FusionHDTV DVB-T Dual Express",
215 .portb
= CX23885_MPEG_DVB
,
216 .portc
= CX23885_MPEG_DVB
,
218 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
] = {
219 .name
= "Leadtek Winfast PxDVR3200 H",
220 .portc
= CX23885_MPEG_DVB
,
222 [CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
] = {
223 .name
= "Leadtek Winfast PxPVR2200",
224 .porta
= CX23885_ANALOG_VIDEO
,
225 .tuner_type
= TUNER_XC2028
,
229 .type
= CX23885_VMUX_TELEVISION
,
230 .vmux
= CX25840_VIN2_CH1
|
232 .amux
= CX25840_AUDIO8
,
235 .type
= CX23885_VMUX_COMPOSITE1
,
236 .vmux
= CX25840_COMPOSITE1
,
237 .amux
= CX25840_AUDIO7
,
240 .type
= CX23885_VMUX_SVIDEO
,
241 .vmux
= CX25840_SVIDEO_LUMA3
|
242 CX25840_SVIDEO_CHROMA4
,
243 .amux
= CX25840_AUDIO7
,
246 .type
= CX23885_VMUX_COMPONENT
,
247 .vmux
= CX25840_VIN7_CH1
|
250 CX25840_COMPONENT_ON
,
251 .amux
= CX25840_AUDIO7
,
255 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
] = {
256 .name
= "Leadtek Winfast PxDVR3200 H XC4000",
257 .porta
= CX23885_ANALOG_VIDEO
,
258 .portc
= CX23885_MPEG_DVB
,
259 .tuner_type
= TUNER_XC4000
,
262 .radio_addr
= ADDR_UNSET
,
264 .type
= CX23885_VMUX_TELEVISION
,
265 .vmux
= CX25840_VIN2_CH1
|
269 .type
= CX23885_VMUX_COMPOSITE1
,
270 .vmux
= CX25840_COMPOSITE1
,
272 .type
= CX23885_VMUX_SVIDEO
,
273 .vmux
= CX25840_SVIDEO_LUMA3
|
274 CX25840_SVIDEO_CHROMA4
,
276 .type
= CX23885_VMUX_COMPONENT
,
277 .vmux
= CX25840_VIN7_CH1
|
280 CX25840_COMPONENT_ON
,
283 [CX23885_BOARD_COMPRO_VIDEOMATE_E650F
] = {
284 .name
= "Compro VideoMate E650F",
285 .portc
= CX23885_MPEG_DVB
,
287 [CX23885_BOARD_TBS_6920
] = {
288 .name
= "TurboSight TBS 6920",
289 .portb
= CX23885_MPEG_DVB
,
291 [CX23885_BOARD_TBS_6980
] = {
292 .name
= "TurboSight TBS 6980",
293 .portb
= CX23885_MPEG_DVB
,
294 .portc
= CX23885_MPEG_DVB
,
296 [CX23885_BOARD_TBS_6981
] = {
297 .name
= "TurboSight TBS 6981",
298 .portb
= CX23885_MPEG_DVB
,
299 .portc
= CX23885_MPEG_DVB
,
301 [CX23885_BOARD_TEVII_S470
] = {
302 .name
= "TeVii S470",
303 .portb
= CX23885_MPEG_DVB
,
305 [CX23885_BOARD_DVBWORLD_2005
] = {
306 .name
= "DVBWorld DVB-S2 2005",
307 .portb
= CX23885_MPEG_DVB
,
309 [CX23885_BOARD_NETUP_DUAL_DVBS2_CI
] = {
311 .name
= "NetUP Dual DVB-S2 CI",
312 .portb
= CX23885_MPEG_DVB
,
313 .portc
= CX23885_MPEG_DVB
,
315 [CX23885_BOARD_HAUPPAUGE_HVR1270
] = {
316 .name
= "Hauppauge WinTV-HVR1270",
317 .portc
= CX23885_MPEG_DVB
,
319 [CX23885_BOARD_HAUPPAUGE_HVR1275
] = {
320 .name
= "Hauppauge WinTV-HVR1275",
321 .portc
= CX23885_MPEG_DVB
,
323 [CX23885_BOARD_HAUPPAUGE_HVR1255
] = {
324 .name
= "Hauppauge WinTV-HVR1255",
325 .porta
= CX23885_ANALOG_VIDEO
,
326 .portc
= CX23885_MPEG_DVB
,
327 .tuner_type
= TUNER_ABSENT
,
328 .tuner_addr
= 0x42, /* 0x84 >> 1 */
331 .type
= CX23885_VMUX_TELEVISION
,
332 .vmux
= CX25840_VIN7_CH3
|
336 .amux
= CX25840_AUDIO8
,
338 .type
= CX23885_VMUX_COMPOSITE1
,
339 .vmux
= CX25840_VIN7_CH3
|
342 .amux
= CX25840_AUDIO7
,
344 .type
= CX23885_VMUX_SVIDEO
,
345 .vmux
= CX25840_VIN7_CH3
|
349 .amux
= CX25840_AUDIO7
,
352 [CX23885_BOARD_HAUPPAUGE_HVR1255_22111
] = {
353 .name
= "Hauppauge WinTV-HVR1255",
354 .porta
= CX23885_ANALOG_VIDEO
,
355 .portc
= CX23885_MPEG_DVB
,
356 .tuner_type
= TUNER_ABSENT
,
357 .tuner_addr
= 0x42, /* 0x84 >> 1 */
360 .type
= CX23885_VMUX_TELEVISION
,
361 .vmux
= CX25840_VIN7_CH3
|
365 .amux
= CX25840_AUDIO8
,
367 .type
= CX23885_VMUX_SVIDEO
,
368 .vmux
= CX25840_VIN7_CH3
|
372 .amux
= CX25840_AUDIO7
,
375 [CX23885_BOARD_HAUPPAUGE_HVR1210
] = {
376 .name
= "Hauppauge WinTV-HVR1210",
377 .portc
= CX23885_MPEG_DVB
,
379 [CX23885_BOARD_MYGICA_X8506
] = {
380 .name
= "Mygica X8506 DMB-TH",
381 .tuner_type
= TUNER_XC5000
,
384 .porta
= CX23885_ANALOG_VIDEO
,
385 .portb
= CX23885_MPEG_DVB
,
388 .type
= CX23885_VMUX_TELEVISION
,
389 .vmux
= CX25840_COMPOSITE2
,
392 .type
= CX23885_VMUX_COMPOSITE1
,
393 .vmux
= CX25840_COMPOSITE8
,
396 .type
= CX23885_VMUX_SVIDEO
,
397 .vmux
= CX25840_SVIDEO_LUMA3
|
398 CX25840_SVIDEO_CHROMA4
,
401 .type
= CX23885_VMUX_COMPONENT
,
402 .vmux
= CX25840_COMPONENT_ON
|
409 [CX23885_BOARD_MAGICPRO_PROHDTVE2
] = {
410 .name
= "Magic-Pro ProHDTV Extreme 2",
411 .tuner_type
= TUNER_XC5000
,
414 .porta
= CX23885_ANALOG_VIDEO
,
415 .portb
= CX23885_MPEG_DVB
,
418 .type
= CX23885_VMUX_TELEVISION
,
419 .vmux
= CX25840_COMPOSITE2
,
422 .type
= CX23885_VMUX_COMPOSITE1
,
423 .vmux
= CX25840_COMPOSITE8
,
426 .type
= CX23885_VMUX_SVIDEO
,
427 .vmux
= CX25840_SVIDEO_LUMA3
|
428 CX25840_SVIDEO_CHROMA4
,
431 .type
= CX23885_VMUX_COMPONENT
,
432 .vmux
= CX25840_COMPONENT_ON
|
439 [CX23885_BOARD_HAUPPAUGE_HVR1850
] = {
440 .name
= "Hauppauge WinTV-HVR1850",
441 .porta
= CX23885_ANALOG_VIDEO
,
442 .portb
= CX23885_MPEG_ENCODER
,
443 .portc
= CX23885_MPEG_DVB
,
444 .tuner_type
= TUNER_ABSENT
,
445 .tuner_addr
= 0x42, /* 0x84 >> 1 */
448 .type
= CX23885_VMUX_TELEVISION
,
449 .vmux
= CX25840_VIN7_CH3
|
453 .amux
= CX25840_AUDIO8
,
455 .type
= CX23885_VMUX_COMPOSITE1
,
456 .vmux
= CX25840_VIN7_CH3
|
459 .amux
= CX25840_AUDIO7
,
461 .type
= CX23885_VMUX_SVIDEO
,
462 .vmux
= CX25840_VIN7_CH3
|
466 .amux
= CX25840_AUDIO7
,
469 [CX23885_BOARD_COMPRO_VIDEOMATE_E800
] = {
470 .name
= "Compro VideoMate E800",
471 .portc
= CX23885_MPEG_DVB
,
473 [CX23885_BOARD_HAUPPAUGE_HVR1290
] = {
474 .name
= "Hauppauge WinTV-HVR1290",
475 .portc
= CX23885_MPEG_DVB
,
477 [CX23885_BOARD_MYGICA_X8558PRO
] = {
478 .name
= "Mygica X8558 PRO DMB-TH",
479 .portb
= CX23885_MPEG_DVB
,
480 .portc
= CX23885_MPEG_DVB
,
482 [CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
] = {
483 .name
= "LEADTEK WinFast PxTV1200",
484 .porta
= CX23885_ANALOG_VIDEO
,
485 .tuner_type
= TUNER_XC2028
,
489 .type
= CX23885_VMUX_TELEVISION
,
490 .vmux
= CX25840_VIN2_CH1
|
494 .type
= CX23885_VMUX_COMPOSITE1
,
495 .vmux
= CX25840_COMPOSITE1
,
497 .type
= CX23885_VMUX_SVIDEO
,
498 .vmux
= CX25840_SVIDEO_LUMA3
|
499 CX25840_SVIDEO_CHROMA4
,
501 .type
= CX23885_VMUX_COMPONENT
,
502 .vmux
= CX25840_VIN7_CH1
|
505 CX25840_COMPONENT_ON
,
508 [CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
] = {
509 .name
= "GoTView X5 3D Hybrid",
510 .tuner_type
= TUNER_XC5000
,
513 .porta
= CX23885_ANALOG_VIDEO
,
514 .portb
= CX23885_MPEG_DVB
,
516 .type
= CX23885_VMUX_TELEVISION
,
517 .vmux
= CX25840_VIN2_CH1
|
521 .type
= CX23885_VMUX_COMPOSITE1
,
522 .vmux
= CX23885_VMUX_COMPOSITE1
,
524 .type
= CX23885_VMUX_SVIDEO
,
525 .vmux
= CX25840_SVIDEO_LUMA3
|
526 CX25840_SVIDEO_CHROMA4
,
529 [CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
] = {
531 .name
= "NetUP Dual DVB-T/C-CI RF",
532 .porta
= CX23885_ANALOG_VIDEO
,
533 .portb
= CX23885_MPEG_DVB
,
534 .portc
= CX23885_MPEG_DVB
,
537 .tuner_type
= TUNER_XC5000
,
540 .type
= CX23885_VMUX_TELEVISION
,
541 .vmux
= CX25840_COMPOSITE1
,
544 [CX23885_BOARD_MPX885
] = {
546 .porta
= CX23885_ANALOG_VIDEO
,
548 .type
= CX23885_VMUX_COMPOSITE1
,
549 .vmux
= CX25840_COMPOSITE1
,
550 .amux
= CX25840_AUDIO6
,
553 .type
= CX23885_VMUX_COMPOSITE2
,
554 .vmux
= CX25840_COMPOSITE2
,
555 .amux
= CX25840_AUDIO6
,
558 .type
= CX23885_VMUX_COMPOSITE3
,
559 .vmux
= CX25840_COMPOSITE3
,
560 .amux
= CX25840_AUDIO7
,
563 .type
= CX23885_VMUX_COMPOSITE4
,
564 .vmux
= CX25840_COMPOSITE4
,
565 .amux
= CX25840_AUDIO7
,
569 [CX23885_BOARD_MYGICA_X8507
] = {
570 .name
= "Mygica X8502/X8507 ISDB-T",
571 .tuner_type
= TUNER_XC5000
,
574 .porta
= CX23885_ANALOG_VIDEO
,
575 .portb
= CX23885_MPEG_DVB
,
578 .type
= CX23885_VMUX_TELEVISION
,
579 .vmux
= CX25840_COMPOSITE2
,
580 .amux
= CX25840_AUDIO8
,
583 .type
= CX23885_VMUX_COMPOSITE1
,
584 .vmux
= CX25840_COMPOSITE8
,
585 .amux
= CX25840_AUDIO7
,
588 .type
= CX23885_VMUX_SVIDEO
,
589 .vmux
= CX25840_SVIDEO_LUMA3
|
590 CX25840_SVIDEO_CHROMA4
,
591 .amux
= CX25840_AUDIO7
,
594 .type
= CX23885_VMUX_COMPONENT
,
595 .vmux
= CX25840_COMPONENT_ON
|
599 .amux
= CX25840_AUDIO7
,
603 [CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
] = {
604 .name
= "TerraTec Cinergy T PCIe Dual",
605 .portb
= CX23885_MPEG_DVB
,
606 .portc
= CX23885_MPEG_DVB
,
608 [CX23885_BOARD_TEVII_S471
] = {
609 .name
= "TeVii S471",
610 .portb
= CX23885_MPEG_DVB
,
612 [CX23885_BOARD_PROF_8000
] = {
613 .name
= "Prof Revolution DVB-S2 8000",
614 .portb
= CX23885_MPEG_DVB
,
616 [CX23885_BOARD_HAUPPAUGE_HVR4400
] = {
617 .name
= "Hauppauge WinTV-HVR4400/HVR5500",
618 .porta
= CX23885_ANALOG_VIDEO
,
619 .portb
= CX23885_MPEG_DVB
,
620 .portc
= CX23885_MPEG_DVB
,
621 .tuner_type
= TUNER_NXP_TDA18271
,
622 .tuner_addr
= 0x60, /* 0xc0 >> 1 */
625 [CX23885_BOARD_HAUPPAUGE_STARBURST
] = {
626 .name
= "Hauppauge WinTV Starburst",
627 .portb
= CX23885_MPEG_DVB
,
629 [CX23885_BOARD_AVERMEDIA_HC81R
] = {
630 .name
= "AVerTV Hybrid Express Slim HC81R",
631 .tuner_type
= TUNER_XC2028
,
632 .tuner_addr
= 0x61, /* 0xc2 >> 1 */
634 .porta
= CX23885_ANALOG_VIDEO
,
636 .type
= CX23885_VMUX_TELEVISION
,
637 .vmux
= CX25840_VIN2_CH1
|
641 .amux
= CX25840_AUDIO8
,
643 .type
= CX23885_VMUX_SVIDEO
,
644 .vmux
= CX25840_VIN8_CH1
|
648 .amux
= CX25840_AUDIO6
,
650 .type
= CX23885_VMUX_COMPONENT
,
651 .vmux
= CX25840_VIN1_CH1
|
655 .amux
= CX25840_AUDIO6
,
658 [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
] = {
659 .name
= "DViCO FusionHDTV DVB-T Dual Express2",
660 .portb
= CX23885_MPEG_DVB
,
661 .portc
= CX23885_MPEG_DVB
,
663 [CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
] = {
664 .name
= "Hauppauge ImpactVCB-e",
665 .tuner_type
= TUNER_ABSENT
,
666 .porta
= CX23885_ANALOG_VIDEO
,
668 .type
= CX23885_VMUX_COMPOSITE1
,
669 .vmux
= CX25840_VIN7_CH3
|
672 .amux
= CX25840_AUDIO7
,
674 .type
= CX23885_VMUX_SVIDEO
,
675 .vmux
= CX25840_VIN7_CH3
|
679 .amux
= CX25840_AUDIO7
,
682 [CX23885_BOARD_DVBSKY_T9580
] = {
683 .name
= "DVBSky T9580",
684 .portb
= CX23885_MPEG_DVB
,
685 .portc
= CX23885_MPEG_DVB
,
687 [CX23885_BOARD_DVBSKY_T980C
] = {
688 .name
= "DVBSky T980C",
689 .portb
= CX23885_MPEG_DVB
,
691 [CX23885_BOARD_DVBSKY_S950C
] = {
692 .name
= "DVBSky S950C",
693 .portb
= CX23885_MPEG_DVB
,
695 [CX23885_BOARD_TT_CT2_4500_CI
] = {
696 .name
= "Technotrend TT-budget CT2-4500 CI",
697 .portb
= CX23885_MPEG_DVB
,
699 [CX23885_BOARD_DVBSKY_S950
] = {
700 .name
= "DVBSky S950",
701 .portb
= CX23885_MPEG_DVB
,
703 [CX23885_BOARD_DVBSKY_S952
] = {
704 .name
= "DVBSky S952",
705 .portb
= CX23885_MPEG_DVB
,
706 .portc
= CX23885_MPEG_DVB
,
708 [CX23885_BOARD_DVBSKY_T982
] = {
709 .name
= "DVBSky T982",
710 .portb
= CX23885_MPEG_DVB
,
711 .portc
= CX23885_MPEG_DVB
,
713 [CX23885_BOARD_HAUPPAUGE_HVR5525
] = {
714 .name
= "Hauppauge WinTV-HVR5525",
715 .portb
= CX23885_MPEG_DVB
,
716 .portc
= CX23885_MPEG_DVB
,
719 const unsigned int cx23885_bcount
= ARRAY_SIZE(cx23885_boards
);
721 /* ------------------------------------------------------------------ */
722 /* PCI subsystem IDs */
724 struct cx23885_subid cx23885_subids
[] = {
728 .card
= CX23885_BOARD_UNKNOWN
,
732 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800lp
,
736 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
740 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
744 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
748 .card
= CX23885_BOARD_HAUPPAUGE_HVR1250
,
752 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
,
756 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
760 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
764 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
768 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
772 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
776 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
780 .card
= CX23885_BOARD_HAUPPAUGE_HVR1700
,
784 .card
= CX23885_BOARD_HAUPPAUGE_HVR1400
,
788 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
,
792 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
,
796 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
,
800 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
,
804 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
,
808 .card
= CX23885_BOARD_COMPRO_VIDEOMATE_E650F
,
812 .card
= CX23885_BOARD_TBS_6920
,
816 .card
= CX23885_BOARD_TBS_6980
,
820 .card
= CX23885_BOARD_TBS_6981
,
824 .card
= CX23885_BOARD_TEVII_S470
,
828 .card
= CX23885_BOARD_DVBWORLD_2005
,
832 .card
= CX23885_BOARD_NETUP_DUAL_DVBS2_CI
,
836 .card
= CX23885_BOARD_HAUPPAUGE_HVR1270
,
840 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
844 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
848 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255
,
852 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255_22111
,
856 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
860 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
864 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
868 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
872 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
876 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255
,
880 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
884 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
888 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
892 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
896 .card
= CX23885_BOARD_MYGICA_X8506
,
900 .card
= CX23885_BOARD_MAGICPRO_PROHDTVE2
,
904 .card
= CX23885_BOARD_HAUPPAUGE_HVR1850
,
908 .card
= CX23885_BOARD_COMPRO_VIDEOMATE_E800
,
912 .card
= CX23885_BOARD_HAUPPAUGE_HVR1290
,
916 .card
= CX23885_BOARD_MYGICA_X8558PRO
,
920 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
,
924 .card
= CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
,
928 .card
= CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
,
932 .card
= CX23885_BOARD_MYGICA_X8507
,
936 .card
= CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
,
940 .card
= CX23885_BOARD_TEVII_S471
,
944 .card
= CX23885_BOARD_PROF_8000
,
948 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-4400 (Model 121xxx, Hybrid DVB-T/S2, IR) */
952 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-5500 (Model 121xxx, Hybrid DVB-T/C/S2, IR) */
956 .card
= CX23885_BOARD_HAUPPAUGE_STARBURST
, /* Hauppauge WinTV Starburst (Model 121x00, DVB-S2, IR) */
960 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-5500 (Model 121xxx, Hybrid DVB-T/C/S2, IR) */
964 .card
= CX23885_BOARD_AVERMEDIA_HC81R
,
968 .card
= CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
,
972 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
,
976 .card
= CX23885_BOARD_DVBSKY_T9580
,
980 .card
= CX23885_BOARD_DVBSKY_T980C
,
984 .card
= CX23885_BOARD_DVBSKY_S950C
,
988 .card
= CX23885_BOARD_TT_CT2_4500_CI
,
992 .card
= CX23885_BOARD_DVBSKY_S950
,
996 .card
= CX23885_BOARD_DVBSKY_S952
,
1000 .card
= CX23885_BOARD_DVBSKY_T982
,
1002 .subvendor
= 0x0070,
1003 .subdevice
= 0xf038,
1004 .card
= CX23885_BOARD_HAUPPAUGE_HVR5525
,
1007 const unsigned int cx23885_idcount
= ARRAY_SIZE(cx23885_subids
);
1009 void cx23885_card_list(struct cx23885_dev
*dev
)
1013 if (0 == dev
->pci
->subsystem_vendor
&&
1014 0 == dev
->pci
->subsystem_device
) {
1016 "%s: Board has no valid PCIe Subsystem ID and can't\n"
1017 "%s: be autodetected. Pass card=<n> insmod option\n"
1018 "%s: to workaround that. Redirect complaints to the\n"
1019 "%s: vendor of the TV card. Best regards,\n"
1021 dev
->name
, dev
->name
, dev
->name
, dev
->name
, dev
->name
);
1024 "%s: Your board isn't known (yet) to the driver.\n"
1025 "%s: Try to pick one of the existing card configs via\n"
1026 "%s: card=<n> insmod option. Updating to the latest\n"
1027 "%s: version might help as well.\n",
1028 dev
->name
, dev
->name
, dev
->name
, dev
->name
);
1030 printk(KERN_INFO
"%s: Here is a list of valid choices for the card=<n> insmod option:\n",
1032 for (i
= 0; i
< cx23885_bcount
; i
++)
1033 printk(KERN_INFO
"%s: card=%d -> %s\n",
1034 dev
->name
, i
, cx23885_boards
[i
].name
);
1037 static void hauppauge_eeprom(struct cx23885_dev
*dev
, u8
*eeprom_data
)
1041 tveeprom_hauppauge_analog(&dev
->i2c_bus
[0].i2c_client
, &tv
,
1044 /* Make sure we support the board model */
1047 /* WinTV-HVR1270 (PCIe, Retail, half height)
1048 * ATSC/QAM and basic analog, IR Blast */
1050 /* WinTV-HVR1210 (PCIe, Retail, half height)
1051 * DVB-T and basic analog, IR Blast */
1053 /* WinTV-HVR1270 (PCIe, Retail, half height)
1054 * ATSC/QAM and basic analog, IR Recv */
1056 /* WinTV-HVR1210 (PCIe, Retail, half height)
1057 * DVB-T and basic analog, IR Recv */
1059 /* WinTV-HVR1275 (PCIe, Retail, half height)
1060 * ATSC/QAM and basic analog, IR Recv */
1062 /* WinTV-HVR1210 (PCIe, Retail, half height)
1063 * DVB-T and basic analog, IR Recv */
1065 /* WinTV-HVR1270 (PCIe, Retail, full height)
1066 * ATSC/QAM and basic analog, IR Blast */
1068 /* WinTV-HVR1210 (PCIe, Retail, full height)
1069 * DVB-T and basic analog, IR Blast */
1071 /* WinTV-HVR1270 (PCIe, Retail, full height)
1072 * ATSC/QAM and basic analog, IR Recv */
1074 /* WinTV-HVR1210 (PCIe, Retail, full height)
1075 * DVB-T and basic analog, IR Recv */
1077 /* WinTV-HVR1275 (PCIe, Retail, full height)
1078 * ATSC/QAM and basic analog, IR Recv */
1080 /* WinTV-HVR1210 (PCIe, Retail, full height)
1081 * DVB-T and basic analog, IR Recv */
1083 /* WinTV-HVR1200 (PCIe, Retail, full height)
1084 * DVB-T and basic analog */
1086 /* WinTV-ImpactVCB-e (PCIe, Retail, half height)
1089 /* WinTV-HVR1200 (PCIe, OEM, half height)
1090 * DVB-T and basic analog */
1092 /* WinTV-HVR1200 (PCIe, OEM, half height)
1093 * DVB-T and basic analog */
1095 /* WinTV-HVR1200 (PCIe, OEM, full height)
1096 * DVB-T and basic analog */
1098 /* WinTV-HVR1200 (PCIe, OEM, half height)
1099 * DVB-T and basic analog */
1101 /* WinTV-HVR1200 (PCIe, OEM, full height)
1102 * DVB-T and basic analog */
1104 /* WinTV-HVR1200 (PCIe, OEM, full height)
1105 * DVB-T and basic analog */
1107 /* WinTV-HVR1200 (PCIe, OEM, half height)
1108 * DVB-T and basic analog */
1110 /* WinTV-HVR1200 (PCIe, OEM, full height)
1111 * DVB-T and basic analog */
1113 /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual
1114 channel ATSC and MPEG2 HW Encoder */
1116 /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC
1119 /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC
1122 /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM
1125 /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM
1128 /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM,
1129 Dual channel ATSC and MPEG2 HW Encoder */
1131 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
1132 Dual channel ATSC and MPEG2 HW Encoder */
1134 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
1135 Dual channel ATSC and MPEG2 HW Encoder */
1137 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM,
1138 Dual channel ATSC and MPEG2 HW Encoder */
1140 /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM,
1141 Dual channel ATSC and MPEG2 HW Encoder */
1143 /* WinTV-HVR1250 (PCIe, Retail, IR, full height,
1144 ATSC and Basic analog */
1146 /* WinTV-HVR1250 (PCIe, Retail, IR, half height,
1147 ATSC and Basic analog */
1149 /* WinTV-HVR1250 (PCIe, No IR, half height,
1150 ATSC [at least] and Basic analog) */
1152 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
1153 ATSC and Basic analog */
1155 /* WinTV-HVR1250 (PCIe, OEM, No IR, full height,
1156 ATSC and Basic analog */
1158 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
1159 ATSC and Basic analog */
1161 /* WinTV-HVR1400 (Express Card, Retail, IR,
1162 * DVB-T and Basic analog */
1164 /* WinTV-HVR1700 (PCIe, OEM, No IR, half height)
1165 * DVB-T and MPEG2 HW Encoder */
1167 /* WinTV-HVR1700 (PCIe, OEM, No IR, full height)
1168 * DVB-T and MPEG2 HW Encoder */
1171 /* WinTV-HVR1850 (PCIe, Retail, 3.5mm in, IR, FM,
1172 Dual channel ATSC and MPEG2 HW Encoder */
1175 /* WinTV-HVR1290 (PCIe, OEM, RCA in, IR,
1176 Dual channel ATSC and Basic analog */
1178 /* WinTV-HVR5525 (PCIe, DVB-S/S2, DVB-T/T2/C) */
1181 printk(KERN_WARNING
"%s: warning: "
1182 "unknown hauppauge model #%d\n",
1183 dev
->name
, tv
.model
);
1187 printk(KERN_INFO
"%s: hauppauge eeprom: model=%d\n",
1188 dev
->name
, tv
.model
);
1191 /* Some TBS cards require initing a chip using a bitbanged SPI attached
1192 to the cx23885 gpio's. If this chip doesn't get init'ed the demod
1193 doesn't respond to any command. */
1194 static void tbs_card_init(struct cx23885_dev
*dev
)
1198 0xe0, 0x06, 0x66, 0x33, 0x65,
1199 0x01, 0x17, 0x06, 0xde};
1201 switch (dev
->board
) {
1202 case CX23885_BOARD_TBS_6980
:
1203 case CX23885_BOARD_TBS_6981
:
1204 cx_set(GP0_IO
, 0x00070007);
1205 usleep_range(1000, 10000);
1206 cx_clear(GP0_IO
, 2);
1207 usleep_range(1000, 10000);
1208 for (i
= 0; i
< 9 * 8; i
++) {
1209 cx_clear(GP0_IO
, 7);
1210 usleep_range(1000, 10000);
1212 ((buf
[i
>> 3] >> (7 - (i
& 7))) & 1) | 4);
1213 usleep_range(1000, 10000);
1220 int cx23885_tuner_callback(void *priv
, int component
, int command
, int arg
)
1222 struct cx23885_tsport
*port
= priv
;
1223 struct cx23885_dev
*dev
= port
->dev
;
1226 if ((command
== XC2028_RESET_CLK
) || (command
== XC2028_I2C_FLUSH
))
1230 printk(KERN_ERR
"%s(): Unknown command 0x%x.\n",
1235 switch (dev
->board
) {
1236 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1237 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1238 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1239 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
1240 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
1241 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
1242 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
1243 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
1244 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
1245 /* Tuner Reset Command */
1248 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
1249 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1250 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1251 /* Two identical tuners on two different i2c buses,
1252 * we need to reset the correct gpio. */
1255 else if (port
->nr
== 2)
1258 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
1259 /* Tuner Reset Command */
1262 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
1263 altera_ci_tuner_reset(dev
, port
->nr
);
1265 case CX23885_BOARD_AVERMEDIA_HC81R
:
1266 /* XC3028L Reset Command */
1272 /* Drive the tuner into reset and back out */
1273 cx_clear(GP0_IO
, bitmask
);
1275 cx_set(GP0_IO
, bitmask
);
1281 void cx23885_gpio_setup(struct cx23885_dev
*dev
)
1283 switch (dev
->board
) {
1284 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1285 /* GPIO-0 cx24227 demodulator reset */
1286 cx_set(GP0_IO
, 0x00010001); /* Bring the part out of reset */
1288 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1289 /* GPIO-0 cx24227 demodulator */
1290 /* GPIO-2 xc3028 tuner */
1292 /* Put the parts into reset */
1293 cx_set(GP0_IO
, 0x00050000);
1294 cx_clear(GP0_IO
, 0x00000005);
1297 /* Bring the parts out of reset */
1298 cx_set(GP0_IO
, 0x00050005);
1300 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1301 /* GPIO-0 cx24227 demodulator reset */
1302 /* GPIO-2 xc5000 tuner reset */
1303 cx_set(GP0_IO
, 0x00050005); /* Bring the part out of reset */
1305 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1306 /* GPIO-0 656_CLK */
1308 /* GPIO-2 8295A Reset */
1309 /* GPIO-3-10 cx23417 data0-7 */
1310 /* GPIO-11-14 cx23417 addr0-3 */
1311 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1314 /* CX23417 GPIO's */
1315 /* EIO15 Zilog Reset */
1316 /* EIO14 S5H1409/CX24227 Reset */
1317 mc417_gpio_enable(dev
, GPIO_15
| GPIO_14
, 1);
1319 /* Put the demod into reset and protect the eeprom */
1320 mc417_gpio_clear(dev
, GPIO_15
| GPIO_14
);
1323 /* Bring the demod and blaster out of reset */
1324 mc417_gpio_set(dev
, GPIO_15
| GPIO_14
);
1327 /* Force the TDA8295A into reset and back */
1328 cx23885_gpio_enable(dev
, GPIO_2
, 1);
1329 cx23885_gpio_set(dev
, GPIO_2
);
1331 cx23885_gpio_clear(dev
, GPIO_2
);
1333 cx23885_gpio_set(dev
, GPIO_2
);
1336 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
1337 /* GPIO-0 tda10048 demodulator reset */
1338 /* GPIO-2 tda18271 tuner reset */
1340 /* Put the parts into reset and back */
1341 cx_set(GP0_IO
, 0x00050000);
1343 cx_clear(GP0_IO
, 0x00000005);
1345 cx_set(GP0_IO
, 0x00050005);
1347 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
1348 /* GPIO-0 TDA10048 demodulator reset */
1349 /* GPIO-2 TDA8295A Reset */
1350 /* GPIO-3-10 cx23417 data0-7 */
1351 /* GPIO-11-14 cx23417 addr0-3 */
1352 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1354 /* The following GPIO's are on the interna AVCore (cx25840) */
1356 /* GPIO-20 IR_TX 416/DVBT Select */
1357 /* GPIO-21 IIS DAT */
1358 /* GPIO-22 IIS WCLK */
1359 /* GPIO-23 IIS BCLK */
1361 /* Put the parts into reset and back */
1362 cx_set(GP0_IO
, 0x00050000);
1364 cx_clear(GP0_IO
, 0x00000005);
1366 cx_set(GP0_IO
, 0x00050005);
1368 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1369 /* GPIO-0 Dibcom7000p demodulator reset */
1370 /* GPIO-2 xc3028L tuner reset */
1373 /* Put the parts into reset and back */
1374 cx_set(GP0_IO
, 0x00050000);
1376 cx_clear(GP0_IO
, 0x00000005);
1378 cx_set(GP0_IO
, 0x00050005);
1380 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
1381 /* GPIO-0 xc5000 tuner reset i2c bus 0 */
1382 /* GPIO-1 s5h1409 demod reset i2c bus 0 */
1383 /* GPIO-2 xc5000 tuner reset i2c bus 1 */
1384 /* GPIO-3 s5h1409 demod reset i2c bus 0 */
1386 /* Put the parts into reset and back */
1387 cx_set(GP0_IO
, 0x000f0000);
1389 cx_clear(GP0_IO
, 0x0000000f);
1391 cx_set(GP0_IO
, 0x000f000f);
1393 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1394 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1395 /* GPIO-0 portb xc3028 reset */
1396 /* GPIO-1 portb zl10353 reset */
1397 /* GPIO-2 portc xc3028 reset */
1398 /* GPIO-3 portc zl10353 reset */
1400 /* Put the parts into reset and back */
1401 cx_set(GP0_IO
, 0x000f0000);
1403 cx_clear(GP0_IO
, 0x0000000f);
1405 cx_set(GP0_IO
, 0x000f000f);
1407 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
1408 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
1409 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
1410 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
1411 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
1412 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
1413 /* GPIO-2 xc3028 tuner reset */
1415 /* The following GPIO's are on the internal AVCore (cx25840) */
1416 /* GPIO-? zl10353 demod reset */
1418 /* Put the parts into reset and back */
1419 cx_set(GP0_IO
, 0x00040000);
1421 cx_clear(GP0_IO
, 0x00000004);
1423 cx_set(GP0_IO
, 0x00040004);
1425 case CX23885_BOARD_TBS_6920
:
1426 case CX23885_BOARD_TBS_6980
:
1427 case CX23885_BOARD_TBS_6981
:
1428 case CX23885_BOARD_PROF_8000
:
1429 cx_write(MC417_CTL
, 0x00000036);
1430 cx_write(MC417_OEN
, 0x00001000);
1431 cx_set(MC417_RWD
, 0x00000002);
1433 cx_clear(MC417_RWD
, 0x00000800);
1435 cx_set(MC417_RWD
, 0x00000800);
1438 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
1439 /* GPIO-0 INTA from CiMax1
1440 GPIO-1 INTB from CiMax2
1442 GPIO-3 to GPIO-10 data/addr for CA
1443 GPIO-11 ~CS0 to CiMax1
1444 GPIO-12 ~CS1 to CiMax2
1445 GPIO-13 ADL0 load LSB addr
1446 GPIO-14 ADL1 load MSB addr
1447 GPIO-15 ~RDY from CiMax
1448 GPIO-17 ~RD to CiMax
1449 GPIO-18 ~WR to CiMax
1451 cx_set(GP0_IO
, 0x00040000); /* GPIO as out */
1452 /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */
1453 cx_clear(GP0_IO
, 0x00030004);
1454 mdelay(100);/* reset delay */
1455 cx_set(GP0_IO
, 0x00040004); /* GPIO as out, reset high */
1456 cx_write(MC417_CTL
, 0x00000037);/* enable GPIO3-18 pins */
1457 /* GPIO-15 IN as ~ACK, rest as OUT */
1458 cx_write(MC417_OEN
, 0x00001000);
1459 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
1460 cx_write(MC417_RWD
, 0x0000c300);
1462 cx_write(GPIO_ISM
, 0x00000000);/* INTERRUPTS active low*/
1464 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1465 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
1466 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
1467 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
1468 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
1469 /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */
1470 /* GPIO-6 I2C Gate which can isolate the demod from the bus */
1471 /* GPIO-9 Demod reset */
1473 /* Put the parts into reset and back */
1474 cx23885_gpio_enable(dev
, GPIO_9
| GPIO_6
| GPIO_5
, 1);
1475 cx23885_gpio_set(dev
, GPIO_9
| GPIO_6
| GPIO_5
);
1476 cx23885_gpio_clear(dev
, GPIO_9
);
1478 cx23885_gpio_set(dev
, GPIO_9
);
1480 case CX23885_BOARD_MYGICA_X8506
:
1481 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
1482 case CX23885_BOARD_MYGICA_X8507
:
1483 /* GPIO-0 (0)Analog / (1)Digital TV */
1484 /* GPIO-1 reset XC5000 */
1485 /* GPIO-2 demod reset */
1486 cx23885_gpio_enable(dev
, GPIO_0
| GPIO_1
| GPIO_2
, 1);
1487 cx23885_gpio_clear(dev
, GPIO_1
| GPIO_2
);
1489 cx23885_gpio_set(dev
, GPIO_0
| GPIO_1
| GPIO_2
);
1492 case CX23885_BOARD_MYGICA_X8558PRO
:
1493 /* GPIO-0 reset first ATBM8830 */
1494 /* GPIO-1 reset second ATBM8830 */
1495 cx23885_gpio_enable(dev
, GPIO_0
| GPIO_1
, 1);
1496 cx23885_gpio_clear(dev
, GPIO_0
| GPIO_1
);
1498 cx23885_gpio_set(dev
, GPIO_0
| GPIO_1
);
1501 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1502 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1503 /* GPIO-0 656_CLK */
1506 /* GPIO-3-10 cx23417 data0-7 */
1507 /* GPIO-11-14 cx23417 addr0-3 */
1508 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1510 /* GPIO-20 C_IR_TX */
1511 /* GPIO-21 I2S DAT */
1512 /* GPIO-22 I2S WCLK */
1513 /* GPIO-23 I2S BCLK */
1514 /* ALT GPIO: EXP GPIO LATCH */
1516 /* CX23417 GPIO's */
1517 /* GPIO-14 S5H1411/CX24228 Reset */
1518 /* GPIO-13 EEPROM write protect */
1519 mc417_gpio_enable(dev
, GPIO_14
| GPIO_13
, 1);
1521 /* Put the demod into reset and protect the eeprom */
1522 mc417_gpio_clear(dev
, GPIO_14
| GPIO_13
);
1525 /* Bring the demod out of reset */
1526 mc417_gpio_set(dev
, GPIO_14
);
1530 /* Connected to IF / Mux */
1532 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
1533 cx_set(GP0_IO
, 0x00010001); /* Bring the part out of reset */
1535 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
1538 GPIO-2 ~reset chips out
1539 GPIO-3 to GPIO-10 data/addr for CA in/out
1549 cx_set(GP0_IO
, 0x00060000); /* GPIO-1,2 as out */
1550 /* GPIO-0 as INT, reset & TMS low */
1551 cx_clear(GP0_IO
, 0x00010006);
1552 mdelay(100);/* reset delay */
1553 cx_set(GP0_IO
, 0x00000004); /* reset high */
1554 cx_write(MC417_CTL
, 0x00000037);/* enable GPIO-3..18 pins */
1555 /* GPIO-17 is TDO in, GPIO-15 is ~RDY in, rest is out */
1556 cx_write(MC417_OEN
, 0x00005000);
1557 /* ~RD, ~WR high; ADDR low; ~CS high */
1558 cx_write(MC417_RWD
, 0x00000d00);
1560 cx_write(GPIO_ISM
, 0x00000000);/* INTERRUPTS active low*/
1562 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
1563 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
1564 /* GPIO-8 tda10071 demod reset */
1565 /* GPIO-9 si2165 demod reset (only HVR4400/HVR5500)*/
1567 /* Put the parts into reset and back */
1568 cx23885_gpio_enable(dev
, GPIO_8
| GPIO_9
, 1);
1570 cx23885_gpio_clear(dev
, GPIO_8
| GPIO_9
);
1572 cx23885_gpio_set(dev
, GPIO_8
| GPIO_9
);
1576 case CX23885_BOARD_AVERMEDIA_HC81R
:
1577 cx_clear(MC417_CTL
, 1);
1578 /* GPIO-0,1,2 setup direction as output */
1579 cx_set(GP0_IO
, 0x00070000);
1581 /* AF9013 demod reset */
1582 cx_set(GP0_IO
, 0x00010001);
1584 cx_clear(GP0_IO
, 0x00010001);
1586 cx_set(GP0_IO
, 0x00010001);
1589 cx_clear(GP0_IO
, 0x00030003);
1591 cx_set(GP0_IO
, 0x00020002);
1593 cx_set(GP0_IO
, 0x00010001);
1595 cx_clear(GP0_IO
, 0x00020002);
1596 /* XC3028L tuner reset */
1597 cx_set(GP0_IO
, 0x00040004);
1598 cx_clear(GP0_IO
, 0x00040004);
1599 cx_set(GP0_IO
, 0x00040004);
1602 case CX23885_BOARD_DVBSKY_T9580
:
1603 case CX23885_BOARD_DVBSKY_S952
:
1604 case CX23885_BOARD_DVBSKY_T982
:
1605 /* enable GPIO3-18 pins */
1606 cx_write(MC417_CTL
, 0x00000037);
1607 cx23885_gpio_enable(dev
, GPIO_2
| GPIO_11
, 1);
1608 cx23885_gpio_clear(dev
, GPIO_2
| GPIO_11
);
1610 cx23885_gpio_set(dev
, GPIO_2
| GPIO_11
);
1612 case CX23885_BOARD_DVBSKY_T980C
:
1613 case CX23885_BOARD_DVBSKY_S950C
:
1614 case CX23885_BOARD_TT_CT2_4500_CI
:
1616 * GPIO-0 INTA from CiMax, input
1617 * GPIO-1 reset CiMax, output, high active
1618 * GPIO-2 reset demod, output, low active
1619 * GPIO-3 to GPIO-10 data/addr for CAM
1620 * GPIO-11 ~CS0 to CiMax1
1621 * GPIO-12 ~CS1 to CiMax2
1622 * GPIO-13 ADL0 load LSB addr
1623 * GPIO-14 ADL1 load MSB addr
1624 * GPIO-15 ~RDY from CiMax
1625 * GPIO-17 ~RD to CiMax
1626 * GPIO-18 ~WR to CiMax
1629 cx_set(GP0_IO
, 0x00060002); /* GPIO 1/2 as output */
1630 cx_clear(GP0_IO
, 0x00010004); /* GPIO 0 as input */
1631 mdelay(100); /* reset delay */
1632 cx_set(GP0_IO
, 0x00060004); /* GPIO as out, reset high */
1633 cx_clear(GP0_IO
, 0x00010002);
1634 cx_write(MC417_CTL
, 0x00000037); /* enable GPIO3-18 pins */
1636 /* GPIO-15 IN as ~ACK, rest as OUT */
1637 cx_write(MC417_OEN
, 0x00001000);
1639 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
1640 cx_write(MC417_RWD
, 0x0000c300);
1643 cx_write(GPIO_ISM
, 0x00000000); /* INTERRUPTS active low */
1645 case CX23885_BOARD_DVBSKY_S950
:
1646 cx23885_gpio_enable(dev
, GPIO_2
, 1);
1647 cx23885_gpio_clear(dev
, GPIO_2
);
1649 cx23885_gpio_set(dev
, GPIO_2
);
1651 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
1655 * GPIO-03 VAUX Pres.
1661 * GPIO-15 IR_LED_STATUS
1664 * ALTGPIO VAUX_SWITCH
1665 * AUX_PLL_CLK : Blaster2
1667 /* Put the parts into reset and back */
1668 cx23885_gpio_enable(dev
, GPIO_8
| GPIO_9
, 1);
1669 cx23885_gpio_clear(dev
, GPIO_8
| GPIO_9
);
1671 cx23885_gpio_set(dev
, GPIO_8
| GPIO_9
);
1677 int cx23885_ir_init(struct cx23885_dev
*dev
)
1679 static struct v4l2_subdev_io_pin_config ir_rxtx_pin_cfg
[] = {
1681 .flags
= V4L2_SUBDEV_IO_PIN_INPUT
,
1682 .pin
= CX23885_PIN_IR_RX_GPIO19
,
1683 .function
= CX23885_PAD_IR_RX
,
1685 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1687 .flags
= V4L2_SUBDEV_IO_PIN_OUTPUT
,
1688 .pin
= CX23885_PIN_IR_TX_GPIO20
,
1689 .function
= CX23885_PAD_IR_TX
,
1691 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1694 const size_t ir_rxtx_pin_cfg_count
= ARRAY_SIZE(ir_rxtx_pin_cfg
);
1696 static struct v4l2_subdev_io_pin_config ir_rx_pin_cfg
[] = {
1698 .flags
= V4L2_SUBDEV_IO_PIN_INPUT
,
1699 .pin
= CX23885_PIN_IR_RX_GPIO19
,
1700 .function
= CX23885_PAD_IR_RX
,
1702 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1705 const size_t ir_rx_pin_cfg_count
= ARRAY_SIZE(ir_rx_pin_cfg
);
1707 struct v4l2_subdev_ir_parameters params
;
1709 switch (dev
->board
) {
1710 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1711 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1712 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1713 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
1714 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1715 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
1716 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
1717 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
1718 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
1719 /* FIXME: Implement me */
1721 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1722 ret
= cx23888_ir_probe(dev
);
1725 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_888_IR
);
1726 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1727 ir_rx_pin_cfg_count
, ir_rx_pin_cfg
);
1729 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1730 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1731 ret
= cx23888_ir_probe(dev
);
1734 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_888_IR
);
1735 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1736 ir_rxtx_pin_cfg_count
, ir_rxtx_pin_cfg
);
1738 * For these boards we need to invert the Tx output via the
1739 * IR controller to have the LED off while idle
1741 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_g_parameters
, ¶ms
);
1742 params
.enable
= false;
1743 params
.shutdown
= false;
1744 params
.invert_level
= true;
1745 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_s_parameters
, ¶ms
);
1746 params
.shutdown
= true;
1747 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_s_parameters
, ¶ms
);
1749 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
1750 case CX23885_BOARD_TEVII_S470
:
1751 case CX23885_BOARD_MYGICA_X8507
:
1752 case CX23885_BOARD_TBS_6980
:
1753 case CX23885_BOARD_TBS_6981
:
1754 case CX23885_BOARD_DVBSKY_T9580
:
1755 case CX23885_BOARD_DVBSKY_T980C
:
1756 case CX23885_BOARD_DVBSKY_S950C
:
1757 case CX23885_BOARD_TT_CT2_4500_CI
:
1758 case CX23885_BOARD_DVBSKY_S950
:
1759 case CX23885_BOARD_DVBSKY_S952
:
1760 case CX23885_BOARD_DVBSKY_T982
:
1763 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_AV_CORE
);
1764 if (dev
->sd_ir
== NULL
) {
1768 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1769 ir_rx_pin_cfg_count
, ir_rx_pin_cfg
);
1771 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1774 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_AV_CORE
);
1775 if (dev
->sd_ir
== NULL
) {
1779 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1780 ir_rxtx_pin_cfg_count
, ir_rxtx_pin_cfg
);
1782 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1783 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1784 request_module("ir-kbd-i2c");
1791 void cx23885_ir_fini(struct cx23885_dev
*dev
)
1793 switch (dev
->board
) {
1794 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1795 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1796 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1797 cx23885_irq_remove(dev
, PCI_MSK_IR
);
1798 cx23888_ir_remove(dev
);
1801 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
1802 case CX23885_BOARD_TEVII_S470
:
1803 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1804 case CX23885_BOARD_MYGICA_X8507
:
1805 case CX23885_BOARD_TBS_6980
:
1806 case CX23885_BOARD_TBS_6981
:
1807 case CX23885_BOARD_DVBSKY_T9580
:
1808 case CX23885_BOARD_DVBSKY_T980C
:
1809 case CX23885_BOARD_DVBSKY_S950C
:
1810 case CX23885_BOARD_TT_CT2_4500_CI
:
1811 case CX23885_BOARD_DVBSKY_S950
:
1812 case CX23885_BOARD_DVBSKY_S952
:
1813 case CX23885_BOARD_DVBSKY_T982
:
1814 cx23885_irq_remove(dev
, PCI_MSK_AV_CORE
);
1815 /* sd_ir is a duplicate pointer to the AV Core, just clear it */
1821 static int netup_jtag_io(void *device
, int tms
, int tdi
, int read_tdo
)
1825 struct cx23885_dev
*dev
= (struct cx23885_dev
*)device
;
1827 data
= ((cx_read(GP0_IO
)) & (~0x00000002));
1828 data
|= (tms
? 0x00020002 : 0x00020000);
1829 cx_write(GP0_IO
, data
);
1832 data
= ((cx_read(MC417_RWD
)) & (~0x0000a000));
1833 data
|= (tdi
? 0x00008000 : 0);
1834 cx_write(MC417_RWD
, data
);
1836 tdo
= (data
& 0x00004000) ? 1 : 0; /*TDO*/
1838 cx_write(MC417_RWD
, data
| 0x00002000);
1841 cx_write(MC417_RWD
, data
);
1846 void cx23885_ir_pci_int_enable(struct cx23885_dev
*dev
)
1848 switch (dev
->board
) {
1849 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1850 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1851 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1853 cx23885_irq_add_enable(dev
, PCI_MSK_IR
);
1855 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
1856 case CX23885_BOARD_TEVII_S470
:
1857 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1858 case CX23885_BOARD_MYGICA_X8507
:
1859 case CX23885_BOARD_TBS_6980
:
1860 case CX23885_BOARD_TBS_6981
:
1861 case CX23885_BOARD_DVBSKY_T9580
:
1862 case CX23885_BOARD_DVBSKY_T980C
:
1863 case CX23885_BOARD_DVBSKY_S950C
:
1864 case CX23885_BOARD_TT_CT2_4500_CI
:
1865 case CX23885_BOARD_DVBSKY_S950
:
1866 case CX23885_BOARD_DVBSKY_S952
:
1867 case CX23885_BOARD_DVBSKY_T982
:
1869 cx23885_irq_add_enable(dev
, PCI_MSK_AV_CORE
);
1874 void cx23885_card_setup(struct cx23885_dev
*dev
)
1876 struct cx23885_tsport
*ts1
= &dev
->ts1
;
1877 struct cx23885_tsport
*ts2
= &dev
->ts2
;
1879 static u8 eeprom
[256];
1881 if (dev
->i2c_bus
[0].i2c_rc
== 0) {
1882 dev
->i2c_bus
[0].i2c_client
.addr
= 0xa0 >> 1;
1883 tveeprom_read(&dev
->i2c_bus
[0].i2c_client
,
1884 eeprom
, sizeof(eeprom
));
1887 switch (dev
->board
) {
1888 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1889 if (dev
->i2c_bus
[0].i2c_rc
== 0) {
1890 if (eeprom
[0x80] != 0x84)
1891 hauppauge_eeprom(dev
, eeprom
+0xc0);
1893 hauppauge_eeprom(dev
, eeprom
+0x80);
1896 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1897 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1898 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1899 if (dev
->i2c_bus
[0].i2c_rc
== 0)
1900 hauppauge_eeprom(dev
, eeprom
+0x80);
1902 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1903 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
1904 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
1905 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
1906 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1907 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
1908 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
1909 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
1910 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
1911 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1912 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1913 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
1914 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
1915 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
1916 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
1917 if (dev
->i2c_bus
[0].i2c_rc
== 0)
1918 hauppauge_eeprom(dev
, eeprom
+0xc0);
1922 switch (dev
->board
) {
1923 case CX23885_BOARD_AVERMEDIA_HC81R
:
1924 /* Defaults for VID B */
1925 ts1
->gen_ctrl_val
= 0x4; /* Parallel */
1926 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1927 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1928 /* Defaults for VID C */
1929 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
1930 ts2
->gen_ctrl_val
= 0x10e;
1931 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1932 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1934 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
1935 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1936 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1937 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1938 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1939 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1940 /* break omitted intentionally */
1941 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
:
1942 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1943 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1944 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1946 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1947 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1948 /* Defaults for VID B - Analog encoder */
1949 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
1950 ts1
->gen_ctrl_val
= 0x10e;
1951 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1952 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1954 /* APB_TSVALERR_POL (active low)*/
1955 ts1
->vld_misc_val
= 0x2000;
1956 ts1
->hw_sop_ctrl_val
= (0x47 << 16 | 188 << 4 | 0xc);
1957 cx_write(0x130184, 0xc);
1959 /* Defaults for VID C */
1960 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1961 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1962 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1964 case CX23885_BOARD_TBS_6920
:
1965 ts1
->gen_ctrl_val
= 0x4; /* Parallel */
1966 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1967 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1969 case CX23885_BOARD_TEVII_S470
:
1970 case CX23885_BOARD_TEVII_S471
:
1971 case CX23885_BOARD_DVBWORLD_2005
:
1972 case CX23885_BOARD_PROF_8000
:
1973 case CX23885_BOARD_DVBSKY_T980C
:
1974 case CX23885_BOARD_DVBSKY_S950C
:
1975 case CX23885_BOARD_TT_CT2_4500_CI
:
1976 case CX23885_BOARD_DVBSKY_S950
:
1977 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
1978 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1979 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1981 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
1982 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
1983 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
1984 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1985 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1986 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1987 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1988 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1989 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1991 case CX23885_BOARD_TBS_6980
:
1992 case CX23885_BOARD_TBS_6981
:
1993 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1994 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1995 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
1996 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
1997 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
1998 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2001 case CX23885_BOARD_MYGICA_X8506
:
2002 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
2003 case CX23885_BOARD_MYGICA_X8507
:
2004 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2005 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2006 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2008 case CX23885_BOARD_MYGICA_X8558PRO
:
2009 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2010 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2011 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2012 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2013 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2014 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2016 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
2017 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2018 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2019 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2020 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2021 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2022 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2024 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
2025 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2026 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2027 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2029 case CX23885_BOARD_DVBSKY_T9580
:
2030 case CX23885_BOARD_DVBSKY_T982
:
2031 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2032 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2033 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2034 ts2
->gen_ctrl_val
= 0x8; /* Serial bus */
2035 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2036 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2038 case CX23885_BOARD_DVBSKY_S952
:
2039 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2040 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2041 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2042 ts2
->gen_ctrl_val
= 0xe; /* Serial bus */
2043 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2044 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2046 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
2047 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2048 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2049 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2050 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2051 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2052 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2054 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2055 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
2056 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
2057 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
2058 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
2059 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
2060 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
2061 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
2062 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
2063 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
2064 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
2065 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
2066 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2067 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
2068 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
2069 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
2070 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
2071 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
2072 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2073 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
2075 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2076 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2077 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2080 /* Certain boards support analog, or require the avcore to be
2081 * loaded, ensure this happens.
2083 switch (dev
->board
) {
2084 case CX23885_BOARD_TEVII_S470
:
2085 /* Currently only enabled for the integrated IR controller */
2088 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2089 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
2090 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
2091 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
2092 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
2093 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
2094 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
2095 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
2096 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
2097 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
2098 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
2099 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
2100 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
2101 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
2102 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2103 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2104 case CX23885_BOARD_MYGICA_X8506
:
2105 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
2106 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2107 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
2108 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
2109 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
2110 case CX23885_BOARD_MPX885
:
2111 case CX23885_BOARD_MYGICA_X8507
:
2112 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
2113 case CX23885_BOARD_AVERMEDIA_HC81R
:
2114 case CX23885_BOARD_TBS_6980
:
2115 case CX23885_BOARD_TBS_6981
:
2116 case CX23885_BOARD_DVBSKY_T9580
:
2117 case CX23885_BOARD_DVBSKY_T980C
:
2118 case CX23885_BOARD_DVBSKY_S950C
:
2119 case CX23885_BOARD_TT_CT2_4500_CI
:
2120 case CX23885_BOARD_DVBSKY_S950
:
2121 case CX23885_BOARD_DVBSKY_S952
:
2122 case CX23885_BOARD_DVBSKY_T982
:
2123 dev
->sd_cx25840
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2124 &dev
->i2c_bus
[2].i2c_adap
,
2125 "cx25840", 0x88 >> 1, NULL
);
2126 if (dev
->sd_cx25840
) {
2127 dev
->sd_cx25840
->grp_id
= CX23885_HW_AV_CORE
;
2128 v4l2_subdev_call(dev
->sd_cx25840
, core
, load_fw
);
2133 /* AUX-PLL 27MHz CLK */
2134 switch (dev
->board
) {
2135 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
2136 netup_initialize(dev
);
2138 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
: {
2140 const struct firmware
*fw
;
2141 const char *filename
= "dvb-netup-altera-01.fw";
2142 char *action
= "configure";
2143 static struct netup_card_info cinfo
;
2144 struct altera_config netup_config
= {
2147 .jtag_io
= netup_jtag_io
,
2150 netup_initialize(dev
);
2152 netup_get_card_info(&dev
->i2c_bus
[0].i2c_adap
, &cinfo
);
2154 cinfo
.rev
= netup_card_rev
;
2156 switch (cinfo
.rev
) {
2158 filename
= "dvb-netup-altera-04.fw";
2161 filename
= "dvb-netup-altera-01.fw";
2164 printk(KERN_INFO
"NetUP card rev=0x%x fw_filename=%s\n",
2165 cinfo
.rev
, filename
);
2167 ret
= request_firmware(&fw
, filename
, &dev
->pci
->dev
);
2169 printk(KERN_ERR
"did not find the firmware file. (%s) "
2170 "Please see linux/Documentation/dvb/ for more details "
2171 "on firmware-problems.", filename
);
2173 altera_init(&netup_config
, fw
);
2175 release_firmware(fw
);