diff options
author | Okash Khawaja <okash.khawaja@gmail.com> | 2017-04-29 22:52:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-05-15 13:31:43 +0300 |
commit | ca693dcd5c02645063210e2352ff4909d9ddc7e9 (patch) | |
tree | 35d64c9b7b31a3babba861d56af0410281bd7ff3 /drivers/staging/speakup/speakup_dectlk.c | |
parent | 2a3e1437c1e3f5ef30d2bb533ca083d5da9c86f2 (diff) | |
download | linux-ca693dcd5c02645063210e2352ff4909d9ddc7e9.tar.xz |
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/speakup_dectlk.c')
-rw-r--r-- | drivers/staging/speakup/speakup_dectlk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c index 0cdbd5e9b36b..74acd527dc86 100644 --- a/drivers/staging/speakup/speakup_dectlk.c +++ b/drivers/staging/speakup/speakup_dectlk.c @@ -42,7 +42,7 @@ static inline int synth_full(void) static void do_catch_up(struct spk_synth *synth); static void synth_flush(struct spk_synth *synth); static void read_buff_add(u_char c); -static unsigned char get_index(void); +static unsigned char get_index(struct spk_synth *synth); static int in_escape; static int is_flushing; @@ -163,7 +163,7 @@ static int is_indnum(u_char *ch) static u_char lastind; -static unsigned char get_index(void) +static unsigned char get_index(struct spk_synth *synth) { u_char rv; |