serial: omap: fix software flow control
authorVikram Pandita <vikram.pandita@ti.com>
Thu, 6 Sep 2012 12:45:37 +0000 (15:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Sep 2012 16:17:02 +0000 (09:17 -0700)
Software flow control register bits were not defined correctly.

Also clarify the IXON and IXOFF logic to reflect what userspace wants.

Cc: stable@vger.kernel.org
Tested-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/plat-omap/include/plat/omap-serial.h
drivers/tty/serial/omap-serial.c

index 90d2d74d1682aafa280bb628885fa212b62b4e14..a79ed8b17d9b0355fed5aef2cc301cc21a08bfa4 100644 (file)
 #define OMAP_UART_WER_MOD_WKUP 0X7F
 
 /* Enable XON/XOFF flow control on output */
-#define OMAP_UART_SW_TX                0x04
+#define OMAP_UART_SW_TX                0x8
 
 /* Enable XON/XOFF flow control on input */
-#define OMAP_UART_SW_RX                0x04
+#define OMAP_UART_SW_RX                0x2
 
 #define OMAP_UART_SYSC_RESET   0X07
 #define OMAP_UART_TCR_TRIG     0X0F
index 6a58f4f64f8183850809a92e080749973481962a..1ba1f439a5b0abded724fa401d5eb29469634775 100644 (file)
@@ -617,19 +617,19 @@ serial_omap_configure_xonxoff
 
        /*
         * IXON Flag:
-        * Enable XON/XOFF flow control on output.
-        * Transmit XON1, XOFF1
+        * Flow control for OMAP.TX
+        * OMAP.RX should listen for XON/XOFF
         */
        if (termios->c_iflag & IXON)
-               up->efr |= OMAP_UART_SW_TX;
+               up->efr |= OMAP_UART_SW_RX;
 
        /*
         * IXOFF Flag:
-        * Enable XON/XOFF flow control on input.
-        * Receiver compares XON1, XOFF1.
+        * Flow control for OMAP.RX
+        * OMAP.TX should send XON/XOFF
         */
        if (termios->c_iflag & IXOFF)
-               up->efr |= OMAP_UART_SW_RX;
+               up->efr |= OMAP_UART_SW_TX;
 
        serial_out(up, UART_EFR, up->efr | UART_EFR_ECB);
        serial_out(up, UART_LCR, UART_LCR_CONF_MODE_A);