mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
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 37f204164d ("PM: Add pm_runtime_suspend|resume_force functions")
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ice5057ca5cdf8999990283a99921b7b6a30cd557
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user