Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
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 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

+83 -16
+11 -1
drivers/input/keyboard/adp5588-keys.c
··· 76 struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); 77 unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); 78 unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); 79 80 - return !!(adp5588_read(kpad->client, GPIO_DAT_STAT1 + bank) & bit); 81 } 82 83 static void adp5588_gpio_set_value(struct gpio_chip *chip,
··· 76 struct adp5588_kpad *kpad = container_of(chip, struct adp5588_kpad, gc); 77 unsigned int bank = ADP5588_BANK(kpad->gpiomap[off]); 78 unsigned int bit = ADP5588_BIT(kpad->gpiomap[off]); 79 + int val; 80 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); 91 } 92 93 static void adp5588_gpio_set_value(struct gpio_chip *chip,
+17 -14
drivers/input/misc/da9052_onkey.c
··· 27 28 static void da9052_onkey_query(struct da9052_onkey *onkey) 29 { 30 - int key_stat; 31 32 - key_stat = da9052_reg_read(onkey->da9052, DA9052_EVENT_B_REG); 33 - if (key_stat < 0) { 34 dev_err(onkey->da9052->dev, 35 - "Failed to read onkey event %d\n", key_stat); 36 } else { 37 /* 38 * Since interrupt for deassertion of ONKEY pin is not 39 * generated, onkey event state determines the onkey 40 * button state. 41 */ 42 - key_stat &= DA9052_EVENTB_ENONKEY; 43 - input_report_key(onkey->input, KEY_POWER, key_stat); 44 - input_sync(onkey->input); 45 - } 46 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)); 53 } 54 55 static void da9052_onkey_work(struct work_struct *work)
··· 27 28 static void da9052_onkey_query(struct da9052_onkey *onkey) 29 { 30 + int ret; 31 32 + ret = da9052_reg_read(onkey->da9052, DA9052_STATUS_A_REG); 33 + if (ret < 0) { 34 dev_err(onkey->da9052->dev, 35 + "Failed to read onkey event err=%d\n", ret); 36 } else { 37 /* 38 * Since interrupt for deassertion of ONKEY pin is not 39 * generated, onkey event state determines the onkey 40 * button state. 41 */ 42 + bool pressed = !(ret & DA9052_STATUSA_NONKEY); 43 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 + } 56 } 57 58 static void da9052_onkey_work(struct work_struct *work)
-1
drivers/input/mouse/cypress_ps2.c
··· 409 __clear_bit(REL_X, input->relbit); 410 __clear_bit(REL_Y, input->relbit); 411 412 - __set_bit(INPUT_PROP_BUTTONPAD, input->propbit); 413 __set_bit(EV_KEY, input->evbit); 414 __set_bit(BTN_LEFT, input->keybit); 415 __set_bit(BTN_RIGHT, input->keybit);
··· 409 __clear_bit(REL_X, input->relbit); 410 __clear_bit(REL_Y, input->relbit); 411 412 __set_bit(EV_KEY, input->evbit); 413 __set_bit(BTN_LEFT, input->keybit); 414 __set_bit(BTN_RIGHT, input->keybit);
+55
drivers/input/mouse/synaptics.c
··· 265 * Read touchpad resolution and maximum reported coordinates 266 * Resolution is left zero if touchpad does not support the query 267 */ 268 static int synaptics_resolution(struct psmouse *psmouse) 269 { 270 struct synaptics_data *priv = psmouse->private; 271 unsigned char resp[3]; 272 273 if (SYN_ID_MAJOR(priv->identity) < 4) 274 return 0; ··· 1496 { } 1497 }; 1498 1499 void __init synaptics_module_init(void) 1500 { 1501 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 1502 broken_olpc_ec = dmi_check_system(olpc_dmi_table); 1503 } 1504 1505 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
··· 265 * Read touchpad resolution and maximum reported coordinates 266 * Resolution is left zero if touchpad does not support the query 267 */ 268 + 269 + static const int *quirk_min_max; 270 + 271 static int synaptics_resolution(struct psmouse *psmouse) 272 { 273 struct synaptics_data *priv = psmouse->private; 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 + } 283 284 if (SYN_ID_MAJOR(priv->identity) < 4) 285 return 0; ··· 1485 { } 1486 }; 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 + 1526 void __init synaptics_module_init(void) 1527 { 1528 + const struct dmi_system_id *min_max_dmi; 1529 + 1530 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 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; 1536 } 1537 1538 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)