aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/omap_hwmod.c
diff options
context:
space:
mode:
authorBenoit Cousson <b-cousson@ti.com>2011-07-10 07:56:30 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-10 07:56:30 -0400
commitd0f0631ddc61026dca71b5b679803000d70fde50 (patch)
tree3567cf7a32a1c6d65503a5d60c5265f0c0db484b /arch/arm/mach-omap2/omap_hwmod.c
parent6ae769973adf1325115d0dfe3fec17e26cbacd81 (diff)
OMAP4: hwmod: Replace CLKCTRL absolute address with offset macros
The CLKCTRL register was accessed using an absolute address. The usage of hardcoded macros to calculate virtual address from physical one should be avoided as much as possible. The usage of a offset will allow future improvement like migration from the current architecture code toward a module driver. Update cm_xxx accessor, move definition to the proper header file and update copyrights. Signed-off-by: Benoit Cousson <b-cousson@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Rajendra Nayak <rnayak@ti.com> Cc: Todd Poynor <toddpoynor@google.com> [paul@pwsan.com: renamed 'omap4_cm_' fns to 'omap4_cminst_'; removed empty fn prototype section from cm44xx.h; incorporated comments from Todd; documented some functions] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_hwmod.c')
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 1f6f47f1d82a..00241ea5bf09 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -146,7 +146,7 @@
146#include <plat/prcm.h> 146#include <plat/prcm.h>
147 147
148#include "cm2xxx_3xxx.h" 148#include "cm2xxx_3xxx.h"
149#include "cm44xx.h" 149#include "cminst44xx.h"
150#include "prm2xxx_3xxx.h" 150#include "prm2xxx_3xxx.h"
151#include "prm44xx.h" 151#include "prm44xx.h"
152#include "mux.h" 152#include "mux.h"
@@ -1060,7 +1060,7 @@ static int _init_clocks(struct omap_hwmod *oh, void *data)
1060 * Wait for a module @oh to leave slave idle. Returns 0 if the module 1060 * Wait for a module @oh to leave slave idle. Returns 0 if the module
1061 * does not have an IDLEST bit or if the module successfully leaves 1061 * does not have an IDLEST bit or if the module successfully leaves
1062 * slave idle; otherwise, pass along the return value of the 1062 * slave idle; otherwise, pass along the return value of the
1063 * appropriate *_cm_wait_module_ready() function. 1063 * appropriate *_cm*_wait_module_ready() function.
1064 */ 1064 */
1065static int _wait_target_ready(struct omap_hwmod *oh) 1065static int _wait_target_ready(struct omap_hwmod *oh)
1066{ 1066{
@@ -1087,7 +1087,13 @@ static int _wait_target_ready(struct omap_hwmod *oh)
1087 oh->prcm.omap2.idlest_reg_id, 1087 oh->prcm.omap2.idlest_reg_id,
1088 oh->prcm.omap2.idlest_idle_bit); 1088 oh->prcm.omap2.idlest_idle_bit);
1089 } else if (cpu_is_omap44xx()) { 1089 } else if (cpu_is_omap44xx()) {
1090 ret = omap4_cm_wait_module_ready(oh->prcm.omap4.clkctrl_reg); 1090 if (!oh->clkdm)
1091 return -EINVAL;
1092
1093 ret = omap4_cminst_wait_module_ready(oh->clkdm->prcm_partition,
1094 oh->clkdm->cm_inst,
1095 oh->clkdm->clkdm_offs,
1096 oh->prcm.omap4.clkctrl_offs);
1091 } else { 1097 } else {
1092 BUG(); 1098 BUG();
1093 }; 1099 };