Commit 3e29af27 authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

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: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4bf4ea9d
...@@ -272,7 +272,10 @@ static void omap8250_restore_regs(struct uart_8250_port *up) ...@@ -272,7 +272,10 @@ static void omap8250_restore_regs(struct uart_8250_port *up)
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
serial_dl_write(up, priv->quot); serial_dl_write(up, priv->quot);
serial_out(up, UART_EFR, priv->efr); if (up->port.mctrl & TIOCM_RTS)
serial_out(up, UART_EFR, priv->efr);
else
serial_out(up, UART_EFR, priv->efr & ~UART_EFR_RTS);
/* Configure flow control */ /* Configure flow control */
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 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,18 +471,18 @@ static void omap_8250_set_termios(struct uart_port *port,
static void omap_8250_pm(struct uart_port *port, unsigned int state, static void omap_8250_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate) unsigned int oldstate)
{ {
struct uart_8250_port *up = struct uart_8250_port *up = up_to_u8250p(port);
container_of(port, struct uart_8250_port, port); u8 efr;
struct omap8250_priv *priv = up->port.private_data;
pm_runtime_get_sync(port->dev); pm_runtime_get_sync(port->dev);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(up, UART_EFR, priv->efr | UART_EFR_ECB); efr = serial_in(up, UART_EFR);
serial_out(up, UART_EFR, efr | UART_EFR_ECB);
serial_out(up, UART_LCR, 0); serial_out(up, UART_LCR, 0);
serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0); serial_out(up, UART_IER, (state != 0) ? UART_IERX_SLEEP : 0);
serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
serial_out(up, UART_EFR, priv->efr); serial_out(up, UART_EFR, efr);
serial_out(up, UART_LCR, 0); serial_out(up, UART_LCR, 0);
pm_runtime_mark_last_busy(port->dev); pm_runtime_mark_last_busy(port->dev);
......
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