Merge branch 'work.gfs2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / arch / arm / mach-at91 / pm_suspend.S
index 9c9e08f..cbd61a3 100644 (file)
@@ -106,6 +106,12 @@ lp_done_\ena:
 #endif
        .endm
 
+       .macro at91_backup_set_lpm reg
+#ifdef CONFIG_SOC_SAMA7
+       orr     \reg, \reg, #0x200000
+#endif
+       .endm
+
        .text
 
        .arm
@@ -980,10 +986,16 @@ ulp_exit:
        mov     tmp1, #0x1
        str     tmp1, [r0, #0x10]
 
+       /* Wait for it. */
+1:     ldr     tmp1, [r0, #0x10]
+       tst     tmp1, #0x1
+       beq     1b
+
        /* Shutdown */
        ldr     r0, .shdwc
        mov     tmp1, #0xA5000000
        add     tmp1, tmp1, #0x1
+       at91_backup_set_lpm tmp1
        str     tmp1, [r0, #0]
 .endm