diff options
Diffstat (limited to 'drivers/staging/speakup/speakup_decpc.c')
-rw-r--r-- | drivers/staging/speakup/speakup_decpc.c | 119 |
1 files changed, 60 insertions, 59 deletions
diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c index 6bf38e4..5d22c3b 100644 --- a/drivers/staging/speakup/speakup_decpc.c +++ b/drivers/staging/speakup/speakup_decpc.c @@ -33,15 +33,15 @@ #include "spk_priv.h" #include "speakup.h" -#define MODULE_init 0x0dec /* module in boot code */ -#define MODULE_self_test 0x8800 /* module in self-test */ -#define MODULE_reset 0xffff /* reinit the whole module */ +#define MODULE_init 0x0dec /* module in boot code */ +#define MODULE_self_test 0x8800 /* module in self-test */ +#define MODULE_reset 0xffff /* reinit the whole module */ -#define MODE_mask 0xf000 /* mode bits in high nibble */ +#define MODE_mask 0xf000 /* mode bits in high nibble */ #define MODE_null 0x0000 -#define MODE_test 0x2000 /* in testing mode */ +#define MODE_test 0x2000 /* in testing mode */ #define MODE_status 0x8000 -#define STAT_int 0x0001 /* running in interrupt mode */ +#define STAT_int 0x0001 /* running in interrupt mode */ #define STAT_tr_char 0x0002 /* character data to transmit */ #define STAT_rr_char 0x0004 /* ready to receive char data */ #define STAT_cmd_ready 0x0008 /* ready to accept commands */ @@ -61,33 +61,31 @@ #define CMD_mask 0xf000 /* mask for command nibble */ #define CMD_null 0x0000 /* post status */ #define CMD_control 0x1000 /* hard control command */ -#define CTRL_mask 0x0F00 /* mask off control nibble */ -#define CTRL_data 0x00FF /* mask to get data byte */ -#define CTRL_null 0x0000 /* null control */ -#define CTRL_vol_up 0x0100 /* increase volume */ -#define CTRL_vol_down 0x0200 /* decrease volume */ -#define CTRL_vol_set 0x0300 /* set volume */ -#define CTRL_pause 0x0400 /* pause spc */ -#define CTRL_resume 0x0500 /* resume spc clock */ -#define CTRL_resume_spc 0x0001 /* resume spc soft pause */ -#define CTRL_flush 0x0600 /* flush all buffers */ -#define CTRL_int_enable 0x0700 /* enable status change ints */ -#define CTRL_buff_free 0x0800 /* buffer remain count */ -#define CTRL_buff_used 0x0900 /* buffer in use */ -#define CTRL_speech 0x0a00 /* immediate speech change */ -#define CTRL_SP_voice 0x0001 /* voice change */ -#define CTRL_SP_rate 0x0002 /* rate change */ -#define CTRL_SP_comma 0x0003 /* comma pause change */ -#define CTRL_SP_period 0x0004 /* period pause change */ -#define CTRL_SP_rate_delta 0x0005 /* delta rate change */ -#define CTRL_SP_get_param 0x0006 /* return the desired parameter */ -#define CTRL_last_index 0x0b00 /* get last index spoken */ -#define CTRL_io_priority 0x0c00 /* change i/o priority */ -#define CTRL_free_mem 0x0d00 /* get free paragraphs on module */ -#define CTRL_get_lang 0x0e00 /* return bit mask of loaded - * languages - */ -#define CMD_test 0x2000 /* self-test request */ +#define CTRL_mask 0x0F00 /* mask off control nibble */ +#define CTRL_data 0x00FF /* mask to get data byte */ +#define CTRL_null 0x0000 /* null control */ +#define CTRL_vol_up 0x0100 /* increase volume */ +#define CTRL_vol_down 0x0200 /* decrease volume */ +#define CTRL_vol_set 0x0300 /* set volume */ +#define CTRL_pause 0x0400 /* pause spc */ +#define CTRL_resume 0x0500 /* resume spc clock */ +#define CTRL_resume_spc 0x0001 /* resume spc soft pause */ +#define CTRL_flush 0x0600 /* flush all buffers */ +#define CTRL_int_enable 0x0700 /* enable status change ints */ +#define CTRL_buff_free 0x0800 /* buffer remain count */ +#define CTRL_buff_used 0x0900 /* buffer in use */ +#define CTRL_speech 0x0a00 /* immediate speech change */ +#define CTRL_SP_voice 0x0001 /* voice change */ +#define CTRL_SP_rate 0x0002 /* rate change */ +#define CTRL_SP_comma 0x0003 /* comma pause change */ +#define CTRL_SP_period 0x0004 /* period pause change */ +#define CTRL_SP_rate_delta 0x0005 /* delta rate change */ +#define CTRL_SP_get_param 0x0006 /* return the desired parameter */ +#define CTRL_last_index 0x0b00 /* get last index spoken */ +#define CTRL_io_priority 0x0c00 /* change i/o priority */ +#define CTRL_free_mem 0x0d00 /* get free paragraphs on module */ +#define CTRL_get_lang 0x0e00 /* return bit mask of loaded languages */ +#define CMD_test 0x2000 /* self-test request */ #define TEST_mask 0x0F00 /* isolate test field */ #define TEST_null 0x0000 /* no test requested */ #define TEST_isa_int 0x0100 /* assert isa irq */ @@ -101,19 +99,19 @@ #define ID_null 0x0000 /* null id */ #define ID_kernel 0x0100 /* kernel code executing */ #define ID_boot 0x0200 /* boot code executing */ -#define CMD_dma 0x4000 /* force a dma start */ -#define CMD_reset 0x5000 /* reset module status */ -#define CMD_sync 0x6000 /* kernel sync command */ -#define CMD_char_in 0x7000 /* single character send */ -#define CMD_char_out 0x8000 /* single character get */ -#define CHAR_count_1 0x0100 /* one char in cmd_low */ -#define CHAR_count_2 0x0200 /* the second in data_low */ -#define CHAR_count_3 0x0300 /* the third in data_high */ -#define CMD_spc_mode 0x9000 /* change spc mode */ -#define CMD_spc_to_text 0x0100 /* set to text mode */ -#define CMD_spc_to_digit 0x0200 /* set to digital mode */ -#define CMD_spc_rate 0x0400 /* change spc data rate */ -#define CMD_error 0xf000 /* severe error */ +#define CMD_dma 0x4000 /* force a dma start */ +#define CMD_reset 0x5000 /* reset module status */ +#define CMD_sync 0x6000 /* kernel sync command */ +#define CMD_char_in 0x7000 /* single character send */ +#define CMD_char_out 0x8000 /* single character get */ +#define CHAR_count_1 0x0100 /* one char in cmd_low */ +#define CHAR_count_2 0x0200 /* the second in data_low */ +#define CHAR_count_3 0x0300 /* the third in data_high */ +#define CMD_spc_mode 0x9000 /* change spc mode */ +#define CMD_spc_to_text 0x0100 /* set to text mode */ +#define CMD_spc_to_digit 0x0200 /* set to digital mode */ +#define CMD_spc_rate 0x0400 /* change spc data rate */ +#define CMD_error 0xf000 /* severe error */ enum { PRIMARY_DIC = 0, USER_DIC, COMMAND_DIC, ABBREV_DIC }; @@ -220,6 +218,7 @@ static struct spk_synth synth_dec_pc = { .startup = SYNTH_START, .checkval = SYNTH_CHECK, .vars = vars, + .io_ops = &spk_serial_io_ops, .probe = synth_probe, .release = dtpc_release, .synth_immediate = synth_immediate, @@ -251,7 +250,7 @@ static int dt_getstatus(void) static void dt_sendcmd(u_int cmd) { outb_p(cmd & 0xFF, speakup_info.port_tts); - outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts+1); + outb_p((cmd >> 8) & 0xFF, speakup_info.port_tts + 1); } static int dt_waitbit(int bit) @@ -287,11 +286,11 @@ static int dt_ctrl(u_int cmd) if (!dt_waitbit(STAT_cmd_ready)) return -1; - outb_p(0, speakup_info.port_tts+2); - outb_p(0, speakup_info.port_tts+3); + outb_p(0, speakup_info.port_tts + 2); + outb_p(0, speakup_info.port_tts + 3); dt_getstatus(); - dt_sendcmd(CMD_control|cmd); - outb_p(0, speakup_info.port_tts+6); + dt_sendcmd(CMD_control | cmd); + outb_p(0, speakup_info.port_tts + 6); while (dt_getstatus() & STAT_cmd_ready) { udelay(20); if (--timeout == 0) @@ -319,8 +318,8 @@ udelay(50); break; udelay(50); } - outb_p(DMA_sync, speakup_info.port_tts+4); - outb_p(0, speakup_info.port_tts+4); + outb_p(DMA_sync, speakup_info.port_tts + 4); + outb_p(0, speakup_info.port_tts + 4); udelay(100); for (timeout = 0; timeout < 10; timeout++) { if (!(dt_getstatus() & STAT_flushing)) @@ -338,8 +337,8 @@ static int dt_sendchar(char ch) return -1; if (!(dt_stat & STAT_rr_char)) return -2; - outb_p(DMA_single_in, speakup_info.port_tts+4); - outb_p(ch, speakup_info.port_tts+4); + outb_p(DMA_single_in, speakup_info.port_tts + 4); + outb_p(ch, speakup_info.port_tts + 4); dma_state ^= STAT_dma_state; return 0; } @@ -355,7 +354,7 @@ static int testkernel(void) dt_sendcmd(CMD_sync); if (!dt_waitbit(STAT_cmd_ready)) status = -2; - else if (dt_stat&0x8000) + else if (dt_stat & 0x8000) return 0; else if (dt_stat == 0x0dec) pr_warn("dec_pc at 0x%x, software not loaded\n", @@ -392,6 +391,7 @@ static void do_catch_up(struct spk_synth *synth) synth->flush(synth); continue; } + synth_buffer_skip_nonlatin1(); if (synth_buffer_empty()) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); break; @@ -410,11 +410,11 @@ static void do_catch_up(struct spk_synth *synth) spin_lock_irqsave(&speakup_info.spinlock, flags); synth_buffer_getc(); spin_unlock_irqrestore(&speakup_info.spinlock, flags); - if (ch == '[') + if (ch == '[') { in_escape = 1; - else if (ch == ']') + } else if (ch == ']') { in_escape = 0; - else if (ch <= SPACE) { + } else if (ch <= SPACE) { if (!in_escape && strchr(",.!?;:", last)) dt_sendchar(PROCSPEECH); if (time_after_eq(jiffies, jiff_max)) { @@ -481,6 +481,7 @@ static int synth_probe(struct spk_synth *synth) static void dtpc_release(void) { + spk_stop_serial_interrupt(); if (speakup_info.port_tts) synth_release_region(speakup_info.port_tts, SYNTH_IO_EXTENT); speakup_info.port_tts = 0; |