diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-14 17:31:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-11-14 17:31:54 -0500 |
commit | 56c381f93d57b88a3e667a2f55137947315c17e2 (patch) | |
tree | 15960c5927472979809bdd3b6620e2d539a3933a /drivers/input | |
parent | 0861fd1c25a8ce79ae7647e384cb6555c46e1690 (diff) | |
parent | c6c748ef85c342d2726fc3c91c6a2af313af2360 (diff) |
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
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/twl4030-pwrbutton.c | 1 | ||||
-rw-r--r-- | drivers/input/mouse/alps.c | 28 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.c | 56 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 5 |
4 files changed, 83 insertions, 7 deletions
diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index fb3b63b2f85c..8400a1a34d87 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c | |||
@@ -85,6 +85,7 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | platform_set_drvdata(pdev, pwr); | 87 | platform_set_drvdata(pdev, pwr); |
88 | device_init_wakeup(&pdev->dev, true); | ||
88 | 89 | ||
89 | return 0; | 90 | return 0; |
90 | } | 91 | } |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2b0ae8cc8e51..d125a019383f 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -1156,7 +1156,13 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
1156 | { | 1156 | { |
1157 | struct alps_data *priv = psmouse->private; | 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 | if (psmouse->pktcnt == 3) { | 1166 | if (psmouse->pktcnt == 3) { |
1161 | alps_report_bare_ps2_packet(psmouse, psmouse->packet, | 1167 | alps_report_bare_ps2_packet(psmouse, psmouse->packet, |
1162 | true); | 1168 | true); |
@@ -1180,12 +1186,27 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
1180 | } | 1186 | } |
1181 | 1187 | ||
1182 | /* Bytes 2 - pktsize should have 0 in the highest bit */ | 1188 | /* Bytes 2 - pktsize should have 0 in the highest bit */ |
1183 | if ((priv->proto_version < ALPS_PROTO_V5) && | 1189 | if (priv->proto_version < ALPS_PROTO_V5 && |
1184 | psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && | 1190 | psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && |
1185 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { | 1191 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { |
1186 | psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", | 1192 | psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", |
1187 | psmouse->pktcnt - 1, | 1193 | psmouse->pktcnt - 1, |
1188 | psmouse->packet[psmouse->pktcnt - 1]); | 1194 | psmouse->packet[psmouse->pktcnt - 1]); |
1195 | |||
1196 | if (priv->proto_version == ALPS_PROTO_V3 && | ||
1197 | psmouse->pktcnt == psmouse->pktsize) { | ||
1198 | /* | ||
1199 | * Some Dell boxes, such as Latitude E6440 or E7440 | ||
1200 | * with closed lid, quite often smash last byte of | ||
1201 | * otherwise valid packet with 0xff. Given that the | ||
1202 | * next packet is very likely to be valid let's | ||
1203 | * report PSMOUSE_FULL_PACKET but not process data, | ||
1204 | * rather than reporting PSMOUSE_BAD_DATA and | ||
1205 | * filling the logs. | ||
1206 | */ | ||
1207 | return PSMOUSE_FULL_PACKET; | ||
1208 | } | ||
1209 | |||
1189 | return PSMOUSE_BAD_DATA; | 1210 | return PSMOUSE_BAD_DATA; |
1190 | } | 1211 | } |
1191 | 1212 | ||
@@ -2389,6 +2410,9 @@ int alps_init(struct psmouse *psmouse) | |||
2389 | /* We are having trouble resyncing ALPS touchpads so disable it for now */ | 2410 | /* We are having trouble resyncing ALPS touchpads so disable it for now */ |
2390 | psmouse->resync_time = 0; | 2411 | psmouse->resync_time = 0; |
2391 | 2412 | ||
2413 | /* Allow 2 invalid packets without resetting device */ | ||
2414 | psmouse->resetafter = psmouse->pktsize * 2; | ||
2415 | |||
2392 | return 0; | 2416 | return 0; |
2393 | 2417 | ||
2394 | init_fail: | 2418 | init_fail: |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 06fc6e76ffbe..3fcb6b3cb0bd 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -563,6 +563,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse) | |||
563 | } else { | 563 | } else { |
564 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 564 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); |
565 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 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 | input_mt_report_pointer_emulation(dev, true); | 569 | input_mt_report_pointer_emulation(dev, true); |
@@ -792,6 +793,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) | |||
792 | unsigned char packet_type = packet[3] & 0x03; | 793 | unsigned char packet_type = packet[3] & 0x03; |
793 | bool sanity_check; | 794 | bool sanity_check; |
794 | 795 | ||
796 | if ((packet[3] & 0x0f) == 0x06) | ||
797 | return PACKET_TRACKPOINT; | ||
798 | |||
795 | /* | 799 | /* |
796 | * Sanity check based on the constant bits of a packet. | 800 | * Sanity check based on the constant bits of a packet. |
797 | * The constant bits change depending on the value of | 801 | * The constant bits change depending on the value of |
@@ -877,10 +881,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse) | |||
877 | 881 | ||
878 | case 4: | 882 | case 4: |
879 | packet_type = elantech_packet_check_v4(psmouse); | 883 | packet_type = elantech_packet_check_v4(psmouse); |
880 | if (packet_type == PACKET_UNKNOWN) | 884 | switch (packet_type) { |
885 | case PACKET_UNKNOWN: | ||
881 | return PSMOUSE_BAD_DATA; | 886 | return PSMOUSE_BAD_DATA; |
882 | 887 | ||
883 | elantech_report_absolute_v4(psmouse, packet_type); | 888 | case PACKET_TRACKPOINT: |
889 | elantech_report_trackpoint(psmouse, packet_type); | ||
890 | break; | ||
891 | |||
892 | default: | ||
893 | elantech_report_absolute_v4(psmouse, packet_type); | ||
894 | break; | ||
895 | } | ||
896 | |||
884 | break; | 897 | break; |
885 | } | 898 | } |
886 | 899 | ||
@@ -1120,6 +1133,22 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse) | |||
1120 | } | 1133 | } |
1121 | 1134 | ||
1122 | /* | 1135 | /* |
1136 | * Some hw_version 4 models do have a middle button | ||
1137 | */ | ||
1138 | static const struct dmi_system_id elantech_dmi_has_middle_button[] = { | ||
1139 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
1140 | { | ||
1141 | /* Fujitsu H730 has a middle button */ | ||
1142 | .matches = { | ||
1143 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
1144 | DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), | ||
1145 | }, | ||
1146 | }, | ||
1147 | #endif | ||
1148 | { } | ||
1149 | }; | ||
1150 | |||
1151 | /* | ||
1123 | * Set the appropriate event bits for the input subsystem | 1152 | * Set the appropriate event bits for the input subsystem |
1124 | */ | 1153 | */ |
1125 | static int elantech_set_input_params(struct psmouse *psmouse) | 1154 | static int elantech_set_input_params(struct psmouse *psmouse) |
@@ -1138,6 +1167,8 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1138 | __clear_bit(EV_REL, dev->evbit); | 1167 | __clear_bit(EV_REL, dev->evbit); |
1139 | 1168 | ||
1140 | __set_bit(BTN_LEFT, dev->keybit); | 1169 | __set_bit(BTN_LEFT, dev->keybit); |
1170 | if (dmi_check_system(elantech_dmi_has_middle_button)) | ||
1171 | __set_bit(BTN_MIDDLE, dev->keybit); | ||
1141 | __set_bit(BTN_RIGHT, dev->keybit); | 1172 | __set_bit(BTN_RIGHT, dev->keybit); |
1142 | 1173 | ||
1143 | __set_bit(BTN_TOUCH, dev->keybit); | 1174 | __set_bit(BTN_TOUCH, dev->keybit); |
@@ -1299,6 +1330,7 @@ ELANTECH_INT_ATTR(reg_25, 0x25); | |||
1299 | ELANTECH_INT_ATTR(reg_26, 0x26); | 1330 | ELANTECH_INT_ATTR(reg_26, 0x26); |
1300 | ELANTECH_INT_ATTR(debug, 0); | 1331 | ELANTECH_INT_ATTR(debug, 0); |
1301 | ELANTECH_INT_ATTR(paritycheck, 0); | 1332 | ELANTECH_INT_ATTR(paritycheck, 0); |
1333 | ELANTECH_INT_ATTR(crc_enabled, 0); | ||
1302 | 1334 | ||
1303 | static struct attribute *elantech_attrs[] = { | 1335 | static struct attribute *elantech_attrs[] = { |
1304 | &psmouse_attr_reg_07.dattr.attr, | 1336 | &psmouse_attr_reg_07.dattr.attr, |
@@ -1313,6 +1345,7 @@ static struct attribute *elantech_attrs[] = { | |||
1313 | &psmouse_attr_reg_26.dattr.attr, | 1345 | &psmouse_attr_reg_26.dattr.attr, |
1314 | &psmouse_attr_debug.dattr.attr, | 1346 | &psmouse_attr_debug.dattr.attr, |
1315 | &psmouse_attr_paritycheck.dattr.attr, | 1347 | &psmouse_attr_paritycheck.dattr.attr, |
1348 | &psmouse_attr_crc_enabled.dattr.attr, | ||
1316 | NULL | 1349 | NULL |
1317 | }; | 1350 | }; |
1318 | 1351 | ||
@@ -1439,6 +1472,22 @@ static int elantech_reconnect(struct psmouse *psmouse) | |||
1439 | } | 1472 | } |
1440 | 1473 | ||
1441 | /* | 1474 | /* |
1475 | * Some hw_version 4 models do not work with crc_disabled | ||
1476 | */ | ||
1477 | static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { | ||
1478 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
1479 | { | ||
1480 | /* Fujitsu H730 does not work with crc_enabled == 0 */ | ||
1481 | .matches = { | ||
1482 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
1483 | DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), | ||
1484 | }, | ||
1485 | }, | ||
1486 | #endif | ||
1487 | { } | ||
1488 | }; | ||
1489 | |||
1490 | /* | ||
1442 | * Some hw_version 3 models go into error state when we try to set | 1491 | * Some hw_version 3 models go into error state when we try to set |
1443 | * bit 3 and/or bit 1 of r10. | 1492 | * bit 3 and/or bit 1 of r10. |
1444 | */ | 1493 | */ |
@@ -1513,7 +1562,8 @@ static int elantech_set_properties(struct elantech_data *etd) | |||
1513 | * The signatures of v3 and v4 packets change depending on the | 1562 | * The signatures of v3 and v4 packets change depending on the |
1514 | * value of this hardware flag. | 1563 | * value of this hardware flag. |
1515 | */ | 1564 | */ |
1516 | etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000); | 1565 | etd->crc_enabled = (etd->fw_version & 0x4000) == 0x4000 || |
1566 | dmi_check_system(elantech_dmi_force_crc_enabled); | ||
1517 | 1567 | ||
1518 | /* Enable real hardware resolution on hw_version 3 ? */ | 1568 | /* Enable real hardware resolution on hw_version 3 ? */ |
1519 | etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table); | 1569 | etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table); |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 9031a0a28ea4..2a7a9174c702 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -135,8 +135,8 @@ static const struct min_max_quirk min_max_pnpid_table[] = { | |||
135 | 1232, 5710, 1156, 4696 | 135 | 1232, 5710, 1156, 4696 |
136 | }, | 136 | }, |
137 | { | 137 | { |
138 | (const char * const []){"LEN0034", "LEN0036", "LEN2002", | 138 | (const char * const []){"LEN0034", "LEN0036", "LEN0039", |
139 | "LEN2004", NULL}, | 139 | "LEN2002", "LEN2004", NULL}, |
140 | 1024, 5112, 2024, 4832 | 140 | 1024, 5112, 2024, 4832 |
141 | }, | 141 | }, |
142 | { | 142 | { |
@@ -163,6 +163,7 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
163 | "LEN0036", /* T440 */ | 163 | "LEN0036", /* T440 */ |
164 | "LEN0037", | 164 | "LEN0037", |
165 | "LEN0038", | 165 | "LEN0038", |
166 | "LEN0039", /* T440s */ | ||
166 | "LEN0041", | 167 | "LEN0041", |
167 | "LEN0042", /* Yoga */ | 168 | "LEN0042", /* Yoga */ |
168 | "LEN0045", | 169 | "LEN0045", |