diff options
author | Jiri Kosina <jkosina@suse.cz> | 2014-04-01 19:05:09 +0200 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-04-01 19:05:09 +0200 |
commit | ad295b6d5739ab24880a31be403bbc8fab62e177 (patch) | |
tree | cd760a18bcfa6e59b8b63fc71e333ba394b1cd9c /drivers/hid/usbhid | |
parent | ba04a57b4acd05a764471b2accd02000f6641881 (diff) | |
parent | c3d77fab51f40821de91a744e4b514e9e4e76a7c (diff) | |
download | op-kernel-dev-ad295b6d5739ab24880a31be403bbc8fab62e177.zip op-kernel-dev-ad295b6d5739ab24880a31be403bbc8fab62e177.tar.gz |
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-linus
Conflicts:
drivers/hid/hid-ids.h
drivers/hid/hid-sony.c
drivers/hid/i2c-hid/i2c-hid.c
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 64 |
1 files changed, 7 insertions, 57 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index f8ca312..7b88f4c 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -894,7 +894,12 @@ static int usbhid_set_raw_report(struct hid_device *hid, unsigned int reportnum, int ret, skipped_report_id = 0; /* Byte 0 is the report number. Report data starts at byte 1.*/ - buf[0] = reportnum; + if ((rtype == HID_OUTPUT_REPORT) && + (hid->quirks & HID_QUIRK_SKIP_OUTPUT_REPORT_ID)) + buf[0] = 0; + else + buf[0] = reportnum; + if (buf[0] == 0x0) { /* Don't send the Report ID */ buf++; @@ -915,59 +920,6 @@ static int usbhid_set_raw_report(struct hid_device *hid, unsigned int reportnum, return ret; } - -static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t count, - unsigned char report_type) -{ - struct usbhid_device *usbhid = hid->driver_data; - struct usb_device *dev = hid_to_usb_dev(hid); - struct usb_interface *intf = usbhid->intf; - struct usb_host_interface *interface = intf->cur_altsetting; - int ret; - - if (usbhid->urbout && report_type != HID_FEATURE_REPORT) { - int actual_length; - int skipped_report_id = 0; - - if (buf[0] == 0x0) { - /* Don't send the Report ID */ - buf++; - count--; - skipped_report_id = 1; - } - ret = usb_interrupt_msg(dev, usbhid->urbout->pipe, - buf, count, &actual_length, - USB_CTRL_SET_TIMEOUT); - /* return the number of bytes transferred */ - if (ret == 0) { - ret = actual_length; - /* count also the report id */ - if (skipped_report_id) - ret++; - } - } else { - int skipped_report_id = 0; - int report_id = buf[0]; - if (buf[0] == 0x0) { - /* Don't send the Report ID */ - buf++; - count--; - skipped_report_id = 1; - } - ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), - HID_REQ_SET_REPORT, - USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, - ((report_type + 1) << 8) | report_id, - interface->desc.bInterfaceNumber, buf, count, - USB_CTRL_SET_TIMEOUT); - /* count also the report id, if this was a numbered report. */ - if (ret > 0 && skipped_report_id) - ret++; - } - - return ret; -} - static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count) { struct usbhid_device *usbhid = hid->driver_data; @@ -975,7 +927,7 @@ static int usbhid_output_report(struct hid_device *hid, __u8 *buf, size_t count) int actual_length, skipped_report_id = 0, ret; if (!usbhid->urbout) - return -EIO; + return -ENOSYS; if (buf[0] == 0x0) { /* Don't send the Report ID */ @@ -1331,8 +1283,6 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id * usb_set_intfdata(intf, hid); hid->ll_driver = &usb_hid_driver; - hid->hid_get_raw_report = usbhid_get_raw_report; - hid->hid_output_raw_report = usbhid_output_raw_report; hid->ff_init = hid_pidff_init; #ifdef CONFIG_USB_HIDDEV hid->hiddev_connect = hiddev_connect; |