ASoC: fsl_spdif: Fix unexpected interrupt after suspend
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 22 Jun 2021 12:31:24 +0000 (20:31 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 23 Jun 2021 10:47:43 +0000 (11:47 +0100)
When system enter suspend, the machine driver suspend callback
function will be called, then the cpu driver trigger callback
(SNDRV_PCM_TRIGGER_SUSPEND) be called, it would disable the
interrupt.

But the machine driver suspend and cpu dai driver suspend order
maybe changed, the cpu dai driver's suspend callback is called before
machine driver's suppend callback, then the interrupt is not cleared
successfully in trigger callback.

So need to clear interrupts in cpu dai driver's suspend callback
to avoid such issue.

Fixes: 9cb2b3796e08 ("ASoC: fsl_spdif: Add pm runtime function")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/1624365084-7934-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_spdif.c

index 5636837eb5113e934d1166d5d7f5f8a5964e752d..53499bc71fa9908f007d4bb0919deb916f838525 100644 (file)
@@ -1404,6 +1404,9 @@ static int fsl_spdif_runtime_suspend(struct device *dev)
        struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
        int i;
 
+       /* Disable all the interrupts */
+       regmap_update_bits(spdif_priv->regmap, REG_SPDIF_SIE, 0xffffff, 0);
+
        regmap_read(spdif_priv->regmap, REG_SPDIF_SRPC,
                        &spdif_priv->regcache_srpc);
        regcache_cache_only(spdif_priv->regmap, true);