Skip to content

Abstract the DMA and Codec DAI ops for the BE DAI widgets - #3972

Merged
plbossart merged 7 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/hda_dai_hw_params
Nov 18, 2022
Merged

plbossart merged 7 commits into
thesofproject:topic/sof-devfrom
ranj063:fix/hda_dai_hw_params

Conversation

@ranj063

@ranj063 ranj063 commented Oct 30, 2022 •

Copy link
Copy Markdown
Collaborator

Introduce SOF DAI ops to abstract the BE DAI widget DMA, codec_dai and dai_config ops. This change will allow adding the chained DMA mode or the DSP-less mode for the BE DAI widgets with a simple change like this:

diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c
index 1d1e238d032e..1be992367a89 100644
--- a/sound/soc/sof/intel/hda-dai-ops.c
+++ b/sound/soc/sof/intel/hda-dai-ops.c
@@ -433,10 +433,19 @@ void hda_set_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swi
        }
        case SOF_INTEL_IPC4:
        {
+               struct snd_sof_widget *pipe_widget = swidget->pipe_widget;
                struct sof_ipc4_copier *ipc4_copier = sdai->private;
+               struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
+               struct snd_sof_dai_dma_ops *dma_ops = sdai->ops->dma_ops;
+
+               if (ipc4_copier->dai_type != SOF_DAI_INTEL_HDA)
+                       break;
+
+               if (pipeline->use_chain_dma) {
+                       dma_ops->pre_trigger = NULL;
+                       dma_ops->post_trigger = NULL;
+               }
 
-               if (ipc4_copier->dai_type == SOF_DAI_INTEL_HDA)
-                       sdai->ops = &hda_ipc4_dai_ops;
                break;
        }
        default:

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants