summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_asrc.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2018-09-05 16:48:33 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:48:34 +0800
commit46bc9e9ca542b03a8ed6c238f90d85f289231677 (patch)
treeb1a954ad7fb21bfe660d01401628681084ef6ec8 /sound/soc/fsl/fsl_asrc.c
parente0e7942c70746e9487cab9a751b825d0e7ddba30 (diff)
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>
Diffstat (limited to 'sound/soc/fsl/fsl_asrc.c')
-rw-r--r--sound/soc/fsl/fsl_asrc.c9
1 files changed, 9 insertions, 0 deletions
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 = (reg >> ASRCFG_INIRQi_SHIFT(0)) & 0x7;
+ } while (!(reg == ((asrctr & 0xE) >> 1)) && --retry);
+
return 0;
disable_asrck_clk: