diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-04 18:56:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-04 18:56:27 -0700 |
commit | df34df483a97b1591a3e90a6941f99fe9f863508 (patch) | |
tree | 1b7239fba7513ecbc3a3b322125fc8c3761bd65e /drivers/staging/speakup | |
parent | 9abf8acea297b4c65f5fa3206e2b8e468e730e84 (diff) | |
parent | 049b5e2ae30b3c2f870cc9550af6f9a947fbd5b5 (diff) | |
download | linux-df34df483a97b1591a3e90a6941f99fe9f863508.tar.bz2 |
Merge tag 'staging-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging/IIO updates from Greg KH:
"Here is the big set of Staging/IIO driver patches for 4.17-rc1.
It is a lot, over 500 changes, but not huge by previous kernel release
standards. We deleted more lines than we added again (27k added vs.
91k remvoed), thanks to finally being able to delete the IRDA drivers
and networking code.
We also deleted the ccree crypto driver, but that's coming back in
through the crypto tree to you, in a much cleaned-up form.
Added this round is at lot of "mt7621" device support, which is for an
embedded device that Neil Brown cares about, and of course a handful
of new IIO drivers as well.
And finally, the fsl-mc core code moved out of the staging tree to the
"real" part of the kernel, which is nice to see happen as well.
Full details are in the shortlog, which has all of the tiny cleanup
patches described.
All of these have been in linux-next for a while with no reported
issues"
* tag 'staging-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (579 commits)
staging: rtl8723bs: Remove yield call, replace with cond_resched()
staging: rtl8723bs: Replace yield() call with cond_resched()
staging: rtl8723bs: Remove unecessary newlines from 'odm.h'.
staging: rtl8723bs: Rework 'struct _ODM_Phy_Status_Info_' coding style.
staging: rtl8723bs: Rework 'struct _ODM_Per_Pkt_Info_' coding style.
staging: rtl8723bs: Replace NULL pointer comparison with '!'.
staging: rtl8723bs: Factor out rtl8723bs_recv_tasklet() sections.
staging: rtl8723bs: Fix function signature that goes over 80 characters.
staging: rtl8723bs: Fix lines too long in update_recvframe_attrib().
staging: rtl8723bs: Remove unnecessary blank lines in 'rtl8723bs_recv.c'.
staging: rtl8723bs: Change camel case to snake case in 'rtl8723bs_recv.c'.
staging: rtl8723bs: Add missing braces in else statement.
staging: rtl8723bs: Add spaces around ternary operators.
staging: rtl8723bs: Fix lines with trailing open parentheses.
staging: rtl8723bs: Remove unnecessary length #define's.
staging: rtl8723bs: Fix IEEE80211 authentication algorithm constants.
staging: rtl8723bs: Fix alignment in rtw_wx_set_auth().
staging: rtl8723bs: Remove braces from single statement conditionals.
staging: rtl8723bs: Remove unecessary braces from switch statement.
staging: rtl8723bs: Fix newlines in rtw_wx_set_auth().
...
Diffstat (limited to 'drivers/staging/speakup')
-rw-r--r-- | drivers/staging/speakup/main.c | 8 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_decpc.c | 6 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_dectlk.c | 4 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_dtlk.c | 25 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_dummy.c | 2 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_keypc.c | 4 | ||||
-rw-r--r-- | drivers/staging/speakup/spk_priv.h | 1 | ||||
-rw-r--r-- | drivers/staging/speakup/spk_ttyio.c | 21 | ||||
-rw-r--r-- | drivers/staging/speakup/spk_types.h | 1 | ||||
-rw-r--r-- | drivers/staging/speakup/synth.c | 25 |
10 files changed, 69 insertions, 28 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index cf1259059776..af30b7099bed 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -417,7 +417,7 @@ static void announce_edge(struct vc_data *vc, int msg_id) bleep(spk_y); if ((spk_bleeps & 2) && (msg_id < edge_quiet)) synth_printf("%s\n", - spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1)); + spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1)); } static void speak_char(u16 ch) @@ -449,8 +449,9 @@ static void speak_char(u16 ch) if (*cp == '^') { cp++; synth_printf(" %s%s ", spk_msg_get(MSG_CTRL), cp); - } else + } else { synth_printf(" %s ", cp); + } } } @@ -561,7 +562,7 @@ static u_long get_word(struct vc_data *vc) get_char(vc, (u_short *)&tmp_pos + 1, &temp) > SPACE) { tmp_pos += 2; tmpx++; - } else + } else { while (tmpx > 0) { ch = get_char(vc, (u_short *)tmp_pos - 1, &temp); if ((ch == SPACE || ch == 0 || @@ -571,6 +572,7 @@ static u_long get_word(struct vc_data *vc) tmp_pos -= 2; tmpx--; } + } attr_ch = get_char(vc, (u_short *)tmp_pos, &spk_attr); buf[cnt++] = attr_ch; while (tmpx < vc->vc_cols - 1) { diff --git a/drivers/staging/speakup/speakup_decpc.c b/drivers/staging/speakup/speakup_decpc.c index 303f393d3f2f..6649309e0342 100644 --- a/drivers/staging/speakup/speakup_decpc.c +++ b/drivers/staging/speakup/speakup_decpc.c @@ -349,7 +349,7 @@ static int testkernel(void) return 0; else if (dt_stat == 0x0dec) pr_warn("dec_pc at 0x%x, software not loaded\n", - speakup_info.port_tts); + speakup_info.port_tts); status = -3; oops: synth_release_region(speakup_info.port_tts, SYNTH_IO_EXTENT); speakup_info.port_tts = 0; @@ -412,11 +412,11 @@ static void do_catch_up(struct spk_synth *synth) if (!in_escape) dt_sendchar(PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, - flags); + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; spin_unlock_irqrestore(&speakup_info.spinlock, - flags); + flags); schedule_timeout(msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val; diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c index 2ea22a2eb5f9..a144f28ee1a8 100644 --- a/drivers/staging/speakup/speakup_dectlk.c +++ b/drivers/staging/speakup/speakup_dectlk.c @@ -262,11 +262,11 @@ static void do_catch_up(struct spk_synth *synth) if (!in_escape) synth->io_ops->synth_out(synth, PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, - flags); + flags); jiffy_delta_val = jiffy_delta->u.n.value; delay_time_val = delay_time->u.n.value; spin_unlock_irqrestore(&speakup_info.spinlock, - flags); + flags); schedule_timeout(msecs_to_jiffies (delay_time_val)); jiff_max = jiffies + jiffy_delta_val; diff --git a/drivers/staging/speakup/speakup_dtlk.c b/drivers/staging/speakup/speakup_dtlk.c index f8cb83c9b82e..dbebed0eeeec 100644 --- a/drivers/staging/speakup/speakup_dtlk.c +++ b/drivers/staging/speakup/speakup_dtlk.c @@ -266,7 +266,7 @@ static char synth_read_tts(void) outb_p(ch, speakup_info.port_tts); while (synth_readable()) cpu_relax(); - return (char) ch; + return (char)ch; } /* interrogate the DoubleTalk PC and return its settings */ @@ -287,7 +287,7 @@ static struct synth_settings *synth_interrogate(struct spk_synth *synth) } t = buf; /* serial number is little endian */ - status.serial_number = t[0] + t[1]*256; + status.serial_number = t[0] + t[1] * 256; t += 2; for (i = 0; *t != '\r'; t++) { status.rom_version[i] = *t; @@ -323,29 +323,29 @@ static int synth_probe(struct spk_synth *synth) if (port_forced) { speakup_info.port_tts = port_forced; pr_info("probe forced to %x by kernel command line\n", - speakup_info.port_tts); + speakup_info.port_tts); if ((port_forced & 0xf) != 0xf) pr_info("warning: port base should probably end with f\n"); - if (synth_request_region(speakup_info.port_tts-1, - SYNTH_IO_EXTENT)) { + if (synth_request_region(speakup_info.port_tts - 1, + SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; } - port_val = inw(speakup_info.port_tts-1); - synth_lpc = speakup_info.port_tts-1; + port_val = inw(speakup_info.port_tts - 1); + synth_lpc = speakup_info.port_tts - 1; } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], - SYNTH_IO_EXTENT)) + SYNTH_IO_EXTENT)) continue; port_val = inw(synth_portlist[i]) & 0xfbff; if (port_val == 0x107f) { synth_lpc = synth_portlist[i]; - speakup_info.port_tts = synth_lpc+1; + speakup_info.port_tts = synth_lpc + 1; break; } synth_release_region(synth_portlist[i], - SYNTH_IO_EXTENT); + SYNTH_IO_EXTENT); } } port_val &= 0xfbff; @@ -359,7 +359,7 @@ static int synth_probe(struct spk_synth *synth) cpu_relax(); /* wait until it's ready */ sp = synth_interrogate(synth); pr_info("%s: %03x-%03x, ROM ver %s, s/n %u, driver: %s\n", - synth->long_name, synth_lpc, synth_lpc+SYNTH_IO_EXTENT - 1, + synth->long_name, synth_lpc, synth_lpc + SYNTH_IO_EXTENT - 1, sp->rom_version, sp->serial_number, synth->version); synth->alive = 1; return 0; @@ -369,7 +369,8 @@ static void dtlk_release(void) { spk_stop_serial_interrupt(); if (speakup_info.port_tts) - synth_release_region(speakup_info.port_tts-1, SYNTH_IO_EXTENT); + synth_release_region(speakup_info.port_tts - 1, + SYNTH_IO_EXTENT); speakup_info.port_tts = 0; } diff --git a/drivers/staging/speakup/speakup_dummy.c b/drivers/staging/speakup/speakup_dummy.c index a30d60450bd5..aa0c900f79f2 100644 --- a/drivers/staging/speakup/speakup_dummy.c +++ b/drivers/staging/speakup/speakup_dummy.c @@ -94,7 +94,7 @@ static struct spk_synth synth_dummy = { .probe = spk_ttyio_synth_probe, .release = spk_ttyio_release, .synth_immediate = spk_ttyio_synth_immediate, - .catch_up = spk_do_catch_up, + .catch_up = spk_do_catch_up_unicode, .flush = spk_synth_flush, .is_alive = spk_synth_is_alive_restart, .synth_adjust = NULL, diff --git a/drivers/staging/speakup/speakup_keypc.c b/drivers/staging/speakup/speakup_keypc.c index de76183932e1..3901734982a4 100644 --- a/drivers/staging/speakup/speakup_keypc.c +++ b/drivers/staging/speakup/speakup_keypc.c @@ -260,7 +260,7 @@ static int synth_probe(struct spk_synth *synth) if (port_forced) { synth_port = port_forced; pr_info("probe forced to %x by kernel command line\n", - synth_port); + synth_port); if (synth_request_region(synth_port-1, SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; @@ -269,7 +269,7 @@ static int synth_probe(struct spk_synth *synth) } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], - SYNTH_IO_EXTENT)) { + SYNTH_IO_EXTENT)) { pr_warn ("request_region: failed with 0x%x, %d\n", synth_portlist[i], SYNTH_IO_EXTENT); diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h index 00430437eb4c..7b3a16e1fa23 100644 --- a/drivers/staging/speakup/spk_priv.h +++ b/drivers/staging/speakup/spk_priv.h @@ -57,6 +57,7 @@ int spk_ttyio_synth_probe(struct spk_synth *synth); const char *spk_serial_synth_immediate(struct spk_synth *synth, const char *buff); const char *spk_ttyio_synth_immediate(struct spk_synth *synth, const char *buff); void spk_do_catch_up(struct spk_synth *synth); +void spk_do_catch_up_unicode(struct spk_synth *synth); void spk_synth_flush(struct spk_synth *synth); unsigned char spk_synth_get_index(struct spk_synth *synth); int spk_synth_is_alive_nop(struct spk_synth *synth); diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c index 5aa3ffa3772d..eac63aab8162 100644 --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -71,7 +71,7 @@ static void spk_ttyio_ldisc_close(struct tty_struct *tty) } static int spk_ttyio_receive_buf2(struct tty_struct *tty, - const unsigned char *cp, char *fp, int count) + const unsigned char *cp, char *fp, int count) { struct spk_ldisc_data *ldisc_data = tty->disc_data; @@ -110,6 +110,7 @@ static struct tty_ldisc_ops spk_ttyio_ldisc_ops = { }; static int spk_ttyio_out(struct spk_synth *in_synth, const char ch); +static int spk_ttyio_out_unicode(struct spk_synth *in_synth, u16 ch); static void spk_ttyio_send_xchar(char ch); static void spk_ttyio_tiocmset(unsigned int set, unsigned int clear); static unsigned char spk_ttyio_in(void); @@ -118,6 +119,7 @@ static void spk_ttyio_flush_buffer(void); struct spk_io_ops spk_ttyio_ops = { .synth_out = spk_ttyio_out, + .synth_out_unicode = spk_ttyio_out_unicode, .send_xchar = spk_ttyio_send_xchar, .tiocmset = spk_ttyio_tiocmset, .synth_in = spk_ttyio_in, @@ -221,6 +223,23 @@ static int spk_ttyio_out(struct spk_synth *in_synth, const char ch) return 0; } +static int spk_ttyio_out_unicode(struct spk_synth *in_synth, u16 ch) +{ + int ret; + + if (ch < 0x80) + ret = spk_ttyio_out(in_synth, ch); + else if (ch < 0x800) { + ret = spk_ttyio_out(in_synth, 0xc0 | (ch >> 6)); + ret &= spk_ttyio_out(in_synth, 0x80 | (ch & 0x3f)); + } else { + ret = spk_ttyio_out(in_synth, 0xe0 | (ch >> 12)); + ret &= spk_ttyio_out(in_synth, 0x80 | ((ch >> 6) & 0x3f)); + ret &= spk_ttyio_out(in_synth, 0x80 | (ch & 0x3f)); + } + return ret; +} + static int check_tty(struct tty_struct *tty) { if (!tty) { diff --git a/drivers/staging/speakup/spk_types.h b/drivers/staging/speakup/spk_types.h index c50de6035a9a..4203bed90b4f 100644 --- a/drivers/staging/speakup/spk_types.h +++ b/drivers/staging/speakup/spk_types.h @@ -151,6 +151,7 @@ struct spk_synth; struct spk_io_ops { int (*synth_out)(struct spk_synth *synth, const char ch); + int (*synth_out_unicode)(struct spk_synth *synth, u16 ch); void (*send_xchar)(char ch); void (*tiocmset)(unsigned int set, unsigned int clear); unsigned char (*synth_in)(void); diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c index c06e6a810999..7deeb7061018 100644 --- a/drivers/staging/speakup/synth.c +++ b/drivers/staging/speakup/synth.c @@ -52,9 +52,9 @@ static int do_synth_init(struct spk_synth *in_synth); * For devices that have a "full" notification mechanism, the driver can * adapt the loop the way they prefer. */ -void spk_do_catch_up(struct spk_synth *synth) +static void _spk_do_catch_up(struct spk_synth *synth, int unicode) { - u_char ch; + u16 ch; unsigned long flags; unsigned long jiff_max; struct var_t *delay_time; @@ -63,6 +63,7 @@ void spk_do_catch_up(struct spk_synth *synth) int jiffy_delta_val; int delay_time_val; int full_time_val; + int ret; jiffy_delta = spk_get_var(JIFFY); full_time = spk_get_var(FULL); @@ -81,7 +82,8 @@ void spk_do_catch_up(struct spk_synth *synth) synth->flush(synth); continue; } - synth_buffer_skip_nonlatin1(); + if (!unicode) + synth_buffer_skip_nonlatin1(); if (synth_buffer_empty()) { spin_unlock_irqrestore(&speakup_info.spinlock, flags); break; @@ -92,7 +94,11 @@ void spk_do_catch_up(struct spk_synth *synth) spin_unlock_irqrestore(&speakup_info.spinlock, flags); if (ch == '\n') ch = synth->procspeech; - if (!synth->io_ops->synth_out(synth, ch)) { + if (unicode) + ret = synth->io_ops->synth_out_unicode(synth, ch); + else + ret = synth->io_ops->synth_out(synth, ch); + if (!ret) { schedule_timeout(msecs_to_jiffies(full_time_val)); continue; } @@ -117,8 +123,19 @@ void spk_do_catch_up(struct spk_synth *synth) } synth->io_ops->synth_out(synth, synth->procspeech); } + +void spk_do_catch_up(struct spk_synth *synth) +{ + _spk_do_catch_up(synth, 0); +} EXPORT_SYMBOL_GPL(spk_do_catch_up); +void spk_do_catch_up_unicode(struct spk_synth *synth) +{ + _spk_do_catch_up(synth, 1); +} +EXPORT_SYMBOL_GPL(spk_do_catch_up_unicode); + void spk_synth_flush(struct spk_synth *synth) { synth->io_ops->flush_buffer(); |