Skip to content

Commit

Permalink
serial: stm32: Fill in rs485_supported
Browse files Browse the repository at this point in the history
Add information on supported serial_rs485 features.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220606100433.13793-22-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ilpo Järvinen authored and Greg Kroah-Hartman committed Jun 10, 2022
1 parent 267913e commit aeae8f2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/tty/serial/stm32-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1375,6 +1375,13 @@ static void stm32_usart_deinit_port(struct stm32_port *stm32port)
clk_disable_unprepare(stm32port->clk);
}

static const struct serial_rs485 stm32_rs485_supported = {
.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND | SER_RS485_RTS_AFTER_SEND |
SER_RS485_RX_DURING_TX,
.delay_rts_before_send = 1,
.delay_rts_after_send = 1,
};

static int stm32_usart_init_port(struct stm32_port *stm32port,
struct platform_device *pdev)
{
Expand All @@ -1394,6 +1401,7 @@ static int stm32_usart_init_port(struct stm32_port *stm32port,
port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_STM32_CONSOLE);
port->irq = irq;
port->rs485_config = stm32_usart_config_rs485;
port->rs485_supported = &stm32_rs485_supported;

ret = stm32_usart_init_rs485(port, pdev);
if (ret)
Expand Down

0 comments on commit aeae8f2

Please sign in to comment.