From: Diogo Kastrup Date: Tue, 19 Jun 2007 12:16:15 +0000 (+0200) Subject: HID: fix autocentering of PID devices X-Git-Tag: firefly_0821_release~28396^2^2~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=816cbfda8b5113629707f604660204701e93b7ce;p=firefly-linux-kernel-4.4.55.git HID: fix autocentering of PID devices 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 Signed-off-by: Anssi Hannula Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index f5a90e950e6b..011326178c06 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -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],