diff options
author | Jim Keir <jimkeir@oracledbadirect.com> | 2015-01-23 12:21:12 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-01-26 15:26:30 -0500 |
commit | afd700d933963d07391e3e3dfbfbc05e905960ef (patch) | |
tree | 063934f6d0e4467c70a50da8766b4868a429926a /drivers/hid | |
parent | 3458e4c0e5f8783ae699e1205062d1fdd2a48cca (diff) |
HID: pidff: Fix initialisation forMicrosoft Sidewinder FF Pro 2
The FF2 driver (usbhid/hid-pidff.c) sends commands to the stick during ff_init.
However, this is called inside a block where driver_input_lock is locked, so
the results of these initial commands are discarded. This behavior is the
"killer", without this nothing else works.
ff_init issues commands using "hid_hw_request". This eventually goes to
hid_input_report, which returns -EBUSY because driver_input_lock is locked. The
change is to delay the ff_init call in hid-core.c until after this lock has
been released.
Calling hid_device_io_start() releases the lock so the device can be
configured. We also need to call hid_device_io_stop() on exit for the lock to
remain locked while ending the init of the drivers.
[ benjamin.tissoires@redhat.com: imrpoved the changelog a lot ]
Signed-off-by: Jim Keir <jimkeir@oracledbadirect.com>
Reviewed-by: Benjamin.tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/usbhid/hid-pidff.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 10b616702780..0b531c6a76a5 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c | |||
@@ -1252,6 +1252,8 @@ int hid_pidff_init(struct hid_device *hid) | |||
1252 | 1252 | ||
1253 | pidff->hid = hid; | 1253 | pidff->hid = hid; |
1254 | 1254 | ||
1255 | hid_device_io_start(hid); | ||
1256 | |||
1255 | pidff_find_reports(hid, HID_OUTPUT_REPORT, pidff); | 1257 | pidff_find_reports(hid, HID_OUTPUT_REPORT, pidff); |
1256 | pidff_find_reports(hid, HID_FEATURE_REPORT, pidff); | 1258 | pidff_find_reports(hid, HID_FEATURE_REPORT, pidff); |
1257 | 1259 | ||
@@ -1315,9 +1317,13 @@ int hid_pidff_init(struct hid_device *hid) | |||
1315 | 1317 | ||
1316 | hid_info(dev, "Force feedback for USB HID PID devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); | 1318 | hid_info(dev, "Force feedback for USB HID PID devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); |
1317 | 1319 | ||
1320 | hid_device_io_stop(hid); | ||
1321 | |||
1318 | return 0; | 1322 | return 0; |
1319 | 1323 | ||
1320 | fail: | 1324 | fail: |
1325 | hid_device_io_stop(hid); | ||
1326 | |||
1321 | kfree(pidff); | 1327 | kfree(pidff); |
1322 | return error; | 1328 | return error; |
1323 | } | 1329 | } |