Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:
"Just a couple drivers fixes (Synaptics PS/2, Xpad)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xpad - fix PowerA init quirk for some gamepad models
Input: synaptics - fix device info appearing different on reconnect

+39 -20
+19 -5
drivers/input/joystick/xpad.c
··· 476 476 }; 477 477 478 478 /* 479 - * A rumble packet is required for some PowerA pads to start 479 + * A specific rumble packet is required for some PowerA pads to start 480 480 * sending input reports. One of those pads is (0x24c6:0x543a). 481 481 */ 482 - static const u8 xboxone_zerorumble_init[] = { 482 + static const u8 xboxone_rumblebegin_init[] = { 483 + 0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00, 484 + 0x1D, 0x1D, 0xFF, 0x00, 0x00 485 + }; 486 + 487 + /* 488 + * A rumble packet with zero FF intensity will immediately 489 + * terminate the rumbling required to init PowerA pads. 490 + * This should happen fast enough that the motors don't 491 + * spin up to enough speed to actually vibrate the gamepad. 492 + */ 493 + static const u8 xboxone_rumbleend_init[] = { 483 494 0x09, 0x00, 0x00, 0x09, 0x00, 0x0F, 0x00, 0x00, 484 495 0x00, 0x00, 0x00, 0x00, 0x00 485 496 }; ··· 505 494 XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), 506 495 XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), 507 496 XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), 508 - XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_zerorumble_init), 509 - XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_zerorumble_init), 510 - XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_zerorumble_init), 497 + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init), 498 + XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumblebegin_init), 499 + XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumblebegin_init), 500 + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumbleend_init), 501 + XBOXONE_INIT_PKT(0x24c6, 0x542a, xboxone_rumbleend_init), 502 + XBOXONE_INIT_PKT(0x24c6, 0x543a, xboxone_rumbleend_init), 511 503 }; 512 504 513 505 struct xpad_output_packet {
+20 -15
drivers/input/mouse/synaptics.c
··· 535 535 } 536 536 } 537 537 538 + static bool synaptics_has_agm(struct synaptics_data *priv) 539 + { 540 + return (SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) || 541 + SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)); 542 + } 543 + 538 544 static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse) 539 545 { 540 546 static u8 param = 0xc8; 541 - struct synaptics_data *priv = psmouse->private; 542 547 int error; 543 - 544 - if (!(SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) || 545 - SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c))) 546 - return 0; 547 548 548 549 error = psmouse_sliced_command(psmouse, SYN_QUE_MODEL); 549 550 if (error) ··· 553 552 error = ps2_command(&psmouse->ps2dev, &param, PSMOUSE_CMD_SETRATE); 554 553 if (error) 555 554 return error; 556 - 557 - /* Advanced gesture mode also sends multi finger data */ 558 - priv->info.capabilities |= BIT(1); 559 555 560 556 return 0; 561 557 } ··· 576 578 if (error) 577 579 return error; 578 580 579 - if (priv->absolute_mode) { 581 + if (priv->absolute_mode && synaptics_has_agm(priv)) { 580 582 error = synaptics_set_advanced_gesture_mode(psmouse); 581 583 if (error) { 582 584 psmouse_err(psmouse, ··· 764 766 ((buf[0] & 0x04) >> 1) | 765 767 ((buf[3] & 0x04) >> 2)); 766 768 767 - if ((SYN_CAP_ADV_GESTURE(priv->info.ext_cap_0c) || 768 - SYN_CAP_IMAGE_SENSOR(priv->info.ext_cap_0c)) && 769 - hw->w == 2) { 769 + if (synaptics_has_agm(priv) && hw->w == 2) { 770 770 synaptics_parse_agm(buf, priv, hw); 771 771 return 1; 772 772 } ··· 1029 1033 synaptics_report_mt_data(psmouse, sgm, num_fingers); 1030 1034 } 1031 1035 1036 + static bool synaptics_has_multifinger(struct synaptics_data *priv) 1037 + { 1038 + if (SYN_CAP_MULTIFINGER(priv->info.capabilities)) 1039 + return true; 1040 + 1041 + /* Advanced gesture mode also sends multi finger data */ 1042 + return synaptics_has_agm(priv); 1043 + } 1044 + 1032 1045 /* 1033 1046 * called for each full received packet from the touchpad 1034 1047 */ ··· 1084 1079 if (SYN_CAP_EXTENDED(info->capabilities)) { 1085 1080 switch (hw.w) { 1086 1081 case 0 ... 1: 1087 - if (SYN_CAP_MULTIFINGER(info->capabilities)) 1082 + if (synaptics_has_multifinger(priv)) 1088 1083 num_fingers = hw.w + 2; 1089 1084 break; 1090 1085 case 2: ··· 1128 1123 input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); 1129 1124 1130 1125 input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1); 1131 - if (SYN_CAP_MULTIFINGER(info->capabilities)) { 1126 + if (synaptics_has_multifinger(priv)) { 1132 1127 input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2); 1133 1128 input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3); 1134 1129 } ··· 1288 1283 __set_bit(BTN_TOUCH, dev->keybit); 1289 1284 __set_bit(BTN_TOOL_FINGER, dev->keybit); 1290 1285 1291 - if (SYN_CAP_MULTIFINGER(info->capabilities)) { 1286 + if (synaptics_has_multifinger(priv)) { 1292 1287 __set_bit(BTN_TOOL_DOUBLETAP, dev->keybit); 1293 1288 __set_bit(BTN_TOOL_TRIPLETAP, dev->keybit); 1294 1289 }