aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/speakup/speakup_soft.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-18staging: speakup_soft: Fix alternate speech with other synthsSamuel Thibault1-5/+11
When switching from speakup_soft to another synth, speakup_soft would keep calling synth_buffer_getc() from softsynthx_read. Let's thus make synth.c export the knowledge of the current synth, so that speakup_soft can determine whether it should be running. speakup_soft also needs to set itself alive, otherwise the switch would let it remain silent. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-01staging: speakup: fix line over 80 characters.Bhagyashri Dighole1-1/+3
Fix coding style issues, which solves checkpatch.pl warning: "WARNING: line over 80 characters". Signed-off-by: Bhagyashri Dighole <digholebhagyashri@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-16staging: speakup: fix wraparound in uaccess length checkSamuel Thibault1-1/+5
If softsynthx_read() is called with `count < 3`, `count - 3` wraps, causing the loop to copy as much data as available to the provided buffer. If softsynthx_read() is invoked through sys_splice(), this causes an unbounded kernel write; but even when userspace just reads from it normally, a small size could cause userspace crashes. Fixes: 425e586cf95b ("speakup: add unicode variant of /dev/softsynth") Cc: stable@vger.kernel.org Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Jann Horn <jannh@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-05-06staging: speakup: Add pause command used on switching to graphical modeSamuel Thibault1-1/+2
For software speech syntheses to be able to manage concurrent audio card access, they need to know when speakup stops emitting text to be spoken because the console has switched to graphical mode. This introduces a PAUSE command to do so. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds1-1/+1
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-01Merge tag 'staging-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-11/+1
Pull staging/IIO updates from Greg KH: "Here is the big Staging and IIO driver patches for 4.16-rc1. There is the normal amount of new IIO drivers added, like all releases. The networking IPX and the ncpfs filesystem are moved into the staging tree, as they are on their way out of the kernel due to lack of use anymore. The visorbus subsystem finall has started moving out of the staging tree to the "real" part of the kernel, and the most and fsl-mc codebases are almost ready to move out, that will probably happen for 4.17-rc1 if all goes well. Other than that, there is a bunch of license header cleanups in the tree, along with the normal amount of coding style churn that we all know and love for this codebase. I also got frustrated at the Meltdown/Spectre mess and took it out on the dgnc tty driver, deleting huge chunks of it that were never even being used. Full details of everything is in the shortlog. All of these patches have been in linux-next for a while with no reported issues" * tag 'staging-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (627 commits) staging: rtlwifi: remove redundant initialization of 'cfg_cmd' staging: rtl8723bs: remove a couple of redundant initializations staging: comedi: reformat lines to 80 chars or less staging: lustre: separate a connection destroy from free struct kib_conn Staging: rtl8723bs: Use !x instead of NULL comparison Staging: rtl8723bs: Remove dead code Staging: rtl8723bs: Change names to conform to the kernel code staging: ccree: Fix missing blank line after declaration staging: rtl8188eu: remove redundant initialization of 'pwrcfgcmd' staging: rtlwifi: remove unused RTLHALMAC_ST and RTLPHYDM_ST staging: fbtft: remove unused FB_TFT_SSD1325 kconfig staging: comedi: dt2811: remove redundant initialization of 'ns' staging: wilc1000: fix alignments to match open parenthesis staging: wilc1000: removed unnecessary defined enums typedef staging: wilc1000: remove unnecessary use of parentheses staging: rtl8192u: remove redundant initialization of 'timeout' staging: sm750fb: fix CamelCase for dispSet var staging: lustre: lnet/selftest: fix compile error on UP build staging: rtl8723bs: hal_com_phycfg: Remove unneeded semicolons staging: rts5208: Fix "seg_no" calculation in reset_ms_card() ...
2018-01-15staging: speakup: remove redundant license textGreg Kroah-Hartman1-11/+0
Now that the SPDX tag is in all drivers/staging/speakup/ files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@reisers.ca> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15staging: speakup: add SPDX identifier.Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Fix up the remaining staging speakup files to have a proper SPDX identifier, based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@reisers.ca> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28the rest of drivers/*: annotate ->poll() instancesAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-05-15staging: speakup: make input functionality swappableOkash Khawaja1-2/+2
This moves functions which take input from external synth, into struct spk_io_ops. The calling code then uses serial implementation of those methods through spk_io_ops. That way we can add a parallel TTY-based implementation and simply replace serial with TTY. That is what the next patch in this series does. speakup_decext.c has get_last_char function which reads the most recent available character from the synth. This patch changes that by defining read_buff_add callback method of spk_syth and letting that update the last_char global character read from the synth. read_buff_add is called from ISR, so there is a possibility for last_char to be stale. Therefore it is marked as volatile. It also pulls a repeated get_index implementation into synth.c, to be used as a utility function. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: speakup: add spk_io_ops struct to spk_synthOkash Khawaja1-0/+1
This patch adds spk_io_ops struct which contain those methods whose job is to communicate with synth device. Currently, all comms with external synth device use raw serial i/o. The idea is to group all methods which do the actual communication with external device into this new struct. Then migrating a serial-based synth over to an alternative to raw serial i/o will mean swapping serial spk_io_ops instance with the io_ops instance of the new method, making the migration simpler. At the moment, this struct only contains one method, synth_out but more will be added in future when migrating synths which require input functionality. Also at the moment, synth_out method has one implementation which uses serial i/o. Plan is to add an alternative. Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09speakup: add unicode variant of /dev/softsynthSamuel Thibault1-12/+81
This adds /dev/softsynthu, along /dev/softsynth, which emits output in UTF-8 encoding, thus allowing to support 16bit characters. Most of the code is shared, only the read function has to behave differently in latin1 and in unicode mode. Since Linux only supports 16bit characters, we can just hardcode the UTF-8 encoding. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Chris Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-09speakup: extend synth buffer to 16bit unicode charactersSamuel Thibault1-0/+1
This extends the synth buffer slots to 16bit, so as to hold 16bit unicode characters. synth_buffer_getc and synth_buffer_peek now return 16bit characters. Speech synthesizers which do not support characters beyond latin1 can use the synth_buffer_skip_nonlatin1() helper to skip the non-latin1 characters before getting or peeking. All synthesizers are made to use it for now. This makes synth_buffer_add take a 16bit character. For simplicity for now, synth_printf is left to using latin1 formats and strings. synth_putwc, synth_putwc_s, synth_putws and synth_putws_s helpers are however added to put 16bit characters and strings. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Chris Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-02sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>Ingo Molnar1-1/+1
Fix up affected files that include this signal functionality via sched.h. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-01-31Staging: speakup - syle fix permissions to octalDerek Robson1-16/+16
A style fix across whole driver. changed permissions to octal style, found using checkpatch Signed-off-by: Derek Robson <robsonde@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c Align parenthesisWalt Feasel1-2/+1
Make suggested checkpatch modification for CHECK: Alignment should match open parenthesis Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c comment modificationsWalt Feasel1-5/+4
Make modifications to comment style Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c Blank line after {Walt Feasel1-1/+0
Make suggested checkpatch modification for CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c Multiple blank linesWalt Feasel1-1/+0
Make suggested checkpatch modification for CHECK: Please don't use multiple blank lines Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c Logical continuationWalt Feasel1-2/+2
Make suggested checkpatch modification for CHECK: Logical continuations should be on the previous line Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-23staging: speakup: speakup_soft.c Space around operatorWalt Feasel1-14/+14
Make suggested checkpatch modification for CHECK: spaces preferred around that '|' Signed-off-by: Walt Feasel <waltfeasel@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-28Staging: speakup: Remove FSF mailing addressShraddha Barke1-3/+0
FSF mailing address is no longer required to be specified. Hence removed. Detected using checkpatch Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: speakup: Fix multi-line comment styleCristina Moraru1-1/+2
Thus using the preferred style for multi-line coments as mentioned in Documentation/CodingStyle. It also silences 'Block comments use * on subsequent lines' and 'Block comments use a trailing */ on a separate line' checkpatch.pl warnings. Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14staging: speakup: Fix warning reported by checkpatchAleksei Fedotov1-1/+0
This patch fixes the checkpatch.pl warnings: WARNING: Block comments use a trailing */ on a separate line WARNING: Block comments use * on subsequent lines Signed-off-by: Aleksey Fedotov <lexa@cfotr.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-20Staging: speakup: Use module_spk_synthVaishali Thakkar1-12/+1
Macro module_spk_synth can be used for speakup drivers whose init and exit paths does only module registrations. So, here remove some boilerplate code by using module_spk_synth. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11staging: speakup: fix missing blank lines after declarationsDomagoj Trsan1-0/+3
Signed-off-by: Domagoj Trsan <domagoj.trsan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23drivers/staging/speakup/: avoid world-writable sysfs files.Rusty Russell1-11/+11
In line with practice for module parameters, we're adding a build-time check that sysfs files aren't world-writable. Cc: Christopher Brannon <chris@the-brannons.com> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-01staging: fix up speakup kobject modeRusty Russell1-15/+15
It uses the unnecessary S_IFREG bit which broke when my stricter-checking-for-mode patch went in. Since we're fixing it anyway, the extra level of indirection is confusing for readers (ROOT_W == rw-r--r-- for example). Also, many of these are other-writable. Is that really intended? I'll-queue-this-patch-up-in-a-bit-by: Greg KH <greg@kroah.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-05-22staging: speakup: fix warnings by adding __user annotationsEmil Goode1-4/+4
This patch fixes the following sparse warnings by adding __user annotations. drivers/staging/speakup/speakup_soft.c:248:34: warning: incorrect type in argument 1 (different address spaces) drivers/staging/speakup/speakup_soft.c:248:34: expected void [noderef] <asn:1>*dst drivers/staging/speakup/speakup_soft.c:248:34: got char *[assigned] cp drivers/staging/speakup/speakup_soft.c:272:40: warning: incorrect type in argument 1 (different address spaces) drivers/staging/speakup/speakup_soft.c:272:40: expected char const [noderef] <asn:1>*s drivers/staging/speakup/speakup_soft.c:272:40: got char const *buf drivers/staging/speakup/speakup_soft.c:306:17: warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/speakup_soft.c:306:17: expected long ( *read )( ... ) drivers/staging/speakup/speakup_soft.c:306:17: got long ( static [toplevel] *<noident> )( ... ) drivers/staging/speakup/speakup_soft.c:307:18: warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/speakup_soft.c:307:18: expected long ( *write )( ... ) drivers/staging/speakup/speakup_soft.c:307:18: got long ( static [toplevel] *<nfile_operationsoident> )( ... ) drivers/staging/speakup/devsynth.c:29:41: warning: incorrect type in argument 2 (different address spaces) drivers/staging/speakup/devsynth.c:29:41: expected void const [noderef] <asn:1>*from drivers/staging/speakup/devsynth.c:29:41: got char const *ptr drivers/staging/speakup/devsynth.c:62:17: warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/devsynth.c:62:17: expected long ( *read )( ... ) drivers/staging/speakup/devsynth.c:62:17: got long ( static [toplevel] *<noident> )( ... ) drivers/staging/speakup/devsynth.c:63:18: warning: incorrect type in initializer (incompatible argument 2 (different address spaces)) drivers/staging/speakup/devsynth.c:63:18: expected long ( *write )( ... ) drivers/staging/speakup/devsynth.c:63:18: got long ( static [toplevel] *<noident> )( ... ) Signed-off-by: Emil Goode <emilgoode@gmail.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16staging: speakup: soft: remove custom locking macrosWilliam Hubbs1-13/+13
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-17staging: speakup_soft: Fix reading of init stringBen Hutchings1-9/+4
softsynth_read() reads a character at a time from the init string; when it finds the null terminator it sets the initialized flag but then repeats the last character. Additionally, if the read() buffer is not big enough for the init string, the next read() will start reading from the beginning again. So the caller may never progress to reading anything else. Replace the simple initialized flag with the current position in the init string, carried over between calls. Switch to reading real data once this reaches the null terminator. (This assumes that the length of the init string can't change, which seems to be the case. Really, the string and position belong together in a per-file private struct.) Tested-by: Samuel Thibault <sthibault@debian.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04speakup: lower default software speech rateSamuel Thibault1-1/+1
Speech synthesis beginners need a low speech rate, and trained people want a high speech rate. A medium speech rate is thus actually not a good default for neither. Since trained people will typically know how to change the rate, better default for a low speech rate, which beginners can grasp and learn how to increase it afterwards This was agreed with users on the speakup mailing list. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-06-28staging: speakup: Use kstrtoul_from_userPeter Huewe1-8/+1
This patch replaces the code for getting an unsigned long from a userspace buffer by a simple call to kstroul_from_user. This makes it easier to read and less error prone. Kernel Version: staging of 20110606 Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15staging: speakup: speakup_soft.c: style fixesChristopher Brannon1-21/+34
* Clean this file based on reports from checkpatch.pl. * Make the file_operations structure const. * Use strict_strtoul instead of simple_strtoul. Signed-off-by: Christopher Brannon <chris@the-brannons.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-07Staging: add speakup to the staging directoryWilliam Hubbs1-0/+366
Speakup is a kernel based screen review package for the linux operating system. It allows blind users to interact with applications on the linux console by means of synthetic speech. The authors and maintainers of this code include the following: Kirk Reiser, Andy Berdan, John Covici, Brian and David Borowski, Christopher Brannon, Samuel Thibault and William Hubbs. Signed-off-by: William Hubbs <w.d.hubbs@gmail.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>