diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-08-31 05:12:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-31 05:12:14 -0400 |
commit | b129a8ccd53f74c43e4c83c8e0031a4990040830 (patch) | |
tree | 4c40afd836be87166d6d014380262f1baa19694f /drivers/serial/sh-sci.c | |
parent | 6b39374a27eb4be7e9d82145ae270ba02ea90dc8 (diff) | |
parent | 194d0710e1a7fe92dcf860ddd31fded8c3103b7a (diff) |
[SERIAL] Clean up and fix tty transmission start/stoping
The start_tx and stop_tx methods were passed a flag to indicate
whether the start/stop was from the tty start/stop callbacks, and
some drivers used this flag to decide whether to ask the UART to
immediately stop transmission (where the UART supports such a
feature.)
There are other cases when we wish this to occur - when CTS is
lowered, or if we change from soft to hard flow control and CTS
is inactive. In these cases, this flag was false, and we would
allow the transmitter to drain before stopping.
There is really only one case where we want to let the transmitter
drain before disabling, and that's when we run out of characters
to send.
Hence, re-jig the start_tx and stop_tx methods to eliminate this
flag, and introduce new functions for the special "disable and
allow transmitter to drain" case.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/sh-sci.c')
-rw-r--r-- | drivers/serial/sh-sci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index ad5b776d779b..512266307866 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -79,8 +79,8 @@ static struct sci_port *serial_console_port = 0; | |||
79 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ | 79 | #endif /* CONFIG_SERIAL_SH_SCI_CONSOLE */ |
80 | 80 | ||
81 | /* Function prototypes */ | 81 | /* Function prototypes */ |
82 | static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop); | 82 | static void sci_stop_tx(struct uart_port *port); |
83 | static void sci_start_tx(struct uart_port *port, unsigned int tty_start); | 83 | static void sci_start_tx(struct uart_port *port); |
84 | static void sci_start_rx(struct uart_port *port, unsigned int tty_start); | 84 | static void sci_start_rx(struct uart_port *port, unsigned int tty_start); |
85 | static void sci_stop_rx(struct uart_port *port); | 85 | static void sci_stop_rx(struct uart_port *port); |
86 | static int sci_request_irq(struct sci_port *port); | 86 | static int sci_request_irq(struct sci_port *port); |
@@ -455,7 +455,7 @@ static void sci_transmit_chars(struct uart_port *port) | |||
455 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) | 455 | if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) |
456 | uart_write_wakeup(port); | 456 | uart_write_wakeup(port); |
457 | if (uart_circ_empty(xmit)) { | 457 | if (uart_circ_empty(xmit)) { |
458 | sci_stop_tx(port, 0); | 458 | sci_stop_tx(port); |
459 | } else { | 459 | } else { |
460 | local_irq_save(flags); | 460 | local_irq_save(flags); |
461 | ctrl = sci_in(port, SCSCR); | 461 | ctrl = sci_in(port, SCSCR); |
@@ -900,7 +900,7 @@ static unsigned int sci_get_mctrl(struct uart_port *port) | |||
900 | return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR; | 900 | return TIOCM_DTR | TIOCM_RTS | TIOCM_DSR; |
901 | } | 901 | } |
902 | 902 | ||
903 | static void sci_start_tx(struct uart_port *port, unsigned int tty_start) | 903 | static void sci_start_tx(struct uart_port *port) |
904 | { | 904 | { |
905 | struct sci_port *s = &sci_ports[port->line]; | 905 | struct sci_port *s = &sci_ports[port->line]; |
906 | 906 | ||
@@ -909,7 +909,7 @@ static void sci_start_tx(struct uart_port *port, unsigned int tty_start) | |||
909 | enable_irq(s->irqs[SCIx_TXI_IRQ]); | 909 | enable_irq(s->irqs[SCIx_TXI_IRQ]); |
910 | } | 910 | } |
911 | 911 | ||
912 | static void sci_stop_tx(struct uart_port *port, unsigned int tty_stop) | 912 | static void sci_stop_tx(struct uart_port *port) |
913 | { | 913 | { |
914 | unsigned long flags; | 914 | unsigned long flags; |
915 | unsigned short ctrl; | 915 | unsigned short ctrl; |
@@ -978,7 +978,7 @@ static void sci_shutdown(struct uart_port *port) | |||
978 | struct sci_port *s = &sci_ports[port->line]; | 978 | struct sci_port *s = &sci_ports[port->line]; |
979 | 979 | ||
980 | sci_stop_rx(port); | 980 | sci_stop_rx(port); |
981 | sci_stop_tx(port, 1); | 981 | sci_stop_tx(port); |
982 | sci_free_irq(s); | 982 | sci_free_irq(s); |
983 | 983 | ||
984 | #if defined(__H8300S__) | 984 | #if defined(__H8300S__) |