diff options
author | Jiri Kosina <jkosina@suse.cz> | 2014-04-01 20:45:27 +0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-04-01 20:45:27 +0400 |
commit | b95dd3ca034a044471242fcbc8b8256f272b5062 (patch) | |
tree | 32a59028a1823e89214fce3149e80d65a0dda778 /drivers/hid/hidraw.c | |
parent | 2078b9bb240ea31ff3ea715881d1ec03d83e6de4 (diff) | |
parent | c3d77fab51f40821de91a744e4b514e9e4e76a7c (diff) | |
download | linux-b95dd3ca034a044471242fcbc8b8256f272b5062.tar.xz |
Merge branch 'for-3.15/hid-core-ll-transport-cleanup' into for-3.15/sony
Diffstat (limited to 'drivers/hid/hidraw.c')
-rw-r--r-- | drivers/hid/hidraw.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index f8708c93f85c..ffa648ce002e 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -123,10 +123,6 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, dev = hidraw_table[minor]->hid; - if (!dev->hid_output_raw_report) { - ret = -ENODEV; - goto out; - } if (count > HID_MAX_BUFFER_SIZE) { hid_warn(dev, "pid %d passed too large report\n", @@ -153,7 +149,21 @@ static ssize_t hidraw_send_report(struct file *file, const char __user *buffer, goto out_free; } - ret = hid_output_raw_report(dev, buf, count, report_type); + if ((report_type == HID_OUTPUT_REPORT) && + !(dev->quirks & HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP)) { + ret = hid_hw_output_report(dev, buf, count); + /* + * compatibility with old implementation of USB-HID and I2C-HID: + * if the device does not support receiving output reports, + * on an interrupt endpoint, fallback to SET_REPORT HID command. + */ + if (ret != -ENOSYS) + goto out_free; + } + + ret = hid_hw_raw_request(dev, buf[0], buf, count, report_type, + HID_REQ_SET_REPORT); + out_free: kfree(buf); out: |