]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
HID: pidff: Add PERMISSIVE_CONTROL quirk
authorTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Sat, 1 Feb 2025 11:38:50 +0000 (12:38 +0100)
committerJiri Kosina <jkosina@suse.com>
Mon, 3 Feb 2025 14:16:56 +0000 (15:16 +0100)
With this quirk, a PID device isn't required to have a strict
logical_minimum of 1 for the the PID_DEVICE_CONTROL usage page.

Some devices come with weird values in their device descriptors and
this quirk enables their initialization even if the logical minimum
of the DEVICE_CONTROL page is not 1.

Fixes initialization of VRS Direct Force Pro

Changes in v6:
- Change quirk name to better reflect it's intention

Co-developed-by: Makarenko Oleg <oleg@makarenk.ooo>
Signed-off-by: Makarenko Oleg <oleg@makarenk.ooo>
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Reviewed-by: Michał Kopeć <michal@nozomi.space>
Reviewed-by: Paul Dino Jones <paul@spacefreak18.xyz>
Tested-by: Paul Dino Jones <paul@spacefreak18.xyz>
Tested-by: Cristóferson Bueno <cbueno81@gmail.com>
Tested-by: Pablo Cisneros <patchkez@protonmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/usbhid/hid-pidff.c
include/linux/hid.h

index 89a1b6a55c1ba87231169d7fbbbe895e4a368255..3f429936d53750f0a7f57e707b098b578a1b24bf 100644 (file)
@@ -982,7 +982,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_PERMISSIVE_CONTROL));
+
        pidff->block_load_status =
                pidff_find_special_field(pidff->reports[PID_BLOCK_LOAD],
                                         0x8b, 1);
index ea7ba8e4bfe49b9307b5b85e308afcc114f9340a..89a4dee377292310b58b6dee80c0fa5e851ed19c 100644 (file)
@@ -1229,8 +1229,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_PERMISSIVE_CONTROL     BIT(2)
 
 #define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)