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

Commit 1c241131 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID fixes from Jiri Kosina:

 - a partial revert of exponent parsing changes to make "Unit" exponent
   item work properly again, by Nikolai Kondrashov

 - a few new device IDs additions piggy-backing, by AceLan Kao and David
   Herrmann

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: wiimote: add LEGO-wiimote VID
  HID: Fix unit exponent parsing again
  HID: usbhid: quirk for SiS Touchscreen
  HID: usbhid: quirk for Synaptics Large Touchccreen
parents 19eddab9 86b84167
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -319,7 +319,7 @@ static s32 item_sdata(struct hid_item *item)


static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
{
{
	__u32 raw_value;
	__s32 raw_value;
	switch (item->tag) {
	switch (item->tag) {
	case HID_GLOBAL_ITEM_TAG_PUSH:
	case HID_GLOBAL_ITEM_TAG_PUSH:


@@ -370,10 +370,11 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item)
		return 0;
		return 0;


	case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
	case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT:
		/* Units exponent negative numbers are given through a
		/* Many devices provide unit exponent as a two's complement
		 * two's complement.
		 * nibble due to the common misunderstanding of HID
		 * See "6.2.2.7 Global Items" for more information. */
		 * specification 1.11, 6.2.2.7 Global Items. Attempt to handle
		raw_value = item_udata(item);
		 * both this and the standard encoding. */
		raw_value = item_sdata(item);
		if (!(raw_value & 0xfffffff0))
		if (!(raw_value & 0xfffffff0))
			parser->global.unit_exponent = hid_snto32(raw_value, 4);
			parser->global.unit_exponent = hid_snto32(raw_value, 4);
		else
		else
@@ -1870,6 +1871,7 @@ static const struct hid_device_id hid_have_special_driver[] = {


	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
	{ }
	{ }
};
};
+6 −0
Original line number Original line Diff line number Diff line
@@ -633,6 +633,7 @@
#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN	0x0003
#define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN	0x0003


#define USB_VENDOR_ID_NINTENDO		0x057e
#define USB_VENDOR_ID_NINTENDO		0x057e
#define USB_VENDOR_ID_NINTENDO2		0x054c
#define USB_DEVICE_ID_NINTENDO_WIIMOTE	0x0306
#define USB_DEVICE_ID_NINTENDO_WIIMOTE	0x0306
#define USB_DEVICE_ID_NINTENDO_WIIMOTE2	0x0330
#define USB_DEVICE_ID_NINTENDO_WIIMOTE2	0x0330


@@ -792,6 +793,8 @@
#define USB_DEVICE_ID_SYNAPTICS_COMP_TP	0x0009
#define USB_DEVICE_ID_SYNAPTICS_COMP_TP	0x0009
#define USB_DEVICE_ID_SYNAPTICS_WTP	0x0010
#define USB_DEVICE_ID_SYNAPTICS_WTP	0x0010
#define USB_DEVICE_ID_SYNAPTICS_DPAD	0x0013
#define USB_DEVICE_ID_SYNAPTICS_DPAD	0x0013
#define USB_DEVICE_ID_SYNAPTICS_LTS1	0x0af8
#define USB_DEVICE_ID_SYNAPTICS_LTS2	0x1d10


#define USB_VENDOR_ID_THINGM		0x27b8
#define USB_VENDOR_ID_THINGM		0x27b8
#define USB_DEVICE_ID_BLINK1		0x01ed
#define USB_DEVICE_ID_BLINK1		0x01ed
@@ -919,4 +922,7 @@
#define USB_VENDOR_ID_PRIMAX	0x0461
#define USB_VENDOR_ID_PRIMAX	0x0461
#define USB_DEVICE_ID_PRIMAX_KEYBOARD	0x4e05
#define USB_DEVICE_ID_PRIMAX_KEYBOARD	0x4e05


#define USB_VENDOR_ID_SIS	0x0457
#define USB_DEVICE_ID_SIS_TS	0x1013

#endif
#endif
+4 −9
Original line number Original line Diff line number Diff line
@@ -192,6 +192,7 @@ static int hidinput_setkeycode(struct input_dev *dev,
	return -EINVAL;
	return -EINVAL;
}
}



/**
/**
 * hidinput_calc_abs_res - calculate an absolute axis resolution
 * hidinput_calc_abs_res - calculate an absolute axis resolution
 * @field: the HID report field to calculate resolution for
 * @field: the HID report field to calculate resolution for
@@ -234,23 +235,17 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
	case ABS_MT_TOOL_Y:
	case ABS_MT_TOOL_Y:
	case ABS_MT_TOUCH_MAJOR:
	case ABS_MT_TOUCH_MAJOR:
	case ABS_MT_TOUCH_MINOR:
	case ABS_MT_TOUCH_MINOR:
		if (field->unit & 0xffffff00)		/* Not a length */
		if (field->unit == 0x11) {		/* If centimeters */
			return 0;
		unit_exponent += hid_snto32(field->unit >> 4, 4) - 1;
		switch (field->unit & 0xf) {
		case 0x1:				/* If centimeters */
			/* Convert to millimeters */
			/* Convert to millimeters */
			unit_exponent += 1;
			unit_exponent += 1;
			break;
		} else if (field->unit == 0x13) {	/* If inches */
		case 0x3:				/* If inches */
			/* Convert to millimeters */
			/* Convert to millimeters */
			prev = physical_extents;
			prev = physical_extents;
			physical_extents *= 254;
			physical_extents *= 254;
			if (physical_extents < prev)
			if (physical_extents < prev)
				return 0;
				return 0;
			unit_exponent -= 1;
			unit_exponent -= 1;
			break;
		} else {
		default:
			return 0;
			return 0;
		}
		}
		break;
		break;
+4 −1
Original line number Original line Diff line number Diff line
@@ -834,7 +834,8 @@ static void wiimote_init_set_type(struct wiimote_data *wdata,
		goto done;
		goto done;
	}
	}


	if (vendor == USB_VENDOR_ID_NINTENDO) {
	if (vendor == USB_VENDOR_ID_NINTENDO ||
	    vendor == USB_VENDOR_ID_NINTENDO2) {
		if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) {
		if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) {
			devtype = WIIMOTE_DEV_GEN10;
			devtype = WIIMOTE_DEV_GEN10;
			goto done;
			goto done;
@@ -1855,6 +1856,8 @@ static void wiimote_hid_remove(struct hid_device *hdev)
static const struct hid_device_id wiimote_hid_devices[] = {
static const struct hid_device_id wiimote_hid_devices[] = {
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
				USB_DEVICE_ID_NINTENDO_WIIMOTE) },
				USB_DEVICE_ID_NINTENDO_WIIMOTE) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2,
				USB_DEVICE_ID_NINTENDO_WIIMOTE) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO,
				USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
				USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
	{ }
	{ }
+3 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,9 @@ static const struct hid_blacklist {
	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
	{ USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
	{ USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS },
	{ USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS1, HID_QUIRK_NO_INIT_REPORTS },
	{ USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2, HID_QUIRK_NO_INIT_REPORTS },
	{ USB_VENDOR_ID_SIS, USB_DEVICE_ID_SIS_TS, HID_QUIRK_NO_INIT_REPORTS },


	{ 0, 0 }
	{ 0, 0 }
};
};