Re: [PATCH/RFC 4/4] OMAP2: PM debug: move wakeup timer into clockevent code

2011-05-30 Thread Santosh Shilimkar

Kevin,

On 5/27/2011 10:48 AM, Santosh Shilimkar wrote:

On 5/27/2011 4:32 AM, Kevin Hilman wrote:

Move suspend wakeup timer from suspend path to be triggered based
on clockevent suspend path.

When gptimers are eventually converted to be a driver, the wakeup
timer feature can be made to be a driver-specific feature using the
driver's suspend method.


Excellent idea and patch. Never crossed my mind that we could
have used CLOCK_EVT_MODE_SHUTDOWN instead of our long old
hack.


Acked-by: Santosh Shilimkar santosh.shilim...@ti.com


I will use this patch and other series for my OMAP4 re-basing
since it's all necessary and good clean-up.

Is that ok with you ?

Regards
Santosh




--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC 4/4] OMAP2: PM debug: move wakeup timer into clockevent code

2011-05-30 Thread Jean Pihet
On Mon, May 30, 2011 at 9:21 AM, Santosh Shilimkar
santosh.shilim...@ti.com wrote:
 Kevin,

 On 5/27/2011 10:48 AM, Santosh Shilimkar wrote:

 On 5/27/2011 4:32 AM, Kevin Hilman wrote:

 Move suspend wakeup timer from suspend path to be triggered based
 on clockevent suspend path.

 When gptimers are eventually converted to be a driver, the wakeup
 timer feature can be made to be a driver-specific feature using the
 driver's suspend method.

 Excellent idea and patch. Never crossed my mind that we could
 have used CLOCK_EVT_MODE_SHUTDOWN instead of our long old
 hack.

Great!
Acked-by: Jean Pihet j-pi...@ti.com

What platform has is been tested on?

Regards,
Jean


 Acked-by: Santosh Shilimkar santosh.shilim...@ti.com


 I will use this patch and other series for my OMAP4 re-basing
 since it's all necessary and good clean-up.

 Is that ok with you ?

 Regards
 Santosh




 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC 4/4] OMAP2: PM debug: move wakeup timer into clockevent code

2011-05-30 Thread Santosh Shilimkar

On 5/30/2011 1:38 PM, Jean Pihet wrote:

On Mon, May 30, 2011 at 9:21 AM, Santosh Shilimkar
santosh.shilim...@ti.com  wrote:

Kevin,

On 5/27/2011 10:48 AM, Santosh Shilimkar wrote:


On 5/27/2011 4:32 AM, Kevin Hilman wrote:


Move suspend wakeup timer from suspend path to be triggered based
on clockevent suspend path.

When gptimers are eventually converted to be a driver, the wakeup
timer feature can be made to be a driver-specific feature using the
driver's suspend method.


Excellent idea and patch. Never crossed my mind that we could
have used CLOCK_EVT_MODE_SHUTDOWN instead of our long old
hack.


Great!
Acked-by: Jean Pihetj-pi...@ti.com

What platform has is been tested on?


I tried thos on OMAP4430 and it works as expected.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH/RFC 4/4] OMAP2: PM debug: move wakeup timer into clockevent code

2011-05-26 Thread Kevin Hilman
Move suspend wakeup timer from suspend path to be triggered based
on clockevent suspend path.

When gptimers are eventually converted to be a driver, the wakeup
timer feature can be made to be a driver-specific feature using the
driver's suspend method.

Signed-off-by: Kevin Hilman khil...@ti.com
---
 arch/arm/mach-omap2/pm-debug.c|   19 
 arch/arm/mach-omap2/pm.h  |3 --
 arch/arm/mach-omap2/pm34xx.c  |4 ---
 arch/arm/mach-omap2/timer-gp.c|   33 ++--
 arch/arm/plat-omap/include/plat/dmtimer.h |1 -
 5 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 7c72f29..72dee22 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -39,25 +39,6 @@
 #include pm.h
 
 u32 enable_off_mode;
-u32 wakeup_timer_seconds;
-u32 wakeup_timer_milliseconds;
-
-void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
-{
-   u32 tick_rate, cycles;
-
-   if (!seconds  !milliseconds)
-   return;
-
-   tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
-   cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
-   omap_dm_timer_stop(gptimer_wakeup);
-   omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0x - cycles);
-
-   pr_info(PM: Resume timer in %u.%03u secs
-(%d ticks at %d ticks/sec.)\n,
-   seconds, milliseconds, cycles, tick_rate);
-}
 
 #ifdef CONFIG_DEBUG_FS
 #include linux/debugfs.h
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index dd1c2e4..803bf1c 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -57,13 +57,10 @@ extern int omap3_pm_set_suspend_state(struct powerdomain 
*pwrdm, int state);
 
 extern u32 wakeup_timer_seconds;
 extern u32 wakeup_timer_milliseconds;
-extern struct omap_dm_timer *gptimer_wakeup;
 
 #ifdef CONFIG_PM_DEBUG
-extern void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds);
 extern u32 enable_off_mode;
 #else
-#define omap2_pm_wakeup_on_timer(seconds, milliseconds)do {} while (0);
 #define enable_off_mode 0
 #endif
 
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 991ade6..a9d9bb1c8 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -532,10 +532,6 @@ static int omap3_pm_suspend(void)
struct power_state *pwrst;
int state, ret = 0;
 
-   if (wakeup_timer_seconds || wakeup_timer_milliseconds)
-   omap2_pm_wakeup_on_timer(wakeup_timer_seconds,
-wakeup_timer_milliseconds);
-
/* Read current next_pwrsts */
list_for_each_entry(pwrst, pwrst_list, node)
pwrst-saved_state = pwrdm_read_next_pwrst(pwrst-pwrdm);
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 3b9cf85..4de51a1 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -44,7 +44,7 @@
 #include plat/omap_hwmod.h
 
 #include timer-gp.h
-
+#include pm.h
 
 /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */
 #define MAX_GPTIMER_ID 12
@@ -53,7 +53,30 @@ static struct omap_dm_timer *gptimer;
 static struct clock_event_device clockevent_gpt;
 static u8 __initdata gptimer_id = 1;
 static u8 __initdata inited;
-struct omap_dm_timer *gptimer_wakeup;
+static struct omap_dm_timer *gptimer_wakeup;
+
+u32 wakeup_timer_seconds;
+u32 wakeup_timer_milliseconds;
+
+static void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
+{
+   u32 tick_rate, cycles;
+
+   if (!gptimer_wakeup)
+   return;
+
+   if (!seconds  !milliseconds)
+   return;
+
+   tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup));
+   cycles = tick_rate * seconds + tick_rate * milliseconds / 1000;
+   omap_dm_timer_stop(gptimer_wakeup);
+   omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0x - cycles);
+
+   pr_info(PM: Resume timer in %u.%03u secs
+(%d ticks at %d ticks/sec.)\n,
+   seconds, milliseconds, cycles, tick_rate);
+}
 
 static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id)
 {
@@ -95,8 +118,12 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode 
mode,
break;
case CLOCK_EVT_MODE_ONESHOT:
break;
-   case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_SHUTDOWN:
+   if (wakeup_timer_seconds || wakeup_timer_milliseconds)
+   omap2_pm_wakeup_on_timer(wakeup_timer_seconds,
+wakeup_timer_milliseconds);
+   break;
+   case CLOCK_EVT_MODE_UNUSED:
case CLOCK_EVT_MODE_RESUME:
break;
}
diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h 
b/arch/arm/plat-omap/include/plat/dmtimer.h
index 

Re: [PATCH/RFC 4/4] OMAP2: PM debug: move wakeup timer into clockevent code

2011-05-26 Thread Santosh Shilimkar

On 5/27/2011 4:32 AM, Kevin Hilman wrote:

Move suspend wakeup timer from suspend path to be triggered based
on clockevent suspend path.

When gptimers are eventually converted to be a driver, the wakeup
timer feature can be made to be a driver-specific feature using the
driver's suspend method.


Excellent idea and patch. Never crossed my mind that we could
have used CLOCK_EVT_MODE_SHUTDOWN instead of our long old
hack.

Regards
Santosh



--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html