drm/exynos: gsc: fix system and runtime pm integration

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>
This commit is contained in:
Marek Szyprowski 2016-08-31 14:55:55 +02:00 коммит произвёл Inki Dae
Родитель 479f125454
Коммит 83bd7b20aa
1 изменённых файлов: 2 добавлений и 27 удалений

Просмотреть файл

@ -1760,32 +1760,6 @@ static int gsc_remove(struct platform_device *pdev)
return 0;
}
#ifdef CONFIG_PM_SLEEP
static int gsc_suspend(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (pm_runtime_suspended(dev))
return 0;
return gsc_clk_ctrl(ctx, false);
}
static int gsc_resume(struct device *dev)
{
struct gsc_context *ctx = get_gsc_context(dev);
DRM_DEBUG_KMS("id[%d]\n", ctx->id);
if (!pm_runtime_suspended(dev))
return gsc_clk_ctrl(ctx, true);
return 0;
}
#endif
#ifdef CONFIG_PM
static int gsc_runtime_suspend(struct device *dev)
{
@ -1807,7 +1781,8 @@ static int gsc_runtime_resume(struct device *dev)
#endif
static const struct dev_pm_ops gsc_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(gsc_suspend, gsc_resume)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(gsc_runtime_suspend, gsc_runtime_resume, NULL)
};