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.
20 #include <linux/init.h>
21 #include <linux/module.h>
22 #include <linux/pci.h>
23 #include <linux/delay.h>
24 #include <media/drv-intf/cx25840.h>
25 #include <linux/firmware.h>
26 #include <misc/altera.h>
28 #include "tuner-xc2028.h"
29 #include "netup-eeprom.h"
30 #include "netup-init.h"
31 #include "altera-ci.h"
34 #include "cx23888-ir.h"
36 static unsigned int netup_card_rev
= 4;
37 module_param(netup_card_rev
, int, 0644);
38 MODULE_PARM_DESC(netup_card_rev
,
39 "NetUP Dual DVB-T/C CI card revision");
40 static unsigned int enable_885_ir
;
41 module_param(enable_885_ir
, int, 0644);
42 MODULE_PARM_DESC(enable_885_ir
,
43 "Enable integrated IR controller for supported\n"
44 "\t\t CX2388[57] boards that are wired for it:\n"
45 "\t\t\tHVR-1250 (reported safe)\n"
46 "\t\t\tTerraTec Cinergy T PCIe Dual (not well tested, appears to be safe)\n"
47 "\t\t\tTeVii S470 (reported unsafe)\n"
48 "\t\t This can cause an interrupt storm with some cards.\n"
49 "\t\t Default: 0 [Disabled]");
51 /* ------------------------------------------------------------------ */
52 /* board config info */
54 struct cx23885_board cx23885_boards
[] = {
55 [CX23885_BOARD_UNKNOWN
] = {
56 .name
= "UNKNOWN/GENERIC",
57 /* Ensure safe default for unknown boards */
60 .type
= CX23885_VMUX_COMPOSITE1
,
63 .type
= CX23885_VMUX_COMPOSITE2
,
66 .type
= CX23885_VMUX_COMPOSITE3
,
69 .type
= CX23885_VMUX_COMPOSITE4
,
73 [CX23885_BOARD_HAUPPAUGE_HVR1800lp
] = {
74 .name
= "Hauppauge WinTV-HVR1800lp",
75 .portc
= CX23885_MPEG_DVB
,
77 .type
= CX23885_VMUX_TELEVISION
,
81 .type
= CX23885_VMUX_DEBUG
,
85 .type
= CX23885_VMUX_COMPOSITE1
,
89 .type
= CX23885_VMUX_SVIDEO
,
94 [CX23885_BOARD_HAUPPAUGE_HVR1800
] = {
95 .name
= "Hauppauge WinTV-HVR1800",
96 .porta
= CX23885_ANALOG_VIDEO
,
97 .portb
= CX23885_MPEG_ENCODER
,
98 .portc
= CX23885_MPEG_DVB
,
99 .tuner_type
= TUNER_PHILIPS_TDA8290
,
100 .tuner_addr
= 0x42, /* 0x84 >> 1 */
103 .type
= CX23885_VMUX_TELEVISION
,
104 .vmux
= CX25840_VIN7_CH3
|
107 .amux
= CX25840_AUDIO8
,
110 .type
= CX23885_VMUX_COMPOSITE1
,
111 .vmux
= CX25840_VIN7_CH3
|
114 .amux
= CX25840_AUDIO7
,
117 .type
= CX23885_VMUX_SVIDEO
,
118 .vmux
= CX25840_VIN7_CH3
|
122 .amux
= CX25840_AUDIO7
,
126 [CX23885_BOARD_HAUPPAUGE_HVR1250
] = {
127 .name
= "Hauppauge WinTV-HVR1250",
128 .porta
= CX23885_ANALOG_VIDEO
,
129 .portc
= CX23885_MPEG_DVB
,
130 #ifdef MT2131_NO_ANALOG_SUPPORT_YET
131 .tuner_type
= TUNER_PHILIPS_TDA8290
,
132 .tuner_addr
= 0x42, /* 0x84 >> 1 */
137 #ifdef MT2131_NO_ANALOG_SUPPORT_YET
138 .type
= CX23885_VMUX_TELEVISION
,
139 .vmux
= CX25840_VIN7_CH3
|
142 .amux
= CX25840_AUDIO8
,
146 .type
= CX23885_VMUX_COMPOSITE1
,
147 .vmux
= CX25840_VIN7_CH3
|
150 .amux
= CX25840_AUDIO7
,
153 .type
= CX23885_VMUX_SVIDEO
,
154 .vmux
= CX25840_VIN7_CH3
|
158 .amux
= CX25840_AUDIO7
,
162 [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
] = {
163 .name
= "DViCO FusionHDTV5 Express",
164 .portb
= CX23885_MPEG_DVB
,
166 [CX23885_BOARD_HAUPPAUGE_HVR1500Q
] = {
167 .name
= "Hauppauge WinTV-HVR1500Q",
168 .portc
= CX23885_MPEG_DVB
,
170 [CX23885_BOARD_HAUPPAUGE_HVR1500
] = {
171 .name
= "Hauppauge WinTV-HVR1500",
172 .porta
= CX23885_ANALOG_VIDEO
,
173 .portc
= CX23885_MPEG_DVB
,
174 .tuner_type
= TUNER_XC2028
,
175 .tuner_addr
= 0x61, /* 0xc2 >> 1 */
177 .type
= CX23885_VMUX_TELEVISION
,
178 .vmux
= CX25840_VIN7_CH3
|
183 .type
= CX23885_VMUX_COMPOSITE1
,
184 .vmux
= CX25840_VIN7_CH3
|
189 .type
= CX23885_VMUX_SVIDEO
,
190 .vmux
= CX25840_VIN7_CH3
|
197 [CX23885_BOARD_HAUPPAUGE_HVR1200
] = {
198 .name
= "Hauppauge WinTV-HVR1200",
199 .portc
= CX23885_MPEG_DVB
,
201 [CX23885_BOARD_HAUPPAUGE_HVR1700
] = {
202 .name
= "Hauppauge WinTV-HVR1700",
203 .portc
= CX23885_MPEG_DVB
,
205 [CX23885_BOARD_HAUPPAUGE_HVR1400
] = {
206 .name
= "Hauppauge WinTV-HVR1400",
207 .portc
= CX23885_MPEG_DVB
,
209 [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
] = {
210 .name
= "DViCO FusionHDTV7 Dual Express",
211 .portb
= CX23885_MPEG_DVB
,
212 .portc
= CX23885_MPEG_DVB
,
214 [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
] = {
215 .name
= "DViCO FusionHDTV DVB-T Dual Express",
216 .portb
= CX23885_MPEG_DVB
,
217 .portc
= CX23885_MPEG_DVB
,
219 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
] = {
220 .name
= "Leadtek Winfast PxDVR3200 H",
221 .portc
= CX23885_MPEG_DVB
,
223 [CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
] = {
224 .name
= "Leadtek Winfast PxPVR2200",
225 .porta
= CX23885_ANALOG_VIDEO
,
226 .tuner_type
= TUNER_XC2028
,
230 .type
= CX23885_VMUX_TELEVISION
,
231 .vmux
= CX25840_VIN2_CH1
|
233 .amux
= CX25840_AUDIO8
,
236 .type
= CX23885_VMUX_COMPOSITE1
,
237 .vmux
= CX25840_COMPOSITE1
,
238 .amux
= CX25840_AUDIO7
,
241 .type
= CX23885_VMUX_SVIDEO
,
242 .vmux
= CX25840_SVIDEO_LUMA3
|
243 CX25840_SVIDEO_CHROMA4
,
244 .amux
= CX25840_AUDIO7
,
247 .type
= CX23885_VMUX_COMPONENT
,
248 .vmux
= CX25840_VIN7_CH1
|
251 CX25840_COMPONENT_ON
,
252 .amux
= CX25840_AUDIO7
,
256 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
] = {
257 .name
= "Leadtek Winfast PxDVR3200 H XC4000",
258 .porta
= CX23885_ANALOG_VIDEO
,
259 .portc
= CX23885_MPEG_DVB
,
260 .tuner_type
= TUNER_XC4000
,
263 .radio_addr
= ADDR_UNSET
,
265 .type
= CX23885_VMUX_TELEVISION
,
266 .vmux
= CX25840_VIN2_CH1
|
270 .type
= CX23885_VMUX_COMPOSITE1
,
271 .vmux
= CX25840_COMPOSITE1
,
273 .type
= CX23885_VMUX_SVIDEO
,
274 .vmux
= CX25840_SVIDEO_LUMA3
|
275 CX25840_SVIDEO_CHROMA4
,
277 .type
= CX23885_VMUX_COMPONENT
,
278 .vmux
= CX25840_VIN7_CH1
|
281 CX25840_COMPONENT_ON
,
284 [CX23885_BOARD_COMPRO_VIDEOMATE_E650F
] = {
285 .name
= "Compro VideoMate E650F",
286 .portc
= CX23885_MPEG_DVB
,
288 [CX23885_BOARD_TBS_6920
] = {
289 .name
= "TurboSight TBS 6920",
290 .portb
= CX23885_MPEG_DVB
,
292 [CX23885_BOARD_TBS_6980
] = {
293 .name
= "TurboSight TBS 6980",
294 .portb
= CX23885_MPEG_DVB
,
295 .portc
= CX23885_MPEG_DVB
,
297 [CX23885_BOARD_TBS_6981
] = {
298 .name
= "TurboSight TBS 6981",
299 .portb
= CX23885_MPEG_DVB
,
300 .portc
= CX23885_MPEG_DVB
,
302 [CX23885_BOARD_TEVII_S470
] = {
303 .name
= "TeVii S470",
304 .portb
= CX23885_MPEG_DVB
,
306 [CX23885_BOARD_DVBWORLD_2005
] = {
307 .name
= "DVBWorld DVB-S2 2005",
308 .portb
= CX23885_MPEG_DVB
,
310 [CX23885_BOARD_NETUP_DUAL_DVBS2_CI
] = {
312 .name
= "NetUP Dual DVB-S2 CI",
313 .portb
= CX23885_MPEG_DVB
,
314 .portc
= CX23885_MPEG_DVB
,
316 [CX23885_BOARD_HAUPPAUGE_HVR1270
] = {
317 .name
= "Hauppauge WinTV-HVR1270",
318 .portc
= CX23885_MPEG_DVB
,
320 [CX23885_BOARD_HAUPPAUGE_HVR1275
] = {
321 .name
= "Hauppauge WinTV-HVR1275",
322 .portc
= CX23885_MPEG_DVB
,
324 [CX23885_BOARD_HAUPPAUGE_HVR1255
] = {
325 .name
= "Hauppauge WinTV-HVR1255",
326 .porta
= CX23885_ANALOG_VIDEO
,
327 .portc
= CX23885_MPEG_DVB
,
328 .tuner_type
= TUNER_ABSENT
,
329 .tuner_addr
= 0x42, /* 0x84 >> 1 */
332 .type
= CX23885_VMUX_TELEVISION
,
333 .vmux
= CX25840_VIN7_CH3
|
337 .amux
= CX25840_AUDIO8
,
339 .type
= CX23885_VMUX_COMPOSITE1
,
340 .vmux
= CX25840_VIN7_CH3
|
343 .amux
= CX25840_AUDIO7
,
345 .type
= CX23885_VMUX_SVIDEO
,
346 .vmux
= CX25840_VIN7_CH3
|
350 .amux
= CX25840_AUDIO7
,
353 [CX23885_BOARD_HAUPPAUGE_HVR1255_22111
] = {
354 .name
= "Hauppauge WinTV-HVR1255",
355 .porta
= CX23885_ANALOG_VIDEO
,
356 .portc
= CX23885_MPEG_DVB
,
357 .tuner_type
= TUNER_ABSENT
,
358 .tuner_addr
= 0x42, /* 0x84 >> 1 */
361 .type
= CX23885_VMUX_TELEVISION
,
362 .vmux
= CX25840_VIN7_CH3
|
366 .amux
= CX25840_AUDIO8
,
368 .type
= CX23885_VMUX_SVIDEO
,
369 .vmux
= CX25840_VIN7_CH3
|
373 .amux
= CX25840_AUDIO7
,
376 [CX23885_BOARD_HAUPPAUGE_HVR1210
] = {
377 .name
= "Hauppauge WinTV-HVR1210",
378 .portc
= CX23885_MPEG_DVB
,
380 [CX23885_BOARD_MYGICA_X8506
] = {
381 .name
= "Mygica X8506 DMB-TH",
382 .tuner_type
= TUNER_XC5000
,
385 .porta
= CX23885_ANALOG_VIDEO
,
386 .portb
= CX23885_MPEG_DVB
,
389 .type
= CX23885_VMUX_TELEVISION
,
390 .vmux
= CX25840_COMPOSITE2
,
393 .type
= CX23885_VMUX_COMPOSITE1
,
394 .vmux
= CX25840_COMPOSITE8
,
397 .type
= CX23885_VMUX_SVIDEO
,
398 .vmux
= CX25840_SVIDEO_LUMA3
|
399 CX25840_SVIDEO_CHROMA4
,
402 .type
= CX23885_VMUX_COMPONENT
,
403 .vmux
= CX25840_COMPONENT_ON
|
410 [CX23885_BOARD_MAGICPRO_PROHDTVE2
] = {
411 .name
= "Magic-Pro ProHDTV Extreme 2",
412 .tuner_type
= TUNER_XC5000
,
415 .porta
= CX23885_ANALOG_VIDEO
,
416 .portb
= CX23885_MPEG_DVB
,
419 .type
= CX23885_VMUX_TELEVISION
,
420 .vmux
= CX25840_COMPOSITE2
,
423 .type
= CX23885_VMUX_COMPOSITE1
,
424 .vmux
= CX25840_COMPOSITE8
,
427 .type
= CX23885_VMUX_SVIDEO
,
428 .vmux
= CX25840_SVIDEO_LUMA3
|
429 CX25840_SVIDEO_CHROMA4
,
432 .type
= CX23885_VMUX_COMPONENT
,
433 .vmux
= CX25840_COMPONENT_ON
|
440 [CX23885_BOARD_HAUPPAUGE_HVR1850
] = {
441 .name
= "Hauppauge WinTV-HVR1850",
442 .porta
= CX23885_ANALOG_VIDEO
,
443 .portb
= CX23885_MPEG_ENCODER
,
444 .portc
= CX23885_MPEG_DVB
,
445 .tuner_type
= TUNER_ABSENT
,
446 .tuner_addr
= 0x42, /* 0x84 >> 1 */
449 .type
= CX23885_VMUX_TELEVISION
,
450 .vmux
= CX25840_VIN7_CH3
|
454 .amux
= CX25840_AUDIO8
,
456 .type
= CX23885_VMUX_COMPOSITE1
,
457 .vmux
= CX25840_VIN7_CH3
|
460 .amux
= CX25840_AUDIO7
,
462 .type
= CX23885_VMUX_SVIDEO
,
463 .vmux
= CX25840_VIN7_CH3
|
467 .amux
= CX25840_AUDIO7
,
470 [CX23885_BOARD_COMPRO_VIDEOMATE_E800
] = {
471 .name
= "Compro VideoMate E800",
472 .portc
= CX23885_MPEG_DVB
,
474 [CX23885_BOARD_HAUPPAUGE_HVR1290
] = {
475 .name
= "Hauppauge WinTV-HVR1290",
476 .portc
= CX23885_MPEG_DVB
,
478 [CX23885_BOARD_MYGICA_X8558PRO
] = {
479 .name
= "Mygica X8558 PRO DMB-TH",
480 .portb
= CX23885_MPEG_DVB
,
481 .portc
= CX23885_MPEG_DVB
,
483 [CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
] = {
484 .name
= "LEADTEK WinFast PxTV1200",
485 .porta
= CX23885_ANALOG_VIDEO
,
486 .tuner_type
= TUNER_XC2028
,
490 .type
= CX23885_VMUX_TELEVISION
,
491 .vmux
= CX25840_VIN2_CH1
|
495 .type
= CX23885_VMUX_COMPOSITE1
,
496 .vmux
= CX25840_COMPOSITE1
,
498 .type
= CX23885_VMUX_SVIDEO
,
499 .vmux
= CX25840_SVIDEO_LUMA3
|
500 CX25840_SVIDEO_CHROMA4
,
502 .type
= CX23885_VMUX_COMPONENT
,
503 .vmux
= CX25840_VIN7_CH1
|
506 CX25840_COMPONENT_ON
,
509 [CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
] = {
510 .name
= "GoTView X5 3D Hybrid",
511 .tuner_type
= TUNER_XC5000
,
514 .porta
= CX23885_ANALOG_VIDEO
,
515 .portb
= CX23885_MPEG_DVB
,
517 .type
= CX23885_VMUX_TELEVISION
,
518 .vmux
= CX25840_VIN2_CH1
|
522 .type
= CX23885_VMUX_COMPOSITE1
,
523 .vmux
= CX23885_VMUX_COMPOSITE1
,
525 .type
= CX23885_VMUX_SVIDEO
,
526 .vmux
= CX25840_SVIDEO_LUMA3
|
527 CX25840_SVIDEO_CHROMA4
,
530 [CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
] = {
532 .name
= "NetUP Dual DVB-T/C-CI RF",
533 .porta
= CX23885_ANALOG_VIDEO
,
534 .portb
= CX23885_MPEG_DVB
,
535 .portc
= CX23885_MPEG_DVB
,
538 .tuner_type
= TUNER_XC5000
,
541 .type
= CX23885_VMUX_TELEVISION
,
542 .vmux
= CX25840_COMPOSITE1
,
545 [CX23885_BOARD_MPX885
] = {
547 .porta
= CX23885_ANALOG_VIDEO
,
549 .type
= CX23885_VMUX_COMPOSITE1
,
550 .vmux
= CX25840_COMPOSITE1
,
551 .amux
= CX25840_AUDIO6
,
554 .type
= CX23885_VMUX_COMPOSITE2
,
555 .vmux
= CX25840_COMPOSITE2
,
556 .amux
= CX25840_AUDIO6
,
559 .type
= CX23885_VMUX_COMPOSITE3
,
560 .vmux
= CX25840_COMPOSITE3
,
561 .amux
= CX25840_AUDIO7
,
564 .type
= CX23885_VMUX_COMPOSITE4
,
565 .vmux
= CX25840_COMPOSITE4
,
566 .amux
= CX25840_AUDIO7
,
570 [CX23885_BOARD_MYGICA_X8507
] = {
571 .name
= "Mygica X8502/X8507 ISDB-T",
572 .tuner_type
= TUNER_XC5000
,
575 .porta
= CX23885_ANALOG_VIDEO
,
576 .portb
= CX23885_MPEG_DVB
,
579 .type
= CX23885_VMUX_TELEVISION
,
580 .vmux
= CX25840_COMPOSITE2
,
581 .amux
= CX25840_AUDIO8
,
584 .type
= CX23885_VMUX_COMPOSITE1
,
585 .vmux
= CX25840_COMPOSITE8
,
586 .amux
= CX25840_AUDIO7
,
589 .type
= CX23885_VMUX_SVIDEO
,
590 .vmux
= CX25840_SVIDEO_LUMA3
|
591 CX25840_SVIDEO_CHROMA4
,
592 .amux
= CX25840_AUDIO7
,
595 .type
= CX23885_VMUX_COMPONENT
,
596 .vmux
= CX25840_COMPONENT_ON
|
600 .amux
= CX25840_AUDIO7
,
604 [CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
] = {
605 .name
= "TerraTec Cinergy T PCIe Dual",
606 .portb
= CX23885_MPEG_DVB
,
607 .portc
= CX23885_MPEG_DVB
,
609 [CX23885_BOARD_TEVII_S471
] = {
610 .name
= "TeVii S471",
611 .portb
= CX23885_MPEG_DVB
,
613 [CX23885_BOARD_PROF_8000
] = {
614 .name
= "Prof Revolution DVB-S2 8000",
615 .portb
= CX23885_MPEG_DVB
,
617 [CX23885_BOARD_HAUPPAUGE_HVR4400
] = {
618 .name
= "Hauppauge WinTV-HVR4400/HVR5500",
619 .porta
= CX23885_ANALOG_VIDEO
,
620 .portb
= CX23885_MPEG_DVB
,
621 .portc
= CX23885_MPEG_DVB
,
622 .tuner_type
= TUNER_NXP_TDA18271
,
623 .tuner_addr
= 0x60, /* 0xc0 >> 1 */
626 [CX23885_BOARD_HAUPPAUGE_STARBURST
] = {
627 .name
= "Hauppauge WinTV Starburst",
628 .portb
= CX23885_MPEG_DVB
,
630 [CX23885_BOARD_AVERMEDIA_HC81R
] = {
631 .name
= "AVerTV Hybrid Express Slim HC81R",
632 .tuner_type
= TUNER_XC2028
,
633 .tuner_addr
= 0x61, /* 0xc2 >> 1 */
635 .porta
= CX23885_ANALOG_VIDEO
,
637 .type
= CX23885_VMUX_TELEVISION
,
638 .vmux
= CX25840_VIN2_CH1
|
642 .amux
= CX25840_AUDIO8
,
644 .type
= CX23885_VMUX_SVIDEO
,
645 .vmux
= CX25840_VIN8_CH1
|
649 .amux
= CX25840_AUDIO6
,
651 .type
= CX23885_VMUX_COMPONENT
,
652 .vmux
= CX25840_VIN1_CH1
|
656 .amux
= CX25840_AUDIO6
,
659 [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
] = {
660 .name
= "DViCO FusionHDTV DVB-T Dual Express2",
661 .portb
= CX23885_MPEG_DVB
,
662 .portc
= CX23885_MPEG_DVB
,
664 [CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
] = {
665 .name
= "Hauppauge ImpactVCB-e",
666 .tuner_type
= TUNER_ABSENT
,
667 .porta
= CX23885_ANALOG_VIDEO
,
669 .type
= CX23885_VMUX_COMPOSITE1
,
670 .vmux
= CX25840_VIN7_CH3
|
673 .amux
= CX25840_AUDIO7
,
675 .type
= CX23885_VMUX_SVIDEO
,
676 .vmux
= CX25840_VIN7_CH3
|
680 .amux
= CX25840_AUDIO7
,
683 [CX23885_BOARD_DVBSKY_T9580
] = {
684 .name
= "DVBSky T9580",
685 .portb
= CX23885_MPEG_DVB
,
686 .portc
= CX23885_MPEG_DVB
,
688 [CX23885_BOARD_DVBSKY_T980C
] = {
689 .name
= "DVBSky T980C",
690 .portb
= CX23885_MPEG_DVB
,
692 [CX23885_BOARD_DVBSKY_S950C
] = {
693 .name
= "DVBSky S950C",
694 .portb
= CX23885_MPEG_DVB
,
696 [CX23885_BOARD_TT_CT2_4500_CI
] = {
697 .name
= "Technotrend TT-budget CT2-4500 CI",
698 .portb
= CX23885_MPEG_DVB
,
700 [CX23885_BOARD_DVBSKY_S950
] = {
701 .name
= "DVBSky S950",
702 .portb
= CX23885_MPEG_DVB
,
704 [CX23885_BOARD_DVBSKY_S952
] = {
705 .name
= "DVBSky S952",
706 .portb
= CX23885_MPEG_DVB
,
707 .portc
= CX23885_MPEG_DVB
,
709 [CX23885_BOARD_DVBSKY_T982
] = {
710 .name
= "DVBSky T982",
711 .portb
= CX23885_MPEG_DVB
,
712 .portc
= CX23885_MPEG_DVB
,
714 [CX23885_BOARD_HAUPPAUGE_HVR5525
] = {
715 .name
= "Hauppauge WinTV-HVR5525",
716 .portb
= CX23885_MPEG_DVB
,
717 .portc
= CX23885_MPEG_DVB
,
719 [CX23885_BOARD_VIEWCAST_260E
] = {
720 .name
= "ViewCast 260e",
721 .porta
= CX23885_ANALOG_VIDEO
,
724 .type
= CX23885_VMUX_COMPOSITE1
,
725 .vmux
= CX25840_VIN6_CH1
,
726 .amux
= CX25840_AUDIO7
,
728 .type
= CX23885_VMUX_SVIDEO
,
729 .vmux
= CX25840_VIN7_CH3
|
732 .amux
= CX25840_AUDIO7
,
734 .type
= CX23885_VMUX_COMPONENT
,
735 .vmux
= CX25840_VIN7_CH3
|
738 CX25840_COMPONENT_ON
,
739 .amux
= CX25840_AUDIO7
,
742 [CX23885_BOARD_VIEWCAST_460E
] = {
743 .name
= "ViewCast 460e",
744 .porta
= CX23885_ANALOG_VIDEO
,
747 .type
= CX23885_VMUX_COMPOSITE1
,
748 .vmux
= CX25840_VIN4_CH1
,
749 .amux
= CX25840_AUDIO7
,
751 .type
= CX23885_VMUX_SVIDEO
,
752 .vmux
= CX25840_VIN7_CH3
|
755 .amux
= CX25840_AUDIO7
,
757 .type
= CX23885_VMUX_COMPONENT
,
758 .vmux
= CX25840_VIN7_CH3
|
761 CX25840_COMPONENT_ON
,
762 .amux
= CX25840_AUDIO7
,
764 .type
= CX23885_VMUX_COMPOSITE2
,
765 .vmux
= CX25840_VIN6_CH1
,
766 .amux
= CX25840_AUDIO7
,
769 [CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
] = {
770 .name
= "Hauppauge WinTV-QuadHD-DVB",
771 .portb
= CX23885_MPEG_DVB
,
772 .portc
= CX23885_MPEG_DVB
,
774 [CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885
] = {
775 .name
= "Hauppauge WinTV-QuadHD-DVB(885)",
776 .portb
= CX23885_MPEG_DVB
,
777 .portc
= CX23885_MPEG_DVB
,
779 [CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
] = {
780 .name
= "Hauppauge WinTV-QuadHD-ATSC",
781 .portb
= CX23885_MPEG_DVB
,
782 .portc
= CX23885_MPEG_DVB
,
784 [CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885
] = {
785 .name
= "Hauppauge WinTV-QuadHD-ATSC(885)",
786 .portb
= CX23885_MPEG_DVB
,
787 .portc
= CX23885_MPEG_DVB
,
789 [CX23885_BOARD_HAUPPAUGE_HVR1265_K4
] = {
790 .name
= "Hauppauge WinTV-HVR-1265(161111)",
791 .porta
= CX23885_ANALOG_VIDEO
,
792 .portc
= CX23885_MPEG_DVB
,
793 .tuner_type
= TUNER_ABSENT
,
796 .type
= CX23885_VMUX_COMPOSITE1
,
797 .vmux
= CX25840_VIN7_CH3
|
800 .amux
= CX25840_AUDIO7
,
802 .type
= CX23885_VMUX_SVIDEO
,
803 .vmux
= CX25840_VIN7_CH3
|
807 .amux
= CX25840_AUDIO7
,
810 [CX23885_BOARD_HAUPPAUGE_STARBURST2
] = {
811 .name
= "Hauppauge WinTV-Starburst2",
812 .portb
= CX23885_MPEG_DVB
,
815 const unsigned int cx23885_bcount
= ARRAY_SIZE(cx23885_boards
);
817 /* ------------------------------------------------------------------ */
818 /* PCI subsystem IDs */
820 struct cx23885_subid cx23885_subids
[] = {
824 .card
= CX23885_BOARD_UNKNOWN
,
828 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800lp
,
832 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
836 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
840 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
844 .card
= CX23885_BOARD_HAUPPAUGE_HVR1250
,
848 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
,
852 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
856 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
860 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
864 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
868 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
872 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
876 .card
= CX23885_BOARD_HAUPPAUGE_HVR1700
,
880 .card
= CX23885_BOARD_HAUPPAUGE_HVR1400
,
884 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
,
888 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
,
892 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
,
896 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
,
900 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
,
904 .card
= CX23885_BOARD_COMPRO_VIDEOMATE_E650F
,
908 .card
= CX23885_BOARD_TBS_6920
,
912 .card
= CX23885_BOARD_TBS_6980
,
916 .card
= CX23885_BOARD_TBS_6981
,
920 .card
= CX23885_BOARD_TEVII_S470
,
924 .card
= CX23885_BOARD_DVBWORLD_2005
,
928 .card
= CX23885_BOARD_NETUP_DUAL_DVBS2_CI
,
932 .card
= CX23885_BOARD_HAUPPAUGE_HVR1270
,
936 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
940 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
944 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255
,
948 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255_22111
,
952 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
956 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
960 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
964 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
968 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
972 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255
,
976 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
980 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
984 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
988 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
, /* HVR1215 */
992 .card
= CX23885_BOARD_MYGICA_X8506
,
996 .card
= CX23885_BOARD_MAGICPRO_PROHDTVE2
,
1000 .card
= CX23885_BOARD_HAUPPAUGE_HVR1850
,
1002 .subvendor
= 0x1858,
1003 .subdevice
= 0xe800,
1004 .card
= CX23885_BOARD_COMPRO_VIDEOMATE_E800
,
1006 .subvendor
= 0x0070,
1007 .subdevice
= 0x8551,
1008 .card
= CX23885_BOARD_HAUPPAUGE_HVR1290
,
1010 .subvendor
= 0x14f1,
1011 .subdevice
= 0x8578,
1012 .card
= CX23885_BOARD_MYGICA_X8558PRO
,
1014 .subvendor
= 0x107d,
1015 .subdevice
= 0x6f22,
1016 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
,
1018 .subvendor
= 0x5654,
1019 .subdevice
= 0x2390,
1020 .card
= CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
,
1022 .subvendor
= 0x1b55,
1023 .subdevice
= 0xe2e4,
1024 .card
= CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
,
1026 .subvendor
= 0x14f1,
1027 .subdevice
= 0x8502,
1028 .card
= CX23885_BOARD_MYGICA_X8507
,
1030 .subvendor
= 0x153b,
1031 .subdevice
= 0x117e,
1032 .card
= CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
,
1034 .subvendor
= 0xd471,
1035 .subdevice
= 0x9022,
1036 .card
= CX23885_BOARD_TEVII_S471
,
1038 .subvendor
= 0x8000,
1039 .subdevice
= 0x3034,
1040 .card
= CX23885_BOARD_PROF_8000
,
1042 .subvendor
= 0x0070,
1043 .subdevice
= 0xc108,
1044 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-4400 (Model 121xxx, Hybrid DVB-T/S2, IR) */
1046 .subvendor
= 0x0070,
1047 .subdevice
= 0xc138,
1048 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-5500 (Model 121xxx, Hybrid DVB-T/C/S2, IR) */
1050 .subvendor
= 0x0070,
1051 .subdevice
= 0xc12a,
1052 .card
= CX23885_BOARD_HAUPPAUGE_STARBURST
, /* Hauppauge WinTV Starburst (Model 121x00, DVB-S2, IR) */
1054 .subvendor
= 0x0070,
1055 .subdevice
= 0xc1f8,
1056 .card
= CX23885_BOARD_HAUPPAUGE_HVR4400
, /* Hauppauge WinTV HVR-5500 (Model 121xxx, Hybrid DVB-T/C/S2, IR) */
1058 .subvendor
= 0x1461,
1059 .subdevice
= 0xd939,
1060 .card
= CX23885_BOARD_AVERMEDIA_HC81R
,
1062 .subvendor
= 0x0070,
1063 .subdevice
= 0x7133,
1064 .card
= CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
,
1066 .subvendor
= 0x0070,
1067 .subdevice
= 0x7137,
1068 .card
= CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
,
1070 .subvendor
= 0x18ac,
1071 .subdevice
= 0xdb98,
1072 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
,
1074 .subvendor
= 0x4254,
1075 .subdevice
= 0x9580,
1076 .card
= CX23885_BOARD_DVBSKY_T9580
,
1078 .subvendor
= 0x4254,
1079 .subdevice
= 0x980c,
1080 .card
= CX23885_BOARD_DVBSKY_T980C
,
1082 .subvendor
= 0x4254,
1083 .subdevice
= 0x950c,
1084 .card
= CX23885_BOARD_DVBSKY_S950C
,
1086 .subvendor
= 0x13c2,
1087 .subdevice
= 0x3013,
1088 .card
= CX23885_BOARD_TT_CT2_4500_CI
,
1090 .subvendor
= 0x4254,
1091 .subdevice
= 0x0950,
1092 .card
= CX23885_BOARD_DVBSKY_S950
,
1094 .subvendor
= 0x4254,
1095 .subdevice
= 0x0952,
1096 .card
= CX23885_BOARD_DVBSKY_S952
,
1098 .subvendor
= 0x4254,
1099 .subdevice
= 0x0982,
1100 .card
= CX23885_BOARD_DVBSKY_T982
,
1102 .subvendor
= 0x0070,
1103 .subdevice
= 0xf038,
1104 .card
= CX23885_BOARD_HAUPPAUGE_HVR5525
,
1106 .subvendor
= 0x1576,
1107 .subdevice
= 0x0260,
1108 .card
= CX23885_BOARD_VIEWCAST_260E
,
1110 .subvendor
= 0x1576,
1111 .subdevice
= 0x0460,
1112 .card
= CX23885_BOARD_VIEWCAST_460E
,
1114 .subvendor
= 0x0070,
1115 .subdevice
= 0x6a28,
1116 .card
= CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
, /* Tuner Pair 1 */
1118 .subvendor
= 0x0070,
1119 .subdevice
= 0x6b28,
1120 .card
= CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
, /* Tuner Pair 2 */
1122 .subvendor
= 0x0070,
1123 .subdevice
= 0x6a18,
1124 .card
= CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
, /* Tuner Pair 1 */
1126 .subvendor
= 0x0070,
1127 .subdevice
= 0x6b18,
1128 .card
= CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
, /* Tuner Pair 2 */
1130 .subvendor
= 0x0070,
1131 .subdevice
= 0x2a18,
1132 .card
= CX23885_BOARD_HAUPPAUGE_HVR1265_K4
, /* Hauppauge WinTV HVR-1265 (Model 161xx1, Hybrid ATSC/QAM-B) */
1134 .subvendor
= 0x0070,
1135 .subdevice
= 0xf02a,
1136 .card
= CX23885_BOARD_HAUPPAUGE_STARBURST2
,
1139 const unsigned int cx23885_idcount
= ARRAY_SIZE(cx23885_subids
);
1141 void cx23885_card_list(struct cx23885_dev
*dev
)
1145 if (0 == dev
->pci
->subsystem_vendor
&&
1146 0 == dev
->pci
->subsystem_device
) {
1147 pr_info("%s: Board has no valid PCIe Subsystem ID and can't\n"
1148 "%s: be autodetected. Pass card=<n> insmod option\n"
1149 "%s: to workaround that. Redirect complaints to the\n"
1150 "%s: vendor of the TV card. Best regards,\n"
1152 dev
->name
, dev
->name
, dev
->name
, dev
->name
, dev
->name
);
1154 pr_info("%s: Your board isn't known (yet) to the driver.\n"
1155 "%s: Try to pick one of the existing card configs via\n"
1156 "%s: card=<n> insmod option. Updating to the latest\n"
1157 "%s: version might help as well.\n",
1158 dev
->name
, dev
->name
, dev
->name
, dev
->name
);
1160 pr_info("%s: Here is a list of valid choices for the card=<n> insmod option:\n",
1162 for (i
= 0; i
< cx23885_bcount
; i
++)
1163 pr_info("%s: card=%d -> %s\n",
1164 dev
->name
, i
, cx23885_boards
[i
].name
);
1167 static void viewcast_eeprom(struct cx23885_dev
*dev
, u8
*eeprom_data
)
1171 /* The serial number record begins with tag 0x59 */
1172 if (*(eeprom_data
+ 0x00) != 0x59) {
1173 pr_info("%s() eeprom records are undefined, no serial number\n",
1178 sn
= (*(eeprom_data
+ 0x06) << 24) |
1179 (*(eeprom_data
+ 0x05) << 16) |
1180 (*(eeprom_data
+ 0x04) << 8) |
1181 (*(eeprom_data
+ 0x03));
1183 pr_info("%s: card '%s' sn# MM%d\n",
1185 cx23885_boards
[dev
->board
].name
,
1189 static void hauppauge_eeprom(struct cx23885_dev
*dev
, u8
*eeprom_data
)
1193 tveeprom_hauppauge_analog(&tv
, eeprom_data
);
1195 /* Make sure we support the board model */
1198 /* WinTV-HVR1270 (PCIe, Retail, half height)
1199 * ATSC/QAM and basic analog, IR Blast */
1201 /* WinTV-HVR1210 (PCIe, Retail, half height)
1202 * DVB-T and basic analog, IR Blast */
1204 /* WinTV-HVR1270 (PCIe, Retail, half height)
1205 * ATSC/QAM and basic analog, IR Recv */
1207 /* WinTV-HVR1210 (PCIe, Retail, half height)
1208 * DVB-T and basic analog, IR Recv */
1210 /* WinTV-HVR1275 (PCIe, Retail, half height)
1211 * ATSC/QAM and basic analog, IR Recv */
1213 /* WinTV-HVR1210 (PCIe, Retail, half height)
1214 * DVB-T and basic analog, IR Recv */
1216 /* WinTV-HVR1270 (PCIe, Retail, full height)
1217 * ATSC/QAM and basic analog, IR Blast */
1219 /* WinTV-HVR1210 (PCIe, Retail, full height)
1220 * DVB-T and basic analog, IR Blast */
1222 /* WinTV-HVR1270 (PCIe, Retail, full height)
1223 * ATSC/QAM and basic analog, IR Recv */
1225 /* WinTV-HVR1210 (PCIe, Retail, full height)
1226 * DVB-T and basic analog, IR Recv */
1228 /* WinTV-HVR1275 (PCIe, Retail, full height)
1229 * ATSC/QAM and basic analog, IR Recv */
1231 /* WinTV-HVR1210 (PCIe, Retail, full height)
1232 * DVB-T and basic analog, IR Recv */
1234 /* WinTV-HVR1200 (PCIe, Retail, full height)
1235 * DVB-T and basic analog */
1237 /* WinTV-ImpactVCB-e (PCIe, Retail, half height)
1240 /* WinTV-HVR1200 (PCIe, OEM, half height)
1241 * DVB-T and basic analog */
1243 /* WinTV-HVR1200 (PCIe, OEM, half height)
1244 * DVB-T and basic analog */
1246 /* WinTV-HVR1200 (PCIe, OEM, full height)
1247 * DVB-T and basic analog */
1249 /* WinTV-HVR1200 (PCIe, OEM, half height)
1250 * DVB-T and basic analog */
1252 /* WinTV-HVR1200 (PCIe, OEM, full height)
1253 * DVB-T and basic analog */
1255 /* WinTV-HVR1200 (PCIe, OEM, full height)
1256 * DVB-T and basic analog */
1258 /* WinTV-HVR1200 (PCIe, OEM, half height)
1259 * DVB-T and basic analog */
1261 /* WinTV-HVR1200 (PCIe, OEM, full height)
1262 * DVB-T and basic analog */
1264 /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual
1265 channel ATSC and MPEG2 HW Encoder */
1267 /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC
1270 /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC
1273 /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM
1276 /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM
1279 /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM,
1280 Dual channel ATSC and MPEG2 HW Encoder */
1282 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
1283 Dual channel ATSC and MPEG2 HW Encoder */
1285 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
1286 Dual channel ATSC and MPEG2 HW Encoder */
1288 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM,
1289 Dual channel ATSC and MPEG2 HW Encoder */
1291 /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM,
1292 Dual channel ATSC and MPEG2 HW Encoder */
1294 /* WinTV-HVR1250 (PCIe, Retail, IR, full height,
1295 ATSC and Basic analog */
1297 /* WinTV-HVR1250 (PCIe, Retail, IR, half height,
1298 ATSC and Basic analog */
1300 /* WinTV-HVR1250 (PCIe, No IR, half height,
1301 ATSC [at least] and Basic analog) */
1303 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
1304 ATSC and Basic analog */
1306 /* WinTV-HVR1250 (PCIe, OEM, No IR, full height,
1307 ATSC and Basic analog */
1309 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
1310 ATSC and Basic analog */
1312 /* WinTV-HVR1400 (Express Card, Retail, IR,
1313 * DVB-T and Basic analog */
1315 /* WinTV-HVR1700 (PCIe, OEM, No IR, half height)
1316 * DVB-T and MPEG2 HW Encoder */
1318 /* WinTV-HVR1700 (PCIe, OEM, No IR, full height)
1319 * DVB-T and MPEG2 HW Encoder */
1322 /* WinTV-HVR1850 (PCIe, Retail, 3.5mm in, IR, FM,
1323 Dual channel ATSC and MPEG2 HW Encoder */
1326 /* WinTV-HVR1290 (PCIe, OEM, RCA in, IR,
1327 Dual channel ATSC and Basic analog */
1329 /* WinTV-HVR4400 (PCIe, DVB-S2, DVB-C/T) */
1332 /* WinTV-HVR5500 (PCIe, DVB-S2, DVB-C/T) */
1335 /* WinTV-HVR5525 (PCIe, DVB-S/S2, DVB-T/T2/C) */
1338 /* WinTV-HVR-1265 K4 (PCIe, Analog/ATSC/QAM-B) */
1340 case 166100: /* 888 version, hybrid */
1341 case 166200: /* 885 version, DVB only */
1342 /* WinTV-QuadHD (DVB) Tuner Pair 1 (PCIe, IR, half height,
1343 DVB-T/T2/C, DVB-T/T2/C */
1345 case 166101: /* 888 version, hybrid */
1346 case 166201: /* 885 version, DVB only */
1347 /* WinTV-QuadHD (DVB) Tuner Pair 2 (PCIe, IR, half height,
1348 DVB-T/T2/C, DVB-T/T2/C */
1350 case 165100: /* 888 version, hybrid */
1351 case 165200: /* 885 version, digital only */
1352 /* WinTV-QuadHD (ATSC) Tuner Pair 1 (PCIe, IR, half height,
1353 * ATSC/QAM-B, ATSC/QAM-B */
1355 case 165101: /* 888 version, hybrid */
1356 case 165201: /* 885 version, digital only */
1357 /* WinTV-QuadHD (ATSC) Tuner Pair 2 (PCIe, IR, half height,
1358 * ATSC/QAM-B, ATSC/QAM-B */
1361 pr_warn("%s: warning: unknown hauppauge model #%d\n",
1362 dev
->name
, tv
.model
);
1366 pr_info("%s: hauppauge eeprom: model=%d\n",
1367 dev
->name
, tv
.model
);
1370 /* Some TBS cards require initing a chip using a bitbanged SPI attached
1371 to the cx23885 gpio's. If this chip doesn't get init'ed the demod
1372 doesn't respond to any command. */
1373 static void tbs_card_init(struct cx23885_dev
*dev
)
1376 static const u8 buf
[] = {
1377 0xe0, 0x06, 0x66, 0x33, 0x65,
1378 0x01, 0x17, 0x06, 0xde};
1380 switch (dev
->board
) {
1381 case CX23885_BOARD_TBS_6980
:
1382 case CX23885_BOARD_TBS_6981
:
1383 cx_set(GP0_IO
, 0x00070007);
1384 usleep_range(1000, 10000);
1385 cx_clear(GP0_IO
, 2);
1386 usleep_range(1000, 10000);
1387 for (i
= 0; i
< 9 * 8; i
++) {
1388 cx_clear(GP0_IO
, 7);
1389 usleep_range(1000, 10000);
1391 ((buf
[i
>> 3] >> (7 - (i
& 7))) & 1) | 4);
1392 usleep_range(1000, 10000);
1399 int cx23885_tuner_callback(void *priv
, int component
, int command
, int arg
)
1401 struct cx23885_tsport
*port
= priv
;
1402 struct cx23885_dev
*dev
= port
->dev
;
1405 if ((command
== XC2028_RESET_CLK
) || (command
== XC2028_I2C_FLUSH
))
1409 pr_err("%s(): Unknown command 0x%x.\n",
1414 switch (dev
->board
) {
1415 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1416 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1417 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1418 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
1419 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
1420 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
1421 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
1422 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
1423 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
1424 /* Tuner Reset Command */
1427 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
1428 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1429 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1430 /* Two identical tuners on two different i2c buses,
1431 * we need to reset the correct gpio. */
1434 else if (port
->nr
== 2)
1437 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
1438 /* Tuner Reset Command */
1441 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
1442 altera_ci_tuner_reset(dev
, port
->nr
);
1444 case CX23885_BOARD_AVERMEDIA_HC81R
:
1445 /* XC3028L Reset Command */
1451 /* Drive the tuner into reset and back out */
1452 cx_clear(GP0_IO
, bitmask
);
1454 cx_set(GP0_IO
, bitmask
);
1460 void cx23885_gpio_setup(struct cx23885_dev
*dev
)
1462 switch (dev
->board
) {
1463 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1464 /* GPIO-0 cx24227 demodulator reset */
1465 cx_set(GP0_IO
, 0x00010001); /* Bring the part out of reset */
1467 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1468 /* GPIO-0 cx24227 demodulator */
1469 /* GPIO-2 xc3028 tuner */
1471 /* Put the parts into reset */
1472 cx_set(GP0_IO
, 0x00050000);
1473 cx_clear(GP0_IO
, 0x00000005);
1476 /* Bring the parts out of reset */
1477 cx_set(GP0_IO
, 0x00050005);
1479 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1480 /* GPIO-0 cx24227 demodulator reset */
1481 /* GPIO-2 xc5000 tuner reset */
1482 cx_set(GP0_IO
, 0x00050005); /* Bring the part out of reset */
1484 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1485 /* GPIO-0 656_CLK */
1487 /* GPIO-2 8295A Reset */
1488 /* GPIO-3-10 cx23417 data0-7 */
1489 /* GPIO-11-14 cx23417 addr0-3 */
1490 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1493 /* CX23417 GPIO's */
1494 /* EIO15 Zilog Reset */
1495 /* EIO14 S5H1409/CX24227 Reset */
1496 mc417_gpio_enable(dev
, GPIO_15
| GPIO_14
, 1);
1498 /* Put the demod into reset and protect the eeprom */
1499 mc417_gpio_clear(dev
, GPIO_15
| GPIO_14
);
1502 /* Bring the demod and blaster out of reset */
1503 mc417_gpio_set(dev
, GPIO_15
| GPIO_14
);
1506 /* Force the TDA8295A into reset and back */
1507 cx23885_gpio_enable(dev
, GPIO_2
, 1);
1508 cx23885_gpio_set(dev
, GPIO_2
);
1510 cx23885_gpio_clear(dev
, GPIO_2
);
1512 cx23885_gpio_set(dev
, GPIO_2
);
1515 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
1516 /* GPIO-0 tda10048 demodulator reset */
1517 /* GPIO-2 tda18271 tuner reset */
1519 /* Put the parts into reset and back */
1520 cx_set(GP0_IO
, 0x00050000);
1522 cx_clear(GP0_IO
, 0x00000005);
1524 cx_set(GP0_IO
, 0x00050005);
1526 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
1527 /* GPIO-0 TDA10048 demodulator reset */
1528 /* GPIO-2 TDA8295A Reset */
1529 /* GPIO-3-10 cx23417 data0-7 */
1530 /* GPIO-11-14 cx23417 addr0-3 */
1531 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1533 /* The following GPIO's are on the interna AVCore (cx25840) */
1535 /* GPIO-20 IR_TX 416/DVBT Select */
1536 /* GPIO-21 IIS DAT */
1537 /* GPIO-22 IIS WCLK */
1538 /* GPIO-23 IIS BCLK */
1540 /* Put the parts into reset and back */
1541 cx_set(GP0_IO
, 0x00050000);
1543 cx_clear(GP0_IO
, 0x00000005);
1545 cx_set(GP0_IO
, 0x00050005);
1547 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1548 /* GPIO-0 Dibcom7000p demodulator reset */
1549 /* GPIO-2 xc3028L tuner reset */
1552 /* Put the parts into reset and back */
1553 cx_set(GP0_IO
, 0x00050000);
1555 cx_clear(GP0_IO
, 0x00000005);
1557 cx_set(GP0_IO
, 0x00050005);
1559 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
1560 /* GPIO-0 xc5000 tuner reset i2c bus 0 */
1561 /* GPIO-1 s5h1409 demod reset i2c bus 0 */
1562 /* GPIO-2 xc5000 tuner reset i2c bus 1 */
1563 /* GPIO-3 s5h1409 demod reset i2c bus 0 */
1565 /* Put the parts into reset and back */
1566 cx_set(GP0_IO
, 0x000f0000);
1568 cx_clear(GP0_IO
, 0x0000000f);
1570 cx_set(GP0_IO
, 0x000f000f);
1572 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1573 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1574 /* GPIO-0 portb xc3028 reset */
1575 /* GPIO-1 portb zl10353 reset */
1576 /* GPIO-2 portc xc3028 reset */
1577 /* GPIO-3 portc zl10353 reset */
1579 /* Put the parts into reset and back */
1580 cx_set(GP0_IO
, 0x000f0000);
1582 cx_clear(GP0_IO
, 0x0000000f);
1584 cx_set(GP0_IO
, 0x000f000f);
1586 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
1587 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
1588 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
1589 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
1590 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
1591 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
1592 /* GPIO-2 xc3028 tuner reset */
1594 /* The following GPIO's are on the internal AVCore (cx25840) */
1595 /* GPIO-? zl10353 demod reset */
1597 /* Put the parts into reset and back */
1598 cx_set(GP0_IO
, 0x00040000);
1600 cx_clear(GP0_IO
, 0x00000004);
1602 cx_set(GP0_IO
, 0x00040004);
1604 case CX23885_BOARD_TBS_6920
:
1605 case CX23885_BOARD_TBS_6980
:
1606 case CX23885_BOARD_TBS_6981
:
1607 case CX23885_BOARD_PROF_8000
:
1608 cx_write(MC417_CTL
, 0x00000036);
1609 cx_write(MC417_OEN
, 0x00001000);
1610 cx_set(MC417_RWD
, 0x00000002);
1612 cx_clear(MC417_RWD
, 0x00000800);
1614 cx_set(MC417_RWD
, 0x00000800);
1617 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
1618 /* GPIO-0 INTA from CiMax1
1619 GPIO-1 INTB from CiMax2
1621 GPIO-3 to GPIO-10 data/addr for CA
1622 GPIO-11 ~CS0 to CiMax1
1623 GPIO-12 ~CS1 to CiMax2
1624 GPIO-13 ADL0 load LSB addr
1625 GPIO-14 ADL1 load MSB addr
1626 GPIO-15 ~RDY from CiMax
1627 GPIO-17 ~RD to CiMax
1628 GPIO-18 ~WR to CiMax
1630 cx_set(GP0_IO
, 0x00040000); /* GPIO as out */
1631 /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */
1632 cx_clear(GP0_IO
, 0x00030004);
1633 msleep(100);/* reset delay */
1634 cx_set(GP0_IO
, 0x00040004); /* GPIO as out, reset high */
1635 cx_write(MC417_CTL
, 0x00000037);/* enable GPIO3-18 pins */
1636 /* GPIO-15 IN as ~ACK, rest as OUT */
1637 cx_write(MC417_OEN
, 0x00001000);
1638 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
1639 cx_write(MC417_RWD
, 0x0000c300);
1641 cx_write(GPIO_ISM
, 0x00000000);/* INTERRUPTS active low*/
1643 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1644 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
1645 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
1646 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
1647 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
1648 /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */
1649 /* GPIO-6 I2C Gate which can isolate the demod from the bus */
1650 /* GPIO-9 Demod reset */
1652 /* Put the parts into reset and back */
1653 cx23885_gpio_enable(dev
, GPIO_9
| GPIO_6
| GPIO_5
, 1);
1654 cx23885_gpio_set(dev
, GPIO_9
| GPIO_6
| GPIO_5
);
1655 cx23885_gpio_clear(dev
, GPIO_9
);
1657 cx23885_gpio_set(dev
, GPIO_9
);
1659 case CX23885_BOARD_MYGICA_X8506
:
1660 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
1661 case CX23885_BOARD_MYGICA_X8507
:
1662 /* GPIO-0 (0)Analog / (1)Digital TV */
1663 /* GPIO-1 reset XC5000 */
1664 /* GPIO-2 demod reset */
1665 cx23885_gpio_enable(dev
, GPIO_0
| GPIO_1
| GPIO_2
, 1);
1666 cx23885_gpio_clear(dev
, GPIO_1
| GPIO_2
);
1668 cx23885_gpio_set(dev
, GPIO_0
| GPIO_1
| GPIO_2
);
1671 case CX23885_BOARD_MYGICA_X8558PRO
:
1672 /* GPIO-0 reset first ATBM8830 */
1673 /* GPIO-1 reset second ATBM8830 */
1674 cx23885_gpio_enable(dev
, GPIO_0
| GPIO_1
, 1);
1675 cx23885_gpio_clear(dev
, GPIO_0
| GPIO_1
);
1677 cx23885_gpio_set(dev
, GPIO_0
| GPIO_1
);
1680 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1681 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1682 /* GPIO-0 656_CLK */
1685 /* GPIO-3-10 cx23417 data0-7 */
1686 /* GPIO-11-14 cx23417 addr0-3 */
1687 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
1689 /* GPIO-20 C_IR_TX */
1690 /* GPIO-21 I2S DAT */
1691 /* GPIO-22 I2S WCLK */
1692 /* GPIO-23 I2S BCLK */
1693 /* ALT GPIO: EXP GPIO LATCH */
1695 /* CX23417 GPIO's */
1696 /* GPIO-14 S5H1411/CX24228 Reset */
1697 /* GPIO-13 EEPROM write protect */
1698 mc417_gpio_enable(dev
, GPIO_14
| GPIO_13
, 1);
1700 /* Put the demod into reset and protect the eeprom */
1701 mc417_gpio_clear(dev
, GPIO_14
| GPIO_13
);
1704 /* Bring the demod out of reset */
1705 mc417_gpio_set(dev
, GPIO_14
);
1709 /* Connected to IF / Mux */
1711 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
1712 cx_set(GP0_IO
, 0x00010001); /* Bring the part out of reset */
1714 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
1717 GPIO-2 ~reset chips out
1718 GPIO-3 to GPIO-10 data/addr for CA in/out
1728 cx_set(GP0_IO
, 0x00060000); /* GPIO-1,2 as out */
1729 /* GPIO-0 as INT, reset & TMS low */
1730 cx_clear(GP0_IO
, 0x00010006);
1731 msleep(100);/* reset delay */
1732 cx_set(GP0_IO
, 0x00000004); /* reset high */
1733 cx_write(MC417_CTL
, 0x00000037);/* enable GPIO-3..18 pins */
1734 /* GPIO-17 is TDO in, GPIO-15 is ~RDY in, rest is out */
1735 cx_write(MC417_OEN
, 0x00005000);
1736 /* ~RD, ~WR high; ADDR low; ~CS high */
1737 cx_write(MC417_RWD
, 0x00000d00);
1739 cx_write(GPIO_ISM
, 0x00000000);/* INTERRUPTS active low*/
1741 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
1742 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
1743 /* GPIO-8 tda10071 demod reset */
1744 /* GPIO-9 si2165 demod reset (only HVR4400/HVR5500)*/
1746 /* Put the parts into reset and back */
1747 cx23885_gpio_enable(dev
, GPIO_8
| GPIO_9
, 1);
1749 cx23885_gpio_clear(dev
, GPIO_8
| GPIO_9
);
1751 cx23885_gpio_set(dev
, GPIO_8
| GPIO_9
);
1755 case CX23885_BOARD_AVERMEDIA_HC81R
:
1756 cx_clear(MC417_CTL
, 1);
1757 /* GPIO-0,1,2 setup direction as output */
1758 cx_set(GP0_IO
, 0x00070000);
1759 usleep_range(10000, 11000);
1760 /* AF9013 demod reset */
1761 cx_set(GP0_IO
, 0x00010001);
1762 usleep_range(10000, 11000);
1763 cx_clear(GP0_IO
, 0x00010001);
1764 usleep_range(10000, 11000);
1765 cx_set(GP0_IO
, 0x00010001);
1766 usleep_range(10000, 11000);
1768 cx_clear(GP0_IO
, 0x00030003);
1769 usleep_range(10000, 11000);
1770 cx_set(GP0_IO
, 0x00020002);
1771 usleep_range(10000, 11000);
1772 cx_set(GP0_IO
, 0x00010001);
1773 usleep_range(10000, 11000);
1774 cx_clear(GP0_IO
, 0x00020002);
1775 /* XC3028L tuner reset */
1776 cx_set(GP0_IO
, 0x00040004);
1777 cx_clear(GP0_IO
, 0x00040004);
1778 cx_set(GP0_IO
, 0x00040004);
1781 case CX23885_BOARD_DVBSKY_T9580
:
1782 case CX23885_BOARD_DVBSKY_S952
:
1783 case CX23885_BOARD_DVBSKY_T982
:
1784 /* enable GPIO3-18 pins */
1785 cx_write(MC417_CTL
, 0x00000037);
1786 cx23885_gpio_enable(dev
, GPIO_2
| GPIO_11
, 1);
1787 cx23885_gpio_clear(dev
, GPIO_2
| GPIO_11
);
1789 cx23885_gpio_set(dev
, GPIO_2
| GPIO_11
);
1791 case CX23885_BOARD_DVBSKY_T980C
:
1792 case CX23885_BOARD_DVBSKY_S950C
:
1793 case CX23885_BOARD_TT_CT2_4500_CI
:
1795 * GPIO-0 INTA from CiMax, input
1796 * GPIO-1 reset CiMax, output, high active
1797 * GPIO-2 reset demod, output, low active
1798 * GPIO-3 to GPIO-10 data/addr for CAM
1799 * GPIO-11 ~CS0 to CiMax1
1800 * GPIO-12 ~CS1 to CiMax2
1801 * GPIO-13 ADL0 load LSB addr
1802 * GPIO-14 ADL1 load MSB addr
1803 * GPIO-15 ~RDY from CiMax
1804 * GPIO-17 ~RD to CiMax
1805 * GPIO-18 ~WR to CiMax
1808 cx_set(GP0_IO
, 0x00060002); /* GPIO 1/2 as output */
1809 cx_clear(GP0_IO
, 0x00010004); /* GPIO 0 as input */
1810 msleep(100); /* reset delay */
1811 cx_set(GP0_IO
, 0x00060004); /* GPIO as out, reset high */
1812 cx_clear(GP0_IO
, 0x00010002);
1813 cx_write(MC417_CTL
, 0x00000037); /* enable GPIO3-18 pins */
1815 /* GPIO-15 IN as ~ACK, rest as OUT */
1816 cx_write(MC417_OEN
, 0x00001000);
1818 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
1819 cx_write(MC417_RWD
, 0x0000c300);
1822 cx_write(GPIO_ISM
, 0x00000000); /* INTERRUPTS active low */
1824 case CX23885_BOARD_DVBSKY_S950
:
1825 cx23885_gpio_enable(dev
, GPIO_2
, 1);
1826 cx23885_gpio_clear(dev
, GPIO_2
);
1828 cx23885_gpio_set(dev
, GPIO_2
);
1830 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
1831 case CX23885_BOARD_HAUPPAUGE_STARBURST2
:
1833 * HVR5525 GPIO Details:
1836 * GPIO-03 VAUX Pres.
1842 * GPIO-15 IR_LED_STATUS
1845 * ALTGPIO VAUX_SWITCH
1846 * AUX_PLL_CLK : Blaster2
1848 /* Put the parts into reset and back */
1849 cx23885_gpio_enable(dev
, GPIO_8
| GPIO_9
, 1);
1850 cx23885_gpio_clear(dev
, GPIO_8
| GPIO_9
);
1852 cx23885_gpio_set(dev
, GPIO_8
| GPIO_9
);
1855 case CX23885_BOARD_VIEWCAST_260E
:
1856 case CX23885_BOARD_VIEWCAST_460E
:
1857 /* For documentation purposes, it's worth noting that this
1858 * card does not have any GPIO's connected to subcomponents.
1861 case CX23885_BOARD_HAUPPAUGE_HVR1265_K4
:
1862 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
:
1863 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885
:
1864 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
:
1865 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885
:
1870 /* Put the parts into reset and back */
1871 cx23885_gpio_enable(dev
, GPIO_8
| GPIO_9
, 1);
1872 cx23885_gpio_clear(dev
, GPIO_8
| GPIO_9
);
1874 cx23885_gpio_set(dev
, GPIO_8
| GPIO_9
);
1880 int cx23885_ir_init(struct cx23885_dev
*dev
)
1882 static struct v4l2_subdev_io_pin_config ir_rxtx_pin_cfg
[] = {
1884 .flags
= BIT(V4L2_SUBDEV_IO_PIN_INPUT
),
1885 .pin
= CX23885_PIN_IR_RX_GPIO19
,
1886 .function
= CX23885_PAD_IR_RX
,
1888 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1890 .flags
= BIT(V4L2_SUBDEV_IO_PIN_OUTPUT
),
1891 .pin
= CX23885_PIN_IR_TX_GPIO20
,
1892 .function
= CX23885_PAD_IR_TX
,
1894 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1897 const size_t ir_rxtx_pin_cfg_count
= ARRAY_SIZE(ir_rxtx_pin_cfg
);
1899 static struct v4l2_subdev_io_pin_config ir_rx_pin_cfg
[] = {
1901 .flags
= BIT(V4L2_SUBDEV_IO_PIN_INPUT
),
1902 .pin
= CX23885_PIN_IR_RX_GPIO19
,
1903 .function
= CX23885_PAD_IR_RX
,
1905 .strength
= CX25840_PIN_DRIVE_MEDIUM
,
1908 const size_t ir_rx_pin_cfg_count
= ARRAY_SIZE(ir_rx_pin_cfg
);
1910 struct v4l2_subdev_ir_parameters params
;
1912 switch (dev
->board
) {
1913 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
1914 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
1915 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
1916 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
1917 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
1918 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
1919 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
1920 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
1921 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
1922 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
:
1923 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
:
1924 /* FIXME: Implement me */
1926 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
1927 ret
= cx23888_ir_probe(dev
);
1930 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_888_IR
);
1931 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1932 ir_rx_pin_cfg_count
, ir_rx_pin_cfg
);
1934 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
1935 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
1936 ret
= cx23888_ir_probe(dev
);
1939 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_888_IR
);
1940 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1941 ir_rxtx_pin_cfg_count
, ir_rxtx_pin_cfg
);
1943 * For these boards we need to invert the Tx output via the
1944 * IR controller to have the LED off while idle
1946 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_g_parameters
, ¶ms
);
1947 params
.enable
= false;
1948 params
.shutdown
= false;
1949 params
.invert_level
= true;
1950 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_s_parameters
, ¶ms
);
1951 params
.shutdown
= true;
1952 v4l2_subdev_call(dev
->sd_ir
, ir
, tx_s_parameters
, ¶ms
);
1954 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
1955 case CX23885_BOARD_TEVII_S470
:
1956 case CX23885_BOARD_MYGICA_X8507
:
1957 case CX23885_BOARD_TBS_6980
:
1958 case CX23885_BOARD_TBS_6981
:
1959 case CX23885_BOARD_DVBSKY_T9580
:
1960 case CX23885_BOARD_DVBSKY_T980C
:
1961 case CX23885_BOARD_DVBSKY_S950C
:
1962 case CX23885_BOARD_TT_CT2_4500_CI
:
1963 case CX23885_BOARD_DVBSKY_S950
:
1964 case CX23885_BOARD_DVBSKY_S952
:
1965 case CX23885_BOARD_DVBSKY_T982
:
1968 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_AV_CORE
);
1969 if (dev
->sd_ir
== NULL
) {
1973 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1974 ir_rx_pin_cfg_count
, ir_rx_pin_cfg
);
1976 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
1979 dev
->sd_ir
= cx23885_find_hw(dev
, CX23885_HW_AV_CORE
);
1980 if (dev
->sd_ir
== NULL
) {
1984 v4l2_subdev_call(dev
->sd_cx25840
, core
, s_io_pin_config
,
1985 ir_rxtx_pin_cfg_count
, ir_rxtx_pin_cfg
);
1987 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
1988 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
1989 request_module("ir-kbd-i2c");
1996 void cx23885_ir_fini(struct cx23885_dev
*dev
)
1998 switch (dev
->board
) {
1999 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2000 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2001 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2002 cx23885_irq_remove(dev
, PCI_MSK_IR
);
2003 cx23888_ir_remove(dev
);
2006 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
2007 case CX23885_BOARD_TEVII_S470
:
2008 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2009 case CX23885_BOARD_MYGICA_X8507
:
2010 case CX23885_BOARD_TBS_6980
:
2011 case CX23885_BOARD_TBS_6981
:
2012 case CX23885_BOARD_DVBSKY_T9580
:
2013 case CX23885_BOARD_DVBSKY_T980C
:
2014 case CX23885_BOARD_DVBSKY_S950C
:
2015 case CX23885_BOARD_TT_CT2_4500_CI
:
2016 case CX23885_BOARD_DVBSKY_S950
:
2017 case CX23885_BOARD_DVBSKY_S952
:
2018 case CX23885_BOARD_DVBSKY_T982
:
2019 cx23885_irq_remove(dev
, PCI_MSK_AV_CORE
);
2020 /* sd_ir is a duplicate pointer to the AV Core, just clear it */
2026 static int netup_jtag_io(void *device
, int tms
, int tdi
, int read_tdo
)
2030 struct cx23885_dev
*dev
= (struct cx23885_dev
*)device
;
2032 data
= ((cx_read(GP0_IO
)) & (~0x00000002));
2033 data
|= (tms
? 0x00020002 : 0x00020000);
2034 cx_write(GP0_IO
, data
);
2037 data
= ((cx_read(MC417_RWD
)) & (~0x0000a000));
2038 data
|= (tdi
? 0x00008000 : 0);
2039 cx_write(MC417_RWD
, data
);
2041 tdo
= (data
& 0x00004000) ? 1 : 0; /*TDO*/
2043 cx_write(MC417_RWD
, data
| 0x00002000);
2046 cx_write(MC417_RWD
, data
);
2051 void cx23885_ir_pci_int_enable(struct cx23885_dev
*dev
)
2053 switch (dev
->board
) {
2054 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2055 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2056 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2058 cx23885_irq_add_enable(dev
, PCI_MSK_IR
);
2060 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
2061 case CX23885_BOARD_TEVII_S470
:
2062 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2063 case CX23885_BOARD_MYGICA_X8507
:
2064 case CX23885_BOARD_TBS_6980
:
2065 case CX23885_BOARD_TBS_6981
:
2066 case CX23885_BOARD_DVBSKY_T9580
:
2067 case CX23885_BOARD_DVBSKY_T980C
:
2068 case CX23885_BOARD_DVBSKY_S950C
:
2069 case CX23885_BOARD_TT_CT2_4500_CI
:
2070 case CX23885_BOARD_DVBSKY_S950
:
2071 case CX23885_BOARD_DVBSKY_S952
:
2072 case CX23885_BOARD_DVBSKY_T982
:
2074 cx23885_irq_add_enable(dev
, PCI_MSK_AV_CORE
);
2079 void cx23885_card_setup(struct cx23885_dev
*dev
)
2081 struct cx23885_tsport
*ts1
= &dev
->ts1
;
2082 struct cx23885_tsport
*ts2
= &dev
->ts2
;
2084 static u8 eeprom
[256];
2086 if (dev
->i2c_bus
[0].i2c_rc
== 0) {
2087 dev
->i2c_bus
[0].i2c_client
.addr
= 0xa0 >> 1;
2088 tveeprom_read(&dev
->i2c_bus
[0].i2c_client
,
2089 eeprom
, sizeof(eeprom
));
2092 switch (dev
->board
) {
2093 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2094 if (dev
->i2c_bus
[0].i2c_rc
== 0) {
2095 if (eeprom
[0x80] != 0x84)
2096 hauppauge_eeprom(dev
, eeprom
+0xc0);
2098 hauppauge_eeprom(dev
, eeprom
+0x80);
2101 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
2102 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
2103 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
2104 if (dev
->i2c_bus
[0].i2c_rc
== 0)
2105 hauppauge_eeprom(dev
, eeprom
+0x80);
2107 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
2108 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
2109 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
2110 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
2111 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2112 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
2113 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
2114 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
2115 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
2116 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2117 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2118 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
2119 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
2120 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
2121 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
2122 case CX23885_BOARD_HAUPPAUGE_HVR1265_K4
:
2123 case CX23885_BOARD_HAUPPAUGE_STARBURST2
:
2124 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
:
2125 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885
:
2126 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
:
2127 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885
:
2128 if (dev
->i2c_bus
[0].i2c_rc
== 0)
2129 hauppauge_eeprom(dev
, eeprom
+0xc0);
2131 case CX23885_BOARD_VIEWCAST_260E
:
2132 case CX23885_BOARD_VIEWCAST_460E
:
2133 dev
->i2c_bus
[1].i2c_client
.addr
= 0xa0 >> 1;
2134 tveeprom_read(&dev
->i2c_bus
[1].i2c_client
,
2135 eeprom
, sizeof(eeprom
));
2136 if (dev
->i2c_bus
[0].i2c_rc
== 0)
2137 viewcast_eeprom(dev
, eeprom
);
2141 switch (dev
->board
) {
2142 case CX23885_BOARD_AVERMEDIA_HC81R
:
2143 /* Defaults for VID B */
2144 ts1
->gen_ctrl_val
= 0x4; /* Parallel */
2145 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2146 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2147 /* Defaults for VID C */
2148 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
2149 ts2
->gen_ctrl_val
= 0x10e;
2150 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2151 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2153 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
2154 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
2155 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP2
:
2156 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2157 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2158 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2160 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
:
2161 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2162 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2163 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2165 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2166 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
2167 /* Defaults for VID B - Analog encoder */
2168 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
2169 ts1
->gen_ctrl_val
= 0x10e;
2170 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2171 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2173 /* APB_TSVALERR_POL (active low)*/
2174 ts1
->vld_misc_val
= 0x2000;
2175 ts1
->hw_sop_ctrl_val
= (0x47 << 16 | 188 << 4 | 0xc);
2176 cx_write(0x130184, 0xc);
2178 /* Defaults for VID C */
2179 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2180 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2181 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2183 case CX23885_BOARD_TBS_6920
:
2184 ts1
->gen_ctrl_val
= 0x4; /* Parallel */
2185 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2186 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2188 case CX23885_BOARD_TEVII_S470
:
2189 case CX23885_BOARD_TEVII_S471
:
2190 case CX23885_BOARD_DVBWORLD_2005
:
2191 case CX23885_BOARD_PROF_8000
:
2192 case CX23885_BOARD_DVBSKY_T980C
:
2193 case CX23885_BOARD_DVBSKY_S950C
:
2194 case CX23885_BOARD_TT_CT2_4500_CI
:
2195 case CX23885_BOARD_DVBSKY_S950
:
2196 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2197 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2198 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2200 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
2201 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
2202 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
2203 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2204 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2205 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2206 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2207 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2208 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2210 case CX23885_BOARD_TBS_6980
:
2211 case CX23885_BOARD_TBS_6981
:
2212 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2213 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2214 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2215 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2216 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2217 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2220 case CX23885_BOARD_MYGICA_X8506
:
2221 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
2222 case CX23885_BOARD_MYGICA_X8507
:
2223 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2224 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2225 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2227 case CX23885_BOARD_MYGICA_X8558PRO
:
2228 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2229 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2230 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2231 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2232 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2233 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2235 case CX23885_BOARD_HAUPPAUGE_HVR4400
:
2236 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2237 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2238 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2239 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2240 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2241 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2243 case CX23885_BOARD_HAUPPAUGE_STARBURST
:
2244 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2245 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2246 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2248 case CX23885_BOARD_DVBSKY_T9580
:
2249 case CX23885_BOARD_DVBSKY_T982
:
2250 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2251 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2252 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2253 ts2
->gen_ctrl_val
= 0x8; /* Serial bus */
2254 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2255 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2257 case CX23885_BOARD_DVBSKY_S952
:
2258 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2259 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2260 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2261 ts2
->gen_ctrl_val
= 0xe; /* Serial bus */
2262 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2263 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2265 case CX23885_BOARD_HAUPPAUGE_HVR5525
:
2266 case CX23885_BOARD_HAUPPAUGE_STARBURST2
:
2267 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
2268 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2269 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2270 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2271 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2272 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2274 case CX23885_BOARD_HAUPPAUGE_HVR1265_K4
:
2275 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
:
2276 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885
:
2277 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
:
2278 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885
:
2279 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2280 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2281 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2282 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2283 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2284 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2286 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2287 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
2288 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
2289 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
2290 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
2291 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
2292 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
2293 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
2294 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
2295 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
2296 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
2297 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
2298 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2299 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
2300 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
2301 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
2302 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
2303 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
2304 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2305 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
2307 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
2308 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
2309 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
2312 /* Certain boards support analog, or require the avcore to be
2313 * loaded, ensure this happens.
2315 switch (dev
->board
) {
2316 case CX23885_BOARD_TEVII_S470
:
2317 /* Currently only enabled for the integrated IR controller */
2321 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
2322 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
2323 case CX23885_BOARD_HAUPPAUGE_IMPACTVCBE
:
2324 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
2325 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
2326 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
2327 case CX23885_BOARD_LEADTEK_WINFAST_PXPVR2200
:
2328 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H_XC4000
:
2329 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
2330 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
2331 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
:
2332 case CX23885_BOARD_COMPRO_VIDEOMATE_E800
:
2333 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
2334 case CX23885_BOARD_HAUPPAUGE_HVR1255_22111
:
2335 case CX23885_BOARD_HAUPPAUGE_HVR1265_K4
:
2336 case CX23885_BOARD_HAUPPAUGE_QUADHD_DVB
:
2337 case CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC
:
2338 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
2339 case CX23885_BOARD_HAUPPAUGE_HVR1850
:
2340 case CX23885_BOARD_MYGICA_X8506
:
2341 case CX23885_BOARD_MAGICPRO_PROHDTVE2
:
2342 case CX23885_BOARD_HAUPPAUGE_HVR1290
:
2343 case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200
:
2344 case CX23885_BOARD_GOTVIEW_X5_3D_HYBRID
:
2345 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
2346 case CX23885_BOARD_MPX885
:
2347 case CX23885_BOARD_MYGICA_X8507
:
2348 case CX23885_BOARD_TERRATEC_CINERGY_T_PCIE_DUAL
:
2349 case CX23885_BOARD_AVERMEDIA_HC81R
:
2350 case CX23885_BOARD_TBS_6980
:
2351 case CX23885_BOARD_TBS_6981
:
2352 case CX23885_BOARD_DVBSKY_T9580
:
2353 case CX23885_BOARD_DVBSKY_T980C
:
2354 case CX23885_BOARD_DVBSKY_S950C
:
2355 case CX23885_BOARD_TT_CT2_4500_CI
:
2356 case CX23885_BOARD_DVBSKY_S950
:
2357 case CX23885_BOARD_DVBSKY_S952
:
2358 case CX23885_BOARD_DVBSKY_T982
:
2359 case CX23885_BOARD_VIEWCAST_260E
:
2360 case CX23885_BOARD_VIEWCAST_460E
:
2361 dev
->sd_cx25840
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2362 &dev
->i2c_bus
[2].i2c_adap
,
2363 "cx25840", 0x88 >> 1, NULL
);
2364 if (dev
->sd_cx25840
) {
2365 /* set host data for clk_freq configuration */
2366 v4l2_set_subdev_hostdata(dev
->sd_cx25840
,
2369 dev
->sd_cx25840
->grp_id
= CX23885_HW_AV_CORE
;
2370 v4l2_subdev_call(dev
->sd_cx25840
, core
, load_fw
);
2375 switch (dev
->board
) {
2376 case CX23885_BOARD_VIEWCAST_260E
:
2377 v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2378 &dev
->i2c_bus
[0].i2c_adap
,
2379 "cs3308", 0x82 >> 1, NULL
);
2381 case CX23885_BOARD_VIEWCAST_460E
:
2382 /* This cs3308 controls the audio from the breakout cable */
2383 v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2384 &dev
->i2c_bus
[0].i2c_adap
,
2385 "cs3308", 0x80 >> 1, NULL
);
2386 /* This cs3308 controls the audio from the onboard header */
2387 v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
2388 &dev
->i2c_bus
[0].i2c_adap
,
2389 "cs3308", 0x82 >> 1, NULL
);
2393 /* AUX-PLL 27MHz CLK */
2394 switch (dev
->board
) {
2395 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
2396 netup_initialize(dev
);
2398 case CX23885_BOARD_NETUP_DUAL_DVB_T_C_CI_RF
: {
2400 const struct firmware
*fw
;
2401 const char *filename
= "dvb-netup-altera-01.fw";
2402 char *action
= "configure";
2403 static struct netup_card_info cinfo
;
2404 struct altera_config netup_config
= {
2407 .jtag_io
= netup_jtag_io
,
2410 netup_initialize(dev
);
2412 netup_get_card_info(&dev
->i2c_bus
[0].i2c_adap
, &cinfo
);
2414 cinfo
.rev
= netup_card_rev
;
2416 switch (cinfo
.rev
) {
2418 filename
= "dvb-netup-altera-04.fw";
2421 filename
= "dvb-netup-altera-01.fw";
2424 pr_info("NetUP card rev=0x%x fw_filename=%s\n",
2425 cinfo
.rev
, filename
);
2427 ret
= request_firmware(&fw
, filename
, &dev
->pci
->dev
);
2429 pr_err("did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware.",
2432 altera_init(&netup_config
, fw
);
2434 release_firmware(fw
);