sc16is7xx: fix incorrect register bits macro
authorWills Wang <wills.wang@live.com>
Sun, 20 Dec 2015 04:55:23 +0000 (12:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 06:46:17 +0000 (22:46 -0800)
In datasheet, Modem Status Register MSR[4-7] reflect the modem pins
CTS/DSR/RI/CD signal state.

Signed-off-by: Wills Wang <wills.wang@live.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sc16is7xx.c

index 13f8d5f7027283ffa5716073d8c8408abf70f5b6..311e7bc07a2448242b072ec99d3730aa7cf878c8 100644 (file)
                                                  * or (IO6)
                                                  * - only on 75x/76x
                                                  */
-#define SC16IS7XX_MSR_CTS_BIT          (1 << 0) /* CTS */
-#define SC16IS7XX_MSR_DSR_BIT          (1 << 1) /* DSR (IO4)
+#define SC16IS7XX_MSR_CTS_BIT          (1 << 4) /* CTS */
+#define SC16IS7XX_MSR_DSR_BIT          (1 << 5) /* DSR (IO4)
                                                  * - only on 75x/76x
                                                  */
-#define SC16IS7XX_MSR_RI_BIT           (1 << 2) /* RI (IO7)
+#define SC16IS7XX_MSR_RI_BIT           (1 << 6) /* RI (IO7)
                                                  * - only on 75x/76x
                                                  */
-#define SC16IS7XX_MSR_CD_BIT           (1 << 3) /* CD (IO6)
+#define SC16IS7XX_MSR_CD_BIT           (1 << 7) /* CD (IO6)
                                                  * - only on 75x/76x
                                                  */
 #define SC16IS7XX_MSR_DELTA_MASK       0x0F     /* Any of the delta bits! */
 
 /* IOControl register bits (Only 750/760) */
 #define SC16IS7XX_IOCONTROL_LATCH_BIT  (1 << 0) /* Enable input latching */
-#define SC16IS7XX_IOCONTROL_GPIO_BIT   (1 << 1) /* Enable GPIO[7:4] */
+#define SC16IS7XX_IOCONTROL_MODEM_BIT  (1 << 1) /* Enable GPIO[7:4] as modem pins */
 #define SC16IS7XX_IOCONTROL_SRESET_BIT (1 << 3) /* Software Reset */
 
 /* EFCR register bits */
@@ -687,7 +687,7 @@ static void sc16is7xx_port_irq(struct sc16is7xx_port *s, int portno)
                case SC16IS7XX_IIR_CTSRTS_SRC:
                        msr = sc16is7xx_port_read(port, SC16IS7XX_MSR_REG);
                        uart_handle_cts_change(port,
-                                              !!(msr & SC16IS7XX_MSR_CTS_BIT));
+                                              !!(msr & SC16IS7XX_MSR_DCTS_BIT));
                        break;
                case SC16IS7XX_IIR_THRI_SRC:
                        sc16is7xx_handle_tx(port);