aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2011-12-13 01:04:23 +0800
committerAndy Green <andy.green@linaro.org>2012-01-09 10:25:05 +0800
commit28fe1712c49bed3015aeb6f8ed31c7d47ca00c6e (patch)
treeaf4706508ed1085c03d0e1c4c76c95b314a9b458
parentcac6ded3d410652f454c7745b4e6592c808633ac (diff)
serial_core: Add wake_peer uart operation which is called before starting UART TX. The idea here is to provide a mechanism where we can wakeup our peer before sending data.
Signed-off-by: San Mehat <san@google.com>
-rw-r--r--drivers/tty/serial/serial_core.c3
-rw-r--r--include/linux/serial_core.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 0406d7ff505..8fd45f1d8a5 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -91,6 +91,9 @@ static void __uart_start(struct tty_struct *tty)
struct uart_state *state = tty->driver_data;
struct uart_port *port = state->uart_port;
+ if (port->ops->wake_peer)
+ port->ops->wake_peer(port);
+
if (!uart_circ_empty(&state->xmit) && state->xmit.buf &&
!tty->stopped && !tty->hw_stopped)
port->ops->start_tx(port);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index eadf33d0abb..11613b38307 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -246,6 +246,7 @@ struct uart_ops {
void (*pm)(struct uart_port *, unsigned int state,
unsigned int oldstate);
int (*set_wake)(struct uart_port *, unsigned int state);
+ void (*wake_peer)(struct uart_port *);
/*
* Return a string describing the type of the port