ssp: move initialisation delay to .get_init_delay()

Implement BCLK initialisation delay using the .get_init_delay()
operation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2021-08-04 16:28:22 +02:00 committed by Liam Girdwood
parent e7dc749abb
commit 6578f5264c
1 changed files with 11 additions and 7 deletions

View File

@ -969,13 +969,6 @@ static void ssp_early_start(struct dai *dai, int direction)
dai_info(dai, "ssp_early_start(): SSE set for SSP%d", dai->index);
}
if (ssp->params.bclk_delay) {
/* drive BCLK early for guaranteed time,
* before first FSYNC, it is required by some codecs
*/
wait_delay(clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK,
ssp->params.bclk_delay));
}
spin_unlock(&dai->lock);
}
@ -1182,6 +1175,16 @@ static int ssp_get_fifo(struct dai *dai, int direction, int stream_id)
return dai->plat_data.fifo[direction].offset;
}
static uint32_t ssp_get_init_delay_ms(struct dai *dai)
{
struct ssp_pdata *ssp = dai_get_drvdata(dai);
/* drive BCLK early for guaranteed time,
* before first FSYNC, it is required by some codecs
*/
return ssp->params.bclk_delay;
}
const struct dai_driver ssp_driver = {
.type = SOF_DAI_INTEL_SSP,
.uid = SOF_UUID(ssp_uuid),
@ -1196,6 +1199,7 @@ const struct dai_driver ssp_driver = {
.get_hw_params = ssp_get_hw_params,
.get_handshake = ssp_get_handshake,
.get_fifo = ssp_get_fifo,
.get_init_delay_ms = ssp_get_init_delay_ms,
.probe = ssp_probe,
.remove = ssp_remove,
},