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

Pull input subsystem fixes from Dmitry Torokhov:
"Updates to Synaptics touchpad to better cope with devices in Lenovo
laptops, and a couple more fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: synaptics - add manual min/max quirk for ThinkPad X240
Input: synaptics - add manual min/max quirk
Input: cypress_ps2 - don't report as a button pads
Input: da9052_onkey - use correct register bit for key status
Input: adp5588-keys - get value from data out when dir is out

Changed files
+83 -16
drivers
+11 -1
drivers/input/keyboard/adp5588-keys.c
··· 76 76 struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); 77 77 unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); 78 78 unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); 79 + int val; 79 80 80 - return !!(adp5588_read(kpad->client, GPIO_DAT_STAT1 + bank) & bit); 81 + mutex_lock(&kpad->gpio_lock); 82 + 83 + if (kpad->dir[bank] & bit) 84 + val = kpad->dat_out[bank]; 85 + else 86 + val = adp5588_read(kpad->client, GPIO_DAT_STAT1 + bank); 87 + 88 + mutex_unlock(&kpad->gpio_lock); 89 + 90 + return !!(val & bit); 81 91 } 82 92 83 93 static void adp5588_gpio_set_value(struct gpio_chip *chip,
+17 -14
drivers/input/misc/da9052_onkey.c
··· 27 27 28 28 static void da9052_onkey_query(struct da9052_onkey *onkey) 29 29 { 30 - int key_stat; 30 + int ret; 31 31 32 - key_stat = da9052_reg_read(onkey->da9052, DA9052_EVENT_B_REG); 33 - if (key_stat < 0) { 32 + ret = da9052_reg_read(onkey->da9052, DA9052_STATUS_A_REG); 33 + if (ret < 0) { 34 34 dev_err(onkey->da9052->dev, 35 - "Failed to read onkey event %d\n", key_stat); 35 + "Failed to read onkey event err=%d\n", ret); 36 36 } else { 37 37 /* 38 38 * Since interrupt for deassertion of ONKEY pin is not 39 39 * generated, onkey event state determines the onkey 40 40 * button state. 41 41 */ 42 - key_stat &= DA9052_EVENTB_ENONKEY; 43 - input_report_key(onkey->input, KEY_POWER, key_stat); 44 - input_sync(onkey->input); 45 - } 42 + bool pressed = !(ret & DA9052_STATUSA_NONKEY); 46 43 47 - /* 48 - * Interrupt is generated only when the ONKEY pin is asserted. 49 - * Hence the deassertion of the pin is simulated through work queue. 50 - */ 51 - if (key_stat) 52 - schedule_delayed_work(&onkey->work, msecs_to_jiffies(50)); 44 + input_report_key(onkey->input, KEY_POWER, pressed); 45 + input_sync(onkey->input); 46 + 47 + /* 48 + * Interrupt is generated only when the ONKEY pin 49 + * is asserted. Hence the deassertion of the pin 50 + * is simulated through work queue. 51 + */ 52 + if (pressed) 53 + schedule_delayed_work(&onkey->work, 54 + msecs_to_jiffies(50)); 55 + } 53 56 } 54 57 55 58 static void da9052_onkey_work(struct work_struct *work)
-1
drivers/input/mouse/cypress_ps2.c
··· 409 409 __clear_bit(REL_X, input->relbit); 410 410 __clear_bit(REL_Y, input->relbit); 411 411 412 - __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 413 412 __set_bit(EV_KEY, input->evbit); 414 413 __set_bit(BTN_LEFT, input->keybit); 415 414 __set_bit(BTN_RIGHT, input->keybit);
+55
drivers/input/mouse/synaptics.c
··· 265 265 * Read touchpad resolution and maximum reported coordinates 266 266 * Resolution is left zero if touchpad does not support the query 267 267 */ 268 + 269 + static const int *quirk_min_max; 270 + 268 271 static int synaptics_resolution(struct psmouse *psmouse) 269 272 { 270 273 struct synaptics_data *priv = psmouse->private; 271 274 unsigned char resp[3]; 275 + 276 + if (quirk_min_max) { 277 + priv->x_min = quirk_min_max[0]; 278 + priv->x_max = quirk_min_max[1]; 279 + priv->y_min = quirk_min_max[2]; 280 + priv->y_max = quirk_min_max[3]; 281 + return 0; 282 + } 272 283 273 284 if (SYN_ID_MAJOR(priv->identity) < 4) 274 285 return 0; ··· 1496 1485 { } 1497 1486 }; 1498 1487 1488 + static const struct dmi_system_id min_max_dmi_table[] __initconst = { 1489 + #if defined(CONFIG_DMI) 1490 + { 1491 + /* Lenovo ThinkPad Helix */ 1492 + .matches = { 1493 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1494 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad Helix"), 1495 + }, 1496 + .driver_data = (int []){1024, 5052, 2258, 4832}, 1497 + }, 1498 + { 1499 + /* Lenovo ThinkPad X240 */ 1500 + .matches = { 1501 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1502 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X240"), 1503 + }, 1504 + .driver_data = (int []){1232, 5710, 1156, 4696}, 1505 + }, 1506 + { 1507 + /* Lenovo ThinkPad T440s */ 1508 + .matches = { 1509 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1510 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T440"), 1511 + }, 1512 + .driver_data = (int []){1024, 5112, 2024, 4832}, 1513 + }, 1514 + { 1515 + /* Lenovo ThinkPad T540p */ 1516 + .matches = { 1517 + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 1518 + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T540"), 1519 + }, 1520 + .driver_data = (int []){1024, 5056, 2058, 4832}, 1521 + }, 1522 + #endif 1523 + { } 1524 + }; 1525 + 1499 1526 void __init synaptics_module_init(void) 1500 1527 { 1528 + const struct dmi_system_id *min_max_dmi; 1529 + 1501 1530 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 1502 1531 broken_olpc_ec = dmi_check_system(olpc_dmi_table); 1532 + 1533 + min_max_dmi = dmi_first_match(min_max_dmi_table); 1534 + if (min_max_dmi) 1535 + quirk_min_max = min_max_dmi->driver_data; 1503 1536 } 1504 1537 1505 1538 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)