]> err.no Git - linux-2.6/blobdiff - sound/pci/atiixp.c
Documentation: correct values in MPC8548E SEC example node
[linux-2.6] / sound / pci / atiixp.c
index b7217adaf1d76b69ee63685cce59d029ebecc77f..9fbb065a810b2c8cea503c68d9122f358f9eb719 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
+#include <linux/mutex.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -277,13 +278,13 @@ struct atiixp {
        unsigned int codec_not_ready_bits;      /* for codec detection */
 
        int spdif_over_aclink;          /* passed from the module option */
-       struct semaphore open_mutex;    /* playback open mutex */
+       struct mutex open_mutex;        /* playback open mutex */
 };
 
 
 /*
  */
-static struct pci_device_id snd_atiixp_ids[] = {
+static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
        { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
        { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
        { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
@@ -1051,9 +1052,9 @@ static int snd_atiixp_playback_open(struct snd_pcm_substream *substream)
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
 
-       down(&chip->open_mutex);
+       mutex_lock(&chip->open_mutex);
        err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0);
-       up(&chip->open_mutex);
+       mutex_unlock(&chip->open_mutex);
        if (err < 0)
                return err;
        substream->runtime->hw.channels_max = chip->max_channels;
@@ -1068,9 +1069,9 @@ static int snd_atiixp_playback_close(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       down(&chip->open_mutex);
+       mutex_lock(&chip->open_mutex);
        err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
-       up(&chip->open_mutex);
+       mutex_unlock(&chip->open_mutex);
        return err;
 }
 
@@ -1090,12 +1091,12 @@ static int snd_atiixp_spdif_open(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       down(&chip->open_mutex);
+       mutex_lock(&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);
-       up(&chip->open_mutex);
+       mutex_unlock(&chip->open_mutex);
        return err;
 }
 
@@ -1103,12 +1104,12 @@ static int snd_atiixp_spdif_close(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       down(&chip->open_mutex);
+       mutex_lock(&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]);
-       up(&chip->open_mutex);
+       mutex_unlock(&chip->open_mutex);
        return err;
 }
 
@@ -1503,7 +1504,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, 1024, snd_atiixp_proc_read);
+               snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
 }
 #else /* !CONFIG_PROC_FS */
 #define snd_atiixp_proc_init(chip)
@@ -1560,7 +1561,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
        }
 
        spin_lock_init(&chip->reg_lock);
-       init_MUTEX(&chip->open_mutex);
+       mutex_init(&chip->open_mutex);
        chip->card = card;
        chip->pci = pci;
        chip->irq = -1;
@@ -1577,7 +1578,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
                return -EIO;
        }
 
-       if (request_irq(pci->irq, snd_atiixp_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_atiixp_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        card->shortname, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_atiixp_free(chip);