diff mbox series

[13/15] ASoC: SOF: Intel: hda-dai-ops: add SoundWire dspless mode

Message ID 20240213101247.28887-14-peter.ujfalusi@linux.intel.com (mailing list archive)
State Accepted
Commit 0c3d57365a03ec920cc90614527ac11ad5a6f323
Headers show
Series ASoC: SOF: Extend ChainDMA and DSPless mode to LNL+ SDW | expand

Commit Message

Peter Ujfalusi Feb. 13, 2024, 10:12 a.m. UTC
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

This mode is only supported starting with LunarLake (ACE_2_0).

DMIC and SSP remain supported with the DSP only for now, since they
need a DAI configuration that is provided to firmware.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/soc/sof/intel/hda-dai-ops.c | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c
index 5a5ef93858be..c50ca9e72d37 100644
--- a/sound/soc/sof/intel/hda-dai-ops.c
+++ b/sound/soc/sof/intel/hda-dai-ops.c
@@ -607,6 +607,13 @@  static const struct hda_dai_widget_dma_ops hda_dspless_dma_ops = {
 	.get_hlink = hda_get_hlink,
 };
 
+static const struct hda_dai_widget_dma_ops sdw_dspless_dma_ops = {
+	.get_hext_stream = hda_dspless_get_hext_stream,
+	.setup_hext_stream = hda_dspless_setup_hext_stream,
+	.calc_stream_format = generic_calc_stream_format,
+	.get_hlink = sdw_get_hlink,
+};
+
 #endif
 
 const struct hda_dai_widget_dma_ops *
@@ -614,12 +621,24 @@  hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg
 {
 #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_LINK)
 	struct snd_sof_dai *sdai;
+	const struct sof_intel_dsp_desc *chip;
 
-	if (sdev->dspless_mode_selected)
-		return &hda_dspless_dma_ops;
-
+	chip = get_chip_info(sdev->pdata);
 	sdai = swidget->private;
 
+	if (sdev->dspless_mode_selected) {
+		switch (sdai->type) {
+		case SOF_DAI_INTEL_HDA:
+			return &hda_dspless_dma_ops;
+		case SOF_DAI_INTEL_ALH:
+			if (chip->hw_ip_version < SOF_INTEL_ACE_2_0)
+				return NULL;
+			return &sdw_dspless_dma_ops;
+		default:
+			return NULL;
+		}
+	}
+
 	switch (sdev->pdata->ipc_type) {
 	case SOF_IPC_TYPE_3:
 	{
@@ -633,9 +652,6 @@  hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg
 	{
 		struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
 		struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
-		const struct sof_intel_dsp_desc *chip;
-
-		chip = get_chip_info(sdev->pdata);
 
 		switch (sdai->type) {
 		case SOF_DAI_INTEL_HDA: