LF-3819: ASoC: fsl_spdif: Fix unexpected interrupt after suspend
authorShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 21 May 2021 04:57:17 +0000 (12:57 +0800)
committerJason Liu <jason.hui.liu@nxp.com>
Sun, 23 May 2021 02:03:13 +0000 (10:03 +0800)
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, the interrupt should be
disabled

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.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Reviewed-by: Viorel Suman <viorel.suman@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
sound/soc/fsl/fsl_spdif.c

index 35ac6ed..781ce88 100644 (file)
@@ -1634,6 +1634,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);