forked from gotzl/hid-fanatecff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hid-ftec.h
83 lines (73 loc) · 1.94 KB
/
hid-ftec.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef __HID_FTEC_H
#define __HID_FTEC_H
#define FANATEC_VENDOR_ID 0x0eb7
#define CLUBSPORT_V2_WHEELBASE_DEVICE_ID 0x0001
#define CLUBSPORT_V25_WHEELBASE_DEVICE_ID 0x0004
#define CLUBSPORT_PEDALS_V3_DEVICE_ID 0x183b
#define PODIUM_WHEELBASE_DD1_DEVICE_ID 0x0006
#define PODIUM_WHEELBASE_DD2_DEVICE_ID 0x0007
#define CSL_ELITE_WHEELBASE_DEVICE_ID 0x0E03
#define CSL_ELITE_PS4_WHEELBASE_DEVICE_ID 0x0005
#define CSL_ELITE_PEDALS_DEVICE_ID 0x6204
#define CSL_DD_WHEELBASE_DEVICE_ID 0x0020
#define CSR_ELITE_WHEELBASE_DEVICE_ID 0x0011
#define CSL_ELITE_STEERING_WHEEL_WRC_ID 0x0112
#define CSL_ELITE_STEERING_WHEEL_MCLAREN_GT3_V2_ID 0x280b
#define CLUBSPORT_STEERING_WHEEL_F1_IS_ID 0x1102
#define CLUBSPORT_STEERING_WHEEL_FORMULA_V2_ID 0x280a
#define PODIUM_STEERING_WHEEL_PORSCHE_911_GT3_R_ID 0x050c
#define LEDS 9
#define NUM_TUNING_SLOTS 5
#define FTECFF_MAX_EFFECTS 16
struct ftecff_effect_state {
struct ff_effect effect;
struct ff_envelope *envelope;
unsigned long start_at;
unsigned long play_at;
unsigned long stop_at;
unsigned long flags;
unsigned long time_playing;
unsigned long updated_at;
unsigned int phase;
unsigned int phase_adj;
unsigned int count;
unsigned int cmd;
unsigned int cmd_start_time;
unsigned int cmd_start_count;
int direction_gain;
int slope;
};
struct ftecff_effect_parameters {
int level;
int d1;
int d2;
int k1;
int k2;
unsigned int clip;
};
struct ftecff_slot {
int id;
struct ftecff_effect_parameters parameters;
u8 current_cmd[7];
int is_updated;
int effect_type;
};
struct ftec_drv_data {
unsigned long quirks;
spinlock_t report_lock; /* Protect output HID report */
spinlock_t timer_lock;
struct hrtimer hrtimer;
struct hid_device *hid;
struct hid_report *report;
struct ftecff_slot slots[4];
struct ftecff_effect_state states[FTECFF_MAX_EFFECTS];
int effects_used;
u16 range;
u16 max_range;
u16 min_range;
#ifdef CONFIG_LEDS_CLASS
u16 led_state;
struct led_classdev *led[LEDS];
#endif
};
#endif