diff options
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index b8470b1a10fe..e80da62363bc 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -319,7 +319,7 @@ static s32 item_sdata(struct hid_item *item) | |||
319 | 319 | ||
320 | static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) | 320 | static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) |
321 | { | 321 | { |
322 | __u32 raw_value; | 322 | __s32 raw_value; |
323 | switch (item->tag) { | 323 | switch (item->tag) { |
324 | case HID_GLOBAL_ITEM_TAG_PUSH: | 324 | case HID_GLOBAL_ITEM_TAG_PUSH: |
325 | 325 | ||
@@ -370,10 +370,11 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) | |||
370 | return 0; | 370 | return 0; |
371 | 371 | ||
372 | case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: | 372 | case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: |
373 | /* Units exponent negative numbers are given through a | 373 | /* Many devices provide unit exponent as a two's complement |
374 | * two's complement. | 374 | * nibble due to the common misunderstanding of HID |
375 | * See "6.2.2.7 Global Items" for more information. */ | 375 | * specification 1.11, 6.2.2.7 Global Items. Attempt to handle |
376 | raw_value = item_udata(item); | 376 | * both this and the standard encoding. */ |
377 | raw_value = item_sdata(item); | ||
377 | if (!(raw_value & 0xfffffff0)) | 378 | if (!(raw_value & 0xfffffff0)) |
378 | parser->global.unit_exponent = hid_snto32(raw_value, 4); | 379 | parser->global.unit_exponent = hid_snto32(raw_value, 4); |
379 | else | 380 | else |
@@ -1715,6 +1716,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1715 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, | 1716 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) }, |
1716 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, | 1717 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) }, |
1717 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, | 1718 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A067) }, |
1719 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, | ||
1718 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) }, | 1720 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_580) }, |
1719 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, | 1721 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, |
1720 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | 1722 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, |
@@ -1869,6 +1871,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1869 | 1871 | ||
1870 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, | 1872 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, |
1871 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | 1873 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
1874 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | ||
1872 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, | 1875 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
1873 | { } | 1876 | { } |
1874 | }; | 1877 | }; |