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,
201 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
203 /* ------------------------------------------------------------------ */
204 /* PCI subsystem IDs */
206 struct cx23885_subid cx23885_subids[] = {
210 .card = CX23885_BOARD_UNKNOWN,
214 .card = CX23885_BOARD_HAUPPAUGE_HVR1800lp,
218 .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
222 .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
226 .card = CX23885_BOARD_HAUPPAUGE_HVR1800,
230 .card = CX23885_BOARD_HAUPPAUGE_HVR1250,
234 .card = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP,
238 .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
242 .card = CX23885_BOARD_HAUPPAUGE_HVR1500Q,
246 .card = CX23885_BOARD_HAUPPAUGE_HVR1500,
250 .card = CX23885_BOARD_HAUPPAUGE_HVR1500,
254 .card = CX23885_BOARD_HAUPPAUGE_HVR1200,
258 .card = CX23885_BOARD_HAUPPAUGE_HVR1200,
262 .card = CX23885_BOARD_HAUPPAUGE_HVR1700,
266 .card = CX23885_BOARD_HAUPPAUGE_HVR1400,
270 .card = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP,
274 .card = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP,
278 .card = CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H,
282 .card = CX23885_BOARD_COMPRO_VIDEOMATE_E650F,
286 .card = CX23885_BOARD_TBS_6920,
290 .card = CX23885_BOARD_TEVII_S470,
294 .card = CX23885_BOARD_DVBWORLD_2005,
298 .card = CX23885_BOARD_NETUP_DUAL_DVBS2_CI,
302 .card = CX23885_BOARD_HAUPPAUGE_HVR1270,
306 .card = CX23885_BOARD_HAUPPAUGE_HVR1275,
310 .card = CX23885_BOARD_HAUPPAUGE_HVR1255,
314 .card = CX23885_BOARD_HAUPPAUGE_HVR1210,
318 .card = CX23885_BOARD_HAUPPAUGE_HVR1210,
321 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
323 void cx23885_card_list(struct cx23885_dev *dev)
327 if (0 == dev->pci->subsystem_vendor &&
328 0 == dev->pci->subsystem_device) {
330 "%s: Board has no valid PCIe Subsystem ID and can't\n"
331 "%s: be autodetected. Pass card=<n> insmod option\n"
332 "%s: to workaround that. Redirect complaints to the\n"
333 "%s: vendor of the TV card. Best regards,\n"
335 dev->name, dev->name, dev->name, dev->name, dev->name);
338 "%s: Your board isn't known (yet) to the driver.\n"
339 "%s: Try to pick one of the existing card configs via\n"
340 "%s: card=<n> insmod option. Updating to the latest\n"
341 "%s: version might help as well.\n",
342 dev->name, dev->name, dev->name, dev->name);
344 printk(KERN_INFO "%s: Here is a list of valid choices for the card=<n> insmod option:\n",
346 for (i = 0; i < cx23885_bcount; i++)
347 printk(KERN_INFO "%s: card=%d -> %s\n",
348 dev->name, i, cx23885_boards[i].name);
351 static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data)
355 tveeprom_hauppauge_analog(&dev->i2c_bus[0].i2c_client, &tv,
358 /* Make sure we support the board model */
361 /* WinTV-HVR1270 (PCIe, Retail, half height)
362 * ATSC/QAM and basic analog, IR Blast */
364 /* WinTV-HVR1210 (PCIe, Retail, half height)
365 * DVB-T and basic analog, IR Blast */
367 /* WinTV-HVR1270 (PCIe, Retail, half height)
368 * ATSC/QAM and basic analog, IR Recv */
370 /* WinTV-HVR1210 (PCIe, Retail, half height)
371 * DVB-T and basic analog, IR Recv */
373 /* WinTV-HVR1275 (PCIe, Retail, half height)
374 * ATSC/QAM and basic analog, IR Recv */
376 /* WinTV-HVR1210 (PCIe, Retail, half height)
377 * DVB-T and basic analog, IR Recv */
379 /* WinTV-HVR1270 (PCIe, Retail, full height)
380 * ATSC/QAM and basic analog, IR Blast */
382 /* WinTV-HVR1210 (PCIe, Retail, full height)
383 * DVB-T and basic analog, IR Blast */
385 /* WinTV-HVR1270 (PCIe, Retail, full height)
386 * ATSC/QAM and basic analog, IR Recv */
388 /* WinTV-HVR1210 (PCIe, Retail, full height)
389 * DVB-T and basic analog, IR Recv */
391 /* WinTV-HVR1275 (PCIe, Retail, full height)
392 * ATSC/QAM and basic analog, IR Recv */
394 /* WinTV-HVR1210 (PCIe, Retail, full height)
395 * DVB-T and basic analog, IR Recv */
397 /* WinTV-HVR1200 (PCIe, Retail, full height)
398 * DVB-T and basic analog */
400 /* WinTV-HVR1200 (PCIe, OEM, half height)
401 * DVB-T and basic analog */
403 /* WinTV-HVR1200 (PCIe, OEM, half height)
404 * DVB-T and basic analog */
406 /* WinTV-HVR1200 (PCIe, OEM, full height)
407 * DVB-T and basic analog */
409 /* WinTV-HVR1200 (PCIe, OEM, half height)
410 * DVB-T and basic analog */
412 /* WinTV-HVR1200 (PCIe, OEM, full height)
413 * DVB-T and basic analog */
415 /* WinTV-HVR1200 (PCIe, OEM, full height)
416 * DVB-T and basic analog */
418 /* WinTV-HVR1200 (PCIe, OEM, half height)
419 * DVB-T and basic analog */
421 /* WinTV-HVR1200 (PCIe, OEM, full height)
422 * DVB-T and basic analog */
424 /* WinTV-HVR1800lp (PCIe, Retail, No IR, Dual
425 channel ATSC and MPEG2 HW Encoder */
427 /* WinTV-HVR1500 (Express Card, OEM, No IR, ATSC
430 /* WinTV-HVR1500 (Express Card, Retail, No IR, ATSC
433 /* WinTV-HVR1500Q (Express Card, OEM, No IR, ATSC/QAM
436 /* WinTV-HVR1500Q (Express Card, Retail, No IR, ATSC/QAM
439 /* WinTV-HVR1800 (PCIe, Retail, 3.5mm in, IR, No FM,
440 Dual channel ATSC and MPEG2 HW Encoder */
442 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
443 Dual channel ATSC and MPEG2 HW Encoder */
445 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, FM,
446 Dual channel ATSC and MPEG2 HW Encoder */
448 /* WinTV-HVR1800 (PCIe, OEM, RCA in, No IR, No FM,
449 Dual channel ATSC and MPEG2 HW Encoder */
451 /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM,
452 Dual channel ATSC and MPEG2 HW Encoder */
454 /* WinTV-HVR1250 (PCIe, Retail, IR, full height,
455 ATSC and Basic analog */
457 /* WinTV-HVR1250 (PCIe, Retail, IR, half height,
458 ATSC and Basic analog */
460 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
461 ATSC and Basic analog */
463 /* WinTV-HVR1250 (PCIe, OEM, No IR, full height,
464 ATSC and Basic analog */
466 /* WinTV-HVR1250 (PCIe, OEM, No IR, half height,
467 ATSC and Basic analog */
469 /* WinTV-HVR1400 (Express Card, Retail, IR,
470 * DVB-T and Basic analog */
472 /* WinTV-HVR1700 (PCIe, OEM, No IR, half height)
473 * DVB-T and MPEG2 HW Encoder */
475 /* WinTV-HVR1700 (PCIe, OEM, No IR, full height)
476 * DVB-T and MPEG2 HW Encoder */
479 printk(KERN_WARNING "%s: warning: unknown hauppauge model #%d\n",
480 dev->name, tv.model);
484 printk(KERN_INFO "%s: hauppauge eeprom: model=%d\n",
485 dev->name, tv.model);
488 int cx23885_tuner_callback(void *priv, int component, int command, int arg)
490 struct cx23885_tsport *port = priv;
491 struct cx23885_dev *dev = port->dev;
494 if (command == XC2028_RESET_CLK)
498 printk(KERN_ERR "%s(): Unknown command 0x%x.\n",
503 switch (dev->board) {
504 case CX23885_BOARD_HAUPPAUGE_HVR1400:
505 case CX23885_BOARD_HAUPPAUGE_HVR1500:
506 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
507 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
508 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
509 /* Tuner Reset Command */
512 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
513 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
514 /* Two identical tuners on two different i2c buses,
515 * we need to reset the correct gpio. */
518 else if (port->nr == 2)
524 /* Drive the tuner into reset and back out */
525 cx_clear(GP0_IO, bitmask);
527 cx_set(GP0_IO, bitmask);
533 void cx23885_gpio_setup(struct cx23885_dev *dev)
535 switch (dev->board) {
536 case CX23885_BOARD_HAUPPAUGE_HVR1250:
537 /* GPIO-0 cx24227 demodulator reset */
538 cx_set(GP0_IO, 0x00010001); /* Bring the part out of reset */
540 case CX23885_BOARD_HAUPPAUGE_HVR1500:
541 /* GPIO-0 cx24227 demodulator */
542 /* GPIO-2 xc3028 tuner */
544 /* Put the parts into reset */
545 cx_set(GP0_IO, 0x00050000);
546 cx_clear(GP0_IO, 0x00000005);
549 /* Bring the parts out of reset */
550 cx_set(GP0_IO, 0x00050005);
552 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
553 /* GPIO-0 cx24227 demodulator reset */
554 /* GPIO-2 xc5000 tuner reset */
555 cx_set(GP0_IO, 0x00050005); /* Bring the part out of reset */
557 case CX23885_BOARD_HAUPPAUGE_HVR1800:
560 /* GPIO-2 8295A Reset */
561 /* GPIO-3-10 cx23417 data0-7 */
562 /* GPIO-11-14 cx23417 addr0-3 */
563 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
567 /* EIO15 Zilog Reset */
568 /* EIO14 S5H1409/CX24227 Reset */
570 /* Force the TDA8295A into reset and back */
571 cx_set(GP0_IO, 0x00040004);
573 cx_clear(GP0_IO, 0x00000004);
575 cx_set(GP0_IO, 0x00040004);
578 case CX23885_BOARD_HAUPPAUGE_HVR1200:
579 /* GPIO-0 tda10048 demodulator reset */
580 /* GPIO-2 tda18271 tuner reset */
582 /* Put the parts into reset and back */
583 cx_set(GP0_IO, 0x00050000);
585 cx_clear(GP0_IO, 0x00000005);
587 cx_set(GP0_IO, 0x00050005);
589 case CX23885_BOARD_HAUPPAUGE_HVR1700:
590 /* GPIO-0 TDA10048 demodulator reset */
591 /* GPIO-2 TDA8295A Reset */
592 /* GPIO-3-10 cx23417 data0-7 */
593 /* GPIO-11-14 cx23417 addr0-3 */
594 /* GPIO-15-18 cx23417 READY, CS, RD, WR */
596 /* The following GPIO's are on the interna AVCore (cx25840) */
598 /* GPIO-20 IR_TX 416/DVBT Select */
599 /* GPIO-21 IIS DAT */
600 /* GPIO-22 IIS WCLK */
601 /* GPIO-23 IIS BCLK */
603 /* Put the parts into reset and back */
604 cx_set(GP0_IO, 0x00050000);
606 cx_clear(GP0_IO, 0x00000005);
608 cx_set(GP0_IO, 0x00050005);
610 case CX23885_BOARD_HAUPPAUGE_HVR1400:
611 /* GPIO-0 Dibcom7000p demodulator reset */
612 /* GPIO-2 xc3028L tuner reset */
615 /* Put the parts into reset and back */
616 cx_set(GP0_IO, 0x00050000);
618 cx_clear(GP0_IO, 0x00000005);
620 cx_set(GP0_IO, 0x00050005);
622 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
623 /* GPIO-0 xc5000 tuner reset i2c bus 0 */
624 /* GPIO-1 s5h1409 demod reset i2c bus 0 */
625 /* GPIO-2 xc5000 tuner reset i2c bus 1 */
626 /* GPIO-3 s5h1409 demod reset i2c bus 0 */
628 /* Put the parts into reset and back */
629 cx_set(GP0_IO, 0x000f0000);
631 cx_clear(GP0_IO, 0x0000000f);
633 cx_set(GP0_IO, 0x000f000f);
635 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
636 /* GPIO-0 portb xc3028 reset */
637 /* GPIO-1 portb zl10353 reset */
638 /* GPIO-2 portc xc3028 reset */
639 /* GPIO-3 portc zl10353 reset */
641 /* Put the parts into reset and back */
642 cx_set(GP0_IO, 0x000f0000);
644 cx_clear(GP0_IO, 0x0000000f);
646 cx_set(GP0_IO, 0x000f000f);
648 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
649 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
650 /* GPIO-2 xc3028 tuner reset */
652 /* The following GPIO's are on the internal AVCore (cx25840) */
653 /* GPIO-? zl10353 demod reset */
655 /* Put the parts into reset and back */
656 cx_set(GP0_IO, 0x00040000);
658 cx_clear(GP0_IO, 0x00000004);
660 cx_set(GP0_IO, 0x00040004);
662 case CX23885_BOARD_TBS_6920:
663 case CX23885_BOARD_TEVII_S470:
664 cx_write(MC417_CTL, 0x00000036);
665 cx_write(MC417_OEN, 0x00001000);
666 cx_write(MC417_RWD, 0x00001800);
668 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
669 /* GPIO-0 INTA from CiMax1
670 GPIO-1 INTB from CiMax2
672 GPIO-3 to GPIO-10 data/addr for CA
673 GPIO-11 ~CS0 to CiMax1
674 GPIO-12 ~CS1 to CiMax2
675 GPIO-13 ADL0 load LSB addr
676 GPIO-14 ADL1 load MSB addr
677 GPIO-15 ~RDY from CiMax
681 cx_set(GP0_IO, 0x00040000); /* GPIO as out */
682 /* GPIO1 and GPIO2 as INTA and INTB from CiMaxes, reset low */
683 cx_clear(GP0_IO, 0x00030004);
684 mdelay(100);/* reset delay */
685 cx_set(GP0_IO, 0x00040004); /* GPIO as out, reset high */
686 cx_write(MC417_CTL, 0x00000037);/* enable GPIO3-18 pins */
687 /* GPIO-15 IN as ~ACK, rest as OUT */
688 cx_write(MC417_OEN, 0x00001000);
689 /* ~RD, ~WR high; ADL0, ADL1 low; ~CS0, ~CS1 high */
690 cx_write(MC417_RWD, 0x0000c300);
692 cx_write(GPIO_ISM, 0x00000000);/* INTERRUPTS active low*/
694 case CX23885_BOARD_HAUPPAUGE_HVR1270:
695 case CX23885_BOARD_HAUPPAUGE_HVR1275:
696 case CX23885_BOARD_HAUPPAUGE_HVR1255:
697 case CX23885_BOARD_HAUPPAUGE_HVR1210:
698 /* GPIO-5 RF Control: 0 = RF1 Terrestrial, 1 = RF2 Cable */
699 /* GPIO-6 I2C Gate which can isolate the demod from the bus */
700 /* GPIO-9 Demod reset */
702 /* Put the parts into reset and back */
703 cx23885_gpio_enable(dev, GPIO_9 | GPIO_6 | GPIO_5, 1);
704 cx23885_gpio_set(dev, GPIO_9 | GPIO_6 | GPIO_5);
705 cx23885_gpio_clear(dev, GPIO_9);
707 cx23885_gpio_set(dev, GPIO_9);
712 int cx23885_ir_init(struct cx23885_dev *dev)
714 switch (dev->board) {
715 case CX23885_BOARD_HAUPPAUGE_HVR1250:
716 case CX23885_BOARD_HAUPPAUGE_HVR1500:
717 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
718 case CX23885_BOARD_HAUPPAUGE_HVR1800:
719 case CX23885_BOARD_HAUPPAUGE_HVR1200:
720 case CX23885_BOARD_HAUPPAUGE_HVR1400:
721 case CX23885_BOARD_HAUPPAUGE_HVR1270:
722 case CX23885_BOARD_HAUPPAUGE_HVR1275:
723 case CX23885_BOARD_HAUPPAUGE_HVR1255:
724 case CX23885_BOARD_HAUPPAUGE_HVR1210:
725 /* FIXME: Implement me */
727 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
728 request_module("ir-kbd-i2c");
735 void cx23885_card_setup(struct cx23885_dev *dev)
737 struct cx23885_tsport *ts1 = &dev->ts1;
738 struct cx23885_tsport *ts2 = &dev->ts2;
740 static u8 eeprom[256];
742 if (dev->i2c_bus[0].i2c_rc == 0) {
743 dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
744 tveeprom_read(&dev->i2c_bus[0].i2c_client,
745 eeprom, sizeof(eeprom));
748 switch (dev->board) {
749 case CX23885_BOARD_HAUPPAUGE_HVR1250:
750 case CX23885_BOARD_HAUPPAUGE_HVR1500:
751 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
752 case CX23885_BOARD_HAUPPAUGE_HVR1400:
753 if (dev->i2c_bus[0].i2c_rc == 0)
754 hauppauge_eeprom(dev, eeprom+0x80);
756 case CX23885_BOARD_HAUPPAUGE_HVR1800:
757 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
758 case CX23885_BOARD_HAUPPAUGE_HVR1200:
759 case CX23885_BOARD_HAUPPAUGE_HVR1700:
760 case CX23885_BOARD_HAUPPAUGE_HVR1270:
761 case CX23885_BOARD_HAUPPAUGE_HVR1275:
762 case CX23885_BOARD_HAUPPAUGE_HVR1255:
763 case CX23885_BOARD_HAUPPAUGE_HVR1210:
764 if (dev->i2c_bus[0].i2c_rc == 0)
765 hauppauge_eeprom(dev, eeprom+0xc0);
769 switch (dev->board) {
770 case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
771 case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
772 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
773 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
774 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
775 /* break omitted intentionally */
776 case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
777 ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
778 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
779 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
781 case CX23885_BOARD_HAUPPAUGE_HVR1800:
782 /* Defaults for VID B - Analog encoder */
783 /* DREQ_POL, SMODE, PUNC_CLK, MCLK_POL Serial bus + punc clk */
784 ts1->gen_ctrl_val = 0x10e;
785 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
786 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
788 /* APB_TSVALERR_POL (active low)*/
789 ts1->vld_misc_val = 0x2000;
790 ts1->hw_sop_ctrl_val = (0x47 << 16 | 188 << 4 | 0xc);
792 /* Defaults for VID C */
793 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
794 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
795 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
797 case CX23885_BOARD_TEVII_S470:
798 case CX23885_BOARD_TBS_6920:
799 case CX23885_BOARD_DVBWORLD_2005:
800 ts1->gen_ctrl_val = 0x5; /* Parallel */
801 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
802 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
804 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
805 ts1->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
806 ts1->ts_clk_en_val = 0x1; /* Enable TS_CLK */
807 ts1->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
808 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
809 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
810 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
812 case CX23885_BOARD_HAUPPAUGE_HVR1250:
813 case CX23885_BOARD_HAUPPAUGE_HVR1500:
814 case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
815 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
816 case CX23885_BOARD_HAUPPAUGE_HVR1200:
817 case CX23885_BOARD_HAUPPAUGE_HVR1700:
818 case CX23885_BOARD_HAUPPAUGE_HVR1400:
819 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
820 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
821 case CX23885_BOARD_HAUPPAUGE_HVR1270:
822 case CX23885_BOARD_HAUPPAUGE_HVR1275:
823 case CX23885_BOARD_HAUPPAUGE_HVR1255:
824 case CX23885_BOARD_HAUPPAUGE_HVR1210:
826 ts2->gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
827 ts2->ts_clk_en_val = 0x1; /* Enable TS_CLK */
828 ts2->src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
831 /* Certain boards support analog, or require the avcore to be
832 * loaded, ensure this happens.
834 switch (dev->board) {
835 case CX23885_BOARD_HAUPPAUGE_HVR1800:
836 case CX23885_BOARD_HAUPPAUGE_HVR1800lp:
837 case CX23885_BOARD_HAUPPAUGE_HVR1700:
838 case CX23885_BOARD_LEADTEK_WINFAST_PXDVR3200_H:
839 case CX23885_BOARD_COMPRO_VIDEOMATE_E650F:
840 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
841 dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
842 &dev->i2c_bus[2].i2c_adap,
843 "cx25840", "cx25840", 0x88 >> 1);
844 v4l2_subdev_call(dev->sd_cx25840, core, load_fw);
848 /* AUX-PLL 27MHz CLK */
849 switch (dev->board) {
850 case CX23885_BOARD_NETUP_DUAL_DVBS2_CI:
851 netup_initialize(dev);
856 /* ------------------------------------------------------------------ */