summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-audio.c
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@redhat.com>2009-02-08 18:17:15 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 17:42:44 +0200
commitdf39ca6437410b9428ebd3ce30fcde193782410d (patch)
tree52693d3610f66915809ad075ca72c1446fe544d1 /drivers/media/video/em28xx/em28xx-audio.c
parentV4L/DVB (10519): em28xx: Fix for em28xx audio startup (diff)
downloadlinux-df39ca6437410b9428ebd3ce30fcde193782410d.tar.xz
linux-df39ca6437410b9428ebd3ce30fcde193782410d.zip
V4L/DVB (10520): em28xx-audio: Add spinlock for trigger
Added spinlock for trigger session Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 52c6657d61cf..8e9957dbdbec 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -381,19 +381,27 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{
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;
}
static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream