From: Prathyush K Date: Wed, 7 Aug 2013 11:53:04 +0000 (-0300) Subject: [media] exynos-gsc: fix s2r functionality X-Git-Tag: firefly_0821_release~176^2~3573^2~1435 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f9fa906f00388bf326d010f36bc905cbd0b6554f;p=firefly-linux-kernel-4.4.55.git [media] exynos-gsc: fix s2r functionality When gsc is in runtime suspended state, there is no need to call m2m_suspend during suspend and similarly, there is no need to call m2m_resume during resume if already in runtime suspended state. This patch adds the necessary conditions to achieve this. Signed-off-by: Prathyush K Signed-off-by: Arun Mankuzhi Signed-off-by: Arun Kumar K Signed-off-by: Sylwester Nawrocki Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 559fab2a2d67..fe69eaeb907a 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1210,12 +1210,12 @@ static int gsc_resume(struct device *dev) spin_unlock_irqrestore(&gsc->slock, flags); return 0; } - gsc_hw_set_sw_reset(gsc); - gsc_wait_reset(gsc); - spin_unlock_irqrestore(&gsc->slock, flags); - return gsc_m2m_resume(gsc); + if (!pm_runtime_suspended(dev)) + return gsc_runtime_resume(dev); + + return 0; } static int gsc_suspend(struct device *dev) @@ -1227,7 +1227,10 @@ static int gsc_suspend(struct device *dev) if (test_and_set_bit(ST_SUSPEND, &gsc->state)) return 0; - return gsc_m2m_suspend(gsc); + if (!pm_runtime_suspended(dev)) + return gsc_runtime_suspend(dev); + + return 0; } static const struct dev_pm_ops gsc_pm_ops = {