diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-01-26 22:13:08 -0500 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-01-28 20:13:49 -0500 |
commit | 44da0a51032f3d90a441bd80c2efe68532104980 (patch) | |
tree | 25f119597684c1d7ce2a2525d6f3c3c2c0fc4053 /arch/arm/mach-omap2/clock2xxx.c | |
parent | 87a1b26c2d31dce62758b78c077ff5a1b5a52ab8 (diff) |
OMAP2xxx clock: move sys_clk code into mach-omap2/clkt2xxx_sys.c
Move the sys_clk clock functions from clock2xxx.c to
mach-omap2/clkt2xxx_sys.c. This is intended to make the clock code
easier to understand, since all of the functions needed to manage the
sys_clk are now located in their own file, rather than being mixed
with other, unrelated functions.
Clock debugging is also now more finely-grained, since the DEBUG
macro can now be defined for the sys_clk clock alone. This
should reduce unnecessary console noise when debugging.
Also, if at some future point the mach-omap2/ directory is split into
OMAP2/3/4 variants, this clkt file can be placed in the mach-omap2xxx/
directory, rather than shared with other chip types that don't use
this clock type.
Thanks to Alexander Shishkin <virtuoso@slind.org> for his comments to
improve the patch description.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Alexander Shishkin <virtuoso@slind.org>
Diffstat (limited to 'arch/arm/mach-omap2/clock2xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/clock2xxx.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/arch/arm/mach-omap2/clock2xxx.c b/arch/arm/mach-omap2/clock2xxx.c index 62c3b022a1e9..b59cb1d2bf55 100644 --- a/arch/arm/mach-omap2/clock2xxx.c +++ b/arch/arm/mach-omap2/clock2xxx.c | |||
@@ -46,8 +46,6 @@ | |||
46 | 46 | ||
47 | struct clk *vclk, *sclk, *dclk; | 47 | struct clk *vclk, *sclk, *dclk; |
48 | 48 | ||
49 | void __iomem *prcm_clksrc_ctrl; | ||
50 | |||
51 | /*------------------------------------------------------------------------- | 49 | /*------------------------------------------------------------------------- |
52 | * Omap24xx specific clock functions | 50 | * Omap24xx specific clock functions |
53 | *-------------------------------------------------------------------------*/ | 51 | *-------------------------------------------------------------------------*/ |
@@ -79,34 +77,6 @@ const struct clkops clkops_omap2430_i2chs_wait = { | |||
79 | .find_companion = omap2_clk_dflt_find_companion, | 77 | .find_companion = omap2_clk_dflt_find_companion, |
80 | }; | 78 | }; |
81 | 79 | ||
82 | #ifdef OLD_CK | ||
83 | /* Recalculate SYST_CLK */ | ||
84 | static void omap2_sys_clk_recalc(struct clk *clk) | ||
85 | { | ||
86 | u32 div = PRCM_CLKSRC_CTRL; | ||
87 | div &= (1 << 7) | (1 << 6); /* Test if ext clk divided by 1 or 2 */ | ||
88 | div >>= clk->rate_offset; | ||
89 | clk->rate = (clk->parent->rate / div); | ||
90 | propagate_rate(clk); | ||
91 | } | ||
92 | #endif /* OLD_CK */ | ||
93 | |||
94 | u32 omap2xxx_get_sysclkdiv(void) | ||
95 | { | ||
96 | u32 div; | ||
97 | |||
98 | div = __raw_readl(prcm_clksrc_ctrl); | ||
99 | div &= OMAP_SYSCLKDIV_MASK; | ||
100 | div >>= OMAP_SYSCLKDIV_SHIFT; | ||
101 | |||
102 | return div; | ||
103 | } | ||
104 | |||
105 | unsigned long omap2_sys_clk_recalc(struct clk *clk) | ||
106 | { | ||
107 | return clk->parent->rate / omap2xxx_get_sysclkdiv(); | ||
108 | } | ||
109 | |||
110 | /* | 80 | /* |
111 | * Set clocks for bypass mode for reboot to work. | 81 | * Set clocks for bypass mode for reboot to work. |
112 | */ | 82 | */ |