#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>
struct timeval my_tv1, my_tv2;
do_gettimeofday(&my_tv1);
#endif
- mutex_lock(&mgr->setup_mutex);
+ down(&mgr->setup_mutex);
/* check the pipes concerned and build pipe_array */
for (i = 0; i < mgr->num_cards; i++) {
}
}
if (capture_mask == 0 && playback_mask == 0) {
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : no pipes\n");
return;
}
/* synchronous stop of all the pipes concerned */
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 0);
if (err) {
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : error stop pipes (P%x C%x)\n",
playback_mask, capture_mask);
return;
/* synchronous start of all the pipes concerned */
err = pcxhr_set_pipe_state(mgr, playback_mask, capture_mask, 1);
if (err) {
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
snd_printk(KERN_ERR "pcxhr_trigger_tasklet : error start pipes (P%x C%x)\n",
playback_mask, capture_mask);
return;
}
spin_unlock_irqrestore(&mgr->lock, flags);
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
#ifdef CONFIG_SND_DEBUG_DETECT
do_gettimeofday(&my_tv2);
}
*/
- mutex_lock(&mgr->setup_mutex);
+ down(&mgr->setup_mutex);
do {
/* if the stream was stopped before, format and buffer were reset */
}
} while(0); /* do only once (so we can use break instead of goto) */
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return err;
}
/* set up format for the stream */
format = params_format(hw);
- mutex_lock(&mgr->setup_mutex);
+ down(&mgr->setup_mutex);
stream->channels = channels;
stream->format = format;
/*
err = pcxhr_set_format(stream);
if(err) {
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return err;
}
*/
err = pcxhr_update_r_buffer(stream);
}
*/
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return err;
}
struct pcxhr_stream *stream;
int is_capture;
- mutex_lock(&mgr->setup_mutex);
+ down(&mgr->setup_mutex);
/* copy the struct snd_pcm_hardware struct */
runtime->hw = pcxhr_caps;
/* streams in use */
snd_printk(KERN_ERR "pcxhr_open chip%d subs%d in use\n",
chip->chip_idx, subs->number);
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return -EBUSY;
}
&external_rate) ||
external_rate == 0) {
/* cannot detect the external clock rate */
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return -EBUSY;
}
runtime->hw.rate_min = runtime->hw.rate_max = external_rate;
mgr->ref_count_rate++;
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return 0;
}
struct pcxhr_mgr *mgr = chip->mgr;
struct pcxhr_stream *stream = subs->runtime->private_data;
- mutex_lock(&mgr->setup_mutex);
+ down(&mgr->setup_mutex);
snd_printdd("pcxhr_close chip%d subs%d\n", chip->chip_idx, subs->number);
stream->status = PCXHR_STREAM_STATUS_FREE;
stream->substream = NULL;
- mutex_unlock(&mgr->setup_mutex);
+ up(&mgr->setup_mutex);
return 0;
}
struct snd_info_entry *entry;
if (! snd_card_proc_new(chip->card, "info", &entry))
- snd_info_set_text_ops(entry, chip, pcxhr_proc_info);
+ snd_info_set_text_ops(entry, chip, 1024, pcxhr_proc_info);
if (! snd_card_proc_new(chip->card, "sync", &entry))
- snd_info_set_text_ops(entry, chip, pcxhr_proc_sync);
+ snd_info_set_text_ops(entry, chip, 1024, pcxhr_proc_sync);
}
/* end of proc interface */
pci_set_master(pci);
/* check if we can restrict PCI DMA transfers to 32 bits */
- if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0) {
+ if (pci_set_dma_mask(pci, 0xffffffff) < 0) {
snd_printk(KERN_ERR "architecture does not support 32bit PCI busmaster DMA\n");
pci_disable_device(pci);
return -ENXIO;
mgr->pci = pci;
mgr->irq = -1;
- if (request_irq(pci->irq, pcxhr_interrupt, IRQF_DISABLED|IRQF_SHARED,
+ if (request_irq(pci->irq, pcxhr_interrupt, SA_INTERRUPT|SA_SHIRQ,
card_name, mgr)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
pcxhr_free(mgr);
spin_lock_init(&mgr->msg_lock);
/* init setup mutex*/
- mutex_init(&mgr->setup_mutex);
+ init_MUTEX(&mgr->setup_mutex);
/* init taslket */
tasklet_init(&mgr->msg_taskq, pcxhr_msg_tasklet, (unsigned long) mgr);