Skip to content

Commit 311e435

Browse files
Thomas KuehneJiri Kosina
authored andcommitted
HID: hid-debug: add EV_FF and FF_STATUS mappings
Currently hid-debug only output question marks for all force feedback related input mapping making debugging gamepads with force feedback a challenge. This adds the necessary mapping information to output EV_FF and FF_STATUS related information. Signed-off-by: Thomas Kuehne <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 132ea82 commit 311e435

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

drivers/hid/hid-debug.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3572,12 +3572,38 @@ static const char *software[SW_CNT] = {
35723572
[SW_MACHINE_COVER] = "MachineCover",
35733573
};
35743574

3575+
static const char *force[FF_CNT] = {
3576+
[FF_RUMBLE] = "FF_RUMBLE",
3577+
[FF_PERIODIC] = "FF_PERIODIC",
3578+
[FF_CONSTANT] = "FF_CONSTANT",
3579+
[FF_SPRING] = "FF_SPRING",
3580+
[FF_FRICTION] = "FF_FRICTION",
3581+
[FF_DAMPER] = "FF_DAMPER",
3582+
[FF_INERTIA] = "FF_INERTIA",
3583+
[FF_RAMP] = "FF_RAMP",
3584+
[FF_SQUARE] = "FF_SQUARE",
3585+
[FF_TRIANGLE] = "FF_TRIANGLE",
3586+
[FF_SINE] = "FF_SINE",
3587+
[FF_SAW_UP] = "FF_SAW_UP",
3588+
[FF_SAW_DOWN] = "FF_SAW_DOWN",
3589+
[FF_CUSTOM] = "FF_CUSTOM",
3590+
[FF_GAIN] = "FF_GAIN",
3591+
[FF_AUTOCENTER] = "FF_AUTOCENTER",
3592+
[FF_MAX] = "FF_MAX",
3593+
};
3594+
3595+
static const char *force_status[FF_STATUS_MAX + 1] = {
3596+
[FF_STATUS_STOPPED] = "FF_STATUS_STOPPED",
3597+
[FF_STATUS_PLAYING] = "FF_STATUS_PLAYING",
3598+
};
3599+
35753600
static const char **names[EV_MAX + 1] = {
35763601
[EV_SYN] = syncs, [EV_KEY] = keys,
35773602
[EV_REL] = relatives, [EV_ABS] = absolutes,
35783603
[EV_MSC] = misc, [EV_LED] = leds,
35793604
[EV_SND] = sounds, [EV_REP] = repeats,
3580-
[EV_SW] = software,
3605+
[EV_SW] = software, [EV_FF] = force,
3606+
[EV_FF_STATUS] = force_status,
35813607
};
35823608

35833609
static void hid_resolv_event(__u8 type, __u16 code, struct seq_file *f)

0 commit comments

Comments
 (0)