From cbba3e6f7a1eb642cccf520f690d4a58b97a9588 Mon Sep 17 00:00:00 2001 From: Qipeng Zha Date: Fri, 7 Aug 2015 19:14:47 +0800 Subject: [PATCH] serial:8250_dw: do not alter CTS and DCTS since AFE is enabled Since the serial core is informed that this device is doing automatic flow control, it is not necessary to alter CTS and DCTS of the MSR as the core no longer attempts stop the port in uart_handle_cts_change(). Signed-off-by: Huiquan Zhong Signed-off-by: Qipeng Zha Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_dw.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 8d04ea781de4..06324f17a0cb 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -56,7 +56,6 @@ struct dw8250_data { u8 usr_reg; - int last_mcr; int line; int msr_mask_on; int msr_mask_off; @@ -76,12 +75,6 @@ static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value) { struct dw8250_data *d = p->private_data; - /* If reading MSR, report CTS asserted when auto-CTS/RTS enabled */ - if (offset == UART_MSR && d->last_mcr & UART_MCR_AFE) { - value |= UART_MSR_CTS; - value &= ~UART_MSR_DCTS; - } - /* Override any modem control signals if needed */ if (offset == UART_MSR) { value |= d->msr_mask_on; @@ -101,11 +94,6 @@ static void dw8250_force_idle(struct uart_port *p) static void dw8250_serial_out(struct uart_port *p, int offset, int value) { - struct dw8250_data *d = p->private_data; - - if (offset == UART_MCR) - d->last_mcr = value; - writeb(value, p->membase + (offset << p->regshift)); /* Make sure LCR write wasn't ignored */ @@ -144,11 +132,6 @@ static unsigned int dw8250_serial_inq(struct uart_port *p, int offset) static void dw8250_serial_outq(struct uart_port *p, int offset, int value) { - struct dw8250_data *d = p->private_data; - - if (offset == UART_MCR) - d->last_mcr = value; - value &= 0xff; __raw_writeq(value, p->membase + (offset << p->regshift)); /* Read back to ensure register write ordering. */ @@ -175,11 +158,6 @@ static void dw8250_serial_outq(struct uart_port *p, int offset, int value) static void dw8250_serial_out32(struct uart_port *p, int offset, int value) { - struct dw8250_data *d = p->private_data; - - if (offset == UART_MCR) - d->last_mcr = value; - writel(value, p->membase + (offset << p->regshift)); /* Make sure LCR write wasn't ignored */ -- 2.39.5