Skip to content

Commit

Permalink
Merge pull request #9 from zehome/odroid-3.0.y
Browse files Browse the repository at this point in the history
Fix S5P-MFC compilation when PM is disabled.
  • Loading branch information
hardkernel committed Jan 15, 2013
2 parents e3f30a5 + 365ad64 commit 8c45d09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/media/video/s5p-mfc/s5p_mfc_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ void s5p_mfc_final_pm(struct s5p_mfc_dev *dev)
int s5p_mfc_clock_on(void)
{
int ret;
#ifdef CONFIG_PM_RUNTIME
struct s5p_mfc_dev *dev = platform_get_drvdata(to_platform_device(pm->device));
#endif

atomic_inc(&clk_ref);

Expand All @@ -110,23 +112,28 @@ int s5p_mfc_clock_on(void)
#endif

ret = clk_enable(pm->clock);
#ifdef CONFIG_PM_RUNTIME
if (atomic_read(&clk_ref) == 1)
s5p_mfc_mem_resume(dev->alloc_ctx[0]);

#endif
return ret;
}

void s5p_mfc_clock_off(void)
{
#ifdef CONFIG_PM_RUNTIME
struct s5p_mfc_dev *dev = platform_get_drvdata(to_platform_device(pm->device));
#endif

atomic_dec(&clk_ref);
#ifdef CLK_DEBUG
mfc_debug(3, "- %d", atomic_read(&clk_ref));
#endif

#ifdef CONFIG_PM_RUNTIME
if (atomic_read(&clk_ref) == 0)
s5p_mfc_mem_suspend(dev->alloc_ctx[0]);
#endif
clk_disable(pm->clock);
}

Expand Down

0 comments on commit 8c45d09

Please sign in to comment.