diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-10-06 04:08:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-04 07:29:33 -0500 |
commit | 18f360f865cffde44b112577fed1a6a0dd2740dc (patch) | |
tree | 6253fe3261bb0e4814e8d03ba350c76b3fdcda86 /drivers/tty | |
parent | 1fe8aa8803536b8030375525a07a152ba8f15363 (diff) |
SERIAL: omap: simplify
We have the sequence:
- LCR mode B
- write EFR with ECB clear
- LCR mode normal
- if s/w flow
- LCR mode B
- write EFR with ECB clear
...
- LCR mode B
- write EFR with ECB clear
- LCR mode normal
This can be simplified to:
- if s/w flow
- LCR mode B
- write EFR with ECB clear
...
- LCR mode B
- write EFR with ECB clear
- LCR mode normal
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 | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index 6d588e20c648..fbce4c2e55cf 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c | |||
@@ -917,19 +917,11 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
917 | 917 | ||
918 | /* Disable access to TCR/TLR */ | 918 | /* Disable access to TCR/TLR */ |
919 | serial_out(up, UART_MCR, up->mcr); | 919 | serial_out(up, UART_MCR, up->mcr); |
920 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | ||
921 | serial_out(up, UART_EFR, up->efr); | ||
922 | serial_out(up, UART_LCR, cval); | ||
923 | } else { | 920 | } else { |
924 | /* Disable AUTORTS and AUTOCTS */ | 921 | /* Disable AUTORTS and AUTOCTS */ |
925 | up->efr &= ~(UART_EFR_CTS | UART_EFR_RTS); | 922 | up->efr &= ~(UART_EFR_CTS | UART_EFR_RTS); |
926 | |||
927 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | ||
928 | serial_out(up, UART_EFR, up->efr); | ||
929 | serial_out(up, UART_LCR, cval); | ||
930 | } | 923 | } |
931 | 924 | ||
932 | /* Software Flow Control Configuration */ | ||
933 | if (up->port.flags & UPF_SOFT_FLOW) { | 925 | if (up->port.flags & UPF_SOFT_FLOW) { |
934 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | 926 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); |
935 | serial_out(up, UART_EFR, up->efr); | 927 | serial_out(up, UART_EFR, up->efr); |
@@ -975,11 +967,12 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios, | |||
975 | serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); | 967 | serial_out(up, UART_TI752_TCR, OMAP_UART_TCR_TRIG); |
976 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); | 968 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A); |
977 | serial_out(up, UART_MCR, up->mcr); | 969 | serial_out(up, UART_MCR, up->mcr); |
978 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | ||
979 | serial_out(up, UART_EFR, up->efr); | ||
980 | serial_out(up, UART_LCR, up->lcr); | ||
981 | } | 970 | } |
982 | 971 | ||
972 | serial_out(up, UART_LCR, UART_LCR_CONF_MODE_B); | ||
973 | serial_out(up, UART_EFR, up->efr); | ||
974 | serial_out(up, UART_LCR, up->lcr); | ||
975 | |||
983 | serial_omap_set_mctrl(&up->port, up->port.mctrl); | 976 | serial_omap_set_mctrl(&up->port, up->port.mctrl); |
984 | 977 | ||
985 | spin_unlock_irqrestore(&up->port.lock, flags); | 978 | spin_unlock_irqrestore(&up->port.lock, flags); |