aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-08-08 08:10:07 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-26 10:53:22 -0400
commit094ddbe9506706187b58df91d64695547a807916 (patch)
treed597d8071ac4f6d840fceed2578d91e821d5a40f /drivers/media/video/pvrusb2/pvrusb2-hdw.c
parent89ebd63fdddc83fabb5cc751d0e59a1350c1627c (diff)
V4L/DVB (4377): Force horizontal resolution limits in the pvrusb2 driver
This change causes the pvrusb2 driver to limit horizontal resolution to be only 720 if 24xxx device hardware is being used. This is a workaround for an unsolved problem in the driver where if the resolution is set to something other than 720 the video quality will be _seriously_ degraded. It only happens on 24xxx devices (29xxx are unaffected by the problem and unaffected by this change). Once the problem is finally solved, this small change can be removed. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 4ccbd53c715e..199b5e2e5c43 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -363,6 +363,30 @@ static int ctrl_freq_set(struct pvr2_ctrl *cptr,int m,int v)
363 return 0; 363 return 0;
364} 364}
365 365
366#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
367static int ctrl_hres_max_get(struct pvr2_ctrl *cptr,int *vp)
368{
369 /* If we're dealing with a 24xxx device, force the horizontal
370 maximum to be 720 no matter what, since we can't get the device
371 to work properly with any other value. Otherwise just return
372 the normal value. */
373 *vp = cptr->info->def.type_int.max_value;
374 if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
375 return 0;
376}
377
378static int ctrl_hres_min_get(struct pvr2_ctrl *cptr,int *vp)
379{
380 /* If we're dealing with a 24xxx device, force the horizontal
381 minimum to be 720 no matter what, since we can't get the device
382 to work properly with any other value. Otherwise just return
383 the normal value. */
384 *vp = cptr->info->def.type_int.min_value;
385 if (cptr->hdw->hdw_type == PVR2_HDW_TYPE_24XXX) *vp = 720;
386 return 0;
387}
388#endif
389
366static int ctrl_cx2341x_is_dirty(struct pvr2_ctrl *cptr) 390static int ctrl_cx2341x_is_dirty(struct pvr2_ctrl *cptr)
367{ 391{
368 return cptr->hdw->enc_stale != 0; 392 return cptr->hdw->enc_stale != 0;
@@ -721,6 +745,12 @@ static const struct pvr2_ctl_info control_defs[] = {
721 .default_value = 720, 745 .default_value = 720,
722 DEFREF(res_hor), 746 DEFREF(res_hor),
723 DEFINT(320,720), 747 DEFINT(320,720),
748#ifdef CONFIG_VIDEO_PVRUSB2_24XXX
749 /* Hook in check for clamp on horizontal resolution in
750 order to avoid unsolved problem involving cx25840. */
751 .get_max_value = ctrl_hres_max_get,
752 .get_min_value = ctrl_hres_min_get,
753#endif
724 },{ 754 },{
725 .desc = "Vertical capture resolution", 755 .desc = "Vertical capture resolution",
726 .name = "resolution_ver", 756 .name = "resolution_ver",