Merge 4.17-rc3 into tty-next
We want the tty and serial driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -169,7 +169,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match)
|
||||
*/
|
||||
int __init setup_earlycon(char *buf)
|
||||
{
|
||||
const struct earlycon_id *match;
|
||||
const struct earlycon_id **p_match;
|
||||
|
||||
if (!buf || !buf[0])
|
||||
return -EINVAL;
|
||||
@@ -177,7 +177,9 @@ int __init setup_earlycon(char *buf)
|
||||
if (early_con.flags & CON_ENABLED)
|
||||
return -EALREADY;
|
||||
|
||||
for (match = __earlycon_table; match < __earlycon_table_end; match++) {
|
||||
for (p_match = __earlycon_table; p_match < __earlycon_table_end;
|
||||
p_match++) {
|
||||
const struct earlycon_id *match = *p_match;
|
||||
size_t len = strlen(match->name);
|
||||
|
||||
if (strncmp(buf, match->name, len))
|
||||
|
@@ -316,7 +316,7 @@ static u32 imx_uart_readl(struct imx_port *sport, u32 offset)
|
||||
* differ from the value that was last written. As it only
|
||||
* clears after being set, reread conditionally.
|
||||
*/
|
||||
if (sport->ucr2 & UCR2_SRST)
|
||||
if (!(sport->ucr2 & UCR2_SRST))
|
||||
sport->ucr2 = readl(sport->port.membase + offset);
|
||||
return sport->ucr2;
|
||||
break;
|
||||
@@ -1833,6 +1833,11 @@ static int imx_uart_rs485_config(struct uart_port *port,
|
||||
rs485conf->flags &= ~SER_RS485_ENABLED;
|
||||
|
||||
if (rs485conf->flags & SER_RS485_ENABLED) {
|
||||
/* Enable receiver if low-active RTS signal is requested */
|
||||
if (sport->have_rtscts && !sport->have_rtsgpio &&
|
||||
!(rs485conf->flags & SER_RS485_RTS_ON_SEND))
|
||||
rs485conf->flags |= SER_RS485_RX_DURING_TX;
|
||||
|
||||
/* disable transmitter */
|
||||
ucr2 = imx_uart_readl(sport, UCR2);
|
||||
if (rs485conf->flags & SER_RS485_RTS_AFTER_SEND)
|
||||
@@ -2265,6 +2270,18 @@ static int imx_uart_probe(struct platform_device *pdev)
|
||||
(!sport->have_rtscts && !sport->have_rtsgpio))
|
||||
dev_err(&pdev->dev, "no RTS control, disabling rs485\n");
|
||||
|
||||
/*
|
||||
* If using the i.MX UART RTS/CTS control then the RTS (CTS_B)
|
||||
* signal cannot be set low during transmission in case the
|
||||
* receiver is off (limitation of the i.MX UART IP).
|
||||
*/
|
||||
if (sport->port.rs485.flags & SER_RS485_ENABLED &&
|
||||
sport->have_rtscts && !sport->have_rtsgpio &&
|
||||
(!(sport->port.rs485.flags & SER_RS485_RTS_ON_SEND) &&
|
||||
!(sport->port.rs485.flags & SER_RS485_RX_DURING_TX)))
|
||||
dev_err(&pdev->dev,
|
||||
"low-active RTS not possible when receiver is off, enabling receiver\n");
|
||||
|
||||
imx_uart_rs485_config(&sport->port, &sport->port.rs485);
|
||||
|
||||
/* Disable interrupts before requesting them */
|
||||
|
@@ -511,7 +511,6 @@ static void mvebu_uart_set_termios(struct uart_port *port,
|
||||
termios->c_iflag |= old->c_iflag & ~(INPCK | IGNPAR);
|
||||
termios->c_cflag &= CREAD | CBAUD;
|
||||
termios->c_cflag |= old->c_cflag & ~(CREAD | CBAUD);
|
||||
termios->c_lflag = old->c_lflag;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&port->lock, flags);
|
||||
|
@@ -1022,6 +1022,7 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
|
||||
struct qcom_geni_serial_port *port;
|
||||
struct uart_port *uport;
|
||||
struct resource *res;
|
||||
int irq;
|
||||
|
||||
if (pdev->dev.of_node)
|
||||
line = of_alias_get_id(pdev->dev.of_node, "serial");
|
||||
@@ -1061,11 +1062,12 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
|
||||
port->rx_fifo_depth = DEF_FIFO_DEPTH_WORDS;
|
||||
port->tx_fifo_width = DEF_FIFO_WIDTH_BITS;
|
||||
|
||||
uport->irq = platform_get_irq(pdev, 0);
|
||||
if (uport->irq < 0) {
|
||||
dev_err(&pdev->dev, "Failed to get IRQ %d\n", uport->irq);
|
||||
return uport->irq;
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0) {
|
||||
dev_err(&pdev->dev, "Failed to get IRQ %d\n", irq);
|
||||
return irq;
|
||||
}
|
||||
uport->irq = irq;
|
||||
|
||||
uport->private_data = &qcom_geni_console_driver;
|
||||
platform_set_drvdata(pdev, port);
|
||||
|
@@ -1142,7 +1142,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
|
||||
/* only set baud if specified on command line - otherwise
|
||||
* assume it has been initialized by a boot loader.
|
||||
*/
|
||||
if (device->baud) {
|
||||
if (port->uartclk && device->baud) {
|
||||
u32 cd = 0, bdiv = 0;
|
||||
u32 mr;
|
||||
int div8;
|
||||
|
Reference in New Issue
Block a user