[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241231154731.1719919-7-tomasz.pakula.oficjalny@gmail.com>
Date: Tue, 31 Dec 2024 16:47:27 +0100
From: Tomasz Pakuła <tomasz.pakula.oficjalny@...il.com>
To: jikos@...nel.org,
bentiss@...nel.org
Cc: linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org,
oleg@...arenk.ooo,
paul@...cefreak18.xyz,
f.kardame@...jaro.org,
jules.noirant@...nge.fr
Subject: [PATCH 06/10] HID: pidff: Add MISSING_DEVICE_CONTROL quirk
With this quirk, a PID device isn't required to have
the PID_DEVICE_CONTROL field available.
Some devices like VRS Direct Force Pro do not implement PID_DEVICE_CONTROL
in their descriptors while still having the necessary control fields like
PID_ENABLE_ACTUATORS or PID_RESET.
Fixes initialization of VRS Direct Force Pro
Co-developed-by: Makarenko Oleg <oleg@...arenk.ooo>
Signed-off-by: Makarenko Oleg <oleg@...arenk.ooo>
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@...il.com>
---
drivers/hid/usbhid/hid-pidff.c | 3 ++-
include/linux/hid.h | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index 0bc093ae1bb3..40265744019c 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -1000,7 +1000,8 @@ static int pidff_find_special_fields(struct pidff_device *pidff)
0x57, 0);
pidff->device_control =
pidff_find_special_field(pidff->reports[PID_DEVICE_CONTROL],
- 0x96, 1);
+ 0x96, pidff->quirks & HID_PIDFF_QUIRK_MISSING_DEVICE_CONTROL ? 0 : 1);
+
pidff->block_load_status =
pidff_find_special_field(pidff->reports[PID_BLOCK_LOAD],
0x8b, 1);
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 29f0a91f505f..2af9db0296d1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1228,8 +1228,9 @@ int hid_pidff_init(struct hid_device *hid);
#endif
/* HID PIDFF quirks */
-#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0)
-#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)
+#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0)
+#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)
+#define HID_PIDFF_QUIRK_MISSING_DEVICE_CONTROL BIT(2)
#define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
--
2.47.1
Powered by blists - more mailing lists