]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/emu10k1/emu10k1x.c
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / sound / pci / emu10k1 / emu10k1x.c
index e4af7a9b808caf0432e93491af8a383f919880ef..491a4a50f869c3dca9887bb9347ca6af64eb5d9b 100644 (file)
@@ -29,7 +29,6 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  *
  */
-#include <sound/driver.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
@@ -328,22 +327,22 @@ static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
 static void snd_emu10k1x_intr_enable(struct emu10k1x *emu, unsigned int intrenb)
 {
        unsigned long flags;
-       unsigned int enable;
-  
+       unsigned int intr_enable;
+
        spin_lock_irqsave(&emu->emu_lock, flags);
-       enable = inl(emu->port + INTE) | intrenb;
-       outl(enable, emu->port + INTE);
+       intr_enable = inl(emu->port + INTE) | intrenb;
+       outl(intr_enable, emu->port + INTE);
        spin_unlock_irqrestore(&emu->emu_lock, flags);
 }
 
 static void snd_emu10k1x_intr_disable(struct emu10k1x *emu, unsigned int intrenb)
 {
        unsigned long flags;
-       unsigned int enable;
-  
+       unsigned int intr_enable;
+
        spin_lock_irqsave(&emu->emu_lock, flags);
-       enable = inl(emu->port + INTE) & ~intrenb;
-       outl(enable, emu->port + INTE);
+       intr_enable = inl(emu->port + INTE) & ~intrenb;
+       outl(intr_enable, emu->port + INTE);
        spin_unlock_irqrestore(&emu->emu_lock, flags);
 }
 
@@ -755,13 +754,13 @@ static int snd_emu10k1x_free(struct emu10k1x *chip)
        // disable audio
        outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
 
-       // release the i/o port
-       release_and_free_resource(chip->res_port);
-
-       // release the irq
+       /* release the irq */
        if (chip->irq >= 0)
                free_irq(chip->irq, chip);
 
+       // release the i/o port
+       release_and_free_resource(chip->res_port);
+
        // release the DMA
        if (chip->dma_buffer.area) {
                snd_dma_free_pages(&chip->dma_buffer);
@@ -796,9 +795,9 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id)
 
        // capture interrupt
        if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) {
-               struct emu10k1x_voice *pvoice = &chip->capture_voice;
-               if (pvoice->use)
-                       snd_emu10k1x_pcm_interrupt(chip, pvoice);
+               struct emu10k1x_voice *cap_voice = &chip->capture_voice;
+               if (cap_voice->use)
+                       snd_emu10k1x_pcm_interrupt(chip, cap_voice);
                else
                        snd_emu10k1x_intr_disable(chip, 
                                                  INTE_CAP_0_LOOP |
@@ -1062,14 +1061,7 @@ static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu)
        return 0;
 }
 
-static int snd_emu10k1x_shared_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 1;
-       return 0;
-}
+#define snd_emu10k1x_shared_spdif_info snd_ctl_boolean_mono_info
 
 static int snd_emu10k1x_shared_spdif_get(struct snd_kcontrol *kcontrol,
                                         struct snd_ctl_elem_value *ucontrol)
@@ -1590,6 +1582,8 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci,
        sprintf(card->longname, "%s at 0x%lx irq %i",
                card->shortname, chip->port, chip->irq);
 
+       snd_card_set_dev(card, &pci->dev);
+
        if ((err = snd_card_register(card)) < 0) {
                snd_card_free(card);
                return err;