HID: core: store the collections as a basic tree

For each collection parsed, store a pointer to the parent collection
(if any). This makes it a lot easier to look up which collection(s)
any given item is part of

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Verified-by: Harry Cutts <hcutts@chromium.org>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
This commit is contained in:
Peter Hutterer
2018-12-05 10:42:22 +10:00
committed by Benjamin Tissoires
parent 52ea899637
commit c53431eb69
2 changed files with 6 additions and 0 deletions

View File

@@ -427,6 +427,7 @@ struct hid_local {
*/
struct hid_collection {
struct hid_collection *parent;
unsigned type;
unsigned usage;
unsigned level;
@@ -650,6 +651,7 @@ struct hid_parser {
unsigned int *collection_stack;
unsigned int collection_stack_ptr;
unsigned int collection_stack_size;
struct hid_collection *active_collection;
struct hid_device *device;
unsigned int scan_flags;
};