Commit graph

19 commits

Author SHA1 Message Date
Tomás Tormo 73b37c91ac Staging: nvec: Modify the nvec_write_sync method to return the error code
Modify the nvec_write_sync function to return the error code
instead of the received message.

The received message is now returned as an output parameter.

Signed-off-by: Tomás Tormo <tomas.tormo@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:52:15 -08:00
Joe Perches ddc9bceb4c staging: nvec: Remove unnecessary externs
Using 'extern' is not necessary for function prototypes.

Miscellanea:

o Reflow alignments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14 18:51:56 -07:00
Stephen Warren c0df5bf536 staging: nvec: use reset framework
Tegra's clock driver now provides an implementation of the common
reset API (include/linux/reset.h). Use this instead of the old Tegra-
specific API; that will soon be removed.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Thierry Reding <treding@nvidia.com>
2013-12-11 16:44:10 -07:00
Marc Dietrich 2c6cbdd0ef staging: nvec: remove instantiating via platform device
Tegra has been converted to support device tree only. Remove support
for instantiating via platform device.

Signed-off-by: Leon Romanovsky <leon@leon.nu>
Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-24 15:59:03 -07:00
Marc Dietrich 218468f40d staging: nvec: implement unregistering of notifiers
This implements the unregistering of notifiers so kernel modules
can be unloaded.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 17:50:06 -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 518945fbfb staging: nvec: move toggle global event reporting to its own function
Cleanup toggle of global event reporting by moving it to its own function.
This simplifies the following cleanup.

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
Justin P. Mattock 535f2a5ffa staging:nvec:nvec.h Fix typos in staging:nvec
The below patch fixes a typo I found while reading.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Julian Andres Klode <jak@jak-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:29:21 -07:00
Julian Andres Klode 12b5a55d72 staging: nvec: Add missing includes and reorder them
Add the includes that are currently missing in nvec.h
and nvec.c and reorder them alphabetically.

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:39 -07:00
Julian Andres Klode 198dd26714 staging: nvec: Export nvec_msg_free() to clients
Client code wishing to make use of nvec_write_sync() must
have a way to free the returned pointer, otherwise we run
out of poool memory fairly soon.

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:36 -07:00
Julian Andres Klode 391d2fa95c staging: nvec: Move implementation-only macros out of the header
Those macros are needed only for implementation purposes and
do not have any use for other code wishing to use nvec.

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:36 -07:00
Julian Andres Klode bdf034d986 staging: nvec: Document public and private API
Add kernel-doc comments describing the functions
and structs we currently have.

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:35 -07:00
Julian Andres Klode 1b9bf629ea staging: nvec: Have nvec_write_async() return -ENOMEM on OOM
Change nvec_write_async() to return an integer, 0 by default,
a negative error on failure. Change nvec_write_sync() to
check the return value and abort if it is negative.

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:35 -07:00
Julian Andres Klode 0cab4cb852 staging: nvec: Rewrite the interrupt handler
Rewrite the interrupt handler to use a state machine similar to
that found in the various kernels for the Advent Vega. This also
changes the code to use the new functions introduced in the
previous commits.

This also merges the rewrite sent in August 2011 by Marc
Dietrich, and thus also includes code by him. His original
patch can be found on the mailing list.

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:33 -07:00
Julian Andres Klode 0b1076c4b2 staging: nvec: Introduce new internal API for msg alloc/free
Introduce two new functions nvec_msg_alloc() and nvec_msg_free()
that allocate and free message buffers from the internal pool
of messages.

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:40 -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