ssp: mclk/bclk turned off unexpectedly

The implementation does not take the state of both directions into
consideration. If host opens both TX/RX PCM devices then close one PCM
device, the ssp driver will close the mclk/bclk immediately regardless
the state of the other PCM device.

Signed-off-by: Brent Lu <brent.lu@intel.com>
This commit is contained in:
Brent Lu 2021-09-03 17:15:17 +08:00 committed by Liam Girdwood
parent ad402bc5bf
commit 287a5f9a2b
1 changed files with 8 additions and 0 deletions

View File

@ -757,6 +757,14 @@ clk:
}
break;
case SOF_DAI_CONFIG_FLAGS_HW_FREE:
/* disable SSP port if no users */
if (ssp->state[SOF_IPC_STREAM_CAPTURE] != COMP_STATE_PREPARE ||
ssp->state[SOF_IPC_STREAM_PLAYBACK] != COMP_STATE_PREPARE) {
dai_info(dai, "ssp_set_config(): hw_free stage: ignore since there is still user",
dai->index);
break;
}
if (ssp->params.clks_control & SOF_DAI_INTEL_SSP_CLKCTRL_BCLK_ES) {
dai_info(dai, "ssp_set_config(): hw_free stage: releasing BCLK clocks for SSP%d...",
dai->index);