diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-01-27 03:10:06 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:53:16 -0500 |
commit | 780019ddf02f214ad61e641b57b8ac30c837e2a7 (patch) | |
tree | 2d0a01efc4d508057bcfaa7b3df5b3e490c249ed /arch/mips/include/asm | |
parent | 5f3c909881d5deebb9a3ddc836a15937e76daefc (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/include/asm')
-rw-r--r-- | arch/mips/include/asm/mach-ar7/ar7.h | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/arch/mips/include/asm/mach-ar7/ar7.h b/arch/mips/include/asm/mach-ar7/ar7.h index 21cbbc706448..f1cf38943497 100644 --- a/arch/mips/include/asm/mach-ar7/ar7.h +++ b/arch/mips/include/asm/mach-ar7/ar7.h | |||
@@ -105,26 +105,9 @@ static inline u8 ar7_chip_rev(void) | |||
105 | return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff; | 105 | return (readl((void *)KSEG1ADDR(AR7_REGS_GPIO + 0x14)) >> 16) & 0xff; |
106 | } | 106 | } |
107 | 107 | ||
108 | static inline int ar7_cpu_freq(void) | 108 | struct clk { |
109 | { | 109 | unsigned int rate; |
110 | return ar7_cpu_clock; | 110 | }; |
111 | } | ||
112 | |||
113 | static inline int ar7_bus_freq(void) | ||
114 | { | ||
115 | return ar7_bus_clock; | ||
116 | } | ||
117 | |||
118 | static inline int ar7_vbus_freq(void) | ||
119 | { | ||
120 | return ar7_bus_clock / 2; | ||
121 | } | ||
122 | #define ar7_cpmac_freq ar7_vbus_freq | ||
123 | |||
124 | static inline int ar7_dsp_freq(void) | ||
125 | { | ||
126 | return ar7_dsp_clock; | ||
127 | } | ||
128 | 111 | ||
129 | static inline int ar7_has_high_cpmac(void) | 112 | static inline int ar7_has_high_cpmac(void) |
130 | { | 113 | { |