summaryrefslogtreecommitdiffstats
path: root/arch/mips/jz4740/time.c
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2015-05-24 16:11:33 +0100
committerRalf Baechle <ralf@linux-mips.org>2015-06-21 21:53:12 +0200
commite06b86a33ad9a225d6336f2489cdd79aeaa9d59b (patch)
treead484b9facecd02ee2a9e800d978c41c67b64179 /arch/mips/jz4740/time.c
parent1f4b840983ffbd7053b5c2219deaf62b4b8a3c12 (diff)
downloadop-kernel-dev-e06b86a33ad9a225d6336f2489cdd79aeaa9d59b.zip
op-kernel-dev-e06b86a33ad9a225d6336f2489cdd79aeaa9d59b.tar.gz
MIPS: JZ4740: replace use of jz4740_clock_bdata
Replace uses of the jz4740_clock_bdata struct with calls to clk_get_rate for the appropriate clock. This is in preparation for migrating the clocks towards common clock framework & devicetree. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: linux-mips@linux-mips.org Cc: Deng-Cheng Zhu <dengcheng.zhu@imgtec.com> Cc: linux-kernel@vger.kernel.org Cc: Apelete Seketeli <apelete@seketeli.net> Patchwork: https://patchwork.linux-mips.org/patch/10149/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/jz4740/time.c')
-rw-r--r--arch/mips/jz4740/time.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/mips/jz4740/time.c b/arch/mips/jz4740/time.c
index 78ed765..f66f7f5 100644
--- a/arch/mips/jz4740/time.c
+++ b/arch/mips/jz4740/time.c
@@ -13,6 +13,7 @@
*
*/
+#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/time.h>
@@ -115,11 +116,17 @@ void __init plat_time_init(void)
int ret;
uint32_t clk_rate;
uint16_t ctrl;
+ struct clk *ext_clk;
jz4740_clock_init();
jz4740_timer_init();
- clk_rate = jz4740_clock_bdata.ext_rate >> 4;
+ ext_clk = clk_get(NULL, "ext");
+ if (IS_ERR(ext_clk))
+ panic("unable to get ext clock");
+ clk_rate = clk_get_rate(ext_clk) >> 4;
+ clk_put(ext_clk);
+
jz4740_jiffies_per_tick = DIV_ROUND_CLOSEST(clk_rate, HZ);
clockevent_set_clock(&jz4740_clockevent, clk_rate);
OpenPOWER on IntegriCloud