LF-3665-4 ASoC: SOF: Introduce fragment elapsed notification API
authorDaniel Baluta <daniel.baluta@nxp.com>
Mon, 18 Jan 2021 13:51:14 +0000 (15:51 +0200)
committerDaniel Baluta <daniel.baluta@nxp.com>
Wed, 28 Apr 2021 12:28:00 +0000 (15:28 +0300)
commit0183793e5ef8b417059c833c0ea3def90b6e5740
treeb379de4b4b706b042201730bea82e639ccbec57f
parent3bf455e4c50f808fc9e583b9bb31083e0c1679cc
LF-3665-4 ASoC: SOF: Introduce fragment elapsed notification API

After each fragment is accepted by the DSP we need to inform
the userspace applications that they can send the next fragment.
This is done via snd_compr_fragment_elapsed.

Similar with the PCM case, in order to avoid sending an IPC before
the previous IPC is handled we need to schedule a delayed work to
call snd_compr_fragment_elapsed().

See snd_sof_pcm_period_elapsed.

To sum up this patch offers the following API to SOF code:
* snd_sof_compr_init_elapsed_work
* snd_sof_compr_fragment_elapsed

Note that implementation for compressed function is in a new file
selected via CONFIG_SND_SOC_SOF_COMPRESS config option.

For symmetry we introduce snd_sof_pcm_init_elapsed_work to setup
the work struct for PCM case.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
sound/soc/sof/Kconfig
sound/soc/sof/Makefile
sound/soc/sof/compress.c [new file with mode: 0644]
sound/soc/sof/ipc.c
sound/soc/sof/pcm.c
sound/soc/sof/sof-audio.h
sound/soc/sof/topology.c