Skip to content

Commit

Permalink
drm/exynos: rotator: fix system and runtime pm integration
Browse files Browse the repository at this point in the history
Use generic helpers instead of open-coding usage of runtime pm for system
sleep pm, which was potentially broken for some corner cases.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Marek Szyprowski authored and Inki Dae committed Sep 18, 2016
1 parent 83bd7b2 commit 5b67723
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions drivers/gpu/drm/exynos/exynos_drm_rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,29 +794,6 @@ static int rotator_clk_crtl(struct rot_context *rot, bool enable)
return 0;
}


#ifdef CONFIG_PM_SLEEP
static int rotator_suspend(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);

if (pm_runtime_suspended(dev))
return 0;

return rotator_clk_crtl(rot, false);
}

static int rotator_resume(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);

if (!pm_runtime_suspended(dev))
return rotator_clk_crtl(rot, true);

return 0;
}
#endif

static int rotator_runtime_suspend(struct device *dev)
{
struct rot_context *rot = dev_get_drvdata(dev);
Expand All @@ -833,7 +810,8 @@ static int rotator_runtime_resume(struct device *dev)
#endif

static const struct dev_pm_ops rotator_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(rotator_suspend, rotator_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(rotator_runtime_suspend, rotator_runtime_resume,
NULL)
};
Expand Down

0 comments on commit 5b67723

Please sign in to comment.