From: Benjamin Tissoires <tissoire@cena.fr>
To: linux-input@vger.kernel.org
Subject: [PATCH 1/3] HID: Export hid_register_field
Date: Mon, 08 Mar 2010 22:29:40 +0100 [thread overview]
Message-ID: <1268083780.9018.19.camel@localhost.localdomain> (raw)
The Apple Magic Mouse (and probably other devices) publish reports that are not
called out in their HID report descriptors -- they only send them when enabled
through other writes to the devices. Exporting hid_register_report is not
sufficient as the given report is empty.
As the hid parser does not know the new fields, the driver has to register them
manually. This allows the driver to manually register the different fields.
Signed-off-by: Benjamin Tissoires <tissoire@cena.fr>
---
drivers/hid/hid-core.c | 3 ++-
include/linux/hid.h | 1 +
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index bfd8301..3313dff 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -83,7 +83,7 @@ EXPORT_SYMBOL_GPL(hid_register_report);
* Register a new field for this report.
*/
-static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
+struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values)
{
struct hid_field *field;
@@ -103,6 +103,7 @@ static struct hid_field *hid_register_field(struct hid_report *report, unsigned
return field;
}
+EXPORT_SYMBOL_GPL(hid_register_field);
/*
* Open a collection. The type/usage is pushed on the stack.
diff --git a/include/linux/hid.h b/include/linux/hid.h
index b1344ec..50f17de 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -691,6 +691,7 @@ int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int
void hid_output_report(struct hid_report *report, __u8 *data);
struct hid_device *hid_allocate_device(void);
struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
+struct hid_field *hid_register_field(struct hid_report *report, unsigned usages, unsigned values);
int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
int hid_check_keys_pressed(struct hid_device *hid);
int hid_connect(struct hid_device *hid, unsigned int connect_mask);
-- 1.6.6.1
reply other threads:[~2010-03-08 21:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1268083780.9018.19.camel@localhost.localdomain \
--to=tissoire@cena.fr \
--cc=linux-input@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).