[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <W1FWKR.P26T1W42X3ND@crapouillou.net>
Date: Sat, 05 Nov 2022 23:39:32 +0000
From: Paul Cercueil <paul@...pouillou.net>
To: Siarhei Volkau <lis8215@...il.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Artur Rojek <contact@...ur-rojek.eu>,
linux-input@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 0/2] Input: adc-joystick: add detachable devices
support
Hi Siarhei,
Le lun. 31 oct. 2022 à 22:01:57 +0300, Siarhei Volkau
<lis8215@...il.com> a écrit :
> For detachable or lock-able joysticks the ADC lanes might
> be biased to GND or AVDD when the joystick is detached/locked.
>
> One such kind of joystick is found in the Ritmix RZX-50 handheld.
> The joystick is non-detachable, although ADC lane biased to power
> supply when the "Hold" switch is activated.
But the RZX-50 has no joystick...
Or is the d-pad actually wired to the ADC instead of GPIOs?
> To avoid reporting old/broken measurements valid-range is introduced.
> When measured value is outside valid-range the driver reports
> safe center position for corresponding axis.
First of all, you already have a "valid range", it is called
"abs-range"; no need for a new one.
Then, the driver has no business doing events filtering. Notice that
when you activate the "hold" button and your joystick values go way
off-range, you still get input events in userspace: that's because the
kernel is not responsible for enforcing the deadzone, the userspace is.
In your case, you need to update your userspace applications/libraries
so that when the joystick values are way off-range, the assumed
position is the center.
Cheers,
-Paul
Powered by blists - more mailing lists