From: Benjamin Tissoires <benjamin.tissoires@gmail.com>
To: Benjamin Tissoires <benjamin.tissoires@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Henrik Rydberg <rydberg@euromail.se>,
Jiri Kosina <jkosina@suse.cz>, Stephane Chatty <chatty@enac.fr>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/9] HID: core: add "report" hook, called once the report has been parsed
Date: Thu, 31 Jan 2013 17:22:23 +0100 [thread overview]
Message-ID: <1359649351-11092-2-git-send-email-benjamin.tissoires@gmail.com> (raw)
In-Reply-To: <1359649351-11092-1-git-send-email-benjamin.tissoires@gmail.com>
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>
---
drivers/hid/hid-core.c | 4 ++++
include/linux/hid.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5ae2cb1..b671e4e 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)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 828726c..e14b465 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -589,6 +589,7 @@ struct hid_usage_id {
* @raw_event: if report in report_table, this hook is called (NULL means nop)
* @usage_table: on which events to call event (NULL means all)
* @event: if usage in usage_table, this hook is called (NULL means nop)
+ * @report: this hook is called after parsing a report (NULL means nop)
* @report_fixup: called before report descriptor parsing (NULL means nop)
* @input_mapping: invoked on input registering before mapping an usage
* @input_mapped: invoked on input registering after mapping an usage
@@ -627,6 +628,7 @@ struct hid_driver {
const struct hid_usage_id *usage_table;
int (*event)(struct hid_device *hdev, struct hid_field *field,
struct hid_usage *usage, __s32 value);
+ void (*report)(struct hid_device *hdev, struct hid_report *report);
__u8 *(*report_fixup)(struct hid_device *hdev, __u8 *buf,
unsigned int *size);
--
1.8.1
next prev parent reply other threads:[~2013-01-31 16:30 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-31 16:22 [PATCH v2 0/9] Support of Nexio 42" and new default class for hid-multitouch Benjamin Tissoires
2013-01-31 16:22 ` Benjamin Tissoires [this message]
2013-02-03 12:27 ` [PATCH v2 1/9] HID: core: add "report" hook, called once the report has been parsed Henrik Rydberg
2013-02-04 9:24 ` Benjamin Tissoires
2013-02-04 11:21 ` Henrik Rydberg
2013-02-04 9:34 ` Jiri Kosina
2013-02-04 9:41 ` Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 2/9] HID: multitouch: use the callback "report" instead of sequential events Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 3/9] HID: multitouch: add support for Nexio 42" panel Benjamin Tissoires
2013-02-03 13:00 ` Henrik Rydberg
2013-02-04 9:36 ` Benjamin Tissoires
2013-02-04 11:42 ` Henrik Rydberg
2013-02-04 13:42 ` Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 4/9] HID: multitouch: fix Win8 protocol for Sharp like devices Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 5/9] HID: multitouch: ensure that serial devices make no use of contact count Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 6/9] HID: multitouch: fix protocol for Sitronix 1403:5001 Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 7/9] HID: multitouch: fix protocol for Cando 2087:0a02 Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 8/9] HID: multitouch: fix protocol for Elo panels Benjamin Tissoires
2013-01-31 16:22 ` [PATCH v2 9/9] HID: multitouch: make MT_CLS_ALWAYS_TRUE the new default class Benjamin Tissoires
2013-02-03 13:07 ` [PATCH v2 0/9] Support of Nexio 42" and new default class for hid-multitouch Henrik Rydberg
2013-02-04 9:38 ` Benjamin Tissoires
2013-02-04 11:54 ` Henrik Rydberg
2013-02-05 11:13 ` Jiri Kosina
2013-02-06 11:04 ` Benjamin Tissoires
2013-02-06 13:11 ` Jiri Kosina
2013-02-06 13:28 ` Benjamin Tissoires
2013-02-06 13:31 ` Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359649351-11092-2-git-send-email-benjamin.tissoires@gmail.com \
--to=benjamin.tissoires@gmail.com \
--cc=chatty@enac.fr \
--cc=dmitry.torokhov@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@euromail.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®