ASoC: SOF: Intel: hda-dai: use HDA_LINK instead of HDA_AUDIO_CODEC
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 12 May 2023 18:17:01 +0000 (13:17 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 15 May 2023 11:14:03 +0000 (20:14 +0900)
For LunarLake support, we will have to use HDAudio DMA-based DAIs even
for SSP/DMIC/SoundWire. That's completely different to the
HDA_AUDIO_CODEC, the DAI ops deal with DMA configuration and that can
happen in the absence of any HDAudio codec.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com
Reviewed-by: Rander Wang <rander.wang@intel.com
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com
Link: https://lore.kernel.org/r/20230512181702.117483-9-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org
sound/soc/sof/intel/hda-dai-ops.c
sound/soc/sof/intel/hda-dai.c

index 4b39cec..d711351 100644 (file)
@@ -16,7 +16,7 @@
 #include "hda.h"
 
 /* These ops are only applicable for the HDA DAI's in their current form */
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_LINK)
 /*
  * This function checks if the host dma channel corresponding
  * to the link DMA stream_tag argument is assigned to one
@@ -350,7 +350,7 @@ static const struct hda_dai_widget_dma_ops hda_dspless_dma_ops = {
 const struct hda_dai_widget_dma_ops *
 hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)
 {
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_LINK)
        struct snd_sof_dai *sdai;
 
        if (sdev->dspless_mode_selected)
index 729f750..09d8ee9 100644 (file)
@@ -61,7 +61,7 @@ int hda_dai_config(struct snd_soc_dapm_widget *w, unsigned int flags,
        return 0;
 }
 
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_LINK)
 
 static struct snd_sof_dev *dai_to_sdev(struct snd_pcm_substream *substream,
                                       struct snd_soc_dai *cpu_dai)
@@ -319,6 +319,8 @@ static int __maybe_unused hda_dai_trigger(struct snd_pcm_substream *substream, i
        return 0;
 }
 
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
+
 static int hda_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
 {
        struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
@@ -334,6 +336,8 @@ static const struct snd_soc_dai_ops hda_dai_ops = {
        .prepare = hda_dai_prepare,
 };
 
+#endif
+
 static int hda_dai_suspend(struct hdac_bus *bus)
 {
        struct snd_soc_pcm_runtime *rtd;
@@ -582,7 +586,7 @@ int hda_dsp_dais_suspend(struct snd_sof_dev *sdev)
         * Since the component suspend is called last, we can trap this corner case
         * and force the DAIs to release their resources.
         */
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC)
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_LINK)
        int ret;
 
        ret = hda_dai_suspend(sof_to_bus(sdev));