diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:59:20 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:59:20 -0800 |
commit | 1c2e02750b992703a8a18634e08b04353face243 (patch) | |
tree | 5dc2d10bad329eeb73b9e219e237662a8383f971 /sound/pci/pcxhr/pcxhr.c | |
parent | 8b4b6707ee32f929846d947d18b1b9bf42e988aa (diff) | |
parent | a3c44854a59f7e983c867060aa906bbf5befb1ef (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
* git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa: (124 commits)
[ALSA] version 1.0.11rc4
[PATCH] Intruduce DMA_28BIT_MASK
[ALSA] hda-codec - Add support for ASUS P4GPL-X
[ALSA] hda-codec - Add support for HP nx9420 laptop
[ALSA] Fix memory leaks in error path of control.c
[ALSA] AMD Au1x00: AC'97 controller is memory mapped
[ALSA] AMD Au1x00: fix DMA init/cleanup
[ALSA] hda-codec - Fix generic auto-configurator
[ALSA] hda-codec - Fix BIOS auto-configuration
[ALSA] Fixes typos in Audiophile-USB.txt
[ALSA] ice1712 - typo fixes for dxr_enable module option
[ALSA] AMD Au1x00: make driver build after cleanup
[ALSA] ice1712 - Fix wrong value types for enum items
[ALSA] fix resource leak in usbmixer
[ALSA] Fix gus_pcm dereference before NULL
[ALSA] Fix seq_clientmgr dereferences before NULL check
[ALSA] hda-codec - Fix for Samsung R65 and ASUS A6J
[ALSA] hda-codec - Add support for VAIO FE550G and SZ110
[ALSA] usb-audio: add Maya44 mixer control names
[ALSA] usb-audio: add Casio PL-40R support
...
Diffstat (limited to 'sound/pci/pcxhr/pcxhr.c')
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index b2cba75b6b1..f679779d96e 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -26,8 +26,11 @@ #include <linux/interrupt.h> #include <linux/slab.h> #include <linux/pci.h> +#include <linux/dma-mapping.h> #include <linux/delay.h> #include <linux/moduleparam.h> +#include <linux/mutex.h> + #include <sound/core.h> #include <sound/initval.h> #include <sound/info.h> @@ -518,7 +521,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg) struct timeval my_tv1, my_tv2; do_gettimeofday(&my_tv1); #endif - down(&mgr->setup_mutex); + mutex_lock(&mgr->setup_mutex); /* check the pipes concerned and build pipe_array */ for (i = 0; i < mgr->num_cards; i++) { @@ -537,7 +540,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg) } } if (capture_mask == 0 && playback_mask == 0) { - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); snd_printk(KERN_ERR "pcxhr_trigger_tasklet : no pipes\n"); return; } @@ -548,7 +551,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg) /* synchronous stop of all the pipes concerned */ err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0); if (err) { - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); snd_printk(KERN_ERR "pcxhr_trigger_tasklet : error stop pipes (P%x C%x)\n", playback_mask, capture_mask); return; @@ -592,7 +595,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg) /* synchronous start of all the pipes concerned */ err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1); if (err) { - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); snd_printk(KERN_ERR "pcxhr_trigger_tasklet : error start pipes (P%x C%x)\n", playback_mask, capture_mask); return; @@ -619,7 +622,7 @@ static void pcxhr_trigger_tasklet(unsigned long arg) } spin_unlock_irqrestore(&mgr->lock, flags); - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); #ifdef CONFIG_SND_DEBUG_DETECT do_gettimeofday(&my_tv2); @@ -728,7 +731,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs) } */ - down(&mgr->setup_mutex); + mutex_lock(&mgr->setup_mutex); do { /* if the stream was stopped before, format and buffer were reset */ @@ -755,7 +758,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs) } } while(0); /* do only once (so we can use break instead of goto) */ - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return err; } @@ -780,7 +783,7 @@ static int pcxhr_hw_params(struct snd_pcm_substream *subs, /* set up format for the stream */ format = params_format(hw); - down(&mgr->setup_mutex); + mutex_lock(&mgr->setup_mutex); stream->channels = channels; stream->format = format; @@ -789,7 +792,7 @@ static int pcxhr_hw_params(struct snd_pcm_substream *subs, /* err = pcxhr_set_format(stream); if(err) { - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return err; } */ @@ -801,7 +804,7 @@ static int pcxhr_hw_params(struct snd_pcm_substream *subs, err = pcxhr_update_r_buffer(stream); } */ - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return err; } @@ -847,7 +850,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) struct pcxhr_stream *stream; int is_capture; - down(&mgr->setup_mutex); + mutex_lock(&mgr->setup_mutex); /* copy the struct snd_pcm_hardware struct */ runtime->hw = pcxhr_caps; @@ -871,7 +874,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) /* streams in use */ snd_printk(KERN_ERR "pcxhr_open chip%d subs%d in use\n", chip->chip_idx, subs->number); - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return -EBUSY; } @@ -887,7 +890,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) &external_rate) || external_rate == 0) { /* cannot detect the external clock rate */ - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return -EBUSY; } runtime->hw.rate_min = runtime->hw.rate_max = external_rate; @@ -905,7 +908,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) mgr->ref_count_rate++; - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return 0; } @@ -916,7 +919,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs) struct pcxhr_mgr *mgr = chip->mgr; struct pcxhr_stream *stream = subs->runtime->private_data; - down(&mgr->setup_mutex); + mutex_lock(&mgr->setup_mutex); snd_printdd("pcxhr_close chip%d subs%d\n", chip->chip_idx, subs->number); @@ -929,7 +932,7 @@ static int pcxhr_close(struct snd_pcm_substream *subs) stream->status = PCXHR_STREAM_STATUS_FREE; stream->substream = NULL; - up(&mgr->setup_mutex); + mutex_unlock(&mgr->setup_mutex); return 0; } @@ -1215,7 +1218,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id pci_set_master(pci); /* check if we can restrict PCI DMA transfers to 32 bits */ - if (pci_set_dma_mask(pci, 0xffffffff) < 0) { + if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) { snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); pci_disable_device(pci); return -ENXIO; @@ -1264,7 +1267,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id spin_lock_init(&mgr->msg_lock); /* init setup mutex*/ - init_MUTEX(&mgr->setup_mutex); + mutex_init(&mgr->setup_mutex); /* init taslket */ tasklet_init(&mgr->msg_taskq, pcxhr_msg_tasklet, (unsigned long) mgr); |