diff options
author | Mike Isely <isely@pobox.com> | 2009-03-06 22:48:42 -0600 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2009-03-06 22:48:42 -0600 |
commit | d238333928061f1804de72a188640fcee8176bd9 (patch) | |
tree | 1559515e46614c6249174af5c894026b991b107f /linux/drivers | |
parent | d87e757220b43c2ffafac3e602c5f8ba8ebbcac5 (diff) | |
download | mediapointer-dvb-s2-d238333928061f1804de72a188640fcee8176bd9.tar.gz mediapointer-dvb-s2-d238333928061f1804de72a188640fcee8176bd9.tar.bz2 |
pvrusb2: Broadcast tuner type change to sub-devices
From: Mike Isely <isely@pobox.com>
The tuner sub-device isn't going to work very well unless we tell it
the correct tuner type to use...
Priority: normal
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 675ce1664..0e892a783 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -24,6 +24,7 @@ #include <linux/firmware.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> +#include <media/tuner.h> #include "pvrusb2.h" #include "pvrusb2-std.h" #include "pvrusb2-util.h" @@ -2278,7 +2279,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) } pvr2_i2c_core_check_stale(hdw); - hdw->tuner_updated = 0; if (!pvr2_hdw_dev_ok(hdw)) return; @@ -2968,6 +2968,21 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) unsigned int id; pvr2_subdev_update_func fp; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev update..."); + + if (hdw->tuner_updated) { + struct tuner_setup setup; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)", + hdw->tuner_type); + if (((int)(hdw->tuner_type)) >= 0) { + setup.addr = ADDR_UNSET; + setup.type = hdw->tuner_type; + setup.mode_mask = T_RADIO | T_ANALOG_TV; + v4l2_device_call_all(&hdw->v4l2_dev, 0, + tuner, s_type_addr, &setup); + } + } + if (hdw->input_dirty || hdw->std_dirty) { pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_standard"); if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { @@ -3265,6 +3280,7 @@ static int pvr2_hdw_commit_execute(struct pvr2_hdw *hdw) /* Check and update state for all sub-devices. */ pvr2_subdev_update(hdw); + hdw->tuner_updated = 0; for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; if (!cptr->info->clear_dirty) continue; |