Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: stm32: add support for break control

Add support for break control to the stm32 serial driver.

Signed-off-by: Erwan Le Ray <erwan.leray@foss.st.com>
Signed-off-by: Valentin Caron <valentin.caron@foss.st.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230906151547.840302-1-valentin.caron@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Erwan Le Ray and committed by
Greg Kroah-Hartman
30e94586 46c4699d

+12 -1
+12 -1
drivers/tty/serial/stm32-usart.c
··· 1047 1047 stm32_usart_clr_bits(port, ofs->cr3, stm32_port->cr3_irq); 1048 1048 } 1049 1049 1050 - /* Handle breaks - ignored by us */ 1051 1050 static void stm32_usart_break_ctl(struct uart_port *port, int break_state) 1052 1051 { 1052 + struct stm32_port *stm32_port = to_stm32_port(port); 1053 + const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; 1054 + unsigned long flags; 1055 + 1056 + spin_lock_irqsave(&port->lock, flags); 1057 + 1058 + if (break_state) 1059 + stm32_usart_set_bits(port, ofs->rqr, USART_RQR_SBKRQ); 1060 + else 1061 + stm32_usart_clr_bits(port, ofs->rqr, USART_RQR_SBKRQ); 1062 + 1063 + spin_unlock_irqrestore(&port->lock, flags); 1053 1064 } 1054 1065 1055 1066 static int stm32_usart_startup(struct uart_port *port)