aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index a6a2cdb81566..d727485da886 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -150,12 +150,10 @@ void ivtv_release_stream(struct ivtv_stream *s)
150static void ivtv_dualwatch(struct ivtv *itv) 150static void ivtv_dualwatch(struct ivtv *itv)
151{ 151{
152 struct v4l2_tuner vt; 152 struct v4l2_tuner vt;
153 u32 new_bitmap;
154 u32 new_stereo_mode; 153 u32 new_stereo_mode;
155 const u32 stereo_mask = 0x0300; 154 const u32 dual = 0x02;
156 const u32 dual = 0x0200;
157 155
158 new_stereo_mode = itv->params.audio_properties & stereo_mask; 156 new_stereo_mode = v4l2_ctrl_g_ctrl(itv->cxhdl.audio_mode);
159 memset(&vt, 0, sizeof(vt)); 157 memset(&vt, 0, sizeof(vt));
160 ivtv_call_all(itv, tuner, g_tuner, &vt); 158 ivtv_call_all(itv, tuner, g_tuner, &vt);
161 if (vt.audmode == V4L2_TUNER_MODE_LANG1_LANG2 && (vt.rxsubchans & V4L2_TUNER_SUB_LANG2)) 159 if (vt.audmode == V4L2_TUNER_MODE_LANG1_LANG2 && (vt.rxsubchans & V4L2_TUNER_SUB_LANG2))
@@ -164,16 +162,10 @@ static void ivtv_dualwatch(struct ivtv *itv)
164 if (new_stereo_mode == itv->dualwatch_stereo_mode) 162 if (new_stereo_mode == itv->dualwatch_stereo_mode)
165 return; 163 return;
166 164
167 new_bitmap = new_stereo_mode | (itv->params.audio_properties & ~stereo_mask); 165 IVTV_DEBUG_INFO("dualwatch: change stereo flag from 0x%x to 0x%x.\n",
168 166 itv->dualwatch_stereo_mode, new_stereo_mode);
169 IVTV_DEBUG_INFO("dualwatch: change stereo flag from 0x%x to 0x%x. new audio_bitmask=0x%ux\n", 167 if (v4l2_ctrl_s_ctrl(itv->cxhdl.audio_mode, new_stereo_mode))
170 itv->dualwatch_stereo_mode, new_stereo_mode, new_bitmap); 168 IVTV_DEBUG_INFO("dualwatch: changing stereo flag failed\n");
171
172 if (ivtv_vapi(itv, CX2341X_ENC_SET_AUDIO_PROPERTIES, 1, new_bitmap) == 0) {
173 itv->dualwatch_stereo_mode = new_stereo_mode;
174 return;
175 }
176 IVTV_DEBUG_INFO("dualwatch: changing stereo flag failed\n");
177} 169}
178 170
179static void ivtv_update_pgm_info(struct ivtv *itv) 171static void ivtv_update_pgm_info(struct ivtv *itv)
@@ -894,7 +886,8 @@ int ivtv_v4l2_close(struct file *filp)
894 if (atomic_read(&itv->capturing) > 0) { 886 if (atomic_read(&itv->capturing) > 0) {
895 /* Undo video mute */ 887 /* Undo video mute */
896 ivtv_vapi(itv, CX2341X_ENC_MUTE_VIDEO, 1, 888 ivtv_vapi(itv, CX2341X_ENC_MUTE_VIDEO, 1,
897 itv->params.video_mute | (itv->params.video_mute_yuv << 8)); 889 v4l2_ctrl_g_ctrl(itv->cxhdl.video_mute) |
890 (v4l2_ctrl_g_ctrl(itv->cxhdl.video_mute_yuv) << 8));
898 } 891 }
899 /* Done! Unmute and continue. */ 892 /* Done! Unmute and continue. */
900 ivtv_unmute(itv); 893 ivtv_unmute(itv);