ALSA: echoaudio: Support PCM sync_stop
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Dec 2019 06:34:14 +0000 (07:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 11 Dec 2019 06:25:44 +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.  It's cleared and reset dynamically at IRQ re-acquiring for
the PM resume, too.

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

index bfc3ffffb9172aa5bdfc16c8e9d2a1a9bee3a320..a9ac9fc635aa25f3de2f36cbfc5a7756cd920b0f 100644 (file)
@@ -1928,6 +1928,7 @@ static int snd_echo_create(struct snd_card *card,
                return -EBUSY;
        }
        chip->irq = pci->irq;
+       card->sync_irq = chip->irq;
        dev_dbg(card->dev, "pci=%p irq=%d subdev=%04x Init hardware...\n",
                chip->pci, chip->irq, chip->pci->subsystem_device);
 
@@ -2151,6 +2152,7 @@ static int snd_echo_suspend(struct device *dev)
        chip->dsp_code = NULL;
        free_irq(chip->irq, chip);
        chip->irq = -1;
+       chip->card->sync_irq = -1;
        return 0;
 }
 
@@ -2204,6 +2206,7 @@ static int snd_echo_resume(struct device *dev)
                return -EBUSY;
        }
        chip->irq = pci->irq;
+       chip->card->sync_irq = chip->irq;
        dev_dbg(dev, "resume irq=%d\n", chip->irq);
 
 #ifdef ECHOCARD_HAS_MIDI