summaryrefslogtreecommitdiff
path: root/sound/soc/soc-component.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2021-03-12 10:38:40 +0800
committerMark Brown <broonie@kernel.org>2021-03-25 13:58:06 +0000
commit8bdfc0455e3a59e2c1207a56be22e910fae0e0d5 (patch)
tree5bb8c4ea8be168416923feab08176d5cb75ee58c /sound/soc/soc-component.c
parent3f994c25868729fb63a4eef42a7040e563eff365 (diff)
ASoC: soc-component: Add snd_soc_pcm_component_ack
Add snd_soc_pcm_component_ack back, which can be used to get an updated buffer pointer in the platform driver. On Asymmetric multiprocessor, this pointer can be sent to Cortex-M core for audio processing. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-component.c')
-rw-r--r--sound/soc/soc-component.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 8415e9bd2932..3a5e84e16a87 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -1212,3 +1212,17 @@ void snd_soc_pcm_component_pm_runtime_put(struct snd_soc_pcm_runtime *rtd,
soc_component_mark_pop(component, stream, pm);
}
}
+
+int snd_soc_pcm_component_ack(struct snd_pcm_substream *substream)
+{
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
+ struct snd_soc_component *component;
+ int i;
+
+ /* FIXME: use 1st pointer */
+ for_each_rtd_components(rtd, i, component)
+ if (component->driver->ack)
+ return component->driver->ack(component, substream);
+
+ return 0;
+}