ARM: S3C24XX: fix building without PM_SLEEP
authorArnd Bergmann <arnd@arndb.de>
Thu, 26 Feb 2015 20:50:22 +0000 (05:50 +0900)
committerKukjin Kim <kgene@kernel.org>
Thu, 26 Feb 2015 20:50:22 +0000 (05:50 +0900)
We get lots of link errors based on the assumption that
any s3c24xx kernel would enable CONFIG_PM_SLEEP if it
enables CONFIG_PM. This tries to clean that up.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
arch/arm/mach-s3c24xx/Kconfig
arch/arm/mach-s3c24xx/Makefile
arch/arm/mach-s3c24xx/pm-s3c2416.c
arch/arm/mach-s3c24xx/pm.c
arch/arm/mach-s3c24xx/s3c2410.c
arch/arm/mach-s3c24xx/s3c2412.c
arch/arm/mach-s3c24xx/s3c2416.c
arch/arm/mach-s3c24xx/s3c2440.c
arch/arm/mach-s3c24xx/s3c2442.c
arch/arm/mach-s3c24xx/s3c244x.c
arch/arm/plat-samsung/include/plat/pm.h

index 389173690716c32da77a31c18a065dc1dd67c27c..a6d3b5bcc4c237356c7fd18e907ba18cb1b31b90 100644 (file)
@@ -39,14 +39,14 @@ config CPU_S3C2412
        bool "SAMSUNG S3C2412"
        select CPU_ARM926T
        select S3C2412_COMMON_CLK
-       select S3C2412_PM if PM
+       select S3C2412_PM if PM_SLEEP
        help
          Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
 
 config CPU_S3C2416
        bool "SAMSUNG S3C2416/S3C2450"
        select CPU_ARM926T
-       select S3C2416_PM if PM
+       select S3C2416_PM if PM_SLEEP
        select S3C2443_COMMON_CLK
        help
          Support for the S3C2416 SoC from the S3C24XX line
@@ -55,7 +55,7 @@ config CPU_S3C2440
        bool "SAMSUNG S3C2440"
        select CPU_ARM920T
        select S3C2410_COMMON_CLK
-       select S3C2410_PM if PM
+       select S3C2410_PM if PM_SLEEP
        help
          Support for S3C2440 Samsung Mobile CPU based systems.
 
@@ -63,7 +63,7 @@ config CPU_S3C2442
        bool "SAMSUNG S3C2442"
        select CPU_ARM920T
        select S3C2410_COMMON_CLK
-       select S3C2410_PM if PM
+       select S3C2410_PM if PM_SLEEP
        help
          Support for S3C2442 Samsung Mobile CPU based systems.
 
index b40a22fe082ada4efb6e33c53a7fd20ddceca4b6..05920c8a5764737b845883030be776b6b1d9c122 100644 (file)
@@ -32,7 +32,8 @@ obj-$(CONFIG_CPU_S3C2443)     += s3c2443.o
 
 # PM
 
-obj-$(CONFIG_PM)               += pm.o irq-pm.o sleep.o
+obj-$(CONFIG_PM)               += pm.o
+obj-$(CONFIG_PM_SLEEP)         += irq-pm.o sleep.o
 
 # common code
 
index 44923895f558633251adc07ce589cfbcb8d86480..c0e328e37bd63927fd48b6cc415fef6bc86bdd44 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "s3c2412-power.h"
 
+#ifdef CONFIG_PM_SLEEP
 extern void s3c2412_sleep_enter(void);
 
 static int s3c2416_cpu_suspend(unsigned long arg)
@@ -70,7 +71,7 @@ static __init int s3c2416_pm_init(void)
 }
 
 arch_initcall(s3c2416_pm_init);
-
+#endif
 
 static void s3c2416_pm_resume(void)
 {
index b19256ec8d407cc4ee7dbf995db7f8498323a7ae..5d510bca0844005ae5f38c717319da1fa3948168 100644 (file)
@@ -50,6 +50,7 @@
 
 #define PFX "s3c24xx-pm: "
 
+#ifdef CONFIG_PM_SLEEP
 static struct sleep_save core_save[] = {
        /* we restore the timings here, with the proviso that the board
         * brings the system up in an slower, or equal frequency setting
@@ -67,6 +68,7 @@ static struct sleep_save core_save[] = {
        SAVE_ITEM(S3C2410_BANKCON4),
        SAVE_ITEM(S3C2410_BANKCON5),
 };
+#endif
 
 /* s3c_pm_check_resume_pin
  *
@@ -121,7 +123,7 @@ void s3c_pm_configure_extint(void)
        }
 }
 
-
+#ifdef CONFIG_PM_SLEEP
 void s3c_pm_restore_core(void)
 {
        s3c_pm_do_restore_core(core_save, ARRAY_SIZE(core_save));
@@ -131,4 +133,4 @@ void s3c_pm_save_core(void)
 {
        s3c_pm_do_save(core_save, ARRAY_SIZE(core_save));
 }
-
+#endif
index 2a6985a4a0ff8952b32e1d144d12416432e2c4d0..5061d66ca10cb47809ae9b33c62da0be52b1bc9e 100644 (file)
@@ -121,7 +121,7 @@ int __init s3c2410_init(void)
 {
        printk("S3C2410: Initialising architecture\n");
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&s3c2410_pm_syscore_ops);
        register_syscore_ops(&s3c24xx_irq_syscore_ops);
 #endif
index ecf2c77ab88b17c508417a928909af0bb0ec286d..64a13605cfc3d08b60bfb042fc7d6cba73882b34 100644 (file)
@@ -172,7 +172,7 @@ int __init s3c2412_init(void)
 {
        printk("S3C2412: Initialising architecture\n");
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&s3c2412_pm_syscore_ops);
        register_syscore_ops(&s3c24xx_irq_syscore_ops);
 #endif
index bfd4da86deb8e94d20698ceef91f06fd305a1ff2..3f8ca2a3ef176953d76e995cdb6e0edea23a271a 100644 (file)
@@ -98,7 +98,7 @@ int __init s3c2416_init(void)
        s3c_adc_setname("s3c2416-adc");
        s3c_rtc_setname("s3c2416-rtc");
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&s3c2416_pm_syscore_ops);
        register_syscore_ops(&s3c24xx_irq_syscore_ops);
        register_syscore_ops(&s3c2416_irq_syscore_ops);
index 03d379f1fc5255037679b070234851afaffef976..eb733555fab52d495be89fa14fba0407412ce13e 100644 (file)
@@ -57,11 +57,11 @@ int __init s3c2440_init(void)
 
        /* register suspend/resume handlers */
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&s3c2410_pm_syscore_ops);
        register_syscore_ops(&s3c24xx_irq_syscore_ops);
-#endif
        register_syscore_ops(&s3c244x_pm_syscore_ops);
+#endif
 
        /* register our system device for everything else */
 
index 7b043349f1c8297c6256ac2690d924d2e59d2c81..893998ede0223baf4a7709da0aa53029deaeed08 100644 (file)
@@ -60,11 +60,11 @@ int __init s3c2442_init(void)
 {
        printk("S3C2442: Initialising architecture\n");
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
        register_syscore_ops(&s3c2410_pm_syscore_ops);
        register_syscore_ops(&s3c24xx_irq_syscore_ops);
-#endif
        register_syscore_ops(&s3c244x_pm_syscore_ops);
+#endif
 
        return device_register(&s3c2442_dev);
 }
index 177f97802745fa133f4bef1ed001541a023d850c..b14119585dc727fa99ca1a70e23fc498093525dd 100644 (file)
@@ -108,7 +108,7 @@ static int __init s3c2442_core_init(void)
 core_initcall(s3c2442_core_init);
 
 
-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static struct sleep_save s3c244x_sleep[] = {
        SAVE_ITEM(S3C2440_DSC0),
        SAVE_ITEM(S3C2440_DSC1),
@@ -127,12 +127,9 @@ static void s3c244x_resume(void)
 {
        s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
 }
-#else
-#define s3c244x_suspend NULL
-#define s3c244x_resume  NULL
-#endif
 
 struct syscore_ops s3c244x_pm_syscore_ops = {
        .suspend        = s3c244x_suspend,
        .resume         = s3c244x_resume,
 };
+#endif
index e5a046dc22f508ae674135f2c6ebcd89eb965225..7f415ce74591487b3d4c3c689184b37fc7b49134 100644 (file)
@@ -43,7 +43,11 @@ extern unsigned long s3c_irqwake_eintmask;
 
 /* IRQ masks for IRQs allowed to go to sleep (see irq.c) */
 extern unsigned long s3c_irqwake_intallow;
+#ifdef CONFIG_PM_SLEEP
 extern unsigned long s3c_irqwake_eintallow;
+#else
+#define s3c_irqwake_eintallow 0
+#endif
 
 /* per-cpu sleep functions */
 
@@ -60,14 +64,18 @@ extern int s3c2410_cpu_suspend(unsigned long);
 
 #ifdef CONFIG_PM_SLEEP
 extern int s3c_irq_wake(struct irq_data *data, unsigned int state);
-extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
 extern void s3c_cpu_resume(void);
 #else
 #define s3c_irq_wake NULL
-#define s3c_irqext_wake NULL
 #define s3c_cpu_resume NULL
 #endif
 
+#ifdef CONFIG_SAMSUNG_PM
+extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
+#else
+#define s3c_irqext_wake NULL
+#endif
+
 #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK
 /**
  * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs