Commit 0557864e authored by Bard Liao's avatar Bard Liao Committed by Mark Brown

ASoC: SOF: sof-audio: test virtual widget in sof_walk_widgets_in_order

Virtual widgets are added for the purpose of showing connections between
aggregated DAIs in SDW topologies. However, we shouldn't touch them in
SOF.
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20230616100039.378150-3-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 90ce7538
...@@ -396,6 +396,9 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg ...@@ -396,6 +396,9 @@ sof_unprepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widg
const struct sof_ipc_tplg_widget_ops *widget_ops; const struct sof_ipc_tplg_widget_ops *widget_ops;
struct snd_soc_dapm_path *p; struct snd_soc_dapm_path *p;
if (is_virtual_widget(sdev, widget, __func__))
return;
/* skip if the widget is in use or if it is already unprepared */ /* skip if the widget is in use or if it is already unprepared */
if (!swidget || !swidget->prepared || swidget->use_count > 0) if (!swidget || !swidget->prepared || swidget->use_count > 0)
goto sink_unprepare; goto sink_unprepare;
...@@ -433,6 +436,9 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget ...@@ -433,6 +436,9 @@ sof_prepare_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dapm_widget
struct snd_soc_dapm_path *p; struct snd_soc_dapm_path *p;
int ret; int ret;
if (is_virtual_widget(sdev, widget, __func__))
return 0;
widget_ops = tplg_ops ? tplg_ops->widget : NULL; widget_ops = tplg_ops ? tplg_ops->widget : NULL;
if (!widget_ops) if (!widget_ops)
return 0; return 0;
...@@ -488,6 +494,9 @@ static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dap ...@@ -488,6 +494,9 @@ static int sof_free_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_dap
int err; int err;
int ret = 0; int ret = 0;
if (is_virtual_widget(sdev, widget, __func__))
return 0;
if (widget->dobj.private) { if (widget->dobj.private) {
err = sof_widget_free(sdev, widget->dobj.private); err = sof_widget_free(sdev, widget->dobj.private);
if (err < 0) if (err < 0)
...@@ -527,6 +536,9 @@ static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_d ...@@ -527,6 +536,9 @@ static int sof_set_up_widgets_in_path(struct snd_sof_dev *sdev, struct snd_soc_d
struct snd_soc_dapm_path *p; struct snd_soc_dapm_path *p;
int ret; int ret;
if (is_virtual_widget(sdev, widget, __func__))
return 0;
if (swidget) { if (swidget) {
int i; int i;
...@@ -592,6 +604,9 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, ...@@ -592,6 +604,9 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm,
return 0; return 0;
for_each_dapm_widgets(list, i, widget) { for_each_dapm_widgets(list, i, widget) {
if (is_virtual_widget(sdev, widget, __func__))
continue;
/* starting widget for playback is AIF type */ /* starting widget for playback is AIF type */
if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in) if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment