serial: uart: add hw flow control support configuration
[deliverable/linux.git] / drivers / tty / serial / serial_core.c
index 9a01ee4dda6df1fc1427e761a0b015d455cb12fb..fbf6c5ad222f55015d79598ff4295723dd396456 100644 (file)
@@ -174,8 +174,12 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
                        if (tty->termios.c_cflag & CBAUD)
                                uart_set_mctrl(uport, TIOCM_RTS | TIOCM_DTR);
                }
-
-               if (tty_port_cts_enabled(port)) {
+               /*
+                * if hw support flow control without software intervention,
+                * then skip the below check
+                */
+               if (tty_port_cts_enabled(port) &&
+                   !(uport->flags & UPF_HARD_FLOW)) {
                        spin_lock_irq(&uport->lock);
                        if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS))
                                tty->hw_stopped = 1;
@@ -2775,7 +2779,9 @@ void uart_handle_cts_change(struct uart_port *uport, unsigned int status)
 
        uport->icount.cts++;
 
-       if (tty_port_cts_enabled(port)) {
+       /* skip below code if the hw flow control is supported */
+       if (tty_port_cts_enabled(port) &&
+           !(uport->flags & UPF_HARD_FLOW)) {
                if (tty->hw_stopped) {
                        if (status) {
                                tty->hw_stopped = 0;
This page took 0.024098 seconds and 5 git commands to generate.