.buf_size = &buf_size_v5,
.buf_align = &mfc_buf_align_v5,
.fw_name[0] = "s5p-mfc.fw",
+ .use_clock_gating = true,
};
static struct s5p_mfc_buf_size_v6 mfc_buf_size_v6 = {
pm = &dev->pm;
p_dev = dev;
+ pm->use_clock_gating = dev->variant->use_clock_gating;
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");
atomic_inc(&clk_ref);
mfc_debug(3, "+ %d\n", atomic_read(&clk_ref));
#endif
+ if (!pm->use_clock_gating)
+ return 0;
if (!IS_ERR_OR_NULL(pm->clock_gate))
ret = clk_enable(pm->clock_gate);
return ret;
atomic_dec(&clk_ref);
mfc_debug(3, "- %d\n", atomic_read(&clk_ref));
#endif
+ if (!pm->use_clock_gating)
+ return;
if (!IS_ERR_OR_NULL(pm->clock_gate))
clk_disable(pm->clock_gate);
}
int s5p_mfc_power_on(void)
{
+ int ret = 0;
+
#ifdef CONFIG_PM
- return pm_runtime_get_sync(pm->device);
+ ret = pm_runtime_get_sync(pm->device);
+ if (ret)
+ return ret;
#else
atomic_set(&pm->power, 1);
- return 0;
#endif
+ if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate))
+ ret = clk_enable(pm->clock_gate);
+ return ret;
}
int s5p_mfc_power_off(void)
{
+ if (!pm->use_clock_gating && !IS_ERR_OR_NULL(pm->clock_gate))
+ clk_disable(pm->clock_gate);
#ifdef CONFIG_PM
return pm_runtime_put_sync(pm->device);
#else