• Okash Khawaja's avatar
    staging: speakup: make input functionality swappable · ca693dcd
    Okash Khawaja authored
    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: default avatarOkash Khawaja <okash.khawaja@gmail.com>
    Reviewed-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ca693dcd
speakup_dectlk.c 8.85 KB