From fa523e52fb53ea01c30724940487a5dc56edaedf Mon Sep 17 00:00:00 2001 From: Yoshinori Sato Date: Thu, 14 Apr 2016 16:57:02 +0900 Subject: [PATCH] sh: Use common clock framework. Signed-off-by: Yoshinori Sato --- arch/sh/kernel/cpu/Makefile | 2 ++ arch/sh/kernel/cpu/clock.c | 9 ++++++--- arch/sh/kernel/cpu/sh4/Makefile | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/sh/kernel/cpu/Makefile b/arch/sh/kernel/cpu/Makefile index accc7ca722e1..d0193a186c80 100644 --- a/arch/sh/kernel/cpu/Makefile +++ b/arch/sh/kernel/cpu/Makefile @@ -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 diff --git a/arch/sh/kernel/cpu/clock.c b/arch/sh/kernel/cpu/clock.c index 4187cf4fe185..856a05cdcb1d 100644 --- a/arch/sh/kernel/cpu/clock.c +++ b/arch/sh/kernel/cpu/clock.c @@ -17,19 +17,21 @@ #include #include #include +#include #include #include 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; } diff --git a/arch/sh/kernel/cpu/sh4/Makefile b/arch/sh/kernel/cpu/sh4/Makefile index 3a1dbc709831..b822c0c0b09c 100644 --- a/arch/sh/kernel/cpu/sh4/Makefile +++ b/arch/sh/kernel/cpu/sh4/Makefile @@ -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) -- 2.11.0