aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prcm-common.h
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2011-12-16 16:36:58 -0500
committerPaul Walmsley <paul@pwsan.com>2011-12-16 16:36:58 -0500
commit91285b6fa296657d92dc2225100fb94aee869bf2 (patch)
treead06e6b86a2da5e09eb9222e73ed82286ac06542 /arch/arm/mach-omap2/prcm-common.h
parent0a84a91c37ada296ffe7147e73af99b5654628ec (diff)
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>
Diffstat (limited to 'arch/arm/mach-omap2/prcm-common.h')
-rw-r--r--arch/arm/mach-omap2/prcm-common.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h
index 76db3795e68f..0f69d8fc5628 100644
--- a/arch/arm/mach-omap2/prcm-common.h
+++ b/arch/arm/mach-omap2/prcm-common.h
@@ -437,11 +437,16 @@ struct omap_prcm_irq {
437 * @irq: MPU IRQ asserted when a PRCM interrupt arrives 437 * @irq: MPU IRQ asserted when a PRCM interrupt arrives
438 * @read_pending_irqs: fn ptr to determine if any PRCM IRQs are pending 438 * @read_pending_irqs: fn ptr to determine if any PRCM IRQs are pending
439 * @ocp_barrier: fn ptr to force buffered PRM writes to complete 439 * @ocp_barrier: fn ptr to force buffered PRM writes to complete
440 * @save_and_clear_irqen: fn ptr to save and clear IRQENABLE regs
441 * @restore_irqen: fn ptr to save and clear IRQENABLE regs
442 * @saved_mask: IRQENABLE regs are saved here during suspend
440 * @priority_mask: 1 bit per IRQ, set to 1 if omap_prcm_irq.priority = true 443 * @priority_mask: 1 bit per IRQ, set to 1 if omap_prcm_irq.priority = true
441 * @base_irq: base dynamic IRQ number, returned from irq_alloc_descs() in init 444 * @base_irq: base dynamic IRQ number, returned from irq_alloc_descs() in init
445 * @suspended: set to true after Linux suspend code has called our ->prepare()
446 * @suspend_save_flag: set to true after IRQ masks have been saved and disabled
442 * 447 *
443 * @priority_mask and @base_irq are populated dynamically during 448 * @saved_mask, @priority_mask, @base_irq, @suspended, and
444 * omap_prcm_register_chain_handler() - these fields are not to be 449 * @suspend_save_flag are populated dynamically, and are not to be
445 * specified in static initializers. 450 * specified in static initializers.
446 */ 451 */
447struct omap_prcm_irq_setup { 452struct omap_prcm_irq_setup {
@@ -453,8 +458,13 @@ struct omap_prcm_irq_setup {
453 int irq; 458 int irq;
454 void (*read_pending_irqs)(unsigned long *events); 459 void (*read_pending_irqs)(unsigned long *events);
455 void (*ocp_barrier)(void); 460 void (*ocp_barrier)(void);
461 void (*save_and_clear_irqen)(u32 *saved_mask);
462 void (*restore_irqen)(u32 *saved_mask);
463 u32 *saved_mask;
456 u32 *priority_mask; 464 u32 *priority_mask;
457 int base_irq; 465 int base_irq;
466 bool suspended;
467 bool suspend_save_flag;
458}; 468};
459 469
460/* OMAP_PRCM_IRQ: convenience macro for creating struct omap_prcm_irq records */ 470/* OMAP_PRCM_IRQ: convenience macro for creating struct omap_prcm_irq records */
@@ -468,6 +478,8 @@ extern void omap_prcm_irq_cleanup(void);
468extern int omap_prcm_register_chain_handler( 478extern int omap_prcm_register_chain_handler(
469 struct omap_prcm_irq_setup *irq_setup); 479 struct omap_prcm_irq_setup *irq_setup);
470extern int omap_prcm_event_to_irq(const char *event); 480extern int omap_prcm_event_to_irq(const char *event);
481extern void omap_prcm_irq_prepare(void);
482extern void omap_prcm_irq_complete(void);
471 483
472# endif 484# endif
473 485