ARM: S3C24XX: create dedicated irq init functions for s3c2440 and s3c2442
authorHeiko Stuebner <heiko@sntech.de>
Tue, 12 Feb 2013 17:59:20 +0000 (09:59 -0800)
committerKukjin Kim <kgene.kim@samsung.com>
Tue, 5 Mar 2013 11:20:33 +0000 (20:20 +0900)
s3c2440 and s3c2442 need separate init functions, as the s3c2440 contains
even more differing irqs that will be moved in the following patch.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
arch/arm/mach-s3c24xx/common.h
arch/arm/mach-s3c24xx/irq.c
arch/arm/mach-s3c24xx/mach-anubis.c
arch/arm/mach-s3c24xx/mach-at2440evb.c
arch/arm/mach-s3c24xx/mach-gta02.c
arch/arm/mach-s3c24xx/mach-mini2440.c
arch/arm/mach-s3c24xx/mach-nexcoder.c
arch/arm/mach-s3c24xx/mach-osiris.c
arch/arm/mach-s3c24xx/mach-rx1950.c
arch/arm/mach-s3c24xx/mach-rx3715.c
arch/arm/mach-s3c24xx/mach-smdk2440.c

index 8a2b4137ddb684951bcc59879c93830627d19d49..362a8cd32eb0cb840db5ac1549a7f38ab901bcf9 100644 (file)
@@ -73,6 +73,7 @@ extern void s3c244x_restart(char mode, const char *cmd);
 #ifdef CONFIG_CPU_S3C2440
 extern  int s3c2440_init(void);
 extern void s3c2440_map_io(void);
+extern void s3c2440_init_irq(void);
 #else
 #define s3c2440_init NULL
 #define s3c2440_map_io NULL
@@ -81,6 +82,7 @@ extern void s3c2440_map_io(void);
 #ifdef CONFIG_CPU_S3C2442
 extern  int s3c2442_init(void);
 extern void s3c2442_map_io(void);
+extern void s3c2442_init_irq(void);
 #else
 #define s3c2442_init NULL
 #define s3c2442_map_io NULL
index 1fea3ddd123db53cd1bbe71602fd258d23d6be1f..2c59b2d99a81c2ab8f425de28fc8dad203c82859 100644 (file)
@@ -783,10 +783,13 @@ static struct irq_chip s3c_irq_cam = {
        .irq_ack        = s3c_irq_cam_ack,
 };
 
-static int s3c244x_irq_add(struct device *dev, struct subsys_interface *sif)
+#ifdef CONFIG_CPU_S3C2440
+void __init s3c2440_init_irq(void)
 {
        unsigned int irqno;
 
+       s3c24xx_init_irq();
+
        irq_set_chip_and_handler(IRQ_NFCON, &s3c_irq_level_chip,
                                 handle_level_irq);
        set_irq_flags(IRQ_NFCON, IRQF_VALID);
@@ -802,36 +805,34 @@ static int s3c244x_irq_add(struct device *dev, struct subsys_interface *sif)
                                         handle_level_irq);
                set_irq_flags(irqno, IRQF_VALID);
        }
-
-       return 0;
 }
+#endif
 
-static struct subsys_interface s3c2440_irq_interface = {
-       .name           = "s3c2440_irq",
-       .subsys         = &s3c2440_subsys,
-       .add_dev        = s3c244x_irq_add,
-};
-
-static int s3c2440_irq_init(void)
+#ifdef CONFIG_CPU_S3C2442
+void __init s3c2442_init_irq(void)
 {
-       return subsys_interface_register(&s3c2440_irq_interface);
-}
+       unsigned int irqno;
 
-arch_initcall(s3c2440_irq_init);
+       s3c24xx_init_irq();
 
-static struct subsys_interface s3c2442_irq_interface = {
-       .name           = "s3c2442_irq",
-       .subsys         = &s3c2442_subsys,
-       .add_dev        = s3c244x_irq_add,
-};
+       irq_set_chip_and_handler(IRQ_NFCON, &s3c_irq_level_chip,
+                                handle_level_irq);
+       set_irq_flags(IRQ_NFCON, IRQF_VALID);
 
+       /* add chained handler for camera */
 
-static int s3c2442_irq_init(void)
-{
-       return subsys_interface_register(&s3c2442_irq_interface);
+       irq_set_chip_and_handler(IRQ_CAM, &s3c_irq_level_chip,
+                                handle_level_irq);
+       irq_set_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
+
+       for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
+               irq_set_chip_and_handler(irqno, &s3c_irq_cam,
+                                        handle_level_irq);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
 }
+#endif
 
-arch_initcall(s3c2442_irq_init);
 #endif
 
 #ifdef CONFIG_CPU_S3C2443
index 24f1a04ccc88da039b53bedceaa88459ee923d09..c1fb6c37867f2ad54af7da5f379acd031d55784e 100644 (file)
@@ -445,7 +445,7 @@ MACHINE_START(ANUBIS, "Simtec-Anubis")
        .atag_offset    = 0x100,
        .map_io         = anubis_map_io,
        .init_machine   = anubis_init,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 2bf6c8c243176a437d48cb8c2425c2c36bbe2065..6dfeeb7ef4693a8fd8f86a06c770c7d66175580a 100644 (file)
@@ -211,7 +211,7 @@ MACHINE_START(AT2440EVB, "AT2440EVB")
        .atag_offset    = 0x100,
        .map_io         = at2440evb_map_io,
        .init_machine   = at2440evb_init,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 84a750d46d4bd498c21f38838f5ac2de8185164f..13d8d073675a577d7b5de70b709cbd1c8a848743 100644 (file)
@@ -589,7 +589,7 @@ MACHINE_START(NEO1973_GTA02, "GTA02")
        /* Maintainer: Nelson Castillo <arhuaco@freaks-unidos.net> */
        .atag_offset    = 0x100,
        .map_io         = gta02_map_io,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2442_init_irq,
        .init_machine   = gta02_machine_init,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
index 29f106cb370e949988290e1cc40158c7e439e495..a83db46320bc6d1e8345ebee8aefd3845f9b347f 100644 (file)
@@ -688,7 +688,7 @@ MACHINE_START(MINI2440, "MINI2440")
        .atag_offset    = 0x100,
        .map_io         = mini2440_map_io,
        .init_machine   = mini2440_init,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 5c826d10a66d2f1499b3ed8465c341b549f62afb..01f4354206f99e9f423d2bc31f3c8d0fa37712ef 100644 (file)
@@ -152,7 +152,7 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
        .atag_offset    = 0x100,
        .map_io         = nexcoder_map_io,
        .init_machine   = nexcoder_init,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
 MACHINE_END
index 4c90ffda4e11c90dc10079206a54c4b5be622bfc..58d6fbe5bf1fc7b59cde5de87eb99cbf573dbdde 100644 (file)
@@ -426,7 +426,7 @@ MACHINE_START(OSIRIS, "Simtec-OSIRIS")
        /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
        .atag_offset    = 0x100,
        .map_io         = osiris_map_io,
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_machine   = osiris_init,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
index 799af43b4e6a1f80dd830f70ff08c688a1d8ec6e..e4d67a33ebee77d9d2dc5bb2de28d680a216c1c6 100644 (file)
@@ -813,7 +813,7 @@ MACHINE_START(RX1950, "HP iPAQ RX1950")
        .atag_offset = 0x100,
        .map_io = rx1950_map_io,
        .reserve        = rx1950_reserve,
-       .init_irq = s3c24xx_init_irq,
+       .init_irq       = s3c2442_init_irq,
        .init_machine = rx1950_init_machine,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
index 0a3c96452f0f7e823ae7acd09f7514f65e93bf81..3bc6231d0a1fc1becb922de1ccab7c4b08581d86 100644 (file)
@@ -190,11 +190,6 @@ static void __init rx3715_reserve(void)
        memblock_reserve(0x30081000, 0x1000);
 }
 
-static void __init rx3715_init_irq(void)
-{
-       s3c24xx_init_irq();
-}
-
 static void __init rx3715_init_machine(void)
 {
 #ifdef CONFIG_PM_H1940
@@ -212,7 +207,7 @@ MACHINE_START(RX3715, "IPAQ-RX3715")
        .atag_offset    = 0x100,
        .map_io         = rx3715_map_io,
        .reserve        = rx3715_reserve,
-       .init_irq       = rx3715_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .init_machine   = rx3715_init_machine,
        .init_time      = samsung_timer_init,
        .restart        = s3c244x_restart,
index f56cb08e6d1cf78d3babf0dc90334a30a0df7b1c..de2e5d39a8471b490a90be86ea966c6b835ba02a 100644 (file)
@@ -177,7 +177,7 @@ MACHINE_START(S3C2440, "SMDK2440")
        /* Maintainer: Ben Dooks <ben-linux@fluff.org> */
        .atag_offset    = 0x100,
 
-       .init_irq       = s3c24xx_init_irq,
+       .init_irq       = s3c2440_init_irq,
        .map_io         = smdk2440_map_io,
        .init_machine   = smdk2440_machine_init,
        .init_time      = samsung_timer_init,