Linux Input/HID development
 help / color / mirror / Atom feed
From: Guillaume Casal <guillaume.casal.42@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	dbdaniel42@gmail.com
Subject: [PATCH 3/3] input: Add FF_TRIGGER_RUMBLE capability bit
Date: Thu, 30 Jul 2026 11:53:17 +0200	[thread overview]
Message-ID: <20260730095317.767418-4-guillaume.casal.42@gmail.com> (raw)
In-Reply-To: <20260730095317.767418-1-guillaume.casal.42@gmail.com>

The preceding patches let userspace ask for rumble in the motors located
under the triggers, but give it no way to find out whether the device has
such motors at all. Without that, an application can only set the new
magnitudes and hope, and it cannot tell a device that ignores them from
one that has no trigger motors.

Add FF_TRIGGER_RUMBLE as a capability bit. Drivers that fill in the
trigger magnitudes advertise it with

	input_set_capability(dev, EV_FF, FF_TRIGGER_RUMBLE);

and userspace tests for it in the EVIOCGBIT(EV_FF) bitmap, exactly as it
already tests for FF_RUMBLE.

It is deliberately not an effect type. The magnitudes keep travelling
inside struct ff_rumble_effect and FF_RUMBLE remains the transport, so
FF_EFFECT_MIN and FF_EFFECT_MAX are untouched. Placing it at 0x62, above
FF_AUTOCENTER, keeps it out of the effect id space whose upper bound
FF_MAX_EFFECTS already documents. Unlike its neighbours FF_GAIN and
FF_AUTOCENTER it is read-only: it reports what the hardware has rather
than something userspace sets, and it is never used as an effect id.

Signed-off-by: Guillaume Casal <guillaume.casal.42@gmail.com>
---
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -528,6 +528,7 @@
 
 #define FF_GAIN		0x60
 #define FF_AUTOCENTER	0x61
+#define FF_TRIGGER_RUMBLE	0x62
 
 /*
  * ff->playback(effect_id = FF_GAIN) is the first effect_id to

  parent reply	other threads:[~2026-07-30  9:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30  9:53 [PATCH 0/3] input: force feedback for trigger rumble motors Guillaume Casal
2026-07-30  9:53 ` [PATCH 1/3] input: uapi: Add trigger_left and trigger_right to ff_rumble_effect struct Guillaume Casal
2026-07-30 10:04   ` sashiko-bot
2026-07-30  9:53 ` [PATCH 2/3] input: ff-memless: Add trigger left/right in ml_combine_effects Guillaume Casal
2026-07-30 10:24   ` sashiko-bot
2026-07-30  9:53 ` Guillaume Casal [this message]
2026-07-30 10:39   ` [PATCH 3/3] input: Add FF_TRIGGER_RUMBLE capability bit sashiko-bot
2026-07-30 13:40 ` [PATCH v2 0/4] input: force feedback for trigger rumble motors Guillaume Casal
2026-07-30 13:40   ` [PATCH v2 1/4] input: Add FF_TRIGGER_RUMBLE effect type Guillaume Casal
2026-07-30 13:53     ` sashiko-bot
2026-07-30 13:40   ` [PATCH v2 2/4] input: ff-memless: Handle FF_TRIGGER_RUMBLE Guillaume Casal
2026-07-30 13:40   ` [PATCH v2 3/4] HID: debug: Add FF_TRIGGER_RUMBLE name Guillaume Casal
2026-07-30 13:40   ` [PATCH v2 4/4] Documentation: input: Document FF_TRIGGER_RUMBLE Guillaume Casal
2026-07-31  5:41   ` [PATCH v3 0/4] input: force feedback for trigger rumble motors Guillaume Casal
2026-07-31  5:41     ` [PATCH v3 1/4] input: Add FF_TRIGGER_RUMBLE effect type Guillaume Casal
2026-07-31  7:57       ` sashiko-bot
2026-07-31  5:41     ` [PATCH v3 2/4] input: ff-memless: Handle FF_TRIGGER_RUMBLE Guillaume Casal
2026-07-31  5:41     ` [PATCH v3 3/4] HID: debug: Add FF_TRIGGER_RUMBLE name Guillaume Casal
2026-07-31  5:41     ` [PATCH v3 4/4] Documentation: input: Document FF_TRIGGER_RUMBLE Guillaume Casal

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=20260730095317.767418-4-guillaume.casal.42@gmail.com \
    --to=guillaume.casal.42@gmail.com \
    --cc=dbdaniel42@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.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