xref: /linux/drivers/hid/usbhid/hid-pidff.h (revision 53597deca0e38c30e6cd4ba2114fa42d2bcd85bb)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 #ifndef __HID_PIDFF_H
3 #define __HID_PIDFF_H
4 
5 #include <linux/hid.h>
6 
7 /* HID PIDFF quirks */
8 
9 /* Delay field (0xA7) missing. Skip it during set effect report upload */
10 #define HID_PIDFF_QUIRK_MISSING_DELAY		BIT(0)
11 
12 /* Missing Paramter block offset (0x23). Skip it during SET_CONDITION upload */
13 #define HID_PIDFF_QUIRK_MISSING_PBO		BIT(1)
14 
15 /* Initialise device control field even if logical_minimum != 1 */
16 #define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL	BIT(2)
17 
18 /* Use fixed 0x4000 direction during SET_EFFECT report upload */
19 #define HID_PIDFF_QUIRK_FIX_CONDITIONAL_DIRECTION	BIT(3)
20 
21 /* Force all periodic effects to be uploaded as SINE */
22 #define HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY	BIT(4)
23 
24 /* Allow devices with missing negative coefficient in the set condition usage */
25 #define HID_PIDFF_QUIRK_MISSING_NEG_COEFFICIENT	BIT(5)
26 
27 /* Allow devices with missing negative saturation in the set condition usage */
28 #define HID_PIDFF_QUIRK_MISSING_NEG_SATURATION	BIT(6)
29 
30 /* Allow devices with missing deadband in the set condition usage */
31 #define HID_PIDFF_QUIRK_MISSING_DEADBAND	BIT(7)
32 
33 #ifdef CONFIG_HID_PID
34 int hid_pidff_init(struct hid_device *hid);
35 int hid_pidff_init_with_quirks(struct hid_device *hid, u32 initial_quirks);
36 #else
37 #define hid_pidff_init NULL
38 #define hid_pidff_init_with_quirks NULL
39 #endif
40 
41 #endif
42