aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/prm44xx.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-06-22 10:40:03 -0400
committerPaul Walmsley <paul@pwsan.com>2012-06-22 10:40:03 -0400
commitdea6200ba0a43afb90a277802c3edf0124848eed (patch)
tree45bd1997bd09e841d2b56cc44f8dbe5adf55ea60 /arch/arm/mach-omap2/prm44xx.c
parent09659fa72bf638ae986b8b80cf99309768dd0b32 (diff)
ARM: OMAP4: PRM: Add IO Daisychain support
IO daisychain is a mechanism that allows individual IO pads to generate wakeup events on their own based on a switch of an input signal level. This allows the hardware module behind the pad to be powered down, but still have device level capability to detect IO events, and once this happens the module can be powered back up to resume IO. See section 3.9.4 in OMAP4430 Public TRM for details. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Vishwanath BS <vishwanath.bs@ti.com> Signed-off-by: Tero Kristo <t-kristo@ti.com> [paul@pwsan.com: use the shared MAX_IOPAD_LATCH_TIME declaration; renamed omap4_trigger_io_chain() to conform to other PRM function names; added kerneldoc; resolved 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.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c
index f106d21ff581..28ffbc55f8d6 100644
--- a/arch/arm/mach-omap2/prm44xx.c
+++ b/arch/arm/mach-omap2/prm44xx.c
@@ -233,6 +233,60 @@ void omap44xx_prm_restore_irqen(u32 *saved_mask)
233 OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); 233 OMAP4_PRM_IRQENABLE_MPU_2_OFFSET);
234} 234}
235 235
236/**
237 * omap44xx_prm_reconfigure_io_chain - clear latches and reconfigure I/O chain
238 *
239 * Clear any previously-latched I/O wakeup events and ensure that the
240 * I/O wakeup gates are aligned with the current mux settings. Works
241 * by asserting WUCLKIN, waiting for WUCLKOUT to be asserted, and then
242 * deasserting WUCLKIN and waiting for WUCLKOUT to be deasserted.
243 * No return value. XXX Are the final two steps necessary?
244 */
245void omap44xx_prm_reconfigure_io_chain(void)
246{
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
260 /* Trigger WUCLKIN enable */
261 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK,
262 OMAP4430_WUCLK_CTRL_MASK,
263 OMAP4430_PRM_DEVICE_INST,
264 OMAP4_PRM_IO_PMCTRL_OFFSET);
265 omap_test_timeout(
266 (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
267 OMAP4_PRM_IO_PMCTRL_OFFSET) &
268 OMAP4430_WUCLK_STATUS_MASK) >>
269 OMAP4430_WUCLK_STATUS_SHIFT) == 1),
270 MAX_IOPAD_LATCH_TIME, i);
271 if (i == MAX_IOPAD_LATCH_TIME)
272 pr_warn("PRM: I/O chain clock line assertion timed out\n");
273
274 /* Trigger WUCLKIN disable */
275 omap4_prm_rmw_inst_reg_bits(OMAP4430_WUCLK_CTRL_MASK, 0x0,
276 OMAP4430_PRM_DEVICE_INST,
277 OMAP4_PRM_IO_PMCTRL_OFFSET);
278 omap_test_timeout(
279 (((omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST,
280 OMAP4_PRM_IO_PMCTRL_OFFSET) &
281 OMAP4430_WUCLK_STATUS_MASK) >>
282 OMAP4430_WUCLK_STATUS_SHIFT) == 0),
283 MAX_IOPAD_LATCH_TIME, i);
284 if (i == MAX_IOPAD_LATCH_TIME)
285 pr_warn("PRM: I/O chain clock line deassertion timed out\n");
286
287 return;
288}
289
236static int __init omap4xxx_prcm_init(void) 290static int __init omap4xxx_prcm_init(void)
237{ 291{
238 if (cpu_is_omap44xx()) 292 if (cpu_is_omap44xx())