mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Siarhei Volkau <lis8215@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Artur Rojek <contact@artur-rojek.eu>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/2] Input: adc-joystick: add detachable devices support
Date: Sat, 05 Nov 2022 23:39:32 +0000	[thread overview]
Message-ID: <W1FWKR.P26T1W42X3ND@crapouillou.net> (raw)
In-Reply-To: <20221031190159.1341027-1-lis8215@gmail.com>

Hi Siarhei,

Le lun. 31 oct. 2022 à 22:01:57 +0300, Siarhei Volkau 
<lis8215@gmail.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



  parent reply	other threads:[~2022-11-05 23:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 19:01 Siarhei Volkau
2022-10-31 19:01 ` [RFC PATCH 1/2] dt-bindings: adc-joystick: add valid-range Siarhei Volkau
2022-10-31 22:05   ` Rob Herring
2022-11-01  1:08     ` Rob Herring
2022-11-01  8:07       ` Siarhei Volkau
2022-10-31 19:01 ` [RFC PATCH 2/2] Input: adc-joystick - add detachable devices support Siarhei Volkau
2022-11-05 23:39 ` Paul Cercueil [this message]
2022-11-06  8:47   ` [RFC PATCH 0/2] Input: adc-joystick: " Siarhei Volkau
2022-11-06 15:22     ` Siarhei Volkau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=W1FWKR.P26T1W42X3ND@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=contact@artur-rojek.eu \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lis8215@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®