diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2014-02-10 12:58:47 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-17 14:51:41 +0100 |
commit | 706daeffaf36590efc77142f6a209bfe51804f36 (patch) | |
tree | f6481cac898419276f3fb6d608110786121075a1 /drivers/hid/uhid.c | |
parent | 289a7162175ccabf2b8fa52314705df271b41e40 (diff) |
HID: uHID: implement .raw_request
uHID is missing a SET_REPORT protocol implementation, but as
.hid_get_raw_report() as been removed from struct hid_device,
there were no means to access GET_REPORT in uhid.
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/uhid.c')
-rw-r--r-- | drivers/hid/uhid.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c index b6de90392075..60acee422fdc 100644 --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -250,6 +250,21 @@ static int uhid_hid_output_report(struct hid_device *hid, __u8 *buf, return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); } +static int uhid_raw_request(struct hid_device *hid, unsigned char reportnum, + __u8 *buf, size_t len, unsigned char rtype, + int reqtype) +{ + switch (reqtype) { + case HID_REQ_GET_REPORT: + return uhid_hid_get_raw(hid, reportnum, buf, len, rtype); + case HID_REQ_SET_REPORT: + /* TODO: implement proper SET_REPORT functionality */ + return -ENOSYS; + default: + return -EIO; + } +} + static struct hid_ll_driver uhid_hid_driver = { .start = uhid_hid_start, .stop = uhid_hid_stop, @@ -257,6 +272,7 @@ static struct hid_ll_driver uhid_hid_driver = { .close = uhid_hid_close, .parse = uhid_hid_parse, .output_report = uhid_hid_output_report, + .raw_request = uhid_raw_request, }; #ifdef CONFIG_COMPAT |