OSDN Git Service

sh: Use common clock framework.
authorYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 14 Apr 2016 07:57:02 +0000 (16:57 +0900)
committerYoshinori Sato <ysato@users.sourceforge.jp>
Thu, 14 Apr 2016 08:05:53 +0000 (17:05 +0900)
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
arch/sh/kernel/cpu/Makefile
arch/sh/kernel/cpu/clock.c
arch/sh/kernel/cpu/sh4/Makefile

index accc7ca..d0193a1 100644 (file)
@@ -16,6 +16,8 @@ obj-$(CONFIG_ARCH_SHMOBILE)   += shmobile/
 # Common interfaces.
 
 obj-$(CONFIG_SH_ADC)           += adc.o
+ifndef CONFIG_COMMON_CLK
 obj-$(CONFIG_SH_CLK_CPG_LEGACY)        += clock-cpg.o
+endif
 
 obj-y  += irq/ init.o clock.o fpu.o pfc.o proc.o
index 4187cf4..856a05c 100644 (file)
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/clk.h>
+#include <linux/of.h>
 #include <asm/clock.h>
 #include <asm/machvec.h>
 
 int __init clk_init(void)
 {
-       int ret;
+       int ret = 0;
 
+#ifndef CONFIG_COMMON_CLK
        ret = arch_clk_init();
        if (unlikely(ret)) {
                pr_err("%s: CPU clock registration failed.\n", __func__);
                return ret;
        }
-
+#endif
        if (sh_mv.mv_clk_init) {
                ret = sh_mv.mv_clk_init();
                if (unlikely(ret)) {
@@ -39,12 +41,13 @@ int __init clk_init(void)
                }
        }
 
+#ifndef CONFIG_COMMON_CLK
        /* Kick the child clocks.. */
        recalculate_root_clocks();
 
        /* Enable the necessary init clocks */
        clk_enable_init_clocks();
-
+#endif
        return ret;
 }
 
index 3a1dbc7..b822c0c 100644 (file)
@@ -14,6 +14,7 @@ perf-$(CONFIG_CPU_SUBTYPE_SH7750)     := perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7750S)     := perf_event.o
 perf-$(CONFIG_CPU_SUBTYPE_SH7091)      := perf_event.o
 
+ifndef CONFIG_OF
 # CPU subtype setup
 obj-$(CONFIG_CPU_SUBTYPE_SH7750)       += setup-sh7750.o
 obj-$(CONFIG_CPU_SUBTYPE_SH7750R)      += setup-sh7750.o
@@ -31,6 +32,7 @@ endif
 
 # Additional clocks by subtype
 clock-$(CONFIG_CPU_SUBTYPE_SH4_202)    += clock-sh4-202.o
+endif
 
 obj-y                                  += $(clock-y)
 obj-$(CONFIG_PERF_EVENTS)              += $(perf-y)