[media] cx231xx: Add initial support for Hauppauge USB-Live2
authorDevin Heitmueller <dheitmueller@hauppauge.com>
Sat, 31 Jul 2010 03:49:01 +0000 (00:49 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Oct 2010 03:17:28 +0000 (01:17 -0200)
Add initial support for the Hauppauge USBLive 2 (2040:c200).  Note that I
had to copy a bunch of the case statements used for the Conexant video grabber
reference design (which also doesn't have a tuner).  This will likely need to
be refactored out into the board profile.

Signed-off-by: Devin Heitmueller <dheitmueller@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/cx231xx/cx231xx-avcore.c
drivers/media/video/cx231xx/cx231xx-cards.c
drivers/media/video/cx231xx/cx231xx-core.c
drivers/media/video/cx231xx/cx231xx-video.c
drivers/media/video/cx231xx/cx231xx.h

index 0d358e675984062f44137e6ce384937a8ea9fd02..917812d6ab21601bb65c95fcd508b6de821f5a77 100644 (file)
@@ -353,6 +353,7 @@ int cx231xx_afe_update_power_control(struct cx231xx *dev,
        case CX231XX_BOARD_CNXT_RDU_253S:
        case CX231XX_BOARD_CNXT_VIDEO_GRABBER:
        case CX231XX_BOARD_HAUPPAUGE_EXETER:
+       case CX231XX_BOARD_HAUPPAUGE_USBLIVE2:
                if (avmode == POLARIS_AVMODE_ANALOGT_TV) {
                        while (afe_power_status != (FLD_PWRDN_TUNING_BIAS |
                                                FLD_PWRDN_ENABLE_PLL)) {
index ed8139acf19a7dac39609e040acd4cc1f8904b16..4d37cb7b07502ffdced8f9f419b6429605b18889 100644 (file)
@@ -378,11 +378,29 @@ struct cx231xx_board cx231xx_boards[] = {
                        .gpio = 0,
                } },
        },
-
-
-
-
-
+       [CX231XX_BOARD_HAUPPAUGE_USBLIVE2] = {
+               .name = "Hauppauge USB Live 2",
+               .tuner_type = TUNER_ABSENT,
+               .decoder = CX231XX_AVDECODER,
+               .demod_xfer_mode = 0,
+               .ctl_pin_status_mask = 0xFFFFFFC4,
+               .agc_analog_digital_select_gpio = 0x0c,
+               .gpio_pin_status_mask = 0x4001000,
+               .norm = V4L2_STD_NTSC,
+               .input = {{
+                       .type = CX231XX_VMUX_COMPOSITE1,
+                       .vmux = CX231XX_VIN_2_1,
+                       .amux = CX231XX_AMUX_LINE_IN,
+                       .gpio = 0,
+               }, {
+                       .type = CX231XX_VMUX_SVIDEO,
+                       .vmux = CX231XX_VIN_1_1 |
+                               (CX231XX_VIN_1_2 << 8) |
+                               CX25840_SVIDEO_ON,
+                       .amux = CX231XX_AMUX_LINE_IN,
+                       .gpio = 0,
+               } },
+       },
 };
 const unsigned int cx231xx_bcount = ARRAY_SIZE(cx231xx_boards);
 
@@ -410,6 +428,8 @@ struct usb_device_id cx231xx_id_table[] = {
         .driver_info = CX231XX_BOARD_HAUPPAUGE_EXETER},
        {USB_DEVICE(0x2040, 0xb140),
         .driver_info = CX231XX_BOARD_HAUPPAUGE_EXETER},
+       {USB_DEVICE(0x2040, 0xc200),
+        .driver_info = CX231XX_BOARD_HAUPPAUGE_USBLIVE2},
        {},
 };
 
@@ -688,7 +708,8 @@ static int cx231xx_init_dev(struct cx231xx **devhandle, struct usb_device *udev,
 
        /*To workaround error number=-71 on EP0 for VideoGrabber,
                 need set alt here.*/
-       if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER) {
+       if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER ||
+           dev->model == CX231XX_BOARD_HAUPPAUGE_USBLIVE2) {
                cx231xx_set_alt_setting(dev, INDEX_VIDEO, 3);
                cx231xx_set_alt_setting(dev, INDEX_VANC, 1);
        }
index fe3d500424f3c7812543cb2944842336af61c771..5406ff28852eb628e84480324072f70d487c2b53 100644 (file)
@@ -628,7 +628,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
                usb_interface_index, alt);
                /*To workaround error number=-71 on EP0 for videograbber,
                 need add following codes.*/
-               if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER)
+               if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
+                   dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
                        return -1;
        }
 
@@ -1327,7 +1328,8 @@ int cx231xx_dev_init(struct cx231xx *dev)
        /* init hardware */
        /* Note : with out calling set power mode function,
        afe can not be set up correctly */
-       if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER) {
+       if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER ||
+           dev->model == CX231XX_BOARD_HAUPPAUGE_USBLIVE2) {
                errCode = cx231xx_set_power_mode(dev,
                                 POLARIS_AVMODE_ENXTERNAL_AV);
                if (errCode < 0) {
@@ -1427,7 +1429,8 @@ int cx231xx_dev_init(struct cx231xx *dev)
                cx231xx_set_alt_setting(dev, INDEX_TS1, 0);
 
        /* set the I2C master port to 3 on channel 1 */
-       if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER)
+       if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
+           dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
                errCode = cx231xx_enable_i2c_for_tuner(dev, I2C_3);
 
        return errCode;
index 0880edd3a49bfcdda1a1f3efcfdb0c738d154b76..38367ee07cc566cdc28756f936bf58becebb0eb1 100644 (file)
@@ -2256,7 +2256,8 @@ static int cx231xx_v4l2_open(struct file *filp)
                dev->height = norm_maxh(dev);
 
                /* Power up in Analog TV mode */
-               if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER)
+               if (dev->model == CX231XX_BOARD_CNXT_VIDEO_GRABBER ||
+                   dev->model == CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
                        cx231xx_set_power_mode(dev,
                                 POLARIS_AVMODE_ENXTERNAL_AV);
                else
@@ -2296,7 +2297,8 @@ static int cx231xx_v4l2_open(struct file *filp)
        if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
                /* Set the required alternate setting  VBI interface works in
                   Bulk mode only */
-               if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER)
+               if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
+                   dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
                        cx231xx_set_alt_setting(dev, INDEX_VANC, 0);
 
                videobuf_queue_vmalloc_init(&fh->vb_vidq, &cx231xx_vbi_qops,
@@ -2371,7 +2373,8 @@ static int cx231xx_v4l2_close(struct file *filp)
 
        /*To workaround error number=-71 on EP0 for VideoGrabber,
                 need exclude following.*/
-       if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER)
+       if (dev->model != CX231XX_BOARD_CNXT_VIDEO_GRABBER &&
+           dev->model != CX231XX_BOARD_HAUPPAUGE_USBLIVE2)
                if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
                        videobuf_stop(&fh->vb_vidq);
                        videobuf_mmap_free(&fh->vb_vidq);
index aa273428d0213db4b0e62cc0aafc52951a67ae2d..8d4fcf70387f33b571e561f3cc41997440c2f9de 100644 (file)
@@ -63,6 +63,7 @@
 #define CX231XX_BOARD_CNXT_RDE_250     6
 #define CX231XX_BOARD_CNXT_RDU_250             7
 #define CX231XX_BOARD_HAUPPAUGE_EXETER  8
+#define CX231XX_BOARD_HAUPPAUGE_USBLIVE2 9
 
 /* Limits minimum and default number of buffers */
 #define CX231XX_MIN_BUF                 4