|
@@ -274,6 +274,13 @@ static bool atmel_use_dma_rx(struct uart_port *port)
|
|
|
return atmel_port->use_dma_rx;
|
|
|
}
|
|
|
|
|
|
+static bool atmel_use_fifo(struct uart_port *port)
|
|
|
+{
|
|
|
+ struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
|
|
|
+
|
|
|
+ return atmel_port->fifo_size;
|
|
|
+}
|
|
|
+
|
|
|
static unsigned int atmel_get_lines_status(struct uart_port *port)
|
|
|
{
|
|
|
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
|
|
@@ -2090,7 +2097,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
|
|
|
mode |= ATMEL_US_USMODE_RS485;
|
|
|
} else if (termios->c_cflag & CRTSCTS) {
|
|
|
/* RS232 with hardware handshake (RTS/CTS) */
|
|
|
- mode |= ATMEL_US_USMODE_HWHS;
|
|
|
+ if (atmel_use_dma_rx(port) && !atmel_use_fifo(port)) {
|
|
|
+ dev_info(port->dev, "not enabling hardware flow control because DMA is used");
|
|
|
+ termios->c_cflag &= ~CRTSCTS;
|
|
|
+ } else {
|
|
|
+ mode |= ATMEL_US_USMODE_HWHS;
|
|
|
+ }
|
|
|
} else {
|
|
|
/* RS232 without hadware handshake */
|
|
|
mode |= ATMEL_US_USMODE_NORMAL;
|