summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorErwan Le Ray <erwan.leray@foss.st.com>2021-03-04 17:22:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 09:50:07 +0200
commita44d6acfa7dffdf37337d02bdbbfc981f357d69b (patch)
treed2f9e52817fd926cee6b1e9a3cc106be1f305f70 /drivers/tty
parentb5e8f0adaec1899ba91c46498adc13c96fcb3663 (diff)
serial: stm32: fix startup by enabling usart for reception
[ Upstream commit f4518a8a75f5be1a121b0c95ad9c6b1eb27d920e ] RX is configured, but usart is not enabled in startup function. Kernel documentation specifies that startup should enable the port for reception. Fix the startup by enabling usart for reception. Fixes: 84872dc448fe ("serial: stm32: add RX and TX FIFO flush") Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com> Link: https://lore.kernel.org/r/20210304162308.8984-3-erwan.leray@foss.st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/stm32-usart.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 1f7fe285bb1f..909a0d991ba1 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -633,6 +633,7 @@ static int stm32_usart_startup(struct uart_port *port)
{
struct stm32_port *stm32_port = to_stm32_port(port);
const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
+ const struct stm32_usart_config *cfg = &stm32_port->info->cfg;
const char *name = to_platform_device(port->dev)->name;
u32 val;
int ret;
@@ -657,7 +658,7 @@ static int stm32_usart_startup(struct uart_port *port)
}
/* RX FIFO enabling */
- val = stm32_port->cr1_irq | USART_CR1_RE;
+ val = stm32_port->cr1_irq | USART_CR1_RE | BIT(cfg->uart_enable_bit);
if (stm32_port->fifoen)
val |= USART_CR1_FIFOEN;
stm32_usart_set_bits(port, ofs->cr1, val);