^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0+
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * originally written by: Kirk Reiser <kirk@braille.uwo.ca>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * this version considerably modified by David Borowski, david575@rogers.com
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * Copyright (C) 1998-99 Kirk Reiser.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (C) 2003 David Borowski.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * specificly written as a driver for the speakup screenreview
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * s not a general device driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/jiffies.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/timer.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/kthread.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include "spk_priv.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #include "speakup.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define DRV_VERSION "2.14"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define SYNTH_CLEAR 0x03
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define PROCSPEECH 0x0b
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) static volatile unsigned char last_char;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static void read_buff_add(u_char ch)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) last_char = ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static inline bool synth_full(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) return last_char == 0x13;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static void do_catch_up(struct spk_synth *synth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) static void synth_flush(struct spk_synth *synth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) static int in_escape;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) static struct var_t vars[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) { CAPS_START, .u.s = {"[:dv ap 222]" } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) { CAPS_STOP, .u.s = {"[:dv ap 100]" } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) { RATE, .u.n = {"[:ra %d]", 7, 0, 9, 150, 25, NULL } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) { PITCH, .u.n = {"[:dv ap %d]", 100, 0, 100, 0, 0, NULL } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) { VOL, .u.n = {"[:dv gv %d]", 13, 0, 16, 0, 5, NULL } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) { PUNCT, .u.n = {"[:pu %c]", 0, 0, 2, 0, 0, "nsa" } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) { VOICE, .u.n = {"[:n%c]", 0, 0, 9, 0, 0, "phfdburwkv" } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) V_LAST_VAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * These attributes will appear in /sys/accessibility/speakup/decext.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) static struct kobj_attribute caps_start_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) __ATTR(caps_start, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) static struct kobj_attribute caps_stop_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) __ATTR(caps_stop, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) static struct kobj_attribute pitch_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) __ATTR(pitch, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) static struct kobj_attribute inflection_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) __ATTR(inflection, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) static struct kobj_attribute punct_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __ATTR(punct, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) static struct kobj_attribute rate_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) __ATTR(rate, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) static struct kobj_attribute voice_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __ATTR(voice, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) static struct kobj_attribute vol_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) __ATTR(vol, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) static struct kobj_attribute delay_time_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) __ATTR(delay_time, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) static struct kobj_attribute direct_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) __ATTR(direct, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) static struct kobj_attribute full_time_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) __ATTR(full_time, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) static struct kobj_attribute jiffy_delta_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) __ATTR(jiffy_delta, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) static struct kobj_attribute trigger_time_attribute =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) __ATTR(trigger_time, 0644, spk_var_show, spk_var_store);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * Create a group of attributes so that we can create and destroy them all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * at once.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) static struct attribute *synth_attrs[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) &caps_start_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) &caps_stop_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) &pitch_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) &inflection_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) &punct_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) &rate_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) &voice_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) &vol_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) &delay_time_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) &direct_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) &full_time_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) &jiffy_delta_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) &trigger_time_attribute.attr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) NULL, /* need to NULL terminate the list of attributes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) static struct spk_synth synth_decext = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) .name = "decext",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) .version = DRV_VERSION,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) .long_name = "Dectalk External",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) .init = "[:pe -380]",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) .procspeech = PROCSPEECH,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) .clear = SYNTH_CLEAR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) .delay = 500,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .trigger = 50,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) .jiffies = 50,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) .full = 40000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) .flags = SF_DEC,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) .dev_name = SYNTH_DEFAULT_DEV,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) .startup = SYNTH_START,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) .checkval = SYNTH_CHECK,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) .vars = vars,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) .io_ops = &spk_ttyio_ops,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) .probe = spk_ttyio_synth_probe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) .release = spk_ttyio_release,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) .synth_immediate = spk_ttyio_synth_immediate,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) .catch_up = do_catch_up,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) .flush = synth_flush,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) .is_alive = spk_synth_is_alive_restart,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) .synth_adjust = NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) .read_buff_add = read_buff_add,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) .get_index = NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) .indexing = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) .command = NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) .lowindex = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) .highindex = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) .currindex = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) .attributes = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) .attrs = synth_attrs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) .name = "decext",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) static void do_catch_up(struct spk_synth *synth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) u_char ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) static u_char last = '\0';
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) unsigned long flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) unsigned long jiff_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) struct var_t *jiffy_delta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) struct var_t *delay_time;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) int jiffy_delta_val = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) int delay_time_val = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) jiffy_delta = spk_get_var(JIFFY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) delay_time = spk_get_var(DELAY);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) spin_lock_irqsave(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) jiffy_delta_val = jiffy_delta->u.n.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) spin_unlock_irqrestore(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) jiff_max = jiffies + jiffy_delta_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) while (!kthread_should_stop()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) spin_lock_irqsave(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) if (speakup_info.flushing) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) speakup_info.flushing = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) spin_unlock_irqrestore(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) synth->flush(synth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) synth_buffer_skip_nonlatin1();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) if (synth_buffer_empty()) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) spin_unlock_irqrestore(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) ch = synth_buffer_peek();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) set_current_state(TASK_INTERRUPTIBLE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) delay_time_val = delay_time->u.n.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) spin_unlock_irqrestore(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) if (ch == '\n')
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) ch = 0x0D;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) if (synth_full() || !synth->io_ops->synth_out(synth, ch)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) schedule_timeout(msecs_to_jiffies(delay_time_val));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) continue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) set_current_state(TASK_RUNNING);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) spin_lock_irqsave(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) synth_buffer_getc();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) spin_unlock_irqrestore(&speakup_info.spinlock, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) if (ch == '[') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) in_escape = 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) } else if (ch == ']') {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) in_escape = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) } else if (ch <= SPACE) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) if (!in_escape && strchr(",.!?;:", last))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) synth->io_ops->synth_out(synth, PROCSPEECH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) if (time_after_eq(jiffies, jiff_max)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) if (!in_escape)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) synth->io_ops->synth_out(synth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) PROCSPEECH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) spin_lock_irqsave(&speakup_info.spinlock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) jiffy_delta_val = jiffy_delta->u.n.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) delay_time_val = delay_time->u.n.value;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) spin_unlock_irqrestore(&speakup_info.spinlock,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) schedule_timeout(msecs_to_jiffies
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) (delay_time_val));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) jiff_max = jiffies + jiffy_delta_val;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) last = ch;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) if (!in_escape)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) synth->io_ops->synth_out(synth, PROCSPEECH);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) static void synth_flush(struct spk_synth *synth)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) in_escape = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) synth->io_ops->flush_buffer();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) synth->synth_immediate(synth, "\033P;10z\033\\");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) module_param_named(ser, synth_decext.ser, int, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) module_param_named(dev, synth_decext.dev_name, charp, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) module_param_named(start, synth_decext.startup, short, 0444);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) MODULE_PARM_DESC(ser, "Set the serial port for the synthesizer (0-based).");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) MODULE_PARM_DESC(dev, "Set the device e.g. ttyUSB0, for the synthesizer.");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded.");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) module_spk_synth(synth_decext);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) MODULE_AUTHOR("Kirk Reiser <kirk@braille.uwo.ca>");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) MODULE_AUTHOR("David Borowski");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) MODULE_DESCRIPTION("Speakup support for DECtalk External synthesizers");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) MODULE_VERSION(DRV_VERSION);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240)