aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-02-10 12:58:47 -0500
committerJiri Kosina <jkosina@suse.cz>2014-02-17 08:51:41 -0500
commit706daeffaf36590efc77142f6a209bfe51804f36 (patch)
treef6481cac898419276f3fb6d608110786121075a1
parent289a7162175ccabf2b8fa52314705df271b41e40 (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>
-rw-r--r--drivers/hid/uhid.c16
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,
250 return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT); 250 return uhid_hid_output_raw(hid, buf, count, HID_OUTPUT_REPORT);
251} 251}
252 252
253static int uhid_raw_request(struct hid_device *hid, unsigned char reportnum,
254 __u8 *buf, size_t len, unsigned char rtype,
255 int reqtype)
256{
257 switch (reqtype) {
258 case HID_REQ_GET_REPORT:
259 return uhid_hid_get_raw(hid, reportnum, buf, len, rtype);
260 case HID_REQ_SET_REPORT:
261 /* TODO: implement proper SET_REPORT functionality */
262 return -ENOSYS;
263 default:
264 return -EIO;
265 }
266}
267
253static struct hid_ll_driver uhid_hid_driver = { 268static struct hid_ll_driver uhid_hid_driver = {
254 .start = uhid_hid_start, 269 .start = uhid_hid_start,
255 .stop = uhid_hid_stop, 270 .stop = uhid_hid_stop,
@@ -257,6 +272,7 @@ static struct hid_ll_driver uhid_hid_driver = {
257 .close = uhid_hid_close, 272 .close = uhid_hid_close,
258 .parse = uhid_hid_parse, 273 .parse = uhid_hid_parse,
259 .output_report = uhid_hid_output_report, 274 .output_report = uhid_hid_output_report,
275 .raw_request = uhid_raw_request,
260}; 276};
261 277
262#ifdef CONFIG_COMPAT 278#ifdef CONFIG_COMPAT