diff options
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r-- | arch/arm/mach-omap2/prm2xxx_3xxx.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c index 21cb74003a56..a0309dea6794 100644 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.c +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c | |||
@@ -302,11 +302,59 @@ void omap3xxx_prm_restore_irqen(u32 *saved_mask) | |||
302 | OMAP3_PRM_IRQENABLE_MPU_OFFSET); | 302 | OMAP3_PRM_IRQENABLE_MPU_OFFSET); |
303 | } | 303 | } |
304 | 304 | ||
305 | /** | ||
306 | * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain | ||
307 | * | ||
308 | * Clear any previously-latched I/O wakeup events and ensure that the | ||
309 | * I/O wakeup gates are aligned with the current mux settings. Works | ||
310 | * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then | ||
311 | * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No | ||
312 | * return value. | ||
313 | */ | ||
314 | void omap3xxx_prm_reconfigure_io_chain(void) | ||
315 | { | ||
316 | int i = 0; | ||
317 | |||
318 | omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, | ||
319 | PM_WKEN); | ||
320 | |||
321 | omap_test_timeout(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST) & | ||
322 | OMAP3430_ST_IO_CHAIN_MASK, | ||
323 | MAX_IOPAD_LATCH_TIME, i); | ||
324 | if (i == MAX_IOPAD_LATCH_TIME) | ||
325 | pr_warn("PRM: I/O chain clock line assertion timed out\n"); | ||
326 | |||
327 | omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD, | ||
328 | PM_WKEN); | ||
329 | |||
330 | omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, WKUP_MOD, | ||
331 | PM_WKST); | ||
332 | |||
333 | omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST); | ||
334 | } | ||
335 | |||
336 | /** | ||
337 | * omap3xxx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches | ||
338 | * | ||
339 | * Activates the I/O wakeup event latches and allows events logged by | ||
340 | * those latches to signal a wakeup event to the PRCM. For I/O | ||
341 | * wakeups to occur, WAKEUPENABLE bits must be set in the pad mux | ||
342 | * registers, and omap3xxx_prm_reconfigure_io_chain() must be called. | ||
343 | * No return value. | ||
344 | */ | ||
345 | static void __init omap3xxx_prm_enable_io_wakeup(void) | ||
346 | { | ||
347 | if (omap3_has_io_wakeup()) | ||
348 | omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_MASK, WKUP_MOD, | ||
349 | PM_WKEN); | ||
350 | } | ||
351 | |||
305 | static int __init omap3xxx_prcm_init(void) | 352 | static int __init omap3xxx_prcm_init(void) |
306 | { | 353 | { |
307 | int ret = 0; | 354 | int ret = 0; |
308 | 355 | ||
309 | if (cpu_is_omap34xx()) { | 356 | if (cpu_is_omap34xx()) { |
357 | omap3xxx_prm_enable_io_wakeup(); | ||
310 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); | 358 | ret = omap_prcm_register_chain_handler(&omap3_prcm_irq_setup); |
311 | if (!ret) | 359 | if (!ret) |
312 | irq_set_status_flags(omap_prcm_event_to_irq("io"), | 360 | irq_set_status_flags(omap_prcm_event_to_irq("io"), |