Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333333
b: refs/heads/master
c: e9332b6
h: refs/heads/master
i:
  333331: d68656c
v: v3
  • Loading branch information
Paul Walmsley committed Oct 9, 2012
1 parent 25d43e9 commit 2bd0d5c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 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: cf956d9f0734b4888655d6b7420e4dac9dba22d0
refs/heads/master: e9332b6eed82973a8f75f1f3d57babaa331d703c
31 changes: 27 additions & 4 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,29 @@ static bool _are_all_hardreset_lines_asserted(struct omap_hwmod *oh)
return false;
}

/**
* _are_any_hardreset_lines_asserted - return true if any part of @oh is
* hard-reset
* @oh: struct omap_hwmod *
*
* If any hardreset lines associated with @oh are asserted, then
* return true. Otherwise, if no hardreset lines associated with @oh
* are asserted, or if @oh has no hardreset lines, then return false.
* This function is used to avoid executing some parts of the IP block
* enable/disable sequence if any hardreset line is set.
*/
static bool _are_any_hardreset_lines_asserted(struct omap_hwmod *oh)
{
int rst_cnt = 0;
int i;

for (i = 0; i < oh->rst_lines_cnt && rst_cnt == 0; i++)
if (_read_hardreset(oh, oh->rst_lines[i].name) > 0)
rst_cnt++;

return (rst_cnt) ? true : false;
}

/**
* _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
* @oh: struct omap_hwmod *
Expand All @@ -1715,7 +1738,7 @@ static int _omap4_disable_module(struct omap_hwmod *oh)
* Since integration code might still be doing something, only
* disable if all lines are under hardreset.
*/
if (!_are_all_hardreset_lines_asserted(oh))
if (_are_any_hardreset_lines_asserted(oh))
return 0;

pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
Expand Down Expand Up @@ -1749,12 +1772,12 @@ static int _am33xx_disable_module(struct omap_hwmod *oh)

pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);

if (_are_any_hardreset_lines_asserted(oh))
return 0;

am33xx_cm_module_disable(oh->clkdm->cm_inst, oh->clkdm->clkdm_offs,
oh->prcm.omap4.clkctrl_offs);

if (_are_all_hardreset_lines_asserted(oh))
return 0;

v = _am33xx_wait_target_disable(oh);
if (v)
pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
Expand Down

0 comments on commit 2bd0d5c

Please sign in to comment.