Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331301
b: refs/heads/master
c: e8e96df
h: refs/heads/master
i:
  331299: 6aab5dc
v: v3
  • Loading branch information
Omar Ramirez Luna authored and Paul Walmsley committed Sep 23, 2012
1 parent 2d53272 commit caa054a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb05f691290e99ee0bd1672317d6add789523c1e
refs/heads/master: e8e96dff71efcf880d9fa446651b3c3db08957c4
37 changes: 37 additions & 0 deletions trunk/arch/arm/mach-omap2/omap_hwmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,7 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
{
struct omap_hwmod_rst_info ohri;
int ret = -EINVAL;
int hwsup = 0;

if (!oh)
return -EINVAL;
Expand All @@ -1596,10 +1597,46 @@ static int _deassert_hardreset(struct omap_hwmod *oh, const char *name)
if (IS_ERR_VALUE(ret))
return ret;

if (oh->clkdm) {
/*
* A clockdomain must be in SW_SUP otherwise reset
* might not be completed. The clockdomain can be set
* in HW_AUTO only when the module become ready.
*/
hwsup = clkdm_in_hwsup(oh->clkdm);
ret = clkdm_hwmod_enable(oh->clkdm, oh);
if (ret) {
WARN(1, "omap_hwmod: %s: could not enable clockdomain %s: %d\n",
oh->name, oh->clkdm->name, ret);
return ret;
}
}

_enable_clocks(oh);
if (soc_ops.enable_module)
soc_ops.enable_module(oh);

ret = soc_ops.deassert_hardreset(oh, &ohri);

if (soc_ops.disable_module)
soc_ops.disable_module(oh);
_disable_clocks(oh);

if (ret == -EBUSY)
pr_warning("omap_hwmod: %s: failed to hardreset\n", oh->name);

if (!ret) {
/*
* Set the clockdomain to HW_AUTO, assuming that the
* previous state was HW_AUTO.
*/
if (oh->clkdm && hwsup)
clkdm_allow_idle(oh->clkdm);
} else {
if (oh->clkdm)
clkdm_hwmod_disable(oh->clkdm, oh);
}

return ret;
}

Expand Down

0 comments on commit caa054a

Please sign in to comment.