From: San Mehat Date: Thu, 30 Jul 2009 03:21:28 +0000 (-0700) Subject: serial_core: Add wake_peer uart operation which is called before starting UART TX... X-Git-Tag: firefly_0821_release~7613^2~770 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=93739c0025f11be799729e946fdf69473fc4ffc9;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index db7912cb7ae0..62ba22f7d318 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 a5c31146a337..0d239897b2f4 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -245,6 +245,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