ANDROID: serial_core: Add wake_peer uart operation
authorSan Mehat <san@google.com>
Thu, 30 Jul 2009 03:21:28 +0000 (20:21 -0700)
committermyung-su.cha <myung-su.cha@samsung.com>
Wed, 9 May 2018 12:14:45 +0000 (21:14 +0900)
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 c8cb0b398cb19b26bc83bcfb7fb86585691114cb..de86a31d9ce776f1efd99e293abeccc4bee00bce 100644 (file)
@@ -133,6 +133,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 && port->ops->wake_peer)
+               port->ops->wake_peer(port);
+
        if (port && !uart_tx_stopped(port))
                port->ops->start_tx(port);
 }
index 5553e04e59c9fb932c6d91ff71e0e9ddbe0bb640..66d6a07f9f647b40c392124a3fb32e94d09ec79b 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