Skip to content

Commit 86f74ba

Browse files
ranj063broonie
authored andcommitted
ASoC: SOF: hda: reset DAI widget before reconfiguring it
It is not unusual for ALSA/ASoC hw_params callbacks to be invoked multiple times. Reset and free the DAI widget before reconfiguring it to keep the DAI widget use_count balanced. Fixes: 0acb48d ("ASoC: SOF: Intel: hda: make sure DAI widget is set up before IPC") Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Paul Olaru <[email protected]> Reviewed-by: Bard Liao <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Kai Vehmanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 872fc0b commit 86f74ba

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sound/soc/sof/intel/hda.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w)
5858
return -EINVAL;
5959
}
6060

61+
/* DAI already configured, reset it before reconfiguring it */
62+
if (sof_dai->configured) {
63+
ret = hda_ctrl_dai_widget_free(w);
64+
if (ret < 0)
65+
return ret;
66+
}
67+
6168
config = &sof_dai->dai_config[sof_dai->current_config];
6269

6370
/*

0 commit comments

Comments
 (0)