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 15/17] ARM: shmobile: use machine specific hook for late init
Date: Thu, 26 Apr 2012 23:38:43 +0800	[thread overview]
Message-ID: <1335454725-13089-16-git-send-email-shawn.guo@linaro.org> (raw)
In-Reply-To: <1335454725-13089-1-git-send-email-shawn.guo@linaro.org>

Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
 arch/arm/mach-shmobile/Makefile              |    2 +-
 arch/arm/mach-shmobile/board-ag5evm.c        |    1 +
 arch/arm/mach-shmobile/board-ap4evb.c        |    1 +
 arch/arm/mach-shmobile/board-bonito.c        |    1 +
 arch/arm/mach-shmobile/board-g3evm.c         |    1 +
 arch/arm/mach-shmobile/board-g4evm.c         |    1 +
 arch/arm/mach-shmobile/board-kota2.c         |    1 +
 arch/arm/mach-shmobile/board-mackerel.c      |    1 +
 arch/arm/mach-shmobile/board-marzen.c        |    1 +
 arch/arm/mach-shmobile/common.c              |   24 ++++++++++++++++++++++++
 arch/arm/mach-shmobile/cpuidle.c             |    3 +--
 arch/arm/mach-shmobile/include/mach/common.h |   14 ++++++++++++++
 arch/arm/mach-shmobile/suspend.c             |    3 +--
 13 files changed, 49 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/common.c

diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index e7c2590..93d62fb 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -3,7 +3,7 @@
 #
 
 # Common objects
-obj-y				:= timer.o console.o clock.o
+obj-y				:= timer.o console.o clock.o common.o
 
 # CPU objects
 obj-$(CONFIG_ARCH_SH7367)	+= setup-sh7367.o clock-sh7367.o intc-sh7367.o
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index cb224a3..a99e7e6 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -598,5 +598,6 @@ MACHINE_START(AG5EVM, "ag5evm")
 	.init_irq	= sh73a0_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= ag5evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index b56dde2..522866d 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -1440,5 +1440,6 @@ MACHINE_START(AP4EVB, "ap4evb")
 	.init_irq	= sh7372_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= ap4evb_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index 81fd95f..e6b1fd3 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -500,5 +500,6 @@ MACHINE_START(BONITO, "bonito")
 	.init_irq	= r8a7740_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= bonito_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index 39b6cf8..796fa00 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -338,5 +338,6 @@ MACHINE_START(G3EVM, "g3evm")
 	.init_irq	= sh7367_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= g3evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index 0e5a39c..f125732 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -381,5 +381,6 @@ MACHINE_START(G4EVM, "g4evm")
 	.init_irq	= sh7377_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= g4evm_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index 200dcd4..f60f1b2 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -521,5 +521,6 @@ MACHINE_START(KOTA2, "kota2")
 	.init_irq	= sh73a0_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= kota2_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index f49e28a..4cd438f 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -1623,5 +1623,6 @@ MACHINE_START(MACKEREL, "mackerel")
 	.init_irq	= sh7372_init_irq,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= mackerel_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index ef0e13b..14de378 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -98,5 +98,6 @@ MACHINE_START(MARZEN, "marzen")
 	.init_irq	= r8a7779_init_irq,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= marzen_init,
+	.init_late	= shmobile_init_late,
 	.timer		= &shmobile_timer,
 MACHINE_END
diff --git a/arch/arm/mach-shmobile/common.c b/arch/arm/mach-shmobile/common.c
new file mode 100644
index 0000000..608aba9
--- /dev/null
+++ b/arch/arm/mach-shmobile/common.c
@@ -0,0 +1,24 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <mach/common.h>
+
+void __init shmobile_init_late(void)
+{
+	shmobile_suspend_init();
+	shmobile_cpuidle_init();
+}
diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c
index 7e65591..7b541e9 100644
--- a/arch/arm/mach-shmobile/cpuidle.c
+++ b/arch/arm/mach-shmobile/cpuidle.c
@@ -46,7 +46,7 @@ static struct cpuidle_driver shmobile_cpuidle_driver = {
 
 void (*shmobile_cpuidle_setup)(struct cpuidle_driver *drv);
 
-static int shmobile_cpuidle_init(void)
+int shmobile_cpuidle_init(void)
 {
 	struct cpuidle_device *dev = &shmobile_cpuidle_dev;
 	struct cpuidle_driver *drv = &shmobile_cpuidle_driver;
@@ -65,4 +65,3 @@ static int shmobile_cpuidle_init(void)
 
 	return 0;
 }
-late_initcall(shmobile_cpuidle_init);
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index 83ad3fe..2a527c4 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -83,4 +83,18 @@ extern void r8a7779_secondary_init(unsigned int cpu);
 extern int r8a7779_boot_secondary(unsigned int cpu);
 extern void r8a7779_smp_prepare_cpus(void);
 
+extern void shmobile_init_late(void);
+
+#ifdef CONFIG_SUSPEND
+int shmobile_suspend_init(void);
+#else
+static inline int shmobile_suspend_init(void) { return 0; }
+#endif
+
+#ifdef CONFIG_CPU_IDLE
+int shmobile_cpuidle_init(void);
+#else
+static inline int shmobile_cpuidle_init(void) { return 0; }
+#endif
+
 #endif /* __ARCH_MACH_COMMON_H */
diff --git a/arch/arm/mach-shmobile/suspend.c b/arch/arm/mach-shmobile/suspend.c
index 4d1b86a..47d83f7 100644
--- a/arch/arm/mach-shmobile/suspend.c
+++ b/arch/arm/mach-shmobile/suspend.c
@@ -39,9 +39,8 @@ struct platform_suspend_ops shmobile_suspend_ops = {
 	.valid		= suspend_valid_only_mem,
 };
 
-static int __init shmobile_suspend_init(void)
+int __init shmobile_suspend_init(void)
 {
 	suspend_set_ops(&shmobile_suspend_ops);
 	return 0;
 }
-late_initcall(shmobile_suspend_init);
-- 
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 ` Shawn Guo [this message]
2012-04-27  9:15   ` [PATCH 15/17] ARM: shmobile: " 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 ` [PATCH 17/17] ARM: ux500: " Shawn Guo
2012-04-27  7:08   ` 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-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 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.