Commit c54d4854 authored by Christoph Niedermaier's avatar Christoph Niedermaier Committed by Greg Kroah-Hartman
Browse files

serial: stm32: Add support for rs485 RX_DURING_TX output GPIO



If a RX_DURING_TX GPIO is defined by the DT property "rs485-rx-during-tx-gpios"
this patch switches this GPIO accordingly to the RS485 flag RX_DURING_TX in user
space. Controlled by this GPIO, now the hardware is responsible for connecting
or disconnecting RX during TX.

Signed-off-by: default avatarChristoph Niedermaier <cniedermaier@dh-electronics.com>
Link: https://lore.kernel.org/r/20221202104127.122761-4-cniedermaier@dh-electronics.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca530cfa
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -226,6 +226,10 @@ static int stm32_usart_config_rs485(struct uart_port *port, struct ktermios *ter

	stm32_usart_clr_bits(port, ofs->cr1, BIT(cfg->uart_enable_bit));

	if (port->rs485_rx_during_tx_gpio)
		gpiod_set_value_cansleep(port->rs485_rx_during_tx_gpio,
					 !!(rs485conf->flags & SER_RS485_RX_DURING_TX));
	else
		rs485conf->flags |= SER_RS485_RX_DURING_TX;

	if (rs485conf->flags & SER_RS485_ENABLED) {