]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cx18/cx18-driver.c
Merge branch 'x86/prototypes' into x86-v28-for-linus-phase1
[linux-2.6-omap-h63xx.git] / drivers / media / video / cx18 / cx18-driver.c
index 2b810bb2a4c70f8d37fc40b6ed5646d1ce5e308f..bd18afebbf860565292b212bde83361486761d8e 100644 (file)
@@ -74,9 +74,9 @@ static int radio[CX18_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
                                     -1, -1, -1, -1, -1, -1, -1, -1,
                                     -1, -1, -1, -1, -1, -1, -1, -1 };
 
-static int cardtype_c = 1;
-static int tuner_c = 1;
-static int radio_c = 1;
+static unsigned cardtype_c = 1;
+static unsigned tuner_c = 1;
+static unsigned radio_c = 1;
 static char pal[] = "--";
 static char secam[] = "--";
 static char ntsc[] = "-";
@@ -120,6 +120,7 @@ MODULE_PARM_DESC(cardtype,
                 "\t\t\t 2 = Hauppauge HVR 1600 (Samsung memory)\n"
                 "\t\t\t 3 = Compro VideoMate H900\n"
                 "\t\t\t 4 = Yuan MPC718\n"
+                "\t\t\t 5 = Conexant Raptor PAL/SECAM\n"
                 "\t\t\t 0 = Autodetect (default)\n"
                 "\t\t\t-1 = Ignore this card\n\t\t");
 MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60");
@@ -420,6 +421,7 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
        mutex_init(&cx->serialize_lock);
        mutex_init(&cx->i2c_bus_lock[0]);
        mutex_init(&cx->i2c_bus_lock[1]);
+       mutex_init(&cx->gpio_lock);
 
        spin_lock_init(&cx->lock);
        spin_lock_init(&cx->dma_reg_lock);
@@ -435,7 +437,7 @@ static int __devinit cx18_init_struct1(struct cx18 *cx)
                (cx->params.video_temporal_filter_mode << 1) |
                (cx->params.video_median_filter_type << 2);
        cx->params.port = CX2341X_PORT_MEMORY;
-       cx->params.capabilities = CX2341X_CAP_HAS_SLICED_VBI;
+       cx->params.capabilities = CX2341X_CAP_HAS_TS;
        init_waitqueue_head(&cx->cap_w);
        init_waitqueue_head(&cx->mb_apu_waitq);
        init_waitqueue_head(&cx->mb_cpu_waitq);
@@ -614,7 +616,7 @@ static int __devinit cx18_probe(struct pci_dev *dev,
        cx18_cards[cx18_cards_active] = cx;
        cx->dev = dev;
        cx->num = cx18_cards_active++;
-       snprintf(cx->name, sizeof(cx->name) - 1, "cx18-%d", cx->num);
+       snprintf(cx->name, sizeof(cx->name), "cx18-%d", cx->num);
        CX18_INFO("Initializing card #%d\n", cx->num);
 
        spin_unlock(&cx18_cards_lock);
@@ -721,6 +723,12 @@ static int __devinit cx18_probe(struct pci_dev *dev,
        /* if no tuner was found, then pick the first tuner in the card list */
        if (cx->options.tuner == -1 && cx->card->tuners[0].std) {
                cx->std = cx->card->tuners[0].std;
+               if (cx->std & V4L2_STD_PAL)
+                       cx->std = V4L2_STD_PAL_BG | V4L2_STD_PAL_H;
+               else if (cx->std & V4L2_STD_NTSC)
+                       cx->std = V4L2_STD_NTSC_M;
+               else if (cx->std & V4L2_STD_SECAM)
+                       cx->std = V4L2_STD_SECAM_L;
                cx->options.tuner = cx->card->tuners[0].tuner;
        }
        if (cx->options.radio == -1)
@@ -818,6 +826,9 @@ int cx18_init_on_first_open(struct cx18 *cx)
        int video_input;
        int fw_retry_count = 3;
        struct v4l2_frequency vf;
+       struct cx18_open_id fh;
+
+       fh.cx = cx;
 
        if (test_bit(CX18_F_I_FAILED, &cx->i_flags))
                return -ENXIO;
@@ -869,13 +880,13 @@ int cx18_init_on_first_open(struct cx18 *cx)
 
        video_input = cx->active_input;
        cx->active_input++;     /* Force update of input */
-       cx18_v4l2_ioctls(cx, NULL, VIDIOC_S_INPUT, &video_input);
+       cx18_s_input(NULL, &fh, video_input);
 
        /* Let the VIDIOC_S_STD ioctl do all the work, keeps the code
           in one place. */
        cx->std++;              /* Force full standard initialization */
-       cx18_v4l2_ioctls(cx, NULL, VIDIOC_S_STD, &cx->tuner_std);
-       cx18_v4l2_ioctls(cx, NULL, VIDIOC_S_FREQUENCY, &vf);
+       cx18_s_std(NULL, &fh, &cx->tuner_std);
+       cx18_s_frequency(NULL, &fh, &vf);
        return 0;
 }