diff options
author | Benoit Cousson <b-cousson@ti.com> | 2011-07-01 16:54:03 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2011-07-09 21:13:36 -0400 |
commit | 1fe741139be5acfe3758b53cdbf0b5e3d26db3fe (patch) | |
tree | 2bb01d2a56a64b2c7b8ce20b4b38a7aaa3418354 /arch/arm/mach-omap2/omap_hwmod.c | |
parent | 6481c73c22613660a5b791d2b4d0faf60508d731 (diff) |
OMAP2+: hwmod: Do not write the enawakeup bit if SYSC_HAS_ENAWAKEUP is not set
The Type 2 type of IPs will not have any enawakeup bit in their sysconfig.
Writing to that bit will instead trigger a softreset.
Check the flag to write this bit only if the module supports it.
Reported-by: Miguel Vadillo <vadillo@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index cbc2a8a4ce39..3800084a1e7a 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -387,8 +387,6 @@ static int _set_module_autoidle(struct omap_hwmod *oh, u8 autoidle, | |||
387 | */ | 387 | */ |
388 | static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) | 388 | static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) |
389 | { | 389 | { |
390 | u32 wakeup_mask; | ||
391 | |||
392 | if (!oh->class->sysc || | 390 | if (!oh->class->sysc || |
393 | !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || | 391 | !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || |
394 | (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) || | 392 | (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) || |
@@ -400,9 +398,8 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) | |||
400 | return -EINVAL; | 398 | return -EINVAL; |
401 | } | 399 | } |
402 | 400 | ||
403 | wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); | 401 | if (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) |
404 | 402 | *v |= 0x1 << oh->class->sysc->sysc_fields->enwkup_shift; | |
405 | *v |= wakeup_mask; | ||
406 | 403 | ||
407 | if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) | 404 | if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) |
408 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v); | 405 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART_WKUP, v); |
@@ -425,8 +422,6 @@ static int _enable_wakeup(struct omap_hwmod *oh, u32 *v) | |||
425 | */ | 422 | */ |
426 | static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) | 423 | static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) |
427 | { | 424 | { |
428 | u32 wakeup_mask; | ||
429 | |||
430 | if (!oh->class->sysc || | 425 | if (!oh->class->sysc || |
431 | !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || | 426 | !((oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) || |
432 | (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) || | 427 | (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) || |
@@ -438,9 +433,8 @@ static int _disable_wakeup(struct omap_hwmod *oh, u32 *v) | |||
438 | return -EINVAL; | 433 | return -EINVAL; |
439 | } | 434 | } |
440 | 435 | ||
441 | wakeup_mask = (0x1 << oh->class->sysc->sysc_fields->enwkup_shift); | 436 | if (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP) |
442 | 437 | *v &= ~(0x1 << oh->class->sysc->sysc_fields->enwkup_shift); | |
443 | *v &= ~wakeup_mask; | ||
444 | 438 | ||
445 | if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) | 439 | if (oh->class->sysc->idlemodes & SIDLE_SMART_WKUP) |
446 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v); | 440 | _set_slave_idlemode(oh, HWMOD_IDLEMODE_SMART, v); |