diff options
author | Douglas Schilling Landgraf <dougsland@redhat.com> | 2009-02-08 12:17:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:44 -0400 |
commit | df39ca6437410b9428ebd3ce30fcde193782410d (patch) | |
tree | 52693d3610f66915809ad075ca72c1446fe544d1 /drivers/media/video/em28xx/em28xx-audio.c | |
parent | c744dff260e9efb1080d1e823e588f85176a057b (diff) |
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.c | 14 |
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, | |||
381 | int cmd) | 381 | int cmd) |
382 | { | 382 | { |
383 | struct em28xx *dev = snd_pcm_substream_chip(substream); | 383 | struct em28xx *dev = snd_pcm_substream_chip(substream); |
384 | int retval; | ||
384 | 385 | ||
385 | dprintk("Should %s capture\n", (cmd == SNDRV_PCM_TRIGGER_START)? | 386 | dprintk("Should %s capture\n", (cmd == SNDRV_PCM_TRIGGER_START)? |
386 | "start": "stop"); | 387 | "start": "stop"); |
388 | |||
389 | spin_lock(&dev->adev.slock); | ||
387 | switch (cmd) { | 390 | switch (cmd) { |
388 | case SNDRV_PCM_TRIGGER_START: | 391 | case SNDRV_PCM_TRIGGER_START: |
389 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); | 392 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 1); |
390 | return 0; | 393 | retval = 0; |
394 | break; | ||
391 | case SNDRV_PCM_TRIGGER_STOP: | 395 | case SNDRV_PCM_TRIGGER_STOP: |
392 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); | 396 | em28xx_cmd(dev, EM28XX_CAPTURE_STREAM_EN, 0); |
393 | return 0; | 397 | retval = 0; |
398 | break; | ||
394 | default: | 399 | default: |
395 | return -EINVAL; | 400 | retval = -EINVAL; |
396 | } | 401 | } |
402 | |||
403 | spin_unlock(&dev->adev.slock); | ||
404 | return retval; | ||
397 | } | 405 | } |
398 | 406 | ||
399 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream | 407 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream |