提交 f1382122 编写于 作者: M Mike Isely 提交者: Mauro Carvalho Chehab

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: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 5a8a0a16
......@@ -146,10 +146,15 @@ static void set_frequency(struct pvr2_hdw *hdw)
fv = hdw->freqVal;
pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 set_freq(%lu)",fv);
memset(&freq,0,sizeof(freq));
freq.frequency = fv / 62500;
if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) {
// ((fv * 1000) / 62500)
freq.frequency = (fv * 2) / 125;
freq.type = V4L2_TUNER_RADIO;
} else {
freq.frequency = fv / 62500;
freq.type = V4L2_TUNER_ANALOG_TV;
}
freq.tuner = 0;
freq.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ?
V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
pvr2_i2c_core_cmd(hdw,VIDIOC_S_FREQUENCY,&freq);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册