[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260203174531.2866644-5-tomasz.pakula.oficjalny@gmail.com>
Date: Tue, 3 Feb 2026 18:45:30 +0100
From: Tomasz Pakuła <tomasz.pakula.oficjalny@...il.com>
To: jikos@...nel.org,
bentiss@...nel.org
Cc: oleg@...arenk.ooo,
linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org,
tomasz.pakula.oficjalny@...il.com
Subject: [PATCH 4/5] HID: pidff: Add MISSING_DEADBAND quirk
Some devices (mainly Asetek) do not have deadband field in set
conditional usage. Do not fail set conditional usage search if it's
missing. Allows conditional effect playback on Asetek wheelbases.
Deadband is practically never used in simracing anyway.
Align property name in the whole driver to use 'deadband' without space.
Co-developed-by: Oleg Makarenko <oleg@...arenk.ooo>
Signed-off-by: Oleg Makarenko <oleg@...arenk.ooo>
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@...il.com>
---
drivers/hid/usbhid/hid-pidff.c | 12 +++++++++---
drivers/hid/usbhid/hid-pidff.h | 3 +++
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index 17bdc36d1908..8106b045a8f7 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -82,7 +82,7 @@ static const u8 pidff_set_envelope[] = { 0x22, 0x5b, 0x5c, 0x5d, 0x5e };
#define PID_NEG_COEFFICIENT 4
#define PID_POS_SATURATION 5
#define PID_NEG_SATURATION 6
-#define PID_DEAD_BAND 7
+#define PID_DEADBAND 7
static const u8 pidff_set_condition[] = {
0x22, 0x23, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65
};
@@ -632,8 +632,11 @@ static void pidff_set_condition_report(struct pidff_device *pidff,
pidff_set_signed(&pidff->set_condition[PID_NEG_SATURATION],
effect->u.condition[i].left_saturation);
- pidff_set(&pidff->set_condition[PID_DEAD_BAND],
- effect->u.condition[i].deadband);
+ /* Omit Deadband field if missing */
+ if (!(pidff->quirks & HID_PIDFF_QUIRK_MISSING_DEADBAND))
+ pidff_set(&pidff->set_condition[PID_DEADBAND],
+ effect->u.condition[i].deadband);
+
hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONDITION],
HID_REQ_SET_REPORT);
}
@@ -1103,6 +1106,9 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table,
else if (table[i] == pidff_set_condition[PID_NEG_SATURATION])
PIDFF_MISSING_FIELD(NEG_SATURATION, quirks);
+ else if (table[i] == pidff_set_condition[PID_DEADBAND])
+ PIDFF_MISSING_FIELD(DEADBAND, quirks);
+
else if (strict) {
pr_debug("failed to locate %d\n", i);
return -1;
diff --git a/drivers/hid/usbhid/hid-pidff.h b/drivers/hid/usbhid/hid-pidff.h
index 8d879067718f..c413aa732842 100644
--- a/drivers/hid/usbhid/hid-pidff.h
+++ b/drivers/hid/usbhid/hid-pidff.h
@@ -27,6 +27,9 @@
/* Allow devices with missing negative saturation in the set condition usage */
#define HID_PIDFF_QUIRK_MISSING_NEG_SATURATION BIT(6)
+/* Allow devices with missing deadband in the set condition usage */
+#define HID_PIDFF_QUIRK_MISSING_DEADBAND BIT(7)
+
#ifdef CONFIG_HID_PID
int hid_pidff_init(struct hid_device *hid);
int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks);
--
2.52.0
Powered by blists - more mailing lists