Commit f36da940 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Support PCM sync_stop

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-22-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e41dbd20
...@@ -790,6 +790,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect) ...@@ -790,6 +790,7 @@ static int azx_acquire_irq(struct azx *chip, int do_disconnect)
return -1; return -1;
} }
bus->irq = chip->pci->irq; bus->irq = chip->pci->irq;
chip->card->sync_irq = bus->irq;
pci_intx(chip->pci, !chip->msi); pci_intx(chip->pci, !chip->msi);
return 0; return 0;
} }
...@@ -1028,6 +1029,7 @@ static int azx_suspend(struct device *dev) ...@@ -1028,6 +1029,7 @@ static int azx_suspend(struct device *dev)
if (bus->irq >= 0) { if (bus->irq >= 0) {
free_irq(bus->irq, chip); free_irq(bus->irq, chip);
bus->irq = -1; bus->irq = -1;
chip->card->sync_irq = -1;
} }
if (chip->msi) if (chip->msi)
...@@ -1883,7 +1885,6 @@ static int azx_first_init(struct azx *chip) ...@@ -1883,7 +1885,6 @@ static int azx_first_init(struct azx *chip)
} }
pci_set_master(pci); pci_set_master(pci);
synchronize_irq(bus->irq);
gcap = azx_readw(chip, GCAP); gcap = azx_readw(chip, GCAP);
dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap); dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
...@@ -2042,6 +2043,7 @@ static int disable_msi_reset_irq(struct azx *chip) ...@@ -2042,6 +2043,7 @@ static int disable_msi_reset_irq(struct azx *chip)
free_irq(bus->irq, chip); free_irq(bus->irq, chip);
bus->irq = -1; bus->irq = -1;
chip->card->sync_irq = -1;
pci_disable_msi(chip->pci); pci_disable_msi(chip->pci);
chip->msi = 0; chip->msi = 0;
err = azx_acquire_irq(chip, 1); err = azx_acquire_irq(chip, 1);
......
...@@ -170,7 +170,6 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev) ...@@ -170,7 +170,6 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)
if (chip && chip->running) { if (chip && chip->running) {
azx_stop_chip(chip); azx_stop_chip(chip);
synchronize_irq(bus->irq);
azx_enter_link_reset(chip); azx_enter_link_reset(chip);
} }
hda_tegra_disable_clocks(hda); hda_tegra_disable_clocks(hda);
...@@ -298,8 +297,7 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev) ...@@ -298,8 +297,7 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
return err; return err;
} }
bus->irq = irq_id; bus->irq = irq_id;
card->sync_irq = bus->irq;
synchronize_irq(bus->irq);
gcap = azx_readw(chip, GCAP); gcap = azx_readw(chip, GCAP);
dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap); dev_dbg(card->dev, "chipset global capabilities = 0x%x\n", gcap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment