aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm2xxx_3xxx.c
diff options
context:
space:
mode:
authorVishwanath BS <vishwanath.bs@ti.com>2012-06-22 10:40:02 -0400
committerPaul Walmsley <paul@pwsan.com>2012-06-22 10:40:02 -0400
commit09659fa72bf638ae986b8b80cf99309768dd0b32 (patch)
tree208420cdcfb4c40b6b2fa0c33224caa68bc10aeb /arch/arm/mach-omap2/prm2xxx_3xxx.c
parentfe7ea0062f2f846bb68447c7b813b9230285dbeb (diff)
ARM: OMAP3: PM: Move IO Daisychain function to omap3 prm file
Since IO Daisychain modifies only PRM registers, it makes sense to move it to PRM File. Also changed the timeout value for IO chain enable to 100us and added a wait for status disable at the end. Thanks to Nishanth Menon <nm@ti.com> for contributing a fix to the timeout code waiting for WUCLKOUT to go high. Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com> Signed-off-by: Tero Kristo <t-kristo@ti.com> Cc: Nishanth Menon <nm@ti.com> Reviewed-by: Rajendra Nayak <rnayak@ti.com> [paul@pwsan.com: renamed omap3_trigger_io_chain() to better describe the end result and to match other PRM functions; removed omap3_disable_io_chain(); moved MAX_IOPAD_LATCH_TIME to prcm-common as it will also be used by the OMAP4 code; removed unnecessary barrier; added kerneldoc; added credit for fix from Nishanth] Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/prm2xxx_3xxx.c')
-rw-r--r--arch/arm/mach-omap2/prm2xxx_3xxx.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c
index 9ce765407ad5..7d62bd654dbe 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c
@@ -301,6 +301,37 @@ void omap3xxx_prm_restore_irqen(u32 *saved_mask)
301 OMAP3_PRM_IRQENABLE_MPU_OFFSET); 301 OMAP3_PRM_IRQENABLE_MPU_OFFSET);
302} 302}
303 303
304/**
305 * omap3xxx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
306 *
307 * Clear any previously-latched I/O wakeup events and ensure that the
308 * I/O wakeup gates are aligned with the current mux settings. Works
309 * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
310 * deasserting WUCLKIN and clearing the ST_IO_CHAIN WKST bit. No
311 * return value.
312 */
313void omap3xxx_prm_reconfigure_io_chain(void)
314{
315 int i = 0;
316
317 omap2_prm_set_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
318 PM_WKEN);
319
320 omap_test_timeout(omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST) &
321 OMAP3430_ST_IO_CHAIN_MASK,
322 MAX_IOPAD_LATCH_TIME, i);
323 if (i == MAX_IOPAD_LATCH_TIME)
324 pr_warn("PRM: I/O chain clock line assertion timed out\n");
325
326 omap2_prm_clear_mod_reg_bits(OMAP3430_EN_IO_CHAIN_MASK, WKUP_MOD,
327 PM_WKEN);
328
329 omap2_prm_set_mod_reg_bits(OMAP3430_ST_IO_CHAIN_MASK, WKUP_MOD,
330 PM_WKST);
331
332 omap2_prm_read_mod_reg(WKUP_MOD, PM_WKST);
333}
334
304static int __init omap3xxx_prcm_init(void) 335static int __init omap3xxx_prcm_init(void)
305{ 336{
306 if (cpu_is_omap34xx()) 337 if (cpu_is_omap34xx())