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 subsystem updates from Dmitry Torokhov:
"Mostly small fixups to PS/2 tochpad drivers (ALPS, Elantech,
Synaptics) to better deal with specific hardware"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: elantech - update the documentation
Input: elantech - provide a sysfs knob for crc_enabled
Input: elantech - report the middle button of the touchpad
Input: alps - ignore bad data on Dell Latitudes E6440 and E7440
Input: alps - allow up to 2 invalid packets without resetting device
Input: alps - ignore potential bare packets when device is out of sync
Input: elantech - fix crc_enabled for Fujitsu H730
Input: elantech - use elantech_report_trackpoint for hardware v4 too
Input: twl4030-pwrbutton - ensure a wakeup event is recorded.
Input: synaptics - add min/max quirk for Lenovo T440s

+158 -13
+75 -6
Documentation/input/elantech.txt
··· 38 38 7.2.1 Status packet 39 39 7.2.2 Head packet 40 40 7.2.3 Motion packet 41 + 8. Trackpoint (for Hardware version 3 and 4) 42 + 8.1 Registers 43 + 8.2 Native relative mode 6 byte packet format 44 + 8.2.1 Status Packet 41 45 42 46 43 47 44 48 1. Introduction 45 49 ~~~~~~~~~~~~ 46 50 47 - Currently the Linux Elantech touchpad driver is aware of two different 48 - hardware versions unimaginatively called version 1 and version 2. Version 1 49 - is found in "older" laptops and uses 4 bytes per packet. Version 2 seems to 50 - be introduced with the EeePC and uses 6 bytes per packet, and provides 51 - additional features such as position of two fingers, and width of the touch. 51 + Currently the Linux Elantech touchpad driver is aware of four different 52 + hardware versions unimaginatively called version 1,version 2, version 3 53 + and version 4. Version 1 is found in "older" laptops and uses 4 bytes per 54 + packet. Version 2 seems to be introduced with the EeePC and uses 6 bytes 55 + per packet, and provides additional features such as position of two fingers, 56 + and width of the touch. Hardware version 3 uses 6 bytes per packet (and 57 + for 2 fingers the concatenation of two 6 bytes packets) and allows tracking 58 + of up to 3 fingers. Hardware version 4 uses 6 bytes per packet, and can 59 + combine a status packet with multiple head or motion packets. Hardware version 60 + 4 allows tracking up to 5 fingers. 61 + 62 + Some Hardware version 3 and version 4 also have a trackpoint which uses a 63 + separate packet format. It is also 6 bytes per packet. 52 64 53 65 The driver tries to support both hardware versions and should be compatible 54 66 with the Xorg Synaptics touchpad driver and its graphical configuration 55 67 utilities. 68 + 69 + Note that a mouse button is also associated with either the touchpad or the 70 + trackpoint when a trackpoint is available. Disabling the Touchpad in xorg 71 + (TouchPadOff=0) will also disable the buttons associated with the touchpad. 56 72 57 73 Additionally the operation of the touchpad can be altered by adjusting the 58 74 contents of some of its internal registers. These registers are represented ··· 94 78 2. Extra knobs 95 79 ~~~~~~~~~~~ 96 80 97 - Currently the Linux Elantech touchpad driver provides two extra knobs under 81 + Currently the Linux Elantech touchpad driver provides three extra knobs under 98 82 /sys/bus/serio/drivers/psmouse/serio? for the user. 99 83 100 84 * debug ··· 127 111 Hardware version 2 does not provide the same parity bits. Only some basic 128 112 data consistency checking can be done. For now checking is disabled by 129 113 default. Currently even turning it on will do nothing. 114 + 115 + * crc_enabled 116 + 117 + Sets crc_enabled to 0/1. The name "crc_enabled" is the official name of 118 + this integrity check, even though it is not an actual cyclic redundancy 119 + check. 120 + 121 + Depending on the state of crc_enabled, certain basic data integrity 122 + verification is done by the driver on hardware version 3 and 4. The 123 + driver will reject any packet that appears corrupted. Using this knob, 124 + The state of crc_enabled can be altered with this knob. 125 + 126 + Reading the crc_enabled value will show the active value. Echoing 127 + "0" or "1" to this file will set the state to "0" or "1". 130 128 131 129 ///////////////////////////////////////////////////////////////////////////// 132 130 ··· 776 746 777 747 byte 0 ~ 2 for one finger 778 748 byte 3 ~ 5 for another 749 + 750 + 751 + 8. Trackpoint (for Hardware version 3 and 4) 752 + ========================================= 753 + 8.1 Registers 754 + ~~~~~~~~~ 755 + No special registers have been identified. 756 + 757 + 8.2 Native relative mode 6 byte packet format 758 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 759 + 8.2.1 Status Packet 760 + ~~~~~~~~~~~~~ 761 + 762 + byte 0: 763 + bit 7 6 5 4 3 2 1 0 764 + 0 0 sx sy 0 M R L 765 + byte 1: 766 + bit 7 6 5 4 3 2 1 0 767 + ~sx 0 0 0 0 0 0 0 768 + byte 2: 769 + bit 7 6 5 4 3 2 1 0 770 + ~sy 0 0 0 0 0 0 0 771 + byte 3: 772 + bit 7 6 5 4 3 2 1 0 773 + 0 0 ~sy ~sx 0 1 1 0 774 + byte 4: 775 + bit 7 6 5 4 3 2 1 0 776 + x7 x6 x5 x4 x3 x2 x1 x0 777 + byte 5: 778 + bit 7 6 5 4 3 2 1 0 779 + y7 y6 y5 y4 y3 y2 y1 y0 780 + 781 + 782 + x and y are written in two's complement spread 783 + over 9 bits with sx/sy the relative top bit and 784 + x7..x0 and y7..y0 the lower bits. 785 + ~sx is the inverse of sx, ~sy is the inverse of sy. 786 + The sign of y is opposite to what the input driver 787 + expects for a relative movement
+1
drivers/input/misc/twl4030-pwrbutton.c
··· 85 85 } 86 86 87 87 platform_set_drvdata(pdev, pwr); 88 + device_init_wakeup(&pdev->dev, true); 88 89 89 90 return 0; 90 91 }
+26 -2
drivers/input/mouse/alps.c
··· 1156 1156 { 1157 1157 struct alps_data *priv = psmouse->private; 1158 1158 1159 - if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */ 1159 + /* 1160 + * Check if we are dealing with a bare PS/2 packet, presumably from 1161 + * a device connected to the external PS/2 port. Because bare PS/2 1162 + * protocol does not have enough constant bits to self-synchronize 1163 + * properly we only do this if the device is fully synchronized. 1164 + */ 1165 + if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) { 1160 1166 if (psmouse->pktcnt == 3) { 1161 1167 alps_report_bare_ps2_packet(psmouse, psmouse->packet, 1162 1168 true); ··· 1186 1180 } 1187 1181 1188 1182 /* Bytes 2 - pktsize should have 0 in the highest bit */ 1189 - if ((priv->proto_version < ALPS_PROTO_V5) && 1183 + if (priv->proto_version < ALPS_PROTO_V5 && 1190 1184 psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && 1191 1185 (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { 1192 1186 psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", 1193 1187 psmouse->pktcnt - 1, 1194 1188 psmouse->packet[psmouse->pktcnt - 1]); 1189 + 1190 + if (priv->proto_version == ALPS_PROTO_V3 && 1191 + psmouse->pktcnt == psmouse->pktsize) { 1192 + /* 1193 + * Some Dell boxes, such as Latitude E6440 or E7440 1194 + * with closed lid, quite often smash last byte of 1195 + * otherwise valid packet with 0xff. Given that the 1196 + * next packet is very likely to be valid let's 1197 + * report PSMOUSE_FULL_PACKET but not process data, 1198 + * rather than reporting PSMOUSE_BAD_DATA and 1199 + * filling the logs. 1200 + */ 1201 + return PSMOUSE_FULL_PACKET; 1202 + } 1203 + 1195 1204 return PSMOUSE_BAD_DATA; 1196 1205 } 1197 1206 ··· 2409 2388 2410 2389 /* We are having trouble resyncing ALPS touchpads so disable it for now */ 2411 2390 psmouse->resync_time = 0; 2391 + 2392 + /* Allow 2 invalid packets without resetting device */ 2393 + psmouse->resetafter = psmouse->pktsize * 2; 2412 2394 2413 2395 return 0; 2414 2396
+53 -3
drivers/input/mouse/elantech.c
··· 563 563 } else { 564 564 input_report_key(dev, BTN_LEFT, packet[0] & 0x01); 565 565 input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); 566 + input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04); 566 567 } 567 568 568 569 input_mt_report_pointer_emulation(dev, true); ··· 793 792 unsigned char packet_type = packet[3] & 0x03; 794 793 bool sanity_check; 795 794 795 + if ((packet[3] & 0x0f) == 0x06) 796 + return PACKET_TRACKPOINT; 797 + 796 798 /* 797 799 * Sanity check based on the constant bits of a packet. 798 800 * The constant bits change depending on the value of ··· 881 877 882 878 case 4: 883 879 packet_type = elantech_packet_check_v4(psmouse); 884 - if (packet_type == PACKET_UNKNOWN) 880 + switch (packet_type) { 881 + case PACKET_UNKNOWN: 885 882 return PSMOUSE_BAD_DATA; 886 883 887 - elantech_report_absolute_v4(psmouse, packet_type); 884 + case PACKET_TRACKPOINT: 885 + elantech_report_trackpoint(psmouse, packet_type); 886 + break; 887 + 888 + default: 889 + elantech_report_absolute_v4(psmouse, packet_type); 890 + break; 891 + } 892 + 888 893 break; 889 894 } 890 895 ··· 1133 1120 } 1134 1121 1135 1122 /* 1123 + * Some hw_version 4 models do have a middle button 1124 + */ 1125 + static const struct dmi_system_id elantech_dmi_has_middle_button[] = { 1126 + #if defined(CONFIG_DMI) && defined(CONFIG_X86) 1127 + { 1128 + /* Fujitsu H730 has a middle button */ 1129 + .matches = { 1130 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1131 + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), 1132 + }, 1133 + }, 1134 + #endif 1135 + { } 1136 + }; 1137 + 1138 + /* 1136 1139 * Set the appropriate event bits for the input subsystem 1137 1140 */ 1138 1141 static int elantech_set_input_params(struct psmouse *psmouse) ··· 1167 1138 __clear_bit(EV_REL, dev->evbit); 1168 1139 1169 1140 __set_bit(BTN_LEFT, dev->keybit); 1141 + if (dmi_check_system(elantech_dmi_has_middle_button)) 1142 + __set_bit(BTN_MIDDLE, dev->keybit); 1170 1143 __set_bit(BTN_RIGHT, dev->keybit); 1171 1144 1172 1145 __set_bit(BTN_TOUCH, dev->keybit); ··· 1330 1299 ELANTECH_INT_ATTR(reg_26, 0x26); 1331 1300 ELANTECH_INT_ATTR(debug, 0); 1332 1301 ELANTECH_INT_ATTR(paritycheck, 0); 1302 + ELANTECH_INT_ATTR(crc_enabled, 0); 1333 1303 1334 1304 static struct attribute *elantech_attrs[] = { 1335 1305 &psmouse_attr_reg_07.dattr.attr, ··· 1345 1313 &psmouse_attr_reg_26.dattr.attr, 1346 1314 &psmouse_attr_debug.dattr.attr, 1347 1315 &psmouse_attr_paritycheck.dattr.attr, 1316 + &psmouse_attr_crc_enabled.dattr.attr, 1348 1317 NULL 1349 1318 }; 1350 1319 ··· 1472 1439 } 1473 1440 1474 1441 /* 1442 + * Some hw_version 4 models do not work with crc_disabled 1443 + */ 1444 + static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { 1445 + #if defined(CONFIG_DMI) && defined(CONFIG_X86) 1446 + { 1447 + /* Fujitsu H730 does not work with crc_enabled == 0 */ 1448 + .matches = { 1449 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1450 + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), 1451 + }, 1452 + }, 1453 + #endif 1454 + { } 1455 + }; 1456 + 1457 + /* 1475 1458 * Some hw_version 3 models go into error state when we try to set 1476 1459 * bit 3 and/or bit 1 of r10. 1477 1460 */ ··· 1562 1513 * The signatures of v3 and v4 packets change depending on the 1563 1514 * value of this hardware flag. 1564 1515 */ 1565 - etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000); 1516 + etd->crc_enabled = (etd->fw_version & 0x4000) == 0x4000 || 1517 + dmi_check_system(elantech_dmi_force_crc_enabled); 1566 1518 1567 1519 /* Enable real hardware resolution on hw_version 3 ? */ 1568 1520 etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table);
+3 -2
drivers/input/mouse/synaptics.c
··· 135 135 1232, 5710, 1156, 4696 136 136 }, 137 137 { 138 - (const char * const []){"LEN0034", "LEN0036", "LEN2002", 139 - "LEN2004", NULL}, 138 + (const char * const []){"LEN0034", "LEN0036", "LEN0039", 139 + "LEN2002", "LEN2004", NULL}, 140 140 1024, 5112, 2024, 4832 141 141 }, 142 142 { ··· 163 163 "LEN0036", /* T440 */ 164 164 "LEN0037", 165 165 "LEN0038", 166 + "LEN0039", /* T440s */ 166 167 "LEN0041", 167 168 "LEN0042", /* Yoga */ 168 169 "LEN0045",