From 1e441594e509c35a222e397d224de17cee103740 Mon Sep 17 00:00:00 2001 From: Okash Khawaja Date: Tue, 14 Mar 2017 13:41:53 +0000 Subject: staging: speakup: add spk_io_ops struct to spk_synth This patch adds spk_io_ops struct which contain those methods whose job is to communicate with synth device. Currently, all comms with external synth device use raw serial i/o. The idea is to group all methods which do the actual communication with external device into this new struct. Then migrating a serial-based synth over to an alternative to raw serial i/o will mean swapping serial spk_io_ops instance with the io_ops instance of the new method, making the migration simpler. At the moment, this struct only contains one method, synth_out but more will be added in future when migrating synths which require input functionality. Also at the moment, synth_out method has one implementation which uses serial i/o. Plan is to add an alternative. Signed-off-by: Okash Khawaja Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman --- drivers/staging/speakup/spk_types.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/staging/speakup/spk_types.h') diff --git a/drivers/staging/speakup/spk_types.h b/drivers/staging/speakup/spk_types.h index 9541b9e65840..a446064b6c91 100644 --- a/drivers/staging/speakup/spk_types.h +++ b/drivers/staging/speakup/spk_types.h @@ -146,6 +146,12 @@ struct synth_indexing { unsigned char currindex; }; +struct spk_synth; + +struct spk_io_ops { + int (*synth_out)(struct spk_synth *synth, const char ch); +}; + struct spk_synth { const char *name; const char *version; @@ -164,6 +170,7 @@ struct spk_synth { struct var_t *vars; int *default_pitch; int *default_vol; + struct spk_io_ops *io_ops; int (*probe)(struct spk_synth *synth); void (*release)(void); const char *(*synth_immediate)(struct spk_synth *synth, -- cgit v1.2.3-55-g7522