Move the code that reprograms the OCP_SYSCONFIG bits into the _reset()
function to ensure that it is called after every reset.  The code was
previously in the _setup() function.  So, before this patch, if
_reset() was called from another function, the SYSCONFIG register
won't be reprogrammed.

Signed-off-by: Paul Walmsley <[email protected]>
Cc: BenoĆ®t Cousson <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod.c |   31 +++++++++++++++----------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index db4ad41..aeb6f4c 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1490,13 +1490,22 @@ static int _reset(struct omap_hwmod *oh)
        pr_debug("omap_hwmod: %s: resetting\n", oh->name);
 
        if (oh->class->reset)
-               return oh->class->reset(oh);
-
-       if (!oh->rst_lines_cnt)
-               return _ocp_softreset(oh);
+               oh->class->reset(oh);
+       else if (!oh->rst_lines_cnt)
+               _ocp_softreset(oh);
+       else
+               for (i = 0; i < oh->rst_lines_cnt; i++)
+                       _assert_hardreset(oh, oh->rst_lines[i].name);
 
-       for (i = 0; i < oh->rst_lines_cnt; i++)
-               _assert_hardreset(oh, oh->rst_lines[i].name);
+       /*
+        * OCP_SYSCONFIG bits need to be reprogrammed after a
+        * softreset.  The _enable() function should be split to avoid
+        * the rewrite of the OCP_SYSCONFIG register.
+        */
+       if (oh->class->sysc) {
+               _update_sysc_cache(oh);
+               _enable_sysc(oh);
+       }
 
        return 0;
 }
@@ -1830,16 +1839,6 @@ static int __init _setup_reset(struct omap_hwmod *oh)
        if (!(oh->flags & HWMOD_INIT_NO_RESET))
                r = _reset(oh);
 
-       /*
-        * OCP_SYSCONFIG bits need to be reprogrammed after a
-        * softreset.  The _enable() function should be split to avoid
-        * the rewrite of the OCP_SYSCONFIG register.
-        */
-       if (oh->class->sysc) {
-               _update_sysc_cache(oh);
-               _enable_sysc(oh);
-       }
-
        return r;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to