aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usbaudio.c15
-rw-r--r--sound/usb/usx2y/usbusx2y.c2
-rw-r--r--sound/usb/usx2y/usbusx2y.h2
-rw-r--r--sound/usb/usx2y/usbusx2yaudio.c8
-rw-r--r--sound/usb/usx2y/usx2yhwdeppcm.c12
5 files changed, 20 insertions, 19 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c9476c237c42..53009bb642f6 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -47,6 +47,7 @@
47#include <linux/usb.h> 47#include <linux/usb.h>
48#include <linux/vmalloc.h> 48#include <linux/vmalloc.h>
49#include <linux/moduleparam.h> 49#include <linux/moduleparam.h>
50#include <linux/mutex.h>
50#include <sound/core.h> 51#include <sound/core.h>
51#include <sound/info.h> 52#include <sound/info.h>
52#include <sound/pcm.h> 53#include <sound/pcm.h>
@@ -202,7 +203,7 @@ struct snd_usb_stream {
202 * the all interfaces on the same card as one sound device. 203 * the all interfaces on the same card as one sound device.
203 */ 204 */
204 205
205static DECLARE_MUTEX(register_mutex); 206static DEFINE_MUTEX(register_mutex);
206static struct snd_usb_audio *usb_chip[SNDRV_CARDS]; 207static struct snd_usb_audio *usb_chip[SNDRV_CARDS];
207 208
208 209
@@ -3285,7 +3286,7 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3285 3286
3286 /* check whether it's already registered */ 3287 /* check whether it's already registered */
3287 chip = NULL; 3288 chip = NULL;
3288 down(&register_mutex); 3289 mutex_lock(&register_mutex);
3289 for (i = 0; i < SNDRV_CARDS; i++) { 3290 for (i = 0; i < SNDRV_CARDS; i++) {
3290 if (usb_chip[i] && usb_chip[i]->dev == dev) { 3291 if (usb_chip[i] && usb_chip[i]->dev == dev) {
3291 if (usb_chip[i]->shutdown) { 3292 if (usb_chip[i]->shutdown) {
@@ -3338,13 +3339,13 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
3338 3339
3339 usb_chip[chip->index] = chip; 3340 usb_chip[chip->index] = chip;
3340 chip->num_interfaces++; 3341 chip->num_interfaces++;
3341 up(&register_mutex); 3342 mutex_unlock(&register_mutex);
3342 return chip; 3343 return chip;
3343 3344
3344 __error: 3345 __error:
3345 if (chip && !chip->num_interfaces) 3346 if (chip && !chip->num_interfaces)
3346 snd_card_free(chip->card); 3347 snd_card_free(chip->card);
3347 up(&register_mutex); 3348 mutex_unlock(&register_mutex);
3348 __err_val: 3349 __err_val:
3349 return NULL; 3350 return NULL;
3350} 3351}
@@ -3364,7 +3365,7 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3364 3365
3365 chip = ptr; 3366 chip = ptr;
3366 card = chip->card; 3367 card = chip->card;
3367 down(&register_mutex); 3368 mutex_lock(&register_mutex);
3368 chip->shutdown = 1; 3369 chip->shutdown = 1;
3369 chip->num_interfaces--; 3370 chip->num_interfaces--;
3370 if (chip->num_interfaces <= 0) { 3371 if (chip->num_interfaces <= 0) {
@@ -3382,10 +3383,10 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr)
3382 snd_usb_mixer_disconnect(p); 3383 snd_usb_mixer_disconnect(p);
3383 } 3384 }
3384 usb_chip[chip->index] = NULL; 3385 usb_chip[chip->index] = NULL;
3385 up(&register_mutex); 3386 mutex_unlock(&register_mutex);
3386 snd_card_free(card); 3387 snd_card_free(card);
3387 } else { 3388 } else {
3388 up(&register_mutex); 3389 mutex_unlock(&register_mutex);
3389 } 3390 }
3390} 3391}
3391 3392
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c
index e0abb56bbe49..cfec38d7839b 100644
--- a/sound/usb/usx2y/usbusx2y.c
+++ b/sound/usb/usx2y/usbusx2y.c
@@ -351,7 +351,7 @@ static struct snd_card *usX2Y_create_card(struct usb_device *device)
351 usX2Y(card)->chip.dev = device; 351 usX2Y(card)->chip.dev = device;
352 usX2Y(card)->chip.card = card; 352 usX2Y(card)->chip.card = card;
353 init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); 353 init_waitqueue_head(&usX2Y(card)->prepare_wait_queue);
354 init_MUTEX (&usX2Y(card)->prepare_mutex); 354 mutex_init(&usX2Y(card)->prepare_mutex);
355 INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list); 355 INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list);
356 strcpy(card->driver, "USB "NAME_ALLCAPS""); 356 strcpy(card->driver, "USB "NAME_ALLCAPS"");
357 sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); 357 sprintf(card->shortname, "TASCAM "NAME_ALLCAPS"");
diff --git a/sound/usb/usx2y/usbusx2y.h b/sound/usb/usx2y/usbusx2y.h
index 435c1feda9df..456b5fdbc339 100644
--- a/sound/usb/usx2y/usbusx2y.h
+++ b/sound/usb/usx2y/usbusx2y.h
@@ -34,7 +34,7 @@ struct usX2Ydev {
34 unsigned int rate, 34 unsigned int rate,
35 format; 35 format;
36 int chip_status; 36 int chip_status;
37 struct semaphore prepare_mutex; 37 struct mutex prepare_mutex;
38 struct us428ctls_sharedmem *us428ctls_sharedmem; 38 struct us428ctls_sharedmem *us428ctls_sharedmem;
39 int wait_iso_frame; 39 int wait_iso_frame;
40 wait_queue_head_t us428ctls_wait_queue_head; 40 wait_queue_head_t us428ctls_wait_queue_head;
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index a6bbc7a6348f..f6bd0dee563c 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -811,7 +811,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream)
811{ 811{
812 struct snd_pcm_runtime *runtime = substream->runtime; 812 struct snd_pcm_runtime *runtime = substream->runtime;
813 struct snd_usX2Y_substream *subs = runtime->private_data; 813 struct snd_usX2Y_substream *subs = runtime->private_data;
814 down(&subs->usX2Y->prepare_mutex); 814 mutex_lock(&subs->usX2Y->prepare_mutex);
815 snd_printdd("snd_usX2Y_hw_free(%p)\n", substream); 815 snd_printdd("snd_usX2Y_hw_free(%p)\n", substream);
816 816
817 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { 817 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) {
@@ -832,7 +832,7 @@ static int snd_usX2Y_pcm_hw_free(struct snd_pcm_substream *substream)
832 usX2Y_urbs_release(subs); 832 usX2Y_urbs_release(subs);
833 } 833 }
834 } 834 }
835 up(&subs->usX2Y->prepare_mutex); 835 mutex_unlock(&subs->usX2Y->prepare_mutex);
836 return snd_pcm_lib_free_pages(substream); 836 return snd_pcm_lib_free_pages(substream);
837} 837}
838/* 838/*
@@ -849,7 +849,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)
849 int err = 0; 849 int err = 0;
850 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream); 850 snd_printdd("snd_usX2Y_pcm_prepare(%p)\n", substream);
851 851
852 down(&usX2Y->prepare_mutex); 852 mutex_lock(&usX2Y->prepare_mutex);
853 usX2Y_subs_prepare(subs); 853 usX2Y_subs_prepare(subs);
854// Start hardware streams 854// Start hardware streams
855// SyncStream first.... 855// SyncStream first....
@@ -869,7 +869,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream)
869 err = usX2Y_urbs_start(subs); 869 err = usX2Y_urbs_start(subs);
870 870
871 up_prepare_mutex: 871 up_prepare_mutex:
872 up(&usX2Y->prepare_mutex); 872 mutex_unlock(&usX2Y->prepare_mutex);
873 return err; 873 return err;
874} 874}
875 875
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index 796a7dcef09d..315855082fe1 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -366,7 +366,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream)
366 struct snd_pcm_runtime *runtime = substream->runtime; 366 struct snd_pcm_runtime *runtime = substream->runtime;
367 struct snd_usX2Y_substream *subs = runtime->private_data, 367 struct snd_usX2Y_substream *subs = runtime->private_data,
368 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; 368 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
369 down(&subs->usX2Y->prepare_mutex); 369 mutex_lock(&subs->usX2Y->prepare_mutex);
370 snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream); 370 snd_printdd("snd_usX2Y_usbpcm_hw_free(%p)\n", substream);
371 371
372 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) { 372 if (SNDRV_PCM_STREAM_PLAYBACK == substream->stream) {
@@ -395,7 +395,7 @@ static int snd_usX2Y_usbpcm_hw_free(struct snd_pcm_substream *substream)
395 usX2Y_usbpcm_urbs_release(cap_subs2); 395 usX2Y_usbpcm_urbs_release(cap_subs2);
396 } 396 }
397 } 397 }
398 up(&subs->usX2Y->prepare_mutex); 398 mutex_unlock(&subs->usX2Y->prepare_mutex);
399 return snd_pcm_lib_free_pages(substream); 399 return snd_pcm_lib_free_pages(substream);
400} 400}
401 401
@@ -503,7 +503,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)
503 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); 503 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm));
504 } 504 }
505 505
506 down(&usX2Y->prepare_mutex); 506 mutex_lock(&usX2Y->prepare_mutex);
507 usX2Y_subs_prepare(subs); 507 usX2Y_subs_prepare(subs);
508// Start hardware streams 508// Start hardware streams
509// SyncStream first.... 509// SyncStream first....
@@ -544,7 +544,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream)
544 usX2Y->hwdep_pcm_shm->capture_iso_start = -1; 544 usX2Y->hwdep_pcm_shm->capture_iso_start = -1;
545 545
546 up_prepare_mutex: 546 up_prepare_mutex:
547 up(&usX2Y->prepare_mutex); 547 mutex_unlock(&usX2Y->prepare_mutex);
548 return err; 548 return err;
549} 549}
550 550
@@ -621,7 +621,7 @@ static int usX2Y_pcms_lock_check(struct snd_card *card)
621 if (dev->type != SNDRV_DEV_PCM) 621 if (dev->type != SNDRV_DEV_PCM)
622 continue; 622 continue;
623 pcm = dev->device_data; 623 pcm = dev->device_data;
624 down(&pcm->open_mutex); 624 mutex_lock(&pcm->open_mutex);
625 } 625 }
626 list_for_each(list, &card->devices) { 626 list_for_each(list, &card->devices) {
627 int s; 627 int s;
@@ -650,7 +650,7 @@ static void usX2Y_pcms_unlock(struct snd_card *card)
650 if (dev->type != SNDRV_DEV_PCM) 650 if (dev->type != SNDRV_DEV_PCM)
651 continue; 651 continue;
652 pcm = dev->device_data; 652 pcm = dev->device_data;
653 up(&pcm->open_mutex); 653 mutex_unlock(&pcm->open_mutex);
654 } 654 }
655} 655}
656 656