aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-12-27 21:23:22 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-02-21 10:34:32 -0500
commitf1382122ab49a7f01fa107608eaf664b12055b8b (patch)
tree5862ece089b81c0b100cad6c2106e20763da7cbb /drivers/media/video/pvrusb2
parent5a8a0a16422eec744ec220ccea472eef74b67180 (diff)
V4L/DVB (5047): Pvrusb2: Fix tuning calculation when in radio mode
Frequency units in V4L2 are apparently different when in radio mode compared to tv mode. Why? Who knows. This change adapts the driver appropriately - so that internally we always only deal in Hz and don't have to muck with craziness like this. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index c0920835d802..c885a9c25e76 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -146,10 +146,15 @@ static void set_frequency(struct pvr2_hdw *hdw)
146 fv = hdw->freqVal; 146 fv = hdw->freqVal;
147 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv); 147 pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
148 memset(&freq,0,sizeof(freq)); 148 memset(&freq,0,sizeof(freq));
149 freq.frequency = fv / 62500; 149 if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
150 // ((fv * 1000) / 62500)
151 freq.frequency = (fv * 2) / 125;
152 freq.type = V4L2_TUNER_RADIO;
153 } else {
154 freq.frequency = fv / 62500;
155 freq.type = V4L2_TUNER_ANALOG_TV;
156 }
150 freq.tuner = 0; 157 freq.tuner = 0;
151 freq.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
152 V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
153 pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq); 158 pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq);
154} 159}
155 160