drm/exynos: fimd: clean up pm suspend/resume
Subsystems (3)
Inki Dae
maintainerPATCH 1/1 drm/exynos: fimd: clean up pm suspend/resume
This patch removes unnecessary runtime pm related function calls from fimd_suspend and fimd_resume functions.
Signed-off-by Inki Dae <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 38 +++++++++--------------------- 1 file changed, 11 insertions(+), 27 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +11 -27
@@ -1003,41 +1003,25 @@ static int fimd_suspend(struct device *dev) {struct fimd_context *ctx =get_fimd_context (dev); -/* -* do not use pm_runtime_suspend(). if pm_runtime_suspend() is -* called here, an error would be returned by that interface -* because the usage_count of pm runtime is more than 1. -*/ -if (!pm_runtime_suspended (dev)) -return fimd_activate (ctx, false); - -return 0 ; +return fimd_activate (ctx, false); }static int fimd_resume (struct device *dev) {struct fimd_context *ctx =get_fimd_context (dev); +int ret; + + ret =fimd_activate (ctx, true); +if (ret <0 ) +return ret;/* -* if entered to sleep when lcd panel was on, the usage_count -* of pm runtime would still be 1 so in this case, fimd driver -* should be on directly not drawing on pm runtime interface. +* in case of dpms on(standby), fimd_apply function will +* be called by encoder's dpms callback to update fimd's +* registers but in case of sleep wakeup, it's not. +* so fimd_apply function should be called at here. */ -if (!pm_runtime_suspended (dev)) { -int ret; - - ret =fimd_activate (ctx, true); -if (ret <0 ) -return ret; - -/* -* in case of dpms on(standby), fimd_apply function will -* be called by encoder's dpms callback to update fimd's -* registers but in case of sleep wakeup, it's not. -* so fimd_apply function should be called at here. -*/ -fimd_apply (dev); - } +fimd_apply (dev);return 0 ; }
Signature · 1 line
1.7.9.5
Inki Dae
maintainerPATCH v2 1/1 drm/exynos: fimd: clean up pm suspend/resume
This patch removes unnecessary runtime pm related function calls from fimd_suspend and fimd_resume functions.
Changelog v2:
- use UNIVERSAL_DEV_PM_OPS macro instead.
Signed-off-by Inki Dae <[email protected]>
Signed-off-by Kyungmin Park <[email protected]>
--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 59 ++++++------------------------ 1 file changed, 12 insertions(+), 47 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +12 -47
@@ -1003,66 +1003,31 @@ static int fimd_suspend(struct device *dev) {struct fimd_context *ctx =get_fimd_context (dev); -/* -* do not use pm_runtime_suspend(). if pm_runtime_suspend() is -* called here, an error would be returned by that interface -* because the usage_count of pm runtime is more than 1. -*/ -if (!pm_runtime_suspended (dev)) -return fimd_activate (ctx, false); - -return 0 ; +return fimd_activate (ctx, false); }static int fimd_resume (struct device *dev) {struct fimd_context *ctx =get_fimd_context (dev); +int ret; + + ret =fimd_activate (ctx, true); +if (ret <0 ) +return ret;/* -* if entered to sleep when lcd panel was on, the usage_count -* of pm runtime would still be 1 so in this case, fimd driver -* should be on directly not drawing on pm runtime interface. +* in case of dpms on(standby), fimd_apply function will +* be called by encoder's dpms callback to update fimd's +* registers but in case of sleep wakeup, it's not. +* so fimd_apply function should be called at here. */ -if (!pm_runtime_suspended (dev)) { -int ret; - - ret =fimd_activate (ctx, true); -if (ret <0 ) -return ret; - -/* -* in case of dpms on(standby), fimd_apply function will -* be called by encoder's dpms callback to update fimd's -* registers but in case of sleep wakeup, it's not. -* so fimd_apply function should be called at here. -*/ -fimd_apply (dev); - } +fimd_apply (dev);return 0 ; }#endif -#ifdef CONFIG_PM_RUNTIME -static int fimd_runtime_suspend (struct device *dev) -{ -struct fimd_context *ctx =get_fimd_context (dev); - -return fimd_activate (ctx, false); -} - -static int fimd_runtime_resume (struct device *dev) -{ -struct fimd_context *ctx =get_fimd_context (dev); - -return fimd_activate (ctx, true); -} -#endif - -static const struct dev_pm_ops fimd_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(fimd_suspend, fimd_resume) -SET_RUNTIME_PM_OPS (fimd_runtime_suspend, fimd_runtime_resume,NULL ) -}; +UNIVERSAL_DEV_PM_OPS (fimd_pm_ops, fimd_suspend, fimd_resume,NULL );struct platform_driver fimd_driver = { .probe = fimd_probe,
Signature · 1 line
1.7.9.5