aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/lantiq/clk.c
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2013-01-19 03:54:24 -0500
committerJohn Crispin <blogic@openwrt.org>2013-02-16 18:15:17 -0500
commit740c606e8e79c3e3800afbc32b4e6123da403d6c (patch)
treed8fad6b56dcdcdfba522011bab2e114d221ba6a3 /arch/mips/lantiq/clk.c
parent3d18c17e4f1699c3a4f47d2483c5d4c3ab3a242b (diff)
MIPS: lantiq: adds static clock for PP32
The Lantiq DSL SoCs have an internal networking processor. Add code to read the static clock rate. Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4815/
Diffstat (limited to 'arch/mips/lantiq/clk.c')
-rw-r--r--arch/mips/lantiq/clk.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/mips/lantiq/clk.c b/arch/mips/lantiq/clk.c
index ce2f129b081f..d90356004027 100644
--- a/arch/mips/lantiq/clk.c
+++ b/arch/mips/lantiq/clk.c
@@ -26,13 +26,15 @@
26#include "prom.h" 26#include "prom.h"
27 27
28/* lantiq socs have 3 static clocks */ 28/* lantiq socs have 3 static clocks */
29static struct clk cpu_clk_generic[3]; 29static struct clk cpu_clk_generic[4];
30 30
31void clkdev_add_static(unsigned long cpu, unsigned long fpi, unsigned long io) 31void clkdev_add_static(unsigned long cpu, unsigned long fpi,
32 unsigned long io, unsigned long ppe)
32{ 33{
33 cpu_clk_generic[0].rate = cpu; 34 cpu_clk_generic[0].rate = cpu;
34 cpu_clk_generic[1].rate = fpi; 35 cpu_clk_generic[1].rate = fpi;
35 cpu_clk_generic[2].rate = io; 36 cpu_clk_generic[2].rate = io;
37 cpu_clk_generic[3].rate = ppe;
36} 38}
37 39
38struct clk *clk_get_cpu(void) 40struct clk *clk_get_cpu(void)
@@ -51,6 +53,12 @@ struct clk *clk_get_io(void)
51 return &cpu_clk_generic[2]; 53 return &cpu_clk_generic[2];
52} 54}
53 55
56struct clk *clk_get_ppe(void)
57{
58 return &cpu_clk_generic[3];
59}
60EXPORT_SYMBOL_GPL(clk_get_ppe);
61
54static inline int clk_good(struct clk *clk) 62static inline int clk_good(struct clk *clk)
55{ 63{
56 return clk && !IS_ERR(clk); 64 return clk && !IS_ERR(clk);