[PATCH v5 12/13] HID: haptic: Add HID_HAPTIC_QUIRK_NO_RETRIGGER to disable retriggering
From: Rong Zhang
Date: Sun Nov 29 2026 - 12:59:04 EST
Some devices do not support retriggering. If the relevant fields are
set, they do not trigger at all, as if no FF effect is played.
Add a new quirk flag HID_HAPTIC_QUIRK_NO_RETRIGGER to zero the relevant
fields before filling the effect buf, so that faulty devices is always
triggered normally.
Signed-off-by: Rong Zhang <i@xxxxxxxx>
---
drivers/hid/hid-haptic.c | 8 ++++++++
drivers/hid/hid-haptic.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/drivers/hid/hid-haptic.c b/drivers/hid/hid-haptic.c
index 1c314c273316..a8762799249c 100644
--- a/drivers/hid/hid-haptic.c
+++ b/drivers/hid/hid-haptic.c
@@ -27,6 +27,9 @@ static u32 hid_haptic_match_quirks(struct hid_device *hdev)
quirks = id ? id->driver_data : 0;
+ if (quirks & HID_HAPTIC_QUIRK_NO_RETRIGGER)
+ hid_notice(hdev, "Device does not support retriggering\n");
+
return quirks;
}
@@ -286,6 +289,11 @@ static int hid_haptic_upload_effect(struct input_dev *dev, struct ff_effect *eff
if (ordinal < 1)
return -EINVAL;
+ if (haptic->quirks & HID_HAPTIC_QUIRK_NO_RETRIGGER) {
+ effect->u.haptic.repeat_count = 0;
+ effect->u.haptic.retrigger_period = 0;
+ }
+
/* Fill the buffer for the effect id */
fill_effect_buf(haptic, &effect->u.haptic, &haptic->effect[effect->id],
ordinal);
diff --git a/drivers/hid/hid-haptic.h b/drivers/hid/hid-haptic.h
index 350948ae6866..cc6d8e2e5e71 100644
--- a/drivers/hid/hid-haptic.h
+++ b/drivers/hid/hid-haptic.h
@@ -19,6 +19,8 @@
#define HID_HAPTIC_MODE_DEVICE 0
#define HID_HAPTIC_MODE_HOST 1
+#define HID_HAPTIC_QUIRK_NO_RETRIGGER BIT(0)
+
struct hid_haptic_effect {
u8 *report_buf;
struct input_dev *input_dev;
--
2.55.0