aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock24xx.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2008-03-18 05:56:39 -0400
committerTony Lindgren <tony@atomide.com>2008-04-14 13:29:38 -0400
commita16e97037b518533569a778f0e997704e5c43796 (patch)
tree0ab385008123a46d2a396d8aa1bf690a2f506fea /arch/arm/mach-omap2/clock24xx.c
parent2150ef46f8b5b2a5e3e5c53c1b04c513276ad4f7 (diff)
ARM: OMAP2: Clean up 24xx clock code
Clean up 24xx clock code to sync it with linux-omap tree. Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock24xx.c')
-rw-r--r--arch/arm/mach-omap2/clock24xx.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c
index 615b511c68c9..ece32d8acba4 100644
--- a/arch/arm/mach-omap2/clock24xx.c
+++ b/arch/arm/mach-omap2/clock24xx.c
@@ -1,15 +1,15 @@
1/* 1/*
2 * linux/arch/arm/mach-omap2/clock.c 2 * linux/arch/arm/mach-omap2/clock.c
3 * 3 *
4 * Copyright (C) 2005 Texas Instruments Inc. 4 * Copyright (C) 2005-2008 Texas Instruments, Inc.
5 * Richard Woodruff <r-woodruff2@ti.com> 5 * Copyright (C) 2004-2008 Nokia Corporation
6 * Created for OMAP2.
7 * 6 *
8 * Cleaned up and modified to use omap shared clock framework by 7 * Contacts:
9 * Tony Lindgren <tony@atomide.com> 8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley
10 * 10 *
11 * Based on omap1 clock.c, Copyright (C) 2004 - 2005 Nokia corporation 11 * Based on earlier work by Tuukka Tikkanen, Tony Lindgren,
12 * Written by Tuukka Tikkanen <tuukka.tikkanen@elektrobit.com> 12 * Gordon McNutt and RidgeRun, Inc.
13 * 13 *
14 * This program is free software; you can redistribute it and/or modify 14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as 15 * it under the terms of the GNU General Public License version 2 as
@@ -60,6 +60,21 @@ static struct clk *sclk;
60 * Omap24xx specific clock functions 60 * Omap24xx specific clock functions
61 *-------------------------------------------------------------------------*/ 61 *-------------------------------------------------------------------------*/
62 62
63/* This actually returns the rate of core_ck, not dpll_ck. */
64static u32 omap2_get_dpll_rate_24xx(struct clk *tclk)
65{
66 long long dpll_clk;
67 u8 amult;
68
69 dpll_clk = omap2_get_dpll_rate(tclk);
70
71 amult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
72 amult &= OMAP24XX_CORE_CLK_SRC_MASK;
73 dpll_clk *= amult;
74
75 return dpll_clk;
76}
77
63static int omap2_enable_osc_ck(struct clk *clk) 78static int omap2_enable_osc_ck(struct clk *clk)
64{ 79{
65 u32 pcc; 80 u32 pcc;
@@ -94,21 +109,6 @@ static void omap2_sys_clk_recalc(struct clk * clk)
94} 109}
95#endif /* OLD_CK */ 110#endif /* OLD_CK */
96 111
97/* This actually returns the rate of core_ck, not dpll_ck. */
98static u32 omap2_get_dpll_rate_24xx(struct clk *tclk)
99{
100 long long dpll_clk;
101 u8 amult;
102
103 dpll_clk = omap2_get_dpll_rate(tclk);
104
105 amult = cm_read_mod_reg(PLL_MOD, CM_CLKSEL2);
106 amult &= OMAP24XX_CORE_CLK_SRC_MASK;
107 dpll_clk *= amult;
108
109 return dpll_clk;
110}
111
112/* Enable an APLL if off */ 112/* Enable an APLL if off */
113static int omap2_clk_fixed_enable(struct clk *clk) 113static int omap2_clk_fixed_enable(struct clk *clk)
114{ 114{
@@ -333,7 +333,7 @@ static int omap2_select_table_rate(struct clk *clk, unsigned long rate)
333 333
334 if (!found_speed) { 334 if (!found_speed) {
335 printk(KERN_INFO "Could not set MPU rate to %luMHz\n", 335 printk(KERN_INFO "Could not set MPU rate to %luMHz\n",
336 rate / 1000000); 336 rate / 1000000);
337 return -EINVAL; 337 return -EINVAL;
338 } 338 }
339 339