aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-10-05Input: analog - fix invalid snprintf() callArnd Bergmann1-8/+10
Overlapping input and output arguments to snprintf() are undefined behavior in C99: drivers/input/joystick/analog.c: In function 'analog_name': drivers/input/joystick/analog.c:428:3: error: 'snprintf' argument 4 overlaps destination object 'analog' [-Werror=restrict] 428 | snprintf(analog->name, sizeof(analog->name), "%s %d-hat", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 429 | analog->name, hweight16(analog->mask & ANALOG_HATS_ALL)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/input/joystick/analog.c:420:40: note: destination object referenced by 'restrict'-qualified argument 1 was declared here 420 | static void analog_name(struct analog *analog) | ~~~~~~~~~~~~~~~^~~~~~ Change this function to use the simpler seq_buf interface instead. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210927101416.1569609-1-arnd@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20Input: tmdc - fix spelling mistake "Millenium" -> "Millennium"Colin Ian King1-1/+1
There is a spelling mistake in the name of a joystick. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20210920184748.18519-1-colin.king@canonical.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-07-18Merge tag 'v5.13' into nextDmitry Torokhov1-0/+2
Sync up with the mainline to get the latest parport API.
2021-06-18Input: add SparkFun Qwiic Joystick driverOleh Kravchenko3-0/+156
A simple analog joystick built on Low Power ATtiny85 Microcontroller. Directional movements are measured with two 10 kΩ potentiometers connected with a gimbal mechanism that separates the horizontal and vertical movements. This joystick also has a select button that is actuated when the joystick is pressed down. Input events polled over the I2C bus. Product page: https://www.sparkfun.com/products/15168 Firmware and hardware sources: https://github.com/sparkfun/Qwiic_Joystick Tested on RPi4B and O4-iMX-NANO boards. Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua> Reviewed-by: Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/20210608223130.16830-2-oleg@kaa.org.ua Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-05-06Input: xpad - add support for Amazon Game ControllerMatt Reynolds1-0/+2
The Amazon Luna controller (product name "Amazon Game Controller") behaves like an Xbox 360 controller when connected over USB. Signed-off-by: Matt Reynolds <mattreynolds@chromium.org> Reviewed-by: Harry Cutts <hcutts@chromium.org> Link: https://lore.kernel.org/r/20210429103548.1.If5f9a44cb81e25b9350f7c6c0b3c88b4ecd81166@changeid Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-03-09Input: n64joy - fix return value check in n64joy_probe()Wei Yongjun1-2/+2
In case of error, the function devm_platform_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 3bdffa8ffb45 ("Input: Add N64 controller driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Lauri Kasanen <cand@gmx.com> Link: https://lore.kernel.org/r/20210308122856.2177071-1-weiyongjun1@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-02-22Merge branch 'next' into for-linusDmitry Torokhov3-1/+353
Prepare input updates for 5.12 merge window.
2021-02-22Merge tag 'v5.11' into nextDmitry Torokhov1-1/+18
Merge with mainline to get latest APIs and device tree bindings.
2021-02-16Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|SOlivier Crête1-0/+1
Signed-off-by: Olivier Crête <olivier.crete@ocrete.ca> Link: https://lore.kernel.org/r/20210204005318.615647-1-olivier.crete@collabora.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-24Input: Add N64 controller driverLauri Kasanen3-1/+353
This adds support for the four built-in controller ports on the Nintendo 64 console. The N64 controller includes an analog stick, a d-pad, and several buttons. No module support as the target has only 8mb ram. Signed-off-by: Lauri Kasanen <cand@gmx.com> Link: https://lore.kernel.org/r/20210115133408.0acd70163b582b77ad0a029b@gmx.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-01-24Input: xpad - sync supported devices with fork on GitHubBenjamin Valentin1-1/+16
There is a fork of this driver on GitHub [0] that has been updated with new device IDs. Merge those into the mainline driver, so the out-of-tree fork is not needed for users of those devices anymore. [0] https://github.com/paroj/xpad Signed-off-by: Benjamin Valentin <benpicco@googlemail.com> Link: https://lore.kernel.org/r/20210121142523.1b6b050f@rechenknecht2k11 Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-14Merge branch 'next' into for-linusDmitry Torokhov5-11/+10
Prepare input updates for 5.11 merge window.
2020-12-02Input: use input_device_enabled()Andrzej Pietrasiewicz1-2/+2
Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-30Input: xpad - support Ardwiino ControllersSanjay Govind1-0/+2
This commit adds support for Ardwiino Controllers Signed-off-by: Sanjay Govind <sanjay.govind9@gmail.com> Link: https://lore.kernel.org/r/20201201071922.131666-1-sanjay.govind9@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-19Input: xpad - demote non-conformant kernel-doc headerLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/input/joystick/xpad.c:1361: warning: Function parameter or member 'xpad' not described in 'xpad_send_led_command' drivers/input/joystick/xpad.c:1361: warning: Function parameter or member 'command' not described in 'xpad_send_led_command' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20201112110204.2083435-2-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-17Merge tag 'v5.9' into nextDmitry Torokhov3-7/+6
Sync up with mainline to bring in the latest DTS files.
2020-11-08Input: analog - fix formatting of error codeZhang Qilong1-1/+1
The location of the minus sign and the error code are linked together for better human view. Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com> Link: https://lore.kernel.org/r/20201027135020.66632-1-zhangqilong3@huawei.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-09-28Input: joystick - add ADC attached joystick driver.Artur Rojek3-0/+275
Add a driver for joystick devices connected to ADC controllers supporting the Industrial I/O subsystem. Signed-off-by: Artur Rojek <contact@artur-rojek.eu> Tested-by: Paul Cercueil <paul@crapouillou.net> Tested-by: Heiko Stuebner <heiko@sntech.de> Link: https://lore.kernel.org/r/20200927123302.31062-2-contact@artur-rojek.eu Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva2-3/+2
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
2020-08-10Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds4-18/+25
Pull input updates from Dmitry Torokhov: - an update to Elan touchpad controller driver supporting newer ICs with enhanced precision reports and a new firmware update process - an update to EXC3000 touch controller supporting additional parts - assorted driver fixups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (27 commits) Input: exc3000 - add support to query model and fw_version Input: exc3000 - add reset gpio support Input: exc3000 - add EXC80H60 and EXC80H84 support dt-bindings: touchscreen: Convert EETI EXC3000 touchscreen to json-schema Input: sentelic - fix error return when fsp_reg_write fails Input: alps - remove redundant assignment to variable ret Input: ims-pcu - return error code rather than -ENOMEM Input: elan_i2c - add ic type 0x15 Input: atmel_mxt_ts - only read messages in mxt_acquire_irq() when necessary Input: uinput - fix typo in function name documentation Input: ati_remote2 - add missing newlines when printing module parameters Input: psmouse - add a newline when printing 'proto' by sysfs Input: synaptics-rmi4 - drop a duplicated word Input: elan_i2c - add support for high resolution reports Input: elan_i2c - do not constantly re-query pattern ID Input: elan_i2c - add firmware update info for ICs 0x11, 0x13, 0x14 Input: elan_i2c - handle firmware updated on newer ICs Input: elan_i2c - add support for different firmware page sizes Input: elan_i2c - fix detecting IAP version on older controllers Input: elan_i2c - handle devices with patterns above 1 ...
2020-07-21Merge branch 'for-linus' into nextDmitry Torokhov1-0/+1
Sync up with 'for-linus' branch to resolve conflict in Elan touchpad driver.
2020-07-07Input: Use fallthrough pseudo-keywordGustavo A. R. Silva4-18/+25
Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20200707180857.GA30600@embeddedor Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-06-14treewide: replace '---help---' in Kconfig files with 'help'Masahiro Yamada1-4/+4
Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over '---help---'"), the number of '---help---' has been gradually decreasing, but there are still more than 2400 instances. This commit finishes the conversion. While I touched the lines, I also fixed the indentation. There are a variety of indentation styles found. a) 4 spaces + '---help---' b) 7 spaces + '---help---' c) 8 spaces + '---help---' d) 1 space + 1 tab + '---help---' e) 1 tab + '---help---' (correct indentation) f) 1 tab + 1 space + '---help---' g) 1 tab + 2 spaces + '---help---' In order to convert all of them to 1 tab + 'help', I ran the following commend: $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/' Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-09Input: adi - work around module name confictArnd Bergmann1-0/+1
Making module name conflicts a fatal error breaks sparc64 allmodconfig: Error log: error: the following would cause module name conflict: drivers/char/adi.ko drivers/input/joystick/adi.ko Renaming one of the modules would solve the problem, but then cause other problems because neither of them is automatically loaded and changing the name is likely to break any setup that relies on manually loading it by name. As there is probably no sparc64 system with this kind of ancient joystick attached, work around it by adding a Kconfig dependency that forbids them from both being modules. It is still possible to build the joystick driver if the sparc64 adi driver is built-in. Reported-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200609100643.1245061-1-arnd@arndb.de Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-04-22Input: xpad - add custom init packet for Xbox One S controllersŁukasz Patron1-0/+12
Sending [ 0x05, 0x20, 0x00, 0x0f, 0x06 ] packet for Xbox One S controllers fixes an issue where controller is stuck in Bluetooth mode and not sending any inputs. Signed-off-by: Łukasz Patron <priv.luk@gmail.com> Reviewed-by: Cameron Gutman <aicommander@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200422075206.18229-1-priv.luk@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-10-29Input: psxpad-spi - switch to using polled mode of input devicesDmitry Torokhov2-31/+34
We have added polled mode to the normal input devices with the intent of retiring input_polled_dev. This converts psxpad-spi driver to use the polling mode of standard input devices and removes dependency on INPUT_POLLDEV. Link: https://lore.kernel.org/r/20191001220421.GA66693@dtor-ws Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-09-05Input: sidewinder - make array seq static const, makes object smallerColin Ian King1-1/+1
Don't populate the array seq on the stack but instead make it static const. Makes the object code smaller by 30 bytes. Before: text data bss dec hex filename 22284 3184 0 25468 637c drivers/input/joystick/sidewinder.o After: text data bss dec hex filename 22158 3280 0 25438 635e drivers/input/joystick/sidewinder.o (gcc version 9.2.1, amd64) Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-11Merge tag 'v5.3-rc4' into nextDmitry Torokhov1-0/+5
Sync up with mainline to bring in device_property_count_u32 andother newer APIs.
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-22Input: add support for the FlySky FS-iA6B RC receiverMarkus Koch3-2/+244
This patch adds support for the FlySky FS-iA6B RC receiver (serial IBUS). It allows the usage of the FlySky FS-i6 and other AFHDS compliant remote controls as a joystick input device. To use it, a patch to inputattach which adds the FS-iA6B as a 115200 baud serial device is required. I will upstream it after this patch is merged. More information about the hardware can be found here: https://notsyncing.net/?p=blog&b=2018.linux-fsia6b Signed-off-by: Markus Koch <markus@notsyncing.net> 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 Torokhov37-400/+37
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>