Commit Graph

35 Commits

Author SHA1 Message Date
Greg Kroah-Hartman d6d69c824e staging: nvec: remove redundant license text
Now that the SPDX tag is in all drivers/staging/nvec/ 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: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Greg Kroah-Hartman 971bcfca1f staging: nvec: 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 staging nvec driver to have a proper SPDX identifiers, 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: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-15 16:03:45 +01:00
Arushi Singhal cf13a747b1 staging:nvec:nvec_ps2.c: Prefering kzalloc(sizeof(*ser_dev)...) over kzalloc(sizeof(struct serio)...)
Prefer kzalloc(sizeof(*ser_dev)...) over kzalloc(sizeof(struct
serio)...) as reported by checkpatch.pl.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-14 09:26:26 -08:00
Marc Dietrich 68fae2f3df staging: nvec: remove managed resource from PS2 driver
This basicly reverts commit e534f3e9 (staging:nvec: Introduce the use of
the managed version of kzalloc). Serio struct should never by managed
because it is refcounted. Doing so will lead to a double free oops on module
remove.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Fixes: e534f3e942 ("staging:nvec: Introduce the use of the managed version of kzalloc")
Cc: stable <stable@vger.kernel.org> # 3.15+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 11:48:25 +01:00
Paul Fertser 17c1c9ba15 Revert "staging: nvec: ps2: change serio type to passthrough"
This reverts commit 36b30d6138.

This is necessary to detect paz00 (ac100) touchpad properly as one
speaking ETPS/2 protocol. Without it X.org's synaptics driver doesn't
work as the touchpad is detected as an ImPS/2 mouse instead.

Commit ec6184b1c7 changed the way
auto-detection is performed on ports marked as pass through and made the
issue apparent.

A pass through port is an additional PS/2 port used to connect a slave
device to a master device that is using PS/2 to communicate with the
host (so slave's PS/2 communication is tunneled over master's PS/2
link). "Synaptics PS/2 TouchPad Interfacing Guide" describes such a
setup (PS/2 PASS-THROUGH OPTION section).

Since paz00's embedded controller is not connected to a PS/2 port
itself, the PS/2 interface it exposes is not a pass-through one.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Fixes: 36b30d6138 ("staging: nvec: ps2: change serio type to passthrough")
Cc: stable <stable@vger.kernel.org> # 3.4+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 11:48:25 +01:00
Paul Fertser d8f8a74d5f drivers: staging: nvec: remove bogus reset command for PS/2 interface
This command was sent behind serio's back and the answer to it was
confusing atkbd probe function which lead to the elantech touchpad
getting detected as a keyboard.

To prevent this from happening just let every party do its part of the
job.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Cc: stable <stable@vger.kernel.org> # 3.4+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07 11:48:25 +01:00
Ben Marsh 0df8f51eed Staging: nvec: removes an unnecessary cast on a void pointer
Patch to nvec_ps2.c to remove an unnecessary cast on a void pointer.

Signed-off-by: Ben Marsh <bmarsh94@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Peng Fan 716baa7b43 staging: nvec: remove duplicated const
Sparse checking warning:
"drivers/staging/nvec/nvec_ps2.c:172:14: warning: duplicate const".
Remove the duplicated const to fix the warning.

Signed-off-by: Peng Fan <van.freenix@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:30:40 -07:00
Somya Anand 4c42d97981 Staging: nvec: use !x instead of x == NULL
Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
Generally, When NULL represents failure, !x is commonly used.

This patch cleans up the tests on the results of these functions, thereby
using !x instead of x == NULL or NULL == x. This is done via following
coccinelle script:
@prob_7@
identifier x;
statement S;
@@

(
 x = devm_kzalloc(...);
|
 x = usb_alloc_urb(...);
|
 x = kmalloc_array(...);
|
 x = devm_ioremap(...);
|
 x = alloc_netdev(...);
)
 ...
- if(NULL == x)
+ if(!x)
        S
Further we have used isomorphism characteristics of coccinelle to
indicate x == NULL and NULL == x are equivalent. This is done via
following iso script.

Expression
@ is_null @ expression X; @@
X == NULL <=> NULL == X

Signed-off-by: Somya Anand <somyaanand214@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:28:47 +01:00
Wolfram Sang d5dbc0245a staging: nvec: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:21:41 +02:00
Pawel Lebioda fa79961786 staging: nvec: insert blank lines after declarations
This patch fixes coding style warnings reported by checkpatch.pl:
"Missing a blank line after declarations".

Signed-off-by: Pawel Lebioda <pawel.lebioda89@gmail.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 12:14:06 -07:00
Himangi Saraogi e534f3e942 staging:nvec: Introduce the use of the managed version of kzalloc
This patch moves shared private data kzalloc to managed devm_kzalloc.
There are no kfree statements associated with this data, so using devm
adds the possibility of the data being freed, if the proble function
fails (if that is possible) or if the remove function succeeds.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 15:19:36 -08:00
Marc Dietrich c2b62f60f6 staging: nvec: cleanup childs on remove
Disable device functions and unregister notifier if available. The
serio device must not be "kzallocated". Otherwise serio_unregister_port
will fail because the device is already freed.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-14 07:07:50 -04:00
Marc Dietrich 99758dec95 staging: nvec: add missing module aliases
Keyboard and mouse drivers were missing MODULE_ALIAS
definitions. This fixes auto module loading of these
drivers.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-14 07:07:50 -04:00
Marc Dietrich 93eff83ff1 staging: nvec: cleanup the string mess
Replace the various command strings by named constants.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:25:10 -05:00
Marc Dietrich 85a90528b2 staging: nvec: fix mouse suspend/resume calls
The EC command for enable/disable is not an EC command. Instead it needs
to be send to the mouse.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:25:09 -05:00
Bill Pemberton 1a6a8a8414 staging: nvec: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:23:51 -08:00
Bill Pemberton 46620803c3 staging: nvec: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:23:51 -08:00
Bill Pemberton 44b90a3fbc staging: nvec: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:23:51 -08:00
Marc Dietrich 3cdde3a3d5 staging: nvec: add remove function to nvec childs
This patch cleanups registered devices on remove.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:38 -07:00
Marc Dietrich ebefae28ce staging: nvec: cleanup powermanagement callbacks
Simplify powermanagement initialization by using pm_ops macro.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich 9891b1ce62 staging: nvec: cleanup driver registration
This patch simplifies code by using the module_platform_driver
macro.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich f5e3352e51 staging: nvec: convert to devm_ functions
This patch cleanups the nvec and its childs by replacing calls to
resource allocations by their devm_* equivalents.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-25 10:55:37 -07:00
Marc Dietrich 36b30d6138 staging: nvec: ps2: change serio type to passthrough
This changes the serio type of the nvec_ps2 mouse port to passthrough.
The old 8042 type seems appropiete for keyboards only.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:59 -08:00
Marc Dietrich a573298b81 staging: nvec: ps2: disable/enable mouse on suspend/resume
This change makes the touchpad buttons work after suspend/resume.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:58 -08:00
Marc Dietrich 0eedab704e staging: nvec: ps2: add some more debug functions
This can print the mouse traffic which goes over the i2c bus. Make
mouse debugging messages configurable and disable them by default.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:58 -08:00
Marc Dietrich 4b625c3abe staging: nvec: ps2: tell nvec to send 6 byte long messages
This packet size used on most modern touchpads. Ideally, this should
be configurable or autodetected.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:58 -08:00
Marc Dietrich 34ba143b9d staging: nvec: ps2: let the start/stop streaming commands be called by the start/stop functions of serio
Instead of executing these commands during open/close, the start/stop
event of the serio device seem to be more appropiete.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:57 -08:00
Marc Dietrich d1b5342c1f staging: nvec: ps2: add suspend/resume functions
This adds suspend and resume functions to the nvec_ps2 mouse driver.

During suspend the nvec sends a "Cancel all mouse events" command. If
this is missed, there will be still some bytes in the received buffer
after resume which make the mouse go out of sync.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31 10:27:57 -08:00
Julian Andres Klode 1e46e6273b staging: nvec: ps2: Always sample 4 bytes instead of just 1
Get 4 bytes of data from nvec at once instead of just a single
byte. This makes the driver more similar to nvidias and might
improve reliability.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:38 -07:00
Julian Andres Klode ff006d1266 staging: nvec: Return error in PS2 driver if write fails
Return the return value of nvec_write_async() in the methods
returning an int.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:41:38 -07:00
Marc Dietrich 162c7d8c4b staging: nvec: coding style fixes / add copyright notice
This patch fixes coding style and adds copyright notices.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
[jak@jak-linux.org: Merge later cleanup into that patch]
Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:40:37 -07:00
Julian Andres Klode 7974035c00 staging: nvec: Include missing headers
Those headers were apparently included by other headers
previously, but are not anymore.

Signed-off-by: Julian Andres Klode <jak@jak-linux.org>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29 17:39:30 -07:00
Marc Dietrich f686e9affb staging: nvec: convert to use platform register and mfdcells
This patch converts the nvec to use mfd cells and improves the
registration of the platform driver. The child drivers are also
converted to use mfd cells and platform registration.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-24 14:25:30 -07:00
Marc Dietrich 32890b9830 Staging: initial version of the nvec driver
This is an implementation of a NVidia compliant embedded controller
protocol driver. It is used on some ARM-Tegra boards for device
communication.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-19 15:36:10 -07:00