diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2015-09-01 09:23:13 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2015-09-01 09:23:13 -0400 |
| commit | 3e097d1271ecdff2f251a54ddfc5eaa1f9821e96 (patch) | |
| tree | d84a437e8ed4c3e71521c739952ba96fd02b3781 /drivers | |
| parent | 0be017120b80f0fe3da9a8239f989a27e54828f2 (diff) | |
| parent | c9b57724b38d4c1555ee49418be3d76801e3327c (diff) | |
Merge branches 'for-4.2/upstream-fixes-devm-fixed' and 'for-4.3/upstream' into for-linus
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/hid/hid-core.c | 19 | ||||
| -rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
| -rw-r--r-- | drivers/hid/hid-input.c | 5 | ||||
| -rw-r--r-- | drivers/hid/usbhid/hid-core.c | 5 | ||||
| -rw-r--r-- | drivers/hid/usbhid/hid-quirks.c | 3 | ||||
| -rw-r--r-- | drivers/hid/wacom_sys.c | 11 |
6 files changed, 34 insertions, 12 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 157c62775053..b403fe2c5cbe 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -427,6 +427,7 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item) | |||
| 427 | { | 427 | { |
| 428 | __u32 data; | 428 | __u32 data; |
| 429 | unsigned n; | 429 | unsigned n; |
| 430 | __u32 count; | ||
| 430 | 431 | ||
| 431 | data = item_udata(item); | 432 | data = item_udata(item); |
| 432 | 433 | ||
| @@ -490,6 +491,24 @@ static int hid_parser_local(struct hid_parser *parser, struct hid_item *item) | |||
| 490 | if (item->size <= 2) | 491 | if (item->size <= 2) |
| 491 | data = (parser->global.usage_page << 16) + data; | 492 | data = (parser->global.usage_page << 16) + data; |
| 492 | 493 | ||
| 494 | count = data - parser->local.usage_minimum; | ||
| 495 | if (count + parser->local.usage_index >= HID_MAX_USAGES) { | ||
| 496 | /* | ||
| 497 | * We do not warn if the name is not set, we are | ||
| 498 | * actually pre-scanning the device. | ||
| 499 | */ | ||
| 500 | if (dev_name(&parser->device->dev)) | ||
| 501 | hid_warn(parser->device, | ||
| 502 | "ignoring exceeding usage max\n"); | ||
| 503 | data = HID_MAX_USAGES - parser->local.usage_index + | ||
| 504 | parser->local.usage_minimum - 1; | ||
| 505 | if (data <= 0) { | ||
| 506 | hid_err(parser->device, | ||
| 507 | "no more usage index available\n"); | ||
| 508 | return -1; | ||
| 509 | } | ||
| 510 | } | ||
| 511 | |||
| 493 | for (n = parser->local.usage_minimum; n <= data; n++) | 512 | for (n = parser->local.usage_minimum; n <= data; n++) |
| 494 | if (hid_add_usage(parser, n)) { | 513 | if (hid_add_usage(parser, n)) { |
| 495 | dbg_hid("hid_add_usage failed\n"); | 514 | dbg_hid("hid_add_usage failed\n"); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index b04b0820d816..0de3284a3e24 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -922,7 +922,8 @@ | |||
| 922 | #define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688 | 922 | #define USB_DEVICE_ID_TOUCHPACK_RTS 0x1688 |
| 923 | 923 | ||
| 924 | #define USB_VENDOR_ID_TPV 0x25aa | 924 | #define USB_VENDOR_ID_TPV 0x25aa |
| 925 | #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN 0x8883 | 925 | #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882 0x8882 |
| 926 | #define USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883 0x8883 | ||
| 926 | 927 | ||
| 927 | #define USB_VENDOR_ID_TURBOX 0x062a | 928 | #define USB_VENDOR_ID_TURBOX 0x062a |
| 928 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 | 929 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index e3c63640df73..53aeaf6252c7 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
| @@ -1166,8 +1166,11 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct | |||
| 1166 | 1166 | ||
| 1167 | input_event(input, usage->type, usage->code, value); | 1167 | input_event(input, usage->type, usage->code, value); |
| 1168 | 1168 | ||
| 1169 | if ((field->flags & HID_MAIN_ITEM_RELATIVE) && (usage->type == EV_KEY)) | 1169 | if ((field->flags & HID_MAIN_ITEM_RELATIVE) && |
| 1170 | usage->type == EV_KEY && value) { | ||
| 1171 | input_sync(input); | ||
| 1170 | input_event(input, usage->type, usage->code, 0); | 1172 | input_event(input, usage->type, usage->code, 0); |
| 1173 | } | ||
| 1171 | } | 1174 | } |
| 1172 | 1175 | ||
| 1173 | void hidinput_report_event(struct hid_device *hid, struct hid_report *report) | 1176 | void hidinput_report_event(struct hid_device *hid, struct hid_report *report) |
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index bfbe1bedda7f..36712e9f56c2 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
| @@ -164,7 +164,7 @@ static void hid_io_error(struct hid_device *hid) | |||
| 164 | if (time_after(jiffies, usbhid->stop_retry)) { | 164 | if (time_after(jiffies, usbhid->stop_retry)) { |
| 165 | 165 | ||
| 166 | /* Retries failed, so do a port reset unless we lack bandwidth*/ | 166 | /* Retries failed, so do a port reset unless we lack bandwidth*/ |
| 167 | if (test_bit(HID_NO_BANDWIDTH, &usbhid->iofl) | 167 | if (!test_bit(HID_NO_BANDWIDTH, &usbhid->iofl) |
| 168 | && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) { | 168 | && !test_and_set_bit(HID_RESET_PENDING, &usbhid->iofl)) { |
| 169 | 169 | ||
| 170 | schedule_work(&usbhid->reset_work); | 170 | schedule_work(&usbhid->reset_work); |
| @@ -710,7 +710,8 @@ int usbhid_open(struct hid_device *hid) | |||
| 710 | * Wait 50 msec for the queue to empty before allowing events | 710 | * Wait 50 msec for the queue to empty before allowing events |
| 711 | * to go through hid. | 711 | * to go through hid. |
| 712 | */ | 712 | */ |
| 713 | msleep(50); | 713 | if (res == 0 && !(hid->quirks & HID_QUIRK_ALWAYS_POLL)) |
| 714 | msleep(50); | ||
| 714 | clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); | 715 | clear_bit(HID_RESUME_RUNNING, &usbhid->iofl); |
| 715 | } | 716 | } |
| 716 | done: | 717 | done: |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 20f9a653444c..965432e413c6 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
| @@ -117,7 +117,8 @@ static const struct hid_blacklist { | |||
| 117 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 117 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
| 118 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET }, | 118 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_1, HID_QUIRK_NOGET }, |
| 119 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET }, | 119 | { USB_VENDOR_ID_SYMBOL, USB_DEVICE_ID_SYMBOL_SCANNER_2, HID_QUIRK_NOGET }, |
| 120 | { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN, HID_QUIRK_NOGET }, | 120 | { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8882, HID_QUIRK_NOGET }, |
| 121 | { USB_VENDOR_ID_TPV, USB_DEVICE_ID_TPV_OPTICAL_TOUCHSCREEN_8883, HID_QUIRK_NOGET }, | ||
| 121 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, | 122 | { USB_VENDOR_ID_TURBOX, USB_DEVICE_ID_TURBOX_KEYBOARD, HID_QUIRK_NOGET }, |
| 122 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT }, | 123 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_KNA5, HID_QUIRK_MULTI_INPUT }, |
| 123 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60, HID_QUIRK_MULTI_INPUT }, | 124 | { USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWA60, HID_QUIRK_MULTI_INPUT }, |
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 01b937e63cf3..5cdb04472023 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
| @@ -335,7 +335,7 @@ static int wacom_set_device_mode(struct hid_device *hdev, int report_id, | |||
| 335 | if (error >= 0) | 335 | if (error >= 0) |
| 336 | error = wacom_get_report(hdev, HID_FEATURE_REPORT, | 336 | error = wacom_get_report(hdev, HID_FEATURE_REPORT, |
| 337 | rep_data, length, 1); | 337 | rep_data, length, 1); |
| 338 | } while ((error < 0 || rep_data[1] != mode) && limit++ < WAC_MSG_RETRIES); | 338 | } while (error >= 0 && rep_data[1] != mode && limit++ < WAC_MSG_RETRIES); |
| 339 | 339 | ||
| 340 | kfree(rep_data); | 340 | kfree(rep_data); |
| 341 | 341 | ||
| @@ -1149,12 +1149,9 @@ static void wacom_free_inputs(struct wacom *wacom) | |||
| 1149 | { | 1149 | { |
| 1150 | struct wacom_wac *wacom_wac = &(wacom->wacom_wac); | 1150 | struct wacom_wac *wacom_wac = &(wacom->wacom_wac); |
| 1151 | 1151 | ||
| 1152 | if (wacom_wac->pen_input) | 1152 | input_free_device(wacom_wac->pen_input); |
| 1153 | input_free_device(wacom_wac->pen_input); | 1153 | input_free_device(wacom_wac->touch_input); |
| 1154 | if (wacom_wac->touch_input) | 1154 | input_free_device(wacom_wac->pad_input); |
| 1155 | input_free_device(wacom_wac->touch_input); | ||
| 1156 | if (wacom_wac->pad_input) | ||
| 1157 | input_free_device(wacom_wac->pad_input); | ||
| 1158 | wacom_wac->pen_input = NULL; | 1155 | wacom_wac->pen_input = NULL; |
| 1159 | wacom_wac->touch_input = NULL; | 1156 | wacom_wac->touch_input = NULL; |
| 1160 | wacom_wac->pad_input = NULL; | 1157 | wacom_wac->pad_input = NULL; |
