提交 2a1cc144 编写于 作者: G Govindraj.R 提交者: Paul Walmsley

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: NGovindraj.R <govindraj.raja@ti.com>
[paul@pwsan.com: updated function kerneldoc documentation]
Signed-off-by: NPaul Walmsley <paul@pwsan.com>
上级 dd775ae2
...@@ -2463,26 +2463,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, ...@@ -2463,26 +2463,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Sets the module OCP socket ENAWAKEUP bit to allow the module to * Sets the module OCP socket ENAWAKEUP bit to allow the module to
* send wakeups to the PRCM. Eventually this should sets PRCM wakeup * send wakeups to the PRCM, and enable I/O ring wakeup events for
* registers to cause the PRCM to receive wakeup events from the * this IP block if it has dynamic mux entries. Eventually this
* module. Does not set any wakeup routing registers beyond this * should set PRCM wakeup registers to cause the PRCM to receive
* point - if the module is to wake up any other module or subsystem, * wakeup events from the module. Does not set any wakeup routing
* that must be set separately. Called by omap_device code. Returns * registers beyond this point - if the module is to wake up any other
* -EINVAL on error or 0 upon success. * module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/ */
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
{ {
unsigned long flags; unsigned long flags;
u32 v; u32 v;
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
spin_lock_irqsave(&oh->_lock, flags); spin_lock_irqsave(&oh->_lock, flags);
v = oh->_sysc_cache;
_enable_wakeup(oh, &v); if (oh->class->sysc &&
_write_sysconfig(v, oh); (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_enable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
_set_idle_ioring_wakeup(oh, true); _set_idle_ioring_wakeup(oh, true);
spin_unlock_irqrestore(&oh->_lock, flags); spin_unlock_irqrestore(&oh->_lock, flags);
...@@ -2494,26 +2496,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) ...@@ -2494,26 +2496,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
* @oh: struct omap_hwmod * * @oh: struct omap_hwmod *
* *
* Clears the module OCP socket ENAWAKEUP bit to prevent the module * Clears the module OCP socket ENAWAKEUP bit to prevent the module
* from sending wakeups to the PRCM. Eventually this should clear * from sending wakeups to the PRCM, and disable I/O ring wakeup
* PRCM wakeup registers to cause the PRCM to ignore wakeup events * events for this IP block if it has dynamic mux entries. Eventually
* from the module. Does not set any wakeup routing registers beyond * this should clear PRCM wakeup registers to cause the PRCM to ignore
* this point - if the module is to wake up any other module or * wakeup events from the module. Does not set any wakeup routing
* subsystem, that must be set separately. Called by omap_device * registers beyond this point - if the module is to wake up any other
* code. Returns -EINVAL on error or 0 upon success. * module or subsystem, that must be set separately. Called by
* omap_device code. Returns -EINVAL on error or 0 upon success.
*/ */
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
{ {
unsigned long flags; unsigned long flags;
u32 v; u32 v;
if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;
spin_lock_irqsave(&oh->_lock, flags); spin_lock_irqsave(&oh->_lock, flags);
v = oh->_sysc_cache;
_disable_wakeup(oh, &v); if (oh->class->sysc &&
_write_sysconfig(v, oh); (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) {
v = oh->_sysc_cache;
_disable_wakeup(oh, &v);
_write_sysconfig(v, oh);
}
_set_idle_ioring_wakeup(oh, false); _set_idle_ioring_wakeup(oh, false);
spin_unlock_irqrestore(&oh->_lock, flags); spin_unlock_irqrestore(&oh->_lock, flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册