summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-29 01:42:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-29 01:42:02 -0300
commitb6e13ad1e52efcb4693b9260cb0cff0c6e85537f (patch)
treee112390aaca87be0aee667ab6c71aa376ba87b95 /linux/drivers/media/video/em28xx/em28xx-video.c
parent79035e11d5ad4166c51bf7e7c334000494e0a859 (diff)
downloadmediapointer-dvb-s2-b6e13ad1e52efcb4693b9260cb0cff0c6e85537f.tar.gz
mediapointer-dvb-s2-b6e13ad1e52efcb4693b9260cb0cff0c6e85537f.tar.bz2
em28xx: fix audio VIDIOC_S_CTRL adjustments on devices without ac97
From: Mauro Carvalho Chehab <mchehab@redhat.com> Even devices without ac97 needs to call analog audio setup function, to properly set xclk and mute/unmute. Thanks to Angelo Cano <acano@fastmail.fm> for reporting and testing it. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index 1237e325d..8cb8674c9 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -1123,9 +1123,26 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
else
rc = 1;
- /* It were not an AC97 control. Sends it to the v4l2 dev interface */
+ /* It isn't an AC97 control. Sends it to the v4l2 dev interface */
if (rc == 1) {
v4l2_device_call_all(&dev->v4l2_dev, 0, core, s_ctrl, ctrl);
+
+ /*
+ * In the case of non-AC97 volume controls, we still need
+ * to do some setups at em28xx, in order to mute/unmute
+ * and to adjust audio volume. However, the value ranges
+ * should be checked by the corresponding V4L subdriver.
+ */
+ switch (ctrl->id) {
+ case V4L2_CID_AUDIO_MUTE:
+ dev->mute = ctrl->value;
+ return em28xx_audio_analog_set(dev);
+ break;
+ case V4L2_CID_AUDIO_VOLUME:
+ dev->volume = ctrl->value;
+ return em28xx_audio_analog_set(dev);
+ }
+
/* FIXME: should be returning a meaninful value */
rc = 0;
}