diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-12-31 16:32:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-01-09 17:10:46 -0500 |
commit | 3e29af27c4686d9cb401a63c7eeb6376662b13c1 (patch) | |
tree | 8e956bb23cf62dd34bb22ba35ad4a0238e82060d /drivers/tty/serial/8250 | |
parent | 4bf4ea9dca4ba1984abeb592f429265b9bacac42 (diff) |
serial: omap_8250: Fix RTS handling, part B
Because the OMAP3 UART ignores MCR[1] (RTS) in autoRTS mode, autoRTS
mode must not be enabled unless RTS is set (or port->mctrl & TIOCM_RTS,
which is equivalent).
Fixes premature raising of RTS in omap_8250_set_termios() -- RTS was
raised even before UART mode was selected.
Fixes raise of RTS after port has been shutdown; omap_8250_pm() re-enabled
RTS after omap_8250_shutdown().
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250')
-rw-r--r-- | drivers/tty/serial/8250/8250_omap.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c index 227033db214b..7c485eaf7dd1 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c | |||
@@ -272,7 +272,10 @@ static void omap8250_restore_regs(struct uart_8250_port *up) | |||
272 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 272 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
273 | serial_dl_write(up, priv->quot); | 273 | serial_dl_write(up, priv->quot); |
274 | 274 | ||
275 | serial_out(up, UART_EFR, priv->efr); | 275 | if (up->port.mctrl & TIOCM_RTS) |
276 | serial_out(up, UART_EFR, priv->efr); | ||
277 | else | ||
278 | serial_out(up, UART_EFR, priv->efr & ~UART_EFR_RTS); | ||
276 | 279 | ||
277 | /* Configure flow control */ | 280 | /* Configure flow control */ |
278 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 281 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
@@ -468,18 +471,18 @@ static void omap_8250_set_termios(struct uart_port *port, | |||
468 | static void omap_8250_pm(struct uart_port *port, unsigned int state, | 471 | static void omap_8250_pm(struct uart_port *port, unsigned int state, |
469 | unsigned int oldstate) | 472 | unsigned int oldstate) |
470 | { | 473 | { |
471 | struct uart_8250_port *up = | 474 | struct uart_8250_port *up = up_to_u8250p(port); |
472 | container_of(port, struct uart_8250_port, port); | 475 | u8 efr; |
473 | struct omap8250_priv *priv = up->port.private_data; | ||
474 | 476 | ||
475 | pm_runtime_get_sync(port->dev); | 477 | pm_runtime_get_sync(port->dev); |
476 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 478 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
477 | serial_out(up, UART_EFR, priv->efr | UART_EFR_ECB); | 479 | efr = serial_in(up, UART_EFR); |
480 | serial_out(up, UART_EFR, efr | UART_EFR_ECB); | ||
478 | serial_out(up, UART_LCR, 0); | 481 | serial_out(up, UART_LCR, 0); |
479 | 482 | ||
480 | serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0); | 483 | serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0); |
481 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 484 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
482 | serial_out(up, UART_EFR, priv->efr); | 485 | serial_out(up, UART_EFR, efr); |
483 | serial_out(up, UART_LCR, 0); | 486 | serial_out(up, UART_LCR, 0); |
484 | 487 | ||
485 | pm_runtime_mark_last_busy(port->dev); | 488 | pm_runtime_mark_last_busy(port->dev); |