summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-23 14:13:29 +0200
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-06-23 14:31:10 +0200
commita7ffa03d4fd492441def38a3c770615b342c7e6a (patch)
tree583ab7e1873a34a2b2a18b6680a24e1f269a4b5f /arch/arm/mach-mx5
parent436bc07e9deda38533233e1b1d822f0b360d1f60 (diff)
ccwmx51: Do not unconditionally set the PMIC as a suspend wake up source
This behaviour was causing that even when the user has not explicitely set a wakeup source the system was suspending without a way to awake. With this change the RTC wake up source is set up when its suspend method is called, making it possible to check for enabled wake up sources on the platform suspend enter. Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/pm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/pm.c b/arch/arm/mach-mx5/pm.c
index c257e049bd9f..a63d6e725e8f 100644
--- a/arch/arm/mach-mx5/pm.c
+++ b/arch/arm/mach-mx5/pm.c
@@ -26,6 +26,7 @@
#include <asm/mach/map.h>
#include <mach/hardware.h>
#include "crm_regs.h"
+#include "mach/irqs.h"
static struct cpu_wp *cpu_wp_tbl;
static struct clk *cpu_clk;
@@ -50,6 +51,14 @@ void (*suspend_in_iram)(void *sdclk_iomux_addr) = NULL;
static int mx51_suspend_enter(suspend_state_t state)
{
void __iomem *sdclk_iomux_addr = IO_ADDRESS(IOMUXC_BASE_ADDR + 0x4b8);
+ u32 * wake_src;
+
+ /* Check that we have a wake up source. We don't want to suspend if not.*/
+ mxc_get_wake_irq(&wake_src);
+ if ( !wake_src[0] && !wake_src[1] && !wake_src[2] && !wake_src[3] ) {
+ printk(KERN_ERR "No sources enabled for wake-up! Sleep abort.\n");
+ return -EINVAL;
+ }
if (gpc_dvfs_clk == NULL)
gpc_dvfs_clk = clk_get(NULL, "gpc_dvfs_clk");