aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2012-05-11 19:00:24 -0400
committerKevin Hilman <khilman@ti.com>2012-06-25 14:22:48 -0400
commite055548953355b6e69c56f9e54388845b29b4e97 (patch)
treed9694b593408193e83574a1e49cb0c4908578182 /arch/arm/mach-omap2
parent9a17d88e0586bb7189655f8f99484a872a474626 (diff)
ARM: OMAP2+: powerdomain: allow pre/post transtion to be per pwrdm
Iteration over all power domains in the idle path is unnecessary since only power domains that are transitioning need to be accounted for. Also PRCM register accesses are known to be expensive, so the additional latency added to the idle path is signficiant. In order allow the pre/post transitions to be isolated and called per-pwrdm, change the API so passing in a specific power domain will trigger the pre/post transtion accounting for only that specific power domain. Passing NULL means iterating over all power domains as is current behavior. Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Tested-by: Grazvydas Ignotas <notasas@gmail.com> Acked-by: Paul Walmsley <paul@pwsan.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r--arch/arm/mach-omap2/omap-mpuss-lowpower.c4
-rw-r--r--arch/arm/mach-omap2/pm34xx.c4
-rw-r--r--arch/arm/mach-omap2/powerdomain.c16
-rw-r--r--arch/arm/mach-omap2/powerdomain.h4
4 files changed, 18 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
index 13670aa84e58..e35a86bf4e1d 100644
--- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c
+++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c
@@ -255,7 +255,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
255 return -ENXIO; 255 return -ENXIO;
256 } 256 }
257 257
258 pwrdm_pre_transition(); 258 pwrdm_pre_transition(NULL);
259 259
260 /* 260 /*
261 * Check MPUSS next state and save interrupt controller if needed. 261 * Check MPUSS next state and save interrupt controller if needed.
@@ -287,7 +287,7 @@ int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state)
287 wakeup_cpu = smp_processor_id(); 287 wakeup_cpu = smp_processor_id();
288 set_cpu_next_pwrst(wakeup_cpu, PWRDM_POWER_ON); 288 set_cpu_next_pwrst(wakeup_cpu, PWRDM_POWER_ON);
289 289
290 pwrdm_post_transition(); 290 pwrdm_post_transition(NULL);
291 291
292 return 0; 292 return 0;
293} 293}
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index e67d898433fb..0bbbc8c82fd8 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -273,7 +273,7 @@ void omap_sram_idle(void)
273 per_next_state = pwrdm_read_next_pwrst(per_pwrdm); 273 per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
274 core_next_state = pwrdm_read_next_pwrst(core_pwrdm); 274 core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
275 275
276 pwrdm_pre_transition(); 276 pwrdm_pre_transition(NULL);
277 277
278 /* PER */ 278 /* PER */
279 if (per_next_state < PWRDM_POWER_ON) { 279 if (per_next_state < PWRDM_POWER_ON) {
@@ -338,7 +338,7 @@ void omap_sram_idle(void)
338 } 338 }
339 omap3_intc_resume_idle(); 339 omap3_intc_resume_idle();
340 340
341 pwrdm_post_transition(); 341 pwrdm_post_transition(NULL);
342 342
343 /* PER */ 343 /* PER */
344 if (per_next_state < PWRDM_POWER_ON) 344 if (per_next_state < PWRDM_POWER_ON)
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index 96114901b932..eefe179045e6 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -981,15 +981,23 @@ int pwrdm_state_switch(struct powerdomain *pwrdm)
981 return ret; 981 return ret;
982} 982}
983 983
984int pwrdm_pre_transition(void) 984int pwrdm_pre_transition(struct powerdomain *pwrdm)
985{ 985{
986 pwrdm_for_each(_pwrdm_pre_transition_cb, NULL); 986 if (pwrdm)
987 _pwrdm_pre_transition_cb(pwrdm, NULL);
988 else
989 pwrdm_for_each(_pwrdm_pre_transition_cb, NULL);
990
987 return 0; 991 return 0;
988} 992}
989 993
990int pwrdm_post_transition(void) 994int pwrdm_post_transition(struct powerdomain *pwrdm)
991{ 995{
992 pwrdm_for_each(_pwrdm_post_transition_cb, NULL); 996 if (pwrdm)
997 _pwrdm_post_transition_cb(pwrdm, NULL);
998 else
999 pwrdm_for_each(_pwrdm_post_transition_cb, NULL);
1000
993 return 0; 1001 return 0;
994} 1002}
995 1003
diff --git a/arch/arm/mach-omap2/powerdomain.h b/arch/arm/mach-omap2/powerdomain.h
index 8f88d65c46ea..a6a4604801ad 100644
--- a/arch/arm/mach-omap2/powerdomain.h
+++ b/arch/arm/mach-omap2/powerdomain.h
@@ -213,8 +213,8 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm);
213int pwrdm_wait_transition(struct powerdomain *pwrdm); 213int pwrdm_wait_transition(struct powerdomain *pwrdm);
214 214
215int pwrdm_state_switch(struct powerdomain *pwrdm); 215int pwrdm_state_switch(struct powerdomain *pwrdm);
216int pwrdm_pre_transition(void); 216int pwrdm_pre_transition(struct powerdomain *pwrdm);
217int pwrdm_post_transition(void); 217int pwrdm_post_transition(struct powerdomain *pwrdm);
218int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm); 218int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
219int pwrdm_get_context_loss_count(struct powerdomain *pwrdm); 219int pwrdm_get_context_loss_count(struct powerdomain *pwrdm);
220bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm); 220bool pwrdm_can_ever_lose_context(struct powerdomain *pwrdm);