aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm44xx.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2012-06-22 10:40:03 -0400
committerPaul Walmsley <paul@pwsan.com>2012-06-22 10:40:03 -0400
commit8a680ea2eb2e9ad602e290396add29e9eaed0911 (patch)
tree1eb5d125323aa1ed80b075a2f372d4eb3dc62900 /arch/arm/mach-omap2/prm44xx.c
parentdea6200ba0a43afb90a277802c3edf0124848eed (diff)
ARM: OMAP3+: PRM: Enable IO wake up
Enable IO Wake up for OMAP3/4 as part of PRM Init. Currently this has been managed in cpuidle path which is not the right place. Subsequent patch will remove IO Daisy chain handling in cpuidle path once daisy chain is handled as part of hwmod mux. This patch also moves the OMAP4 IO wakeup enable code from the trigger function to init time setup. Signed-off-by: Tero Kristo <t-kristo@ti.com> Reviewed-by: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: harmonize function names with other PRM functions; add kerneldoc; resolve checkpatch warnings] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm44xx.c')
-rw-r--r--arch/arm/mach-omap2/prm44xx.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index 28ffbc55f8d6..bb727c2d9337 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -245,17 +245,6 @@ void omap44xx_prm_restore_irqen(u32 *saved_mask)
245void omap44xx_prm_reconfigure_io_chain(void) 245void omap44xx_prm_reconfigure_io_chain(void)
246{ 246{
247 int i = 0; 247 int i = 0;
248 u32 v;
249
250 v = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
251 OMAP4_PRM_IO_PMCTRL_OFFSET);
252
253 /* Enable GLOBAL_WUEN */
254 if (!(v & OMAP4430_GLOBAL_WUEN_MASK))
255 omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
256 OMAP4430_GLOBAL_WUEN_MASK,
257 OMAP4430_PRM_DEVICE_INST,
258 OMAP4_PRM_IO_PMCTRL_OFFSET);
259 248
260 /* Trigger WUCLKIN enable */ 249 /* Trigger WUCLKIN enable */
261 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 250 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
@@ -287,10 +276,28 @@ void omap44xx_prm_reconfigure_io_chain(void)
287 return; 276 return;
288} 277}
289 278
279/**
280 * omap44xx_prm_enable_io_wakeup - enable wakeup events from I/O wakeup latches
281 *
282 * Activates the I/O wakeup event latches and allows events logged by
283 * those latches to signal a wakeup event to the PRCM. For I/O wakeups
284 * to occur, WAKEUPENABLE bits must be set in the pad mux registers, and
285 * omap44xx_prm_reconfigure_io_chain() must be called. No return value.
286 */
287static void __init omap44xx_prm_enable_io_wakeup(void)
288{
289 omap4_prm_rmw_inst_reg_bits(OMAP4430_GLOBAL_WUEN_MASK,
290 OMAP4430_GLOBAL_WUEN_MASK,
291 OMAP4430_PRM_DEVICE_INST,
292 OMAP4_PRM_IO_PMCTRL_OFFSET);
293}
294
290static int __init omap4xxx_prcm_init(void) 295static int __init omap4xxx_prcm_init(void)
291{ 296{
292 if (cpu_is_omap44xx()) 297 if (cpu_is_omap44xx()) {
298 omap44xx_prm_enable_io_wakeup();
293 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup); 299 return omap_prcm_register_chain_handler(&omap4_prcm_irq_setup);
300 }
294 return 0; 301 return 0;
295} 302}
296subsys_initcall(omap4xxx_prcm_init); 303subsys_initcall(omap4xxx_prcm_init);