diff options
| -rw-r--r-- | drivers/misc/ti-st/st_core.c | 2 | ||||
| -rw-r--r-- | drivers/tty/serial/omap-serial.c | 26 | ||||
| -rw-r--r-- | include/linux/ti_wilink_st.h | 1 |
3 files changed, 26 insertions, 3 deletions
diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index d0bf4e9e46d..e8a8cb4e99c 100644 --- a/drivers/misc/ti-st/st_core.c +++ b/drivers/misc/ti-st/st_core.c @@ -807,6 +807,8 @@ static void st_tty_receive(struct tty_struct *tty, const unsigned char *data, st_recv(tty->disc_data, data, count); wake_lock_timeout(&st_wk_lock_timeout, msecs_to_jiffies(ST_WAKE_LOCK_TIMEOUT_MS)); + + omap_serial_relax(tty->index); pr_debug("done %s\n", __func__); } diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 037e46bd92a..625cf102cc3 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -226,6 +226,28 @@ void omap_serial_runtime_put(int port_index) spin_unlock(&up->port.lock); } +static void _omap_serial_wakeup_event(struct uart_omap_port *up) +{ + if (up->wakelock_timeout) + pm_wakeup_event(up->dev, up->wakelock_timeout); +} + +static void _omap_serial_relax(struct uart_omap_port *up) +{ + if (up->wakelock_timeout) + pm_relax(up->dev); +} + +void omap_serial_relax(int port_index) +{ + struct uart_omap_port *up; + + if (port_index >= OMAP_MAX_HSUART_PORTS) + return; + up = ui[port_index]; + _omap_serial_relax(up); +} + static inline unsigned int serial_in(struct uart_omap_port *up, int offset) { offset <<= up->port.regshift; @@ -546,9 +568,7 @@ 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); + _omap_serial_wakeup_event(up); do { iir = serial_in(up, UART_IIR); diff --git a/include/linux/ti_wilink_st.h b/include/linux/ti_wilink_st.h index d914cd9085c..cf71cdea9f9 100644 --- a/include/linux/ti_wilink_st.h +++ b/include/linux/ti_wilink_st.h @@ -403,6 +403,7 @@ unsigned long st_ll_sleep_state(struct st_data_s *, unsigned char); void st_ll_wakeup(struct st_data_s *); void omap_serial_runtime_get(int port_index); void omap_serial_runtime_put(int port_index); +void omap_serial_relax(int port_index); /* * header information used by st_core.c for FM and GPS |