Skip to content

Commit 8a47c3b

Browse files
ranj063mwasko
authored andcommitted
drivers: Intel: SSP: ignore config when SSP is already configured
When two streams are started one after the other, 2 DAI_CONFIG IPC's will be sent before the START trigger. This ends up configuring the SSP when the first one has already just configured it and ends up with xruns. The root cause is that the ssp_set_config() function configures a set of variables, writes those variables into SSP registers, and later on does a read-modify-write operation on the TSRE, RSRE and SSE bits. If the ssp_set_config is executed more than once, this will temporarily clear all three bitfields, and temporarily disable DMA transfers and SSP clocks. Avoid this by checking if the current state is > COMP_STATE_READY before configuring the SSP, so that the ssp_set_config() function only modifies SSP registers once. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Brent Lu <brent.lu@intel.com>
1 parent 80a7795 commit 8a47c3b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • src/drivers/intel/ssp

src/drivers/intel/ssp/ssp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ static int ssp_set_config(struct dai *dai,
267267

268268
spin_lock(&dai->lock);
269269

270-
/* is playback/capture already running */
271-
if (ssp->state[DAI_DIR_PLAYBACK] == COMP_STATE_ACTIVE ||
272-
ssp->state[DAI_DIR_CAPTURE] == COMP_STATE_ACTIVE) {
273-
dai_info(dai, "ssp_set_config(): playback/capture active. Ignore config");
270+
/* ignore config if SSP is already configured */
271+
if (ssp->state[DAI_DIR_PLAYBACK] > COMP_STATE_READY ||
272+
ssp->state[DAI_DIR_CAPTURE] > COMP_STATE_READY) {
273+
dai_info(dai, "ssp_set_config(): Already configured. Ignore config");
274274
goto out;
275275
}
276276

0 commit comments

Comments
 (0)