All of lore.kernel.org
 help / color / mirror / Atom feed
From: shawn.guo@linaro.org (Shawn Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 17/17] ARM: ux500: use machine specific hook for late init
Date: Thu, 26 Apr 2012 23:38:45 +0800	[thread overview]
Message-ID: <1335454725-13089-18-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1335454725-13089-1-git-send-email-shawn.guo@linaro.org>

Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-ux500/board-mop500.c       |    4 ++++
 arch/arm/mach-ux500/board-u5500.c        |    1 +
 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 +
 6 files changed, 26 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/board-u5500.c b/arch/arm/mach-ux500/board-u5500.c
index 0ff4be7..c7f5c82 100644
--- a/arch/arm/mach-ux500/board-u5500.c
+++ b/arch/arm/mach-ux500/board-u5500.c
@@ -159,4 +159,5 @@ MACHINE_START(U5500, "ST-Ericsson U5500 Platform")
 	.timer		= &ux500_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= u5500_init_machine,
+	.init_late	= ux500_init_late,
 MACHINE_END
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-04-26 15:38 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26 15:38 [PATCH 00/17] arch/arm/mach-* late_initcall cleanup Shawn Guo
2012-04-26 15:38 ` [PATCH 01/17] ARM: provide a late_initcall hook for platform initialization Shawn Guo
2012-05-02  2:16   ` Rob Lee
2012-04-26 15:38 ` [PATCH 02/17] ARM: at91: use machine specific hook for late init Shawn Guo
2012-04-26 15:29   ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-27 14:07     ` Shawn Guo
2012-04-27 14:26       ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  2:30         ` Shawn Guo
2012-04-28  5:30           ` Jean-Christophe PLAGNIOL-VILLARD
2012-04-28  6:53             ` Shawn Guo
2012-04-30  8:46               ` Arnd Bergmann
2012-05-02  2:51                 ` Jean-Christophe PLAGNIOL-VILLARD
2012-05-02  7:22                   ` Shawn Guo
2012-04-26 15:38 ` [PATCH 03/17] ARM: davinci: " Shawn Guo
2012-04-26 15:38 ` [PATCH 04/17] ARM: ep93xx: " Shawn Guo
2012-04-26 21:11   ` Ryan Mallon
2012-04-26 21:49     ` H Hartley Sweeten
2012-04-26 22:12       ` Russell King - ARM Linux
2012-04-26 22:27         ` H Hartley Sweeten
2012-04-26 22:41       ` Ryan Mallon
2012-04-27  8:41         ` Arnd Bergmann
2012-04-27 13:23         ` Shawn Guo
2012-04-26 22:42   ` H Hartley Sweeten
2012-04-27 13:08     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 05/17] ARM: exynos: " Shawn Guo
2012-04-26 15:38 ` [PATCH 06/17] ARM: imx: " Shawn Guo
2012-04-27  9:05   ` Sascha Hauer
2012-04-27 13:05     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 07/17] ARM: kirkwood: " Shawn Guo
2012-04-26 15:38 ` [PATCH 08/17] ARM: msm: " Shawn Guo
2012-04-26 17:41   ` David Brown
2012-04-27 12:36     ` Shawn Guo
2012-04-26 15:38 ` [PATCH 09/17] ARM: omap1: " Shawn Guo
2012-04-26 15:38 ` [PATCH 10/17] ARM: omap2: " Shawn Guo
2012-04-26 15:38 ` [PATCH 11/17] ARM: pnx4008: " Shawn Guo
2012-04-26 15:38 ` [PATCH 12/17] ARM: prima2: " Shawn Guo
2012-04-29 14:06   ` Barry Song
2012-04-26 15:38 ` [PATCH 13/17] ARM: s3c64xx: " Shawn Guo
2012-04-26 15:38 ` [PATCH 14/17] ARM: sa1100: " Shawn Guo
2012-04-26 15:38 ` [PATCH 15/17] ARM: shmobile: " Shawn Guo
2012-04-27  9:15   ` Magnus Damm
2012-04-29 21:35     ` Rafael J. Wysocki
2012-04-30  0:54       ` Shawn Guo
2012-04-30 21:58         ` Rafael J. Wysocki
2012-05-01  1:56           ` Shawn Guo
2012-05-01 13:35             ` Rafael J. Wysocki
2012-05-01 13:35               ` Shawn Guo
2012-04-26 15:38 ` [PATCH 16/17] ARM: tegra: " Shawn Guo
2012-04-26 15:51   ` Stephen Warren
2012-04-27 12:54     ` Shawn Guo
2012-04-26 15:38 ` Shawn Guo [this message]
2012-04-27  7:08   ` [PATCH 17/17] ARM: ux500: " Srinidhi Kasagar
2012-04-27 12:38     ` 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=1335454725-13089-18-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.