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 few random driver fixups"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: synaptics - add a second working PNP_ID for Lenovo T470s
Input: applespi - replace zero-length array with flexible-array
Input: axp20x-pek - always register interrupt handlers
Input: lm8333 - update contact email
Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()
Input: synaptics-rmi4 - really fix attn_data use-after-free
Input: i8042 - add ThinkPad S230u to i8042 reset list
Revert "Input: i8042 - add ThinkPad S230u to i8042 nomux list"
Input: dlink-dir685-touchkeys - fix a typo in driver name
Input: xpad - add custom init packet for Xbox One S controllers
Input: evdev - call input_flush_device() on release(), not flush()
Input: i8042 - add ThinkPad S230u to i8042 nomux list
Input: usbtouchscreen - add support for BonXeon TP
Input: cros_ec_keyb - use cros_ec_cmd_xfer_status helper
Input: mms114 - fix handling of mms345l
Input: elants_i2c - support palm detection

+88 -72
+4 -15
drivers/input/evdev.c
··· 326 326 return fasync_helper(fd, file, on, &client->fasync); 327 327 } 328 328 329 - static int evdev_flush(struct file *file, fl_owner_t id) 330 - { 331 - struct evdev_client *client = file->private_data; 332 - struct evdev *evdev = client->evdev; 333 - 334 - mutex_lock(&evdev->mutex); 335 - 336 - if (evdev->exist && !client->revoked) 337 - input_flush_device(&evdev->handle, file); 338 - 339 - mutex_unlock(&evdev->mutex); 340 - return 0; 341 - } 342 - 343 329 static void evdev_free(struct device *dev) 344 330 { 345 331 struct evdev *evdev = container_of(dev, struct evdev, dev); ··· 439 453 unsigned int i; 440 454 441 455 mutex_lock(&evdev->mutex); 456 + 457 + if (evdev->exist && !client->revoked) 458 + input_flush_device(&evdev->handle, file); 459 + 442 460 evdev_ungrab(evdev, client); 443 461 mutex_unlock(&evdev->mutex); 444 462 ··· 1300 1310 .compat_ioctl = evdev_ioctl_compat, 1301 1311 #endif 1302 1312 .fasync = evdev_fasync, 1303 - .flush = evdev_flush, 1304 1313 .llseek = no_llseek, 1305 1314 }; 1306 1315
+12
drivers/input/joystick/xpad.c
··· 459 459 }; 460 460 461 461 /* 462 + * This packet is required for Xbox One S (0x045e:0x02ea) 463 + * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to 464 + * initialize the controller that was previously used in 465 + * Bluetooth mode. 466 + */ 467 + static const u8 xboxone_s_init[] = { 468 + 0x05, 0x20, 0x00, 0x0f, 0x06 469 + }; 470 + 471 + /* 462 472 * This packet is required for the Titanfall 2 Xbox One pads 463 473 * (0x0e6f:0x0165) to finish initialization and for Hori pads 464 474 * (0x0f0d:0x0067) to make the analog sticks work. ··· 526 516 XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init), 527 517 XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init), 528 518 XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init), 519 + XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init), 520 + XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init), 529 521 XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1), 530 522 XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2), 531 523 XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
+1 -1
drivers/input/keyboard/applespi.c
··· 186 186 u8 number_of_fingers; 187 187 u8 clicked2; 188 188 u8 unknown3[16]; 189 - struct tp_finger fingers[0]; 189 + struct tp_finger fingers[]; 190 190 }; 191 191 192 192 /**
+5 -9
drivers/input/keyboard/cros_ec_keyb.c
··· 347 347 params->info_type = info_type; 348 348 params->event_type = event_type; 349 349 350 - ret = cros_ec_cmd_xfer(ec_dev, msg); 351 - if (ret < 0) { 352 - dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", 353 - (int)info_type, (int)event_type, ret); 354 - } else if (msg->result == EC_RES_INVALID_VERSION) { 350 + ret = cros_ec_cmd_xfer_status(ec_dev, msg); 351 + if (ret == -ENOTSUPP) { 355 352 /* With older ECs we just return 0 for everything */ 356 353 memset(result, 0, result_size); 357 354 ret = 0; 358 - } else if (msg->result != EC_RES_SUCCESS) { 359 - dev_warn(ec_dev->dev, "Error getting info %d/%d: %d\n", 360 - (int)info_type, (int)event_type, msg->result); 361 - ret = -EPROTO; 355 + } else if (ret < 0) { 356 + dev_warn(ec_dev->dev, "Transfer error %d/%d: %d\n", 357 + (int)info_type, (int)event_type, ret); 362 358 } else if (ret != result_size) { 363 359 dev_warn(ec_dev->dev, "Wrong size %d/%d: %d != %zu\n", 364 360 (int)info_type, (int)event_type,
+37 -35
drivers/input/misc/axp20x-pek.c
··· 205 205 206 206 static irqreturn_t axp20x_pek_irq(int irq, void *pwr) 207 207 { 208 - struct input_dev *idev = pwr; 209 - struct axp20x_pek *axp20x_pek = input_get_drvdata(idev); 208 + struct axp20x_pek *axp20x_pek = pwr; 209 + struct input_dev *idev = axp20x_pek->input; 210 + 211 + if (!idev) 212 + return IRQ_HANDLED; 210 213 211 214 /* 212 215 * The power-button is connected to ground so a falling edge (dbf) ··· 228 225 static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, 229 226 struct platform_device *pdev) 230 227 { 231 - struct axp20x_dev *axp20x = axp20x_pek->axp20x; 232 228 struct input_dev *idev; 233 229 int error; 234 - 235 - axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); 236 - if (axp20x_pek->irq_dbr < 0) 237 - return axp20x_pek->irq_dbr; 238 - axp20x_pek->irq_dbr = regmap_irq_get_virq(axp20x->regmap_irqc, 239 - axp20x_pek->irq_dbr); 240 - 241 - axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); 242 - if (axp20x_pek->irq_dbf < 0) 243 - return axp20x_pek->irq_dbf; 244 - axp20x_pek->irq_dbf = regmap_irq_get_virq(axp20x->regmap_irqc, 245 - axp20x_pek->irq_dbf); 246 230 247 231 axp20x_pek->input = devm_input_allocate_device(&pdev->dev); 248 232 if (!axp20x_pek->input) ··· 245 255 246 256 input_set_drvdata(idev, axp20x_pek); 247 257 248 - error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr, 249 - axp20x_pek_irq, 0, 250 - "axp20x-pek-dbr", idev); 251 - if (error < 0) { 252 - dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n", 253 - axp20x_pek->irq_dbr, error); 254 - return error; 255 - } 256 - 257 - error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf, 258 - axp20x_pek_irq, 0, 259 - "axp20x-pek-dbf", idev); 260 - if (error < 0) { 261 - dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n", 262 - axp20x_pek->irq_dbf, error); 263 - return error; 264 - } 265 - 266 258 error = input_register_device(idev); 267 259 if (error) { 268 260 dev_err(&pdev->dev, "Can't register input device: %d\n", 269 261 error); 270 262 return error; 271 263 } 272 - 273 - device_init_wakeup(&pdev->dev, true); 274 264 275 265 return 0; 276 266 } ··· 309 339 310 340 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); 311 341 342 + axp20x_pek->irq_dbr = platform_get_irq_byname(pdev, "PEK_DBR"); 343 + if (axp20x_pek->irq_dbr < 0) 344 + return axp20x_pek->irq_dbr; 345 + axp20x_pek->irq_dbr = regmap_irq_get_virq( 346 + axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbr); 347 + 348 + axp20x_pek->irq_dbf = platform_get_irq_byname(pdev, "PEK_DBF"); 349 + if (axp20x_pek->irq_dbf < 0) 350 + return axp20x_pek->irq_dbf; 351 + axp20x_pek->irq_dbf = regmap_irq_get_virq( 352 + axp20x_pek->axp20x->regmap_irqc, axp20x_pek->irq_dbf); 353 + 312 354 if (axp20x_pek_should_register_input(axp20x_pek, pdev)) { 313 355 error = axp20x_pek_probe_input_device(axp20x_pek, pdev); 314 356 if (error) ··· 328 346 } 329 347 330 348 axp20x_pek->info = (struct axp20x_info *)match->driver_data; 349 + 350 + error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbr, 351 + axp20x_pek_irq, 0, 352 + "axp20x-pek-dbr", axp20x_pek); 353 + if (error < 0) { 354 + dev_err(&pdev->dev, "Failed to request dbr IRQ#%d: %d\n", 355 + axp20x_pek->irq_dbr, error); 356 + return error; 357 + } 358 + 359 + error = devm_request_any_context_irq(&pdev->dev, axp20x_pek->irq_dbf, 360 + axp20x_pek_irq, 0, 361 + "axp20x-pek-dbf", axp20x_pek); 362 + if (error < 0) { 363 + dev_err(&pdev->dev, "Failed to request dbf IRQ#%d: %d\n", 364 + axp20x_pek->irq_dbf, error); 365 + return error; 366 + } 367 + 368 + device_init_wakeup(&pdev->dev, true); 331 369 332 370 platform_set_drvdata(pdev, axp20x_pek); 333 371
+1
drivers/input/mouse/synaptics.c
··· 170 170 "LEN005b", /* P50 */ 171 171 "LEN005e", /* T560 */ 172 172 "LEN006c", /* T470s */ 173 + "LEN007a", /* T470s */ 173 174 "LEN0071", /* T480 */ 174 175 "LEN0072", /* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ 175 176 "LEN0073", /* X1 Carbon G5 (Elantech) */
+3 -2
drivers/input/rmi4/rmi_driver.c
··· 205 205 206 206 if (count) { 207 207 kfree(attn_data.data); 208 - attn_data.data = NULL; 208 + drvdata->attn_data.data = NULL; 209 209 } 210 210 211 211 if (!kfifo_is_empty(&drvdata->attn_fifo)) ··· 1210 1210 if (data->input) { 1211 1211 rmi_driver_set_input_name(rmi_dev, data->input); 1212 1212 if (!rmi_dev->xport->input) { 1213 - if (input_register_device(data->input)) { 1213 + retval = input_register_device(data->input); 1214 + if (retval) { 1214 1215 dev_err(dev, "%s: Failed to register input device.\n", 1215 1216 __func__); 1216 1217 goto err_destroy_functions;
+7
drivers/input/serio/i8042-x86ia64io.h
··· 662 662 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"), 663 663 }, 664 664 }, 665 + { 666 + /* Lenovo ThinkPad Twist S230u */ 667 + .matches = { 668 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 669 + DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"), 670 + }, 671 + }, 665 672 { } 666 673 }; 667 674
+10 -1
drivers/input/touchscreen/elants_i2c.c
··· 19 19 */ 20 20 21 21 22 + #include <linux/bits.h> 22 23 #include <linux/module.h> 23 24 #include <linux/input.h> 24 25 #include <linux/interrupt.h> ··· 74 73 #define FW_POS_STATE 1 75 74 #define FW_POS_TOTAL 2 76 75 #define FW_POS_XY 3 76 + #define FW_POS_TOOL_TYPE 33 77 77 #define FW_POS_CHECKSUM 34 78 78 #define FW_POS_WIDTH 35 79 79 #define FW_POS_PRESSURE 45 ··· 844 842 { 845 843 struct input_dev *input = ts->input; 846 844 unsigned int n_fingers; 845 + unsigned int tool_type; 847 846 u16 finger_state; 848 847 int i; 849 848 ··· 854 851 855 852 dev_dbg(&ts->client->dev, 856 853 "n_fingers: %u, state: %04x\n", n_fingers, finger_state); 854 + 855 + /* Note: all fingers have the same tool type */ 856 + tool_type = buf[FW_POS_TOOL_TYPE] & BIT(0) ? 857 + MT_TOOL_FINGER : MT_TOOL_PALM; 857 858 858 859 for (i = 0; i < MAX_CONTACT_NUM && n_fingers; i++) { 859 860 if (finger_state & 1) { ··· 874 867 i, x, y, p, w); 875 868 876 869 input_mt_slot(input, i); 877 - input_mt_report_slot_state(input, MT_TOOL_FINGER, true); 870 + input_mt_report_slot_state(input, tool_type, true); 878 871 input_event(input, EV_ABS, ABS_MT_POSITION_X, x); 879 872 input_event(input, EV_ABS, ABS_MT_POSITION_Y, y); 880 873 input_event(input, EV_ABS, ABS_MT_PRESSURE, p); ··· 1314 1307 input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0); 1315 1308 input_set_abs_params(ts->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); 1316 1309 input_set_abs_params(ts->input, ABS_MT_PRESSURE, 0, 255, 0, 0); 1310 + input_set_abs_params(ts->input, ABS_MT_TOOL_TYPE, 1311 + 0, MT_TOOL_PALM, 0, 0); 1317 1312 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); 1318 1313 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); 1319 1314 input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
+5 -7
drivers/input/touchscreen/mms114.c
··· 91 91 if (reg <= MMS114_MODE_CONTROL && reg + len > MMS114_MODE_CONTROL) 92 92 BUG(); 93 93 94 - /* Write register: use repeated start */ 94 + /* Write register */ 95 95 xfer[0].addr = client->addr; 96 - xfer[0].flags = I2C_M_TEN | I2C_M_NOSTART; 96 + xfer[0].flags = client->flags & I2C_M_TEN; 97 97 xfer[0].len = 1; 98 98 xfer[0].buf = &buf; 99 99 100 100 /* Read data */ 101 101 xfer[1].addr = client->addr; 102 - xfer[1].flags = I2C_M_RD; 102 + xfer[1].flags = (client->flags & I2C_M_TEN) | I2C_M_RD; 103 103 xfer[1].len = len; 104 104 xfer[1].buf = val; 105 105 ··· 428 428 const void *match_data; 429 429 int error; 430 430 431 - if (!i2c_check_functionality(client->adapter, 432 - I2C_FUNC_PROTOCOL_MANGLING)) { 433 - dev_err(&client->dev, 434 - "Need i2c bus that supports protocol mangling\n"); 431 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 432 + dev_err(&client->dev, "Not supported I2C adapter\n"); 435 433 return -ENODEV; 436 434 } 437 435
+1
drivers/input/touchscreen/usbtouchscreen.c
··· 182 182 #endif 183 183 184 184 #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH 185 + {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, 185 186 {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, 186 187 {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH}, 187 188 {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES},
+1 -1
include/linux/input/lm8333.h
··· 1 1 /* 2 2 * public include for LM8333 keypad driver - same license as driver 3 - * Copyright (C) 2012 Wolfram Sang, Pengutronix <w.sang@pengutronix.de> 3 + * Copyright (C) 2012 Wolfram Sang, Pengutronix <kernel@pengutronix.de> 4 4 */ 5 5 6 6 #ifndef _LM8333_H