[PATCH v6 12/13] HID: haptic: Add HID_HAPTIC_QUIRK_NO_RETRIGGER to disable retriggering
From: Rong Zhang
Date: Wed Dec 02 2026 - 13:39:35 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 f3118876d1b2..0b75dff9fcc7 100644
--- a/drivers/hid/hid-haptic.c
+++ b/drivers/hid/hid-haptic.c
@@ -28,6 +28,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;
}
@@ -287,6 +290,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 3464766def08..044f91851357 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