28 #include <linux/sched.h>
37 #define DRV_VERSION "2.10"
38 #define PROCSPEECH '\r'
41 static void accent_release(
void);
46 static int synth_port_control;
47 static int port_forced;
48 static unsigned int synth_portlist[] = { 0x2a8, 0 };
50 static struct var_t vars[] = {
53 {
RATE, .u.n = {
"\033R%c", 9, 0, 17, 0, 0,
"0123456789abcdefgh" } },
54 {
PITCH, .u.n = {
"\033P%d", 5, 0, 9, 0, 0,
NULL } },
55 {
VOL, .u.n = {
"\033A%d", 5, 0, 9, 0, 0,
NULL } },
56 {
TONE, .u.n = {
"\033V%d", 5, 0, 9, 0, 0,
NULL } },
92 static struct attribute *synth_attrs[] = {
93 &caps_start_attribute.
attr,
94 &caps_stop_attribute.
attr,
95 &pitch_attribute.
attr,
99 &delay_time_attribute.
attr,
100 &direct_attribute.
attr,
101 &full_time_attribute.
attr,
102 &jiffy_delta_attribute.
attr,
103 &trigger_time_attribute.
attr,
110 .long_name =
"Accent PC",
111 .init =
"\033=X \033Oi\033T2\033=M\033N1\n",
121 .probe = synth_probe,
122 .release = accent_release,
124 .catch_up = do_catch_up,
125 .flush = synth_flush,
127 .synth_adjust =
NULL,
128 .read_buff_add =
NULL,
137 .attrs = synth_attrs,
142 static inline bool synth_writable(
void)
147 static inline bool synth_full(
void)
155 while ((ch = *buf)) {
161 while (synth_writable()) {
172 static void do_catch_up(
struct spk_synth *synth)
176 unsigned long jiff_max;
181 struct var_t *delay_time;
182 struct var_t *full_time;
183 struct var_t *jiffy_delta;
190 jiffy_delta_val = jiffy_delta->
u.
n.value;
193 jiff_max =
jiffies + jiffy_delta_val;
207 full_time_val = full_time->
u.
n.value;
215 while (synth_writable()) {
226 if (jiffies >= jiff_max && ch ==
SPACE) {
228 while (synth_writable()) {
235 jiffy_delta_val = jiffy_delta->
u.
n.value;
236 delay_time_val = delay_time->
u.
n.value;
239 jiff_max =
jiffies+jiffy_delta_val;
243 while (synth_writable()) {
251 static void synth_flush(
struct spk_synth *synth)
256 static int synth_probe(
struct spk_synth *synth)
258 unsigned int port_val = 0;
263 pr_info(
"probe forced to %x by kernel command line\n",
267 pr_warn(
"sorry, port already reserved\n");
273 for (i = 0; synth_portlist[
i]; i++) {
277 (
"request_region: failed with 0x%x, %d\n",
281 port_val =
inw(synth_portlist[i]) & 0xfffc;
282 if (port_val == 0x53fc) {
284 synth_port_control = synth_portlist[
i];
291 if (port_val != 0x53fc) {
295 synth_port_control = 0;
305 static void accent_release(
void)
318 static int __init acntpc_init(
void)
323 static void __exit acntpc_exit(
void)