aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/iforce (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-06Input: iforce - add sanity checksOliver Neukum1-0/+5
The endpoint type should also be checked before a device is accepted. Reported-by: syzbot+5efc10c005014d061a74@syzkaller.appspotmail.com Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Input: iforce - remove empty multiline commentsTim Schumacher6-18/+0
Those are remnants of the SPDX identifier migration, which haven't been removed properly. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-07-15Merge tag 'v5.2' into nextDmitry Torokhov8-78/+8
Sync up with mainline to resolve conflicts in iforce driver.
2019-06-22Input: iforce - add the Saitek R440 Force WheelTim Schumacher2-0/+2
This is added based on the fact that this is an iforce-based device and that the Windows driver for the R440 works for the Logitech WingMan Formula Force after replacing the device/vendor IDs. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use unaligned accessors, where appropriateDmitry Torokhov2-7/+12
Instead of open-coding conversion from/to little-endian, let's use proper accessors. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - drop couple of temps from transport codeDmitry Torokhov2-10/+4
Transport initialization code now deals mostly with transport-specific data, so we can drop couple of temporary variables. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - drop bus type from iforce structureDmitry Torokhov3-7/+0
It is not needed anymore as behavior is controlled by the transport operations set up for given device. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use DMA-safe buffores for USB transfersDmitry Torokhov3-15/+25
USB transport has to use cache line-aligned buffers for transfers to avoid DMA issues; serio doe snot have such restrictions. Let's move "data_in" buffer from main driver structure into transport modules and make sure USB requirements are respected. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - allow callers supply data buffer when fetching device IDsDmitry Torokhov4-30/+47
We want to move buffer handling into transport layers as the properties of buffers (DMA-safety, alignment, etc) are different for different transports. To allow this, let's allow caller to specify their own buffers for the results of iforce_get_id_packet() and let transport drivers to figure what buffers they need to use for transfers. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - only call iforce_process_packet() if initializedDmitry Torokhov2-4/+1
It is excessive to check if device is fully initialized in iforce_process_packet(), as for USB-conected devices we do not start collecting reports until the device is fully initialized. Let's change serio transport code to not call iforce_process_packet() until device initialization is done. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - signal command completion from transport codeDmitry Torokhov2-5/+6
Signalling command completion from iforce_process_packet() does not make sense, as not all transport use the same data path for both commands and motion data form the device, that is why USB code already has to signal command completion iforce_usb_out(). Let's move signalling completion into individual transport modules. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - do not combine arguments for iforce_process_packet()Dmitry Torokhov4-11/+13
Current code combines packet type and data length into single argument to iforce_process_packet() and then has to untangle it. It is much clearer to simply use separate arguments. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - factor out hat handling when parsing packetsDmitry Torokhov1-44/+57
This makes code clearer a bit. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - update formatting of switch statementsDmitry Torokhov3-100/+100
According to our coding style case labels in switch statements should be aligned with the switch keyword. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - use DMA-safe buffer when getting IDs from USBDmitry Torokhov1-46/+22
When working with USB devices we need to use DMA-safe buffers, and iforce->edata is not one. Let's rework the code to allocate temporary buffer (iforce_get_id() is called only during initialization so there is no reason to have permanent buffer) and use it. While at it, let's utilize usb_control_msg() API which simplifies code. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - split into core and transport modulesDmitry Torokhov7-43/+25
Now that we have moved enough transport details into separate source files we can change them into transport modules so that they are only loaded when needed. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - move transport data into transport modulesDmitry Torokhov3-104/+144
This moves transport-specific data from main iforce structure into transport modules. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - add bus type and parent arguments to iforce_init_device()Dmitry Torokhov4-18/+8
Note that the parent device for the USB-connected controllers is now USB interface instead of USB device. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - introduce start and stop io transport opsDmitry Torokhov4-23/+34
Add start_io() and stop_io() transport methods so that core does not have to know the details. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - move command completion handling to serio codeDmitry Torokhov2-8/+11
Continue teasing apart protocol-specific bits from core into transport modules. This time move RS232-specific command completion handling from core to iforce-serio module. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - move get_id to the transport operationsDmitry Torokhov4-65/+51
To avoid #ifdef-ing out parts of the code and having conditionals in normal control flow, let's define "get_id" transport method and move implementation into respective transport modules. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - introduce transport opsDmitry Torokhov4-28/+29
In order to tease apart the driver into core and transport modules, let's introduce transport operations and make "xmit" the very first one such operation. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-06-22Input: iforce - remove "being used" sillinessDmitry Torokhov1-10/+1
The kernel is supposed to handle multiple devices, static flags in packet handling code will never work. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner6-78/+6
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21treewide: Add SPDX license identifier - Makefile/KconfigThomas Gleixner2-0/+2
Add SPDX license identifiers to all Make/Kconfig files which: - Have no license information of any form These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-18Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds6-52/+16
Pull input updates from Dmitry Torokhov: - a new driver for Rohm BU21029 touch controller - new bitmap APIs: bitmap_alloc, bitmap_zalloc and bitmap_free - updates to Atmel, eeti. pxrc and iforce drivers - assorted driver cleanups and fixes. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits) MAINTAINERS: Add PhoenixRC Flight Controller Adapter Input: do not use WARN() in input_alloc_absinfo() Input: mark expected switch fall-throughs Input: raydium_i2c_ts - use true and false for boolean values Input: evdev - switch to bitmap API Input: gpio-keys - switch to bitmap_zalloc() Input: elan_i2c_smbus - cast sizeof to int for comparison bitmap: Add bitmap_alloc(), bitmap_zalloc() and bitmap_free() md: Avoid namespace collision with bitmap API dm: Avoid namespace collision with bitmap API Input: pm8941-pwrkey - add resin entry Input: pm8941-pwrkey - abstract register offsets and event code Input: iforce - reorganize joystick configuration lists Input: atmel_mxt_ts - move completion to after config crc is updated Input: atmel_mxt_ts - don't report zero pressure from T9 Input: atmel_mxt_ts - zero terminate config firmware file Input: atmel_mxt_ts - refactor config update code to add context struct Input: atmel_mxt_ts - config CRC may start at T71 Input: atmel_mxt_ts - remove unnecessary debug on ENOMEM Input: atmel_mxt_ts - remove duplicate setup of ABS_MT_PRESSURE ...
2018-07-27Input: iforce - reorganize joystick configuration listsTim Schumacher1-14/+5
* btn_avb_pegasus and btn_avb_tw are the same. Unify them into btn_joystick_avb. * btn_wheel is an exact copy of btn_joystick, so remove it. Rename btn_avb_wheel into btn_wheel since it is the only sane configuration for a wheel. * Assign the (new) btn_wheel configuration to the "AVB Top Shot Force Feedback Racing Wheel", because the previous configuration was meant for a joystick. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-27Input: iforce - assign BTN_DEAD only for specific devicesTim Schumacher1-5/+6
Move BTN_DEAD into the arrays with the specific button sets instead of assigning it for every iforce device. BTN_DEAD represents an optical sensor which detects if the user is interacting with the device. On devices without that optical sensor BTN_DEAD is repeatedly causing false inputs on every status update of the joystick. Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-26Input: iforce - reformat the packet dump outputTim Schumacher4-11/+7
Previously, packets that have been dumped are shown in the kernel log like this: drivers/input/joystick/iforce/iforce-packets.c: info cmd = ff04, data = 56 02 04 00 Use dev_dbg to dump the packages only when requested and to list the parent device as well. Use printf logic to generate the hexdump instead of looping through every char that needs to be printed (which in turn fixes the unnecessary newlines and looks more clean in general). The resulting package dump output does now look like this: usb 2-8: iforce_dump_packet info cmd = ff04, data = 56 02 04 00 Signed-off-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-26Input: stop telling users to snail-mail VojtechDmitry Torokhov6-24/+0
I do not think Vojtech wants snail mail these days (and he mentioned that nobody has ever sent him snail mail), and the address is not even valid anymore, so let's remove snail-mail instructions from the sources. Acked-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-07-04Input: iforce - use GFP_KERNEL in iforce_get_id_packet()Sebastian Andrzej Siewior1-1/+1
iforce_get_id_packet() invokes wait_event_interruptible_timeout() which means it has to be in non-atomic context at that point, thus we can use GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-15docs: fix broken references with multiple hintsMauro Carvalho Chehab1-2/+2
The script: ./scripts/documentation-file-ref-check --fix Gives multiple hints for broken references on some files. Manually use the one that applies for some files. Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: James Morris <james.morris@microsoft.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
2017-08-18Input: iforce - constify serio_device_idArvind Yadav1-1/+1
serio_device_id are not supposed to change at runtime. All functions working with serio_device_id provided by <linux/serio.h> work with const serio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-08-07Input: iforce - constify usb_device_id and fix space before '[' errorArvind Yadav1-1/+1
usb_device_id are not supposed to change at runtime. All functions working with usb_device_id provided by <linux/usb.h> work with const usb_device_id. So mark the non-const structs as const. Fix checkpatch.pl error: ERROR: space prohibited before open square bracket '['. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-16Input: iforce - validate number of endpoints before using themJohan Hovold1-0/+3
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer or accessing memory that lie beyond the end of the endpoint array should a malicious device lack the expected endpoints. Signed-off-by: Johan Hovold <johan@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2014-01-06Input: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
None of these files are actually using any __init type directives and hence don't need to include <linux/init.h>. Most are just a left over from __devinit and __cpuinit removal, or simply due to code getting copied from one driver to the next. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2012-05-04USB: input: iforce: fix up dev_* messagesGreg Kroah-Hartman3-5/+7
Previously I had made the struct device point to the input device, but after talking with Dmitry, he said that the USB device would make more sense for this driver to point to. So converted it to use that instead. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01USB: iforce: remove dbg() usageGreg Kroah-Hartman2-8/+12
dbg() was a very old USB-specific macro that should no longer be used. This patch removes it from being used in the driver and uses dev_dbg() instead. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-01USB: input: joystick: iforce: fix up dev_err() usagesGreg Kroah-Hartman2-2/+2
We should always reference the input device for dev_err(), not the USB device. Fix up the places where I got this wrong. Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25USB: iforce: remove err() usageGreg Kroah-Hartman3-6/+12
err() was a very old USB-specific macro that I thought had gone away. This patch removes it from being used in the driver and uses dev_err() instead. Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2010-11-22Input: iforce - clean up MakefileDmitry Torokhov1-12/+3
Use <module>-y notation to specify list of objects comprising iforce module and conditionally pull in USB and RS232 support. Also remove custom compiler flags and rely on general makefile rules for enabling warnings. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-05-10Input: iforce - fix Guillemot Jet Leader 3D entryMarek Vasut1-1/+1
USB ID entry for "Guillemot Jet Leader 3D" in iforce-main.c did not match one used in iforce-usb.c Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-05-10Input: iforce - add Guillemot Jet Leader Force FeedbackMarek Vasut2-0/+5
This device features a RUDDER on the knob. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-30Input: iforce - wait for command completion when closing the deviceDmitry Torokhov2-0/+4
We need to wait for the command to disable FF effects to complete before continuing with closing the device. Tested-by: Johannes Ebke <johannes.ebke@physik.uni-muenchen.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-24Input: iforce - fix oops on device disconnectDmitry Torokhov3-44/+12
Do not try to free iforce device when we closing input device; disconnect is the only place where it should be deleted. Reported-by: Johannes Ebke <johannes.ebke@physik.uni-muenchen.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-08-19Input: iforce - support new revision of ACT LABS Force RSJiri Kosina2-0/+2
Reported-by: cemede@gmail.com Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-10-17USB: remove warn() macro from usb input driversGreg Kroah-Hartman4-23/+37
USB should not be having it's own printk macros, so remove warn() and use the system-wide standard of dev_warn() wherever possible. In the few places that will not work out, use a basic printk(). Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-20Input: remove CVS keywordsAdrian Bunk6-12/+0
This patch removes CVS keywords that weren't updated for a long time from comments. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-05-16Input: replace remaining __FUNCTION__ occurrencesHarvey Harrison1-3/+3
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-04-28usb input endianness annotations and fixesAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>