X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fatiixp.c;fp=sound%2Fpci%2Fatiixp.c;h=b7217adaf1d76b69ee63685cce59d029ebecc77f;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=347e25ff073dba9e5af492908f2a9190f1473413;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 347e25ff0..b7217adaf 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -278,7 +277,7 @@ struct atiixp { unsigned int codec_not_ready_bits; /* for codec detection */ int spdif_over_aclink; /* passed from the module option */ - struct mutex open_mutex; /* playback open mutex */ + struct semaphore open_mutex; /* playback open mutex */ }; @@ -1052,9 +1051,9 @@ static int snd_atiixp_playback_open(struct snd_pcm_substream *substream) struct atiixp *chip = snd_pcm_substream_chip(substream); int err; - mutex_lock(&chip->open_mutex); + down(&chip->open_mutex); err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0); - mutex_unlock(&chip->open_mutex); + up(&chip->open_mutex); if (err < 0) return err; substream->runtime->hw.channels_max = chip->max_channels; @@ -1069,9 +1068,9 @@ static int snd_atiixp_playback_close(struct snd_pcm_substream *substream) { struct atiixp *chip = snd_pcm_substream_chip(substream); int err; - mutex_lock(&chip->open_mutex); + down(&chip->open_mutex); err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]); - mutex_unlock(&chip->open_mutex); + up(&chip->open_mutex); return err; } @@ -1091,12 +1090,12 @@ static int snd_atiixp_spdif_open(struct snd_pcm_substream *substream) { struct atiixp *chip = snd_pcm_substream_chip(substream); int err; - mutex_lock(&chip->open_mutex); + down(&chip->open_mutex); if (chip->spdif_over_aclink) /* share DMA_PLAYBACK */ err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 2); else err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_SPDIF], -1); - mutex_unlock(&chip->open_mutex); + up(&chip->open_mutex); return err; } @@ -1104,12 +1103,12 @@ static int snd_atiixp_spdif_close(struct snd_pcm_substream *substream) { struct atiixp *chip = snd_pcm_substream_chip(substream); int err; - mutex_lock(&chip->open_mutex); + down(&chip->open_mutex); if (chip->spdif_over_aclink) err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]); else err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_SPDIF]); - mutex_unlock(&chip->open_mutex); + up(&chip->open_mutex); return err; } @@ -1504,7 +1503,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip) struct snd_info_entry *entry; if (! snd_card_proc_new(chip->card, "atiixp", &entry)) - snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read); + snd_info_set_text_ops(entry, chip, 1024, snd_atiixp_proc_read); } #else /* !CONFIG_PROC_FS */ #define snd_atiixp_proc_init(chip) @@ -1561,7 +1560,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card, } spin_lock_init(&chip->reg_lock); - mutex_init(&chip->open_mutex); + init_MUTEX(&chip->open_mutex); chip->card = card; chip->pci = pci; chip->irq = -1; @@ -1578,7 +1577,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card, return -EIO; } - if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_DISABLED|IRQF_SHARED, + if (request_irq(pci->irq, snd_atiixp_interrupt, SA_INTERRUPT|SA_SHIRQ, card->shortname, chip)) { snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); snd_atiixp_free(chip);