summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Zobel <dzobel1@motorola.com>2014-07-16 18:29:53 -0500
committerDoug Zobel <dzobel1@motorola.com>2014-07-17 14:40:23 -0500
commit81e594422fb91e007ebe94d94922b5aa01072fbc (patch)
tree827440657228c07c4f679e58b52b0d37c7e3e912
parent6ccdf6d6ca16904865e32af56f9524ccc9f0407d (diff)
downloadolio-linux-3.10-81e594422fb91e007ebe94d94922b5aa01072fbc.tar.xz
olio-linux-3.10-81e594422fb91e007ebe94d94922b5aa01072fbc.zip
IKXCLOCK-2861 uart: Allow UART to grab timed wakelocks
In the case of asynchronous wakeups coming in from UART, the system may need to stay awake for a period in order to catch a retry reliably. By making a port specific platform data wakelock timeout parameter, a port can be configured to stay awake longer than the retry period. Change-Id: I46ab72bf19d9916c409cac9cdda51acc362fa1a9
-rw-r--r--drivers/tty/serial/omap-serial.c8
-rw-r--r--include/linux/platform_data/serial-omap.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index ab5ec0b4c03..28088f1d0d5 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -173,6 +173,7 @@ struct uart_omap_port {
int ext_rt_cnt;
bool open_close_pm;
unsigned int rx_trig;
+ int wakelock_timeout;
int (*get_context_loss_count)(struct device *);
};
@@ -543,6 +544,9 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id)
spin_lock(&up->port.lock);
pm_runtime_get_sync(up->dev);
+ if (up->wakelock_timeout)
+ pm_wakeup_event(up->dev, up->wakelock_timeout);
+
do {
iir = serial_in(up, UART_IIR);
if (iir & UART_IIR_NO_INT)
@@ -1436,6 +1440,7 @@ static struct omap_uart_port_info *of_get_uart_port_info(struct device *dev)
of_property_read_u32(np, "flags", &oi->flags);
oi->wakeup_capable = of_property_read_bool(np, "wakeup-capable");
of_property_read_u32(np, "autosuspend-delay", &oi->autosuspend_timeout);
+ of_property_read_u32(np, "timed-wakelock", &oi->wakelock_timeout);
oi->open_close_pm = of_property_read_bool(np, "open_close_pm");
if (of_property_read_u32(np, "rx_trig", &oi->rx_trig))
oi->rx_trig = 1;
@@ -1574,6 +1579,9 @@ static int serial_omap_probe(struct platform_device *pdev)
up->open_close_pm = omap_up_info->open_close_pm;
up->get_context_loss_count = omap_pm_get_dev_context_loss_count;
+ if (omap_up_info->wakelock_timeout)
+ up->wakelock_timeout = omap_up_info->wakelock_timeout;
+
pm_runtime_mark_last_busy(up->dev);
pm_runtime_put_autosuspend(up->dev);
return 0;
diff --git a/include/linux/platform_data/serial-omap.h b/include/linux/platform_data/serial-omap.h
index a2f2a8c45a2..afba9011b52 100644
--- a/include/linux/platform_data/serial-omap.h
+++ b/include/linux/platform_data/serial-omap.h
@@ -37,6 +37,7 @@ struct omap_uart_port_info {
unsigned int dma_rx_buf_size;
unsigned int dma_rx_timeout;
unsigned int autosuspend_timeout;
+ unsigned int wakelock_timeout;
unsigned int dma_rx_poll_rate;
int DTR_gpio;
int DTR_inverted;