diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-01-15 12:46:14 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-01-15 12:46:14 -0500 |
commit | 0c49cd295d42d0032af11d55e2140dbec11dc8d0 (patch) | |
tree | 1e7d0e50b6b6d6e4de1fb6bb0b6d856c3932da58 /drivers/input/mouse | |
parent | 0c3e99437a66e4c869c60c2398449e6d98f3a988 (diff) | |
parent | eaa27f34e91a14cdceed26ed6c6793ec1d186115 (diff) |
Merge tag 'v3.19-rc4' into next
Merge with mainline to bring in the latest thermal and other changes.
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/alps.c | 32 | ||||
-rw-r--r-- | drivers/input/mouse/amimouse.c | 1 | ||||
-rw-r--r-- | drivers/input/mouse/elantech.c | 64 | ||||
-rw-r--r-- | drivers/input/mouse/gpio_mouse.c | 1 | ||||
-rw-r--r-- | drivers/input/mouse/navpoint.c | 1 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 7 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 9 | ||||
-rw-r--r-- | drivers/input/mouse/vsxxxaa.c | 2 |
8 files changed, 89 insertions, 28 deletions
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index dd2fd397466a..f719f28d370c 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -846,8 +846,8 @@ static void alps_process_packet_v4(struct psmouse *psmouse) | |||
846 | f->fingers = alps_process_bitmap(priv, f); | 846 | f->fingers = alps_process_bitmap(priv, f); |
847 | } | 847 | } |
848 | 848 | ||
849 | f->left = packet[4] & 0x01; | 849 | f->left = !!(packet[4] & 0x01); |
850 | f->right = packet[4] & 0x02; | 850 | f->right = !!(packet[4] & 0x02); |
851 | 851 | ||
852 | f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | | 852 | f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | |
853 | ((packet[0] & 0x30) >> 4); | 853 | ((packet[0] & 0x30) >> 4); |
@@ -1238,7 +1238,13 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
1238 | { | 1238 | { |
1239 | struct alps_data *priv = psmouse->private; | 1239 | struct alps_data *priv = psmouse->private; |
1240 | 1240 | ||
1241 | if ((psmouse->packet[0] & 0xc8) == 0x08) { /* PS/2 packet */ | 1241 | /* |
1242 | * Check if we are dealing with a bare PS/2 packet, presumably from | ||
1243 | * a device connected to the external PS/2 port. Because bare PS/2 | ||
1244 | * protocol does not have enough constant bits to self-synchronize | ||
1245 | * properly we only do this if the device is fully synchronized. | ||
1246 | */ | ||
1247 | if (!psmouse->out_of_sync_cnt && (psmouse->packet[0] & 0xc8) == 0x08) { | ||
1242 | if (psmouse->pktcnt == 3) { | 1248 | if (psmouse->pktcnt == 3) { |
1243 | alps_report_bare_ps2_packet(psmouse, psmouse->packet, | 1249 | alps_report_bare_ps2_packet(psmouse, psmouse->packet, |
1244 | true); | 1250 | true); |
@@ -1262,12 +1268,27 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse) | |||
1262 | } | 1268 | } |
1263 | 1269 | ||
1264 | /* Bytes 2 - pktsize should have 0 in the highest bit */ | 1270 | /* Bytes 2 - pktsize should have 0 in the highest bit */ |
1265 | if ((priv->proto_version < ALPS_PROTO_V5) && | 1271 | if (priv->proto_version < ALPS_PROTO_V5 && |
1266 | psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && | 1272 | psmouse->pktcnt >= 2 && psmouse->pktcnt <= psmouse->pktsize && |
1267 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { | 1273 | (psmouse->packet[psmouse->pktcnt - 1] & 0x80)) { |
1268 | psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", | 1274 | psmouse_dbg(psmouse, "refusing packet[%i] = %x\n", |
1269 | psmouse->pktcnt - 1, | 1275 | psmouse->pktcnt - 1, |
1270 | psmouse->packet[psmouse->pktcnt - 1]); | 1276 | psmouse->packet[psmouse->pktcnt - 1]); |
1277 | |||
1278 | if (priv->proto_version == ALPS_PROTO_V3 && | ||
1279 | psmouse->pktcnt == psmouse->pktsize) { | ||
1280 | /* | ||
1281 | * Some Dell boxes, such as Latitude E6440 or E7440 | ||
1282 | * with closed lid, quite often smash last byte of | ||
1283 | * otherwise valid packet with 0xff. Given that the | ||
1284 | * next packet is very likely to be valid let's | ||
1285 | * report PSMOUSE_FULL_PACKET but not process data, | ||
1286 | * rather than reporting PSMOUSE_BAD_DATA and | ||
1287 | * filling the logs. | ||
1288 | */ | ||
1289 | return PSMOUSE_FULL_PACKET; | ||
1290 | } | ||
1291 | |||
1271 | return PSMOUSE_BAD_DATA; | 1292 | return PSMOUSE_BAD_DATA; |
1272 | } | 1293 | } |
1273 | 1294 | ||
@@ -2481,6 +2502,9 @@ int alps_init(struct psmouse *psmouse) | |||
2481 | /* We are having trouble resyncing ALPS touchpads so disable it for now */ | 2502 | /* We are having trouble resyncing ALPS touchpads so disable it for now */ |
2482 | psmouse->resync_time = 0; | 2503 | psmouse->resync_time = 0; |
2483 | 2504 | ||
2505 | /* Allow 2 invalid packets without resetting device */ | ||
2506 | psmouse->resetafter = psmouse->pktsize * 2; | ||
2507 | |||
2484 | return 0; | 2508 | return 0; |
2485 | 2509 | ||
2486 | init_fail: | 2510 | init_fail: |
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c index 62ec52b2e347..a7fd8f22ba56 100644 --- a/drivers/input/mouse/amimouse.c +++ b/drivers/input/mouse/amimouse.c | |||
@@ -141,7 +141,6 @@ static struct platform_driver amimouse_driver = { | |||
141 | .remove = __exit_p(amimouse_remove), | 141 | .remove = __exit_p(amimouse_remove), |
142 | .driver = { | 142 | .driver = { |
143 | .name = "amiga-mouse", | 143 | .name = "amiga-mouse", |
144 | .owner = THIS_MODULE, | ||
145 | }, | 144 | }, |
146 | }; | 145 | }; |
147 | 146 | ||
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 06fc6e76ffbe..f2b978026407 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -428,14 +428,6 @@ static void elantech_report_trackpoint(struct psmouse *psmouse, | |||
428 | int x, y; | 428 | int x, y; |
429 | u32 t; | 429 | u32 t; |
430 | 430 | ||
431 | if (dev_WARN_ONCE(&psmouse->ps2dev.serio->dev, | ||
432 | !tp_dev, | ||
433 | psmouse_fmt("Unexpected trackpoint message\n"))) { | ||
434 | if (etd->debug == 1) | ||
435 | elantech_packet_dump(psmouse); | ||
436 | return; | ||
437 | } | ||
438 | |||
439 | t = get_unaligned_le32(&packet[0]); | 431 | t = get_unaligned_le32(&packet[0]); |
440 | 432 | ||
441 | switch (t & ~7U) { | 433 | switch (t & ~7U) { |
@@ -563,6 +555,7 @@ static void elantech_input_sync_v4(struct psmouse *psmouse) | |||
563 | } else { | 555 | } else { |
564 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 556 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); |
565 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | 557 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); |
558 | input_report_key(dev, BTN_MIDDLE, packet[0] & 0x04); | ||
566 | } | 559 | } |
567 | 560 | ||
568 | input_mt_report_pointer_emulation(dev, true); | 561 | input_mt_report_pointer_emulation(dev, true); |
@@ -792,6 +785,9 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) | |||
792 | unsigned char packet_type = packet[3] & 0x03; | 785 | unsigned char packet_type = packet[3] & 0x03; |
793 | bool sanity_check; | 786 | bool sanity_check; |
794 | 787 | ||
788 | if (etd->tp_dev && (packet[3] & 0x0f) == 0x06) | ||
789 | return PACKET_TRACKPOINT; | ||
790 | |||
795 | /* | 791 | /* |
796 | * Sanity check based on the constant bits of a packet. | 792 | * Sanity check based on the constant bits of a packet. |
797 | * The constant bits change depending on the value of | 793 | * The constant bits change depending on the value of |
@@ -877,10 +873,19 @@ static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse) | |||
877 | 873 | ||
878 | case 4: | 874 | case 4: |
879 | packet_type = elantech_packet_check_v4(psmouse); | 875 | packet_type = elantech_packet_check_v4(psmouse); |
880 | if (packet_type == PACKET_UNKNOWN) | 876 | switch (packet_type) { |
877 | case PACKET_UNKNOWN: | ||
881 | return PSMOUSE_BAD_DATA; | 878 | return PSMOUSE_BAD_DATA; |
882 | 879 | ||
883 | elantech_report_absolute_v4(psmouse, packet_type); | 880 | case PACKET_TRACKPOINT: |
881 | elantech_report_trackpoint(psmouse, packet_type); | ||
882 | break; | ||
883 | |||
884 | default: | ||
885 | elantech_report_absolute_v4(psmouse, packet_type); | ||
886 | break; | ||
887 | } | ||
888 | |||
884 | break; | 889 | break; |
885 | } | 890 | } |
886 | 891 | ||
@@ -1120,6 +1125,22 @@ static void elantech_set_buttonpad_prop(struct psmouse *psmouse) | |||
1120 | } | 1125 | } |
1121 | 1126 | ||
1122 | /* | 1127 | /* |
1128 | * Some hw_version 4 models do have a middle button | ||
1129 | */ | ||
1130 | static const struct dmi_system_id elantech_dmi_has_middle_button[] = { | ||
1131 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
1132 | { | ||
1133 | /* Fujitsu H730 has a middle button */ | ||
1134 | .matches = { | ||
1135 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
1136 | DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), | ||
1137 | }, | ||
1138 | }, | ||
1139 | #endif | ||
1140 | { } | ||
1141 | }; | ||
1142 | |||
1143 | /* | ||
1123 | * Set the appropriate event bits for the input subsystem | 1144 | * Set the appropriate event bits for the input subsystem |
1124 | */ | 1145 | */ |
1125 | static int elantech_set_input_params(struct psmouse *psmouse) | 1146 | static int elantech_set_input_params(struct psmouse *psmouse) |
@@ -1138,6 +1159,8 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
1138 | __clear_bit(EV_REL, dev->evbit); | 1159 | __clear_bit(EV_REL, dev->evbit); |
1139 | 1160 | ||
1140 | __set_bit(BTN_LEFT, dev->keybit); | 1161 | __set_bit(BTN_LEFT, dev->keybit); |
1162 | if (dmi_check_system(elantech_dmi_has_middle_button)) | ||
1163 | __set_bit(BTN_MIDDLE, dev->keybit); | ||
1141 | __set_bit(BTN_RIGHT, dev->keybit); | 1164 | __set_bit(BTN_RIGHT, dev->keybit); |
1142 | 1165 | ||
1143 | __set_bit(BTN_TOUCH, dev->keybit); | 1166 | __set_bit(BTN_TOUCH, dev->keybit); |
@@ -1299,6 +1322,7 @@ ELANTECH_INT_ATTR(reg_25, 0x25); | |||
1299 | ELANTECH_INT_ATTR(reg_26, 0x26); | 1322 | ELANTECH_INT_ATTR(reg_26, 0x26); |
1300 | ELANTECH_INT_ATTR(debug, 0); | 1323 | ELANTECH_INT_ATTR(debug, 0); |
1301 | ELANTECH_INT_ATTR(paritycheck, 0); | 1324 | ELANTECH_INT_ATTR(paritycheck, 0); |
1325 | ELANTECH_INT_ATTR(crc_enabled, 0); | ||
1302 | 1326 | ||
1303 | static struct attribute *elantech_attrs[] = { | 1327 | static struct attribute *elantech_attrs[] = { |
1304 | &psmouse_attr_reg_07.dattr.attr, | 1328 | &psmouse_attr_reg_07.dattr.attr, |
@@ -1313,6 +1337,7 @@ static struct attribute *elantech_attrs[] = { | |||
1313 | &psmouse_attr_reg_26.dattr.attr, | 1337 | &psmouse_attr_reg_26.dattr.attr, |
1314 | &psmouse_attr_debug.dattr.attr, | 1338 | &psmouse_attr_debug.dattr.attr, |
1315 | &psmouse_attr_paritycheck.dattr.attr, | 1339 | &psmouse_attr_paritycheck.dattr.attr, |
1340 | &psmouse_attr_crc_enabled.dattr.attr, | ||
1316 | NULL | 1341 | NULL |
1317 | }; | 1342 | }; |
1318 | 1343 | ||
@@ -1439,6 +1464,22 @@ static int elantech_reconnect(struct psmouse *psmouse) | |||
1439 | } | 1464 | } |
1440 | 1465 | ||
1441 | /* | 1466 | /* |
1467 | * Some hw_version 4 models do not work with crc_disabled | ||
1468 | */ | ||
1469 | static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { | ||
1470 | #if defined(CONFIG_DMI) && defined(CONFIG_X86) | ||
1471 | { | ||
1472 | /* Fujitsu H730 does not work with crc_enabled == 0 */ | ||
1473 | .matches = { | ||
1474 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), | ||
1475 | DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), | ||
1476 | }, | ||
1477 | }, | ||
1478 | #endif | ||
1479 | { } | ||
1480 | }; | ||
1481 | |||
1482 | /* | ||
1442 | * Some hw_version 3 models go into error state when we try to set | 1483 | * Some hw_version 3 models go into error state when we try to set |
1443 | * bit 3 and/or bit 1 of r10. | 1484 | * bit 3 and/or bit 1 of r10. |
1444 | */ | 1485 | */ |
@@ -1513,7 +1554,8 @@ static int elantech_set_properties(struct elantech_data *etd) | |||
1513 | * The signatures of v3 and v4 packets change depending on the | 1554 | * The signatures of v3 and v4 packets change depending on the |
1514 | * value of this hardware flag. | 1555 | * value of this hardware flag. |
1515 | */ | 1556 | */ |
1516 | etd->crc_enabled = ((etd->fw_version & 0x4000) == 0x4000); | 1557 | etd->crc_enabled = (etd->fw_version & 0x4000) == 0x4000 || |
1558 | dmi_check_system(elantech_dmi_force_crc_enabled); | ||
1517 | 1559 | ||
1518 | /* Enable real hardware resolution on hw_version 3 ? */ | 1560 | /* Enable real hardware resolution on hw_version 3 ? */ |
1519 | etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table); | 1561 | etd->set_hw_resolution = !dmi_check_system(no_hw_res_dmi_table); |
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index 8c7d94200bdb..ced07391304b 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c | |||
@@ -171,7 +171,6 @@ static struct platform_driver gpio_mouse_device_driver = { | |||
171 | .remove = gpio_mouse_remove, | 171 | .remove = gpio_mouse_remove, |
172 | .driver = { | 172 | .driver = { |
173 | .name = "gpio_mouse", | 173 | .name = "gpio_mouse", |
174 | .owner = THIS_MODULE, | ||
175 | } | 174 | } |
176 | }; | 175 | }; |
177 | module_platform_driver(gpio_mouse_device_driver); | 176 | module_platform_driver(gpio_mouse_device_driver); |
diff --git a/drivers/input/mouse/navpoint.c b/drivers/input/mouse/navpoint.c index 69017279e8d7..d6e8f58a1de3 100644 --- a/drivers/input/mouse/navpoint.c +++ b/drivers/input/mouse/navpoint.c | |||
@@ -353,7 +353,6 @@ static struct platform_driver navpoint_driver = { | |||
353 | .remove = navpoint_remove, | 353 | .remove = navpoint_remove, |
354 | .driver = { | 354 | .driver = { |
355 | .name = "navpoint", | 355 | .name = "navpoint", |
356 | .owner = THIS_MODULE, | ||
357 | .pm = &navpoint_pm_ops, | 356 | .pm = &navpoint_pm_ops, |
358 | }, | 357 | }, |
359 | }; | 358 | }; |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 4a9de33a9afd..68469feda470 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -1548,16 +1548,9 @@ static int psmouse_reconnect(struct serio *serio) | |||
1548 | { | 1548 | { |
1549 | struct psmouse *psmouse = serio_get_drvdata(serio); | 1549 | struct psmouse *psmouse = serio_get_drvdata(serio); |
1550 | struct psmouse *parent = NULL; | 1550 | struct psmouse *parent = NULL; |
1551 | struct serio_driver *drv = serio->drv; | ||
1552 | unsigned char type; | 1551 | unsigned char type; |
1553 | int rc = -1; | 1552 | int rc = -1; |
1554 | 1553 | ||
1555 | if (!drv || !psmouse) { | ||
1556 | psmouse_dbg(psmouse, | ||
1557 | "reconnect request, but serio is disconnected, ignoring...\n"); | ||
1558 | return -1; | ||
1559 | } | ||
1560 | |||
1561 | mutex_lock(&psmouse_mutex); | 1554 | mutex_lock(&psmouse_mutex); |
1562 | 1555 | ||
1563 | if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { | 1556 | if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) { |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 8ae1841059b1..f89de8971bf8 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -135,14 +135,18 @@ 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 | { |
143 | (const char * const []){"LEN2001", NULL}, | 143 | (const char * const []){"LEN2001", NULL}, |
144 | 1024, 5022, 2508, 4832 | 144 | 1024, 5022, 2508, 4832 |
145 | }, | 145 | }, |
146 | { | ||
147 | (const char * const []){"LEN2006", NULL}, | ||
148 | 1264, 5675, 1171, 4688 | ||
149 | }, | ||
146 | { } | 150 | { } |
147 | }; | 151 | }; |
148 | 152 | ||
@@ -163,6 +167,7 @@ static const char * const topbuttonpad_pnp_ids[] = { | |||
163 | "LEN0036", /* T440 */ | 167 | "LEN0036", /* T440 */ |
164 | "LEN0037", | 168 | "LEN0037", |
165 | "LEN0038", | 169 | "LEN0038", |
170 | "LEN0039", /* T440s */ | ||
166 | "LEN0041", | 171 | "LEN0041", |
167 | "LEN0042", /* Yoga */ | 172 | "LEN0042", /* Yoga */ |
168 | "LEN0045", | 173 | "LEN0045", |
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 38298232124f..abd494411e69 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c | |||
@@ -128,7 +128,7 @@ static void vsxxxaa_drop_bytes(struct vsxxxaa *mouse, int num) | |||
128 | if (num >= mouse->count) { | 128 | if (num >= mouse->count) { |
129 | mouse->count = 0; | 129 | mouse->count = 0; |
130 | } else { | 130 | } else { |
131 | memmove(mouse->buf, mouse->buf + num - 1, BUFLEN - num); | 131 | memmove(mouse->buf, mouse->buf + num, BUFLEN - num); |
132 | mouse->count -= num; | 132 | mouse->count -= num; |
133 | } | 133 | } |
134 | } | 134 | } |