ALSA: ens137x: Support PCM sync_stop
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Dec 2019 06:34:16 +0000 (07:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 Dec 2019 06:25:45 +0000 (07:25 +0100)
The driver invokes snd_pcm_period_elapsed() simply from the interrupt
handler.  Set card->sync_irq for enabling the missing sync_stop PCM
operation, as well as removing the superfluous synchronize_irq()
call.

Link: https://lore.kernel.org/r/20191210063454.31603-18-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ens1370.c

index f69555c..378141a 100644 (file)
@@ -1888,8 +1888,6 @@ static int snd_ensoniq_free(struct ensoniq *ensoniq)
        outl(0, ES_REG(ensoniq, CONTROL));      /* switch everything off */
        outl(0, ES_REG(ensoniq, SERIAL));       /* clear serial interface */
 #endif
        outl(0, ES_REG(ensoniq, CONTROL));      /* switch everything off */
        outl(0, ES_REG(ensoniq, SERIAL));       /* clear serial interface */
 #endif
-       if (ensoniq->irq >= 0)
-               synchronize_irq(ensoniq->irq);
        pci_set_power_state(ensoniq->pci, PCI_D3hot);
       __hw_end:
 #ifdef CHIP1370
        pci_set_power_state(ensoniq->pci, PCI_D3hot);
       __hw_end:
 #ifdef CHIP1370
@@ -1990,7 +1988,6 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
        outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL));
        outb(0x00, ES_REG(ensoniq, UART_RES));
        outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
        outb(ensoniq->uartc = 0x00, ES_REG(ensoniq, UART_CONTROL));
        outb(0x00, ES_REG(ensoniq, UART_RES));
        outl(ensoniq->cssr, ES_REG(ensoniq, STATUS));
-       synchronize_irq(ensoniq->irq);
 }
 
 #ifdef CONFIG_PM_SLEEP
 }
 
 #ifdef CONFIG_PM_SLEEP
@@ -2074,6 +2071,7 @@ static int snd_ensoniq_create(struct snd_card *card,
                return -EBUSY;
        }
        ensoniq->irq = pci->irq;
                return -EBUSY;
        }
        ensoniq->irq = pci->irq;
+       card->sync_irq = ensoniq->irq;
 #ifdef CHIP1370
        if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev,
                                16, &ensoniq->dma_bug) < 0) {
 #ifdef CHIP1370
        if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, &pci->dev,
                                16, &ensoniq->dma_bug) < 0) {