public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC 1/2] OMAP2+: powerdomain: add API to get context loss count
@ 2010-12-10  0:08 Kevin Hilman
  2010-12-10  0:08 ` [PATCH/RFC 2/2] OMAP: PM: implement context loss count APIs Kevin Hilman
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kevin Hilman @ 2010-12-10  0:08 UTC (permalink / raw)
  To: linux-omap; +Cc: Paul Walmsely

Add new powerdomain API

    int pwrdm_get_context_loss_count(struct powerdomain *pwrdm)

for checking how many times the powerdomain has lost context.  The
loss count is the sum sum of the powerdomain off-mode counter, the
logic off counter and the per-bank memory off counter.

Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/powerdomain.c |   23 +++++++++++++++++++++++
 arch/arm/mach-omap2/powerdomain.h |    1 +
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 06ef60e..78e7d22 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -909,3 +909,26 @@ int pwrdm_post_transition(void)
 	pwrdm_for_each(_pwrdm_post_transition_cb, NULL);
 	return 0;
 }
+
+/**
+ * pwrdm_get_context_loss_count - get powerdomain's context loss count
+ * @pwrdm: struct powerdomain * to wait for
+ *
+ * Context loss count is a sum of powerdomain off-mode counter,
+ * the logic off counter and the per-bank memory off counter.
+ */
+int pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
+{
+	int i, count;
+
+	count = pwrdm->state_counter[PWRDM_POWER_OFF];
+	count += pwrdm->ret_logic_off_counter;
+
+	for (i = 0; i < pwrdm->banks; i++)
+		count += pwrdm->ret_mem_off_counter[i];
+
+	pr_debug("powerdomain: %s: context loss count = %u\n",
+		 pwrdm->name, count);
+
+	return count;
+}
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 35b5b48..d269eff 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -211,6 +211,7 @@ int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
 int pwrdm_pre_transition(void);
 int pwrdm_post_transition(void);
 int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
+int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
 
 extern void omap2xxx_powerdomains_init(void);
 extern void omap3xxx_powerdomains_init(void);
-- 
1.7.2.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-12-15  3:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10  0:08 [PATCH/RFC 1/2] OMAP2+: powerdomain: add API to get context loss count Kevin Hilman
2010-12-10  0:08 ` [PATCH/RFC 2/2] OMAP: PM: implement context loss count APIs Kevin Hilman
2010-12-10 11:28   ` Vishwanath Sripathy
2010-12-11  0:43     ` Kevin Hilman
2010-12-11  7:13       ` Vishwanath Sripathy
2010-12-13 10:43     ` Paul Walmsley
2010-12-13 13:48       ` Vishwanath Sripathy
2010-12-13 19:39         ` Paul Walmsley
2010-12-15  3:35   ` Paul Walmsley
2010-12-10  1:32 ` [PATCH/RFC 3/2] OMAP: PM noop: implement context loss count for non-omap_devices Kevin Hilman
2010-12-15  3:39   ` Paul Walmsley
2010-12-15  3:23 ` [PATCH/RFC 1/2] OMAP2+: powerdomain: add API to get context loss count Paul Walmsley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox