]> err.no Git - linux-2.6/commitdiff
V4L/DVB (6196): cx23885: add support for DViCO FusionHDTV 5 Express
authorMichael Krufky <mkrufky@linuxtv.org>
Sat, 8 Sep 2007 18:17:13 +0000 (15:17 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:14:29 +0000 (22:14 -0300)
This patch adds digital ATSC / QAM support for the DViCO FusionHDTV5 Express.
Remote control is supported by ir-kbd-i2c, RTC is supported by rtc-isl1208.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Steven Toth <stoth@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx23885/cx23885-cards.c
drivers/media/video/cx23885/cx23885-core.c
drivers/media/video/cx23885/cx23885-dvb.c
drivers/media/video/cx23885/cx23885-i2c.c
drivers/media/video/cx23885/cx23885.h
drivers/media/video/ir-kbd-i2c.c
drivers/media/video/tuner-core.c

index 09d4376c2e05cea840d4fc7807754102a6a06fe1..cdda11ddf145679f4a114ca13a7848722dc66dd0 100644 (file)
@@ -109,6 +109,10 @@ struct cx23885_board cx23885_boards[] = {
                        .gpio0  = 0xff02,
                }},
        },
+       [CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP] = {
+               .name           = "DViCO FusionHDTV5 Express",
+               .portc          = CX23885_MPEG_DVB,
+       },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -136,6 +140,10 @@ struct cx23885_subid cx23885_subids[] = {
                .subvendor = 0x0070,
                .subdevice = 0x7911,
                .card      = CX23885_BOARD_HAUPPAUGE_HVR1250,
+       },{
+               .subvendor = 0x18ac,
+               .subdevice = 0xd500,
+               .card      = CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP,
        },
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
index 553a72ae163ae06fafc261a874b3ad976a004c77..bcba192634760de39e00ecde7e0750d3e8d1728c 100644 (file)
@@ -793,6 +793,32 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
        cx23885_ir_init(dev);
 
        switch (dev->board) {
+       case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
+               dev->ts2.reg_gpcnt          = VID_B_GPCNT;
+               dev->ts2.reg_gpcnt_ctl      = VID_B_GPCNT_CTL;
+               dev->ts2.reg_dma_ctl        = VID_B_DMA_CTL;
+               dev->ts2.reg_lngth          = VID_B_LNGTH;
+               dev->ts2.reg_hw_sop_ctrl    = VID_B_HW_SOP_CTL;
+               dev->ts2.reg_gen_ctrl       = VID_B_GEN_CTL;
+               dev->ts2.reg_bd_pkt_status  = VID_B_BD_PKT_STATUS;
+               dev->ts2.reg_sop_status     = VID_B_SOP_STATUS;
+               dev->ts2.reg_fifo_ovfl_stat = VID_B_FIFO_OVFL_STAT;
+               dev->ts2.reg_vld_misc       = VID_B_VLD_MISC;
+               dev->ts2.reg_ts_clk_en      = VID_B_TS_CLK_EN;
+               dev->ts2.reg_ts_int_msk     = VID_B_INT_MSK;
+               dev->ts2.reg_src_sel        = VID_B_SRC_SEL;
+
+               // FIXME: Make this board specific
+               dev->ts2.pci_irqmask = 0x02; /* TS Port 2 bit */
+               dev->ts2.dma_ctl_val = 0x11; /* Enable RISC controller and Fifo */
+               dev->ts2.ts_int_msk_val = 0x1111; /* TS port bits for RISC */
+               dev->ts2.gen_ctrl_val = 0xc; /* Serial bus + punctured clock */
+               dev->ts2.ts_clk_en_val = 0x1; /* Enable TS_CLK */
+               dev->ts2.src_sel_val = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
+
+               // Drive this from cards.c (portb/c) and move it outside of this switch
+               dev->ts2.sram_chno = SRAM_CH03;
+               break;
        default:
                dev->ts2.reg_gpcnt          = VID_C_GPCNT;
                dev->ts2.reg_gpcnt_ctl      = VID_C_GPCNT_CTL;
index ffa4c49d691671f5aeda02be74dac54ed8ca1872..0ace919195df55c88eac282b7f3c78e30f5e75c3 100644 (file)
@@ -32,6 +32,8 @@
 
 #include "s5h1409.h"
 #include "mt2131.h"
+#include "lgdt330x.h"
+#include "dvb-pll.h"
 
 static unsigned int debug = 0;
 
@@ -101,6 +103,12 @@ static struct mt2131_config hauppauge_generic_tunerconfig = {
        0x61
 };
 
+static struct lgdt330x_config fusionhdtv_5_express = {
+       .demod_address = 0x0e,
+       .demod_chip = LGDT3303,
+       .serial_mpeg = 0x40,
+};
+
 static int dvb_register(struct cx23885_tsport *port)
 {
        struct cx23885_dev *dev = port->dev;
@@ -131,6 +139,16 @@ static int dvb_register(struct cx23885_tsport *port)
                                   &hauppauge_generic_tunerconfig, 0);
                }
                break;
+       case CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP:
+               port->dvb.frontend = dvb_attach(lgdt330x_attach,
+                                               &fusionhdtv_5_express,
+                                               &dev->i2c_bus[0].i2c_adap);
+               if (port->dvb.frontend != NULL) {
+                       dvb_attach(dvb_pll_attach, port->dvb.frontend,
+                                  0x61, &dev->i2c_bus[0].i2c_adap,
+                                  DVB_PLL_LG_TDVS_H06XF);
+               }
+               break;
        default:
                printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n",
                       dev->name);
index 5572fbbbb5ae7b7411276b063b79666c0932730b..b517c8b5a5668cba8970dbcb62a40627d0f2818b 100644 (file)
@@ -305,12 +305,14 @@ static struct i2c_client cx23885_i2c_client_template = {
 };
 
 static char *i2c_devs[128] = {
+       [ 0x1c >> 1 ] = "lgdt3303",
+       [ 0x86 >> 1 ] = "tda9887",
        [ 0x32 >> 1 ] = "cx24227",
        [ 0x88 >> 1 ] = "cx25837",
        [ 0x84 >> 1 ] = "tda8295",
        [ 0xa0 >> 1 ] = "eeprom",
-       [ 0xc0 >> 1 ] = "mt2131/tda8275",
-       [ 0xc2 >> 1 ] = "mt2131/tda8275",
+       [ 0xc0 >> 1 ] = "tuner/mt2131/tda8275",
+       [ 0xc2 >> 1 ] = "tuner/mt2131/tda8275",
 };
 
 static void do_i2c_scan(char *name, struct i2c_client *c)
index 62b44f6d749fe867323a5da94af3688fabd8c582..4933274b1e3947c2928f24a688e3e4da20e92518 100644 (file)
@@ -54,6 +54,7 @@
 #define CX23885_BOARD_HAUPPAUGE_HVR1800lp      1
 #define CX23885_BOARD_HAUPPAUGE_HVR1800        2
 #define CX23885_BOARD_HAUPPAUGE_HVR1250        3
+#define CX23885_BOARD_DVICO_FUSIONHDTV_5_EXP   4
 
 enum cx23885_itype {
        CX23885_VMUX_COMPOSITE1 = 1,
index 04f6eb5ea2927add42794cc8f32fec8719d9dc8f..d98dd0d1e37301c04644d154d342ca8fde4ca155 100644 (file)
@@ -507,6 +507,7 @@ static int ir_probe(struct i2c_adapter *adap)
        static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
        static const int probe_em28XX[] = { 0x30, 0x47, -1 };
        static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
+       static const int probe_cx23885[] = { 0x6b, -1 };
        const int *probe = NULL;
        struct i2c_client c;
        unsigned char buf;
@@ -527,6 +528,8 @@ static int ir_probe(struct i2c_adapter *adap)
                break;
        case I2C_HW_B_CX2388x:
                probe = probe_cx88;
+       case I2C_HW_B_CX23885:
+               probe = probe_cx23885;
                break;
        }
        if (NULL == probe)
index 2d4a3e38f278b5a650eecb9ed3f90f7b66124154..94843086cda90f41f32e2b876b23b0e63908abb9 100644 (file)
@@ -665,7 +665,8 @@ static int tuner_probe(struct i2c_adapter *adap)
         * FusionHDTV5 RT Gold has an ir receiver at 0x6b
         * and an RTC at 0x6f which can get corrupted if probed.
         */
-       if (adap->id == I2C_HW_B_CX2388x) {
+       if ((adap->id == I2C_HW_B_CX2388x) ||
+           (adap->id == I2C_HW_B_CX23885)) {
                unsigned int i = 0;
 
                while (i < I2C_CLIENT_MAX_OPTS && ignore[i] != I2C_CLIENT_END)