summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2007-01-19 21:09:47 -0600
committerMike Isely <isely@pobox.com>2007-01-19 21:09:47 -0600
commite35c602656fcea0704973c72c96f7f41ebd66d61 (patch)
tree70db43767c24bcee28befbf6a9d9b0834889352d /linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
parentac666ccc4bab1e73f11e2cc40f11d3797f8c9cff (diff)
downloadmediapointer-dvb-s2-e35c602656fcea0704973c72c96f7f41ebd66d61.tar.gz
mediapointer-dvb-s2-e35c602656fcea0704973c72c96f7f41ebd66d61.tar.bz2
pvrusb2: VIDIOC_G_TUNER cleanup
From: Mike Isely <isely@pobox.com> 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>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 51da8945e..b1f680962 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -37,6 +37,7 @@ static void set_standard(struct pvr2_hdw *hdw)
vs = hdw->std_mask_cur;
pvr2_i2c_core_cmd(hdw,VIDIOC_S_STD,&vs);
}
+ hdw->tuner_signal_stale = !0;
}
@@ -145,13 +146,21 @@ static void set_frequency(struct pvr2_hdw *hdw)
struct v4l2_frequency freq;
fv = pvr2_hdw_get_cur_freq(hdw);
pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
+ if (hdw->tuner_signal_stale) {
+ pvr2_i2c_core_status_poll(hdw);
+ }
memset(&freq,0,sizeof(freq));
- if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
+ if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) {
// ((fv * 1000) / 62500)
freq.frequency = (fv * 2) / 125;
- freq.type = V4L2_TUNER_RADIO;
} else {
freq.frequency = fv / 62500;
+ }
+ /* tuner-core currently doesn't seem to care about this, but
+ let's set it anyway for completeness. */
+ if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
+ freq.type = V4L2_TUNER_RADIO;
+ } else {
freq.type = V4L2_TUNER_ANALOG_TV;
}
freq.tuner = 0;
@@ -230,6 +239,12 @@ void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *cp,int fl)
}
+void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *cp)
+{
+ pvr2_i2c_client_cmd(cp,VIDIOC_G_TUNER,&cp->hdw->tuner_signal_info);
+}
+
+
/*
Stuff for Emacs to see, in order to encourage consistent editing style:
*** Local Variables: ***