aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/caiaq/audio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-11-02 12:50:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-11-02 12:50:22 -0500
commit20107f84b29536887b958e38b20474cccc619322 (patch)
tree457a84cafe89bf63ba243edb3f8074955c478838 /sound/usb/caiaq/audio.c
parent3fe866ca6cc0495510a1d37c03a4abdc55174e83 (diff)
parent8fd6959de180f727b28813741468c9cb2a7028ec (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: hda - Don't check invalid HP pin ALSA: dummy - Fix descriptions of pcm_substreams parameter ALSA: pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (sound) ALSA: hda: Use quirk mask for Dell Inspiron Mini9/Vostro A90 using ALC268 sound: via82xx: deactivate DXS controls of inactive streams ALSA: snd-usb-caiaq: Bump version number to 1.3.20 ALSA: snd-usb-caiaq: Lock on stream start/unpause ALSA: snd-usb-caiaq: Missing lock around use of buffer positions ALSA: sound/parisc: Move dereference after NULL test ALSA: sound: Move dereference after NULL test and drop unnecessary NULL tests ALSA: hda_intel: Add the Linux device ID for NVIDIA HDA controller ALSA: pcsp - Fix nforce workaround ALSA: SND_CS5535AUDIO: Remove the X86 platform dependency ASoC: Amstrad Delta: add info about the line discipline requirement to Kconfig help text ASoC: Fix possible codec_dai->ops NULL pointer problems ALSA: hda - Fix capture source checks for ALC662/663 codecs ASoC: Serialize access to dapm_power_widgets()
Diffstat (limited to 'sound/usb/caiaq/audio.c')
-rw-r--r--sound/usb/caiaq/audio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 121af0644fd9..86b2c3b92df5 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -62,10 +62,14 @@ static void
62activate_substream(struct snd_usb_caiaqdev *dev, 62activate_substream(struct snd_usb_caiaqdev *dev,
63 struct snd_pcm_substream *sub) 63 struct snd_pcm_substream *sub)
64{ 64{
65 spin_lock(&dev->spinlock);
66
65 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 67 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
66 dev->sub_playback[sub->number] = sub; 68 dev->sub_playback[sub->number] = sub;
67 else 69 else
68 dev->sub_capture[sub->number] = sub; 70 dev->sub_capture[sub->number] = sub;
71
72 spin_unlock(&dev->spinlock);
69} 73}
70 74
71static void 75static void
@@ -269,16 +273,22 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub)
269{ 273{
270 int index = sub->number; 274 int index = sub->number;
271 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub); 275 struct snd_usb_caiaqdev *dev = snd_pcm_substream_chip(sub);
276 snd_pcm_uframes_t ptr;
277
278 spin_lock(&dev->spinlock);
272 279
273 if (dev->input_panic || dev->output_panic) 280 if (dev->input_panic || dev->output_panic)
274 return SNDRV_PCM_POS_XRUN; 281 ptr = SNDRV_PCM_POS_XRUN;
275 282
276 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) 283 if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
277 return bytes_to_frames(sub->runtime, 284 ptr = bytes_to_frames(sub->runtime,
278 dev->audio_out_buf_pos[index]); 285 dev->audio_out_buf_pos[index]);
279 else 286 else
280 return bytes_to_frames(sub->runtime, 287 ptr = bytes_to_frames(sub->runtime,
281 dev->audio_in_buf_pos[index]); 288 dev->audio_in_buf_pos[index]);
289
290 spin_unlock(&dev->spinlock);
291 return ptr;
282} 292}
283 293
284/* operators for both playback and capture */ 294/* operators for both playback and capture */