aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRanjani Sridharan <[email protected]>2021-11-23 18:57:59 +0200
committerMark Brown <[email protected]>2021-11-24 12:57:11 +0000
commit86f74ba3fef56dd1cee19b7a15ae27fc0da5bb61 (patch)
tree2e0765e56873b1747acb4263a96157776be4fcd3
parent872fc0b6bde8b2dd6891c740cd792d214255dca3 (diff)
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: 0acb48dd31e3 ("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]>
-rw-r--r--sound/soc/sof/intel/hda.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 568d351b7a4e..2c0d4d06ab36 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -58,6 +58,13 @@ int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w)
return -EINVAL;
}
+ /* DAI already configured, reset it before reconfiguring it */
+ if (sof_dai->configured) {
+ ret = hda_ctrl_dai_widget_free(w);
+ if (ret < 0)
+ return ret;
+ }
+
config = &sof_dai->dai_config[sof_dai->current_config];
/*