serial: sc16is7xx: Read modem line state at startup
authorPhil Elwell <phil@raspberrypi.com>
Tue, 13 Jun 2023 15:12:54 +0000 (16:12 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:36 +0000 (11:33 +0000)
This patch sets the driver modem line state to the actual line state
at driver startup.

See: https://github.com/raspberrypi/linux/issues/5501

Signed-off-by: Earl Schmidt <schmidt.earl.f@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
drivers/tty/serial/sc16is7xx.c

index 7690c8536cc06e4febabc4ce88d0635b3f018a3a..eea6622122afeff394315e697c460c4b0b06da44 100644 (file)
@@ -1193,6 +1193,9 @@ static int sc16is7xx_startup(struct uart_port *port)
              SC16IS7XX_IER_MSI_BIT;
        sc16is7xx_port_write(port, SC16IS7XX_IER_REG, val);
 
+       /* Initialize the Modem Control signals to current status */
+       one->old_mctrl = sc16is7xx_get_hwmctrl(port);
+
        /* Enable modem status polling */
        uart_port_lock_irqsave(port, &flags);
        sc16is7xx_enable_ms(port);