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 subsystem fixes from Dmitry Torokhov:
"Miscellaneous driver fixes"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: psmouse - disable "palm detection" in the focaltech driver
Input: psmouse - disable changing resolution/rate/scale for FocalTech
Input: psmouse - ensure that focaltech reports consistent coordinates
Input: psmouse - remove hardcoded touchpad size from the focaltech driver
Input: tc3589x-keypad - set IRQF_ONESHOT flag to ensure IRQ request
Input: ALPS - fix memory leak when detection fails
Input: sun4i-ts - add thermal driver dependency
Input: cyapa - remove superfluous type check in cyapa_gen5_read_idac_data()
Input: cyapa - fix unaligned functions redefinition error
Input: mma8450 - add parent device

+65 -23
+3 -3
drivers/input/keyboard/tc3589x-keypad.c
··· 411 411 412 412 input_set_drvdata(input, keypad); 413 413 414 - error = request_threaded_irq(irq, NULL, 415 - tc3589x_keypad_irq, plat->irqtype, 416 - "tc3589x-keypad", keypad); 414 + error = request_threaded_irq(irq, NULL, tc3589x_keypad_irq, 415 + plat->irqtype | IRQF_ONESHOT, 416 + "tc3589x-keypad", keypad); 417 417 if (error < 0) { 418 418 dev_err(&pdev->dev, 419 419 "Could not allocate irq %d,error %d\n",
+1
drivers/input/misc/mma8450.c
··· 187 187 idev->private = m; 188 188 idev->input->name = MMA8450_DRV_NAME; 189 189 idev->input->id.bustype = BUS_I2C; 190 + idev->input->dev.parent = &c->dev; 190 191 idev->poll = mma8450_poll; 191 192 idev->poll_interval = POLL_INTERVAL; 192 193 idev->poll_interval_max = POLL_INTERVAL_MAX;
+3 -1
drivers/input/mouse/alps.c
··· 2605 2605 return -ENOMEM; 2606 2606 2607 2607 error = alps_identify(psmouse, priv); 2608 - if (error) 2608 + if (error) { 2609 + kfree(priv); 2609 2610 return error; 2611 + } 2610 2612 2611 2613 if (set_properties) { 2612 2614 psmouse->vendor = "ALPS";
+1 -1
drivers/input/mouse/cyapa_gen3.c
··· 20 20 #include <linux/input/mt.h> 21 21 #include <linux/module.h> 22 22 #include <linux/slab.h> 23 - #include <linux/unaligned/access_ok.h> 23 + #include <asm/unaligned.h> 24 24 #include "cyapa.h" 25 25 26 26
+2 -2
drivers/input/mouse/cyapa_gen5.c
··· 17 17 #include <linux/mutex.h> 18 18 #include <linux/completion.h> 19 19 #include <linux/slab.h> 20 - #include <linux/unaligned/access_ok.h> 20 + #include <asm/unaligned.h> 21 21 #include <linux/crc-itu-t.h> 22 22 #include "cyapa.h" 23 23 ··· 1926 1926 electrodes_tx = cyapa->electrodes_x; 1927 1927 max_element_cnt = ((cyapa->aligned_electrodes_rx + 7) & 1928 1928 ~7u) * electrodes_tx; 1929 - } else if (idac_data_type == GEN5_RETRIEVE_SELF_CAP_PWC_DATA) { 1929 + } else { 1930 1930 offset = 2; 1931 1931 max_element_cnt = cyapa->electrodes_x + 1932 1932 cyapa->electrodes_y;
+35 -15
drivers/input/mouse/focaltech.c
··· 67 67 68 68 #define FOC_MAX_FINGERS 5 69 69 70 - #define FOC_MAX_X 2431 71 - #define FOC_MAX_Y 1663 72 - 73 70 /* 74 71 * Current state of a single finger on the touchpad. 75 72 */ ··· 126 129 input_mt_slot(dev, i); 127 130 input_mt_report_slot_state(dev, MT_TOOL_FINGER, active); 128 131 if (active) { 129 - input_report_abs(dev, ABS_MT_POSITION_X, finger->x); 132 + unsigned int clamped_x, clamped_y; 133 + /* 134 + * The touchpad might report invalid data, so we clamp 135 + * the resulting values so that we do not confuse 136 + * userspace. 137 + */ 138 + clamped_x = clamp(finger->x, 0U, priv->x_max); 139 + clamped_y = clamp(finger->y, 0U, priv->y_max); 140 + input_report_abs(dev, ABS_MT_POSITION_X, clamped_x); 130 141 input_report_abs(dev, ABS_MT_POSITION_Y, 131 - FOC_MAX_Y - finger->y); 142 + priv->y_max - clamped_y); 132 143 } 133 144 } 134 145 input_mt_report_pointer_emulation(dev, true); ··· 184 179 } 185 180 186 181 state->pressed = (packet[0] >> 4) & 1; 187 - 188 - /* 189 - * packet[5] contains some kind of tool size in the most 190 - * significant nibble. 0xff is a special value (latching) that 191 - * signals a large contact area. 192 - */ 193 - if (packet[5] == 0xff) { 194 - state->fingers[finger].valid = false; 195 - return; 196 - } 197 182 198 183 state->fingers[finger].x = ((packet[1] & 0xf) << 8) | packet[2]; 199 184 state->fingers[finger].y = (packet[3] << 8) | packet[4]; ··· 376 381 377 382 return 0; 378 383 } 384 + 385 + void focaltech_set_resolution(struct psmouse *psmouse, unsigned int resolution) 386 + { 387 + /* not supported yet */ 388 + } 389 + 390 + static void focaltech_set_rate(struct psmouse *psmouse, unsigned int rate) 391 + { 392 + /* not supported yet */ 393 + } 394 + 395 + static void focaltech_set_scale(struct psmouse *psmouse, 396 + enum psmouse_scale scale) 397 + { 398 + /* not supported yet */ 399 + } 400 + 379 401 int focaltech_init(struct psmouse *psmouse) 380 402 { 381 403 struct focaltech_data *priv; ··· 427 415 psmouse->cleanup = focaltech_reset; 428 416 /* resync is not supported yet */ 429 417 psmouse->resync_time = 0; 418 + /* 419 + * rate/resolution/scale changes are not supported yet, and 420 + * the generic implementations of these functions seem to 421 + * confuse some touchpads 422 + */ 423 + psmouse->set_resolution = focaltech_set_resolution; 424 + psmouse->set_rate = focaltech_set_rate; 425 + psmouse->set_scale = focaltech_set_scale; 430 426 431 427 return 0; 432 428
+13 -1
drivers/input/mouse/psmouse-base.c
··· 454 454 } 455 455 456 456 /* 457 + * Here we set the mouse scaling. 458 + */ 459 + 460 + static void psmouse_set_scale(struct psmouse *psmouse, enum psmouse_scale scale) 461 + { 462 + ps2_command(&psmouse->ps2dev, NULL, 463 + scale == PSMOUSE_SCALE21 ? PSMOUSE_CMD_SETSCALE21 : 464 + PSMOUSE_CMD_SETSCALE11); 465 + } 466 + 467 + /* 457 468 * psmouse_poll() - default poll handler. Everyone except for ALPS uses it. 458 469 */ 459 470 ··· 700 689 701 690 psmouse->set_rate = psmouse_set_rate; 702 691 psmouse->set_resolution = psmouse_set_resolution; 692 + psmouse->set_scale = psmouse_set_scale; 703 693 psmouse->poll = psmouse_poll; 704 694 psmouse->protocol_handler = psmouse_process_byte; 705 695 psmouse->pktsize = 3; ··· 1172 1160 if (psmouse_max_proto != PSMOUSE_PS2) { 1173 1161 psmouse->set_rate(psmouse, psmouse->rate); 1174 1162 psmouse->set_resolution(psmouse, psmouse->resolution); 1175 - ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSCALE11); 1163 + psmouse->set_scale(psmouse, PSMOUSE_SCALE11); 1176 1164 } 1177 1165 } 1178 1166
+6
drivers/input/mouse/psmouse.h
··· 36 36 PSMOUSE_FULL_PACKET 37 37 } psmouse_ret_t; 38 38 39 + enum psmouse_scale { 40 + PSMOUSE_SCALE11, 41 + PSMOUSE_SCALE21 42 + }; 43 + 39 44 struct psmouse { 40 45 void *private; 41 46 struct input_dev *dev; ··· 72 67 psmouse_ret_t (*protocol_handler)(struct psmouse *psmouse); 73 68 void (*set_rate)(struct psmouse *psmouse, unsigned int rate); 74 69 void (*set_resolution)(struct psmouse *psmouse, unsigned int resolution); 70 + void (*set_scale)(struct psmouse *psmouse, enum psmouse_scale scale); 75 71 76 72 int (*reconnect)(struct psmouse *psmouse); 77 73 void (*disconnect)(struct psmouse *psmouse);
+1
drivers/input/touchscreen/Kconfig
··· 943 943 tristate "Allwinner sun4i resistive touchscreen controller support" 944 944 depends on ARCH_SUNXI || COMPILE_TEST 945 945 depends on HWMON 946 + depends on THERMAL || !THERMAL_OF 946 947 help 947 948 This selects support for the resistive touchscreen controller 948 949 found on Allwinner sunxi SoCs.