serial_core: Add wake_peer uart operation
authorSan Mehat <san@google.com>
Thu, 30 Jul 2009 03:21:28 +0000 (20:21 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:54:17 +0000 (13:54 -0800)
Add wake_peer which is called before starting UART TX. The idea here
is to provide a mechanism where we can wakeup our peer before sending
data.

Change-Id: I42e0779b635f64ca99184b45d5b028de80197491
Signed-off-by: San Mehat <san@google.com>
drivers/tty/serial/serial_core.c
include/linux/serial_core.h

index def5199ca004d1f3b7fa70057b465871a8ef5bb5..62fe36858a75d989ff2fa431c64a96aa850f549c 100644 (file)
@@ -95,6 +95,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_tx_stopped(port))
                port->ops->start_tx(port);
 }
index 297d4fa1cfe513d85340ae43c1217d47e9c7e881..0afc11f8f30030af685217aa0656da16932dd09e 100644 (file)
@@ -66,6 +66,7 @@ struct uart_ops {
        void            (*set_ldisc)(struct uart_port *, struct ktermios *);
        void            (*pm)(struct uart_port *, unsigned int state,
                              unsigned int oldstate);
+       void            (*wake_peer)(struct uart_port *);
 
        /*
         * Return a string describing the type of the port