Commit a7153258b70ccbe3922fcee9ca4271d4f4c2bc55
Exists in
master
and in
39 other branches
Merge branches 'upstream' and 'upstream-fixes' into for-linus
Showing 3 changed files Side-by-side Diff
drivers/hid/hid-magicmouse.c
... | ... | @@ -435,6 +435,11 @@ |
435 | 435 | if (!msc->input) |
436 | 436 | msc->input = hi->input; |
437 | 437 | |
438 | + /* Magic Trackpad does not give relative data after switching to MT */ | |
439 | + if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD && | |
440 | + field->flags & HID_MAIN_ITEM_RELATIVE) | |
441 | + return -1; | |
442 | + | |
438 | 443 | return 0; |
439 | 444 | } |
440 | 445 |
drivers/hid/hid-mosart.c
... | ... | @@ -90,6 +90,10 @@ |
90 | 90 | case 0xff000000: |
91 | 91 | /* ignore HID features */ |
92 | 92 | return -1; |
93 | + | |
94 | + case HID_UP_BUTTON: | |
95 | + /* ignore buttons */ | |
96 | + return -1; | |
93 | 97 | } |
94 | 98 | |
95 | 99 | return 0; |
... | ... | @@ -230,6 +234,19 @@ |
230 | 234 | return ret; |
231 | 235 | } |
232 | 236 | |
237 | +#ifdef CONFIG_PM | |
238 | +static int mosart_reset_resume(struct hid_device *hdev) | |
239 | +{ | |
240 | + struct hid_report_enum *re = hdev->report_enum | |
241 | + + HID_FEATURE_REPORT; | |
242 | + struct hid_report *r = re->report_id_hash[7]; | |
243 | + | |
244 | + r->field[0]->value[0] = 0x02; | |
245 | + usbhid_submit_report(hdev, r, USB_DIR_OUT); | |
246 | + return 0; | |
247 | +} | |
248 | +#endif | |
249 | + | |
233 | 250 | static void mosart_remove(struct hid_device *hdev) |
234 | 251 | { |
235 | 252 | hid_hw_stop(hdev); |
... | ... | @@ -258,6 +275,9 @@ |
258 | 275 | .input_mapped = mosart_input_mapped, |
259 | 276 | .usage_table = mosart_grabbed_usages, |
260 | 277 | .event = mosart_event, |
278 | +#ifdef CONFIG_PM | |
279 | + .reset_resume = mosart_reset_resume, | |
280 | +#endif | |
261 | 281 | }; |
262 | 282 | |
263 | 283 | static int __init mosart_init(void) |
drivers/hid/hid-picolcd.c
... | ... | @@ -1544,7 +1544,7 @@ |
1544 | 1544 | |
1545 | 1545 | /* prepare buffer with info about what we want to read (addr & len) */ |
1546 | 1546 | raw_data[0] = *off & 0xff; |
1547 | - raw_data[1] = (*off >> 8) && 0xff; | |
1547 | + raw_data[1] = (*off >> 8) & 0xff; | |
1548 | 1548 | raw_data[2] = s < 20 ? s : 20; |
1549 | 1549 | if (*off + raw_data[2] > 0xff) |
1550 | 1550 | raw_data[2] = 0x100 - *off; |
... | ... | @@ -1583,7 +1583,7 @@ |
1583 | 1583 | |
1584 | 1584 | memset(raw_data, 0, sizeof(raw_data)); |
1585 | 1585 | raw_data[0] = *off & 0xff; |
1586 | - raw_data[1] = (*off >> 8) && 0xff; | |
1586 | + raw_data[1] = (*off >> 8) & 0xff; | |
1587 | 1587 | raw_data[2] = s < 20 ? s : 20; |
1588 | 1588 | if (*off + raw_data[2] > 0xff) |
1589 | 1589 | raw_data[2] = 0x100 - *off; |
... | ... | @@ -1867,6 +1867,7 @@ |
1867 | 1867 | report->id, raw_size); |
1868 | 1868 | hid_debug_event(hdev, buff); |
1869 | 1869 | if (raw_size + 5 > sizeof(raw_data)) { |
1870 | + kfree(buff); | |
1870 | 1871 | hid_debug_event(hdev, " TOO BIG\n"); |
1871 | 1872 | return; |
1872 | 1873 | } else { |