Input: adc-joystick - handle inverted axes
authorChris Morgan <macromorgan@hotmail.com>
Fri, 19 Jan 2024 08:19:08 +0000 (00:19 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 7 Jun 2024 19:29:32 +0000 (12:29 -0700)
commit6560cfcfb46511d47893d6e3994ce1d3c58ddf7f
treeddff8af596d9c90270e0837911c7e8ad66672e80
parent5bbcece640ef7570ca090a5b35af035fe4ecc7b1
Input: adc-joystick - handle inverted axes

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>
drivers/input/joystick/adc-joystick.c