diff options
Diffstat (limited to 'drivers/tty/serial/atmel_serial.c')
| -rw-r--r-- | drivers/tty/serial/atmel_serial.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index fd8aa1f4ba78..168b10cad47b 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
| @@ -2132,11 +2132,29 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 2132 | mode |= ATMEL_US_USMODE_RS485; | 2132 | mode |= ATMEL_US_USMODE_RS485; |
| 2133 | } else if (termios->c_cflag & CRTSCTS) { | 2133 | } else if (termios->c_cflag & CRTSCTS) { |
| 2134 | /* RS232 with hardware handshake (RTS/CTS) */ | 2134 | /* RS232 with hardware handshake (RTS/CTS) */ |
| 2135 | if (atmel_use_dma_rx(port) && !atmel_use_fifo(port)) { | 2135 | if (atmel_use_fifo(port) && |
| 2136 | dev_info(port->dev, "not enabling hardware flow control because DMA is used"); | 2136 | !mctrl_gpio_to_gpiod(atmel_port->gpios, UART_GPIO_CTS)) { |
| 2137 | termios->c_cflag &= ~CRTSCTS; | 2137 | /* |
| 2138 | } else { | 2138 | * with ATMEL_US_USMODE_HWHS set, the controller will |
| 2139 | * be able to drive the RTS pin high/low when the RX | ||
| 2140 | * FIFO is above RXFTHRES/below RXFTHRES2. | ||
| 2141 | * It will also disable the transmitter when the CTS | ||
| 2142 | * pin is high. | ||
| 2143 | * This mode is not activated if CTS pin is a GPIO | ||
| 2144 | * because in this case, the transmitter is always | ||
| 2145 | * disabled (there must be an internal pull-up | ||
| 2146 | * responsible for this behaviour). | ||
| 2147 | * If the RTS pin is a GPIO, the controller won't be | ||
| 2148 | * able to drive it according to the FIFO thresholds, | ||
| 2149 | * but it will be handled by the driver. | ||
| 2150 | */ | ||
| 2139 | mode |= ATMEL_US_USMODE_HWHS; | 2151 | mode |= ATMEL_US_USMODE_HWHS; |
| 2152 | } else { | ||
| 2153 | /* | ||
| 2154 | * For platforms without FIFO, the flow control is | ||
| 2155 | * handled by the driver. | ||
| 2156 | */ | ||
| 2157 | mode |= ATMEL_US_USMODE_NORMAL; | ||
| 2140 | } | 2158 | } |
| 2141 | } else { | 2159 | } else { |
| 2142 | /* RS232 without hadware handshake */ | 2160 | /* RS232 without hadware handshake */ |
