From: Shengjiu Wang Date: Fri, 21 May 2021 04:57:17 +0000 (+0800) Subject: LF-3819: ASoC: fsl_spdif: Fix unexpected interrupt after suspend X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~70 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=5cb5dd5a8c51e14aa97580e8b81cbceb7aab829a;p=linux.git LF-3819: ASoC: fsl_spdif: Fix unexpected interrupt after suspend 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 Reviewed-by: Viorel Suman Acked-by: Jason Liu --- diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 35ac6edcf6ac..781ce88ff663 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -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);