aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c60
1 files changed, 34 insertions, 26 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 0c745b142fb7..cbc388729d77 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -85,8 +85,8 @@ MODULE_PARM_DESC(video_std,"specify initial video standard");
85module_param_array(tolerance, int, NULL, 0444); 85module_param_array(tolerance, int, NULL, 0444);
86MODULE_PARM_DESC(tolerance,"specify stream error tolerance"); 86MODULE_PARM_DESC(tolerance,"specify stream error tolerance");
87 87
88/* US Broadcast channel 7 (175.25 MHz) */ 88/* US Broadcast channel 3 (61.25 MHz), to help with testing */
89static int default_tv_freq = 175250000L; 89static int default_tv_freq = 61250000L;
90/* 104.3 MHz, a usable FM station for my area */ 90/* 104.3 MHz, a usable FM station for my area */
91static int default_radio_freq = 104300000L; 91static int default_radio_freq = 104300000L;
92 92
@@ -1987,6 +1987,34 @@ static unsigned int pvr2_copy_i2c_addr_list(
1987} 1987}
1988 1988
1989 1989
1990static 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
1990static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, 2018static 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
@@ -2954,6 +2960,7 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw)
2954 vs = hdw->std_mask_cur; 2960 vs = hdw->std_mask_cur;
2955 v4l2_device_call_all(&hdw->v4l2_dev, 0, 2961 v4l2_device_call_all(&hdw->v4l2_dev, 0,
2956 core, s_std, vs); 2962 core, s_std, vs);
2963 pvr2_hdw_cx25840_vbi_hack(hdw);
2957 } 2964 }
2958 hdw->tuner_signal_stale = !0; 2965 hdw->tuner_signal_stale = !0;
2959 hdw->cropcap_stale = !0; 2966 hdw->cropcap_stale = !0;
@@ -4076,6 +4083,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
4076 if (hdw->decoder_client_id) { 4083 if (hdw->decoder_client_id) {
4077 v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, 4084 v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id,
4078 core, reset, 0); 4085 core, reset, 0);
4086 pvr2_hdw_cx25840_vbi_hack(hdw);
4079 return 0; 4087 return 0;
4080 } 4088 }
4081 pvr2_trace(PVR2_TRACE_INIT, 4089 pvr2_trace(PVR2_TRACE_INIT,