950-0791-serial-sc16is7xx-Read-modem-line-state-at-startup.patch 990 B

12345678910111213141516171819202122232425262728
  1. From 52039b6ffb6e78c2f77319b167dceab9aa51d13f Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <[email protected]>
  3. Date: Tue, 13 Jun 2023 16:12:54 +0100
  4. Subject: [PATCH] serial: sc16is7xx: Read modem line state at startup
  5. This patch sets the driver modem line state to the actual line state
  6. at driver startup.
  7. See: https://github.com/raspberrypi/linux/issues/5501
  8. Signed-off-by: Earl Schmidt <[email protected]>
  9. Signed-off-by: Phil Elwell <[email protected]>
  10. ---
  11. drivers/tty/serial/sc16is7xx.c | 3 +++
  12. 1 file changed, 3 insertions(+)
  13. --- a/drivers/tty/serial/sc16is7xx.c
  14. +++ b/drivers/tty/serial/sc16is7xx.c
  15. @@ -1222,6 +1222,9 @@ static int sc16is7xx_startup(struct uart
  16. SC16IS7XX_IER_MSI_BIT;
  17. sc16is7xx_port_write(port, SC16IS7XX_IER_REG, val);
  18. + /* Initialize the Modem Control signals to current status */
  19. + one->old_mctrl = sc16is7xx_get_hwmctrl(port);
  20. +
  21. /* Enable modem status polling */
  22. spin_lock_irqsave(&port->lock, flags);
  23. sc16is7xx_enable_ms(port);