HID: pidff: Completely rework and fix pidff_reset function
Previously, it was assumed that DEVICE_CONTROL usage is always an array but a lot of devices implements it as a bitmask variable. This led to the pidff_reset function not working and causing errors in such cases. Selectors can come in three types. One selection of a set, N selections and Any selection in form of bitmask as from USB Hid Usage Tables v1.5, subsection 3.4.2.1 Added pidff_send_device_control which handles usage flag check which decides whether DEVICE_CONTROL should be handled as "One selection of a set" or "Any selection of a set". Reset was triggered once, on device initialization. Now, it's triggered every time when uploading an effect to an empty device (no currently stored effects), tracked by pidff->effect_count variable. 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>
Loading
Please sign in to comment