newton: add goodix tp support and support goodix and focal detect
[firefly-linux-kernel-4.4.55.git] / drivers / serial / serial_core.c
index 1689bda1d13b0b486096c584ec8d73da4464b965..47ad0cb20e42cfc5c9dea490cc37e58684691ebe 100644 (file)
@@ -94,6 +94,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);
@@ -1270,6 +1273,9 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
 
        BUG_ON(!kernel_locked());
 
+       if (!state)
+               return;
+
        uport = state->uart_port;
        port = &state->port;
 
@@ -1316,9 +1322,9 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
         */
        if (port->flags & ASYNC_INITIALIZED) {
                unsigned long flags;
-               spin_lock_irqsave(&port->lock, flags);
+               spin_lock_irqsave(&uport->lock, flags);
                uport->ops->stop_rx(uport);
-               spin_unlock_irqrestore(&port->lock, flags);
+               spin_unlock_irqrestore(&uport->lock, flags);
                /*
                 * Before we drop DTR, make sure the UART transmitter
                 * has completely drained; this is especially