Commit 978c8394 authored by Ben Collins's avatar Ben Collins

[PATCH] USB: fix keyboard leds

> Ben, it looks like your patch broke something for USB keyboards, any
> idea?

Yep, my patch killed hid-input from scanning HID_OUTPUT_REPORT's. Fixed
with this patch for 2.5.70+bk. I'll send one for 2.4.x in a few minutes.
parent 8a36b98f
......@@ -70,8 +70,11 @@ static struct input_dev *find_input(struct hid_device *hid, struct hid_field *fi
hidinput = list_entry(lh, struct hid_input, list);
for (i = 0; i < hidinput->maxfield; i++)
if (hidinput->fields[i] == field)
if (! hidinput->report)
continue;
for (i = 0; i < hidinput->report->maxfield; i++)
if (hidinput->report->field[i] == field)
return &hidinput->input;
}
......@@ -527,7 +530,7 @@ int hidinput_connect(struct hid_device *hid)
struct hid_report *report;
struct list_head *list;
struct hid_input *hidinput = NULL;
int i, j;
int i, j, k;
INIT_LIST_HEAD(&hid->inputs);
......@@ -539,7 +542,8 @@ int hidinput_connect(struct hid_device *hid)
if (i == hid->maxcollection)
return -1;
report_enum = hid->report_enum + HID_INPUT_REPORT;
for (k = HID_INPUT_REPORT; k <= HID_OUTPUT_REPORT; k++) {
report_enum = hid->report_enum + k;
list = report_enum->report_list.next;
while (list != &report_enum->report_list) {
report = (struct hid_report *) list;
......@@ -582,15 +586,14 @@ int hidinput_connect(struct hid_device *hid)
* the same interface. Some devices (e.g. Happ's
* UGCI) cram a lot of unrelated inputs into the
* same interface. */
hidinput->fields = report->field;
hidinput->maxfield = report->maxfield;
hidinput->report = report;
input_register_device(&hidinput->input);
hidinput = NULL;
}
list = list->next;
}
}
/* This only gets called when we are a single-input (most of the
* time). IOW, not a HID_QUIRK_MULTI_INPUT. The hid_ff_init() is
......
......@@ -324,8 +324,7 @@ struct hid_control_fifo {
struct hid_input {
struct list_head list;
struct hid_field **fields;
int maxfield;
struct hid_report *report;
struct input_dev input;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment