aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e436dcb19795..4a134c4d2271 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -819,11 +819,8 @@ static int _wait_target_ready(struct omap_hwmod *oh)
819 ret = omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs, 819 ret = omap2_cm_wait_module_ready(oh->prcm.omap2.module_offs,
820 oh->prcm.omap2.idlest_reg_id, 820 oh->prcm.omap2.idlest_reg_id,
821 oh->prcm.omap2.idlest_idle_bit); 821 oh->prcm.omap2.idlest_idle_bit);
822#if 0
823 } else if (cpu_is_omap44xx()) { 822 } else if (cpu_is_omap44xx()) {
824 ret = omap4_cm_wait_module_ready(oh->prcm.omap4.module_offs, 823 ret = omap4_cm_wait_module_ready(oh->prcm.omap4.clkctrl_reg);
825 oh->prcm.omap4.device_offs);
826#endif
827 } else { 824 } else {
828 BUG(); 825 BUG();
829 }; 826 };
@@ -912,16 +909,21 @@ static int _enable(struct omap_hwmod *oh)
912 _add_initiator_dep(oh, mpu_oh); 909 _add_initiator_dep(oh, mpu_oh);
913 _enable_clocks(oh); 910 _enable_clocks(oh);
914 911
915 if (oh->class->sysc) {
916 if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED))
917 _update_sysc_cache(oh);
918 _sysc_enable(oh);
919 }
920
921 r = _wait_target_ready(oh); 912 r = _wait_target_ready(oh);
922 if (!r) 913 if (!r) {
923 oh->_state = _HWMOD_STATE_ENABLED; 914 oh->_state = _HWMOD_STATE_ENABLED;
924 915
916 /* Access the sysconfig only if the target is ready */
917 if (oh->class->sysc) {
918 if (!(oh->_int_flags & _HWMOD_SYSCONFIG_LOADED))
919 _update_sysc_cache(oh);
920 _sysc_enable(oh);
921 }
922 } else {
923 pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
924 oh->name, r);
925 }
926
925 return r; 927 return r;
926} 928}
927 929
@@ -999,7 +1001,7 @@ static int _shutdown(struct omap_hwmod *oh)
999static int _setup(struct omap_hwmod *oh) 1001static int _setup(struct omap_hwmod *oh)
1000{ 1002{
1001 struct omap_hwmod_ocp_if *os; 1003 struct omap_hwmod_ocp_if *os;
1002 int i; 1004 int i, r;
1003 1005
1004 if (!oh) 1006 if (!oh)
1005 return -EINVAL; 1007 return -EINVAL;
@@ -1023,7 +1025,12 @@ static int _setup(struct omap_hwmod *oh)
1023 1025
1024 oh->_state = _HWMOD_STATE_INITIALIZED; 1026 oh->_state = _HWMOD_STATE_INITIALIZED;
1025 1027
1026 _enable(oh); 1028 r = _enable(oh);
1029 if (r) {
1030 pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
1031 oh->name, oh->_state);
1032 return 0;
1033 }
1027 1034
1028 if (!(oh->flags & HWMOD_INIT_NO_RESET)) { 1035 if (!(oh->flags & HWMOD_INIT_NO_RESET)) {
1029 /* 1036 /*