aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/speakup/serialio.c
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-05-15 18:45:37 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-16 14:19:41 +0200
commit1c5973675cee92d5e8ad3a8a6e53a3e822bae271 (patch)
tree2ef5bad2d418ac675b709e600b8bf6975e565fda /drivers/staging/speakup/serialio.c
parentstaging: speakup: migrate apollo, ltlk, audptr, decext, dectlk and spkout (diff)
downloadlinux-dev-1c5973675cee92d5e8ad3a8a6e53a3e822bae271.tar.xz
linux-dev-1c5973675cee92d5e8ad3a8a6e53a3e822bae271.zip
staging: speakup: flush tty buffers and ensure hardware flow control
This patch fixes the issue where TTY-migrated synths would take a while to shut up after hitting numpad enter key. When calling synth_flush, even though XOFF character is sent as high priority, data buffered in TTY layer is still sent to the synth. This patch flushes that buffered data when synth_flush is called. It also tries to ensure that hardware flow control is enabled, by setting CRTSCTS using tty's termios. Reported-by: John Covici <covici@ccs.covici.com> Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/speakup/serialio.c')
-rw-r--r--drivers/staging/speakup/serialio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c
index 5f96b5ba7acb..969373201356 100644
--- a/drivers/staging/speakup/serialio.c
+++ b/drivers/staging/speakup/serialio.c
@@ -30,6 +30,7 @@ static void spk_serial_send_xchar(char ch);
static void spk_serial_tiocmset(unsigned int set, unsigned int clear);
static unsigned char spk_serial_in(void);
static unsigned char spk_serial_in_nowait(void);
+static void spk_serial_flush_buffer(void);
struct spk_io_ops spk_serial_io_ops = {
.synth_out = spk_serial_out,
@@ -37,6 +38,7 @@ struct spk_io_ops spk_serial_io_ops = {
.tiocmset = spk_serial_tiocmset,
.synth_in = spk_serial_in,
.synth_in_nowait = spk_serial_in_nowait,
+ .flush_buffer = spk_serial_flush_buffer,
};
EXPORT_SYMBOL_GPL(spk_serial_io_ops);
@@ -268,6 +270,11 @@ static unsigned char spk_serial_in_nowait(void)
return inb_p(speakup_info.port_tts + UART_RX);
}
+static void spk_serial_flush_buffer(void)
+{
+ /* TODO: flush the UART 16550 buffer */
+}
+
static int spk_serial_out(struct spk_synth *in_synth, const char ch)
{
if (in_synth->alive && spk_wait_for_xmitr(in_synth)) {