aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/mixart/mixart.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/mixart/mixart.c')
-rw-r--r--sound/pci/mixart/mixart.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index b218e1d20c78..43ee3b2b948f 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -25,7 +25,9 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/pci.h> 27#include <linux/pci.h>
28#include <linux/dma-mapping.h>
28#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <linux/mutex.h>
29#include <sound/core.h> 31#include <sound/core.h>
30#include <sound/initval.h> 32#include <sound/initval.h>
31#include <sound/info.h> 33#include <sound/info.h>
@@ -589,7 +591,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
589 /* set up format for the stream */ 591 /* set up format for the stream */
590 format = params_format(hw); 592 format = params_format(hw);
591 593
592 down(&mgr->setup_mutex); 594 mutex_lock(&mgr->setup_mutex);
593 595
594 /* update the stream levels */ 596 /* update the stream levels */
595 if( stream->pcm_number <= MIXART_PCM_DIGITAL ) { 597 if( stream->pcm_number <= MIXART_PCM_DIGITAL ) {
@@ -628,7 +630,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
628 bufferinfo[i].available_length, 630 bufferinfo[i].available_length,
629 subs->number); 631 subs->number);
630 } 632 }
631 up(&mgr->setup_mutex); 633 mutex_unlock(&mgr->setup_mutex);
632 634
633 return err; 635 return err;
634} 636}
@@ -700,7 +702,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
700 int err = 0; 702 int err = 0;
701 int pcm_number; 703 int pcm_number;
702 704
703 down(&mgr->setup_mutex); 705 mutex_lock(&mgr->setup_mutex);
704 706
705 if ( pcm == chip->pcm ) { 707 if ( pcm == chip->pcm ) {
706 pcm_number = MIXART_PCM_ANALOG; 708 pcm_number = MIXART_PCM_ANALOG;
@@ -758,7 +760,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
758 } 760 }
759 761
760 _exit_open: 762 _exit_open:
761 up(&mgr->setup_mutex); 763 mutex_unlock(&mgr->setup_mutex);
762 764
763 return err; 765 return err;
764} 766}
@@ -775,7 +777,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
775 int err = 0; 777 int err = 0;
776 int pcm_number; 778 int pcm_number;
777 779
778 down(&mgr->setup_mutex); 780 mutex_lock(&mgr->setup_mutex);
779 781
780 if ( pcm == chip->pcm ) { 782 if ( pcm == chip->pcm ) {
781 pcm_number = MIXART_PCM_ANALOG; 783 pcm_number = MIXART_PCM_ANALOG;
@@ -836,7 +838,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
836 } 838 }
837 839
838 _exit_open: 840 _exit_open:
839 up(&mgr->setup_mutex); 841 mutex_unlock(&mgr->setup_mutex);
840 842
841 return err; 843 return err;
842} 844}
@@ -849,7 +851,7 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
849 struct mixart_mgr *mgr = chip->mgr; 851 struct mixart_mgr *mgr = chip->mgr;
850 struct mixart_stream *stream = subs->runtime->private_data; 852 struct mixart_stream *stream = subs->runtime->private_data;
851 853
852 down(&mgr->setup_mutex); 854 mutex_lock(&mgr->setup_mutex);
853 855
854 snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number); 856 snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number);
855 857
@@ -868,7 +870,7 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
868 stream->status = MIXART_STREAM_STATUS_FREE; 870 stream->status = MIXART_STREAM_STATUS_FREE;
869 stream->substream = NULL; 871 stream->substream = NULL;
870 872
871 up(&mgr->setup_mutex); 873 mutex_unlock(&mgr->setup_mutex);
872 return 0; 874 return 0;
873} 875}
874 876
@@ -1288,7 +1290,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1288 pci_set_master(pci); 1290 pci_set_master(pci);
1289 1291
1290 /* check if we can restrict PCI DMA transfers to 32 bits */ 1292 /* check if we can restrict PCI DMA transfers to 32 bits */
1291 if (pci_set_dma_mask(pci, 0xffffffff) < 0) { 1293 if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) {
1292 snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n"); 1294 snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n");
1293 pci_disable_device(pci); 1295 pci_disable_device(pci);
1294 return -ENXIO; 1296 return -ENXIO;
@@ -1335,12 +1337,12 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
1335 mgr->msg_fifo_writeptr = 0; 1337 mgr->msg_fifo_writeptr = 0;
1336 1338
1337 spin_lock_init(&mgr->msg_lock); 1339 spin_lock_init(&mgr->msg_lock);
1338 init_MUTEX(&mgr->msg_mutex); 1340 mutex_init(&mgr->msg_mutex);
1339 init_waitqueue_head(&mgr->msg_sleep); 1341 init_waitqueue_head(&mgr->msg_sleep);
1340 atomic_set(&mgr->msg_processed, 0); 1342 atomic_set(&mgr->msg_processed, 0);
1341 1343
1342 /* init setup mutex*/ 1344 /* init setup mutex*/
1343 init_MUTEX(&mgr->setup_mutex); 1345 mutex_init(&mgr->setup_mutex);
1344 1346
1345 /* init message taslket */ 1347 /* init message taslket */
1346 tasklet_init(&mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr); 1348 tasklet_init(&mgr->msg_taskq, snd_mixart_msg_tasklet, (unsigned long) mgr);