Skip to content

Commit

Permalink
drm/exynos: enable FIMD clocks
Browse files Browse the repository at this point in the history
Common Clock Framework introduced the need to prepare clocks before
enabling them, otherwise clk_enable() fails. This patch adds clk_prepare_enable
and clk_disable_unprepare() calls to the driver.
This patch also removes clk_disable() from fimd_remove() as it will be done
by pm_runtime_put_sync.

Signed-off-by: Vikas Sajjan <vikas.sajjan@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Vikas Sajjan authored and Inki Dae committed Apr 29, 2013
1 parent baa88c8 commit 11963a6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,18 +801,18 @@ static int fimd_clock(struct fimd_context *ctx, bool enable)
if (enable) {
int ret;

ret = clk_enable(ctx->bus_clk);
ret = clk_prepare_enable(ctx->bus_clk);
if (ret < 0)
return ret;

ret = clk_enable(ctx->lcd_clk);
ret = clk_prepare_enable(ctx->lcd_clk);
if (ret < 0) {
clk_disable(ctx->bus_clk);
clk_disable_unprepare(ctx->bus_clk);
return ret;
}
} else {
clk_disable(ctx->lcd_clk);
clk_disable(ctx->bus_clk);
clk_disable_unprepare(ctx->lcd_clk);
clk_disable_unprepare(ctx->bus_clk);
}

return 0;
Expand Down Expand Up @@ -996,9 +996,6 @@ static int fimd_remove(struct platform_device *pdev)
if (ctx->suspended)
goto out;

clk_disable(ctx->lcd_clk);
clk_disable(ctx->bus_clk);

pm_runtime_set_suspended(dev);
pm_runtime_put_sync(dev);

Expand Down

0 comments on commit 11963a6

Please sign in to comment.