]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/arm/mach-omap2/omap_hwmod.c
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[mirror_ubuntu-artful-kernel.git] / arch / arm / mach-omap2 / omap_hwmod.c
index 6ef9e6341d96ba13e31c6a3cd0e1b3fc54cf1db9..cc8a987149e2737db4bf255075d5baf3bc2b2bb0 100644 (file)
@@ -300,7 +300,20 @@ static void _write_sysconfig(u32 v, struct omap_hwmod *oh)
 
        /* Module might have lost context, always update cache and register */
        oh->_sysc_cache = v;
+
+       /*
+        * Some IP blocks (such as RTC) require unlocking of IP before
+        * accessing its registers. If a function pointer is present
+        * to unlock, then call it before accessing sysconfig and
+        * call lock after writing sysconfig.
+        */
+       if (oh->class->unlock)
+               oh->class->unlock(oh);
+
        omap_hwmod_write(v, oh, oh->class->sysc->sysc_offs);
+
+       if (oh->class->lock)
+               oh->class->lock(oh);
 }
 
 /**
@@ -3887,7 +3900,8 @@ void __init omap_hwmod_init(void)
                soc_ops.init_clkdm = _init_clkdm;
                soc_ops.update_context_lost = _omap4_update_context_lost;
                soc_ops.get_context_lost = _omap4_get_context_lost;
-       } else if (cpu_is_ti816x() || soc_is_am33xx() || soc_is_am43xx()) {
+       } else if (cpu_is_ti814x() || cpu_is_ti816x() || soc_is_am33xx() ||
+                  soc_is_am43xx()) {
                soc_ops.enable_module = _omap4_enable_module;
                soc_ops.disable_module = _omap4_disable_module;
                soc_ops.wait_target_ready = _omap4_wait_target_ready;