MLK-17089-1: ASoC: fsl_sai: support suspend & resume for imx8
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 6 Dec 2017 03:40:20 +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_sai.c

index d93b6a0..74062e9 100644 (file)
@@ -1239,37 +1239,11 @@ static int fsl_sai_runtime_suspend(struct device *dev)
 }
 #endif
 
-#ifdef CONFIG_PM_SLEEP
-static int fsl_sai_suspend(struct device *dev)
-{
-       struct fsl_sai *sai = dev_get_drvdata(dev);
-
-       regcache_cache_only(sai->regmap, true);
-       regcache_mark_dirty(sai->regmap);
-
-       return 0;
-}
-
-static int fsl_sai_resume(struct device *dev)
-{
-       struct fsl_sai *sai = dev_get_drvdata(dev);
-       unsigned char offset = sai->soc->reg_offset;
-
-       regcache_cache_only(sai->regmap, false);
-       regmap_write(sai->regmap, FSL_SAI_TCSR(offset), FSL_SAI_CSR_SR);
-       regmap_write(sai->regmap, FSL_SAI_RCSR(offset), FSL_SAI_CSR_SR);
-       usleep_range(1000, 2000);
-       regmap_write(sai->regmap, FSL_SAI_TCSR(offset), 0);
-       regmap_write(sai->regmap, FSL_SAI_RCSR(offset), 0);
-       return regcache_sync(sai->regmap);
-}
-#endif /* CONFIG_PM_SLEEP */
-
 static const struct dev_pm_ops fsl_sai_pm_ops = {
        SET_RUNTIME_PM_OPS(fsl_sai_runtime_suspend,
                           fsl_sai_runtime_resume,
                           NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(fsl_sai_suspend, fsl_sai_resume)
+       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_sai_driver = {