summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/hda-dai-ops.c
diff options
context:
space:
mode:
authorJyri Sarha <jyri.sarha@intel.com>2023-03-21 11:26:54 +0200
committerMark Brown <broonie@kernel.org>2023-03-21 12:13:31 +0000
commitca5ce0caa67fa9eeecaa29d895c2e4c3151c159e (patch)
tree79cf6da268ed8a2a3e8b48c77406586eab4645b8 /sound/soc/sof/intel/hda-dai-ops.c
parentcb3cdef33136baceada86ba2a21ba30cd53a9087 (diff)
downloadlinux-ca5ce0caa67fa9eeecaa29d895c2e4c3151c159e.tar.gz
linux-ca5ce0caa67fa9eeecaa29d895c2e4c3151c159e.tar.bz2
linux-ca5ce0caa67fa9eeecaa29d895c2e4c3151c159e.zip
ASoC: SOF: ipc4/intel: Add support for chained DMA
Add logic for setting up and tearing down chained DMA connections. Since pipelines are not used, all the logic to set the pipeline states can be bypassed, with only the DMA programming sequences remaining. In addition the same format needs to be used for host- and link-DMA, without the usual fixup to use the S32_LE format on the link. Note however that for convenience and compatibility with existing definitions, the topology relies on the concept of pipelines with a 'USE_CHAIN_DMA' token indicating that all the logic shall be bypassed. Unlike 'normal' ALSA sequences, the chain DMA is not programmed in hw_params/hw_free. The IPC message to set-up and tear-down chained DMA are sent in sof_ipc4_trigger_pipelines(), but the contents prepared earlier. Chained DMA is only supported by the Intel HDA DAI for now, and only S16_LE and S32_LE formats are supported for now. Signed-off-by: Jyri Sarha <jyri.sarha@intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230321092654.7292-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda-dai-ops.c')
-rw-r--r--sound/soc/sof/intel/hda-dai-ops.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c
index be109f33715f..de48f13259f1 100644
--- a/sound/soc/sof/intel/hda-dai-ops.c
+++ b/sound/soc/sof/intel/hda-dai-ops.c
@@ -277,6 +277,15 @@ static const struct hda_dai_widget_dma_ops hda_ipc4_dma_ops = {
.post_trigger = hda_ipc4_post_trigger
};
+static const struct hda_dai_widget_dma_ops hda_ipc4_chain_dma_ops = {
+ .get_hext_stream = hda_get_hext_stream,
+ .assign_hext_stream = hda_assign_hext_stream,
+ .release_hext_stream = hda_release_hext_stream,
+ .setup_hext_stream = hda_setup_hext_stream,
+ .reset_hext_stream = hda_reset_hext_stream,
+ .trigger = hda_trigger,
+};
+
static int hda_ipc3_post_trigger(struct snd_sof_dev *sdev, struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream, int cmd)
{
@@ -331,8 +340,15 @@ hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg
{
struct sof_ipc4_copier *ipc4_copier = sdai->private;
- if (ipc4_copier->dai_type == SOF_DAI_INTEL_HDA)
+ if (ipc4_copier->dai_type == SOF_DAI_INTEL_HDA) {
+ struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
+ struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
+
+ if (pipeline->use_chain_dma)
+ return &hda_ipc4_chain_dma_ops;
+
return &hda_ipc4_dma_ops;
+ }
break;
}
default: