aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-01-09 17:20:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-01-09 17:20:39 -0500
commit57e964e1ae9bd4f699ae1074430bcf81a9a11377 (patch)
tree8c1fc5199e18a55cece4aa72bbaf2ca909bd1453 /arch/arm/mach-omap2/omap_hwmod.c
parent4dee6b64ee7cfef94b47733c6d9fef07f8051c7c (diff)
parent39fbc76272225fb991ffdfac1e08974506cfa3eb (diff)
Merge tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Non-critical bug fixes Simple bug fixes that were not considered important enough for inclusion into 3.2. * tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: MAINTAINERS: update pxa and mmp ARM: pxa: Include linux/export.h in balloon3.c ARM: OMAP4: clock: Add CPU local timer clock node ARM: OMAP4: hwmod: Don't wait for the idle status if modulemode is not supported ARM: OMAP: AM3517/3505: fix crash on boot due to incorrect voltagedomain data ARM: OMAP: hwmod data: fix the panic on Nokia RM-680 during boot ARM: OMAP2+: DMA: Workaround for invalid destination position ARM: OMAP2+: DMA: Workaround for invalid source position
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 529142aff766..373d1f15c4eb 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -706,27 +706,65 @@ static void _enable_module(struct omap_hwmod *oh)
706} 706}
707 707
708/** 708/**
709 * _disable_module - enable CLKCTRL modulemode on OMAP4 709 * _omap4_wait_target_disable - wait for a module to be disabled on OMAP4
710 * @oh: struct omap_hwmod *
711 *
712 * Wait for a module @oh to enter slave idle. Returns 0 if the module
713 * does not have an IDLEST bit or if the module successfully enters
714 * slave idle; otherwise, pass along the return value of the
715 * appropriate *_cm*_wait_module_idle() function.
716 */
717static int _omap4_wait_target_disable(struct omap_hwmod *oh)
718{
719 if (!cpu_is_omap44xx())
720 return 0;
721
722 if (!oh)
723 return -EINVAL;
724
725 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
726 return 0;
727
728 if (oh->flags & HWMOD_NO_IDLEST)
729 return 0;
730
731 return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
732 oh->clkdm->cm_inst,
733 oh->clkdm->clkdm_offs,
734 oh->prcm.omap4.clkctrl_offs);
735}
736
737/**
738 * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4
710 * @oh: struct omap_hwmod * 739 * @oh: struct omap_hwmod *
711 * 740 *
712 * Disable the PRCM module mode related to the hwmod @oh. 741 * Disable the PRCM module mode related to the hwmod @oh.
713 * No return value. 742 * Return EINVAL if the modulemode is not supported and 0 in case of success.
714 */ 743 */
715static void _disable_module(struct omap_hwmod *oh) 744static int _omap4_disable_module(struct omap_hwmod *oh)
716{ 745{
746 int v;
747
717 /* The module mode does not exist prior OMAP4 */ 748 /* The module mode does not exist prior OMAP4 */
718 if (cpu_is_omap24xx() || cpu_is_omap34xx()) 749 if (!cpu_is_omap44xx())
719 return; 750 return -EINVAL;
720 751
721 if (!oh->clkdm || !oh->prcm.omap4.modulemode) 752 if (!oh->clkdm || !oh->prcm.omap4.modulemode)
722 return; 753 return -EINVAL;
723 754
724 pr_debug("omap_hwmod: %s: _disable_module\n", oh->name); 755 pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__);
725 756
726 omap4_cminst_module_disable(oh->clkdm->prcm_partition, 757 omap4_cminst_module_disable(oh->clkdm->prcm_partition,
727 oh->clkdm->cm_inst, 758 oh->clkdm->cm_inst,
728 oh->clkdm->clkdm_offs, 759 oh->clkdm->clkdm_offs,
729 oh->prcm.omap4.clkctrl_offs); 760 oh->prcm.omap4.clkctrl_offs);
761
762 v = _omap4_wait_target_disable(oh);
763 if (v)
764 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
765 oh->name);
766
767 return 0;
730} 768}
731 769
732/** 770/**
@@ -1153,36 +1191,6 @@ static int _wait_target_ready(struct omap_hwmod *oh)
1153} 1191}
1154 1192
1155/** 1193/**
1156 * _wait_target_disable - wait for a module to be disabled
1157 * @oh: struct omap_hwmod *
1158 *
1159 * Wait for a module @oh to enter slave idle. Returns 0 if the module
1160 * does not have an IDLEST bit or if the module successfully enters
1161 * slave idle; otherwise, pass along the return value of the
1162 * appropriate *_cm*_wait_module_idle() function.
1163 */
1164static int _wait_target_disable(struct omap_hwmod *oh)
1165{
1166 /* TODO: For now just handle OMAP4+ */
1167 if (cpu_is_omap24xx() || cpu_is_omap34xx())
1168 return 0;
1169
1170 if (!oh)
1171 return -EINVAL;
1172
1173 if (oh->_int_flags & _HWMOD_NO_MPU_PORT)
1174 return 0;
1175
1176 if (oh->flags & HWMOD_NO_IDLEST)
1177 return 0;
1178
1179 return omap4_cminst_wait_module_idle(oh->clkdm->prcm_partition,
1180 oh->clkdm->cm_inst,
1181 oh->clkdm->clkdm_offs,
1182 oh->prcm.omap4.clkctrl_offs);
1183}
1184
1185/**
1186 * _lookup_hardreset - fill register bit info for this hwmod/reset line 1194 * _lookup_hardreset - fill register bit info for this hwmod/reset line
1187 * @oh: struct omap_hwmod * 1195 * @oh: struct omap_hwmod *
1188 * @name: name of the reset line in the context of this hwmod 1196 * @name: name of the reset line in the context of this hwmod
@@ -1524,8 +1532,6 @@ static int _enable(struct omap_hwmod *oh)
1524 */ 1532 */
1525static int _idle(struct omap_hwmod *oh) 1533static int _idle(struct omap_hwmod *oh)
1526{ 1534{
1527 int ret;
1528
1529 pr_debug("omap_hwmod: %s: idling\n", oh->name); 1535 pr_debug("omap_hwmod: %s: idling\n", oh->name);
1530 1536
1531 if (oh->_state != _HWMOD_STATE_ENABLED) { 1537 if (oh->_state != _HWMOD_STATE_ENABLED) {
@@ -1537,11 +1543,9 @@ static int _idle(struct omap_hwmod *oh)
1537 if (oh->class->sysc) 1543 if (oh->class->sysc)
1538 _idle_sysc(oh); 1544 _idle_sysc(oh);
1539 _del_initiator_dep(oh, mpu_oh); 1545 _del_initiator_dep(oh, mpu_oh);
1540 _disable_module(oh); 1546
1541 ret = _wait_target_disable(oh); 1547 _omap4_disable_module(oh);
1542 if (ret) 1548
1543 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
1544 oh->name);
1545 /* 1549 /*
1546 * The module must be in idle mode before disabling any parents 1550 * The module must be in idle mode before disabling any parents
1547 * clocks. Otherwise, the parent clock might be disabled before 1551 * clocks. Otherwise, the parent clock might be disabled before
@@ -1642,11 +1646,7 @@ static int _shutdown(struct omap_hwmod *oh)
1642 if (oh->_state == _HWMOD_STATE_ENABLED) { 1646 if (oh->_state == _HWMOD_STATE_ENABLED) {
1643 _del_initiator_dep(oh, mpu_oh); 1647 _del_initiator_dep(oh, mpu_oh);
1644 /* XXX what about the other system initiators here? dma, dsp */ 1648 /* XXX what about the other system initiators here? dma, dsp */
1645 _disable_module(oh); 1649 _omap4_disable_module(oh);
1646 ret = _wait_target_disable(oh);
1647 if (ret)
1648 pr_warn("omap_hwmod: %s: _wait_target_disable failed\n",
1649 oh->name);
1650 _disable_clocks(oh); 1650 _disable_clocks(oh);
1651 if (oh->clkdm) 1651 if (oh->clkdm)
1652 clkdm_hwmod_disable(oh->clkdm, oh); 1652 clkdm_hwmod_disable(oh->clkdm, oh);