* Bringing back gptimer_wakeup @ 2012-06-18 9:18 Tasslehoff Kjappfot 2012-06-18 10:00 ` Shilimkar, Santosh 2012-06-18 18:01 ` Kevin Hilman 0 siblings, 2 replies; 6+ messages in thread From: Tasslehoff Kjappfot @ 2012-06-18 9:18 UTC (permalink / raw) To: linux-omap 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/linux-omap@vger.kernel.org/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? Regards, Tasslehoff ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bringing back gptimer_wakeup 2012-06-18 9:18 Bringing back gptimer_wakeup Tasslehoff Kjappfot @ 2012-06-18 10:00 ` Shilimkar, Santosh 2012-06-18 18:01 ` Kevin Hilman 1 sibling, 0 replies; 6+ messages in thread From: Shilimkar, Santosh @ 2012-06-18 10:00 UTC (permalink / raw) To: Tasslehoff Kjappfot; +Cc: linux-omap On Mon, Jun 18, 2012 at 2:48 PM, Tasslehoff Kjappfot <tasskjapp@gmail.com> 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/linux-omap@vger.kernel.org/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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: Bringing back gptimer_wakeup 2012-06-18 9:18 Bringing back gptimer_wakeup Tasslehoff Kjappfot 2012-06-18 10:00 ` Shilimkar, Santosh @ 2012-06-18 18:01 ` Kevin Hilman 2012-06-19 6:07 ` Shilimkar, Santosh 2012-06-28 14:00 ` Kevin Hilman 1 sibling, 2 replies; 6+ messages in thread From: Kevin Hilman @ 2012-06-18 18:01 UTC (permalink / raw) To: Tasslehoff Kjappfot; +Cc: linux-omap Tasslehoff Kjappfot <tasskjapp@gmail.com> writes: > 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/linux-omap@vger.kernel.org/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? The branch below (based on v3.4) will work (at least on OMAP3) We've been holding off on putting this back becasue the timer interface has been going through some major cleanup/rework, but I would like to see this make it back in soonish. Kevin git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git pm-wip/wakeup-timer ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bringing back gptimer_wakeup 2012-06-18 18:01 ` Kevin Hilman @ 2012-06-19 6:07 ` Shilimkar, Santosh 2012-06-19 8:24 ` Tasslehoff Kjappfot 2012-06-28 14:00 ` Kevin Hilman 1 sibling, 1 reply; 6+ messages in thread From: Shilimkar, Santosh @ 2012-06-19 6:07 UTC (permalink / raw) To: Kevin Hilman; +Cc: Tasslehoff Kjappfot, linux-omap On Mon, Jun 18, 2012 at 11:31 PM, Kevin Hilman <khilman@ti.com> wrote: > Tasslehoff Kjappfot <tasskjapp@gmail.com> writes: > >> 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/linux-omap@vger.kernel.org/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? > > The branch below (based on v3.4) will work (at least on OMAP3) > > We've been holding off on putting this back becasue the timer interface > has been going through some major cleanup/rework, but I would like to > see this make it back in soonish. > I got an off-list message from Tasslehoff, that the patch I sent worked for him. Regards Santosh ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bringing back gptimer_wakeup 2012-06-19 6:07 ` Shilimkar, Santosh @ 2012-06-19 8:24 ` Tasslehoff Kjappfot 0 siblings, 0 replies; 6+ messages in thread From: Tasslehoff Kjappfot @ 2012-06-19 8:24 UTC (permalink / raw) To: Shilimkar, Santosh; +Cc: Kevin Hilman, linux-omap On 06/19/2012 08:07 AM, Shilimkar, Santosh wrote: > On Mon, Jun 18, 2012 at 11:31 PM, Kevin Hilman<khilman@ti.com> wrote: >> Tasslehoff Kjappfot<tasskjapp@gmail.com> writes: >> >>> 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/linux-omap@vger.kernel.org/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? >> >> The branch below (based on v3.4) will work (at least on OMAP3) >> >> We've been holding off on putting this back becasue the timer interface >> has been going through some major cleanup/rework, but I would like to >> see this make it back in soonish. >> > I got an off-list message from Tasslehoff, that the patch I sent worked for him. > > Regards > Santosh Ah, that was meant to be an on-list message. Santosh' fix worked well on my 3.2.18 kernel. - Tasslehoff ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Bringing back gptimer_wakeup 2012-06-18 18:01 ` Kevin Hilman 2012-06-19 6:07 ` Shilimkar, Santosh @ 2012-06-28 14:00 ` Kevin Hilman 1 sibling, 0 replies; 6+ messages in thread From: Kevin Hilman @ 2012-06-28 14:00 UTC (permalink / raw) To: Tasslehoff Kjappfot; +Cc: linux-omap Kevin Hilman <khilman@ti.com> writes: > Tasslehoff Kjappfot <tasskjapp@gmail.com> writes: > >> 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/linux-omap@vger.kernel.org/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? > > The branch below (based on v3.4) will work (at least on OMAP3) > > We've been holding off on putting this back becasue the timer interface > has been going through some major cleanup/rework, but I would like to > see this make it back in soonish. Note that another feature that can be used for this same feature is wakeup using RTC. On OMAP3 platoforms with TWL4030 PMIC (which contains an RTC), this is successfully working using the 'rtcwake' utility. E.g., to suspend-to-RAM and trigger an RTC wakeup 4 seconds later, do: # rtcwake -m mem -s 4 The RTC timekeeping seems a bit broken and the actual delay seems to be about 2x the value passed in here, but otherwise this works. There are currently some problems with the OMAP4 RTC driver that prevent this from working, but they need to be investigated. Kevin ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-06-28 14:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-06-18 9:18 Bringing back gptimer_wakeup Tasslehoff Kjappfot 2012-06-18 10:00 ` Shilimkar, Santosh 2012-06-18 18:01 ` Kevin Hilman 2012-06-19 6:07 ` Shilimkar, Santosh 2012-06-19 8:24 ` Tasslehoff Kjappfot 2012-06-28 14:00 ` Kevin Hilman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox