summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJai Luthra <j-luthra@ti.com>2024-06-11 18:02:55 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-07-25 09:49:14 +0200
commit3e25eb518ffef5d1e5d8a044d1e4f2821769aacb (patch)
treecd7bbc8de5e54030fe06609793bf96598ab0737a /include
parent9b6164e34ad4963ed6fb84f6e42f318ed4990064 (diff)
downloadlinux-3e25eb518ffef5d1e5d8a044d1e4f2821769aacb.tar.gz
linux-3e25eb518ffef5d1e5d8a044d1e4f2821769aacb.tar.bz2
linux-3e25eb518ffef5d1e5d8a044d1e4f2821769aacb.zip
ALSA: dmaengine: Synchronize dma channel after drop()
[ Upstream commit e8343410ddf08fc36a9b9cc7c51a4e53a262d4c6 ] Sometimes the stream may be stopped due to XRUN events, in which case the userspace can call snd_pcm_drop() and snd_pcm_prepare() to stop and start the stream again. In these cases, we must wait for the DMA channel to synchronize before marking the stream as prepared for playback, as the DMA channel gets stopped by drop() without any synchronization. Make sure the ALSA core synchronizes the DMA channel by adding a sync_stop() hook. Reviewed-by: Peter Ujfalusi <peter.ujfalusi@gmail.com> Signed-off-by: Jai Luthra <j-luthra@ti.com> Link: https://lore.kernel.org/r/20240611-asoc_next-v3-1-fcfd84b12164@ti.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/sound/dmaengine_pcm.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
index 2df54cf02cb3..74b8ef419d4f 100644
--- a/include/sound/dmaengine_pcm.h
+++ b/include/sound/dmaengine_pcm.h
@@ -36,6 +36,7 @@ snd_pcm_uframes_t snd_dmaengine_pcm_pointer_no_residue(struct snd_pcm_substream
int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
struct dma_chan *chan);
int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
+int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream);
int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
dma_filter_fn filter_fn, void *filter_data);