diff options
author | Mike Isely <isely@pobox.com> | 2009-03-06 23:48:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:38 -0400 |
commit | 75212a02734155de3d25c91344a9083d7bf2aef1 (patch) | |
tree | b8dcc2d5926c96539b776f99fcfb08ddaa528244 /drivers/media/video/pvrusb2 | |
parent | b481880bff1f98085a9f57362393463e6e3a3157 (diff) |
V4L/DVB (11190): pvrusb2: Broadcast tuner type change to sub-devices
The tuner sub-device isn't going to work very well unless we tell it
the correct tuner type to use...
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 029cdf411df0..8be5392e979b 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/firmware.h> | 24 | #include <linux/firmware.h> |
25 | #include <linux/videodev2.h> | 25 | #include <linux/videodev2.h> |
26 | #include <media/v4l2-common.h> | 26 | #include <media/v4l2-common.h> |
27 | #include <media/tuner.h> | ||
27 | #include "pvrusb2.h" | 28 | #include "pvrusb2.h" |
28 | #include "pvrusb2-std.h" | 29 | #include "pvrusb2-std.h" |
29 | #include "pvrusb2-util.h" | 30 | #include "pvrusb2-util.h" |
@@ -2261,7 +2262,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) | |||
2261 | } | 2262 | } |
2262 | 2263 | ||
2263 | pvr2_i2c_core_check_stale(hdw); | 2264 | pvr2_i2c_core_check_stale(hdw); |
2264 | hdw->tuner_updated = 0; | ||
2265 | 2265 | ||
2266 | if (!pvr2_hdw_dev_ok(hdw)) return; | 2266 | if (!pvr2_hdw_dev_ok(hdw)) return; |
2267 | 2267 | ||
@@ -2944,6 +2944,21 @@ static void pvr2_subdev_update(struct pvr2_hdw *hdw) | |||
2944 | unsigned int id; | 2944 | unsigned int id; |
2945 | pvr2_subdev_update_func fp; | 2945 | pvr2_subdev_update_func fp; |
2946 | 2946 | ||
2947 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev update..."); | ||
2948 | |||
2949 | if (hdw->tuner_updated) { | ||
2950 | struct tuner_setup setup; | ||
2951 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)", | ||
2952 | hdw->tuner_type); | ||
2953 | if (((int)(hdw->tuner_type)) >= 0) { | ||
2954 | setup.addr = ADDR_UNSET; | ||
2955 | setup.type = hdw->tuner_type; | ||
2956 | setup.mode_mask = T_RADIO | T_ANALOG_TV; | ||
2957 | v4l2_device_call_all(&hdw->v4l2_dev, 0, | ||
2958 | tuner, s_type_addr, &setup); | ||
2959 | } | ||
2960 | } | ||
2961 | |||
2947 | if (hdw->input_dirty || hdw->std_dirty) { | 2962 | if (hdw->input_dirty || hdw->std_dirty) { |
2948 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_standard"); | 2963 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_standard"); |
2949 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { | 2964 | if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { |
@@ -3241,6 +3256,7 @@ static int pvr2_hdw_commit_execute(struct pvr2_hdw *hdw) | |||
3241 | /* Check and update state for all sub-devices. */ | 3256 | /* Check and update state for all sub-devices. */ |
3242 | pvr2_subdev_update(hdw); | 3257 | pvr2_subdev_update(hdw); |
3243 | 3258 | ||
3259 | hdw->tuner_updated = 0; | ||
3244 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 3260 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
3245 | cptr = hdw->controls + idx; | 3261 | cptr = hdw->controls + idx; |
3246 | if (!cptr->info->clear_dirty) continue; | 3262 | if (!cptr->info->clear_dirty) continue; |