diff options
author | Govindraj.R <govindraj.raja@ti.com> | 2011-10-13 04:41:09 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@ti.com> | 2011-12-14 19:05:23 -0500 |
commit | 62f3ec5fbd5fddce62b7a71adc04723a5eb903da (patch) | |
tree | 682d86d38cf888bd10622479d779e862ebcee6d3 /drivers | |
parent | 94734749af794c080f6af6ac3ce8c1c13ee2dbbd (diff) |
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 <govindraj.raja@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de> (for drivers/tty changes)
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 764ac7795694..45a25a01c44d 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) | |||
1496 | if (!up) | 1496 | if (!up) |
1497 | return -EINVAL; | 1497 | return -EINVAL; |
1498 | 1498 | ||
1499 | if (!pdata->enable_wakeup) | ||
1500 | return 0; | ||
1501 | |||
1499 | if (pdata->get_context_loss_count) | 1502 | if (pdata->get_context_loss_count) |
1500 | up->context_loss_cnt = pdata->get_context_loss_count(dev); | 1503 | up->context_loss_cnt = pdata->get_context_loss_count(dev); |
1501 | 1504 | ||
1505 | if (device_may_wakeup(dev)) { | ||
1506 | if (!up->wakeups_enabled) { | ||
1507 | pdata->enable_wakeup(up->pdev, true); | ||
1508 | up->wakeups_enabled = true; | ||
1509 | } | ||
1510 | } else { | ||
1511 | if (up->wakeups_enabled) { | ||
1512 | pdata->enable_wakeup(up->pdev, false); | ||
1513 | up->wakeups_enabled = false; | ||
1514 | } | ||
1515 | } | ||
1516 | |||
1502 | /* Errata i291 */ | 1517 | /* Errata i291 */ |
1503 | if (up->use_dma && pdata->set_forceidle && | 1518 | if (up->use_dma && pdata->set_forceidle && |
1504 | (up->errata & UART_ERRATA_i291_DMA_FORCEIDLE)) | 1519 | (up->errata & UART_ERRATA_i291_DMA_FORCEIDLE)) |