]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: SOF: ops: add new 'is_chain_dma_supported' callback
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Tue, 13 Feb 2024 10:12:34 +0000 (12:12 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 13 Feb 2024 13:28:52 +0000 (13:28 +0000)
IPC4 introduced a 'chain-dma' mode when host and link DMA are
connected by firmware without using a regular pipeline or the ability
to add intermediate connections. This mode is not available on all
platforms and all links, so add a platform-specific callback to help
the SOF ipc4-topology core handle different hardware+firmware
configurations.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://msgid.link/r/20240213101247.28887-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ops.h
sound/soc/sof/sof-priv.h

index 6538d9f4fe96e02ca2fc45b55deb8738f505787e..6cf21e829e07272ccf4c7005f74f9ae61403d39b 100644 (file)
@@ -567,6 +567,15 @@ snd_sof_set_mach_params(struct snd_soc_acpi_mach *mach,
                sof_ops(sdev)->set_mach_params(mach, sdev);
 }
 
+static inline bool
+snd_sof_is_chain_dma_supported(struct snd_sof_dev *sdev, u32 dai_type)
+{
+       if (sof_ops(sdev) && sof_ops(sdev)->is_chain_dma_supported)
+               return sof_ops(sdev)->is_chain_dma_supported(sdev, dai_type);
+
+       return false;
+}
+
 /**
  * snd_sof_dsp_register_poll_timeout - Periodically poll an address
  * until a condition is met or a timeout occurs
index 6d7897bf96075e05dae0f708155455bf10a38b44..6c163c008607ddae34797e693656a61dc7b93256 100644 (file)
@@ -338,6 +338,8 @@ struct snd_sof_dsp_ops {
        struct snd_soc_dai_driver *drv;
        int num_drv;
 
+       bool (*is_chain_dma_supported)(struct snd_sof_dev *sdev, u32 dai_type); /* optional */
+
        /* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */
        u32 hw_info;