From 46bc9e9ca542b03a8ed6c238f90d85f289231677 Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Wed, 5 Sep 2018 16:48:33 +0800 Subject: 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 --- sound/soc/fsl/fsl_asrc.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sound/soc/fsl/fsl_asrc.c') diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index c1db84d6756a..64c8c370bd89 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -1149,6 +1149,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) @@ -1185,6 +1187,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 >> ASRCFG_INIRQi_SHIFT(0)) & 0x7; + } while (!(reg == ((asrctr & 0xE) >> 1)) && --retry); + return 0; disable_asrck_clk: -- cgit v1.2.3