Skip to content

Commit 2a1cc14

Browse files
Govindraj.RPaul Walmsley
authored andcommitted
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 <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Rajendra Nayak <[email protected]> Signed-off-by: Govindraj.R <[email protected]> [[email protected]: updated function kerneldoc documentation] Signed-off-by: Paul Walmsley <[email protected]>
1 parent dd775ae commit 2a1cc14

File tree

1 file changed

+30
-26
lines changed

1 file changed

+30
-26
lines changed

arch/arm/mach-omap2/omap_hwmod.c

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,26 +2463,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
24632463
* @oh: struct omap_hwmod *
24642464
*
24652465
* Sets the module OCP socket ENAWAKEUP bit to allow the module to
2466-
* send wakeups to the PRCM. Eventually this should sets PRCM wakeup
2467-
* registers to cause the PRCM to receive wakeup events from the
2468-
* module. Does not set any wakeup routing registers beyond this
2469-
* point - if the module is to wake up any other module or subsystem,
2470-
* that must be set separately. Called by omap_device code. Returns
2471-
* -EINVAL on error or 0 upon success.
2466+
* send wakeups to the PRCM, and enable I/O ring wakeup events for
2467+
* this IP block if it has dynamic mux entries. Eventually this
2468+
* should set PRCM wakeup registers to cause the PRCM to receive
2469+
* wakeup events from the module. Does not set any wakeup routing
2470+
* registers beyond this point - if the module is to wake up any other
2471+
* module or subsystem, that must be set separately. Called by
2472+
* omap_device code. Returns -EINVAL on error or 0 upon success.
24722473
*/
24732474
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
24742475
{
24752476
unsigned long flags;
24762477
u32 v;
24772478

2478-
if (!oh->class->sysc ||
2479-
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
2480-
return -EINVAL;
2481-
24822479
spin_lock_irqsave(&oh->_lock, flags);
2483-
v = oh->_sysc_cache;
2484-
_enable_wakeup(oh, &v);
2485-
_write_sysconfig(v, oh);
2480+
2481+
if (oh->class->sysc &&
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+
24862488
_set_idle_ioring_wakeup(oh, true);
24872489
spin_unlock_irqrestore(&oh->_lock, flags);
24882490

@@ -2494,26 +2496,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
24942496
* @oh: struct omap_hwmod *
24952497
*
24962498
* Clears the module OCP socket ENAWAKEUP bit to prevent the module
2497-
* from sending wakeups to the PRCM. Eventually this should clear
2498-
* PRCM wakeup registers to cause the PRCM to ignore wakeup events
2499-
* from the module. Does not set any wakeup routing registers beyond
2500-
* this point - if the module is to wake up any other module or
2501-
* subsystem, that must be set separately. Called by omap_device
2502-
* code. Returns -EINVAL on error or 0 upon success.
2499+
* from sending wakeups to the PRCM, and disable I/O ring wakeup
2500+
* events for this IP block if it has dynamic mux entries. Eventually
2501+
* this should clear PRCM wakeup registers to cause the PRCM to ignore
2502+
* wakeup events from the module. Does not set any wakeup routing
2503+
* registers beyond this point - if the module is to wake up any other
2504+
* module or subsystem, that must be set separately. Called by
2505+
* omap_device code. Returns -EINVAL on error or 0 upon success.
25032506
*/
25042507
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
25052508
{
25062509
unsigned long flags;
25072510
u32 v;
25082511

2509-
if (!oh->class->sysc ||
2510-
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
2511-
return -EINVAL;
2512-
25132512
spin_lock_irqsave(&oh->_lock, flags);
2514-
v = oh->_sysc_cache;
2515-
_disable_wakeup(oh, &v);
2516-
_write_sysconfig(v, oh);
2513+
2514+
if (oh->class->sysc &&
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+
25172521
_set_idle_ioring_wakeup(oh, false);
25182522
spin_unlock_irqrestore(&oh->_lock, flags);
25192523

0 commit comments

Comments
 (0)