aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-10-06 04:12:44 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-11-04 07:29:33 -0500
commitc7d059cae31f328bbe2be6ab737226d338f22486 (patch)
tree0e733e2418dc6fc4abf07064b8378b69776d75e5 /drivers/tty
parent18f360f865cffde44b112577fed1a6a0dd2740dc (diff)
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: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/omap-serial.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index fbce4c2e55c..7180ffc847e 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -898,31 +898,30 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
898 else 898 else
899 serial_out(up, UART_OMAP_MDR1, up->mdr1); 899 serial_out(up, UART_OMAP_MDR1, up->mdr1);
900 900
901 /* Hardware Flow Control Configuration */ 901 /* Enable access to TCR/TLR */
902 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
903 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
904 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
905 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
902 906
903 if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) { 907 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
904 /* Enable access to TCR/TLR */
905 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
906 serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
907 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
908 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
909 908
910 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); 909 /* Hardware Flow Control Configuration */
911 910
911 if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) {
912 /* Enable AUTORTS and AUTOCTS */ 912 /* Enable AUTORTS and AUTOCTS */
913 up->efr |= UART_EFR_CTS | UART_EFR_RTS; 913 up->efr |= UART_EFR_CTS | UART_EFR_RTS;
914 914
915 /* Ensure MCR RTS is asserted */ 915 /* Ensure MCR RTS is asserted */
916 up->mcr |= UART_MCR_RTS; 916 up->mcr |= UART_MCR_RTS;
917
918 /* Disable access to TCR/TLR */
919 serial_out(up, UART_MCR, up->mcr);
920 } else { 917 } else {
921 /* Disable AUTORTS and AUTOCTS */ 918 /* Disable AUTORTS and AUTOCTS */
922 up->efr &= ~(UART_EFR_CTS | UART_EFR_RTS); 919 up->efr &= ~(UART_EFR_CTS | UART_EFR_RTS);
923 } 920 }
924 921
925 if (up->port.flags & UPF_SOFT_FLOW) { 922 if (up->port.flags & UPF_SOFT_FLOW) {
923 /* Disable access to TCR/TLR */
924 serial_out(up, UART_MCR, up->mcr);
926 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 925 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
927 serial_out(up, UART_EFR, up->efr); 926 serial_out(up, UART_EFR, up->efr);
928 927
@@ -961,14 +960,9 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
961 up->mcr |= UART_MCR_XONANY; 960 up->mcr |= UART_MCR_XONANY;
962 else 961 else
963 up->mcr &= ~UART_MCR_XONANY; 962 up->mcr &= ~UART_MCR_XONANY;
964
965 serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR);
966 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
967 serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG);
968 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);
969 serial_out(up, UART_MCR, up->mcr);
970 } 963 }
971 964
965 serial_out(up, UART_MCR, up->mcr);
972 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); 966 serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B);
973 serial_out(up, UART_EFR, up->efr); 967 serial_out(up, UART_EFR, up->efr);
974 serial_out(up, UART_LCR, up->lcr); 968 serial_out(up, UART_LCR, up->lcr);