Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7d059ca authored by Russell King's avatar Russell King
Browse files

SERIAL: omap: always set TCR



We always setup the TCR register in the software flow control path,
and when hardware flow control is enabled.  Remove this redundant
setup, and place it before we setup any hardware flow control.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 18f360f8
Loading
Loading
Loading
Loading
+11 −17
Original line number Diff line number Diff line
@@ -898,9 +898,6 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
	else
		serial_out(up, UART_OMAP_MDR1, up->mdr1);

	/* Hardware Flow Control Configuration */

	if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) {
	/* Enable access to TCR/TLR */
	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
	serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
@@ -909,20 +906,22 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,

	serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);

	/* Hardware Flow Control Configuration */

	if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) {
		/* Enable AUTORTS and AUTOCTS */
		up->efr |= UART_EFR_CTS | UART_EFR_RTS;

		/* Ensure MCR RTS is asserted */
		up->mcr |= UART_MCR_RTS;

		/* Disable access to TCR/TLR */
		serial_out(up, UART_MCR, up->mcr);
	} else {
		/* Disable AUTORTS and AUTOCTS */
		up->efr &= ~(UART_EFR_CTS | UART_EFR_RTS);
	}

	if (up->port.flags & UPF_SOFT_FLOW) {
		/* Disable access to TCR/TLR */
		serial_out(up, UART_MCR, up->mcr);
		serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
		serial_out(up, UART_EFR, up->efr);

@@ -961,14 +960,9 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
			up->mcr |= UART_MCR_XONANY;
		else
			up->mcr &= ~UART_MCR_XONANY;

		serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
		serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
		serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
		serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
		serial_out(up, UART_MCR, up->mcr);
	}

	serial_out(up, UART_MCR, up->mcr);
	serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
	serial_out(up, UART_EFR, up->efr);
	serial_out(up, UART_LCR, up->lcr);