summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/fsl_lpuart.c
diff options
context:
space:
mode:
authorSherry Sun <sherry.sun@nxp.com>2022-11-25 18:19:53 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-19 15:05:33 +0100
commit4029dfc034febb54f6dd8ea83568accc943bc088 (patch)
tree6f72bbf00d9751c8f2c7f39bd9176d4998577fb9 /drivers/tty/serial/fsl_lpuart.c
parent1d4bd0e4ae4ba95892bef919a8d4d3f08f122d7e (diff)
tty: serial: fsl_lpuart: clear LPUART Status Register in lpuart32_shutdown()
The LPUART Status Register needs to be cleared when closing the uart port to get a clean environment when reopening the uart. Fixes: 380c966c093e ("tty: serial: fsl_lpuart: add 32-bit register interface support") Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20221125101953.18753-4-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/fsl_lpuart.c')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 88697ddcd8c4..8918e08bb19e 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1799,6 +1799,10 @@ static void lpuart32_shutdown(struct uart_port *port)
spin_lock_irqsave(&port->lock, flags);
+ /* clear status */
+ temp = lpuart32_read(&sport->port, UARTSTAT);
+ lpuart32_write(&sport->port, temp, UARTSTAT);
+
/* disable Rx/Tx DMA */
temp = lpuart32_read(port, UARTBAUD);
temp &= ~(UARTBAUD_TDMAE | UARTBAUD_RDMAE);