Commit 1941ab1d authored by Samuel Thibault's avatar Samuel Thibault Committed by Greg Kroah-Hartman
Browse files

speakup: add the missing synth parameter to all io functions



So that we can avoid the spk_ttyio_synth global variable in the next
commit.

Signed-off-by: default avatarSamuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20210126222147.3848175-2-samuel.thibault@ens-lyon.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0fc99422
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -27,11 +27,11 @@ static const struct old_serial_port *serstate;
static int timeouts;

static int spk_serial_out(struct spk_synth *in_synth, const char ch);
static void spk_serial_send_xchar(char ch);
static void spk_serial_tiocmset(unsigned int set, unsigned int clear);
static unsigned char spk_serial_in(void);
static unsigned char spk_serial_in_nowait(void);
static void spk_serial_flush_buffer(void);
static void spk_serial_send_xchar(struct spk_synth *in_synth, char ch);
static void spk_serial_tiocmset(struct spk_synth *in_synth, unsigned int set, unsigned int clear);
static unsigned char spk_serial_in(struct spk_synth *in_synth);
static unsigned char spk_serial_in_nowait(struct spk_synth *in_synth);
static void spk_serial_flush_buffer(struct spk_synth *in_synth);
static int spk_serial_wait_for_xmitr(struct spk_synth *in_synth);

struct spk_io_ops spk_serial_io_ops = {
@@ -150,7 +150,7 @@ static void start_serial_interrupt(int irq)
	outb(1, speakup_info.port_tts + UART_FCR);	/* Turn FIFO On */
}

static void spk_serial_send_xchar(char ch)
static void spk_serial_send_xchar(struct spk_synth *synth, char ch)
{
	int timeout = SPK_XMITR_TIMEOUT;

@@ -162,7 +162,7 @@ static void spk_serial_send_xchar(char ch)
	outb(ch, speakup_info.port_tts);
}

static void spk_serial_tiocmset(unsigned int set, unsigned int clear)
static void spk_serial_tiocmset(struct spk_synth *in_synth, unsigned int set, unsigned int clear)
{
	int old = inb(speakup_info.port_tts + UART_MCR);

@@ -251,7 +251,7 @@ static int spk_serial_wait_for_xmitr(struct spk_synth *in_synth)
	return 1;
}

static unsigned char spk_serial_in(void)
static unsigned char spk_serial_in(struct spk_synth *in_synth)
{
	int tmout = SPK_SERIAL_TIMEOUT;

@@ -265,7 +265,7 @@ static unsigned char spk_serial_in(void)
	return inb_p(speakup_info.port_tts + UART_RX);
}

static unsigned char spk_serial_in_nowait(void)
static unsigned char spk_serial_in_nowait(struct spk_synth *in_synth)
{
	unsigned char lsr;

@@ -275,7 +275,7 @@ static unsigned char spk_serial_in_nowait(void)
	return inb_p(speakup_info.port_tts + UART_RX);
}

static void spk_serial_flush_buffer(void)
static void spk_serial_flush_buffer(struct spk_synth *in_synth)
{
	/* TODO: flush the UART 16550 buffer */
}
@@ -307,7 +307,7 @@ const char *spk_serial_synth_immediate(struct spk_synth *synth,
}
EXPORT_SYMBOL_GPL(spk_serial_synth_immediate);

void spk_serial_release(void)
void spk_serial_release(struct spk_synth *synth)
{
	spk_stop_serial_interrupt();
	if (speakup_info.port_tts == 0)
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
#define PROCSPEECH '\r'

static int synth_probe(struct spk_synth *synth);
static void accent_release(void);
static void accent_release(struct spk_synth *synth);
static const char *synth_immediate(struct spk_synth *synth, const char *buf);
static void do_catch_up(struct spk_synth *synth);
static void synth_flush(struct spk_synth *synth);
@@ -294,7 +294,7 @@ static int synth_probe(struct spk_synth *synth)
	return 0;
}

static void accent_release(void)
static void accent_release(struct spk_synth *synth)
{
	spk_stop_serial_interrupt();
	if (speakup_info.port_tts)
+2 −2
Original line number Diff line number Diff line
@@ -163,8 +163,8 @@ static void do_catch_up(struct spk_synth *synth)
		full_time_val = full_time->u.n.value;
		spin_unlock_irqrestore(&speakup_info.spinlock, flags);
		if (!synth->io_ops->synth_out(synth, ch)) {
			synth->io_ops->tiocmset(0, UART_MCR_RTS);
			synth->io_ops->tiocmset(UART_MCR_RTS, 0);
			synth->io_ops->tiocmset(synth, 0, UART_MCR_RTS);
			synth->io_ops->tiocmset(synth, UART_MCR_RTS, 0);
			schedule_timeout(msecs_to_jiffies(full_time_val));
			continue;
		}
+4 −4
Original line number Diff line number Diff line
@@ -119,8 +119,8 @@ static struct spk_synth synth_audptr = {

static void synth_flush(struct spk_synth *synth)
{
	synth->io_ops->flush_buffer();
	synth->io_ops->send_xchar(SYNTH_CLEAR);
	synth->io_ops->flush_buffer(synth);
	synth->io_ops->send_xchar(synth, SYNTH_CLEAR);
	synth->io_ops->synth_out(synth, PROCSPEECH);
}

@@ -130,11 +130,11 @@ static void synth_version(struct spk_synth *synth)
	char synth_id[40] = "";

	synth->synth_immediate(synth, "\x05[Q]");
	synth_id[test] = synth->io_ops->synth_in();
	synth_id[test] = synth->io_ops->synth_in(synth);
	if (synth_id[test] == 'A') {
		do {
			/* read version string from synth */
			synth_id[++test] = synth->io_ops->synth_in();
			synth_id[++test] = synth->io_ops->synth_in(synth);
		} while (synth_id[test] != '\n' && test < 32);
		synth_id[++test] = 0x00;
	}
+1 −1
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ static void do_catch_up(struct spk_synth *synth)
static void synth_flush(struct spk_synth *synth)
{
	in_escape = 0;
	synth->io_ops->flush_buffer();
	synth->io_ops->flush_buffer(synth);
	synth->synth_immediate(synth, "\033P;10z\033\\");
}

Loading