linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jean.pihet@newoldbits.com
To: linux-omap@vger.kernel.org
Subject: [PATCH 08/13] OMAP2+: PM: provide the next timer event API to PM modules
Date: Wed, 18 May 2011 19:32:25 +0200	[thread overview]
Message-ID: <1305739950-11695-9-git-send-email-j-pihet@ti.com> (raw)
In-Reply-To: <1305739950-11695-1-git-send-email-j-pihet@ti.com>

From: Jean Pihet <j-pihet@ti.com>

Provide omap_pm_tick_nohz_get_sleep_length_us so that the code
from the OMAP PM modules can use it.

Signed-off-by: Jean Pihet <j-pihet@ti.com>
---
 arch/arm/mach-omap2/pm-debug.c |    7 ++++---
 arch/arm/mach-omap2/pm.c       |   15 +++++++++++++++
 arch/arm/mach-omap2/pm.h       |   12 ++++++++----
 3 files changed, 27 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 0b896d4..24e5c31 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -141,9 +141,10 @@ void omap2_pm_dump(int mode, int resume, unsigned int us)
 	if (!resume)
 #ifdef CONFIG_NO_HZ
 		printk(KERN_INFO
-		       "--- Going to %s %s (next timer after %u ms)\n", s1, s2,
-		       jiffies_to_msecs(get_next_timer_interrupt(jiffies) -
-					jiffies));
+		       "--- Going to %s %s (next timer after %lu ms)\n", s1, s2,
+		       DIV_ROUND_UP(omap_pm_tick_nohz_get_sleep_length_us(),
+				    1000)
+		      );
 #else
 		printk(KERN_INFO "--- Going to %s %s\n", s1, s2);
 #endif
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 37a4801..0c451e3 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -14,6 +14,8 @@
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/opp.h>
+#include <linux/hrtimer.h>
+#include <linux/tick.h>
 
 #include <plat/omap-pm.h>
 #include <plat/omap_device.h>
@@ -30,6 +32,7 @@ static struct omap_device_pm_latency *pm_lats;
 struct cpuidle_params *cpuidle_params_override_table;
 #endif
 
+#ifdef CONFIG_PM_DEBUG
 u32 enable_off_mode;
 EXPORT_SYMBOL(enable_off_mode);
 
@@ -37,6 +40,7 @@ int omap2_pm_debug;
 u32 sleep_while_idle;
 u32 wakeup_timer_seconds;
 u32 wakeup_timer_milliseconds;
+#endif
 
 static struct device *mpu_dev;
 static struct device *iva_dev;
@@ -292,6 +296,7 @@ void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params)
 }
 #endif
 
+#ifdef CONFIG_PM_DEBUG
 void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
 {
 	u32 tick_rate, cycles;
@@ -308,4 +313,14 @@ void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds)
 		" (%d ticks at %d ticks/sec.)\n",
 		seconds, milliseconds, cycles, tick_rate);
 }
+EXPORT_SYMBOL(omap2_pm_wakeup_on_timer);
+#endif
+
+#ifdef CONFIG_NO_HZ
+unsigned long omap_pm_tick_nohz_get_sleep_length_us(void)
+{
+	return ktime_to_us(tick_nohz_get_sleep_length());
+}
+EXPORT_SYMBOL(omap_pm_tick_nohz_get_sleep_length_us);
+#endif
 
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h
index 03da7f8..70eb80e 100644
--- a/arch/arm/mach-omap2/pm.h
+++ b/arch/arm/mach-omap2/pm.h
@@ -68,11 +68,15 @@ extern int omap2_pm_debug;
 extern u32 enable_off_mode;
 extern u32 sleep_while_idle;
 #else
-#define omap2_pm_dump(mode, resume, us)		do {} while (0);
+#define omap2_pm_dump(mode, resume, us)			do {} while (0);
 #define omap2_pm_wakeup_on_timer(seconds, milliseconds)	do {} while (0);
-#define omap2_pm_debug				0
-#define enable_off_mode 0
-#define sleep_while_idle 0
+#define omap2_pm_debug					0
+#define enable_off_mode					0
+#define sleep_while_idle				0
+#endif
+
+#ifdef CONFIG_NO_HZ
+extern unsigned long omap_pm_tick_nohz_get_sleep_length_us(void);
 #endif
 
 #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS)
-- 
1.7.4.1


  parent reply	other threads:[~2011-05-18 17:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 17:32 [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules jean.pihet
2011-05-18 17:32 ` [PATCH 01/13] perf: export power_start and power_end tracepoints jean.pihet
2011-05-18 17:32 ` [PATCH 02/13] OMAP2+: PM: isolate PM code jean.pihet
2011-05-18 17:32 ` [PATCH 03/13] OMAP2+: PM: clean up usage of SRAM functions jean.pihet
2011-05-26 20:34   ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 04/13] OMAP2+: cpuidle: register the board specific C-states table jean.pihet
2011-05-18 17:32 ` [PATCH 05/13] OMAP2+: PM: move common code from pm-debug.c to pm.c jean.pihet
2011-05-18 17:32 ` [PATCH 06/13] OMAP2+: PM: isolate the scratchpad save function from the PM code jean.pihet
2011-05-18 17:32 ` [PATCH 07/13] OMAP2+: PM: move the powerdomains time stats to powerdomain code jean.pihet
2011-05-26 20:45   ` Kevin Hilman
2011-05-18 17:32 ` jean.pihet [this message]
2011-05-19  7:59   ` [PATCH 08/13] OMAP2+: PM: provide the next timer event API to PM modules Santosh Shilimkar
2011-05-19 12:02     ` Jean Pihet
2011-05-26 23:00   ` Kevin Hilman
2011-05-27  7:44     ` Jean Pihet
2011-05-18 17:32 ` [PATCH 09/13] OMAP2+: PM: export suspend_set_ops " jean.pihet
2011-05-26 23:09   ` Kevin Hilman
2011-05-27  7:48     ` Jean Pihet
2011-05-28  0:28       ` Kevin Hilman
2011-05-18 17:32 ` [PATCH 10/13] OMAP3: PM: export the v7_flush_dcache_all API to modules jean.pihet
2011-05-19  8:04   ` Santosh Shilimkar
2011-05-25 12:21     ` Jean Pihet
2011-05-18 17:32 ` [PATCH 11/13] OMAP2+: PM: implement modules insertion and removal code jean.pihet
2011-05-18 17:32 ` [PATCH 12/13] OMAP2+: PM: export functions and variables to PM modules jean.pihet
2011-05-19  8:32   ` Santosh Shilimkar
2011-05-18 17:32 ` [PATCH 13/13] OMAP2+: PM: build PM functionality as modules jean.pihet
2011-05-31  8:02 ` [RFC/PATCH 00/13] OMAP2+: PM: isolate PM code in modules Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305739950-11695-9-git-send-email-j-pihet@ti.com \
    --to=jean.pihet@newoldbits.com \
    --cc=linux-omap@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).