aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/powerdomain.c29
-rw-r--r--arch/arm/mach-omap2/powerdomain.h1
2 files changed, 30 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 06ef60eebebd..eaed0df16699 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -909,3 +909,32 @@ int pwrdm_post_transition(void)
909 pwrdm_for_each(_pwrdm_post_transition_cb, NULL); 909 pwrdm_for_each(_pwrdm_post_transition_cb, NULL);
910 return 0; 910 return 0;
911} 911}
912
913/**
914 * pwrdm_get_context_loss_count - get powerdomain's context loss count
915 * @pwrdm: struct powerdomain * to wait for
916 *
917 * Context loss count is the sum of powerdomain off-mode counter, the
918 * logic off counter and the per-bank memory off counter. Returns 0
919 * (and WARNs) upon error, otherwise, returns the context loss count.
920 */
921u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm)
922{
923 int i, count;
924
925 if (!pwrdm) {
926 WARN(1, "powerdomain: %s: pwrdm is null\n", __func__);
927 return 0;
928 }
929
930 count = pwrdm->state_counter[PWRDM_POWER_OFF];
931 count += pwrdm->ret_logic_off_counter;
932
933 for (i = 0; i < pwrdm->banks; i++)
934 count += pwrdm->ret_mem_off_counter[i];
935
936 pr_debug("powerdomain: %s: context loss count = %u\n",
937 pwrdm->name, count);
938
939 return count;
940}
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 35b5b4800a43..c66431edfeb7 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);
211int pwrdm_pre_transition(void); 211int pwrdm_pre_transition(void);
212int pwrdm_post_transition(void); 212int pwrdm_post_transition(void);
213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 213int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
214u32 pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
214 215
215extern void omap2xxx_powerdomains_init(void); 216extern void omap2xxx_powerdomains_init(void);
216extern void omap3xxx_powerdomains_init(void); 217extern void omap3xxx_powerdomains_init(void);