[PATCH 21/28] omap2 clock: call clock-specific enable/disable functions if present

Paul Walmsley
2007-08-20T09:54:08Z

[-- Attachment #1: add_clk_specific_enable_disable.patch --]
[-- Type: text/plain, Size: 1065 bytes --]

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 <paul@pwsan.com>

---
arch/arm/mach-omap2/clock.c | 8 ++++++++
1 file changed, 8 insertions(+)

Index: linux-omap/arch/arm/mach-omap2/clock.c
Index: linux-omap/arch/arm/mach-omap2/clock.c
===================================================================
--- linux-omap.orig/arch/arm/mach-omap2/clock.c
+++ linux-omap/arch/arm/mach-omap2/clock.c
@@ -276,6 +276,9 @@ static int _omap2_clk_enable(struct 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);
@@ -315,6 +318,11 @@ static void _omap2_clk_disable(struct cl
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;

--