summaryrefslogtreecommitdiffstats
path: root/drivers/input/joystick/adc-joystick.c
Commit message (Collapse)AuthorAgeFilesLines
* Input: adc-joystick - move axes data into the main structureDmitry Torokhov2024-06-211-53/+61
| | | | | | | | | | | There is no need to allocate axes information separately from the main joystick structure so let's fold the allocation and also drop members (such as range, flat and fuzz) that are only used during initialization of the device. Acked-by: Artur Rojek <contact@artur-rojek.eu> Link: https://lore.kernel.org/r/ZmkrgTlxNwm_oHxv@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: adc-joystick - handle inverted axesChris Morgan2024-06-071-0/+20
| | | | | | | | | | | | | | | When one or more axes are inverted, (where min > max), normalize the data so that min < max and invert the values reported to the input stack. This ensures we can continue defining the device correctly in the device tree while not breaking downstream assumptions that min is always less than max. Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Acked-by: Artur Rojek <contact@artur-rojek.eu> Link: https://lore.kernel.org/r/20240115192752.266367-1-macroalpha82@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: adc-joystick - add polled input device supportChris Morgan2022-08-171-12/+53
| | | | | | | | | | | | Add polled input device support to the adc-joystick driver. This is useful for devices which do not have hardware capable triggers on their SARADC. Code modified from adc-joystick.c changes made by Maya Matuszczyk. Signed-off-by: Maya Matuszczyk <maccraft123mc@gmail.com> Signed-off-by: Chris Morgan <macromorgan@hotmail.com> Link: https://lore.kernel.org/r/20220816210440.14260-3-macroalpha82@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: adc-joystick - fix ordering in adc_joystick_probe()Dmitry Torokhov2022-08-021-7/+8
| | | | | | | | | | | We should register the IIO buffer before we register the input device, because as soon as the device is registered input handlers may attach to it, resulting in a call to adc_joystick_open() which makes use of the said buffer. Acked-by: Artur Rojek <contact@artur-rojek.eu> Link: https://lore.kernel.org/r/YskFh4NHnlcryMkk@google.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
* Input: joystick - add ADC attached joystick driver.Artur Rojek2020-09-281-0/+264
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>