1
0
Fork 0
Commit Graph

33 Commits (redonkable)

Author SHA1 Message Date
Greg Kroah-Hartman 6496922817 staging: speakup: add SPDX identifier.
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>
2018-01-15 16:03:44 +01:00
Bo YU e5770b7bdb staging: speakup: alignment match open parens
I have aligned argument with parenthesis, so checkpatch no check also.

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:31 +02:00
Bo YU 1f10145646 staging: speakup: in serialio.c no over 80 chars long
Fixed the checkpatch.pl warning:

WARNING: line over 80 characters

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Bo YU 79de2d0e8d staging: speakup: add a space around '|'
Add a space around logical symbol '|' to wipe out checkpatch check

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Bo YU f6089ae42f staging: speakup: add a missing blank line after declaration
Fixed checkpatch warning by adding a blank line after declare
expression

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-06 16:17:30 +02:00
Okash Khawaja 1c5973675c staging: speakup: flush tty buffers and ensure hardware flow control
This patch fixes the issue where TTY-migrated synths would take a while
to shut up after hitting numpad enter key. When calling synth_flush,
even though XOFF character is sent as high priority, data buffered in
TTY layer is still sent to the synth. This patch flushes that buffered
data when synth_flush is called.

It also tries to ensure that hardware flow control is enabled, by
setting CRTSCTS using tty's termios.

Reported-by: John Covici <covici@ccs.covici.com>
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-05-16 14:19:41 +02:00
Okash Khawaja ca693dcd5c staging: speakup: make input functionality swappable
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-05-15 12:31:43 +02:00
Okash Khawaja be223d5775 staging: speakup: add send_xchar and tiocmset methods
This adds two methods to spk_synth struct: send_xchar and tiocmset, and
creates serial implementation for each of them. It takes existing code
in apollo, audptr and spkout which already fits the behaviour of
send_xchar and tiocmset. In follow-up patches there will be TTY-based
implementations of these methods. Then migrating the synths to TTY will
include repointing these methods to their TTY implementations

Rest of the changes simply make use of serial implementation of these two
functions.

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-04-25 20:45:12 +02:00
Gustavo A. R. Silva a15505e69c staging: speakup: fix warning for static declaration
Fix the following sparse warning:
symbol 'spk_serial_out' was not declared. Should it be static?

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-27 13:49:22 +02:00
Arushi Singhal 65bf4ea10f staging: speakup: Match alignment with open parenthesis.
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23 14:20:41 +01:00
Okash Khawaja 98c1fda752 staging: speakup: move those functions which do outgoing serial comms, into serialio.c
This moves spk_synth_immediate and spk_serial_synth_probe functions into
serialio.c. These functions do outgoing serial comms. The move is a step
towards collecting all serial comms in serialio.c. This also renames
spk_synth_immediate to spk_serial_synth_immediate.

Code inside those functions has not been changed. Along the way, this patch
also fixes a couple of spots which were calling spk_synth_immediate directly,
so that the calls now happen via the spk_syth struct.

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-17 15:19:09 +09:00
Arushi Singhal defaa9ad58 staging: speakup: Add blank line after declarations
Patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum
declarations.
Add a blank line after enum and struct declarations.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16 11:15:10 +09:00
Okash Khawaja a50ef31654 staging: speakup: move spk_stop_serial_interrupt into synth-specific release function
This moves call to spk_stop_serial_interrupt() function out of synth_release()
and into release() method of specific spk_synth instances. This is because
the spk_stop_serial_interrupt() call is specific to current serial i/o
implementation. Moving it into each synth's release() method gives the
decision of calling  spk_stop_serial_interrupt() to that synth.

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-16 11:12:02 +09:00
Okash Khawaja 1e441594e5 staging: speakup: add spk_io_ops struct to spk_synth
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-16 11:11:22 +09:00
Okash Khawaja 9176d156ca staging: speakup: spk_serial_out and spk_wait_for_xmitr to take synth arg
These two functions are always called from a context where spk_synth instance
is available. They also use the spk_synth instance but instead of taking it
as an argument, they rely on a global spk_synth instance inside synth.c which
points to the same synth as the one being passed in as argument.

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-16 11:10:18 +09:00
Varsha Rao e3bab5eb1a staging: speakup: Added spaces around arithmetic operators.
Added spaces around arithmetic operators (+, -, /), to fix the checkpatch
issue.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:02 +01:00
Varsha Rao 8190e15c40 staging: speakup: Removed blank line after open braces.
Remove blank line after open braces, to fix the following checkpatch issue:

CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:02 +01:00
Shiva Kerdel d290effe7e Staging: speakup: Remove unnecessary space after cast
The affected files have been modified to remove redundant spaces after
casts to solve checkpatch.pl checks.

Signed-off-by: Shiva Kerdel <shiva@exdev.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 10:50:35 +01:00
Janani Ravichandran e6ceec822a staging: speakup: Fix block comment style
Use trailing */ on a separate line when it is a block comment.
This patch fixes the last of the checkpatch warnings for the file.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:49:09 -08:00
Janani Ravichandran b3d0ea8d80 staging: speakup: Eliminate commented out code
This patch removes commented out code as it contributes to code clutter.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 20:00:30 -08:00
Samuel Thibault 327b882d3b Staging: speakup: Fix getting port information
Commit f79b0d9c22 ("staging: speakup: Fixed warning <linux/serial.h>
instead of <asm/serial.h>") broke the port information in the speakup
driver: SERIAL_PORT_DFNS only gets defined if asm/serial.h is included,
and no other header includes asm/serial.h.

We here make sure serialio.c does get the arch-specific definition of
SERIAL_PORT_DFNS from asm/serial.h, if any.

Along the way, this makes sure that we do have information for the
requested serial port number (index)

Fixes: f79b0d9c22 ("staging: speakup: Fixed warning <linux/serial.h> instead of <asm/serial.h>")
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: stable <stable@vger.kernel.org> # 3.18
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-01-28 22:55:40 -08:00
Shraddha Barke 114885e08c Staging: speakup: serialio.c: Remove explicit NULL comparison
Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:25:00 -07:00
Aleksei Fedotov 13d825edd4 staging: speakup: Fix warning reported by checkpatch
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-08-14 17:38:16 -07:00
Domagoj Trsan 8e69a81106 staging: speakup: fix missing blank lines after declarations
Signed-off-by: Domagoj Trsan <domagoj.trsan@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-11 14:54:51 -07:00
Keerthimai Janarthanan 3a046c1915 staging: speakup: Prefer pr_err instead of printk(KERN_ERR)
Prefer pr_err instead of printk(KERN_ERR)

Signed-off-by: Keerthimai Janarthanan <keerthimaipb@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-18 11:13:37 -07:00
Chen Gang 5e6dc548e4 drivers: staging: speakup: serialio: only use platform specific SERIAL_PORT_DFNS.
If SERIAL_PORT_DFNS isn't present by platform, it need be defined to
"nothing", like the 8250 serial driver does it.

All related macros also need be removed: IRQF_SHARED is defined in
"linux/interrupt.h", others will be defined when related architecture
has SERIAL_PORT_DFNS.

Or it will cause issue (for arc, with allmodconfig):

    CC [M]  drivers/staging/speakup/serialio.o
  drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant
    SERIAL_PORT_DFNS
    ^
  drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[0].baud_base')
  drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant
  drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[1].baud_base')
  drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant
  drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[2].baud_base')
  drivers/staging/speakup/serialio.c:12:2: error: initializer element is not constant
  drivers/staging/speakup/serialio.c:12:2: error: (near initialization for 'rs_table[3].baud_base')

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-11-11 16:22:17 -08:00
William Hubbs 9fb31b1abd staging: speakup: serialio: remove custom locking macros
Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-16 16:11:09 -07:00
Samuel Thibault ca2beaf84d staging: speakup: Prefix externally-visible symbols
This prefixes all externally-visible symbols of speakup with "spk_".

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:06:31 -08:00
Jiri Slaby 3ee0017e03 TTY: speakup, do not use serialP
The structures there are going away. And speakup has enough troubles
already.

So define a structure similar to what 8250 does: old_serial_port.
There define an array of speed, port base and so on needed for
configuration. Then use this structure instead of serial_state defined
in serialP.h.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: William Hubbs <w.d.hubbs@gmail.com>
Cc: Chris Brannon <chris@the-brannons.com>
Cc: Kirk Reiser <kirk@braille.uwo.ca>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08 11:47:02 -08:00
William Hubbs baf9ac9ff8 staging: speakup: serialio.c style fixes
fix issues reported by checkpatch.pl

Signed-off-by: William Hubbs <w.d.hubbs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-19 10:06:05 -07:00
Randy Dunlap 0a652b9628 staging: speakup: fix printk format warning
Fix printk format warning:

drivers/staging/speakup/serialio.c:44: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'long unsigned int'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <speakup@braille.uwo.ca>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-14 12:14:10 -07:00
Tracey Dent ef999f10a6 Staging: speakup: serialio: Fixed errors in file
On line 40 printk() needed an KERN_* facility level, so I gave it
INFO. Also, fixed a C99 comment error.

Signed-off-by: Tracey Dent <tdent48227@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-08 19:49:26 -07:00
William Hubbs c6e3fd22cd Staging: add speakup to the staging directory
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>
2010-10-07 19:22:31 -07:00