All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Golle <daniel@makrotopia.org>
To: Oleh Kuzhylnyi <kuzhylol@gmail.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Hendrik Noack <hendrik-noack@gmx.de>,
	Arnd Bergmann <arnd@arndb.de>,
	Ferass El Hafidi <funderscore@postmarketos.org>,
	Uwe Kleine-Koenig <u.kleine-koenig@baylibre.com>,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Chad Monroe <chad@monroe.io>,
	John Crispin <john@phrozen.org>
Subject: Re: [PATCH v2 3/5] Input: hynitron-cst816x: release gesture keys
Date: Mon, 5 Oct 2026 18:07:51 +0100	[thread overview]
Message-ID: <asPZZ4Dk56iO7NYF@makrotopia.org> (raw)
In-Reply-To: <XXX-PASTE-MESSAGE-ID-OF-OLEHS-MAIL>

Hi!

Thank you for testing, and for reporting the issue.

> I suggest either gate the gesture branch on tch.active so a finger-up
> single-click never fires a key, or fix cst816x_gest_idx() to map 0x5/0xC
> to their own valid slots so they stop aliasing the TRIPLETAP keycode.

v3 takes the second route. cst816x_gest_idx() returned
CST816X_NUM_KEYS - 1 for every code its switch did not name, so single
click, 0x05, shared the long-press slot. Reporting the key with a
fixed value of 1 is what made that alias visible as the
BTN_TOOL_TRIPLETAP pair in your log.

The lookup now yields a keycode instead of an index:

  static unsigned int cst816x_gest_keycode(struct cst816x_priv *priv,
                                           u8 gest)
  {
          switch (gest) {
          case 0x01: /* Slide up gesture */
          case 0x02: /* Slide down gesture */
          case 0x03: /* Slide left gesture */
          case 0x04: /* Slide right gesture */
                  return priv->keycode[gest - 1];
          case 0x0c: /* Long press gesture */
                  return priv->keycode[CST816X_NUM_KEYS - 1];
          default:
                  return KEY_RESERVED;
          }
  }

A code the driver does not map is handled like a report that carries
no gesture code at all: it releases whatever the input core still
holds down, rather than pressing a key that belongs to another
gesture. Single click reports nothing of its own, so a tap is
described by BTN_TOUCH alone.

I left the gate on tch.active out, because your trace shows the
gesture codes arriving with t: 0 on both the finger-down and the
finger-up report, and that t is tch.active. Slide gestures reach the
driver the same way, at lift, so the gate would silence the keys this
series is meant to report, not only the single click.

If a key for single click is wanted, that is a linux,keycodes
extension in the binding and can follow on its own.

v3 with that change follows. A retest on your CST816S would be most
welcome.

  parent reply	other threads:[~2026-10-05 17:08 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 12:47 [PATCH v2 0/5] Input: hynitron-cst816x: axes, gesture keys and panel power Daniel Golle
2026-10-02 12:47 ` [PATCH v2 1/5] dt-bindings: input: touchscreen: hynitron,cst816x: axes and panel Daniel Golle
2026-10-04  7:24   ` Krzysztof Kozlowski
2026-10-04  7:29     ` Daniel Golle
2026-10-04  7:33       ` Krzysztof Kozlowski
2026-10-02 12:47 ` [PATCH v2 2/5] Input: hynitron-cst816x: respect touchscreen DT properties Daniel Golle
2026-10-04 20:30   ` Oleh Kuzhylnyi
2026-10-02 12:47 ` [PATCH v2 3/5] Input: hynitron-cst816x: release gesture keys Daniel Golle
2026-10-04 21:36   ` Oleh Kuzhylnyi
     [not found]   ` <XXX-PASTE-MESSAGE-ID-OF-OLEHS-MAIL>
2026-10-05 17:07     ` Daniel Golle [this message]
2026-10-02 12:48 ` [PATCH v2 4/5] Input: hynitron-cst816x: time out gesture key release Daniel Golle
2026-10-02 13:14   ` sashiko-bot
2026-10-02 12:48 ` [PATCH v2 5/5] Input: hynitron-cst816x: power sequence with the panel Daniel Golle
2026-10-02 13:26   ` sashiko-bot

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=asPZZ4Dk56iO7NYF@makrotopia.org \
    --to=daniel@makrotopia.org \
    --cc=arnd@arndb.de \
    --cc=chad@monroe.io \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=funderscore@postmarketos.org \
    --cc=hendrik-noack@gmx.de \
    --cc=john@phrozen.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuzhylol@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.