serial_core: Add wake_peer uart operation
authorSan Mehat <san@google.com>
Thu, 30 Jul 2009 03:21:28 +0000 (20:21 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 20:40:27 +0000 (13:40 -0700)
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 f87dbfd3277047a9c9d6d2ef6fdd7c3487a32f93..7855f3a4ad05ceeda9f96068b45b37e632dda7d1 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_circ_empty(&state->xmit) && state->xmit.buf &&
            !tty->stopped && !tty->hw_stopped)
                port->ops->start_tx(port);
index 87d4bbc773fc7d8d7223423c9d388accc32c527c..a782f3ca71e9b84782ed0ec500baa6ad26df2434 100644 (file)
@@ -60,6 +60,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