diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-06-16 15:17:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-11 01:07:46 +0200 |
commit | 8bd67d7d2cbcea2a2371480fe3fe47f2bcd0294c (patch) | |
tree | 0d3798ff3e7e7fb0ba7f77ff1a7d7a412c06467a /drivers/tty/serial/bfin_uart.c | |
parent | tty: serial: Fix termios/port flags mismatch (diff) | |
download | linux-8bd67d7d2cbcea2a2371480fe3fe47f2bcd0294c.tar.xz linux-8bd67d7d2cbcea2a2371480fe3fe47f2bcd0294c.zip |
serial: blackfin: Fix CTS flow control
blackfin uart port drivers mistakenly set the struct uart_port
flags bit UPF_BUG_THRE (which only has meaning to the 8250 core)
while trying to set ASYNC_CTS_FLOW.
Uart port drivers can override termios settings based on actual
hardware support in their .set_termios method; the serial core
sets the appropriate port flags based on the overrides.
Overriding only the initial termios settings is accomplished
by only perform those overrides if the old termios parameter is
NULL.
CC: Sonic Zhang <sonic.zhang@analog.com>
CC: adi-buildroot-devel@lists.sourceforge.net
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/bfin_uart.c')
-rw-r--r-- | drivers/tty/serial/bfin_uart.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c index dddc081568f1..dec0fd725d80 100644 --- a/drivers/tty/serial/bfin_uart.c +++ b/drivers/tty/serial/bfin_uart.c @@ -785,6 +785,13 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, unsigned int ier, lcr = 0; unsigned long timeout; +#ifdef CONFIG_SERIAL_BFIN_CTSRTS + if (old == NULL && uart->cts_pin != -1) + termios->c_cflag |= CRTSCTS; + else if (uart->cts_pin == -1) + termios->c_cflag &= ~CRTSCTS; +#endif + switch (termios->c_cflag & CSIZE) { case CS8: lcr = WLS(8); @@ -1316,12 +1323,8 @@ static int bfin_serial_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_IO, 0); if (res == NULL) uart->cts_pin = -1; - else { + else uart->cts_pin = res->start; -#ifdef CONFIG_SERIAL_BFIN_CTSRTS - uart->port.flags |= ASYNC_CTS_FLOW; -#endif - } res = platform_get_resource(pdev, IORESOURCE_IO, 1); if (res == NULL) |