diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-10-06 04:34:36 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-04 07:29:34 -0500 |
commit | c533e51b228020142cd2c4d5f21e8db4683ce457 (patch) | |
tree | f810d7bae0e655b992aa08cc3e375207a17dab7a /drivers/tty | |
parent | c7d059cae31f328bbe2be6ab737226d338f22486 (diff) |
SERIAL: omap: move xon/xoff setting earlier
Take advantage of the switch to mode B for accessing the TCR register,
and move the xon/xoff configuration there. This allows further
simplication of this sequence.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/omap-serial.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 7180ffc847e8..0d2671e66da4 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -898,16 +898,20 @@ 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 | /* Enable access to TCR/TLR */ | 901 | /* Configure flow control */ |
902 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 902 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
903 | |||
904 | /* XON1/XOFF1 accessible mode B, TCRTLR=0, ECB=0 */ | ||
905 | serial_out(up, UART_XON1, termios->c_cc[VSTART]); | ||
906 | serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]); | ||
907 | |||
908 | /* Enable access to TCR/TLR */ | ||
903 | serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); | 909 | serial_out(up, UART_EFR, up->efr | UART_EFR_ECB); |
904 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); | 910 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); |
905 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); | 911 | serial_out(up, UART_MCR, up->mcr | UART_MCR_TCRTLR); |
906 | 912 | ||
907 | serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); | 913 | serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); |
908 | 914 | ||
909 | /* Hardware Flow Control Configuration */ | ||
910 | |||
911 | if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) { | 915 | if (termios->c_cflag & CRTSCTS && up->port.flags & UPF_HARD_FLOW) { |
912 | /* Enable AUTORTS and AUTOCTS */ | 916 | /* Enable AUTORTS and AUTOCTS */ |
913 | up->efr |= UART_EFR_CTS | UART_EFR_RTS; | 917 | up->efr |= UART_EFR_CTS | UART_EFR_RTS; |
@@ -925,9 +929,6 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
925 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 929 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
926 | serial_out(up, UART_EFR, up->efr); | 930 | serial_out(up, UART_EFR, up->efr); |
927 | 931 | ||
928 | serial_out(up, UART_XON1, termios->c_cc[VSTART]); | ||
929 | serial_out(up, UART_XOFF1, termios->c_cc[VSTOP]); | ||
930 | |||
931 | /* clear SW control mode bits */ | 932 | /* clear SW control mode bits */ |
932 | up->efr &= OMAP_UART_SW_CLR; | 933 | up->efr &= OMAP_UART_SW_CLR; |
933 | 934 | ||