From 94056cf8c7fd16f6a42d929b5023f2dd8a59d7ad Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Wed, 6 Dec 2017 11:40:20 +0800 Subject: [PATCH] MLK-17089-1: ASoC: fsl_sai: support suspend & resume for imx8 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 (cherry picked from commit 6398e9efcae3a2aa102689797c9b63e260a06cdd) --- sound/soc/fsl/fsl_sai.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index e1db16722fac..febc6127d8cb 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -1610,37 +1610,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 = { -- 2.17.1