summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/bfin_sport_uart.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-06-16 09:17:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-10 16:07:46 -0700
commit8bd67d7d2cbcea2a2371480fe3fe47f2bcd0294c (patch)
tree0d3798ff3e7e7fb0ba7f77ff1a7d7a412c06467a /drivers/tty/serial/bfin_sport_uart.c
parentc18b55fd1717a4c08c9f3555be63da142767e6b8 (diff)
downloadlinux-8bd67d7d2cbcea2a2371480fe3fe47f2bcd0294c.tar.bz2
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_sport_uart.c')
-rw-r--r--drivers/tty/serial/bfin_sport_uart.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/tty/serial/bfin_sport_uart.c b/drivers/tty/serial/bfin_sport_uart.c
index 1174efa466a6..7810aa290edf 100644
--- a/drivers/tty/serial/bfin_sport_uart.c
+++ b/drivers/tty/serial/bfin_sport_uart.c
@@ -495,6 +495,13 @@ static void sport_set_termios(struct uart_port *port,
pr_debug("%s enter, c_cflag:%08x\n", __func__, termios->c_cflag);
+#ifdef CONFIG_SERIAL_BFIN_SPORT_CTSRTS
+ if (old == NULL && up->cts_pin != -1)
+ termios->c_cflag |= CRTSCTS;
+ else if (up->cts_pin == -1)
+ termios->c_cflag &= ~CRTSCTS;
+#endif
+
switch (termios->c_cflag & CSIZE) {
case CS8:
up->csize = 8;
@@ -807,10 +814,8 @@ static int sport_uart_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
if (res == NULL)
sport->cts_pin = -1;
- else {
+ else
sport->cts_pin = res->start;
- sport->port.flags |= ASYNC_CTS_FLOW;
- }
res = platform_get_resource(pdev, IORESOURCE_IO, 1);
if (res == NULL)