ARM: OMAP: PRCM: add suspend prepare / finish support
authorTero Kristo <t-kristo@ti.com>
Fri, 16 Dec 2011 21:36:58 +0000 (14:36 -0700)
committerPaul Walmsley <paul@pwsan.com>
Fri, 16 Dec 2011 21:36:58 +0000 (14:36 -0700)
commit91285b6fa296657d92dc2225100fb94aee869bf2
treead06e6b86a2da5e09eb9222e73ed82286ac06542
parent0a84a91c37ada296ffe7147e73af99b5654628ec
ARM: OMAP: PRCM: add suspend prepare / finish support

PRCM chain handler needs to disable forwarding of interrupts during
suspend, because runtime PM is disabled and most of the drivers
are potentially not able to handle interrupts coming at this time.

This patch masks all the PRCM interrupt events if a PRCM interrupt
occurs during suspend, but does not ack them. Once suspend finish
is called, all the masked events will be re-enabled, which causes
immediate PRCM interrupt and handles the postponed event.

The suspend prepare and complete  callbacks will be called from
pm34xx.c / pm44xx.c files in the following patches.

The functions defined in this patch should eventually be moved to
suspend->prepare and suspend->finish driver hooks, once the PRCM
chain handler will be made as its own driver.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
[paul@pwsan.com: add kerneldoc, add omap_prcm_irq_setup.saved_mask, add fn
 ptrs for save_and_clear_irqen() and restore_irqen()]
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/prcm-common.h
arch/arm/mach-omap2/prm2xxx_3xxx.c
arch/arm/mach-omap2/prm2xxx_3xxx.h
arch/arm/mach-omap2/prm44xx.c
arch/arm/mach-omap2/prm44xx.h
arch/arm/mach-omap2/prm_common.c