From 5f93ad4729ee441b29474ea2cc7ad2e377ff81bc Mon Sep 17 00:00:00 2001 From: Iuliana Prodan Date: Fri, 5 Mar 2021 19:06:37 +0200 Subject: [PATCH] drivers: imx: sai: W1C for a clean start On start W1C the Work Start Flag, Sync Error Flag and FIFO Error Flag. Write a logic 1 to this field to clear each of this flags and have a clean start for SAI. Signed-off-by: Iuliana Prodan --- src/drivers/imx/sai.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/drivers/imx/sai.c b/src/drivers/imx/sai.c index 28f97c36f..6ea552106 100644 --- a/src/drivers/imx/sai.c +++ b/src/drivers/imx/sai.c @@ -66,6 +66,14 @@ static void sai_start(struct dai *dai, int direction) } } + /* W1C */ + dai_update_bits(dai, REG_SAI_XCSR(direction), + REG_SAI_CSR_FEF, 1); + dai_update_bits(dai, REG_SAI_XCSR(direction), + REG_SAI_CSR_SEF, 1); + dai_update_bits(dai, REG_SAI_XCSR(direction), + REG_SAI_CSR_WSF, 1); + /* add one word to FIFO before TRCE is enabled */ if (direction == DAI_DIR_PLAYBACK) dai_write(dai, REG_SAI_TDR0, 0x0);