aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorGovindraj.R <govindraj.raja@ti.com>2012-04-05 04:59:32 -0400
committerPaul Walmsley <paul@pwsan.com>2012-04-05 04:59:32 -0400
commit2a1cc1445a51e3a81c10d294586756cdb9174469 (patch)
treebdabb52ae6c7bebce982a2c8a09f57b7cc3a84e2 /arch/arm
parentdd775ae2549217d3ae09363e3edb305d0fa19928 (diff)
ARM: OMAP2+: omap_hwmod: Allow io_ring wakeup configuration for all modules
Some modules doesn't have SYSC_HAS_ENAWAKEUP bit available (ex: usb host uhh module) in absence of this flag omap_hwmod_enable/disable_wakeup avoids configuring pad mux wakeup capability. Configure sysc if SYSC_HAS_ENAWAKEUP is available and for other cases try enabling/disabling wakeup from mux_pad pins. Cc: Paul Walmsley <paul@pwsan.com> Cc: Kevin Hilman <khilman@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Govindraj.R <govindraj.raja@ti.com> [paul@pwsan.com: updated function kerneldoc documentation] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index eba6cd3816f5..5a680108195b 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -2463,26 +2463,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
2463 * @oh: struct omap_hwmod * 2463 * @oh: struct omap_hwmod *
2464 * 2464 *
2465 * Sets the module OCP socket ENAWAKEUP bit to allow the module to 2465 * Sets the module OCP socket ENAWAKEUP bit to allow the module to
2466 * send wakeups to the PRCM. Eventually this should sets PRCM wakeup 2466 * send wakeups to the PRCM, and enable I/O ring wakeup events for
2467 * registers to cause the PRCM to receive wakeup events from the 2467 * this IP block if it has dynamic mux entries. Eventually this
2468 * module. Does not set any wakeup routing registers beyond this 2468 * should set PRCM wakeup registers to cause the PRCM to receive
2469 * point - if the module is to wake up any other module or subsystem, 2469 * wakeup events from the module. Does not set any wakeup routing
2470 * that must be set separately. Called by omap_device code. Returns 2470 * registers beyond this point - if the module is to wake up any other
2471 * -EINVAL on error or 0 upon success. 2471 * module or subsystem, that must be set separately. Called by
2472 * omap_device code. Returns -EINVAL on error or 0 upon success.
2472 */ 2473 */
2473int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) 2474int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
2474{ 2475{
2475 unsigned long flags; 2476 unsigned long flags;
2476 u32 v; 2477 u32 v;
2477 2478
2478 if (!oh->class->sysc ||
2479 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
2480 return -EINVAL;
2481
2482 spin_lock_irqsave(&oh->_lock, flags); 2479 spin_lock_irqsave(&oh->_lock, flags);
2483 v = oh->_sysc_cache; 2480
2484 _enable_wakeup(oh, &v); 2481 if (oh->class->sysc &&
2485 _write_sysconfig(v, oh); 2482 (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
2483 v = oh->_sysc_cache;
2484 _enable_wakeup(oh, &v);
2485 _write_sysconfig(v, oh);
2486 }
2487
2486 _set_idle_ioring_wakeup(oh, true); 2488 _set_idle_ioring_wakeup(oh, true);
2487 spin_unlock_irqrestore(&oh->_lock, flags); 2489 spin_unlock_irqrestore(&oh->_lock, flags);
2488 2490
@@ -2494,26 +2496,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
2494 * @oh: struct omap_hwmod * 2496 * @oh: struct omap_hwmod *
2495 * 2497 *
2496 * Clears the module OCP socket ENAWAKEUP bit to prevent the module 2498 * Clears the module OCP socket ENAWAKEUP bit to prevent the module
2497 * from sending wakeups to the PRCM. Eventually this should clear 2499 * from sending wakeups to the PRCM, and disable I/O ring wakeup
2498 * PRCM wakeup registers to cause the PRCM to ignore wakeup events 2500 * events for this IP block if it has dynamic mux entries. Eventually
2499 * from the module. Does not set any wakeup routing registers beyond 2501 * this should clear PRCM wakeup registers to cause the PRCM to ignore
2500 * this point - if the module is to wake up any other module or 2502 * wakeup events from the module. Does not set any wakeup routing
2501 * subsystem, that must be set separately. Called by omap_device 2503 * registers beyond this point - if the module is to wake up any other
2502 * code. Returns -EINVAL on error or 0 upon success. 2504 * module or subsystem, that must be set separately. Called by
2505 * omap_device code. Returns -EINVAL on error or 0 upon success.
2503 */ 2506 */
2504int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) 2507int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
2505{ 2508{
2506 unsigned long flags; 2509 unsigned long flags;
2507 u32 v; 2510 u32 v;
2508 2511
2509 if (!oh->class->sysc ||
2510 !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
2511 return -EINVAL;
2512
2513 spin_lock_irqsave(&oh->_lock, flags); 2512 spin_lock_irqsave(&oh->_lock, flags);
2514 v = oh->_sysc_cache; 2513
2515 _disable_wakeup(oh, &v); 2514 if (oh->class->sysc &&
2516 _write_sysconfig(v, oh); 2515 (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
2516 v = oh->_sysc_cache;
2517 _disable_wakeup(oh, &v);
2518 _write_sysconfig(v, oh);
2519 }
2520
2517 _set_idle_ioring_wakeup(oh, false); 2521 _set_idle_ioring_wakeup(oh, false);
2518 spin_unlock_irqrestore(&oh->_lock, flags); 2522 spin_unlock_irqrestore(&oh->_lock, flags);
2519 2523