diff options
author | Peter Ma <pma@mediamatech.com> | 2009-03-31 13:31:02 -0400 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2009-04-01 10:13:51 -0400 |
commit | 8e706c4d0dab214c625a2df84a0ca69a76bae65d (patch) | |
tree | fdcea60fc9364e4c1a38d719e9bb3794fa2d6852 /drivers/serial/atmel_serial.c | |
parent | bf4861cf3e7df123c0c62f00ae2c301c292f669c (diff) |
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: Peter Ma <pma@mediamatech.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Diffstat (limited to 'drivers/serial/atmel_serial.c')
-rw-r--r-- | drivers/serial/atmel_serial.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c index 8f58f7ff0dd7..b3497d7e5354 100644 --- a/drivers/serial/atmel_serial.c +++ b/drivers/serial/atmel_serial.c | |||
@@ -1020,7 +1020,8 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1020 | 1020 | ||
1021 | /* Get current mode register */ | 1021 | /* Get current mode register */ |
1022 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL | 1022 | mode = UART_GET_MR(port) & ~(ATMEL_US_USCLKS | ATMEL_US_CHRL |
1023 | | ATMEL_US_NBSTOP | ATMEL_US_PAR); | 1023 | | ATMEL_US_NBSTOP | ATMEL_US_PAR |
1024 | | ATMEL_US_USMODE); | ||
1024 | 1025 | ||
1025 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); | 1026 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); |
1026 | quot = uart_get_divisor(port, baud); | 1027 | quot = uart_get_divisor(port, baud); |
@@ -1065,6 +1066,12 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, | |||
1065 | } else | 1066 | } else |
1066 | mode |= ATMEL_US_PAR_NONE; | 1067 | mode |= ATMEL_US_PAR_NONE; |
1067 | 1068 | ||
1069 | /* hardware handshake (RTS/CTS) */ | ||
1070 | if (termios->c_cflag & CRTSCTS) | ||
1071 | mode |= ATMEL_US_USMODE_HWHS; | ||
1072 | else | ||
1073 | mode |= ATMEL_US_USMODE_NORMAL; | ||
1074 | |||
1068 | spin_lock_irqsave(&port->lock, flags); | 1075 | spin_lock_irqsave(&port->lock, flags); |
1069 | 1076 | ||
1070 | port->read_status_mask = ATMEL_US_OVRE; | 1077 | port->read_status_mask = ATMEL_US_OVRE; |