diff options
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); |