[ALSA] emu10k1x: simplify around pci_register_driver()
[pandora-kernel.git] / sound / pci / via82xx.c
index 39daf62..e0e3bfd 100644 (file)
@@ -396,7 +396,7 @@ struct via82xx {
 #endif
 };
 
-static struct pci_device_id snd_via82xx_ids[] __devinitdata = {
+static struct pci_device_id snd_via82xx_ids[] = {
        /* 0x1106, 0x3058 */
        { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, TYPE_CARD_VIA686, },     /* 686A */
        /* 0x1106, 0x3059 */
@@ -1277,7 +1277,18 @@ static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream)
        if (! ratep->used)
                ratep->rate = 0;
        spin_unlock_irq(&ratep->lock);
-
+       if (! ratep->rate) {
+               if (! viadev->direction) {
+                       snd_ac97_update_power(chip->ac97,
+                                             AC97_PCM_FRONT_DAC_RATE, 0);
+                       snd_ac97_update_power(chip->ac97,
+                                             AC97_PCM_SURR_DAC_RATE, 0);
+                       snd_ac97_update_power(chip->ac97,
+                                             AC97_PCM_LFE_DAC_RATE, 0);
+               } else
+                       snd_ac97_update_power(chip->ac97,
+                                             AC97_PCM_LR_ADC_RATE, 0);
+       }
        viadev->substream = NULL;
        return 0;
 }
@@ -1775,6 +1786,12 @@ static struct ac97_quirk ac97_quirks[] = {
                .name = "Targa Traveller 811",
                .type = AC97_TUNE_HP_ONLY,
        },
+       {
+               .subvendor = 0x161f,
+               .subdevice = 0x2032,
+               .name = "m680x",
+               .type = AC97_TUNE_HP_ONLY, /* http://launchpad.net/bugs/38546 */
+       },
        { } /* terminator */
 };
 
@@ -1973,7 +1990,7 @@ static int __devinit snd_via686_init_misc(struct via82xx *chip)
        pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, legacy_cfg);
        if (chip->mpu_res) {
                if (snd_mpu401_uart_new(chip->card, 0, MPU401_HW_VIA686A,
-                                       mpu_port, 1,
+                                       mpu_port, MPU401_INFO_INTEGRATED,
                                        chip->irq, 0, &chip->rmidi) < 0) {
                        printk(KERN_WARNING "unable to initialize MPU-401"
                               " at 0x%lx, skipping\n", mpu_port);
@@ -2015,7 +2032,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx *chip)
        struct snd_info_entry *entry;
 
        if (! snd_card_proc_new(chip->card, "via82xx", &entry))
-               snd_info_set_text_ops(entry, chip, 1024, snd_via82xx_proc_read);
+               snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
 }
 
 /*
@@ -2275,7 +2292,7 @@ static int __devinit snd_via82xx_create(struct snd_card *card,
        if (request_irq(pci->irq,
                        chip_type == TYPE_VIA8233 ?
                        snd_via8233_interrupt : snd_via686_interrupt,
-                       SA_INTERRUPT|SA_SHIRQ,
+                       IRQF_DISABLED|IRQF_SHARED,
                        card->driver, chip)) {
                snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
                snd_via82xx_free(chip);
@@ -2365,7 +2382,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci, int revision)
                { .subvendor = 0x1462, .subdevice = 0x0470, .action = VIA_DXS_SRC }, /* MSI KT880 Delta-FSR */
                { .subvendor = 0x1462, .subdevice = 0x3800, .action = VIA_DXS_ENABLE }, /* MSI KT266 */
                { .subvendor = 0x1462, .subdevice = 0x5901, .action = VIA_DXS_NO_VRA }, /* MSI KT6 Delta-SR */
-               { .subvendor = 0x1462, .subdevice = 0x7023, .action = VIA_DXS_NO_VRA }, /* MSI K8T Neo2-FI */
+               { .subvendor = 0x1462, .subdevice = 0x7023, .action = VIA_DXS_SRC }, /* MSI K8T Neo2-FI */
                { .subvendor = 0x1462, .subdevice = 0x7120, .action = VIA_DXS_ENABLE }, /* MSI KT4V */
                { .subvendor = 0x1462, .subdevice = 0x7142, .action = VIA_DXS_ENABLE }, /* MSI K8MM-V */
                { .subvendor = 0x1462, .subdevice = 0xb012, .action = VIA_DXS_SRC }, /* P4M800/VIA8237R */
@@ -2387,6 +2404,7 @@ static int __devinit check_dxs_list(struct pci_dev *pci, int revision)
                { .subvendor = 0x16f3, .subdevice = 0x6405, .action = VIA_DXS_SRC }, /* Jetway K8M8MS */
                { .subvendor = 0x1734, .subdevice = 0x1078, .action = VIA_DXS_SRC }, /* FSC Amilo L7300 */
                { .subvendor = 0x1734, .subdevice = 0x1093, .action = VIA_DXS_SRC }, /* FSC */
+               { .subvendor = 0x1734, .subdevice = 0x10ab, .action = VIA_DXS_SRC }, /* FSC */
                { .subvendor = 0x1849, .subdevice = 0x3059, .action = VIA_DXS_NO_VRA }, /* ASRock K7VM2 */
                { .subvendor = 0x1849, .subdevice = 0x9739, .action = VIA_DXS_SRC }, /* ASRock mobo(?) */
                { .subvendor = 0x1849, .subdevice = 0x9761, .action = VIA_DXS_SRC }, /* ASRock mobo(?) */