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.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include <linux/init.h>
23 #include <linux/module.h>
24 #include <linux/pci.h>
25 #include <linux/delay.h>
26 #include <media/cx25840.h>
29 #include "tuner-xc2028.h"
30 #include "netup-init.h"
32 /* ------------------------------------------------------------------ */
33 /* board config info */
35 struct cx23885_board cx23885_boards
[] = {
36 [CX23885_BOARD_UNKNOWN
] = {
37 .name
= "UNKNOWN/GENERIC",
38 /* Ensure safe default for unknown boards */
41 .type
= CX23885_VMUX_COMPOSITE1
,
44 .type
= CX23885_VMUX_COMPOSITE2
,
47 .type
= CX23885_VMUX_COMPOSITE3
,
50 .type
= CX23885_VMUX_COMPOSITE4
,
54 [CX23885_BOARD_HAUPPAUGE_HVR1800lp
] = {
55 .name
= "Hauppauge WinTV-HVR1800lp",
56 .portc
= CX23885_MPEG_DVB
,
58 .type
= CX23885_VMUX_TELEVISION
,
62 .type
= CX23885_VMUX_DEBUG
,
66 .type
= CX23885_VMUX_COMPOSITE1
,
70 .type
= CX23885_VMUX_SVIDEO
,
75 [CX23885_BOARD_HAUPPAUGE_HVR1800
] = {
76 .name
= "Hauppauge WinTV-HVR1800",
77 .porta
= CX23885_ANALOG_VIDEO
,
78 .portb
= CX23885_MPEG_ENCODER
,
79 .portc
= CX23885_MPEG_DVB
,
80 .tuner_type
= TUNER_PHILIPS_TDA8290
,
81 .tuner_addr
= 0x42, /* 0x84 >> 1 */
83 .type
= CX23885_VMUX_TELEVISION
,
84 .vmux
= CX25840_VIN7_CH3
|
89 .type
= CX23885_VMUX_COMPOSITE1
,
90 .vmux
= CX25840_VIN7_CH3
|
95 .type
= CX23885_VMUX_SVIDEO
,
96 .vmux
= CX25840_VIN7_CH3
|
103 [CX23885_BOARD_HAUPPAUGE_HVR1250
] = {
104 .name
= "Hauppauge WinTV-HVR1250",
105 .portc
= CX23885_MPEG_DVB
,
107 .type
= CX23885_VMUX_TELEVISION
,
111 .type
= CX23885_VMUX_DEBUG
,
115 .type
= CX23885_VMUX_COMPOSITE1
,
119 .type
= CX23885_VMUX_SVIDEO
,
124 [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
] = {
125 .name
= "DViCO FusionHDTV5 Express",
126 .portb
= CX23885_MPEG_DVB
,
128 [CX23885_BOARD_HAUPPAUGE_HVR1500Q
] = {
129 .name
= "Hauppauge WinTV-HVR1500Q",
130 .portc
= CX23885_MPEG_DVB
,
132 [CX23885_BOARD_HAUPPAUGE_HVR1500
] = {
133 .name
= "Hauppauge WinTV-HVR1500",
134 .portc
= CX23885_MPEG_DVB
,
136 [CX23885_BOARD_HAUPPAUGE_HVR1200
] = {
137 .name
= "Hauppauge WinTV-HVR1200",
138 .portc
= CX23885_MPEG_DVB
,
140 [CX23885_BOARD_HAUPPAUGE_HVR1700
] = {
141 .name
= "Hauppauge WinTV-HVR1700",
142 .portc
= CX23885_MPEG_DVB
,
144 [CX23885_BOARD_HAUPPAUGE_HVR1400
] = {
145 .name
= "Hauppauge WinTV-HVR1400",
146 .portc
= CX23885_MPEG_DVB
,
148 [CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
] = {
149 .name
= "DViCO FusionHDTV7 Dual Express",
150 .portb
= CX23885_MPEG_DVB
,
151 .portc
= CX23885_MPEG_DVB
,
153 [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
] = {
154 .name
= "DViCO FusionHDTV DVB-T Dual Express",
155 .portb
= CX23885_MPEG_DVB
,
156 .portc
= CX23885_MPEG_DVB
,
158 [CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
] = {
159 .name
= "Leadtek Winfast PxDVR3200 H",
160 .portc
= CX23885_MPEG_DVB
,
162 [CX23885_BOARD_COMPRO_VIDEOMATE_E650F
] = {
163 .name
= "Compro VideoMate E650F",
164 .portc
= CX23885_MPEG_DVB
,
166 [CX23885_BOARD_TBS_6920
] = {
167 .name
= "TurboSight TBS 6920",
168 .portb
= CX23885_MPEG_DVB
,
170 [CX23885_BOARD_TEVII_S470
] = {
171 .name
= "TeVii S470",
172 .portb
= CX23885_MPEG_DVB
,
174 [CX23885_BOARD_DVBWORLD_2005
] = {
175 .name
= "DVBWorld DVB-S2 2005",
176 .portb
= CX23885_MPEG_DVB
,
178 [CX23885_BOARD_NETUP_DUAL_DVBS2_CI
] = {
180 .name
= "NetUP Dual DVB-S2 CI",
181 .portb
= CX23885_MPEG_DVB
,
182 .portc
= CX23885_MPEG_DVB
,
184 [CX23885_BOARD_HAUPPAUGE_HVR1270
] = {
185 .name
= "Hauppauge WinTV-HVR1270",
186 .portc
= CX23885_MPEG_DVB
,
188 [CX23885_BOARD_HAUPPAUGE_HVR1275
] = {
189 .name
= "Hauppauge WinTV-HVR1275",
190 .portc
= CX23885_MPEG_DVB
,
192 [CX23885_BOARD_HAUPPAUGE_HVR1255
] = {
193 .name
= "Hauppauge WinTV-HVR1255",
194 .portc
= CX23885_MPEG_DVB
,
196 [CX23885_BOARD_HAUPPAUGE_HVR1210
] = {
197 .name
= "Hauppauge WinTV-HVR1210",
198 .portc
= CX23885_MPEG_DVB
,
200 [CX23885_BOARD_MYGICA_X8506
] = {
201 .name
= "Mygica X8506 DMB-TH",
202 .portb
= CX23885_MPEG_DVB
,
205 const unsigned int cx23885_bcount
= ARRAY_SIZE(cx23885_boards
);
207 /* ------------------------------------------------------------------ */
208 /* PCI subsystem IDs */
210 struct cx23885_subid cx23885_subids
[] = {
214 .card
= CX23885_BOARD_UNKNOWN
,
218 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800lp
,
222 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
226 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
230 .card
= CX23885_BOARD_HAUPPAUGE_HVR1800
,
234 .card
= CX23885_BOARD_HAUPPAUGE_HVR1250
,
238 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
,
242 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
246 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500Q
,
250 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
254 .card
= CX23885_BOARD_HAUPPAUGE_HVR1500
,
258 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
262 .card
= CX23885_BOARD_HAUPPAUGE_HVR1200
,
266 .card
= CX23885_BOARD_HAUPPAUGE_HVR1700
,
270 .card
= CX23885_BOARD_HAUPPAUGE_HVR1400
,
274 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
,
278 .card
= CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
,
282 .card
= CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
,
286 .card
= CX23885_BOARD_COMPRO_VIDEOMATE_E650F
,
290 .card
= CX23885_BOARD_TBS_6920
,
294 .card
= CX23885_BOARD_TEVII_S470
,
298 .card
= CX23885_BOARD_DVBWORLD_2005
,
302 .card
= CX23885_BOARD_NETUP_DUAL_DVBS2_CI
,
306 .card
= CX23885_BOARD_HAUPPAUGE_HVR1270
,
310 .card
= CX23885_BOARD_HAUPPAUGE_HVR1275
,
314 .card
= CX23885_BOARD_HAUPPAUGE_HVR1255
,
318 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
322 .card
= CX23885_BOARD_HAUPPAUGE_HVR1210
,
326 .card
= CX23885_BOARD_MYGICA_X8506
,
329 const unsigned int cx23885_idcount
= ARRAY_SIZE(cx23885_subids
);
331 void cx23885_card_list(struct cx23885_dev
*dev
)
335 if (0 == dev
->pci
->subsystem_vendor
&&
336 0 == dev
->pci
->subsystem_device
) {
338 "%s: Board has no valid PCIe Subsystem ID and can't\n"
339 "%s: be autodetected. Pass card=<n> insmod option\n"
340 "%s: to workaround that. Redirect complaints to the\n"
341 "%s: vendor of the TV card. Best regards,\n"
343 dev
->name
, dev
->name
, dev
->name
, dev
->name
, dev
->name
);
346 "%s: Your board isn't known (yet) to the driver.\n"
347 "%s: Try to pick one of the existing card configs via\n"
348 "%s: card=<n> insmod option. Updating to the latest\n"
349 "%s: version might help as well.\n",
350 dev
->name
, dev
->name
, dev
->name
, dev
->name
);
352 printk(KERN_INFO
"%s: Here is a list of valid choices for the card=<n> insmod option:\n",
354 for (i
= 0; i
< cx23885_bcount
; i
++)
355 printk(KERN_INFO
"%s: card=%d -> %s\n",
356 dev
->name
, i
, cx23885_boards
[i
].name
);
359 static void hauppauge_eeprom(struct cx23885_dev
*dev
, u8
*eeprom_data
)
363 tveeprom_hauppauge_analog(&dev
->i2c_bus
[0].i2c_client
, &tv
,
366 /* Make sure we support the board model */
369 /* WinTV-HVR1270 (PCIe, Retail, half height)
370 * ATSC/QAM and basic analog, IR Blast */
372 /* WinTV-HVR1210 (PCIe, Retail, half height)
373 * DVB-T and basic analog, IR Blast */
375 /* WinTV-HVR1270 (PCIe, Retail, half height)
376 * ATSC/QAM and basic analog, IR Recv */
378 /* WinTV-HVR1210 (PCIe, Retail, half height)
379 * DVB-T and basic analog, IR Recv */
381 /* WinTV-HVR1275 (PCIe, Retail, half height)
382 * ATSC/QAM and basic analog, IR Recv */
384 /* WinTV-HVR1210 (PCIe, Retail, half height)
385 * DVB-T and basic analog, IR Recv */
387 /* WinTV-HVR1270 (PCIe, Retail, full height)
388 * ATSC/QAM and basic analog, IR Blast */
390 /* WinTV-HVR1210 (PCIe, Retail, full height)
391 * DVB-T and basic analog, IR Blast */
393 /* WinTV-HVR1270 (PCIe, Retail, full height)
394 * ATSC/QAM and basic analog, IR Recv */
396 /* WinTV-HVR1210 (PCIe, Retail, full height)
397 * DVB-T and basic analog, IR Recv */
399 /* WinTV-HVR1275 (PCIe, Retail, full height)
400 * ATSC/QAM and basic analog, IR Recv */
402 /* WinTV-HVR1210 (PCIe, Retail, full height)
403 * DVB-T and basic analog, IR Recv */
405 /* WinTV-HVR1200 (PCIe, Retail, full height)
406 * DVB-T and basic analog */
408 /* WinTV-HVR1200 (PCIe, OEM, half height)
409 * DVB-T and basic analog */
411 /* WinTV-HVR1200 (PCIe, OEM, half height)
412 * DVB-T and basic analog */
414 /* WinTV-HVR1200 (PCIe, OEM, full height)
415 * DVB-T and basic analog */
417 /* WinTV-HVR1200 (PCIe, OEM, half height)
418 * DVB-T and basic analog */
420 /* WinTV-HVR1200 (PCIe, OEM, full height)
421 * DVB-T and basic analog */
423 /* WinTV-HVR1200 (PCIe, OEM, full height)
424 * DVB-T and basic analog */
426 /* WinTV-HVR1200 (PCIe, OEM, half height)
427 * DVB-T and basic analog */
429 /* WinTV-HVR1200 (PCIe, OEM, full height)
430 * DVB-T and basic analog */
432 /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual
433 channel ATSC and MPEG2 HW Encoder */
435 /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC
438 /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC
441 /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM
444 /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM
447 /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM,
448 Dual channel ATSC and MPEG2 HW Encoder */
450 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
451 Dual channel ATSC and MPEG2 HW Encoder */
453 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
454 Dual channel ATSC and MPEG2 HW Encoder */
456 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM,
457 Dual channel ATSC and MPEG2 HW Encoder */
459 /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM,
460 Dual channel ATSC and MPEG2 HW Encoder */
462 /* WinTV-HVR1250 (PCIe, Retail, IR, full height,
463 ATSC and Basic analog */
465 /* WinTV-HVR1250 (PCIe, Retail, IR, half height,
466 ATSC and Basic analog */
468 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
469 ATSC and Basic analog */
471 /* WinTV-HVR1250 (PCIe, OEM, No IR, full height,
472 ATSC and Basic analog */
474 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
475 ATSC and Basic analog */
477 /* WinTV-HVR1400 (Express Card, Retail, IR,
478 * DVB-T and Basic analog */
480 /* WinTV-HVR1700 (PCIe, OEM, No IR, half height)
481 * DVB-T and MPEG2 HW Encoder */
483 /* WinTV-HVR1700 (PCIe, OEM, No IR, full height)
484 * DVB-T and MPEG2 HW Encoder */
487 printk(KERN_WARNING
"%s: warning: unknown hauppauge model #%d\n",
488 dev
->name
, tv
.model
);
492 printk(KERN_INFO
"%s: hauppauge eeprom: model=%d\n",
493 dev
->name
, tv
.model
);
496 int cx23885_tuner_callback(void *priv
, int component
, int command
, int arg
)
498 struct cx23885_tsport
*port
= priv
;
499 struct cx23885_dev
*dev
= port
->dev
;
502 if (command
== XC2028_RESET_CLK
)
506 printk(KERN_ERR
"%s(): Unknown command 0x%x.\n",
511 switch (dev
->board
) {
512 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
513 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
514 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
515 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
516 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
517 /* Tuner Reset Command */
520 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
521 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
522 /* Two identical tuners on two different i2c buses,
523 * we need to reset the correct gpio. */
526 else if (port
->nr
== 2)
532 /* Drive the tuner into reset and back out */
533 cx_clear(GP0_IO
, bitmask
);
535 cx_set(GP0_IO
, bitmask
);
541 void cx23885_gpio_setup(struct cx23885_dev
*dev
)
543 switch (dev
->board
) {
544 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
545 /* GPIO-0 cx24227 demodulator reset */
546 cx_set(GP0_IO
, 0x00010001); /* Bring the part out of reset */
548 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
549 /* GPIO-0 cx24227 demodulator */
550 /* GPIO-2 xc3028 tuner */
552 /* Put the parts into reset */
553 cx_set(GP0_IO
, 0x00050000);
554 cx_clear(GP0_IO
, 0x00000005);
557 /* Bring the parts out of reset */
558 cx_set(GP0_IO
, 0x00050005);
560 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
561 /* GPIO-0 cx24227 demodulator reset */
562 /* GPIO-2 xc5000 tuner reset */
563 cx_set(GP0_IO
, 0x00050005); /* Bring the part out of reset */
565 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
568 /* GPIO-2 8295A Reset */
569 /* GPIO-3-10 cx23417 data0-7 */
570 /* GPIO-11-14 cx23417 addr0-3 */
571 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
575 /* EIO15 Zilog Reset */
576 /* EIO14 S5H1409/CX24227 Reset */
578 /* Force the TDA8295A into reset and back */
579 cx_set(GP0_IO
, 0x00040004);
581 cx_clear(GP0_IO
, 0x00000004);
583 cx_set(GP0_IO
, 0x00040004);
586 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
587 /* GPIO-0 tda10048 demodulator reset */
588 /* GPIO-2 tda18271 tuner reset */
590 /* Put the parts into reset and back */
591 cx_set(GP0_IO
, 0x00050000);
593 cx_clear(GP0_IO
, 0x00000005);
595 cx_set(GP0_IO
, 0x00050005);
597 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
598 /* GPIO-0 TDA10048 demodulator reset */
599 /* GPIO-2 TDA8295A Reset */
600 /* GPIO-3-10 cx23417 data0-7 */
601 /* GPIO-11-14 cx23417 addr0-3 */
602 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
604 /* The following GPIO's are on the interna AVCore (cx25840) */
606 /* GPIO-20 IR_TX 416/DVBT Select */
607 /* GPIO-21 IIS DAT */
608 /* GPIO-22 IIS WCLK */
609 /* GPIO-23 IIS BCLK */
611 /* Put the parts into reset and back */
612 cx_set(GP0_IO
, 0x00050000);
614 cx_clear(GP0_IO
, 0x00000005);
616 cx_set(GP0_IO
, 0x00050005);
618 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
619 /* GPIO-0 Dibcom7000p demodulator reset */
620 /* GPIO-2 xc3028L tuner reset */
623 /* Put the parts into reset and back */
624 cx_set(GP0_IO
, 0x00050000);
626 cx_clear(GP0_IO
, 0x00000005);
628 cx_set(GP0_IO
, 0x00050005);
630 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
631 /* GPIO-0 xc5000 tuner reset i2c bus 0 */
632 /* GPIO-1 s5h1409 demod reset i2c bus 0 */
633 /* GPIO-2 xc5000 tuner reset i2c bus 1 */
634 /* GPIO-3 s5h1409 demod reset i2c bus 0 */
636 /* Put the parts into reset and back */
637 cx_set(GP0_IO
, 0x000f0000);
639 cx_clear(GP0_IO
, 0x0000000f);
641 cx_set(GP0_IO
, 0x000f000f);
643 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
644 /* GPIO-0 portb xc3028 reset */
645 /* GPIO-1 portb zl10353 reset */
646 /* GPIO-2 portc xc3028 reset */
647 /* GPIO-3 portc zl10353 reset */
649 /* Put the parts into reset and back */
650 cx_set(GP0_IO
, 0x000f0000);
652 cx_clear(GP0_IO
, 0x0000000f);
654 cx_set(GP0_IO
, 0x000f000f);
656 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
657 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
658 /* GPIO-2 xc3028 tuner reset */
660 /* The following GPIO's are on the internal AVCore (cx25840) */
661 /* GPIO-? zl10353 demod reset */
663 /* Put the parts into reset and back */
664 cx_set(GP0_IO
, 0x00040000);
666 cx_clear(GP0_IO
, 0x00000004);
668 cx_set(GP0_IO
, 0x00040004);
670 case CX23885_BOARD_TBS_6920
:
671 case CX23885_BOARD_TEVII_S470
:
672 cx_write(MC417_CTL
, 0x00000036);
673 cx_write(MC417_OEN
, 0x00001000);
674 cx_write(MC417_RWD
, 0x00001800);
676 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
677 /* GPIO-0 INTA from CiMax1
678 GPIO-1 INTB from CiMax2
680 GPIO-3 to GPIO-10 data/addr for CA
681 GPIO-11 ~CS0 to CiMax1
682 GPIO-12 ~CS1 to CiMax2
683 GPIO-13 ADL0 load LSB addr
684 GPIO-14 ADL1 load MSB addr
685 GPIO-15 ~RDY from CiMax
689 cx_set(GP0_IO
, 0x00040000); /* GPIO as out */
690 /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */
691 cx_clear(GP0_IO
, 0x00030004);
692 mdelay(100);/* reset delay */
693 cx_set(GP0_IO
, 0x00040004); /* GPIO as out, reset high */
694 cx_write(MC417_CTL
, 0x00000037);/* enable GPIO3-18 pins */
695 /* GPIO-15 IN as ~ACK, rest as OUT */
696 cx_write(MC417_OEN
, 0x00001000);
697 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
698 cx_write(MC417_RWD
, 0x0000c300);
700 cx_write(GPIO_ISM
, 0x00000000);/* INTERRUPTS active low*/
702 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
703 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
704 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
705 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
706 /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */
707 /* GPIO-6 I2C Gate which can isolate the demod from the bus */
708 /* GPIO-9 Demod reset */
710 /* Put the parts into reset and back */
711 cx23885_gpio_enable(dev
, GPIO_9
| GPIO_6
| GPIO_5
, 1);
712 cx23885_gpio_set(dev
, GPIO_9
| GPIO_6
| GPIO_5
);
713 cx23885_gpio_clear(dev
, GPIO_9
);
715 cx23885_gpio_set(dev
, GPIO_9
);
717 case CX23885_BOARD_MYGICA_X8506
:
718 /* GPIO-1 reset XC5000 */
719 /* GPIO-2 reset LGS8GL5 */
720 cx_set(GP0_IO
, 0x00060000);
721 cx_clear(GP0_IO
, 0x00000006);
723 cx_set(GP0_IO
, 0x00060006);
729 int cx23885_ir_init(struct cx23885_dev
*dev
)
731 switch (dev
->board
) {
732 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
733 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
734 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
735 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
736 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
737 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
738 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
739 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
740 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
741 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
742 /* FIXME: Implement me */
744 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
745 request_module("ir-kbd-i2c");
752 void cx23885_card_setup(struct cx23885_dev
*dev
)
754 struct cx23885_tsport
*ts1
= &dev
->ts1
;
755 struct cx23885_tsport
*ts2
= &dev
->ts2
;
757 static u8 eeprom
[256];
759 if (dev
->i2c_bus
[0].i2c_rc
== 0) {
760 dev
->i2c_bus
[0].i2c_client
.addr
= 0xa0 >> 1;
761 tveeprom_read(&dev
->i2c_bus
[0].i2c_client
,
762 eeprom
, sizeof(eeprom
));
765 switch (dev
->board
) {
766 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
767 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
768 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
769 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
770 if (dev
->i2c_bus
[0].i2c_rc
== 0)
771 hauppauge_eeprom(dev
, eeprom
+0x80);
773 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
774 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
775 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
776 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
777 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
778 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
779 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
780 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
781 if (dev
->i2c_bus
[0].i2c_rc
== 0)
782 hauppauge_eeprom(dev
, eeprom
+0xc0);
786 switch (dev
->board
) {
787 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP
:
788 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP
:
789 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
790 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
791 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
792 /* break omitted intentionally */
793 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP
:
794 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
795 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
796 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
798 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
799 /* Defaults for VID B - Analog encoder */
800 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
801 ts1
->gen_ctrl_val
= 0x10e;
802 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
803 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
805 /* APB_TSVALERR_POL (active low)*/
806 ts1
->vld_misc_val
= 0x2000;
807 ts1
->hw_sop_ctrl_val
= (0x47 << 16 | 188 << 4 | 0xc);
809 /* Defaults for VID C */
810 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
811 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
812 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
814 case CX23885_BOARD_TEVII_S470
:
815 case CX23885_BOARD_TBS_6920
:
816 case CX23885_BOARD_DVBWORLD_2005
:
817 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
818 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
819 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
821 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
822 ts1
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
823 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
824 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
825 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
826 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
827 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
829 case CX23885_BOARD_MYGICA_X8506
:
830 ts1
->gen_ctrl_val
= 0x5; /* Parallel */
831 ts1
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
832 ts1
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
834 case CX23885_BOARD_HAUPPAUGE_HVR1250
:
835 case CX23885_BOARD_HAUPPAUGE_HVR1500
:
836 case CX23885_BOARD_HAUPPAUGE_HVR1500Q
:
837 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
838 case CX23885_BOARD_HAUPPAUGE_HVR1200
:
839 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
840 case CX23885_BOARD_HAUPPAUGE_HVR1400
:
841 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
842 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
843 case CX23885_BOARD_HAUPPAUGE_HVR1270
:
844 case CX23885_BOARD_HAUPPAUGE_HVR1275
:
845 case CX23885_BOARD_HAUPPAUGE_HVR1255
:
846 case CX23885_BOARD_HAUPPAUGE_HVR1210
:
848 ts2
->gen_ctrl_val
= 0xc; /* Serial bus + punctured clock */
849 ts2
->ts_clk_en_val
= 0x1; /* Enable TS_CLK */
850 ts2
->src_sel_val
= CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO
;
853 /* Certain boards support analog, or require the avcore to be
854 * loaded, ensure this happens.
856 switch (dev
->board
) {
857 case CX23885_BOARD_HAUPPAUGE_HVR1800
:
858 case CX23885_BOARD_HAUPPAUGE_HVR1800lp
:
859 case CX23885_BOARD_HAUPPAUGE_HVR1700
:
860 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H
:
861 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F
:
862 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
863 dev
->sd_cx25840
= v4l2_i2c_new_subdev(&dev
->v4l2_dev
,
864 &dev
->i2c_bus
[2].i2c_adap
,
865 "cx25840", "cx25840", 0x88 >> 1);
866 v4l2_subdev_call(dev
->sd_cx25840
, core
, load_fw
);
870 /* AUX-PLL 27MHz CLK */
871 switch (dev
->board
) {
872 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI
:
873 netup_initialize(dev
);
878 /* ------------------------------------------------------------------ */