[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260203174531.2866644-4-tomasz.pakula.oficjalny@gmail.com>
Date: Tue, 3 Feb 2026 18:45:29 +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 3/5] HID: pidff: Add MISSING_NEG_SATURATION quirk
This is the same case as the previous MISSING_NEG_COEFFICIENT quirk
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 | 14 ++++++++++----
drivers/hid/usbhid/hid-pidff.h | 3 +++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index aebf6c89643f..17bdc36d1908 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -619,16 +619,19 @@ static void pidff_set_condition_report(struct pidff_device *pidff,
effect->u.condition[i].center);
pidff_set_signed(&pidff->set_condition[PID_POS_COEFFICIENT],
effect->u.condition[i].right_coeff);
+ pidff_set(&pidff->set_condition[PID_POS_SATURATION],
+ effect->u.condition[i].right_saturation);
/* Omit Negative Coefficient if missing */
if (!(pidff->quirks & HID_PIDFF_QUIRK_MISSING_NEG_COEFFICIENT))
pidff_set_signed(&pidff->set_condition[PID_NEG_COEFFICIENT],
effect->u.condition[i].left_coeff);
- pidff_set(&pidff->set_condition[PID_POS_SATURATION],
- effect->u.condition[i].right_saturation);
- pidff_set(&pidff->set_condition[PID_NEG_SATURATION],
- effect->u.condition[i].left_saturation);
+ /* Omit Negative Saturation if missing */
+ if (!(pidff->quirks & HID_PIDFF_QUIRK_MISSING_NEG_SATURATION))
+ 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);
hid_hw_request(pidff->hid, pidff->reports[PID_SET_CONDITION],
@@ -1097,6 +1100,9 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table,
else if (table[i] == pidff_set_condition[PID_NEG_COEFFICIENT])
PIDFF_MISSING_FIELD(NEG_COEFFICIENT, quirks);
+ else if (table[i] == pidff_set_condition[PID_NEG_SATURATION])
+ PIDFF_MISSING_FIELD(NEG_SATURATION, 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 5bf54e981543..8d879067718f 100644
--- a/drivers/hid/usbhid/hid-pidff.h
+++ b/drivers/hid/usbhid/hid-pidff.h
@@ -24,6 +24,9 @@
/* Allow devices with missing negative coefficient in the set condition usage */
#define HID_PIDFF_QUIRK_MISSING_NEG_COEFFICIENT BIT(5)
+/* Allow devices with missing negative saturation in the set condition usage */
+#define HID_PIDFF_QUIRK_MISSING_NEG_SATURATION BIT(6)
+
#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