diff options
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-audio.c')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-audio.c | 14 |
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) |