1
0
Fork 0

MLK-18979-2: ASoC: fsl_asrc: add initial check in resume

If the initialization is not finished, then we input data to
the FIFO will fail, which still cause the error

"output dma task timeout"

So we need to ad initial check in the resume.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
pull/10/head
Shengjiu Wang 2018-09-05 16:48:33 +08:00 committed by Jason Liu
parent 7268718ae3
commit 7a97b10d79
1 changed files with 9 additions and 0 deletions

View File

@ -1234,6 +1234,8 @@ static int fsl_asrc_runtime_resume(struct device *dev)
struct fsl_asrc *asrc_priv = dev_get_drvdata(dev);
int i, ret;
u32 asrctr;
u32 reg;
int retry = 10;
ret = clk_prepare_enable(asrc_priv->mem_clk);
if (ret)
@ -1270,6 +1272,13 @@ static int fsl_asrc_runtime_resume(struct device *dev)
regmap_update_bits(asrc_priv->regmap, REG_ASRCTR,
ASRCTR_ASRCEi_ALL_MASK, asrctr);
/* Wait for status of initialization */
do {
udelay(5);
regmap_read(asrc_priv->regmap, REG_ASRCFG, &reg);
reg = (reg >> ASRCFG_INIRQi_SHIFT(0)) & 0x7;
} while (!(reg == ((asrctr & 0xE) >> 1)) && --retry);
return 0;
disable_asrck_clk: