linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 15/15] ARM: ux500: use machine specific hook for late init
Date: Wed,  2 May 2012 19:33:40 +0800	[thread overview]
Message-ID: <1335958420-5193-16-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1335958420-5193-1-git-send-email-shawn.guo@linaro.org>

Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
---
 arch/arm/mach-ux500/board-mop500.c       |    4 ++++
 arch/arm/mach-ux500/clock.c              |    6 ++----
 arch/arm/mach-ux500/clock.h              |   12 ++++++++++++
 arch/arm/mach-ux500/cpu.c                |    6 ++++++
 arch/arm/mach-ux500/include/mach/setup.h |    1 +
 5 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 77d03c1..348ebd9 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -722,6 +722,7 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= mop500_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
@@ -731,6 +732,7 @@ MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= hrefv60_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
@@ -741,6 +743,7 @@ MACHINE_START(SNOWBALL, "Calao Systems Snowball platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= snowball_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
 
 #ifdef CONFIG_MACH_UX500_DT
@@ -830,6 +833,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= u8500_init_machine,
+	.init_late	= ux500_init_late,
 	.dt_compat      = u8500_dt_board_compat,
 MACHINE_END
 #endif
diff --git a/arch/arm/mach-ux500/clock.c b/arch/arm/mach-ux500/clock.c
index ec35f0a..ce00f5e 100644
--- a/arch/arm/mach-ux500/clock.c
+++ b/arch/arm/mach-ux500/clock.c
@@ -633,7 +633,7 @@ static int clk_debugfs_register(struct clk *c)
 	return 0;
 }
 
-static int __init clk_debugfs_init(void)
+int __init clk_debugfs_init(void)
 {
 	struct clk *c;
 	struct dentry *d;
@@ -655,7 +655,6 @@ err_out:
 	return err;
 }
 
-late_initcall(clk_debugfs_init);
 #endif /* defined(CONFIG_DEBUG_FS) */
 
 unsigned long clk_smp_twd_rate = 500000000;
@@ -694,12 +693,11 @@ static struct notifier_block clk_twd_cpufreq_nb = {
 	.notifier_call = clk_twd_cpufreq_transition,
 };
 
-static int clk_init_smp_twd_cpufreq(void)
+int clk_init_smp_twd_cpufreq(void)
 {
 	return cpufreq_register_notifier(&clk_twd_cpufreq_nb,
 				  CPUFREQ_TRANSITION_NOTIFIER);
 }
-late_initcall(clk_init_smp_twd_cpufreq);
 
 #endif
 
diff --git a/arch/arm/mach-ux500/clock.h b/arch/arm/mach-ux500/clock.h
index d776ada..65d27a1 100644
--- a/arch/arm/mach-ux500/clock.h
+++ b/arch/arm/mach-ux500/clock.h
@@ -150,3 +150,15 @@ struct clk clk_##_name = {						\
 
 int __init clk_db8500_ed_fixup(void);
 int __init clk_init(void);
+
+#ifdef CONFIG_DEBUG_FS
+int clk_debugfs_init(void);
+#else
+static inline int clk_debugfs_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_FREQ
+int clk_init_smp_twd_cpufreq(void);
+#else
+static inline int clk_init_smp_twd_cpufreq(void) { return 0; }
+#endif
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c
index d11f389..9856c57 100644
--- a/arch/arm/mach-ux500/cpu.c
+++ b/arch/arm/mach-ux500/cpu.c
@@ -67,6 +67,12 @@ void __init ux500_init_irq(void)
 	clk_init();
 }
 
+void __init ux500_init_late(void)
+{
+	clk_debugfs_init();
+	clk_init_smp_twd_cpufreq();
+}
+
 static const char * __init ux500_get_machine(void)
 {
 	return kasprintf(GFP_KERNEL, "DB%4x", dbx500_partnumber());
diff --git a/arch/arm/mach-ux500/include/mach/setup.h b/arch/arm/mach-ux500/include/mach/setup.h
index 3dc00ff..7b5d865 100644
--- a/arch/arm/mach-ux500/include/mach/setup.h
+++ b/arch/arm/mach-ux500/include/mach/setup.h
@@ -22,6 +22,7 @@ extern struct device * __init u5500_init_devices(void);
 extern struct device * __init u8500_init_devices(void);
 
 extern void __init ux500_init_irq(void);
+extern void __init ux500_init_late(void);
 
 extern void __init u5500_sdi_init(struct device *parent);
 
-- 
1.7.5.4

  parent reply	other threads:[~2012-05-02 11:33 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02 11:33 [PATCH 00/15] arch/arm/mach-* late_initcall cleanup Shawn Guo
2012-05-02 11:33 ` [PATCH 01/15] ARM: provide a late_initcall hook for platform initialization Shawn Guo
2012-05-02 13:14   ` Shawn Guo
2012-05-03 14:55     ` Shawn Guo
2012-05-03 14:58     ` Russell King - ARM Linux
2012-05-02 17:47   ` H Hartley Sweeten
2012-05-02 11:33 ` [PATCH 02/15] ARM: davinci: use machine specific hook for late init Shawn Guo
2012-05-04 19:58   ` Sekhar Nori
2012-05-05  6:27     ` Shawn Guo
2012-05-02 11:33 ` [PATCH 03/15] ARM: ep93xx: " Shawn Guo
2012-05-02 17:45   ` H Hartley Sweeten
2012-05-03 15:05     ` Shawn Guo
2012-05-02 11:33 ` [PATCH 04/15] ARM: exynos: " Shawn Guo
2012-05-02 11:33 ` [PATCH 05/15] ARM: imx: " Shawn Guo
2012-05-02 12:36   ` Sascha Hauer
2012-05-02 11:33 ` [PATCH 06/15] ARM: msm: " Shawn Guo
2012-05-02 18:28   ` David Brown
2012-05-02 11:33 ` [PATCH 07/15] ARM: omap1: " Shawn Guo
2012-05-02 11:33 ` [PATCH 08/15] ARM: omap2: " Shawn Guo
2012-05-02 11:33 ` [PATCH 09/15] ARM: pnx4008: " Shawn Guo
2012-05-02 11:33 ` [PATCH 10/15] ARM: prima2: " Shawn Guo
2012-05-02 11:33 ` [PATCH 11/15] ARM: s3c64xx: " Shawn Guo
2012-05-02 11:33 ` [PATCH 12/15] ARM: sa1100: " Shawn Guo
2012-05-02 11:33 ` [PATCH 13/15] ARM: shmobile: " Shawn Guo
2012-05-02 11:33 ` [PATCH 14/15] ARM: tegra: " Shawn Guo
2012-05-02 15:57   ` Stephen Warren
2012-05-02 11:33 ` Shawn Guo [this message]
2012-05-07 12:19   ` [PATCH 15/15] ARM: ux500: " Linus Walleij
2012-05-08 12:39     ` Shawn Guo
2012-05-02 12:45 ` [PATCH 00/15] arch/arm/mach-* late_initcall cleanup Arnd Bergmann
2012-05-02 13:37   ` Shawn Guo
2012-05-02 13:41     ` Arnd Bergmann
2012-05-04 23:56     ` Tony Lindgren
2012-05-05  6:25       ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335958420-5193-16-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).