MLK-17089-2: ASoC: fsl_esai: support suspend & resume for imx8
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 6 Dec 2017 03:40:31 +0000 (11:40 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:15 +0000 (14:50 -0500)
Base on latest power management design in MLK-17074, every driver
need to enter runtime suspend state in suspend, so the driver should
call the pm_runtime_force_suspend in suspend. with this implementation
the suspend function almost same as runtime suspend function. so remove
the suspend function, just use pm_runtime_force_suspend instead.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
sound/soc/fsl/fsl_esai.c

index baa998c..085be9c 100644 (file)
@@ -1226,48 +1226,11 @@ static int fsl_esai_runtime_suspend(struct device *dev)
 }
 #endif
 
-
-#ifdef CONFIG_PM_SLEEP
-static int fsl_esai_suspend(struct device *dev)
-{
-       struct fsl_esai *esai = dev_get_drvdata(dev);
-
-       regcache_cache_only(esai->regmap, true);
-       regcache_mark_dirty(esai->regmap);
-
-       return 0;
-}
-
-static int fsl_esai_resume(struct device *dev)
-{
-       struct fsl_esai *esai = dev_get_drvdata(dev);
-       int ret;
-
-       regcache_cache_only(esai->regmap, false);
-
-       /* FIFO reset for safety */
-       regmap_update_bits(esai->regmap, REG_ESAI_TFCR,
-                          ESAI_xFCR_xFR, ESAI_xFCR_xFR);
-       regmap_update_bits(esai->regmap, REG_ESAI_RFCR,
-                          ESAI_xFCR_xFR, ESAI_xFCR_xFR);
-
-       ret = regcache_sync(esai->regmap);
-       if (ret)
-               return ret;
-
-       /* FIFO reset done */
-       regmap_update_bits(esai->regmap, REG_ESAI_TFCR, ESAI_xFCR_xFR, 0);
-       regmap_update_bits(esai->regmap, REG_ESAI_RFCR, ESAI_xFCR_xFR, 0);
-
-       return 0;
-}
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops fsl_esai_pm_ops = {
        SET_RUNTIME_PM_OPS(fsl_esai_runtime_suspend,
                           fsl_esai_runtime_resume,
                           NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(fsl_esai_suspend, fsl_esai_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_esai_driver = {