diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 19:08:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-15 19:08:50 -0400 |
commit | 65a6ec0d72a07f16719e9b7a96e1c4bae044b591 (patch) | |
tree | 344e03a5039a44982c1b78d6113633b21b434820 /arch/arm/mach-omap1/clock.c | |
parent | 541010e4b8921cd781ff02ae68028501457045b6 (diff) | |
parent | 0181b61a988424b5cc44fe09e6968142359c815e (diff) |
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (95 commits)
[ARM] 4578/1: CM-x270: PCMCIA support
[ARM] 4577/1: ITE 8152 PCI bridge support
[ARM] 4576/1: CM-X270 machine support
[ARM] pxa: Avoid pxa_gpio_mode() in gpio_direction_{in,out}put()
[ARM] pxa: move pxa_set_mode() from pxa2xx_mainstone.c to mainstone.c
[ARM] pxa: move pxa_set_mode() from pxa2xx_lubbock.c to lubbock.c
[ARM] pxa: Make cpu_is_pxaXXX dependent on configuration symbols
[ARM] pxa: PXA3xx base support
[NET] smc91x: fix PXA DMA support code
[SERIAL] Fix console initialisation ordering
[ARM] pxa: tidy up arch/arm/mach-pxa/Makefile
[ARM] Update arch/arm/Kconfig for drivers/Kconfig changes
[ARM] 4600/1: fix kernel build failure with build-id-supporting binutils
[ARM] 4599/1: Preserve ATAG list for use with kexec (2.6.23)
[ARM] Rename consistent_sync() as dma_cache_maint()
[ARM] 4572/1: ep93xx: add cirrus logic edb9307 support
[ARM] 4596/1: S3C2412: Correct IRQs for SDI+CF and add decoding support
[ARM] 4595/1: ns9xxx: define registers as void __iomem * instead of volatile u32
[ARM] 4594/1: ns9xxx: use the new gpio functions
[ARM] 4593/1: ns9xxx: implement generic clockevents
...
Diffstat (limited to 'arch/arm/mach-omap1/clock.c')
-rw-r--r-- | arch/arm/mach-omap1/clock.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index f625f6dd228a..5d9faa68d2ec 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -49,6 +49,15 @@ static void omap1_uart_recalc(struct clk * clk) | |||
49 | clk->rate = 12000000; | 49 | clk->rate = 12000000; |
50 | } | 50 | } |
51 | 51 | ||
52 | static void omap1_sossi_recalc(struct clk *clk) | ||
53 | { | ||
54 | u32 div = omap_readl(MOD_CONF_CTRL_1); | ||
55 | |||
56 | div = (div >> 17) & 0x7; | ||
57 | div++; | ||
58 | clk->rate = clk->parent->rate / div; | ||
59 | } | ||
60 | |||
52 | static int omap1_clk_enable_dsp_domain(struct clk *clk) | 61 | static int omap1_clk_enable_dsp_domain(struct clk *clk) |
53 | { | 62 | { |
54 | int retval; | 63 | int retval; |
@@ -396,6 +405,31 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate) | |||
396 | return 0; | 405 | return 0; |
397 | } | 406 | } |
398 | 407 | ||
408 | static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate) | ||
409 | { | ||
410 | u32 l; | ||
411 | int div; | ||
412 | unsigned long p_rate; | ||
413 | |||
414 | p_rate = clk->parent->rate; | ||
415 | /* Round towards slower frequency */ | ||
416 | div = (p_rate + rate - 1) / rate; | ||
417 | div--; | ||
418 | if (div < 0 || div > 7) | ||
419 | return -EINVAL; | ||
420 | |||
421 | l = omap_readl(MOD_CONF_CTRL_1); | ||
422 | l &= ~(7 << 17); | ||
423 | l |= div << 17; | ||
424 | omap_writel(l, MOD_CONF_CTRL_1); | ||
425 | |||
426 | clk->rate = p_rate / (div + 1); | ||
427 | if (unlikely(clk->flags & RATE_PROPAGATES)) | ||
428 | propagate_rate(clk); | ||
429 | |||
430 | return 0; | ||
431 | } | ||
432 | |||
399 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate) | 433 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate) |
400 | { | 434 | { |
401 | return 96000000 / calc_ext_dsor(rate); | 435 | return 96000000 / calc_ext_dsor(rate); |