]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
ARM: shmobile: use machine specific hook for late init
authorShawn Guo <shawn.guo@linaro.org>
Thu, 26 Apr 2012 13:58:41 +0000 (21:58 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Tue, 8 May 2012 12:36:35 +0000 (20:36 +0800)
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Magnus Damm <damm@opensource.se>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
13 files changed:
arch/arm/mach-shmobile/Makefile
arch/arm/mach-shmobile/board-ag5evm.c
arch/arm/mach-shmobile/board-ap4evb.c
arch/arm/mach-shmobile/board-bonito.c
arch/arm/mach-shmobile/board-g3evm.c
arch/arm/mach-shmobile/board-g4evm.c
arch/arm/mach-shmobile/board-kota2.c
arch/arm/mach-shmobile/board-mackerel.c
arch/arm/mach-shmobile/board-marzen.c
arch/arm/mach-shmobile/common.c [new file with mode: 0644]
arch/arm/mach-shmobile/cpuidle.c
arch/arm/mach-shmobile/include/mach/common.h
arch/arm/mach-shmobile/suspend.c

index e7c2590b75d9b50f7765760c2843dc10bf1be867..93d62fb215b7259684500c8b46c5d8b37e965d23 100644 (file)
@@ -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
index cb224a344af0ccfa11a460297038a4a79ed151ce..a99e7e6172689fcd5654036d4f0542b61f07e860 100644 (file)
@@ -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
index b56dde2732bbd2b5215c101f6a1ce57f026a712d..522866d0cf7ee202062fae3f48c5c388b867bd93 100644 (file)
@@ -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
index 81fd95f7f52ada6b440f26cbff003a25c92fbef9..e6b1fd38e72f7867468e383dd786e34387806cf1 100644 (file)
@@ -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
index 39b6cf85ced6cc2d98d3132c56629ff0a7398874..796fa00ad3c459cc3432a522446592bc2e18f33a 100644 (file)
@@ -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
index 0e5a39c670bc259731790e7f275bcfeb47ead4c9..f1257321999a3ca585b15706d413077339552f46 100644 (file)
@@ -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
index 200dcd42a3a0f819bc4581b8f9b82e0da9a3f962..f60f1b281cc46117c2cd2a03585ac8b21a8359dd 100644 (file)
@@ -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
index f49e28abe0abe59d987aec558d357dd78e2ec7f3..4cd438f948a82f4cd3a4a075d1245a26e308ca8a 100644 (file)
@@ -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
index ef0e13bf0b3a46911564e1ef7515740a77028574..14de3787cafcc7193abefe6e4c1c589988a76acc 100644 (file)
@@ -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 (file)
index 0000000..608aba9
--- /dev/null
@@ -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();
+}
index 7e6559105d40f27be8ffbdbc394cc377cec65ade..7b541e911ab4aebe99262ef74c8ec0fb6084c01c 100644 (file)
@@ -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);
index 83ad3fe0a75fc120676b19ebca1d896611076d5a..2a527c4de36c721d1b07d9937b1ed777d9ddbe6f 100644 (file)
@@ -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 */
index 4d1b86a49923bf7f28f004ad4bb8c4a3f902095f..47d83f7a70b6065d2053730ad14237622fcdad7f 100644 (file)
@@ -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);