summaryrefslogtreecommitdiff
path: root/arch
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
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')
-rw-r--r--arch/arm/mach-mx5/pm.c9
-rw-r--r--arch/arm/plat-mxc/tzic.c4
-rw-r--r--arch/arm/plat-mxc/usb_common.c1
3 files changed, 13 insertions, 1 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");
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c
index bcca6ac465a2..8707744fd3d1 100644
--- a/arch/arm/plat-mxc/tzic.c
+++ b/arch/arm/plat-mxc/tzic.c
@@ -105,6 +105,10 @@ static int mxc_set_wake_irq(unsigned int irq, unsigned int enable)
return 0;
}
+void mxc_get_wake_irq(u32 * wake_src[])
+{
+ *wake_src = wakeup_intr;
+}
static struct irq_chip mxc_tzic_chip = {
.name = "MXC_TZIC",
diff --git a/arch/arm/plat-mxc/usb_common.c b/arch/arm/plat-mxc/usb_common.c
index c8b8ba41b559..2f5f597f806e 100644
--- a/arch/arm/plat-mxc/usb_common.c
+++ b/arch/arm/plat-mxc/usb_common.c
@@ -447,7 +447,6 @@ static int usb_register_remote_wakeup(struct platform_device *pdev)
}
irq = res->start;
pdev->dev.power.can_wakeup = 1;
- enable_irq_wake(irq);
return 0;
}