Skip to content

Commit

Permalink
HID: ignore all non-LED usages in output fields in hid-input
Browse files Browse the repository at this point in the history
We have to ignore all non-LED usages in output fields if the
report descriptor of the device specifies any. If we don't do
so, the devices which contain the same usages both in input and
output reports with different parameters will mess things up. In
hid-input, we currently care only for the input usages, with exception
for LEDs. All other output usages should be properly handled by
appropriate force-feedback driver.

Fixes auto-calibration for Saitek Cyborg Evo Force joystick.

Reported-by: Renato Golin <rengolin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Jiri Kosina committed Oct 14, 2007
1 parent 77b2966 commit 82eb121
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
if (field->flags & HID_MAIN_ITEM_CONSTANT)
goto ignore;

/* only LED usages are supported in output fields */
if (field->report_type == HID_OUTPUT_REPORT &&
(usage->hid & HID_USAGE_PAGE) != HID_UP_LED) {
dbg_hid_line(" [non-LED output field] ");
goto ignore;
}

switch (usage->hid & HID_USAGE_PAGE) {

case HID_UP_UNDEFINED:
Expand Down

0 comments on commit 82eb121

Please sign in to comment.