diff options
Diffstat (limited to 'drivers/mxc/ipu3/ipu_disp.c')
-rw-r--r-- | drivers/mxc/ipu3/ipu_disp.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/mxc/ipu3/ipu_disp.c b/drivers/mxc/ipu3/ipu_disp.c index bc417abb6723..23fe511c8479 100644 --- a/drivers/mxc/ipu3/ipu_disp.c +++ b/drivers/mxc/ipu3/ipu_disp.c @@ -1665,8 +1665,7 @@ int32_t ipu_disp_set_global_alpha(ipu_channel_t channel, bool enable, else bg_chan = false; - if (!g_ipu_clk_enabled) - clk_enable(g_ipu_clk); + ipu_get_clk(false); spin_lock_irqsave(&ipu_lock, lock_flags); if (bg_chan) { @@ -1693,8 +1692,7 @@ int32_t ipu_disp_set_global_alpha(ipu_channel_t channel, bool enable, __raw_writel(reg, IPU_SRM_PRI2); spin_unlock_irqrestore(&ipu_lock, lock_flags); - if (!g_ipu_clk_enabled) - clk_disable(g_ipu_clk); + ipu_put_clk(); return 0; } @@ -1728,9 +1726,7 @@ int32_t ipu_disp_set_color_key(ipu_channel_t channel, bool enable, else return -EINVAL; - if (!g_ipu_clk_enabled) - clk_enable(g_ipu_clk); - + ipu_get_clk(false); spin_lock_irqsave(&ipu_lock, lock_flags); color_key_4rgb = 1; @@ -1771,8 +1767,7 @@ int32_t ipu_disp_set_color_key(ipu_channel_t channel, bool enable, __raw_writel(reg, IPU_SRM_PRI2); spin_unlock_irqrestore(&ipu_lock, lock_flags); - if (!g_ipu_clk_enabled) - clk_disable(g_ipu_clk); + ipu_put_clk(); return 0; } @@ -1805,8 +1800,7 @@ int32_t ipu_disp_set_gamma_correction(ipu_channel_t channel, bool enable, int co else return -EINVAL; - if (!g_ipu_clk_enabled) - clk_enable(g_ipu_clk); + ipu_get_clk(false); spin_lock_irqsave(&ipu_lock, lock_flags); for (i = 0; i < 8; i++) @@ -1829,8 +1823,7 @@ int32_t ipu_disp_set_gamma_correction(ipu_channel_t channel, bool enable, int co __raw_writel(reg, IPU_SRM_PRI2); spin_unlock_irqrestore(&ipu_lock, lock_flags); - if (!g_ipu_clk_enabled) - clk_disable(g_ipu_clk); + ipu_put_clk(); return 0; } @@ -1870,9 +1863,7 @@ int32_t ipu_disp_set_window_pos(ipu_channel_t channel, int16_t x_pos, } else return -EINVAL; - if (!g_ipu_clk_enabled) - clk_enable(g_ipu_clk); - + ipu_get_clk(false); spin_lock_irqsave(&ipu_lock, lock_flags); __raw_writel((x_pos << 16) | y_pos, DP_FG_POS(flow)); @@ -1889,8 +1880,7 @@ int32_t ipu_disp_set_window_pos(ipu_channel_t channel, int16_t x_pos, } spin_unlock_irqrestore(&ipu_lock, lock_flags); - if (!g_ipu_clk_enabled) - clk_disable(g_ipu_clk); + ipu_put_clk(); return 0; } @@ -1912,8 +1902,7 @@ int32_t ipu_disp_get_window_pos(ipu_channel_t channel, int16_t *x_pos, else return -EINVAL; - if (!g_ipu_clk_enabled) - clk_enable(g_ipu_clk); + ipu_get_clk(false); spin_lock_irqsave(&ipu_lock, lock_flags); reg = __raw_readl(DP_FG_POS(flow)); @@ -1922,8 +1911,7 @@ int32_t ipu_disp_get_window_pos(ipu_channel_t channel, int16_t *x_pos, *y_pos = reg & 0x7FF; spin_unlock_irqrestore(&ipu_lock, lock_flags); - if (!g_ipu_clk_enabled) - clk_disable(g_ipu_clk); + ipu_put_clk(); return 0; } |