summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@redhat.com>2009-02-08 15:17:15 -0200
committerDouglas Schilling Landgraf <dougsland@redhat.com>2009-02-08 15:17:15 -0200
commitc06f528a6de5324f104965c8a90907211963e29e (patch)
tree8b3b990dd5017cccc905712617a04d2b3d1f8b9b
parent96f4a3677c2e17fe91f9956779fad977ec6a8f8c (diff)
downloadmediapointer-dvb-s2-c06f528a6de5324f104965c8a90907211963e29e.tar.gz
mediapointer-dvb-s2-c06f528a6de5324f104965c8a90907211963e29e.tar.bz2
em28xx-audio: Add spinlock for trigger
From: Douglas Schilling Landgraf <dougsland@redhat.com> Added spinlock for trigger session Priority: high Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-audio.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-audio.c b/linux/drivers/media/video/em28xx/em28xx-audio.c
index 921ec190d..a5a28eb19 100644
--- a/linux/drivers/media/video/em28xx/em28xx-audio.c
+++ b/linux/drivers/media/video/em28xx/em28xx-audio.c
@@ -445,19 +445,27 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
#endif
{
struct em28xx *dev = snd_pcm_substream_chip(substream);
+ int retval;
dprintk("Should %s capture\n", (cmd == SNDRV_PCM_TRIGGER_START)?
"start": "stop");
+
+ spin_lock(&dev->adev.slock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1);
- return 0;
+ retval = 0;
+ break;
case SNDRV_PCM_TRIGGER_STOP:
em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0);
- return 0;
+ retval = 0;
+ break;
default:
- return -EINVAL;
+ retval = -EINVAL;
}
+
+ spin_unlock(&dev->adev.slock);
+ return retval;
}
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 16)