From 62f3ec5fbd5fddce62b7a71adc04723a5eb903da Mon Sep 17 00:00:00 2001 From: "Govindraj.R" Date: Thu, 13 Oct 2011 14:11:09 +0530 Subject: ARM: OMAP2+: UART: Add wakeup mechanism for omap-uarts From the runtime callbacks enable hwmod wakeups for uart which will internally enable io-pad wakeups for uarts if they have rx-pad pins set as wakeup capabale. Use the io-ring wakeup mechanism after uart clock gating and leave the PM_WKST set for uart to default reset values cleanup the code in serial.c which was handling PM_WKST reg. Irq_chaing(PRM_DRIVER) is used to wakeup uart after uart clocks are gated using pad wakeup mechanism. Signed-off-by: Govindraj.R Acked-by: Greg Kroah-Hartman (for drivers/tty changes) Signed-off-by: Kevin Hilman --- drivers/tty/serial/omap-serial.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/tty') diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 764ac779569..45a25a01c44 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -1496,9 +1496,24 @@ static int serial_omap_runtime_suspend(struct device *dev) if (!up) return -EINVAL; + if (!pdata->enable_wakeup) + return 0; + if (pdata->get_context_loss_count) up->context_loss_cnt = pdata->get_context_loss_count(dev); + if (device_may_wakeup(dev)) { + if (!up->wakeups_enabled) { + pdata->enable_wakeup(up->pdev, true); + up->wakeups_enabled = true; + } + } else { + if (up->wakeups_enabled) { + pdata->enable_wakeup(up->pdev, false); + up->wakeups_enabled = false; + } + } + /* Errata i291 */ if (up->use_dma && pdata->set_forceidle && (up->errata & UART_ERRATA_i291_DMA_FORCEIDLE)) -- cgit v1.2.3