From 36eb638d2d917f22c3a82464ecffa770551e439e Mon Sep 17 00:00:00 2001 From: Sugar Zhang Date: Fri, 7 Jul 2023 16:22:03 +0800 Subject: [PATCH] ASoC: rockchip: sai: Use generic pm_runtime_force_* for system PM This patch use the generic pm_runtime_force_* API for system PM, because both of them do the same action. let's make it implemented with runtime PM. Ref: commit 37f204164dfb ("PM: Add pm_runtime_suspend|resume_force functions") Signed-off-by: Sugar Zhang Change-Id: Ice5057ca5cdf8999990283a99921b7b6a30cd557 --- sound/soc/rockchip/rockchip_sai.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c index 3e50ba0e12f0..b62e5ed19509 100644 --- a/sound/soc/rockchip/rockchip_sai.c +++ b/sound/soc/rockchip/rockchip_sai.c @@ -1432,33 +1432,9 @@ static int rockchip_sai_remove(struct platform_device *pdev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int rockchip_sai_suspend(struct device *dev) -{ - struct rk_sai_dev *sai = dev_get_drvdata(dev); - - regcache_mark_dirty(sai->regmap); - - return 0; -} - -static int rockchip_sai_resume(struct device *dev) -{ - struct rk_sai_dev *sai = dev_get_drvdata(dev); - int ret = pm_runtime_resume_and_get(dev); - - if (ret < 0) - return ret; - ret = regcache_sync(sai->regmap); - pm_runtime_put(dev); - - return ret; -} -#endif /* CONFIG_PM_SLEEP */ - static const struct dev_pm_ops rockchip_sai_pm_ops = { SET_RUNTIME_PM_OPS(rockchip_sai_runtime_suspend, rockchip_sai_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(rockchip_sai_suspend, rockchip_sai_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; static struct platform_driver rockchip_sai_driver = {