diff options
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 0c745b142fb7..e97f8e0e466c 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1987,6 +1987,34 @@ static unsigned int pvr2_copy_i2c_addr_list( | |||
1987 | } | 1987 | } |
1988 | 1988 | ||
1989 | 1989 | ||
1990 | static void pvr2_hdw_cx25840_vbi_hack(struct pvr2_hdw *hdw) | ||
1991 | { | ||
1992 | /* | ||
1993 | Mike Isely <isely@pobox.com> 19-Nov-2006 - This bit of nuttiness | ||
1994 | for cx25840 causes that module to correctly set up its video | ||
1995 | scaling. This is really a problem in the cx25840 module itself, | ||
1996 | but we work around it here. The problem has not been seen in | ||
1997 | ivtv because there VBI is supported and set up. We don't do VBI | ||
1998 | here (at least not yet) and thus we never attempted to even set | ||
1999 | it up. | ||
2000 | */ | ||
2001 | struct v4l2_format fmt; | ||
2002 | if (hdw->decoder_client_id != PVR2_CLIENT_ID_CX25840) { | ||
2003 | /* We're not using a cx25840 so don't enable the hack */ | ||
2004 | return; | ||
2005 | } | ||
2006 | |||
2007 | pvr2_trace(PVR2_TRACE_INIT, | ||
2008 | "Module ID %u:" | ||
2009 | " Executing cx25840 VBI hack", | ||
2010 | hdw->decoder_client_id); | ||
2011 | memset(&fmt, 0, sizeof(fmt)); | ||
2012 | fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; | ||
2013 | v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, | ||
2014 | video, s_fmt, &fmt); | ||
2015 | } | ||
2016 | |||
2017 | |||
1990 | static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, | 2018 | static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, |
1991 | const struct pvr2_device_client_desc *cd) | 2019 | const struct pvr2_device_client_desc *cd) |
1992 | { | 2020 | { |
@@ -2078,30 +2106,6 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, | |||
2078 | /* client-specific setup... */ | 2106 | /* client-specific setup... */ |
2079 | switch (mid) { | 2107 | switch (mid) { |
2080 | case PVR2_CLIENT_ID_CX25840: | 2108 | case PVR2_CLIENT_ID_CX25840: |
2081 | hdw->decoder_client_id = mid; | ||
2082 | { | ||
2083 | /* | ||
2084 | Mike Isely <isely@pobox.com> 19-Nov-2006 - This | ||
2085 | bit of nuttiness for cx25840 causes that module | ||
2086 | to correctly set up its video scaling. This is | ||
2087 | really a problem in the cx25840 module itself, | ||
2088 | but we work around it here. The problem has not | ||
2089 | been seen in ivtv because there VBI is supported | ||
2090 | and set up. We don't do VBI here (at least not | ||
2091 | yet) and thus we never attempted to even set it | ||
2092 | up. | ||
2093 | */ | ||
2094 | struct v4l2_format fmt; | ||
2095 | pvr2_trace(PVR2_TRACE_INIT, | ||
2096 | "Module ID %u:" | ||
2097 | " Executing cx25840 VBI hack", | ||
2098 | mid); | ||
2099 | memset(&fmt, 0, sizeof(fmt)); | ||
2100 | fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; | ||
2101 | v4l2_device_call_all(&hdw->v4l2_dev, mid, | ||
2102 | video, s_fmt, &fmt); | ||
2103 | } | ||
2104 | break; | ||
2105 | case PVR2_CLIENT_ID_SAA7115: | 2109 | case PVR2_CLIENT_ID_SAA7115: |
2106 | hdw->decoder_client_id = mid; | 2110 | hdw->decoder_client_id = mid; |
2107 | break; | 2111 | break; |
@@ -2202,6 +2206,8 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) | |||
2202 | cptr->info->set_value(cptr,~0,cptr->info->default_value); | 2206 | cptr->info->set_value(cptr,~0,cptr->info->default_value); |
2203 | } | 2207 | } |
2204 | 2208 | ||
2209 | pvr2_hdw_cx25840_vbi_hack(hdw); | ||
2210 | |||
2205 | /* Set up special default values for the television and radio | 2211 | /* Set up special default values for the television and radio |
2206 | frequencies here. It's not really important what these defaults | 2212 | frequencies here. It's not really important what these defaults |
2207 | are, but I set them to something usable in the Chicago area just | 2213 | are, but I set them to something usable in the Chicago area just |
@@ -4076,6 +4082,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) | |||
4076 | if (hdw->decoder_client_id) { | 4082 | if (hdw->decoder_client_id) { |
4077 | v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, | 4083 | v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, |
4078 | core, reset, 0); | 4084 | core, reset, 0); |
4085 | pvr2_hdw_cx25840_vbi_hack(hdw); | ||
4079 | return 0; | 4086 | return 0; |
4080 | } | 4087 | } |
4081 | pvr2_trace(PVR2_TRACE_INIT, | 4088 | pvr2_trace(PVR2_TRACE_INIT, |