Skip to content

Commit

Permalink
HID: fix autocentering of PID devices
Browse files Browse the repository at this point in the history
When setting the autocentering of PID devices, PID_DIRECTION_ENABLE is not
being explicitely set to 1. This results in autocentering working only on the
vertical axis when this field is preset to 0.

Fix that by setting it explicitely to 1 when preparing the set_effect report
for autocentering spring effect.

Signed-off-by: Diogo Kastrup <[email protected]>
Signed-off-by: Anssi Hannula <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
Diogo Kastrup authored and Jiri Kosina committed Jul 9, 2007
1 parent ea9a4a8 commit 816cbfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/hid/usbhid/hid-pidff.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude)
pidff->set_effect[PID_TRIGGER_BUTTON].value[0] = 0;
pidff->set_effect[PID_TRIGGER_REPEAT_INT].value[0] = 0;
pidff_set(&pidff->set_effect[PID_GAIN], magnitude);
pidff->set_effect[PID_DIRECTION_ENABLE].value[0] = 1;
pidff->set_effect[PID_START_DELAY].value[0] = 0;

usbhid_submit_report(pidff->hid, pidff->reports[PID_SET_EFFECT],
Expand Down

0 comments on commit 816cbfd

Please sign in to comment.