The patch number 8987 was added via Steven Toth <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Steven Toth  <[EMAIL PROTECTED]>
cx88: Add support for the Hauppauge HVR4000 and HVR4000-LITE (S2) boards


Adding support for Hauppauge's cx88 S2 based products, based on the
cx24116 DVB-S2 demodulator.

Priority: normal

Signed-off-by: Steven Toth <[EMAIL PROTECTED]>


---

 linux/Documentation/video4linux/CARDLIST.cx88 |    2 
 linux/drivers/media/video/cx88/cx88-cards.c   |   79 ++++++++++++++++++
 linux/drivers/media/video/cx88/cx88-dvb.c     |   42 +++++++++
 linux/drivers/media/video/cx88/cx88-input.c   |    4 
 linux/drivers/media/video/cx88/cx88.h         |    2 
 5 files changed, 129 insertions(+)

diff -r dbe777f26aea -r 3a4c28521d43 
linux/Documentation/video4linux/CARDLIST.cx88
--- a/linux/Documentation/video4linux/CARDLIST.cx88     Thu Sep 04 00:14:43 
2008 -0400
+++ b/linux/Documentation/video4linux/CARDLIST.cx88     Thu Sep 04 00:17:33 
2008 -0400
@@ -66,3 +66,5 @@
  65 -> DViCO FusionHDTV 7 Gold                             [18ac:d610]
  66 -> Prolink Pixelview MPEG 8000GT                       [1554:4935]
  67 -> Kworld PlusTV HD PCI 120 (ATSC 120)                 [17de:08c1]
+ 68 -> Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid           
[0070:6900,0070:6904,0070:6902]
+ 69 -> Hauppauge WinTV-HVR4000(Lite) DVB-S/S2              
[0070:6905,0070:6906]
diff -r dbe777f26aea -r 3a4c28521d43 linux/drivers/media/video/cx88/cx88-cards.c
--- a/linux/drivers/media/video/cx88/cx88-cards.c       Thu Sep 04 00:14:43 
2008 -0400
+++ b/linux/drivers/media/video/cx88/cx88-cards.c       Thu Sep 04 00:17:33 
2008 -0400
@@ -1699,6 +1699,51 @@ static const struct cx88_board cx88_boar
                        .gpio1  = 0x0000f35d,
                        .gpio2  = 0x00000000,
                },
+               .mpeg           = CX88_MPEG_DVB,
+       },
+       [CX88_BOARD_HAUPPAUGE_HVR4000] = {
+               .name           = "Hauppauge WinTV-HVR4000 DVB-S/S2/T/Hybrid",
+               .tuner_type     = TUNER_PHILIPS_FMD1216ME_MK3,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .tda9887_conf   = TDA9887_PRESENT,
+               /*
+                * GPIO0 (WINTV2000)
+                *
+                * Analogue     SAT     DVB-T
+                * Antenna      0xc4bf  0xc4bb
+                * Composite    0xc4bf  0xc4bb
+                * S-Video      0xc4bf  0xc4bb
+                * Composite1   0xc4ff  0xc4fb
+                * S-Video1     0xc4ff  0xc4fb
+                */
+               .input          = {{
+                       .type   = CX88_VMUX_TELEVISION,
+                       .vmux   = 0,
+                       .gpio0  = 0xc4bf,
+               }, {
+                       .type   = CX88_VMUX_COMPOSITE1,
+                       .vmux   = 1,
+                       .gpio0  = 0xc4bf,
+               }, {
+                       .type   = CX88_VMUX_SVIDEO,
+                       .vmux   = 2,
+                       .gpio0  = 0xc4bf,
+               } },
+               /* fixme: Add radio support */
+               .mpeg           = CX88_MPEG_DVB,
+       },
+       [CX88_BOARD_HAUPPAUGE_HVR4000LITE] = {
+               .name           = "Hauppauge WinTV-HVR4000(Lite) DVB-S/S2",
+               .tuner_type     = UNSET,
+               .radio_type     = UNSET,
+               .tuner_addr     = ADDR_UNSET,
+               .radio_addr     = ADDR_UNSET,
+               .input          = {{
+                       .type   = CX88_VMUX_DVB,
+                       .vmux   = 0,
+               } },
                .mpeg           = CX88_MPEG_DVB,
        },
 };
@@ -2050,6 +2095,26 @@ static const struct cx88_subid cx88_subi
                .subvendor = 0x17de,
                .subdevice = 0x08c1,
                .card      = CX88_BOARD_KWORLD_ATSC_120,
+       }, {
+               .subvendor = 0x0070,
+               .subdevice = 0x6900,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR4000,
+       }, {
+               .subvendor = 0x0070,
+               .subdevice = 0x6904,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR4000,
+       }, {
+               .subvendor = 0x0070,
+               .subdevice = 0x6902,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR4000,
+       }, {
+               .subvendor = 0x0070,
+               .subdevice = 0x6905,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR4000LITE,
+       }, {
+               .subvendor = 0x0070,
+               .subdevice = 0x6906,
+               .card      = CX88_BOARD_HAUPPAUGE_HVR4000LITE,
        },
 };
 
@@ -2102,6 +2167,13 @@ static void hauppauge_eeprom(struct cx88
        case 14669: /* WinTV-HVR3000 (OEM, no IR, no b/panel video - Low 
profile) */
        case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
        case 34519: /* WinTV-PCI-FM */
+       case 69009:
+               /* WinTV-HVR4000 (DVBS/S2/T, Video and IR, back panel inputs) */
+       case 69100: /* WinTV-HVR4000LITE (DVBS/S2, IR) */
+       case 69500: /* WinTV-HVR4000LITE (DVBS/S2, No IR) */
+       case 69559:
+               /* WinTV-HVR4000 (DVBS/S2/T, Video no IR, back panel inputs) */
+       case 69569: /* WinTV-HVR4000 (DVBS/S2/T, Video no IR) */
        case 90002: /* Nova-T-PCI (9002) */
        case 92001: /* Nova-S-Plus (Video and IR) */
        case 92002: /* Nova-S-Plus (Video and IR) */
@@ -2452,6 +2524,11 @@ static void cx88_card_setup_pre_i2c(stru
                /* Enable the xc5000 tuner */
                cx_set(MO_GP0_IO, 0x00001010);
                break;
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
+               /* Init GPIO to allow tuner to attach */
+               cx_write(MO_GP0_IO, 0x0000c4bf);
+               udelay(1000);
        }
 }
 
@@ -2526,6 +2603,8 @@ static void cx88_card_setup(struct cx88_
        case CX88_BOARD_HAUPPAUGE_HVR1100LP:
        case CX88_BOARD_HAUPPAUGE_HVR3000:
        case CX88_BOARD_HAUPPAUGE_HVR1300:
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
                if (0 == core->i2c_rc)
                        hauppauge_eeprom(core, eeprom);
                break;
diff -r dbe777f26aea -r 3a4c28521d43 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c Thu Sep 04 00:14:43 2008 -0400
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c Thu Sep 04 00:17:33 2008 -0400
@@ -49,6 +49,7 @@
 #include "tuner-simple.h"
 #include "tda9887.h"
 #include "s5h1411.h"
+#include "cx24116.h"
 
 MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
 MODULE_AUTHOR("Chris Pascoe <[EMAIL PROTECTED]>");
@@ -524,6 +525,35 @@ static int attach_xc3028(u8 addr, struct
 
        return 0;
 }
+
+static int cx24116_set_ts_param(struct dvb_frontend *fe,
+       int is_punctured)
+{
+       struct cx8802_dev *dev = fe->dvb->priv;
+       dev->ts_gen_cntrl = 0x2;
+
+       return 0;
+}
+
+static int cx24116_reset_device(struct dvb_frontend *fe)
+{
+       struct cx8802_dev *dev = fe->dvb->priv;
+       struct cx88_core *core = dev->core;
+
+       /* Reset the part */
+       cx_write(MO_SRST_IO, 0);
+       msleep(10);
+       cx_write(MO_SRST_IO, 1);
+       msleep(10);
+
+       return 0;
+}
+
+static struct cx24116_config hauppauge_hvr4000_config = {
+       .demod_address          = 0x05,
+       .set_ts_params          = cx24116_set_ts_param,
+       .reset_device           = cx24116_reset_device,
+};
 
 static int dvb_register(struct cx8802_dev *dev)
 {
@@ -891,6 +921,18 @@ static int dvb_register(struct cx8802_de
                                goto frontend_detach;
                }
                break;
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
+               /* Support for DVB-S only, not DVB-T support */
+               dev->dvb.frontend = dvb_attach(cx24116_attach,
+                       &hauppauge_hvr4000_config,
+                       &dev->core->i2c_adap);
+               if (dev->dvb.frontend) {
+                       dvb_attach(isl6421_attach, dev->dvb.frontend,
+                               &dev->core->i2c_adap,
+                               0x08, 0x00, 0x00);
+               }
+               break;
        default:
                printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't 
supported yet\n",
                       core->name);
diff -r dbe777f26aea -r 3a4c28521d43 linux/drivers/media/video/cx88/cx88-input.c
--- a/linux/drivers/media/video/cx88/cx88-input.c       Thu Sep 04 00:14:43 
2008 -0400
+++ b/linux/drivers/media/video/cx88/cx88-input.c       Thu Sep 04 00:17:33 
2008 -0400
@@ -237,6 +237,8 @@ int cx88_ir_init(struct cx88_core *core,
        case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR3000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
                ir_codes = ir_codes_hauppauge_new;
                ir_type = IR_TYPE_RC5;
                ir->sampling = 1;
@@ -479,6 +481,8 @@ void cx88_ir_irq(struct cx88_core *core)
        case CX88_BOARD_HAUPPAUGE_HVR1100:
        case CX88_BOARD_HAUPPAUGE_HVR3000:
        case CX88_BOARD_PINNACLE_PCTV_HD_800i:
+       case CX88_BOARD_HAUPPAUGE_HVR4000:
+       case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
                ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
                ir_dprintk("biphase decoded: %x\n", ircode);
                if ((ircode & 0xfffff000) != 0x3000)
diff -r dbe777f26aea -r 3a4c28521d43 linux/drivers/media/video/cx88/cx88.h
--- a/linux/drivers/media/video/cx88/cx88.h     Thu Sep 04 00:14:43 2008 -0400
+++ b/linux/drivers/media/video/cx88/cx88.h     Thu Sep 04 00:17:33 2008 -0400
@@ -222,6 +222,8 @@ extern struct sram_channel cx88_sram_cha
 #define CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD 65
 #define CX88_BOARD_PROLINK_PV_8000GT       66
 #define CX88_BOARD_KWORLD_ATSC_120         67
+#define CX88_BOARD_HAUPPAUGE_HVR4000       68
+#define CX88_BOARD_HAUPPAUGE_HVR4000LITE   69
 
 enum cx88_itype {
        CX88_VMUX_COMPOSITE1 = 1,


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/3a4c28521d430bfee3eef546b499fc58dd032952

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to