summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-input.c6
-rw-r--r--include/linux/hid.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 04056773102e..fd1c4fe70327 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1526,9 +1526,12 @@ static struct hid_input *hidinput_allocate(struct hid_device *hid)
input_dev->id.product = hid->product;
input_dev->id.version = hid->version;
input_dev->dev.parent = &hid->dev;
+
hidinput->input = input_dev;
list_add_tail(&hidinput->list, &hid->inputs);
+ INIT_LIST_HEAD(&hidinput->reports);
+
return hidinput;
}
@@ -1678,6 +1681,9 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
if (hid->quirks & HID_QUIRK_MULTI_INPUT)
hidinput->report = report;
+
+ list_add_tail(&report->hidinput_list,
+ &hidinput->reports);
}
}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 0267aa5c1ea3..396068ccc197 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -464,6 +464,7 @@ struct hid_field {
struct hid_report {
struct list_head list;
+ struct list_head hidinput_list;
unsigned id; /* id of this report */
unsigned type; /* report type */
struct hid_field *field[HID_MAX_FIELDS]; /* fields of the report */
@@ -510,6 +511,7 @@ struct hid_input {
struct hid_report *report;
struct input_dev *input;
bool registered;
+ struct list_head reports; /* the list of reports */
};
enum hid_type {