aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/clock.c')
-rw-r--r--arch/arm/mach-omap1/clock.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 5fba2073171..25ef04da6b0 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -26,8 +26,17 @@
26#include <mach/clock.h> 26#include <mach/clock.h>
27#include <mach/sram.h> 27#include <mach/sram.h>
28 28
29static const struct clkops clkops_generic;
30static const struct clkops clkops_uart;
31static const struct clkops clkops_dspck;
32
29#include "clock.h" 33#include "clock.h"
30 34
35static int omap1_clk_enable_generic(struct clk * clk);
36static int omap1_clk_enable(struct clk *clk);
37static void omap1_clk_disable_generic(struct clk * clk);
38static void omap1_clk_disable(struct clk *clk);
39
31__u32 arm_idlect1_mask; 40__u32 arm_idlect1_mask;
32 41
33/*------------------------------------------------------------------------- 42/*-------------------------------------------------------------------------
@@ -78,6 +87,11 @@ static void omap1_clk_disable_dsp_domain(struct clk *clk)
78 } 87 }
79} 88}
80 89
90static const struct clkops clkops_dspck = {
91 .enable = &omap1_clk_enable_dsp_domain,
92 .disable = &omap1_clk_disable_dsp_domain,
93};
94
81static int omap1_clk_enable_uart_functional(struct clk *clk) 95static int omap1_clk_enable_uart_functional(struct clk *clk)
82{ 96{
83 int ret; 97 int ret;
@@ -105,6 +119,11 @@ static void omap1_clk_disable_uart_functional(struct clk *clk)
105 omap1_clk_disable_generic(clk); 119 omap1_clk_disable_generic(clk);
106} 120}
107 121
122static const struct clkops clkops_uart = {
123 .enable = &omap1_clk_enable_uart_functional,
124 .disable = &omap1_clk_disable_uart_functional,
125};
126
108static void omap1_clk_allow_idle(struct clk *clk) 127static void omap1_clk_allow_idle(struct clk *clk)
109{ 128{
110 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk; 129 struct arm_idlect1_clk * iclk = (struct arm_idlect1_clk *)clk;
@@ -468,7 +487,7 @@ static int omap1_clk_enable(struct clk *clk)
468 omap1_clk_deny_idle(clk->parent); 487 omap1_clk_deny_idle(clk->parent);
469 } 488 }
470 489
471 ret = clk->enable(clk); 490 ret = clk->ops->enable(clk);
472 491
473 if (unlikely(ret != 0) && clk->parent) { 492 if (unlikely(ret != 0) && clk->parent) {
474 omap1_clk_disable(clk->parent); 493 omap1_clk_disable(clk->parent);
@@ -482,7 +501,7 @@ static int omap1_clk_enable(struct clk *clk)
482static void omap1_clk_disable(struct clk *clk) 501static void omap1_clk_disable(struct clk *clk)
483{ 502{
484 if (clk->usecount > 0 && !(--clk->usecount)) { 503 if (clk->usecount > 0 && !(--clk->usecount)) {
485 clk->disable(clk); 504 clk->ops->disable(clk);
486 if (likely(clk->parent)) { 505 if (likely(clk->parent)) {
487 omap1_clk_disable(clk->parent); 506 omap1_clk_disable(clk->parent);
488 if (clk->flags & CLOCK_NO_IDLE_PARENT) 507 if (clk->flags & CLOCK_NO_IDLE_PARENT)
@@ -561,6 +580,11 @@ static void omap1_clk_disable_generic(struct clk *clk)
561 } 580 }
562} 581}
563 582
583static const struct clkops clkops_generic = {
584 .enable = &omap1_clk_enable_generic,
585 .disable = &omap1_clk_disable_generic,
586};
587
564static long omap1_clk_round_rate(struct clk *clk, unsigned long rate) 588static long omap1_clk_round_rate(struct clk *clk, unsigned long rate)
565{ 589{
566 int dsor_exp; 590 int dsor_exp;
@@ -659,7 +683,7 @@ static void __init omap1_clk_disable_unused(struct clk *clk)
659 } 683 }
660 684
661 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name); 685 printk(KERN_INFO "Disabling unused clock \"%s\"... ", clk->name);
662 clk->disable(clk); 686 clk->ops->disable(clk);
663 printk(" done\n"); 687 printk(" done\n");
664} 688}
665 689