aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-controls.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-controls.c')
-rw-r--r--drivers/media/video/cx18/cx18-controls.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c
index 9505c417371d..e5604c2328ad 100644
--- a/drivers/media/video/cx18/cx18-controls.c
+++ b/drivers/media/video/cx18/cx18-controls.c
@@ -77,7 +77,7 @@ int cx18_queryctrl(struct file *file, void *fh, struct v4l2_queryctrl *qctrl)
77 case V4L2_CID_AUDIO_BASS: 77 case V4L2_CID_AUDIO_BASS:
78 case V4L2_CID_AUDIO_TREBLE: 78 case V4L2_CID_AUDIO_TREBLE:
79 case V4L2_CID_AUDIO_LOUDNESS: 79 case V4L2_CID_AUDIO_LOUDNESS:
80 if (cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_QUERYCTRL, qctrl)) 80 if (v4l2_subdev_call(cx->sd_av, core, queryctrl, qctrl))
81 qctrl->flags |= V4L2_CTRL_FLAG_DISABLED; 81 qctrl->flags |= V4L2_CTRL_FLAG_DISABLED;
82 return 0; 82 return 0;
83 83
@@ -134,7 +134,7 @@ static int cx18_s_ctrl(struct cx18 *cx, struct v4l2_control *vctrl)
134 case V4L2_CID_AUDIO_BASS: 134 case V4L2_CID_AUDIO_BASS:
135 case V4L2_CID_AUDIO_TREBLE: 135 case V4L2_CID_AUDIO_TREBLE:
136 case V4L2_CID_AUDIO_LOUDNESS: 136 case V4L2_CID_AUDIO_LOUDNESS:
137 return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_S_CTRL, vctrl); 137 return v4l2_subdev_call(cx->sd_av, core, s_ctrl, vctrl);
138 138
139 default: 139 default:
140 CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id); 140 CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
@@ -159,7 +159,8 @@ static int cx18_g_ctrl(struct cx18 *cx, struct v4l2_control *vctrl)
159 case V4L2_CID_AUDIO_BASS: 159 case V4L2_CID_AUDIO_BASS:
160 case V4L2_CID_AUDIO_TREBLE: 160 case V4L2_CID_AUDIO_TREBLE:
161 case V4L2_CID_AUDIO_LOUDNESS: 161 case V4L2_CID_AUDIO_LOUDNESS:
162 return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, VIDIOC_G_CTRL, vctrl); 162 return v4l2_subdev_call(cx->sd_av, core, g_ctrl, vctrl);
163
163 default: 164 default:
164 CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id); 165 CX18_DEBUG_IOCTL("invalid control 0x%x\n", vctrl->id);
165 return -EINVAL; 166 return -EINVAL;
@@ -260,10 +261,12 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
260 return err; 261 return err;
261 } 262 }
262 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) { 263 if (c->ctrl_class == V4L2_CTRL_CLASS_MPEG) {
264 static u32 freqs[3] = { 44100, 48000, 32000 };
263 struct cx18_api_func_private priv; 265 struct cx18_api_func_private priv;
264 struct cx2341x_mpeg_params p = cx->params; 266 struct cx2341x_mpeg_params p = cx->params;
265 int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing), 267 int err = cx2341x_ext_ctrls(&p, atomic_read(&cx->ana_capturing),
266 c, VIDIOC_S_EXT_CTRLS); 268 c, VIDIOC_S_EXT_CTRLS);
269 unsigned int idx;
267 270
268 if (err) 271 if (err)
269 return err; 272 return err;
@@ -287,7 +290,11 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
287 err = cx18_setup_vbi_fmt(cx, p.stream_vbi_fmt); 290 err = cx18_setup_vbi_fmt(cx, p.stream_vbi_fmt);
288 cx->params = p; 291 cx->params = p;
289 cx->dualwatch_stereo_mode = p.audio_properties & 0x0300; 292 cx->dualwatch_stereo_mode = p.audio_properties & 0x0300;
290 cx18_audio_set_audio_clock_freq(cx, p.audio_properties & 0x03); 293 idx = p.audio_properties & 0x03;
294 /* The audio clock of the digitizer must match the codec sample
295 rate otherwise you get some very strange effects. */
296 if (idx < sizeof(freqs))
297 cx18_call_all(cx, audio, s_clock_freq, freqs[idx]);
291 return err; 298 return err;
292 } 299 }
293 return -EINVAL; 300 return -EINVAL;