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

Merge branch 'for-linus' into next

Merge for-linus branch to sync Elan touchscreen driver code.

+87 -72
+4 -15
drivers/input/evdev.c
··· 327 327 return fasync_helper(fd, file, on, &client->fasync); 328 328 } 329 329 330 - static int evdev_flush(struct file *file, fl_owner_t id) 331 - { 332 - struct evdev_client *client = file->private_data; 333 - struct evdev *evdev = client->evdev; 334 - 335 - mutex_lock(&evdev->mutex); 336 - 337 - if (evdev->exist && !client->revoked) 338 - input_flush_device(&evdev->handle, file); 339 - 340 - mutex_unlock(&evdev->mutex); 341 - return 0; 342 - } 343 - 344 330 static void evdev_free(struct device *dev) 345 331 { 346 332 struct evdev *evdev = container_of(dev, struct evdev, dev); ··· 440 454 unsigned int i; 441 455 442 456 mutex_lock(&evdev->mutex); 457 + 458 + if (evdev->exist && !client->revoked) 459 + input_flush_device(&evdev->handle, file); 460 + 443 461 evdev_ungrab(evdev, client); 444 462 mutex_unlock(&evdev->mutex); 445 463 ··· 1301 1311 .compat_ioctl = evdev_ioctl_compat, 1302 1312 #endif 1303 1313 .fasync = evdev_fasync, 1304 - .flush = evdev_flush, 1305 1314 .llseek = no_llseek, 1306 1315 }; 1307 1316
+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
+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 ··· 845 843 { 846 844 struct input_dev *input = ts->input; 847 845 unsigned int n_fingers; 846 + unsigned int tool_type; 848 847 u16 finger_state; 849 848 int i; 850 849 ··· 855 852 856 853 dev_dbg(&ts->client->dev, 857 854 "n_fingers: %u, state: %04x\n", n_fingers, finger_state); 855 + 856 + /* Note: all fingers have the same tool type */ 857 + tool_type = buf[FW_POS_TOOL_TYPE] & BIT(0) ? 858 + MT_TOOL_FINGER : MT_TOOL_PALM; 858 859 859 860 for (i = 0; i < MAX_CONTACT_NUM && n_fingers; i++) { 860 861 if (finger_state & 1) { ··· 875 868 i, x, y, p, w); 876 869 877 870 input_mt_slot(input, i); 878 - input_mt_report_slot_state(input, MT_TOOL_FINGER, true); 871 + input_mt_report_slot_state(input, tool_type, true); 879 872 input_event(input, EV_ABS, ABS_MT_POSITION_X, x); 880 873 input_event(input, EV_ABS, ABS_MT_POSITION_Y, y); 881 874 input_event(input, EV_ABS, ABS_MT_PRESSURE, p); ··· 1340 1333 input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0); 1341 1334 input_set_abs_params(ts->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); 1342 1335 input_set_abs_params(ts->input, ABS_MT_PRESSURE, 0, 255, 0, 0); 1336 + input_set_abs_params(ts->input, ABS_MT_TOOL_TYPE, 1337 + 0, MT_TOOL_PALM, 0, 0); 1343 1338 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); 1344 1339 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); 1345 1340 input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1);
+5 -7
drivers/input/touchscreen/mms114.c
··· 92 92 if (reg <= MMS114_MODE_CONTROL && reg + len > MMS114_MODE_CONTROL) 93 93 BUG(); 94 94 95 - /* Write register: use repeated start */ 95 + /* Write register */ 96 96 xfer[0].addr = client->addr; 97 - xfer[0].flags = I2C_M_TEN | I2C_M_NOSTART; 97 + xfer[0].flags = client->flags & I2C_M_TEN; 98 98 xfer[0].len = 1; 99 99 xfer[0].buf = &buf; 100 100 101 101 /* Read data */ 102 102 xfer[1].addr = client->addr; 103 - xfer[1].flags = I2C_M_RD; 103 + xfer[1].flags = (client->flags & I2C_M_TEN) | I2C_M_RD; 104 104 xfer[1].len = len; 105 105 xfer[1].buf = val; 106 106 ··· 438 438 const void *match_data; 439 439 int error; 440 440 441 - if (!i2c_check_functionality(client->adapter, 442 - I2C_FUNC_PROTOCOL_MANGLING)) { 443 - dev_err(&client->dev, 444 - "Need i2c bus that supports protocol mangling\n"); 441 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 442 + dev_err(&client->dev, "Not supported I2C adapter\n"); 445 443 return -ENODEV; 446 444 } 447 445
+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