ASoC: SOF: Intel: hda-dai-ops: Split the get_hext_stream() op for IPC4
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 15 May 2023 11:20:21 +0000 (14:20 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 15 May 2023 11:25:37 +0000 (20:25 +0900)
Introduce a separate op implementation for get_hext_stream() for IPC4.
This op will also be used to set the skip_during_fe_trigger flag for the
BE DAI pipeline. With this change, we can remove the flag setting in
sof_ipc4_dai_config() which will further simplify support for
DMIC/SSP/Soundwire in the LunarLake platform.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com
Link: https://lore.kernel.org/r/20230515112022.30297-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
sound/soc/sof/intel/hda-dai-ops.c
sound/soc/sof/ipc4-topology.c

index 4b39cec..4c04adf 100644 (file)
@@ -120,6 +120,26 @@ static struct hdac_ext_stream *hda_get_hext_stream(struct snd_sof_dev *sdev,
        return snd_soc_dai_get_dma_data(cpu_dai, substream);
 }
 
+static struct hdac_ext_stream *hda_ipc4_get_hext_stream(struct snd_sof_dev *sdev,
+                                                       struct snd_soc_dai *cpu_dai,
+                                                       struct snd_pcm_substream *substream)
+{
+       struct snd_sof_widget *pipe_widget;
+       struct sof_ipc4_pipeline *pipeline;
+       struct snd_sof_widget *swidget;
+       struct snd_soc_dapm_widget *w;
+
+       w = snd_soc_dai_get_widget(cpu_dai, substream->stream);
+       swidget = w->dobj.private;
+       pipe_widget = swidget->spipe->pipe_widget;
+       pipeline = pipe_widget->private;
+
+       /* mark pipeline so that it can be skipped during FE trigger */
+       pipeline->skip_during_fe_trigger = true;
+
+       return snd_soc_dai_get_dma_data(cpu_dai, substream);
+}
+
 static struct hdac_ext_stream *hda_assign_hext_stream(struct snd_sof_dev *sdev,
                                                      struct snd_soc_dai *cpu_dai,
                                                      struct snd_pcm_substream *substream)
@@ -267,7 +287,7 @@ static int hda_ipc4_post_trigger(struct snd_sof_dev *sdev, struct snd_soc_dai *c
 }
 
 static const struct hda_dai_widget_dma_ops hda_ipc4_dma_ops = {
-       .get_hext_stream = hda_get_hext_stream,
+       .get_hext_stream = hda_ipc4_get_hext_stream,
        .assign_hext_stream = hda_assign_hext_stream,
        .release_hext_stream = hda_release_hext_stream,
        .setup_hext_stream = hda_setup_hext_stream,
index 059eebf..91a89ac 100644 (file)
@@ -2507,7 +2507,6 @@ static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
                }
                gtw_attr = ipc4_copier->gtw_attr;
                gtw_attr->lp_buffer_alloc = pipeline->lp_mode;
-               pipeline->skip_during_fe_trigger = true;
                fallthrough;
        case SOF_DAI_INTEL_ALH:
                /*