On Mon, Jun 18, 2012 at 2:48 PM, Tasslehoff Kjappfot
<[email protected]> wrote:
> The support for using a timer to wake from suspend was removed in:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=98e182a26bbbf5575457622337684ef61493e864
>
> I found an alternative patch
> (http://www.mail-archive.com/[email protected]/msg47836.html) that
> claimed to keep it working using GPTIMER1 instead, but I haven't been able
> to make it work (likely because the timer code has changed a good deal since
> the patch was posted).
>
> Anyone got
> a) a patch that enables this feature on newer kernels, or
> b) an idea how the patch above can be made to work?
>
I had one working against 3.4. may be you can try this out and see it helps.
Regards
Santosh
---
arch/arm/mach-omap2/pm-debug.c | 5 +++++
arch/arm/mach-omap2/timer.c | 12 ++++++++++++
2 files changed, 17 insertions(+)
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 814bcd9..8f59a70 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -39,6 +39,7 @@
#include "pm.h"
u32 enable_off_mode;
+u32 wakeup_timer_seconds = 0;
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
@@ -276,6 +277,10 @@ static int __init pm_dbg_init(void)
(void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,
&enable_off_mode, &pm_dbg_option_fops);
+
+ (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,
+ &wakeup_timer_seconds, &pm_dbg_option_fops);
+
pm_dbg_init_done = 1;
return 0;
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index b28ea5e..31a0628 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -82,6 +82,9 @@
#define MAX_GPTIMER_ID 12
static u32 sys_timer_reserved;
+#ifdef CONFIG_PM_DEBUG
+extern u32 wakeup_timer_seconds;
+#endif
/* Clockevent code */
@@ -138,6 +141,15 @@ static void omap2_gp_timer_set_mode(enum
clock_event_mode mode,
break;
case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN:
+#ifdef CONFIG_PM_DEBUG
+ if (wakeup_timer_seconds) {
+ __omap_dm_timer_write(&clkev, OMAP_TIMER_LOAD_REG,
+ 0xffffffff - (clkev.rate * wakeup_timer_seconds), 1);
+ __omap_dm_timer_load_start(&clkev, OMAP_TIMER_CTRL_ST,
+ 0xffffffff - (clkev.rate * wakeup_timer_seconds), 1);
+ }
+#endif
+ break;
case CLOCK_EVT_MODE_RESUME:
break;
}
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html