Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e097d12 authored by Jiri Kosina's avatar Jiri Kosina
Browse files

Merge branches 'for-4.2/upstream-fixes-devm-fixed' and 'for-4.3/upstream' into for-linus

parents 0be01712 c9b57724
Loading
Loading
Loading
Loading
+19 −0
Original line number Original line Diff line number Diff line
@@ -427,6 +427,7 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item)
{
{
	__u32 data;
	__u32 data;
	unsigned n;
	unsigned n;
	__u32 count;


	data = item_udata(item);
	data = item_udata(item);


@@ -490,6 +491,24 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item)
		if (item->size <= 2)
		if (item->size <= 2)
			data = (parser->global.usage_page << 16) + data;
			data = (parser->global.usage_page << 16) + data;


		count = data - parser->local.usage_minimum;
		if (count + parser->local.usage_index >= HID_MAX_USAGES) {
			/*
			 * We do not warn if the name is not set, we are
			 * actually pre-scanning the device.
			 */
			if (dev_name(&parser->device->dev))
				hid_warn(parser->device,
					 "ignoring exceeding usage max\n");
			data = HID_MAX_USAGES - parser->local.usage_index +
				parser->local.usage_minimum - 1;
			if (data <= 0) {
				hid_err(parser->device,
					"no more usage index available\n");
				return -1;
			}
		}

		for (n = parser->local.usage_minimum; n <= data; n++)
		for (n = parser->local.usage_minimum; n <= data; n++)
			if (hid_add_usage(parser, n)) {
			if (hid_add_usage(parser, n)) {
				dbg_hid("hid_add_usage failed\n");
				dbg_hid("hid_add_usage failed\n");
+2 −1
Original line number Original line Diff line number Diff line
@@ -922,7 +922,8 @@
#define USB_DEVICE_ID_TOUCHPACK_RTS	0x1688
#define USB_DEVICE_ID_TOUCHPACK_RTS	0x1688


#define USB_VENDOR_ID_TPV		0x25aa
#define USB_VENDOR_ID_TPV		0x25aa
#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN	0x8883
#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882	0x8882
#define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883	0x8883


#define USB_VENDOR_ID_TURBOX		0x062a
#define USB_VENDOR_ID_TURBOX		0x062a
#define USB_DEVICE_ID_TURBOX_KEYBOARD	0x0201
#define USB_DEVICE_ID_TURBOX_KEYBOARD	0x0201
+4 −1
Original line number Original line Diff line number Diff line
@@ -1166,9 +1166,12 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct


	input_event(input, usage->type, usage->code, value);
	input_event(input, usage->type, usage->code, value);


	if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY))
	if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
	    usage->type == EV_KEY && value) {
		input_sync(input);
		input_event(input, usage->type, usage->code, 0);
		input_event(input, usage->type, usage->code, 0);
	}
	}
}


void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
void hidinput_report_event(struct hid_device *hid, struct hid_report *report)
{
{
+3 −2
Original line number Original line Diff line number Diff line
@@ -164,7 +164,7 @@ static void hid_io_error(struct hid_device *hid)
	if (time_after(jiffies, usbhid->stop_retry)) {
	if (time_after(jiffies, usbhid->stop_retry)) {


		/* Retries failed, so do a port reset unless we lack bandwidth*/
		/* Retries failed, so do a port reset unless we lack bandwidth*/
		if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
		if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl)
		     && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) {
		     && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) {


			schedule_work(&usbhid->reset_work);
			schedule_work(&usbhid->reset_work);
@@ -710,6 +710,7 @@ int usbhid_open(struct hid_device *hid)
		 * Wait 50 msec for the queue to empty before allowing events
		 * Wait 50 msec for the queue to empty before allowing events
		 * to go through hid.
		 * to go through hid.
		 */
		 */
		if (res == 0 && !(hid->quirks & HID_QUIRK_ALWAYS_POLL))
			msleep(50);
			msleep(50);
		clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
		clear_bit(HID_RESUME_RUNNING, &usbhid->iofl);
	}
	}
+2 −1
Original line number Original line Diff line number Diff line
@@ -117,7 +117,8 @@ static const struct hid_blacklist {
	{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET },
	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60, HID_QUIRK_MULTI_INPUT },
Loading