Skip to content

Commit

Permalink
serial: stm32: add support for break control
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Erwan Le Ray authored and Greg Kroah-Hartman committed Sep 18, 2023
1 parent 46c4699 commit 30e9458
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/tty/serial/stm32-usart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,9 +1047,20 @@ static void stm32_usart_stop_rx(struct uart_port *port)
stm32_usart_clr_bits(port, ofs->cr3, stm32_port->cr3_irq);
}

/* Handle breaks - ignored by us */
static void stm32_usart_break_ctl(struct uart_port *port, int break_state)
{
struct stm32_port *stm32_port = to_stm32_port(port);
const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
unsigned long flags;

spin_lock_irqsave(&port->lock, flags);

if (break_state)
stm32_usart_set_bits(port, ofs->rqr, USART_RQR_SBKRQ);
else
stm32_usart_clr_bits(port, ofs->rqr, USART_RQR_SBKRQ);

spin_unlock_irqrestore(&port->lock, flags);
}

static int stm32_usart_startup(struct uart_port *port)
Expand Down

0 comments on commit 30e9458

Please sign in to comment.