aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/nvec (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-01-31staging: nvec: Fix Kconfig dependenciesJulian Andres Klode1-3/+3
nvec modules do not require other stuff to be build in, nor does nvec_ps2 require mouse support, only generic serio support. Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31staging: nvec: Use gpio_request_one() instead of gpio_request()Julian Andres Klode1-7/+6
This saves us some calls and thus makes the code shorter and nicer. Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31staging: nvec: Fix typo s/I2C_SL_NEWL/I2C_SL_NEWSL/Julian Andres Klode1-3/+3
The constant I2C_SL_NEWL meant "new slave", but the S was missing. Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-31staging: nvec: ps2: change serio type to passthroughMarc Dietrich1-1/+1
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-31staging: nvec: ps2: disable/enable mouse on suspend/resumeMarc Dietrich1-0/+8
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-31staging: nvec: ps2: add some more debug functionsMarc Dietrich1-5/+13
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-31staging: nvec: ps2: tell nvec to send 6 byte long messagesMarc Dietrich1-1/+1
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-31staging: nvec: ps2: let the start/stop streaming commands be called by the start/stop functions of serioMarc Dietrich1-2/+2
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-31staging: nvec: ps2: add suspend/resume functionsMarc Dietrich1-0/+19
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>
2011-11-26staging: nvec: add device tree supportMarc Dietrich1-2/+28
This adds device tree support to the nvec driver. By using this method it is no longer necessary to specify platform data through a board file. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Acked-by: Stephen Warren <swarren@nvidia.com> Cc: Julian Andres Klode <jak@jak-linux.org> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Olof Johansson <olof@lixom.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17staging/nvec: fix compilation error in nvec.cMarc Dietrich1-0/+1
This fixes a compilation error in nvec.c due to the missing module.h include. Signed-off-by: Marc Dietrich <marvin24@gmx.de> Cc: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29staging: nvec: send suspend messages synchronouslyMarc Dietrich1-2/+8
The suspend commands need to be sent using the synchronous method, otherwise the power gets disabled before the messages are transferred. Signed-off-by: Marc Dietrich <marvin24@gmx.de> [jak@jak-linux.org: Rewrote commit message] Signed-off-by: Julian Andres Klode <jak@jak-linux.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-29staging: nvec: Add a udelay(100) to nvec_interruptJulian Andres Klode1-0/+9
As the comment indicates, adding that udelay seems to improve the stability of the communication, although it is not known why this is the case. 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-29staging: nvec: Add missing includes and reorder themJulian Andres Klode2-14/+17
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-29staging: nvec: Add battery quirk to ignore incomplete responsesJulian Andres Klode1-0/+5
The nvec_power system polls nvec for battery information. In some cases, that part seems to be overloaded and unable to respond fast in which case it sends an incomplete response. We need to mark the transfer as completed, though, in order to prevent endless retries which can kill 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-29staging: nvec: ps2: Always sample 4 bytes instead of just 1Julian Andres Klode1-2/+3
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-29staging: nvec: Return error in PS2 driver if write failsJulian Andres Klode1-5/+2
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-29staging: nvec: Reject incomplete messagesJulian Andres Klode1-1/+6
Reject incomplete messages, causing the request to be transmitted again. This should fix various problems out there. 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-29staging: nvec: Handle filled up RX buffersJulian Andres Klode1-0/+5
If no RX buffer is available in state 1, jump to state 0 again. This will produce an incredible amount of warnings, but it is not supposed to happen anyway. 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-29staging: nvec: Allow TX buffers only in the upper 75% of the poolJulian Andres Klode1-6/+25
Allow TX buffers to be allocated only in the upper 75% of the pool to avoid a completely filled buffer preventing the driver from processing responses. This also improves performance, as RX allocations do not require checking buffers allocated for TX unless there are more than 16 incoming messages -- which is highly unlikely. An earlier version used the lower 75% for TX messages, but that was considered to be not that effective due to the overlaps of RX and TX buffers mentioned above. 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-29staging: nvec: Export nvec_msg_free() to clientsJulian Andres Klode2-2/+7
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-29staging: nvec: Move implementation-only macros out of the headerJulian Andres Klode2-21/+20
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-29staging: nvec: Document public and private APIJulian Andres Klode2-4/+191
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-29staging: nvec: Have nvec_write_async() return -ENOMEM on OOMJulian Andres Klode2-3/+10
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-29staging: nvec: Enable the capslock LED in the keyboard driverJulian Andres Klode1-0/+19
When the caps lock key is pressed, toggle the associated LED. According to Nvidia code, we should send 0x01 where we sent 0x07, but this does not appear to work correctly on the AC100. 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-29staging: nvec: Add myself to copyright and authors listJulian Andres Klode1-0/+1
Forgotten in the last commit(s) which contained the copyrightable material, so let's add it now. I believe that only my nvec.c contributions are copyrightable, nvec.h is just interface naming, so does not deserve that yet. 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-29staging: nvec: Do not print free message for tx_scratchJulian Andres Klode1-1/+2
The scratch area is not part of the pool and thus gets no allocation message. Printing a free message would be confusing, and the pointer subtraction would be undefined behavior. 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-29staging: nvec: Rewrite the interrupt handlerJulian Andres Klode3-142/+307
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-29staging: nvec: Add is_event() and size() functions for nvec_msgJulian Andres Klode1-0/+31
Add functions nvec_msg_is_event() and nvec_msg_size() which do just what the say: tell whether the message is an event, and getting the size of the message. 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-29staging: nvec: Introduce nvec_gpio_set_value()Julian Andres Klode1-0/+7
Introduce nvec_gpio_set_value(), which works like gpio_set_value(), but also creates a debugging message, if that's enabled. 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-29staging: nvec: Introduce new internal API for msg alloc/freeJulian Andres Klode2-0/+29
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-29staging: nvec: fix Kconfig dependenciesMarc Dietrich1-3/+3
This patch adds config dependencies for the NVEC keyboard, mouse, and power drivers. 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-29staging: nvec: update ToDo listMarc Dietrich1-0/+5
Mostly small stuff only. Hopefully completed during the next release cycle. Signed-off-by: Marc Dietrich <marvin24@gmx.de> [jak@jak-linux.org: Removed some items no longer valid] 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-29staging: nvec: add LED supportIlya Petrov5-2/+127
This patch adds support for LEDs connect to a nvec. A single brightness property is exported to sysfs. LEDs are selected via bitfields in the brightness value. Also the blinking behavior is selected through this method. Vendors may use different values for different HW designs. Signed-off-by: Ilya Petrov <ilya.muromec@gmail.com> Signed-off-by: Marc Dietrich <marvin24@gmx.de> [jak@jak-linux.org: Fixed checkpatch warnings] 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-29staging: nvec: fix unmute of speakersMarc Dietrich1-1/+1
The ec command used was for muting, not unmuting. Signed-off-by: Marc Dietrich <marvin24@gmx.de> 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-29staging: nvec: rework the nvec slave initMarc Dietrich1-8/+21
Rework the tegra slave controller init to look more like in tegra-i2c.c. This makes the nvec init reliable. Also add de-init of the slave to be used during suspend. Signed-off-by: Marc Dietrich <marvin24@gmx.de> 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-29staging: nvec: Use print_hex_dump() where appropriateMarc Dietrich1-13/+7
Split of the previous patch and the next by Marc, as that patch is not strictly a coding style fix only. 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-29staging: nvec: coding style fixes / add copyright noticeMarc Dietrich7-420/+521
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-29staging: nvec: Include missing headersJulian Andres Klode3-0/+3
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-08-24staging: nvec: convert to use platform register and mfdcellsMarc Dietrich4-81/+138
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-23Staging: nvec: fixes coding style issues in nvec_kbd.cColin Brophy1-11/+11
This patches nvec_kbd.c to the file that fixes up errors found by the checkpath.pl tool. Signed-off-by: Colin Brophy <colin@brophys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-02Staging: Add clk API note to nvec/TODORussell King1-2/+4
Add a note about the abuse of the clk API to the nvec/TODO list. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-20treewide: remove duplicate includesVitaliy Ivanov1-1/+0
Many stupid corrections of duplicated includes based on the output of scripts/checkincludes.pl. Signed-off-by: Vitaliy Ivanov <vitalivanov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-05-19Staging: initial version of the nvec driverMarc Dietrich10-0/+1540
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>