Skip to content

Commit

Permalink
ASoC: SOF: hda: reset DAI widget before reconfiguring it
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ranj063 authored and broonie committed Nov 24, 2021
1 parent 872fc0b commit 86f74ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

/*
Expand Down

0 comments on commit 86f74ba

Please sign in to comment.