Commit 6a171b29 authored by Jason Uy's avatar Jason Uy Committed by Greg Kroah-Hartman

serial: 8250_dw: Allow hardware flow control to be used

In the most common use case, the Synopsys DW UART driver does not
set the set_termios callback function.  This prevents UPSTAT_AUTOCTS
from being set when the UART flag CRTSCTS is set.  As a result, the
driver will use software flow control as opposed to hardware flow
control.

To fix the problem, the set_termios callback function is set to the
DW specific function.  The logic to set UPSTAT_AUTOCTS is moved so
that any clock error will not affect setting the hardware flow
control.
Reviewed-by: default avatarScott Branden <scott.branden@broadcom.com>
Reviewed-by: default avatarRay Jui <ray.jui@broadcom.com>
Signed-off-by: default avatarJason Uy <jason.uy@broadcom.com>
Reviewed-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfc80387
...@@ -248,11 +248,11 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios, ...@@ -248,11 +248,11 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
if (!ret) if (!ret)
p->uartclk = rate; p->uartclk = rate;
out:
p->status &= ~UPSTAT_AUTOCTS; p->status &= ~UPSTAT_AUTOCTS;
if (termios->c_cflag & CRTSCTS) if (termios->c_cflag & CRTSCTS)
p->status |= UPSTAT_AUTOCTS; p->status |= UPSTAT_AUTOCTS;
out:
serial8250_do_set_termios(p, termios, old); serial8250_do_set_termios(p, termios, old);
} }
...@@ -326,13 +326,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data) ...@@ -326,13 +326,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
p->serial_in = dw8250_serial_in32; p->serial_in = dw8250_serial_in32;
data->uart_16550_compatible = true; data->uart_16550_compatible = true;
} }
p->set_termios = dw8250_set_termios;
} }
/* Platforms with iDMA */ /* Platforms with iDMA */
if (platform_get_resource_byname(to_platform_device(p->dev), if (platform_get_resource_byname(to_platform_device(p->dev),
IORESOURCE_MEM, "lpss_priv")) { IORESOURCE_MEM, "lpss_priv")) {
p->set_termios = dw8250_set_termios;
data->dma.rx_param = p->dev->parent; data->dma.rx_param = p->dev->parent;
data->dma.tx_param = p->dev->parent; data->dma.tx_param = p->dev->parent;
data->dma.fn = dw8250_idma_filter; data->dma.fn = dw8250_idma_filter;
...@@ -414,6 +412,7 @@ static int dw8250_probe(struct platform_device *pdev) ...@@ -414,6 +412,7 @@ static int dw8250_probe(struct platform_device *pdev)
p->serial_in = dw8250_serial_in; p->serial_in = dw8250_serial_in;
p->serial_out = dw8250_serial_out; p->serial_out = dw8250_serial_out;
p->set_ldisc = dw8250_set_ldisc; p->set_ldisc = dw8250_set_ldisc;
p->set_termios = dw8250_set_termios;
p->membase = devm_ioremap(dev, regs->start, resource_size(regs)); p->membase = devm_ioremap(dev, regs->start, resource_size(regs));
if (!p->membase) if (!p->membase)
......
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