diff options
author | Mike Isely <isely@pobox.com> | 2006-12-27 20:06:04 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-12-27 20:06:04 -0600 |
commit | 9658dff2c8dd1b4c1dac98a634a5967aaa156ef8 (patch) | |
tree | e923f3676aa6814e10ae20828be37b0b0b7c21b3 /linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | |
parent | 9cb0dc1a11d13622b9bca84b946d3ce0e1aa1f9b (diff) | |
download | mediapointer-dvb-s2-9658dff2c8dd1b4c1dac98a634a5967aaa156ef8.tar.gz mediapointer-dvb-s2-9658dff2c8dd1b4c1dac98a634a5967aaa156ef8.tar.bz2 |
pvrusb2: Enable radio mode round #2
From: Pantelis Koukousoulas <pakt223@freemail.gr>
This is the logic that
a) Ensures /sys/class/pvrusb2/sn-*/ctl_frequency/{max,min}_val are
"automagically" reset to sane values on each mode change.
b) Allows tuning to a radio frequency by something like:
echo `perl -e "print int(94.9*16000 + 0.5)"` \
> /sys/class/pvrusb2/sn-*/ctl_input/cur_val
The trick was to take advantage of the already existing .get_{min,max}_value
function pointers in pvr2_ctrl, to "dynamically override" the hardcoded values
for min/max frequency at runtime.
For a moment I thought to dispose of the hardcoded MIN/MAX_FREQ and use the
hirange/lowrange fields of the v4l2_tuner struct instead, but then I see that
tuner-core.c kinda hardcodes these as well, so I decided to not bother.
--Pantelis
Signed-off-by: Pantelis Koukousoulas <pakt223@freemail.gr>
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.c | 4 |
1 files changed, 3 insertions, 1 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 50fcceb15..ed4eed4d5 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c @@ -169,7 +169,9 @@ 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_TV) + fv /= 62500; + freq.frequency = fv; freq.tuner = 0; freq.type = (hdw->input_val == PVR2_CVAL_INPUT_RADIO) ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; |