[ALSA] es1938 - Fix resume
[powerpc.git] / sound / pci / es1938.c
index b492777..e8b8ebf 100644 (file)
@@ -76,13 +76,6 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1938},"
 #define SUPPORT_JOYSTICK 1
 #endif
 
-#ifndef PCI_VENDOR_ID_ESS
-#define PCI_VENDOR_ID_ESS              0x125d
-#endif
-#ifndef PCI_DEVICE_ID_ESS_ES1938
-#define PCI_DEVICE_ID_ESS_ES1938       0x1969
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;     /* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;      /* ID for this card */
 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;     /* Enable this card */
@@ -1397,7 +1390,8 @@ static int es1938_suspend(snd_card_t *card, pm_message_t state)
                *d = snd_es1938_reg_read(chip, *s);
 
        outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */
-
+       if (chip->irq >= 0)                                                                         
+               free_irq(chip->irq, (void *)chip);  
        pci_disable_device(chip->pci);
        return 0;
 }
@@ -1408,6 +1402,7 @@ static int es1938_resume(snd_card_t *card)
        unsigned char *s, *d;
 
        pci_enable_device(chip->pci);
+       request_irq(chip->pci->irq, snd_es1938_interrupt, SA_INTERRUPT|SA_SHIRQ, "ES1938", (void *)chip);
        snd_es1938_chip_init(chip);
 
        /* restore mixer-related registers */
@@ -1501,7 +1496,7 @@ static int __devinit snd_es1938_create(snd_card_t * card,
                 return -ENXIO;
         }
 
-       chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);
+       chip = kzalloc(sizeof(*chip), GFP_KERNEL);
        if (chip == NULL) {
                pci_disable_device(pci);
                return -ENOMEM;
@@ -1753,6 +1748,7 @@ static void __devexit snd_es1938_remove(struct pci_dev *pci)
 
 static struct pci_driver driver = {
        .name = "ESS ES1938 (Solo-1)",
+       .owner = THIS_MODULE,
        .id_table = snd_es1938_ids,
        .probe = snd_es1938_probe,
        .remove = __devexit_p(snd_es1938_remove),