Commit 8e706c4d authored by Peter Ma's avatar Peter Ma Committed by Haavard Skinnemoen

avr32: add hardware handshake support to atmel_serial

Adds Hardware Handshake (aka RTS/CTS flow-control) support to
atmel_serial driver, as a termios flag.

For this to actually work, the platform code needs to configure the RTS
and CTS pins for use by the USART. This has been done for AVR32 as a
separate patch.
Signed-off-by: default avatarPeter Ma <pma@mediamatech.com>
Signed-off-by: default avatarHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: default avatarAlan Cox <alan@lxorguk.ukuu.org.uk>
parent bf4861cf
...@@ -1020,7 +1020,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -1020,7 +1020,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
/* Get current mode register */ /* Get current mode register */
mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL
| ATMEL_US_NBSTOP | ATMEL_US_PAR); | ATMEL_US_NBSTOP | ATMEL_US_PAR
| ATMEL_US_USMODE);
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);
quot = uart_get_divisor(port, baud); quot = uart_get_divisor(port, baud);
...@@ -1065,6 +1066,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -1065,6 +1066,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
} else } else
mode |= ATMEL_US_PAR_NONE; mode |= ATMEL_US_PAR_NONE;
/* hardware handshake (RTS/CTS) */
if (termios->c_cflag & CRTSCTS)
mode |= ATMEL_US_USMODE_HWHS;
else
mode |= ATMEL_US_USMODE_NORMAL;
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
port->read_status_mask = ATMEL_US_OVRE; port->read_status_mask = ATMEL_US_OVRE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment