aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/sof/sof-audio.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2022-04-26 10:17:38 -0700
committerMark Brown <broonie@kernel.org>2022-04-29 13:06:00 +0100
commitd77d7795547ae8e2ed23d1ce835b539ee1d794bb (patch)
treed2910ace5f0021c013508eac1223af862fde943a /sound/soc/sof/sof-audio.c
parentASoC: SOF: expose a couple of functions (diff)
downloadwireguard-linux-d77d7795547ae8e2ed23d1ce835b539ee1d794bb.tar.xz
wireguard-linux-d77d7795547ae8e2ed23d1ce835b539ee1d794bb.zip
ASoC: SOF: Add a route_free op in struct sof_ipc_tplg_ops
IPC4 requires that the widgets be unbound in the firmware before they are freed. So add a new op in struct sof_ipc_tplg_ops that will be used to send the IPC to the firmware to unbind widgets. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20220426171743.171061-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/sof-audio.c')
-rw-r--r--sound/soc/sof/sof-audio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index 6e43f1a55406..b2da078a1641 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -14,11 +14,16 @@
static void sof_reset_route_setup_status(struct snd_sof_dev *sdev, struct snd_sof_widget *widget)
{
+ const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
struct snd_sof_route *sroute;
list_for_each_entry(sroute, &sdev->route_list, list)
- if (sroute->src_widget == widget || sroute->sink_widget == widget)
+ if (sroute->src_widget == widget || sroute->sink_widget == widget) {
+ if (sroute->setup && tplg_ops->route_free)
+ tplg_ops->route_free(sdev, sroute);
+
sroute->setup = false;
+ }
}
int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget)