From: Okash Khawaja <okash.khawaja@gmail.com>
To: kirk@reisers.ca, samuel.thibault@ens-lyon.org,
david.a.borowski@gmail.com, chris@the-brannons.com,
w.d.hubbs@gmail.com, gregkh@linuxfoundation.org
Cc: speakup@linux-speakup.org, devel@driverdev.osuosl.org
Subject: [PATCH 1/3] staging: speakup: add serial_out() method to spk_synth
Date: Sat, 19 Nov 2016 15:46:04 +0000 [thread overview]
Message-ID: <20161119154604.GA962@sanghar> (raw)
In-Reply-To: <20161119154328.GA946@sanghar>
This does two things:
1. add serial_out() method to spk_synth
2. replace calls to spk_serial_out() in spk_do_catch_up() and
spk_synth_flush() with calls to serial_out()
spk_do_catch_up() and spk_synth_flush() are the only functions through
which speakup_dummy calls into spk_serial_out(). Calls to spk_serial_out() in
other drivers can stay for now.
Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
---
drivers/staging/speakup/spk_types.h | 1 +
drivers/staging/speakup/synth.c | 8 ++++----
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/speakup/spk_types.h b/drivers/staging/speakup/spk_types.h
index e8ff5d7..56dc7df 100644
--- a/drivers/staging/speakup/spk_types.h
+++ b/drivers/staging/speakup/spk_types.h
@@ -168,6 +168,7 @@ struct spk_synth {
int *default_vol;
int (*probe)(struct spk_synth *synth);
void (*release)(void);
+ int (*serial_out)(const char ch);
const char *(*synth_immediate)(struct spk_synth *synth,
const char *buff);
void (*catch_up)(struct spk_synth *synth);
diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index 4f462c3..cef6591 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -118,7 +118,7 @@ void spk_do_catch_up(struct spk_synth *synth)
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (ch == '\n')
ch = synth->procspeech;
- if (!spk_serial_out(ch)) {
+ if (!synth->serial_out(ch)) {
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
@@ -128,7 +128,7 @@ void spk_do_catch_up(struct spk_synth *synth)
delay_time_val = delay_time->u.n.value;
full_time_val = full_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
- if (spk_serial_out(synth->procspeech))
+ if (synth->serial_out(synth->procspeech))
schedule_timeout(
msecs_to_jiffies(delay_time_val));
else
@@ -141,7 +141,7 @@ void spk_do_catch_up(struct spk_synth *synth)
synth_buffer_getc();
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
}
- spk_serial_out(synth->procspeech);
+ synth->serial_out(synth->procspeech);
}
EXPORT_SYMBOL_GPL(spk_do_catch_up);
@@ -164,7 +164,7 @@ EXPORT_SYMBOL_GPL(spk_synth_immediate);
void spk_synth_flush(struct spk_synth *synth)
{
- spk_serial_out(synth->clear);
+ synth->serial_out(synth->clear);
}
EXPORT_SYMBOL_GPL(spk_synth_flush);
--
2.10.2
next prev parent reply other threads:[~ UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[PATCH 0/3]: staging: speakup: refactor to make room for serial comms changes Okash Khawaja
` Okash Khawaja [this message]
` [PATCH 2/3] staging: speakup: add spk_serial_out2() Okash Khawaja
` [PATCH 3/3] staging: speakup: initialise serial_out() method in drivers Okash Khawaja
[not found] ` <20161119160809.GB5159@kroah.com>
` [PATCH 0/3]: staging: speakup: refactor to make room for serial comms changes Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161119154604.GA962@sanghar \
--to=okash.khawaja@gmail.com \
--cc=chris@the-brannons.com \
--cc=david.a.borowski@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kirk@reisers.ca \
--cc=samuel.thibault@ens-lyon.org \
--cc=speakup@linux-speakup.org \
--cc=w.d.hubbs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).