Commit 6d8bf787 authored by Maarten Brock's avatar Maarten Brock Committed by Greg Kroah-Hartman

serial: xilinx_uartps: set_termios sets flowcontrol

Let set_termios enable/disable automatic flow control.
set_mctrl should not touch automatic flow control.
Signed-off-by: default avatarMaarten Brock <m.brock@vanmierlo.com>
Signed-off-by: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1574687731-21563-2-git-send-email-shubhrajyoti.datta@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 422c6d3b
...@@ -690,7 +690,7 @@ static void cdns_uart_break_ctl(struct uart_port *port, int ctl) ...@@ -690,7 +690,7 @@ static void cdns_uart_break_ctl(struct uart_port *port, int ctl)
static void cdns_uart_set_termios(struct uart_port *port, static void cdns_uart_set_termios(struct uart_port *port,
struct ktermios *termios, struct ktermios *old) struct ktermios *termios, struct ktermios *old)
{ {
unsigned int cval = 0; u32 cval = 0;
unsigned int baud, minbaud, maxbaud; unsigned int baud, minbaud, maxbaud;
unsigned long flags; unsigned long flags;
unsigned int ctrl_reg, mode_reg, val; unsigned int ctrl_reg, mode_reg, val;
...@@ -811,6 +811,13 @@ static void cdns_uart_set_termios(struct uart_port *port, ...@@ -811,6 +811,13 @@ static void cdns_uart_set_termios(struct uart_port *port,
cval |= mode_reg & 1; cval |= mode_reg & 1;
writel(cval, port->membase + CDNS_UART_MR); writel(cval, port->membase + CDNS_UART_MR);
cval = readl(port->membase + CDNS_UART_MODEMCR);
if (termios->c_cflag & CRTSCTS)
cval |= CDNS_UART_MODEMCR_FCM;
else
cval &= ~CDNS_UART_MODEMCR_FCM;
writel(cval, port->membase + CDNS_UART_MODEMCR);
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
} }
...@@ -1045,12 +1052,9 @@ static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl) ...@@ -1045,12 +1052,9 @@ static void cdns_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
val = readl(port->membase + CDNS_UART_MODEMCR); val = readl(port->membase + CDNS_UART_MODEMCR);
mode_reg = readl(port->membase + CDNS_UART_MR); mode_reg = readl(port->membase + CDNS_UART_MR);
val &= ~(CDNS_UART_MODEMCR_RTS | CDNS_UART_MODEMCR_DTR | val &= ~(CDNS_UART_MODEMCR_RTS | CDNS_UART_MODEMCR_DTR);
CDNS_UART_MODEMCR_FCM);
mode_reg &= ~CDNS_UART_MR_CHMODE_MASK; mode_reg &= ~CDNS_UART_MR_CHMODE_MASK;
if (mctrl & TIOCM_RTS || mctrl & TIOCM_DTR)
val |= CDNS_UART_MODEMCR_FCM;
if (mctrl & TIOCM_LOOP) if (mctrl & TIOCM_LOOP)
mode_reg |= CDNS_UART_MR_CHMODE_L_LOOP; mode_reg |= CDNS_UART_MR_CHMODE_L_LOOP;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment