[media] exynos-gsc: Do full clock gating at runtime PM suspend
authorUlf Hansson <ulf.hansson@linaro.org>
Wed, 9 Nov 2016 14:23:55 +0000 (12:23 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 16 Nov 2016 18:33:09 +0000 (16:33 -0200)
To potentially save more power in runtime PM suspend state, let's
also prepare/unprepare the clock from the runtime PM callbacks.

[mszyprow: rebased onto v4.9-rc4]

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/exynos-gsc/gsc-core.c

index e627653288489931ca3fff805e927ef4e836d07d..3ac588f5c558ba1c50a9c3c595283e2ae6b6b8d5 100644 (file)
@@ -1154,7 +1154,7 @@ static int gsc_runtime_resume(struct device *dev)
 
        pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
 
-       ret = clk_enable(gsc->clock);
+       ret = clk_prepare_enable(gsc->clock);
        if (ret)
                return ret;
 
@@ -1172,7 +1172,7 @@ static int gsc_runtime_suspend(struct device *dev)
 
        ret = gsc_m2m_suspend(gsc);
        if (!ret)
-               clk_disable(gsc->clock);
+               clk_disable_unprepare(gsc->clock);
 
        pr_debug("gsc%d: state: 0x%lx", gsc->id, gsc->state);
        return ret;