aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 22:09:47 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:38 -0500
commit18103c57b0168ebc0401702d483fe131f0aecc7a (patch)
tree1d57e73217254121f0c023009c510a4936332d64 /drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
parentaf78a48b69231e129db0e1db24053da22f8eed6d (diff)
V4L/DVB (5081): Pvrusb2: VIDIOC_G_TUNER cleanup
Clean up use of VIDIOC_G_TUNER; we now correctly gather info from all the I2C client modules. Also abide by V4L2_TUNER_CAP_LOW appropriately. 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-i2c-cmd-v4l2.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 51da8945efe4..b1f6809625e8 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -37,6 +37,7 @@ static void set_standard(struct pvr2_hdw *hdw)
37 vs = hdw->std_mask_cur; 37 vs = hdw->std_mask_cur;
38 pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs); 38 pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs);
39 } 39 }
40 hdw->tuner_signal_stale = !0;
40} 41}
41 42
42 43
@@ -145,13 +146,21 @@ static void set_frequency(struct pvr2_hdw *hdw)
145 struct v4l2_frequency freq; 146 struct v4l2_frequency freq;
146 fv = pvr2_hdw_get_cur_freq(hdw); 147 fv = pvr2_hdw_get_cur_freq(hdw);
147 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); 148 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
149 if (hdw->tuner_signal_stale) {
150 pvr2_i2c_core_status_poll(hdw);
151 }
148 memset(&freq,0,sizeof(freq)); 152 memset(&freq,0,sizeof(freq));
149 if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { 153 if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) {
150 // ((fv * 1000) / 62500) 154 // ((fv * 1000) / 62500)
151 freq.frequency = (fv * 2) / 125; 155 freq.frequency = (fv * 2) / 125;
152 freq.type = V4L2_TUNER_RADIO;
153 } else { 156 } else {
154 freq.frequency = fv / 62500; 157 freq.frequency = fv / 62500;
158 }
159 /* tuner-core currently doesn't seem to care about this, but
160 let's set it anyway for completeness. */
161 if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
162 freq.type = V4L2_TUNER_RADIO;
163 } else {
155 freq.type = V4L2_TUNER_ANALOG_TV; 164 freq.type = V4L2_TUNER_ANALOG_TV;
156 } 165 }
157 freq.tuner = 0; 166 freq.tuner = 0;
@@ -230,6 +239,12 @@ void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl)
230} 239}
231 240
232 241
242void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp)
243{
244 pvr2_i2c_client_cmd(cp,VIDIOC_G_TUNER,&cp->hdw->tuner_signal_info);
245}
246
247
233/* 248/*
234 Stuff for Emacs to see, in order to encourage consistent editing style: 249 Stuff for Emacs to see, in order to encourage consistent editing style:
235 *** Local Variables: *** 250 *** Local Variables: ***