Commit 874bf9ee authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

 - kernel crash fixes for multitouch and wacom drivers, by Brent Adam
   and Dan Carpenter

 - cp2112 data packet race condition corruption fix, by Antonio Borneo

 - a few new device IDs for wacom and microsoft drivers

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: cp2112: fix to force single data-report reply
  HID: wacom: Enable pad device for older Bamboo Touch tablets
  HID: multitouch: Fix fields from pen report ID being interpreted for multitouch
  HID: microsoft: Add quirk for MS Surface Type/Touch cover
  HID: wacom: NULL dereferences on error in probe()
parents 077b2053 6debce6f
...@@ -356,6 +356,8 @@ static int cp2112_read(struct cp2112_device *dev, u8 *data, size_t size) ...@@ -356,6 +356,8 @@ static int cp2112_read(struct cp2112_device *dev, u8 *data, size_t size)
struct cp2112_force_read_report report; struct cp2112_force_read_report report;
int ret; int ret;
if (size > sizeof(dev->read_data))
size = sizeof(dev->read_data);
report.report = CP2112_DATA_READ_FORCE_SEND; report.report = CP2112_DATA_READ_FORCE_SEND;
report.length = cpu_to_be16(size); report.length = cpu_to_be16(size);
......
...@@ -778,9 +778,16 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -778,9 +778,16 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
/* /*
* some egalax touchscreens have "application == HID_DG_TOUCHSCREEN" * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
* for the stylus. * for the stylus.
* The check for mt_report_id ensures we don't process
* HID_DG_CONTACTCOUNT from the pen report as it is outside the physical
* collection, but within the report ID.
*/ */
if (field->physical == HID_DG_STYLUS) if (field->physical == HID_DG_STYLUS)
return 0; return 0;
else if ((field->physical == 0) &&
(field->report->id != td->mt_report_id) &&
(td->mt_report_id != -1))
return 0;
if (field->application == HID_DG_TOUCHSCREEN || if (field->application == HID_DG_TOUCHSCREEN ||
field->application == HID_DG_TOUCHPAD) field->application == HID_DG_TOUCHPAD)
......
...@@ -87,6 +87,9 @@ static const struct hid_blacklist { ...@@ -87,6 +87,9 @@ static const struct hid_blacklist {
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C05A, HID_QUIRK_ALWAYS_POLL }, { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C05A, HID_QUIRK_ALWAYS_POLL },
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C06A, HID_QUIRK_ALWAYS_POLL }, { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOUSE_C06A, HID_QUIRK_ALWAYS_POLL },
{ USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET }, { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_SURFACE_PRO_2, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_2, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TOUCH_COVER_2, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3_JP, HID_QUIRK_NO_INIT_REPORTS },
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER, HID_QUIRK_NO_INIT_REPORTS }, { USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER, HID_QUIRK_NO_INIT_REPORTS },
......
...@@ -1271,11 +1271,13 @@ static int wacom_register_inputs(struct wacom *wacom) ...@@ -1271,11 +1271,13 @@ static int wacom_register_inputs(struct wacom *wacom)
pad_input_dev = NULL; pad_input_dev = NULL;
wacom_wac->pad_registered = false; wacom_wac->pad_registered = false;
fail_register_pad_input: fail_register_pad_input:
input_unregister_device(touch_input_dev); if (touch_input_dev)
input_unregister_device(touch_input_dev);
wacom_wac->touch_input = NULL; wacom_wac->touch_input = NULL;
wacom_wac->touch_registered = false; wacom_wac->touch_registered = false;
fail_register_touch_input: fail_register_touch_input:
input_unregister_device(pen_input_dev); if (pen_input_dev)
input_unregister_device(pen_input_dev);
wacom_wac->pen_input = NULL; wacom_wac->pen_input = NULL;
wacom_wac->pen_registered = false; wacom_wac->pen_registered = false;
fail_register_pen_input: fail_register_pen_input:
......
...@@ -2213,6 +2213,9 @@ void wacom_setup_device_quirks(struct wacom *wacom) ...@@ -2213,6 +2213,9 @@ void wacom_setup_device_quirks(struct wacom *wacom)
features->x_max = 4096; features->x_max = 4096;
features->y_max = 4096; features->y_max = 4096;
} }
else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
features->device_type |= WACOM_DEVICETYPE_PAD;
}
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment