]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tty: serial: fsl_lpuart: use UARTMODIR register bits for lpuart32 platform
authorSherry Sun <sherry.sun@nxp.com>
Fri, 14 Apr 2023 02:21:11 +0000 (10:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:31:01 +0000 (14:31 +0200)
[ Upstream commit d57d56e4dddfb5c92cd81abf8922055bf0fb85a4 ]

For lpuart32 platforms, UARTMODIR register is used instead of UARTMODEM.
So here should configure the corresponding UARTMODIR register bits to
avoid confusion.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20230414022111.20896-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: f5cb528d6441 ("tty: serial: fsl_lpuart: disable transmitter before changing RS485 related registers")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/fsl_lpuart.c

index b16ad6db1ef8e2e0cd4717037968c029a5550708..5135cdc0b664455b9d093df37e4777ebc829f16a 100644 (file)
@@ -1351,7 +1351,7 @@ static int lpuart32_config_rs485(struct uart_port *port,
                        struct lpuart_port, port);
 
        unsigned long modem = lpuart32_read(&sport->port, UARTMODIR)
-                               & ~(UARTMODEM_TXRTSPOL | UARTMODEM_TXRTSE);
+                               & ~(UARTMODIR_TXRTSPOL | UARTMODIR_TXRTSE);
        lpuart32_write(&sport->port, modem, UARTMODIR);
 
        /* clear unsupported configurations */
@@ -1361,7 +1361,7 @@ static int lpuart32_config_rs485(struct uart_port *port,
 
        if (rs485->flags & SER_RS485_ENABLED) {
                /* Enable auto RS-485 RTS mode */
-               modem |= UARTMODEM_TXRTSE;
+               modem |= UARTMODIR_TXRTSE;
 
                /*
                 * RTS needs to be logic HIGH either during transfer _or_ after
@@ -1383,9 +1383,9 @@ static int lpuart32_config_rs485(struct uart_port *port,
                 * Note: UART is assumed to be active high.
                 */
                if (rs485->flags & SER_RS485_RTS_ON_SEND)
-                       modem |= UARTMODEM_TXRTSPOL;
+                       modem |= UARTMODIR_TXRTSPOL;
                else if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
-                       modem &= ~UARTMODEM_TXRTSPOL;
+                       modem &= ~UARTMODIR_TXRTSPOL;
        }
 
        /* Store the new configuration */