]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
HID: pidff: Use direction fix only for conditional effects
authorTomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Wed, 13 Aug 2025 20:09:49 +0000 (22:09 +0200)
committerJiri Kosina <jkosina@suse.com>
Fri, 15 Aug 2025 13:58:01 +0000 (15:58 +0200)
commitf345a4798dab800159b09d088e7bdae0f16076c3
tree85d8036d91484362c526ba63468a4eceb36d84a6
parentb80a75cf6999fb79971b41eaec7af2bb4b514714
HID: pidff: Use direction fix only for conditional effects

The already fixed bug in SDL only affected conditional effects. This
should fix FFB in Forza Horizion 4/5 on Moza Devices as Forza Horizon
flips the constant force direction instead of using negative magnitude
values.

Changing the direction in the effect directly in pidff_upload_effect()
would affect it's value in further operations like comparing to the old
effect and/or just reading the effect values in the user application.

This, in turn, would lead to constant PID_SET_EFFECT spam as the effect
direction would constantly not match the value that's set by the
application.

This way, it's still transparent to any software/API.

Only affects conditional effects now so it's better for it to explicitly
state that in the name. If any HW ever needs fixed direction for other
effects, we'll add more quirks.

Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Reviewed-by: Oleg Makarenko <oleg@makarenk.ooo>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-universal-pidff.c
drivers/hid/usbhid/hid-pidff.c
drivers/hid/usbhid/hid-pidff.h