serial:8250_dw: do not alter CTS and DCTS since AFE is enabled
authorQipeng Zha <qipeng.zha@intel.com>
Fri, 7 Aug 2015 11:14:47 +0000 (19:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Aug 2015 00:15:13 +0000 (17:15 -0700)
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 <huiquan.zhong@intel.com>
Signed-off-by: Qipeng Zha <qipeng.zha@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_dw.c

index 8d04ea7..06324f1 100644 (file)
@@ -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 */