MIPS: JZ4740: Call jz4740_clock_init earlier
authorPaul Burton <paul.burton@imgtec.com>
Sun, 24 May 2015 15:11:32 +0000 (16:11 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Sun, 21 Jun 2015 19:53:11 +0000 (21:53 +0200)
Call jz4740_clock_init before any uses of jz4740_clock_bdata occur. This
is in preparation for replacing uses of that struct with calls to
clk_get_rate, which will allow the clocks to be migrated 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
Patchwork: https://patchwork.linux-mips.org/patch/10148/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/mach-jz4740/clock.h
arch/mips/jz4740/clock.c
arch/mips/jz4740/time.c

index 16659cd76d4e7caa863e7ebeadd19ccb6b06392c..01d846845f530f3e7328d0f639b4bea11c35b96c 100644 (file)
@@ -20,6 +20,8 @@ enum jz4740_wait_mode {
        JZ4740_WAIT_MODE_SLEEP,
 };
 
+int jz4740_clock_init(void);
+
 void jz4740_clock_set_wait_mode(enum jz4740_wait_mode mode);
 
 void jz4740_clock_udc_enable_auto_suspend(void);
index 1b5f55426cad50be1b7477b793716ecde255954d..c257073577a205285b7bc32f866b72c3a78db5c5 100644 (file)
@@ -889,7 +889,7 @@ void jz4740_clock_resume(void)
                JZ_CLOCK_GATE_TCU | JZ_CLOCK_GATE_DMAC | JZ_CLOCK_GATE_UART0);
 }
 
-static int jz4740_clock_init(void)
+int jz4740_clock_init(void)
 {
        uint32_t val;
 
@@ -921,4 +921,3 @@ static int jz4740_clock_init(void)
 
        return 0;
 }
-arch_initcall(jz4740_clock_init);
index 72b0cecbc17c96997f8969689f4b79ee1c3b5867..78ed7652ef67a8016abb9c9217d9f3c02fb37dd0 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/clockchips.h>
 #include <linux/sched_clock.h>
 
+#include <asm/mach-jz4740/clock.h>
 #include <asm/mach-jz4740/irq.h>
 #include <asm/mach-jz4740/timer.h>
 #include <asm/time.h>
@@ -115,6 +116,7 @@ void __init plat_time_init(void)
        uint32_t clk_rate;
        uint16_t ctrl;
 
+       jz4740_clock_init();
        jz4740_timer_init();
 
        clk_rate = jz4740_clock_bdata.ext_rate >> 4;