aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/ar7/time.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-01-27 03:10:06 -0500
committerRalf Baechle <ralf@linux-mips.org>2010-02-27 06:53:16 -0500
commit780019ddf02f214ad61e641b57b8ac30c837e2a7 (patch)
tree2d0a01efc4d508057bcfaa7b3df5b3e490c249ed /arch/mips/ar7/time.c
parent5f3c909881d5deebb9a3ddc836a15937e76daefc (diff)
MIPS: AR7: Implement clock API
This patch makes the ar7 clock code implement the Linux clk API. Drivers using the various clocks available in the SoC are updated accordingly. Signed-off-by: Florian Fainelli <florian@openwrt.org> Acked-by: Wim Van Sebroeck <wim@iguana.be> To: linux-mips@linux-mips.org Cc: Wim Van Sebroeck <wim@iguana.be> Cc: netdev@vger.kernel.org Cc: David Miller <davem@davemloft.net> Patchwork: http://patchwork.linux-mips.org/patch/881/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/ar7/time.c')
-rw-r--r--arch/mips/ar7/time.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/mips/ar7/time.c b/arch/mips/ar7/time.c
index a1fba894daa2..5fb8a0134085 100644
--- a/arch/mips/ar7/time.c
+++ b/arch/mips/ar7/time.c
@@ -20,11 +20,21 @@
20 20
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/time.h> 22#include <linux/time.h>
23#include <linux/err.h>
24#include <linux/clk.h>
23 25
24#include <asm/time.h> 26#include <asm/time.h>
25#include <asm/mach-ar7/ar7.h> 27#include <asm/mach-ar7/ar7.h>
26 28
27void __init plat_time_init(void) 29void __init plat_time_init(void)
28{ 30{
29 mips_hpt_frequency = ar7_cpu_freq() / 2; 31 struct clk *cpu_clk;
32
33 cpu_clk = clk_get(NULL, "cpu");
34 if (IS_ERR(cpu_clk)) {
35 printk(KERN_ERR "unable to get cpu clock\n");
36 return;
37 }
38
39 mips_hpt_frequency = clk_get_rate(cpu_clk) / 2;
30} 40}