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

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

Pull some more input subsystem updates from Dmitry Torokhov:
"An update to the ALPS driver to support the V8 protocol with
touchstick, a change for i8042 to skip selftest on many Asus laptops
which helps to keep their touchpads working after resume, and a couple
other driver fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: i8042 - skip selftest on ASUS laptops
Input: melfas_mip4 - add ic_name sysfs attribute
Input: melfas_mip4 - add maintainer information
Input: melfas_mip4 - add devicetree binding documentations
Input: elantech - add Fujitsu Lifebook E556 to force crc_enabled
Input: synaptics-rmi4 - fix error handling in I2C transport driver
Input: synaptics-rmi4 - fix error handling in SPI transport driver
Input: ALPS - add V8 protocol documentation
Input: ALPS - set DualPoint flag for 74 03 28 devices
Input: ALPS - allow touchsticks to report pressure
Input: ALPS - handle 0-pressure 1F events
Input: ALPS - add touchstick support for SS5 hardware
Input: elantech - force needed quirks on Fujitsu H760
Input: elantech - fix Lenovo version typo

+411 -59
+21
Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt
··· 1 + * MELFAS MIP4 Touchscreen 2 + 3 + Required properties: 4 + - compatible: must be "melfas,mip4_ts" 5 + - reg: I2C slave address of the chip (0x48 or 0x34) 6 + - interrupt-parent: interrupt controller to which the chip is connected 7 + - interrupts: interrupt to which the chip is connected 8 + 9 + Optional properties: 10 + - ce-gpios: GPIO connected to the CE (chip enable) pin of the chip 11 + 12 + Example: 13 + i2c@00000000 { 14 + touchscreen: melfas_mip4@48 { 15 + compatible = "melfas,mip4_ts"; 16 + reg = <0x48>; 17 + interrupt-parent = <&gpio>; 18 + interrupts = <0 IRQ_TYPE_EDGE_FALLING>; 19 + ce-gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; 20 + }; 21 + };
+1
Documentation/devicetree/bindings/vendor-prefixes.txt
··· 163 163 meas Measurement Specialties 164 164 mediatek MediaTek Inc. 165 165 melexis Melexis N.V. 166 + melfas MELFAS Inc. 166 167 merrii Merrii Technology Co., Ltd. 167 168 micrel Micrel Inc. 168 169 microchip Microchip Technology Inc.
+57
Documentation/input/alps.txt
··· 319 319 otherwise byte 0 bit 4 must be set and byte 0/4/5 are 320 320 in NEW fmt 321 321 F: Number of fingers - 3, 0 means 3 fingers, 1 means 4 ... 322 + 323 + 324 + ALPS Absolute Mode - Protocol Version 8 325 + --------------------------------------- 326 + 327 + Spoken by SS4 (73 03 14) and SS5 (73 03 28) hardware. 328 + 329 + The packet type is given by the APD field, bits 4-5 of byte 3. 330 + 331 + Touchpad packet (APD = 0x2): 332 + 333 + b7 b6 b5 b4 b3 b2 b1 b0 334 + byte 0: SWM SWR SWL 1 1 0 0 X7 335 + byte 1: 0 X6 X5 X4 X3 X2 X1 X0 336 + byte 2: 0 Y6 Y5 Y4 Y3 Y2 Y1 Y0 337 + byte 3: 0 T&P 1 0 1 0 0 Y7 338 + byte 4: 0 Z6 Z5 Z4 Z3 Z2 Z1 Z0 339 + byte 5: 0 0 0 0 0 0 0 0 340 + 341 + SWM, SWR, SWL: Middle, Right, and Left button states 342 + 343 + Touchpad 1 Finger packet (APD = 0x0): 344 + 345 + b7 b6 b5 b4 b3 b2 b1 b0 346 + byte 0: SWM SWR SWL 1 1 X2 X1 X0 347 + byte 1: X9 X8 X7 1 X6 X5 X4 X3 348 + byte 2: 0 X11 X10 LFB Y3 Y2 Y1 Y0 349 + byte 3: Y5 Y4 0 0 1 TAPF2 TAPF1 TAPF0 350 + byte 4: Zv7 Y11 Y10 1 Y9 Y8 Y7 Y6 351 + byte 5: Zv6 Zv5 Zv4 0 Zv3 Zv2 Zv1 Zv0 352 + 353 + TAPF: ??? 354 + LFB: ??? 355 + 356 + Touchpad 2 Finger packet (APD = 0x1): 357 + 358 + b7 b6 b5 b4 b3 b2 b1 b0 359 + byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4 360 + byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0 361 + byte 2: AY11 AY10 AY9 CONT AY8 AY7 AY6 AY5 362 + byte 3: 0 0 0 1 1 BX6 BX5 BX4 363 + byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0 364 + byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5 365 + 366 + CONT: A 3-or-4 Finger packet is to follow 367 + 368 + Touchpad 3-or-4 Finger packet (APD = 0x3): 369 + 370 + b7 b6 b5 b4 b3 b2 b1 b0 371 + byte 0: SWM SWR SWL 1 1 AX6 AX5 AX4 372 + byte 1: AX11 AX10 AX9 AX8 AX7 AZ1 AY4 AZ0 373 + byte 2: AY11 AY10 AY9 OVF AY8 AY7 AY6 AY5 374 + byte 3: 0 0 1 1 1 BX6 BX5 BX4 375 + byte 4: BX11 BX10 BX9 BX8 BX7 BZ1 BY4 BZ0 376 + byte 5: BY11 BY10 BY9 0 BY8 BY7 BY5 BY5 377 + 378 + OVF: 5th finger detected
+8 -1
Documentation/kernel-parameters.txt
··· 1511 1511 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 1512 1512 controllers 1513 1513 i8042.notimeout [HW] Ignore timeout condition signalled by controller 1514 - i8042.reset [HW] Reset the controller during init and cleanup 1514 + i8042.reset [HW] Reset the controller during init, cleanup and 1515 + suspend-to-ram transitions, only during s2r 1516 + transitions, or never reset 1517 + Format: { 1 | Y | y | 0 | N | n } 1518 + 1, Y, y: always reset controller 1519 + 0, N, n: don't ever reset controller 1520 + Default: only on s2r transitions on x86; most other 1521 + architectures force reset to be always executed 1515 1522 i8042.unlock [HW] Unlock (ignore) the keylock 1516 1523 i8042.kbdreset [HW] Reset device connected to KBD port 1517 1524
+7
MAINTAINERS
··· 7829 7829 F: drivers/scsi/megaraid.* 7830 7830 F: drivers/scsi/megaraid/ 7831 7831 7832 + MELFAS MIP4 TOUCHSCREEN DRIVER 7833 + M: Sangwon Jee <jeesw@melfas.com> 7834 + W: http://www.melfas.com 7835 + S: Supported 7836 + F: drivers/input/touchscreen/melfas_mip4.c 7837 + F: Documentation/devicetree/bindings/input/touchscreen/melfas_mip4.txt 7838 + 7832 7839 MELLANOX ETHERNET DRIVER (mlx4_en) 7833 7840 M: Tariq Toukan <tariqt@mellanox.com> 7834 7841 L: netdev@vger.kernel.org
+75 -12
drivers/input/mouse/alps.c
··· 103 103 6-byte ALPS packet */ 104 104 #define ALPS_STICK_BITS 0x100 /* separate stick button bits */ 105 105 #define ALPS_BUTTONPAD 0x200 /* device is a clickpad */ 106 + #define ALPS_DUALPOINT_WITH_PRESSURE 0x400 /* device can report trackpoint pressure */ 106 107 107 108 static const struct alps_model_info alps_model_data[] = { 108 109 { { 0x32, 0x02, 0x14 }, 0x00, { ALPS_PROTO_V2, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT } }, /* Toshiba Salellite Pro M10 */ ··· 1157 1156 { 1158 1157 unsigned char pkt_id = SS4_PACKET_ID_IDLE; 1159 1158 1160 - if (byte[0] == 0x18 && byte[1] == 0x10 && byte[2] == 0x00 && 1161 - (byte[3] & 0x88) == 0x08 && byte[4] == 0x10 && byte[5] == 0x00) { 1162 - pkt_id = SS4_PACKET_ID_IDLE; 1163 - } else if (!(byte[3] & 0x10)) { 1164 - pkt_id = SS4_PACKET_ID_ONE; 1165 - } else if (!(byte[3] & 0x20)) { 1159 + switch (byte[3] & 0x30) { 1160 + case 0x00: 1161 + if (byte[0] == 0x18 && byte[1] == 0x10 && byte[2] == 0x00 && 1162 + (byte[3] & 0x88) == 0x08 && byte[4] == 0x10 && 1163 + byte[5] == 0x00) { 1164 + pkt_id = SS4_PACKET_ID_IDLE; 1165 + } else { 1166 + pkt_id = SS4_PACKET_ID_ONE; 1167 + } 1168 + break; 1169 + case 0x10: 1170 + /* two-finger finger positions */ 1166 1171 pkt_id = SS4_PACKET_ID_TWO; 1167 - } else { 1172 + break; 1173 + case 0x20: 1174 + /* stick pointer */ 1175 + pkt_id = SS4_PACKET_ID_STICK; 1176 + break; 1177 + case 0x30: 1178 + /* third and fourth finger positions */ 1168 1179 pkt_id = SS4_PACKET_ID_MULTI; 1180 + break; 1169 1181 } 1170 1182 1171 1183 return pkt_id; ··· 1199 1185 f->mt[0].x = SS4_1F_X_V2(p); 1200 1186 f->mt[0].y = SS4_1F_Y_V2(p); 1201 1187 f->pressure = ((SS4_1F_Z_V2(p)) * 2) & 0x7f; 1202 - f->fingers = 1; 1188 + /* 1189 + * When a button is held the device will give us events 1190 + * with x, y, and pressure of 0. This causes annoying jumps 1191 + * if a touch is released while the button is held. 1192 + * Handle this by claiming zero contacts. 1193 + */ 1194 + f->fingers = f->pressure > 0 ? 1 : 0; 1203 1195 f->first_mp = 0; 1204 1196 f->is_mp = 0; 1205 1197 break; ··· 1266 1246 } 1267 1247 break; 1268 1248 1249 + case SS4_PACKET_ID_STICK: 1250 + if (!(priv->flags & ALPS_DUALPOINT)) { 1251 + psmouse_warn(psmouse, 1252 + "Rejected trackstick packet from non DualPoint device"); 1253 + } else { 1254 + int x = (s8)(((p[0] & 1) << 7) | (p[1] & 0x7f)); 1255 + int y = (s8)(((p[3] & 1) << 7) | (p[2] & 0x7f)); 1256 + int pressure = (s8)(p[4] & 0x7f); 1257 + 1258 + input_report_rel(priv->dev2, REL_X, x); 1259 + input_report_rel(priv->dev2, REL_Y, -y); 1260 + input_report_abs(priv->dev2, ABS_PRESSURE, pressure); 1261 + } 1262 + break; 1263 + 1269 1264 case SS4_PACKET_ID_IDLE: 1270 1265 default: 1271 1266 memset(f, 0, sizeof(struct alps_fields)); 1272 1267 break; 1273 1268 } 1274 1269 1275 - f->left = !!(SS4_BTN_V2(p) & 0x01); 1276 - if (!(priv->flags & ALPS_BUTTONPAD)) { 1277 - f->right = !!(SS4_BTN_V2(p) & 0x02); 1278 - f->middle = !!(SS4_BTN_V2(p) & 0x04); 1270 + /* handle buttons */ 1271 + if (pkt_id == SS4_PACKET_ID_STICK) { 1272 + f->ts_left = !!(SS4_BTN_V2(p) & 0x01); 1273 + if (!(priv->flags & ALPS_BUTTONPAD)) { 1274 + f->ts_right = !!(SS4_BTN_V2(p) & 0x02); 1275 + f->ts_middle = !!(SS4_BTN_V2(p) & 0x04); 1276 + } 1277 + } else { 1278 + f->left = !!(SS4_BTN_V2(p) & 0x01); 1279 + if (!(priv->flags & ALPS_BUTTONPAD)) { 1280 + f->right = !!(SS4_BTN_V2(p) & 0x02); 1281 + f->middle = !!(SS4_BTN_V2(p) & 0x04); 1282 + } 1279 1283 } 1280 1284 1281 1285 return 0; ··· 1310 1266 struct alps_data *priv = psmouse->private; 1311 1267 unsigned char *packet = psmouse->packet; 1312 1268 struct input_dev *dev = psmouse->dev; 1269 + struct input_dev *dev2 = priv->dev2; 1313 1270 struct alps_fields *f = &priv->f; 1314 1271 1315 1272 memset(f, 0, sizeof(struct alps_fields)); ··· 1356 1311 1357 1312 input_report_abs(dev, ABS_PRESSURE, f->pressure); 1358 1313 input_sync(dev); 1314 + 1315 + if (priv->flags & ALPS_DUALPOINT) { 1316 + input_report_key(dev2, BTN_LEFT, f->ts_left); 1317 + input_report_key(dev2, BTN_RIGHT, f->ts_right); 1318 + input_report_key(dev2, BTN_MIDDLE, f->ts_middle); 1319 + input_sync(dev2); 1320 + } 1359 1321 } 1360 1322 1361 1323 static bool alps_is_valid_package_ss4_v2(struct psmouse *psmouse) ··· 2747 2695 if (alps_set_defaults_ss4_v2(psmouse, priv)) 2748 2696 return -EIO; 2749 2697 2698 + if (priv->fw_ver[1] == 0x1) 2699 + priv->flags |= ALPS_DUALPOINT | 2700 + ALPS_DUALPOINT_WITH_PRESSURE; 2701 + 2750 2702 break; 2751 2703 } 2752 2704 ··· 2822 2766 protocol = &alps_v3_protocol_data; 2823 2767 } else if (e7[0] == 0x73 && e7[1] == 0x03 && 2824 2768 e7[2] == 0x14 && ec[1] == 0x02) { 2769 + protocol = &alps_v8_protocol_data; 2770 + } else if (e7[0] == 0x73 && e7[1] == 0x03 && 2771 + e7[2] == 0x28 && ec[1] == 0x01) { 2825 2772 protocol = &alps_v8_protocol_data; 2826 2773 } else { 2827 2774 psmouse_dbg(psmouse, ··· 3008 2949 3009 2950 input_set_capability(dev2, EV_REL, REL_X); 3010 2951 input_set_capability(dev2, EV_REL, REL_Y); 2952 + if (priv->flags & ALPS_DUALPOINT_WITH_PRESSURE) { 2953 + input_set_capability(dev2, EV_ABS, ABS_PRESSURE); 2954 + input_set_abs_params(dev2, ABS_PRESSURE, 0, 127, 0, 0); 2955 + } 3011 2956 input_set_capability(dev2, EV_KEY, BTN_LEFT); 3012 2957 input_set_capability(dev2, EV_KEY, BTN_RIGHT); 3013 2958 input_set_capability(dev2, EV_KEY, BTN_MIDDLE);
+2
drivers/input/mouse/alps.h
··· 37 37 * or there's button activities. 38 38 * SS4_PACKET_ID_TWO: There's two or more fingers on touchpad 39 39 * SS4_PACKET_ID_MULTI: There's three or more fingers on touchpad 40 + * SS4_PACKET_ID_STICK: A stick pointer packet 40 41 */ 41 42 enum SS4_PACKET_ID { 42 43 SS4_PACKET_ID_IDLE = 0, 43 44 SS4_PACKET_ID_ONE, 44 45 SS4_PACKET_ID_TWO, 45 46 SS4_PACKET_ID_MULTI, 47 + SS4_PACKET_ID_STICK, 46 48 }; 47 49 48 50 #define SS4_COUNT_PER_ELECTRODE 256
+24 -3
drivers/input/mouse/elantech.c
··· 1134 1134 * System76 Pangolin 0x250f01 ? 2 hw buttons 1135 1135 * (*) + 3 trackpoint buttons 1136 1136 * (**) + 0 trackpoint buttons 1137 - * Note: Lenovo L430 and Lenovo L430 have the same fw_version/caps 1137 + * Note: Lenovo L430 and Lenovo L530 have the same fw_version/caps 1138 1138 */ 1139 1139 static void elantech_set_buttonpad_prop(struct psmouse *psmouse) 1140 1140 { ··· 1157 1157 .matches = { 1158 1158 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1159 1159 DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H730"), 1160 + }, 1161 + }, 1162 + { 1163 + /* Fujitsu H760 also has a middle button */ 1164 + .matches = { 1165 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1166 + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"), 1160 1167 }, 1161 1168 }, 1162 1169 #endif ··· 1510 1503 }, 1511 1504 }, 1512 1505 { 1513 - /* Fujitsu LIFEBOOK E554 does not work with crc_enabled == 0 */ 1506 + /* Fujitsu H760 does not work with crc_enabled == 0 */ 1514 1507 .matches = { 1515 1508 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1516 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E554"), 1509 + DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"), 1517 1510 }, 1518 1511 }, 1519 1512 { ··· 1521 1514 .matches = { 1522 1515 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1523 1516 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"), 1517 + }, 1518 + }, 1519 + { 1520 + /* Fujitsu LIFEBOOK E554 does not work with crc_enabled == 0 */ 1521 + .matches = { 1522 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1523 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E554"), 1524 + }, 1525 + }, 1526 + { 1527 + /* Fujitsu LIFEBOOK E556 does not work with crc_enabled == 0 */ 1528 + .matches = { 1529 + DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 1530 + DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E556"), 1524 1531 }, 1525 1532 }, 1526 1533 {
+26 -12
drivers/input/rmi4/rmi_i2c.c
··· 221 221 MODULE_DEVICE_TABLE(of, rmi_i2c_of_match); 222 222 #endif 223 223 224 + static void rmi_i2c_regulator_bulk_disable(void *data) 225 + { 226 + struct rmi_i2c_xport *rmi_i2c = data; 227 + 228 + regulator_bulk_disable(ARRAY_SIZE(rmi_i2c->supplies), 229 + rmi_i2c->supplies); 230 + } 231 + 232 + static void rmi_i2c_unregister_transport(void *data) 233 + { 234 + struct rmi_i2c_xport *rmi_i2c = data; 235 + 236 + rmi_unregister_transport_device(&rmi_i2c->xport); 237 + } 238 + 224 239 static int rmi_i2c_probe(struct i2c_client *client, 225 240 const struct i2c_device_id *id) 226 241 { ··· 279 264 if (retval < 0) 280 265 return retval; 281 266 267 + retval = devm_add_action_or_reset(&client->dev, 268 + rmi_i2c_regulator_bulk_disable, 269 + rmi_i2c); 270 + if (retval) 271 + return retval; 272 + 282 273 of_property_read_u32(client->dev.of_node, "syna,startup-delay-ms", 283 274 &rmi_i2c->startup_delay); 284 275 ··· 315 294 client->addr); 316 295 return retval; 317 296 } 297 + retval = devm_add_action_or_reset(&client->dev, 298 + rmi_i2c_unregister_transport, 299 + rmi_i2c); 300 + if (retval) 301 + return retval; 318 302 319 303 retval = rmi_i2c_init_irq(client); 320 304 if (retval < 0) ··· 327 301 328 302 dev_info(&client->dev, "registered rmi i2c driver at %#04x.\n", 329 303 client->addr); 330 - return 0; 331 - } 332 - 333 - static int rmi_i2c_remove(struct i2c_client *client) 334 - { 335 - struct rmi_i2c_xport *rmi_i2c = i2c_get_clientdata(client); 336 - 337 - rmi_unregister_transport_device(&rmi_i2c->xport); 338 - regulator_bulk_disable(ARRAY_SIZE(rmi_i2c->supplies), 339 - rmi_i2c->supplies); 340 - 341 304 return 0; 342 305 } 343 306 ··· 446 431 }, 447 432 .id_table = rmi_id, 448 433 .probe = rmi_i2c_probe, 449 - .remove = rmi_i2c_remove, 450 434 }; 451 435 452 436 module_i2c_driver(rmi_i2c_driver);
+12 -10
drivers/input/rmi4/rmi_spi.c
··· 396 396 } 397 397 #endif 398 398 399 + static void rmi_spi_unregister_transport(void *data) 400 + { 401 + struct rmi_spi_xport *rmi_spi = data; 402 + 403 + rmi_unregister_transport_device(&rmi_spi->xport); 404 + } 405 + 399 406 static int rmi_spi_probe(struct spi_device *spi) 400 407 { 401 408 struct rmi_spi_xport *rmi_spi; ··· 471 464 dev_err(&spi->dev, "failed to register transport.\n"); 472 465 return retval; 473 466 } 467 + retval = devm_add_action_or_reset(&spi->dev, 468 + rmi_spi_unregister_transport, 469 + rmi_spi); 470 + if (retval) 471 + return retval; 474 472 475 473 retval = rmi_spi_init_irq(spi); 476 474 if (retval < 0) 477 475 return retval; 478 476 479 477 dev_info(&spi->dev, "registered RMI SPI driver\n"); 480 - return 0; 481 - } 482 - 483 - static int rmi_spi_remove(struct spi_device *spi) 484 - { 485 - struct rmi_spi_xport *rmi_spi = spi_get_drvdata(spi); 486 - 487 - rmi_unregister_transport_device(&rmi_spi->xport); 488 - 489 478 return 0; 490 479 } 491 480 ··· 580 577 }, 581 578 .id_table = rmi_id, 582 579 .probe = rmi_spi_probe, 583 - .remove = rmi_spi_remove, 584 580 }; 585 581 586 582 module_spi_driver(rmi_spi_driver);
+1 -1
drivers/input/serio/i8042-io.h
··· 81 81 return -EBUSY; 82 82 #endif 83 83 84 - i8042_reset = 1; 84 + i8042_reset = I8042_RESET_ALWAYS; 85 85 return 0; 86 86 } 87 87
+1 -1
drivers/input/serio/i8042-ip22io.h
··· 61 61 return -EBUSY; 62 62 #endif 63 63 64 - i8042_reset = 1; 64 + i8042_reset = I8042_RESET_ALWAYS; 65 65 66 66 return 0; 67 67 }
+1 -1
drivers/input/serio/i8042-ppcio.h
··· 44 44 45 45 static inline int i8042_platform_init(void) 46 46 { 47 - i8042_reset = 1; 47 + i8042_reset = I8042_RESET_ALWAYS; 48 48 return 0; 49 49 } 50 50
+1 -1
drivers/input/serio/i8042-sparcio.h
··· 130 130 } 131 131 } 132 132 133 - i8042_reset = 1; 133 + i8042_reset = I8042_RESET_ALWAYS; 134 134 135 135 return 0; 136 136 }
+1 -1
drivers/input/serio/i8042-unicore32io.h
··· 61 61 if (!request_mem_region(I8042_REGION_START, I8042_REGION_SIZE, "i8042")) 62 62 return -EBUSY; 63 63 64 - i8042_reset = 1; 64 + i8042_reset = I8042_RESET_ALWAYS; 65 65 return 0; 66 66 } 67 67
+93 -3
drivers/input/serio/i8042-x86ia64io.h
··· 510 510 { } 511 511 }; 512 512 513 + /* 514 + * On some Asus laptops, just running self tests cause problems. 515 + */ 516 + static const struct dmi_system_id i8042_dmi_noselftest_table[] = { 517 + { 518 + .matches = { 519 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 520 + DMI_MATCH(DMI_PRODUCT_NAME, "A455LD"), 521 + }, 522 + }, 523 + { 524 + .matches = { 525 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 526 + DMI_MATCH(DMI_PRODUCT_NAME, "K401LB"), 527 + }, 528 + }, 529 + { 530 + .matches = { 531 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 532 + DMI_MATCH(DMI_PRODUCT_NAME, "K501LB"), 533 + }, 534 + }, 535 + { 536 + .matches = { 537 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 538 + DMI_MATCH(DMI_PRODUCT_NAME, "K501LX"), 539 + }, 540 + }, 541 + { 542 + .matches = { 543 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 544 + DMI_MATCH(DMI_PRODUCT_NAME, "R409L"), 545 + }, 546 + }, 547 + { 548 + .matches = { 549 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 550 + DMI_MATCH(DMI_PRODUCT_NAME, "V502LX"), 551 + }, 552 + }, 553 + { 554 + .matches = { 555 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 556 + DMI_MATCH(DMI_PRODUCT_NAME, "X302LA"), 557 + }, 558 + }, 559 + { 560 + .matches = { 561 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 562 + DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"), 563 + }, 564 + }, 565 + { 566 + .matches = { 567 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 568 + DMI_MATCH(DMI_PRODUCT_NAME, "X450LD"), 569 + }, 570 + }, 571 + { 572 + .matches = { 573 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 574 + DMI_MATCH(DMI_PRODUCT_NAME, "X455LAB"), 575 + }, 576 + }, 577 + { 578 + .matches = { 579 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 580 + DMI_MATCH(DMI_PRODUCT_NAME, "X455LDB"), 581 + }, 582 + }, 583 + { 584 + .matches = { 585 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 586 + DMI_MATCH(DMI_PRODUCT_NAME, "X455LF"), 587 + }, 588 + }, 589 + { 590 + .matches = { 591 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 592 + DMI_MATCH(DMI_PRODUCT_NAME, "Z450LA"), 593 + }, 594 + }, 595 + { } 596 + }; 513 597 static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = { 514 598 { 515 599 /* MSI Wind U-100 */ ··· 1156 1072 return retval; 1157 1073 1158 1074 #if defined(__ia64__) 1159 - i8042_reset = true; 1075 + i8042_reset = I8042_RESET_ALWAYS; 1160 1076 #endif 1161 1077 1162 1078 #ifdef CONFIG_X86 1163 - if (dmi_check_system(i8042_dmi_reset_table)) 1164 - i8042_reset = true; 1079 + /* Honor module parameter when value is not default */ 1080 + if (i8042_reset == I8042_RESET_DEFAULT) { 1081 + if (dmi_check_system(i8042_dmi_reset_table)) 1082 + i8042_reset = I8042_RESET_ALWAYS; 1083 + 1084 + if (dmi_check_system(i8042_dmi_noselftest_table)) 1085 + i8042_reset = I8042_RESET_NEVER; 1086 + } 1165 1087 1166 1088 if (dmi_check_system(i8042_dmi_noloop_table)) 1167 1089 i8042_noloop = true;
+44 -11
drivers/input/serio/i8042.c
··· 48 48 module_param_named(unlock, i8042_unlock, bool, 0); 49 49 MODULE_PARM_DESC(unlock, "Ignore keyboard lock."); 50 50 51 - static bool i8042_reset; 52 - module_param_named(reset, i8042_reset, bool, 0); 53 - MODULE_PARM_DESC(reset, "Reset controller during init and cleanup."); 51 + enum i8042_controller_reset_mode { 52 + I8042_RESET_NEVER, 53 + I8042_RESET_ALWAYS, 54 + I8042_RESET_ON_S2RAM, 55 + #define I8042_RESET_DEFAULT I8042_RESET_ON_S2RAM 56 + }; 57 + static enum i8042_controller_reset_mode i8042_reset = I8042_RESET_DEFAULT; 58 + static int i8042_set_reset(const char *val, const struct kernel_param *kp) 59 + { 60 + enum i8042_controller_reset_mode *arg = kp->arg; 61 + int error; 62 + bool reset; 63 + 64 + if (val) { 65 + error = kstrtobool(val, &reset); 66 + if (error) 67 + return error; 68 + } else { 69 + reset = true; 70 + } 71 + 72 + *arg = reset ? I8042_RESET_ALWAYS : I8042_RESET_NEVER; 73 + return 0; 74 + } 75 + 76 + static const struct kernel_param_ops param_ops_reset_param = { 77 + .flags = KERNEL_PARAM_OPS_FL_NOARG, 78 + .set = i8042_set_reset, 79 + }; 80 + #define param_check_reset_param(name, p) \ 81 + __param_check(name, p, enum i8042_controller_reset_mode) 82 + module_param_named(reset, i8042_reset, reset_param, 0); 83 + MODULE_PARM_DESC(reset, "Reset controller on resume, cleanup or both"); 54 84 55 85 static bool i8042_direct; 56 86 module_param_named(direct, i8042_direct, bool, 0); ··· 1049 1019 * Reset the controller and reset CRT to the original value set by BIOS. 1050 1020 */ 1051 1021 1052 - static void i8042_controller_reset(bool force_reset) 1022 + static void i8042_controller_reset(bool s2r_wants_reset) 1053 1023 { 1054 1024 i8042_flush(); 1055 1025 ··· 1074 1044 * Reset the controller if requested. 1075 1045 */ 1076 1046 1077 - if (i8042_reset || force_reset) 1047 + if (i8042_reset == I8042_RESET_ALWAYS || 1048 + (i8042_reset == I8042_RESET_ON_S2RAM && s2r_wants_reset)) { 1078 1049 i8042_controller_selftest(); 1050 + } 1079 1051 1080 1052 /* 1081 1053 * Restore the original control register setting. ··· 1142 1110 * before suspending. 1143 1111 */ 1144 1112 1145 - static int i8042_controller_resume(bool force_reset) 1113 + static int i8042_controller_resume(bool s2r_wants_reset) 1146 1114 { 1147 1115 int error; 1148 1116 ··· 1150 1118 if (error) 1151 1119 return error; 1152 1120 1153 - if (i8042_reset || force_reset) { 1121 + if (i8042_reset == I8042_RESET_ALWAYS || 1122 + (i8042_reset == I8042_RESET_ON_S2RAM && s2r_wants_reset)) { 1154 1123 error = i8042_controller_selftest(); 1155 1124 if (error) 1156 1125 return error; ··· 1228 1195 1229 1196 static int i8042_pm_resume(struct device *dev) 1230 1197 { 1231 - bool force_reset; 1198 + bool want_reset; 1232 1199 int i; 1233 1200 1234 1201 for (i = 0; i < I8042_NUM_PORTS; i++) { ··· 1251 1218 * off control to the platform firmware, otherwise we can simply restore 1252 1219 * the mode. 1253 1220 */ 1254 - force_reset = pm_resume_via_firmware(); 1221 + want_reset = pm_resume_via_firmware(); 1255 1222 1256 - return i8042_controller_resume(force_reset); 1223 + return i8042_controller_resume(want_reset); 1257 1224 } 1258 1225 1259 1226 static int i8042_pm_thaw(struct device *dev) ··· 1515 1482 1516 1483 i8042_platform_device = dev; 1517 1484 1518 - if (i8042_reset) { 1485 + if (i8042_reset == I8042_RESET_ALWAYS) { 1519 1486 error = i8042_controller_selftest(); 1520 1487 if (error) 1521 1488 return error;
+36 -2
drivers/input/touchscreen/melfas_mip4.c
··· 157 157 158 158 char phys[32]; 159 159 char product_name[16]; 160 + char ic_name[4]; 160 161 161 162 unsigned int max_x; 162 163 unsigned int max_y; ··· 263 262 else 264 263 dev_dbg(&ts->client->dev, "product name: %.*s\n", 265 264 (int)sizeof(ts->product_name), ts->product_name); 265 + 266 + /* IC name */ 267 + cmd[0] = MIP4_R0_INFO; 268 + cmd[1] = MIP4_R1_INFO_IC_NAME; 269 + error = mip4_i2c_xfer(ts, cmd, sizeof(cmd), 270 + ts->ic_name, sizeof(ts->ic_name)); 271 + if (error) 272 + dev_warn(&ts->client->dev, 273 + "Failed to retrieve IC name: %d\n", error); 274 + else 275 + dev_dbg(&ts->client->dev, "IC name: %.*s\n", 276 + (int)sizeof(ts->ic_name), ts->ic_name); 266 277 267 278 /* Firmware version */ 268 279 error = mip4_get_fw_version(ts); ··· 1339 1326 * paired with current firmware in the chip. 1340 1327 */ 1341 1328 count = snprintf(buf, PAGE_SIZE, "%.*s\n", 1342 - (int)sizeof(ts->product_name), ts->product_name); 1329 + (int)sizeof(ts->product_name), ts->product_name); 1343 1330 1344 1331 mutex_unlock(&ts->input->mutex); 1345 1332 ··· 1348 1335 1349 1336 static DEVICE_ATTR(hw_version, S_IRUGO, mip4_sysfs_read_hw_version, NULL); 1350 1337 1338 + static ssize_t mip4_sysfs_read_ic_name(struct device *dev, 1339 + struct device_attribute *attr, 1340 + char *buf) 1341 + { 1342 + struct i2c_client *client = to_i2c_client(dev); 1343 + struct mip4_ts *ts = i2c_get_clientdata(client); 1344 + size_t count; 1345 + 1346 + mutex_lock(&ts->input->mutex); 1347 + 1348 + count = snprintf(buf, PAGE_SIZE, "%.*s\n", 1349 + (int)sizeof(ts->ic_name), ts->ic_name); 1350 + 1351 + mutex_unlock(&ts->input->mutex); 1352 + 1353 + return count; 1354 + } 1355 + 1356 + static DEVICE_ATTR(ic_name, S_IRUGO, mip4_sysfs_read_ic_name, NULL); 1357 + 1351 1358 static struct attribute *mip4_attrs[] = { 1352 1359 &dev_attr_fw_version.attr, 1353 1360 &dev_attr_hw_version.attr, 1361 + &dev_attr_ic_name.attr, 1354 1362 &dev_attr_update_fw.attr, 1355 1363 NULL, 1356 1364 }; ··· 1572 1538 module_i2c_driver(mip4_driver); 1573 1539 1574 1540 MODULE_DESCRIPTION("MELFAS MIP4 Touchscreen"); 1575 - MODULE_VERSION("2016.03.12"); 1541 + MODULE_VERSION("2016.09.28"); 1576 1542 MODULE_AUTHOR("Sangwon Jee <jeesw@melfas.com>"); 1577 1543 MODULE_LICENSE("GPL");