mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] speakup: flush serial input buffer
@ 2026-08-30 17:47 EPAXGAMINGtv
  0 siblings, 0 replies; only message in thread
From: EPAXGAMINGtv @ 2026-08-30 17:47 UTC (permalink / raw)
  To: speakup
  Cc: w.d.hubbs, chris, kirk, samuel.thibault, linux-kernel,
	EPAXGAMINGtv, EPAXGAMINGtv

Implement the serial buffer flush operation for the Speakup serial
I/O backend by draining pending characters from the UART receive
buffer.

Signed-off-by: EPAXGAMINGtv <sureyjan@gmail.com>
Signed-off-by: EPAXGAMINGtv <dev_epaxgaming@icloud.com>
---
 drivers/accessibility/speakup/serialio.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/accessibility/speakup/serialio.c b/drivers/accessibility/speakup/serialio.c
index 3418ea31d..921303505 100644
--- a/drivers/accessibility/speakup/serialio.c
+++ b/drivers/accessibility/speakup/serialio.c
@@ -277,7 +277,16 @@ static unsigned char spk_serial_in_nowait(struct spk_synth *in_synth)
 
 static void spk_serial_flush_buffer(struct spk_synth *in_synth)
 {
-	/* TODO: flush the UART 16550 buffer */
+	
+	unsigned long flags;
+
+	spin_lock_irqsave(&speakup_info.spinlock,flags);
+
+	while (inb_p(speakup_info.port_tts + UART_LSR) & UART_LSR_DR)
+		inb_p(speakup_info.port_tts + UART_RX);
+
+  	spin_unlock_irqrestore(&speakup_info.spinlock,flags);
+
 }
 
 static int spk_serial_out(struct spk_synth *in_synth, const char ch)

base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
-- 
2.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-30 17:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-30 17:47 [PATCH] speakup: flush serial input buffer EPAXGAMINGtv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®