Skip to content

Commit

Permalink
drm/exynos: consider common clock framework to g2d driver.
Browse files Browse the repository at this point in the history
This patch just changes clk_enable/disable to
clk_prepare_enable/clk_disable_unprepare, and
adds related exception codes.

Signed-off-by: Inki Dae <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
  • Loading branch information
daeinki committed Jul 29, 2013
1 parent de1d367 commit 89f8b85
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,9 +806,20 @@ static void g2d_dma_start(struct g2d_data *g2d,
struct g2d_cmdlist_node *node =
list_first_entry(&runqueue_node->run_cmdlist,
struct g2d_cmdlist_node, list);
int ret;

ret = pm_runtime_get_sync(g2d->dev);
if (ret < 0) {
dev_warn(g2d->dev, "failed pm power on.\n");
return;
}

pm_runtime_get_sync(g2d->dev);
clk_enable(g2d->gate_clk);
ret = clk_prepare_enable(g2d->gate_clk);
if (ret < 0) {
dev_warn(g2d->dev, "failed to enable clock.\n");
pm_runtime_put_sync(g2d->dev);
return;
}

writel_relaxed(node->dma_addr, g2d->regs + G2D_DMA_SFR_BASE_ADDR);
writel_relaxed(G2D_DMA_START, g2d->regs + G2D_DMA_COMMAND);
Expand Down Expand Up @@ -861,7 +872,7 @@ static void g2d_runqueue_worker(struct work_struct *work)
runqueue_work);

mutex_lock(&g2d->runqueue_mutex);
clk_disable(g2d->gate_clk);
clk_disable_unprepare(g2d->gate_clk);
pm_runtime_put_sync(g2d->dev);

complete(&g2d->runqueue_node->complete);
Expand Down

0 comments on commit 89f8b85

Please sign in to comment.