ASoC: fsl_micfil: explicitly clear CHnF flags
authorShengjiu Wang <shengjiu.wang@nxp.com>
Sat, 7 May 2022 12:14:14 +0000 (20:14 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 11 May 2022 16:42:54 +0000 (17:42 +0100)
There may be failure when start 1 channel recording after
8 channels recording. The reason is that the CHnF
flags are not cleared successfully by software reset.

This issue is triggerred by the change of clearing
software reset bit.

CHnF flags are write 1 clear bits. Clear them by force
write.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1651925654-32060-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_micfil.c

index cb84d95..d1cd104 100644 (file)
@@ -202,6 +202,14 @@ static int fsl_micfil_reset(struct device *dev)
        if (ret)
                return ret;
 
+       /*
+        * Set SRES should clear CHnF flags, But even add delay here
+        * the CHnF may not be cleared sometimes, so clear CHnF explicitly.
+        */
+       ret = regmap_write_bits(micfil->regmap, REG_MICFIL_STAT, 0xFF, 0xFF);
+       if (ret)
+               return ret;
+
        return 0;
 }