diff options
author | Olof Johansson <olof@lixom.net> | 2012-10-09 17:04:35 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2012-10-09 18:00:55 -0400 |
commit | aa8bd5969e90af0bd146b466f4f2c7c0c8992eab (patch) | |
tree | 38c58b88667cbd3ceace54314046be1dac6a8a80 /arch/arm/mach-omap2/omap_hwmod.c | |
parent | 125c9671794a0d4b49d51a925aa8190f1d5d2168 (diff) | |
parent | eb20f31f6e7d3ac19738e5a45df9b09b25381e73 (diff) |
Merge tag 'omap-for-v3.7-rc1/fixes-hwmod-clock-signed-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes
From Paul Walmsley <paul@pwsan.com> via Tony Lindgren:
Some OMAP fixes for the 3.7 merge window, fixing mismerges, branch
integration issues, and bugs after the arm-soc merges.
* tag 'omap-for-v3.7-rc1/fixes-hwmod-clock-signed-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP4/AM335x: hwmod: fix disable_module regression in hardreset handling
ARM: OMAP3: fix workaround for EMU clockdomain
ARM: OMAP: omap3evm: fix new sparse warning
ARM: OMAP2+: hwmod data: Fix PMU interrupt definitions
ARM: am33xx: clk: Update clkdev table to add mcasp alias
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_hwmod.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 299ca2821ad1..b969ab1d258b 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1698,6 +1698,29 @@ static bool _are_all_hardreset_lines_asserted(struct omap_hwmod *oh) | |||
1698 | } | 1698 | } |
1699 | 1699 | ||
1700 | /** | 1700 | /** |
1701 | * _are_any_hardreset_lines_asserted - return true if any part of @oh is | ||
1702 | * hard-reset | ||
1703 | * @oh: struct omap_hwmod * | ||
1704 | * | ||
1705 | * If any hardreset lines associated with @oh are asserted, then | ||
1706 | * return true. Otherwise, if no hardreset lines associated with @oh | ||
1707 | * are asserted, or if @oh has no hardreset lines, then return false. | ||
1708 | * This function is used to avoid executing some parts of the IP block | ||
1709 | * enable/disable sequence if any hardreset line is set. | ||
1710 | */ | ||
1711 | static bool _are_any_hardreset_lines_asserted(struct omap_hwmod *oh) | ||
1712 | { | ||
1713 | int rst_cnt = 0; | ||
1714 | int i; | ||
1715 | |||
1716 | for (i = 0; i < oh->rst_lines_cnt && rst_cnt == 0; i++) | ||
1717 | if (_read_hardreset(oh, oh->rst_lines[i].name) > 0) | ||
1718 | rst_cnt++; | ||
1719 | |||
1720 | return (rst_cnt) ? true : false; | ||
1721 | } | ||
1722 | |||
1723 | /** | ||
1701 | * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4 | 1724 | * _omap4_disable_module - enable CLKCTRL modulemode on OMAP4 |
1702 | * @oh: struct omap_hwmod * | 1725 | * @oh: struct omap_hwmod * |
1703 | * | 1726 | * |
@@ -1715,7 +1738,7 @@ static int _omap4_disable_module(struct omap_hwmod *oh) | |||
1715 | * Since integration code might still be doing something, only | 1738 | * Since integration code might still be doing something, only |
1716 | * disable if all lines are under hardreset. | 1739 | * disable if all lines are under hardreset. |
1717 | */ | 1740 | */ |
1718 | if (!_are_all_hardreset_lines_asserted(oh)) | 1741 | if (_are_any_hardreset_lines_asserted(oh)) |
1719 | return 0; | 1742 | return 0; |
1720 | 1743 | ||
1721 | pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); | 1744 | pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); |
@@ -1749,12 +1772,12 @@ static int _am33xx_disable_module(struct omap_hwmod *oh) | |||
1749 | 1772 | ||
1750 | pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); | 1773 | pr_debug("omap_hwmod: %s: %s\n", oh->name, __func__); |
1751 | 1774 | ||
1775 | if (_are_any_hardreset_lines_asserted(oh)) | ||
1776 | return 0; | ||
1777 | |||
1752 | am33xx_cm_module_disable(oh->clkdm->cm_inst, oh->clkdm->clkdm_offs, | 1778 | am33xx_cm_module_disable(oh->clkdm->cm_inst, oh->clkdm->clkdm_offs, |
1753 | oh->prcm.omap4.clkctrl_offs); | 1779 | oh->prcm.omap4.clkctrl_offs); |
1754 | 1780 | ||
1755 | if (_are_all_hardreset_lines_asserted(oh)) | ||
1756 | return 0; | ||
1757 | |||
1758 | v = _am33xx_wait_target_disable(oh); | 1781 | v = _am33xx_wait_target_disable(oh); |
1759 | if (v) | 1782 | if (v) |
1760 | pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", | 1783 | pr_warn("omap_hwmod: %s: _wait_target_disable failed\n", |