aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/pch_uart.c
diff options
context:
space:
mode:
authorTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>2011-02-22 20:03:17 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-22 20:22:04 -0500
commit9af7155bb03675ba2d4d68428a4345e0511ce8dd (patch)
tree82c11187bbbaab18601e0a554c120d6aed04a15f /drivers/tty/serial/pch_uart.c
parentaac6c0b0fd6458f166651fc102695fb8836a4d95 (diff)
pch_uart: fix auto flow control miss-setting issue
Currently, auto-flow control setting processing is not set correctly. This patch fixes the issue. Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/serial/pch_uart.c')
-rw-r--r--drivers/tty/serial/pch_uart.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 189886122516..0c95051fa0a4 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -218,6 +218,7 @@ struct eg20t_port {
218 struct pch_uart_buffer rxbuf; 218 struct pch_uart_buffer rxbuf;
219 unsigned int dmsr; 219 unsigned int dmsr;
220 unsigned int fcr; 220 unsigned int fcr;
221 unsigned int mcr;
221 unsigned int use_dma; 222 unsigned int use_dma;
222 unsigned int use_dma_flag; 223 unsigned int use_dma_flag;
223 struct dma_async_tx_descriptor *desc_tx; 224 struct dma_async_tx_descriptor *desc_tx;
@@ -1007,7 +1008,6 @@ static unsigned int pch_uart_get_mctrl(struct uart_port *port)
1007static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) 1008static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
1008{ 1009{
1009 u32 mcr = 0; 1010 u32 mcr = 0;
1010 unsigned int dat;
1011 struct eg20t_port *priv = container_of(port, struct eg20t_port, port); 1011 struct eg20t_port *priv = container_of(port, struct eg20t_port, port);
1012 1012
1013 if (mctrl & TIOCM_DTR) 1013 if (mctrl & TIOCM_DTR)
@@ -1017,11 +1017,11 @@ static void pch_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
1017 if (mctrl & TIOCM_LOOP) 1017 if (mctrl & TIOCM_LOOP)
1018 mcr |= UART_MCR_LOOP; 1018 mcr |= UART_MCR_LOOP;
1019 1019
1020 if (mctrl) { 1020 if (priv->mcr & UART_MCR_AFE)
1021 dat = pch_uart_get_mctrl(port); 1021 mcr |= UART_MCR_AFE;
1022 dat |= mcr; 1022
1023 iowrite8(dat, priv->membase + UART_MCR); 1023 if (mctrl)
1024 } 1024 iowrite8(mcr, priv->membase + UART_MCR);
1025} 1025}
1026 1026
1027static void pch_uart_stop_tx(struct uart_port *port) 1027static void pch_uart_stop_tx(struct uart_port *port)
@@ -1215,6 +1215,13 @@ static void pch_uart_set_termios(struct uart_port *port,
1215 } else { 1215 } else {
1216 parity = PCH_UART_HAL_PARITY_NONE; 1216 parity = PCH_UART_HAL_PARITY_NONE;
1217 } 1217 }
1218
1219 /* Only UART0 has auto hardware flow function */
1220 if ((termios->c_cflag & CRTSCTS) && (priv->fifo_size == 256))
1221 priv->mcr |= UART_MCR_AFE;
1222 else
1223 priv->mcr &= ~UART_MCR_AFE;
1224
1218 termios->c_cflag &= ~CMSPAR; /* Mark/Space parity is not supported */ 1225 termios->c_cflag &= ~CMSPAR; /* Mark/Space parity is not supported */
1219 1226
1220 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16); 1227 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk / 16);