summaryrefslogtreecommitdiff
path: root/drivers/staging/speakup/spk_priv.h
diff options
context:
space:
mode:
authorOkash Khawaja <okash.khawaja@gmail.com>2017-04-29 20:52:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-15 12:31:43 +0200
commitca693dcd5c02645063210e2352ff4909d9ddc7e9 (patch)
tree35d64c9b7b31a3babba861d56af0410281bd7ff3 /drivers/staging/speakup/spk_priv.h
parent2a3e1437c1e3f5ef30d2bb533ca083d5da9c86f2 (diff)
staging: speakup: make input functionality swappable
This moves functions which take input from external synth, into struct spk_io_ops. The calling code then uses serial implementation of those methods through spk_io_ops. That way we can add a parallel TTY-based implementation and simply replace serial with TTY. That is what the next patch in this series does. speakup_decext.c has get_last_char function which reads the most recent available character from the synth. This patch changes that by defining read_buff_add callback method of spk_syth and letting that update the last_char global character read from the synth. read_buff_add is called from ISR, so there is a possibility for last_char to be stale. Therefore it is marked as volatile. It also pulls a repeated get_index implementation into synth.c, to be used as a utility function. 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/spk_priv.h')
-rw-r--r--drivers/staging/speakup/spk_priv.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h
index 995f586bddcd..6895373902de 100644
--- a/drivers/staging/speakup/spk_priv.h
+++ b/drivers/staging/speakup/spk_priv.h
@@ -43,8 +43,6 @@
const struct old_serial_port *spk_serial_init(int index);
void spk_stop_serial_interrupt(void);
int spk_wait_for_xmitr(struct spk_synth *in_synth);
-unsigned char spk_serial_in(void);
-unsigned char spk_serial_in_nowait(void);
void spk_serial_release(void);
void synth_buffer_skip_nonlatin1(void);
@@ -61,6 +59,7 @@ int spk_serial_synth_probe(struct spk_synth *synth);
const char *spk_serial_synth_immediate(struct spk_synth *synth, const char *buff);
void spk_do_catch_up(struct spk_synth *synth);
void spk_synth_flush(struct spk_synth *synth);
+unsigned char spk_synth_get_index(struct spk_synth *synth);
int spk_synth_is_alive_nop(struct spk_synth *synth);
int spk_synth_is_alive_restart(struct spk_synth *synth);
__printf(1, 2)