From bde012e1e6069404c01c515cad975b68302b4235 Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Mon, 27 Aug 2007 02:39:17 -0600 Subject: [PATCH] omap2 clock: call clock-specific enable/disable functions if present Call clock-specific enable/disable functions if .enable/.disable function pointer fields are present in struct clk. Similar to OMAP1 clock code. Signed-off-by: Paul Walmsley Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/clock.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index f5ff8cd3977..ad84869226a 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -277,6 +277,9 @@ static int _omap2_clk_enable(struct clk * clk) return 0; } + if (clk->enable) + return clk->enable(clk); + if (unlikely(clk->enable_reg == 0)) { printk(KERN_ERR "clock.c: Enable for %s without enable code\n", clk->name); @@ -316,6 +319,11 @@ static void _omap2_clk_disable(struct clk *clk) if (clk->flags & (ALWAYS_ENABLED | PARENT_CONTROLS_CLOCK)) return; + if (clk->disable) { + clk->disable(clk); + return; + } + if (unlikely(clk == &osc_ck)) { omap2_set_osc_ck(0); return; -- 2.41.1