mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:24:45 +01:00
ASoC: SOF: sof-audio: Add a new op in struct sof_ipc_tplg_ops
Add a new host_config op in struct sof_ipc_tplg_ops and define it for IPC4. This will be used to configure the host widget during prepare after a suspend/resume or after an xrun. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://patch.msgid.link/20260204081833.16630-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
dcf0470aa3
commit
236d5e66b5
2 changed files with 23 additions and 0 deletions
|
|
@ -2004,6 +2004,25 @@ sof_ipc4_prepare_dai_copier(struct snd_sof_dev *sdev, struct snd_sof_dai *dai,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void sof_ipc4_host_config(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
|
||||
struct snd_sof_platform_stream_params *platform_params)
|
||||
{
|
||||
struct sof_ipc4_copier *ipc4_copier = (struct sof_ipc4_copier *)swidget->private;
|
||||
struct snd_sof_widget *pipe_widget = swidget->spipe->pipe_widget;
|
||||
struct sof_ipc4_copier_data *copier_data = &ipc4_copier->data;
|
||||
struct sof_ipc4_pipeline *pipeline = pipe_widget->private;
|
||||
u32 host_dma_id = platform_params->stream_tag - 1;
|
||||
|
||||
if (pipeline->use_chain_dma) {
|
||||
pipeline->msg.primary &= ~SOF_IPC4_GLB_CHAIN_DMA_HOST_ID_MASK;
|
||||
pipeline->msg.primary |= SOF_IPC4_GLB_CHAIN_DMA_HOST_ID(host_dma_id);
|
||||
return;
|
||||
}
|
||||
|
||||
copier_data->gtw_cfg.node_id &= ~SOF_IPC4_NODE_INDEX_MASK;
|
||||
copier_data->gtw_cfg.node_id |= SOF_IPC4_NODE_INDEX(host_dma_id);
|
||||
}
|
||||
|
||||
static int
|
||||
sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget,
|
||||
struct snd_pcm_hw_params *fe_params,
|
||||
|
|
@ -3929,4 +3948,5 @@ const struct sof_ipc_tplg_ops ipc4_tplg_ops = {
|
|||
.dai_get_param = sof_ipc4_dai_get_param,
|
||||
.tear_down_all_pipelines = sof_ipc4_tear_down_all_pipelines,
|
||||
.link_setup = sof_ipc4_link_setup,
|
||||
.host_config = sof_ipc4_host_config,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -209,6 +209,7 @@ struct sof_ipc_tplg_widget_ops {
|
|||
* @widget_setup: Function pointer for setting up setup in the DSP
|
||||
* @widget_free: Function pointer for freeing widget in the DSP
|
||||
* @dai_config: Function pointer for sending DAI config IPC to the DSP
|
||||
* @host_config: Function pointer for setting the DMA ID for host widgets
|
||||
* @dai_get_param: Function pointer for getting the DAI parameter
|
||||
* @set_up_all_pipelines: Function pointer for setting up all topology pipelines
|
||||
* @tear_down_all_pipelines: Function pointer for tearing down all topology pipelines
|
||||
|
|
@ -230,6 +231,8 @@ struct sof_ipc_tplg_ops {
|
|||
int (*widget_free)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget);
|
||||
int (*dai_config)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
|
||||
unsigned int flags, struct snd_sof_dai_config_data *data);
|
||||
void (*host_config)(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget,
|
||||
struct snd_sof_platform_stream_params *platform_params);
|
||||
int (*dai_get_param)(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, int param_type);
|
||||
int (*set_up_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
|
||||
int (*tear_down_all_pipelines)(struct snd_sof_dev *sdev, bool verify);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue