Merge remote-tracking branch 'spi/fix/core' into spi-linus
[linux-drm-fsl-dcu.git] / arch / blackfin / mach-common / pm.c
index 87bfe549ad3f5044b8ce652434b98d00470672fc..1387a94bcfd5a30e68fb00d9e293eea7db710d98 100644 (file)
@@ -27,7 +27,7 @@ struct bfin_cpu_pm_fns *bfin_cpu_pm;
 
 void bfin_pm_suspend_standby_enter(void)
 {
-#ifndef CONFIG_BF60x
+#if !BFIN_GPIO_PINT
        bfin_pm_standby_setup();
 #endif
 
@@ -41,7 +41,7 @@ void bfin_pm_suspend_standby_enter(void)
 # endif
 #endif
 
-#ifndef CONFIG_BF60x
+#if !BFIN_GPIO_PINT
        bfin_pm_standby_restore();
 #endif
 
@@ -128,6 +128,7 @@ static void flushinv_all_dcache(void)
                                        if ((status & 0x3) != 0x3)
                                                continue;
 
+
                                        /* construct the address using the tag */
                                        addr = (status & 0xFFFFC800) | (subbank << 12) | (set << 5);
 
@@ -140,11 +141,14 @@ static void flushinv_all_dcache(void)
 
 int bfin_pm_suspend_mem_enter(void)
 {
-       int wakeup, ret;
+       int ret;
+#ifndef CONFIG_BF60x
+       int wakeup;
+#endif
 
        unsigned char *memptr = kmalloc(L1_CODE_LENGTH + L1_DATA_A_LENGTH
                                         + L1_DATA_B_LENGTH + L1_SCRATCH_LENGTH,
-                                         GFP_KERNEL);
+                                         GFP_ATOMIC);
 
        if (memptr == NULL) {
                panic("bf53x_suspend_l1_mem malloc failed");
@@ -170,10 +174,8 @@ int bfin_pm_suspend_mem_enter(void)
                return ret;
        }
 
+#ifdef CONFIG_GPIO_ADI
        bfin_gpio_pm_hibernate_suspend();
-
-#if BFIN_GPIO_PINT
-       bfin_pint_suspend();
 #endif
 
 #if defined(CONFIG_BFIN_EXTMEM_WRITEBACK) || defined(CONFIG_BFIN_L2_WRITEBACK)
@@ -194,11 +196,9 @@ int bfin_pm_suspend_mem_enter(void)
        _enable_icplb();
        _enable_dcplb();
 
-#if BFIN_GPIO_PINT
-       bfin_pint_resume();
-#endif
-
+#ifdef CONFIG_GPIO_ADI
        bfin_gpio_pm_hibernate_restore();
+#endif
        blackfin_dma_resume();
 
        kfree(memptr);