linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: stm32: add support for break control
@ 2023-09-06 15:15 Valentin Caron
  2023-09-11  7:36 ` Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Valentin Caron @ 2023-09-06 15:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby
  Cc: Erwan Le Ray, Alexandre Torgue, linux-kernel, linux-serial,
	linux-stm32, linux-arm-kernel, Valentin Caron

From: Erwan Le Ray <erwan.leray@foss.st.com>

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>
---
 drivers/tty/serial/stm32-usart.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index 5e9cf0c48813..d03ec69d79fc 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -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)
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] serial: stm32: add support for break control
  2023-09-06 15:15 [PATCH] serial: stm32: add support for break control Valentin Caron
@ 2023-09-11  7:36 ` Jiri Slaby
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2023-09-11  7:36 UTC (permalink / raw)
  To: Valentin Caron, Greg Kroah-Hartman
  Cc: Erwan Le Ray, Alexandre Torgue, linux-kernel, linux-serial,
	linux-stm32, linux-arm-kernel

On 06. 09. 23, 17:15, Valentin Caron wrote:
> From: Erwan Le Ray <erwan.leray@foss.st.com>
> 
> 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>

LGTM

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

-- 
js
suse labs


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-11  7:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 15:15 [PATCH] serial: stm32: add support for break control Valentin Caron
2023-09-11  7:36 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).