]> err.no Git - linux-2.6/commitdiff
V4L/DVB (4852): Pvrusb2: Fix horizontal resolution setting problem for 24xxx devices
authorMike Isely <isely@pobox.com>
Sun, 19 Nov 2006 23:50:31 +0000 (20:50 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 10 Dec 2006 10:51:35 +0000 (08:51 -0200)
Fix long-standing issue which prevented use of 24xxx devices at any
horizontal resolution other an 720.  The problem is in the cx25840
module, if no attempt is made to initialize VBI there.  Such a thing
should not be needed, but the pvrusb2 driver is updated now to deal
with this.

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c

index c80c26be6e4d31dd048964525184d676cc96bf0d..848fb233d80861efe8cb88d07787d61aaeb587b2 100644 (file)
@@ -260,6 +260,22 @@ int pvr2_i2c_cx2584x_v4l_setup(struct pvr2_hdw *hdw,
                                  sizeof(decoder_ops[0]))) - 1;
        hdw->decoder_ctrl = &ctxt->ctrl;
        cp->handler = &ctxt->handler;
+       {
+               /*
+                 Mike Isely <isely@pobox.com> 19-Nov-2006 - This bit
+                 of nuttiness for cx25840 causes that module to
+                 correctly set up its video scaling.  This is really
+                 a problem in the cx25840 module itself, but we work
+                 around it here.  The problem has not been seen in
+                 ivtv because there VBI is supported and set up.  We
+                 don't do VBI here (at least not yet) and thus we
+                 never attempted to even set it up.
+                */
+               struct v4l2_format fmt;
+               memset(&fmt,0,sizeof(fmt));
+               fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
+               pvr2_i2c_client_cmd(ctxt->client,VIDIOC_S_FMT,&fmt);
+       }
        pvr2_trace(PVR2_TRACE_CHIPS,"i2c 0x%x cx2584x V4L2 handler set up",
                   cp->client->addr);
        return !0;
index 1f787333d18c03153cb840c9d6307960f3a0c5b2..d2004965187bf54e47455a067881abf27f444950 100644 (file)
@@ -356,28 +356,6 @@ static int ctrl_freq_set(struct pvr2_ctrl *cptr,int m,int v)
        return 0;
 }
 
-static int ctrl_hres_max_get(struct pvr2_ctrl *cptr,int *vp)
-{
-       /* If we're dealing with a 24xxx device, force the horizontal
-          maximum to be 720 no matter what, since we can't get the device
-          to work properly with any other value.  Otherwise just return
-          the normal value. */
-       *vp = cptr->info->def.type_int.max_value;
-       if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
-       return 0;
-}
-
-static int ctrl_hres_min_get(struct pvr2_ctrl *cptr,int *vp)
-{
-       /* If we're dealing with a 24xxx device, force the horizontal
-          minimum to be 720 no matter what, since we can't get the device
-          to work properly with any other value.  Otherwise just return
-          the normal value. */
-       *vp = cptr->info->def.type_int.min_value;
-       if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
-       return 0;
-}
-
 static int ctrl_vres_max_get(struct pvr2_ctrl *cptr,int *vp)
 {
        /* Actual maximum depends on the video standard in effect. */
@@ -758,10 +736,6 @@ static const struct pvr2_ctl_info control_defs[] = {
                .default_value = 720,
                DEFREF(res_hor),
                DEFINT(19,720),
-               /* Hook in check for clamp on horizontal resolution in
-                  order to avoid unsolved problem involving cx25840. */
-               .get_max_value = ctrl_hres_max_get,
-               .get_min_value = ctrl_hres_min_get,
        },{
                .desc = "Vertical capture resolution",
                .name = "resolution_ver",