diff options
author | Benjamin Tissoires <benjamin.tissoires@gmail.com> | 2013-01-31 17:22:23 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-02-05 12:07:39 +0100 |
commit | 6d85d037d6247b06e1060b5e5ad0e4854a7d1e3b (patch) | |
tree | d2340762020aa4c8512a21d74f564d73d3f9fde8 /drivers/hid | |
parent | cf5425bfcd6909f9831a00bc06ccb9a5b163766a (diff) | |
download | linux-6d85d037d6247b06e1060b5e5ad0e4854a7d1e3b.tar.gz linux-6d85d037d6247b06e1060b5e5ad0e4854a7d1e3b.tar.bz2 linux-6d85d037d6247b06e1060b5e5ad0e4854a7d1e3b.zip |
HID: core: add "report" hook, called once the report has been parsed
This callback is called when the parsing of the report has been done
by hid-core (so after the calls to .event). The hid drivers can now
have access to the whole report by relying on the values stored in
the different fields.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index eb2ee11b6412..754098a7dd47 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1195,6 +1195,7 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, { struct hid_report_enum *report_enum = hid->report_enum + type; struct hid_report *report; + struct hid_driver *hdrv; unsigned int a; int rsize, csize = size; u8 *cdata = data; @@ -1231,6 +1232,9 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, if (hid->claimed != HID_CLAIMED_HIDRAW) { for (a = 0; a < report->maxfield; a++) hid_input_field(hid, report->field[a], cdata, interrupt); + hdrv = hid->driver; + if (hdrv && hdrv->report) + hdrv->report(hid, report); } if (hid->claimed & HID_CLAIMED_INPUT) |