Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294971
b: refs/heads/master
c: eb73251
h: refs/heads/master
i:
  294969: 39bbbb9
  294967: 481e29a
v: v3
  • Loading branch information
Kamil Debski authored and Mauro Carvalho Chehab committed Mar 8, 2012
1 parent 011fa0e commit 74cd6b0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11a37c709797cc56f48905e68a3099b79cf08850
refs/heads/master: eb732518e0db585376f95256b18b2149240e3ad3
24 changes: 22 additions & 2 deletions trunk/drivers/media/video/s5p-mfc/s5p_mfc_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,29 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
pm->clock_gate = clk_get(&dev->plat_dev->dev, MFC_GATE_CLK_NAME);
if (IS_ERR(pm->clock_gate)) {
mfc_err("Failed to get clock-gating control\n");
ret = -ENOENT;
ret = PTR_ERR(pm->clock_gate);
goto err_g_ip_clk;
}

ret = clk_prepare(pm->clock_gate);
if (ret) {
mfc_err("Failed to preapre clock-gating control\n");
goto err_p_ip_clk;
}

pm->clock = clk_get(&dev->plat_dev->dev, MFC_CLKNAME);
if (IS_ERR(pm->clock)) {
mfc_err("Failed to get MFC clock\n");
ret = -ENOENT;
ret = PTR_ERR(pm->clock);
goto err_g_ip_clk_2;
}

ret = clk_prepare(pm->clock);
if (ret) {
mfc_err("Failed to prepare MFC clock\n");
goto err_p_ip_clk_2;
}

atomic_set(&pm->power, 0);
#ifdef CONFIG_PM_RUNTIME
pm->device = &dev->plat_dev->dev;
Expand All @@ -59,15 +73,21 @@ int s5p_mfc_init_pm(struct s5p_mfc_dev *dev)
atomic_set(&clk_ref, 0);
#endif
return 0;
err_p_ip_clk_2:
clk_put(pm->clock);
err_g_ip_clk_2:
clk_unprepare(pm->clock_gate);
err_p_ip_clk:
clk_put(pm->clock_gate);
err_g_ip_clk:
return ret;
}

void s5p_mfc_final_pm(struct s5p_mfc_dev *dev)
{
clk_unprepare(pm->clock_gate);
clk_put(pm->clock_gate);
clk_unprepare(pm->clock);
clk_put(pm->clock);
#ifdef CONFIG_PM_RUNTIME
pm_runtime_disable(pm->device);
Expand Down

0 comments on commit 74cd6b0

Please sign in to comment.