Revert "ASoC: SOF: Intel: hda-dai-ops: only allocate/release streams for first CPU...
authorBard Liao <yung-chuan.liao@linux.intel.com>
Tue, 2 Apr 2024 15:18:14 +0000 (10:18 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 2 Apr 2024 16:14:45 +0000 (17:14 +0100)
This reverts commit f8ba62ac863c33fc0d8ac3f1270985c2b77f4377.

The SoundWire aggregated solution was to use one DMA on multiple links.
But, the solution changed to use one DMA for each link. It means that
we should assign HDaudio stream_tag for each cpu_dai.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://msgid.link/r/20240402151828.175002-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dai-ops.c

index d3e168ad11804489056e6bc7f611ab6d27e3921b..1afdb06499a3764ffe0b3dd9492ec318f9d3d7ad 100644 (file)
@@ -145,17 +145,9 @@ 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)
 {
-       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
-       struct snd_soc_dai *dai;
        struct hdac_ext_stream *hext_stream;
 
-       /* only allocate a stream_tag for the first DAI in the dailink */
-       dai = snd_soc_rtd_to_cpu(rtd, 0);
-       if (dai == cpu_dai)
-               hext_stream = hda_link_stream_assign(sof_to_bus(sdev), substream);
-       else
-               hext_stream = snd_soc_dai_get_dma_data(dai, substream);
-
+       hext_stream = hda_link_stream_assign(sof_to_bus(sdev), substream);
        if (!hext_stream)
                return NULL;
 
@@ -168,14 +160,9 @@ static void hda_release_hext_stream(struct snd_sof_dev *sdev, struct snd_soc_dai
                                    struct snd_pcm_substream *substream)
 {
        struct hdac_ext_stream *hext_stream = hda_get_hext_stream(sdev, cpu_dai, substream);
-       struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
-       struct snd_soc_dai *dai;
 
-       /* only release a stream_tag for the first DAI in the dailink */
-       dai = snd_soc_rtd_to_cpu(rtd, 0);
-       if (dai == cpu_dai)
-               snd_hdac_ext_stream_release(hext_stream, HDAC_EXT_STREAM_TYPE_LINK);
        snd_soc_dai_set_dma_data(cpu_dai, substream, NULL);
+       snd_hdac_ext_stream_release(hext_stream, HDAC_EXT_STREAM_TYPE_LINK);
 }
 
 static void hda_setup_hext_stream(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream,