Skip to content

Commit 927728a

Browse files
jason77-wanggregkh
authored andcommitted
serial: sc16is7xx: Clear RS485 bits in the shutdown
We tested RS485 function on an EVB which has SC16IS752, after finishing the test, we started the RS232 function test, but found the RTS is still working in the RS485 mode. That is because both startup and shutdown call port_update() to set the EFCR_REG, this will not clear the RS485 bits once the bits are set in the reconf_rs485(). To fix it, clear the RS485 bits in shutdown. Cc: <stable@vger.kernel.org> Signed-off-by: Hui Wang <hui.wang@canonical.com> Link: https://lore.kernel.org/r/20220308110042.108451-1-hui.wang@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f25fbd5 commit 927728a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,10 +1238,12 @@ static void sc16is7xx_shutdown(struct uart_port *port)
12381238

12391239
/* Disable all interrupts */
12401240
sc16is7xx_port_write(port, SC16IS7XX_IER_REG, 0);
1241-
/* Disable TX/RX */
1241+
/* Disable TX/RX, clear auto RS485 and RTS invert */
12421242
sc16is7xx_port_update(port, SC16IS7XX_EFCR_REG,
12431243
SC16IS7XX_EFCR_RXDISABLE_BIT |
1244-
SC16IS7XX_EFCR_TXDISABLE_BIT,
1244+
SC16IS7XX_EFCR_TXDISABLE_BIT |
1245+
SC16IS7XX_EFCR_AUTO_RS485_BIT |
1246+
SC16IS7XX_EFCR_RTS_INVERT_BIT,
12451247
SC16IS7XX_EFCR_RXDISABLE_BIT |
12461248
SC16IS7XX_EFCR_TXDISABLE_BIT);
12471249

0 commit comments

Comments
 (0)