summaryrefslogtreecommitdiffstats
path: root/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-09-12 12:18:14 -0300
commit73c6f462d1d07f276e279467f311a96a2a43d9c5 (patch)
treea9ebbc04a5b577f75d93d5956827723fca017581 /drivers/media/video/em28xx/em28xx-video.c
parente81516c58ef84663ee05a43760a53a416d529de7 (diff)
downloadop-kernel-dev-73c6f462d1d07f276e279467f311a96a2a43d9c5.zip
op-kernel-dev-73c6f462d1d07f276e279467f311a96a2a43d9c5.tar.gz
V4L/DVB (12345): em28xx: fix audio VIDIOC_S_CTRL adjustments on devices without ac97
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. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 7ed3051..477b9b6 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1146,11 +1146,25 @@ 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);
- /* FIXME: should be returning a meaninful value */
- rc = 0;
+
+ /*
+ * 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;
+ rc = em28xx_audio_analog_set(dev);
+ break;
+ case V4L2_CID_AUDIO_VOLUME:
+ dev->volume = ctrl->value;
+ rc = em28xx_audio_analog_set(dev);
+ }
}
mutex_unlock(&dev->lock);
OpenPOWER on IntegriCloud