diff mbox

[v2,08/13] ARM: davinci - migrating to use davinci_common_clk_init

Message ID 1348683037-9705-9-git-send-email-m-karicheri2@ti.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Murali Karicheri Sept. 26, 2012, 6:10 p.m. UTC
The common clk code uses a new function davinci_common_clk_init()
defined in drivers/clk/davinci/davinci-clock.c to initialize the
clk drivers. This function is now invoked in time.c as part of
davinci_timer_init(). Currently davinci_clk_init() is called from
davinci_common_init() which is too early to initialize common clk
drivers. Also include pll.h instead of clock.h in some of the source
files.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index 64b0f65..f854296 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -20,7 +20,9 @@ 
 #include <mach/common.h>
 #include <mach/cputype.h>
 
+#ifndef CONFIG_COMMON_CLK
 #include "clock.h"
+#endif
 
 struct davinci_soc_info davinci_soc_info;
 EXPORT_SYMBOL(davinci_soc_info);
@@ -106,7 +108,9 @@  void __init davinci_common_init(struct davinci_soc_info *soc_info)
 		goto err;
 
 	if (davinci_soc_info.cpu_clks) {
+#ifndef CONFIG_COMMON_CLK
 		ret = davinci_clk_init(davinci_soc_info.cpu_clks);
+#endif
 
 		if (ret != 0)
 			goto err;
@@ -122,5 +126,7 @@  void __init davinci_init_late(void)
 {
 	davinci_cpufreq_init();
 	davinci_pm_init();
+#ifndef CONFIG_COMMON_CLK
 	davinci_clk_disable_unused();
+#endif
 }
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index d2f96662..96ee175 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -24,7 +24,9 @@ 
 #include <mach/time.h>
 
 #include "davinci.h"
+#ifndef CONFIG_COMMON_CLK
 #include "clock.h"
+#endif
 
 #define DAVINCI_I2C_BASE	     0x01C21000
 #define DAVINCI_ATA_BASE	     0x01C66000
diff --git a/arch/arm/mach-davinci/pm.c b/arch/arm/mach-davinci/pm.c
index eb8360b..8802fdc 100644
--- a/arch/arm/mach-davinci/pm.c
+++ b/arch/arm/mach-davinci/pm.c
@@ -23,7 +23,11 @@ 
 #include <mach/sram.h>
 #include <mach/pm.h>
 
+#ifndef CONFIG_COMMON_CLK
 #include "clock.h"
+#else
+#include <mach/pll.h>
+#endif
 
 #define DEEPSLEEP_SLEEPCOUNT_MASK	0xFFFF
 
diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S
index d4e9316..5c04a7c 100644
--- a/arch/arm/mach-davinci/sleep.S
+++ b/arch/arm/mach-davinci/sleep.S
@@ -24,7 +24,11 @@ 
 #include <mach/psc.h>
 #include <mach/ddr2.h>
 
+#ifndef CONFIG_COMMON_CLK
 #include "clock.h"
+#else
+#include <mach/pll.h>
+#endif
 
 /* Arbitrary, hardware currently does not update PHYRDY correctly */
 #define PHYRDY_CYCLES		0x1000
@@ -183,6 +187,7 @@  ENDPROC(davinci_cpu_suspend)
  * 	r1: contains virtual base for DDR2 Power and Sleep controller (PSC)
  * 	r2: contains PSC number for DDR2
  */
+
 ENTRY(davinci_ddr_psc_config)
 	/* Set next state in mdctl for DDR2 */
 	mov	r6, #MDCTL
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 9847938..cc3bb96 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -18,6 +18,9 @@ 
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/platform_device.h>
+#ifdef CONFIG_COMMON_CLK
+#include <linux/platform_data/davinci-clock.h>
+#endif
 
 #include <asm/sched_clock.h>
 #include <asm/mach/irq.h>
@@ -27,7 +30,9 @@ 
 #include <mach/hardware.h>
 #include <mach/time.h>
 
+#ifndef CONFIG_COMMON_CLK
 #include "clock.h"
+#endif
 
 static struct clock_event_device clockevent_davinci;
 static unsigned int davinci_clock_tick_rate;
@@ -347,6 +352,14 @@  static void __init davinci_timer_init(void)
 		"%s: can't register clocksource!\n";
 	int i;
 
+#ifdef CONFIG_COMMON_CLK
+	if (davinci_soc_info.cpu_clks)	{
+		davinci_common_clk_init(davinci_soc_info.cpu_clks,
+				davinci_soc_info.dev_clk_lookups,
+				davinci_soc_info.psc_bases_num,
+				davinci_soc_info.psc_bases);
+	}
+#endif
 	clockevent_id = soc_info->timer_info->clockevent_id;
 	clocksource_id = soc_info->timer_info->clocksource_id;