Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226635
b: refs/heads/master
c: 5a7ddcb
h: refs/heads/master
i:
  226633: 4bbc398
  226631: 0befaa1
v: v3
  • Loading branch information
Kevin Hilman authored and Paul Walmsley committed Dec 22, 2010
1 parent 5521da5 commit 4586458
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b399bca897802db3f342b6f3032a19ab8f2af99b
refs/heads/master: 5a7ddcbdaf1bb7603422fb6188156ccc39711b0f
32 changes: 17 additions & 15 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle,
* Allow the hardware module @oh to send wakeups. Returns -EINVAL
* upon error or 0 upon success.
*/
static int _enable_wakeup(struct omap_hwmod *oh)
static int _enable_wakeup(struct omap_hwmod *oh, u32 *v)
{
u32 v, wakeup_mask;
u32 wakeup_mask;

if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
Expand All @@ -405,9 +405,7 @@ static int _enable_wakeup(struct omap_hwmod *oh)

wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);

v = oh->_sysc_cache;
v |= wakeup_mask;
_write_sysconfig(v, oh);
*v |= wakeup_mask;

/* XXX test pwrdm_get_wken for this hwmod's subsystem */

Expand All @@ -423,9 +421,9 @@ static int _enable_wakeup(struct omap_hwmod *oh)
* Prevent the hardware module @oh to send wakeups. Returns -EINVAL
* upon error or 0 upon success.
*/
static int _disable_wakeup(struct omap_hwmod *oh)
static int _disable_wakeup(struct omap_hwmod *oh, u32 *v)
{
u32 v, wakeup_mask;
u32 wakeup_mask;

if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
Expand All @@ -438,9 +436,7 @@ static int _disable_wakeup(struct omap_hwmod *oh)

wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift);

v = oh->_sysc_cache;
v &= ~wakeup_mask;
_write_sysconfig(v, oh);
*v &= ~wakeup_mask;

/* XXX test pwrdm_get_wken for this hwmod's subsystem */

Expand Down Expand Up @@ -788,11 +784,11 @@ static void _enable_sysc(struct omap_hwmod *oh)
(sf & SYSC_HAS_CLOCKACTIVITY))
_set_clockactivity(oh, oh->class->sysc->clockact, &v);

_write_sysconfig(v, oh);

/* If slave is in SMARTIDLE, also enable wakeup */
if ((sf & SYSC_HAS_SIDLEMODE) && !(oh->flags & HWMOD_SWSUP_SIDLE))
_enable_wakeup(oh);
_enable_wakeup(oh, &v);

_write_sysconfig(v, oh);

/*
* Set the autoidle bit only after setting the smartidle bit
Expand Down Expand Up @@ -2011,13 +2007,16 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh,
int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
{
unsigned long flags;
u32 v;

if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;

spin_lock_irqsave(&oh->_lock, flags);
_enable_wakeup(oh);
v = oh->_sysc_cache;
_enable_wakeup(oh, &v);
_write_sysconfig(v, oh);
spin_unlock_irqrestore(&oh->_lock, flags);

return 0;
Expand All @@ -2038,13 +2037,16 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh)
int omap_hwmod_disable_wakeup(struct omap_hwmod *oh)
{
unsigned long flags;
u32 v;

if (!oh->class->sysc ||
!(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP))
return -EINVAL;

spin_lock_irqsave(&oh->_lock, flags);
_disable_wakeup(oh);
v = oh->_sysc_cache;
_disable_wakeup(oh, &v);
_write_sysconfig(v, oh);
spin_unlock_irqrestore(&oh->_lock, flags);

return 0;
Expand Down

0 comments on commit 4586458

Please sign in to comment.