fix file specification in comments
[powerpc.git] / sound / pci / es1968.c
index 5ff4175..f3c4038 100644 (file)
@@ -132,7 +132,7 @@ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;  /* Enable this card *
 static int total_bufsize[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1024 };
 static int pcm_substreams_p[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 4 };
 static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
-static int clock[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 0};
+static int clock[SNDRV_CARDS];
 static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 #ifdef SUPPORT_JOYSTICK
@@ -592,7 +592,7 @@ struct es1968 {
 
 static irqreturn_t snd_es1968_interrupt(int irq, void *dev_id, struct pt_regs *regs);
 
-static struct pci_device_id snd_es1968_ids[] __devinitdata = {
+static struct pci_device_id snd_es1968_ids[] = {
        /* Maestro 1 */
         { 0x1285, 0x0100, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, TYPE_MAESTRO },
        /* Maestro 2 */
@@ -1905,7 +1905,7 @@ static void es1968_update_hw_volume(unsigned long private_data)
        /* Figure out which volume control button was pushed,
           based on differences from the default register
           values. */
-       x = inb(chip->io_port + 0x1c);
+       x = inb(chip->io_port + 0x1c) & 0xee;
        /* Reset the volume control registers. */
        outb(0x88, chip->io_port + 0x1c);
        outb(0x88, chip->io_port + 0x1d);
@@ -1921,7 +1921,8 @@ static void es1968_update_hw_volume(unsigned long private_data)
        /* FIXME: we can't call snd_ac97_* functions since here is in tasklet. */
        spin_lock_irqsave(&chip->ac97_lock, flags);
        val = chip->ac97->regs[AC97_MASTER];
-       if (x & 1) {
+       switch (x) {
+       case 0x88:
                /* mute */
                val ^= 0x8000;
                chip->ac97->regs[AC97_MASTER] = val;
@@ -1929,26 +1930,31 @@ static void es1968_update_hw_volume(unsigned long private_data)
                outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
                snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
                               &chip->master_switch->id);
-       } else {
-               val &= 0x7fff;
-               if (((x>>1) & 7) > 4) {
-                       /* volume up */
-                       if ((val & 0xff) > 0)
-                               val--;
-                       if ((val & 0xff00) > 0)
-                               val -= 0x0100;
-               } else {
-                       /* volume down */
-                       if ((val & 0xff) < 0x1f)
-                               val++;
-                       if ((val & 0xff00) < 0x1f00)
-                               val += 0x0100;
-               }
+               break;
+       case 0xaa:
+               /* volume up */
+               if ((val & 0x7f) > 0)
+                       val--;
+               if ((val & 0x7f00) > 0)
+                       val -= 0x0100;
+               chip->ac97->regs[AC97_MASTER] = val;
+               outw(val, chip->io_port + ESM_AC97_DATA);
+               outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
+               snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
+                              &chip->master_volume->id);
+               break;
+       case 0x66:
+               /* volume down */
+               if ((val & 0x7f) < 0x1f)
+                       val++;
+               if ((val & 0x7f00) < 0x1f00)
+                       val += 0x0100;
                chip->ac97->regs[AC97_MASTER] = val;
                outw(val, chip->io_port + ESM_AC97_DATA);
                outb(AC97_MASTER, chip->io_port + ESM_AC97_INDEX);
                snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
                               &chip->master_volume->id);
+               break;
        }
        spin_unlock_irqrestore(&chip->ac97_lock, flags);
 }
@@ -2597,7 +2603,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
                return err;
        }
        chip->io_port = pci_resource_start(pci, 0);
-       if (request_irq(pci->irq, snd_es1968_interrupt, SA_INTERRUPT|SA_SHIRQ,
+       if (request_irq(pci->irq, snd_es1968_interrupt, IRQF_DISABLED|IRQF_SHARED,
                        "ESS Maestro", (void*)chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_es1968_free(chip);
@@ -2727,7 +2733,8 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
        }
        if (enable_mpu[dev]) {
                if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401,
-                                              chip->io_port + ESM_MPU401_PORT, 1,
+                                              chip->io_port + ESM_MPU401_PORT,
+                                              MPU401_INFO_INTEGRATED,
                                               chip->irq, 0, &chip->rmidi)) < 0) {
                        printk(KERN_WARNING "es1968: skipping MPU-401 MIDI support..\n");
                }