diff options
author | Bard Liao <yung-chuan.liao@linux.intel.com> | 2022-11-08 03:29:10 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-11-09 16:44:20 +0300 |
commit | a2ba1f70b301b366666e739a1f951f57b8af2cce (patch) | |
tree | e03c30bc8027757718796db5ffc46de2453a010d /sound/soc/sof/intel | |
parent | eb2eaf50395a8164f4f9e0021609ddb40ad97e87 (diff) | |
download | linux-a2ba1f70b301b366666e739a1f951f57b8af2cce.tar.xz |
ASoC: SOF: ipc4: get pipeline instance id from pipe_widget->instance_id
Currently we set pipeline instance id = swidget->pipeline_id, but
pipeline_id is from topology and can be any number. In fact, the
number of pipelines is limited. This patch use ida to allocate pipeline
instance id and will be used for pipeline instance id in the IPC
message.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221108002910.2819709-4-yung-chuan.liao@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel')
-rw-r--r-- | sound/soc/sof/intel/hda-dai.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index 0cb7af719c66..1c3d4887aa30 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -478,7 +478,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream, struct snd_sof_widget *pipe_widget = swidget->pipe_widget; struct sof_ipc4_pipeline *pipeline = pipe_widget->private; - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_PAUSED); if (ret < 0) return ret; @@ -487,7 +487,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream, snd_hdac_ext_stream_clear(hext_stream); - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_RESET); if (ret < 0) return ret; @@ -506,7 +506,7 @@ static int ipc4_hda_dai_trigger(struct snd_pcm_substream *substream, struct snd_sof_widget *pipe_widget = swidget->pipe_widget; struct sof_ipc4_pipeline *pipeline = pipe_widget->private; - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_PAUSED); if (ret < 0) return ret; @@ -721,20 +721,20 @@ static int ipc4_be_dai_common_trigger(struct snd_soc_dai *dai, int cmd, int stre switch (cmd) { case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_STOP: - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_PAUSED); if (ret < 0) return ret; pipeline->state = SOF_IPC4_PIPE_PAUSED; - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_RESET); if (ret < 0) return ret; pipeline->state = SOF_IPC4_PIPE_RESET; break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - ret = sof_ipc4_set_pipeline_state(sdev, swidget->pipeline_id, + ret = sof_ipc4_set_pipeline_state(sdev, pipe_widget->instance_id, SOF_IPC4_PIPE_PAUSED); if (ret < 0) return ret; |