aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorKalle Jokiniemi <kalle.jokiniemi@digia.com>2009-03-26 09:59:01 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-11 17:42:28 -0500
commit3a7ec26bb44988051d97479f6dfcfd4942a99049 (patch)
tree30f561ad6a82dd0be1068ed93832ed31e8534138 /arch/arm/mach-omap2/pm34xx.c
parentc16c3f672defb7aca1276065375fe1ee5ca003dc (diff)
OMAP3: PM: Enable IO-CHAIN wakeup
OMAP 3430 ES3.1 chips have a separate bit for IO daisy-chain wake up enabling. It needs to be enabled when entering retention or off state, otherwise waking up might not work in all situations. Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 7623edabc419..511a57dc7015 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -94,6 +94,35 @@ static inline void omap3_per_restore_context(void)
94 omap_gpio_restore_context(); 94 omap_gpio_restore_context();
95} 95}
96 96
97static void omap3_enable_io_chain(void)
98{
99 int timeout = 0;
100
101 if (omap_rev() >= OMAP3430_REV_ES3_1) {
102 prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN, WKUP_MOD, PM_WKEN);
103 /* Do a readback to assure write has been done */
104 prm_read_mod_reg(WKUP_MOD, PM_WKEN);
105
106 while (!(prm_read_mod_reg(WKUP_MOD, PM_WKST) &
107 OMAP3430_ST_IO_CHAIN)) {
108 timeout++;
109 if (timeout > 1000) {
110 printk(KERN_ERR "Wake up daisy chain "
111 "activation failed.\n");
112 return;
113 }
114 prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN,
115 WKUP_MOD, PM_WKST);
116 }
117 }
118}
119
120static void omap3_disable_io_chain(void)
121{
122 if (omap_rev() >= OMAP3430_REV_ES3_1)
123 prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN, WKUP_MOD, PM_WKEN);
124}
125
97static void omap3_core_save_context(void) 126static void omap3_core_save_context(void)
98{ 127{
99 u32 control_padconf_off; 128 u32 control_padconf_off;
@@ -367,8 +396,9 @@ static void omap_sram_idle(void)
367 omap3_core_save_context(); 396 omap3_core_save_context();
368 omap3_prcm_save_context(); 397 omap3_prcm_save_context();
369 } 398 }
370 /* Enable IO-PAD wakeup */ 399 /* Enable IO-PAD and IO-CHAIN wakeups */
371 prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); 400 prm_set_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
401 omap3_enable_io_chain();
372 } 402 }
373 403
374 /* 404 /*
@@ -432,9 +462,11 @@ static void omap_sram_idle(void)
432 pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF); 462 pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF);
433 } 463 }
434 464
435 /* Disable IO-PAD wakeup */ 465 /* Disable IO-PAD and IO-CHAIN wakeup */
436 if (core_next_state < PWRDM_POWER_ON) 466 if (core_next_state < PWRDM_POWER_ON) {
437 prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN); 467 prm_clear_mod_reg_bits(OMAP3430_EN_IO, WKUP_MOD, PM_WKEN);
468 omap3_disable_io_chain();
469 }
438 470
439 pwrdm_post_transition(); 471 pwrdm_post_transition();
440 472