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:
"Updates for the input subsystem.

The main change is that we tell joydev not to touch "absolute mice",
such as VMware virtual mouse, as that produced bad result (cursor
stuck in upper right corner) with games"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: smtpe-ts - wait 50mS until polling for pen-up
Input: smtpe-ts - use msecs_to_jiffies() instead of HZ
Input: joydev - don't classify the vmmouse as a joystick
Input: vmmouse - do not reference non-existing version of X driver
Input: alps - fix finger jumps on lifting 2 fingers on v7 touchpad
Input: elantech - fix semi-mt protocol for v3 HW
Input: sx8654 - fix memory allocation check

+70 -4
+61
drivers/input/joydev.c
··· 747 747 input_close_device(handle); 748 748 } 749 749 750 + static bool joydev_dev_is_absolute_mouse(struct input_dev *dev) 751 + { 752 + DECLARE_BITMAP(jd_scratch, KEY_CNT); 753 + 754 + BUILD_BUG_ON(ABS_CNT > KEY_CNT || EV_CNT > KEY_CNT); 755 + 756 + /* 757 + * Virtualization (VMware, etc) and remote management (HP 758 + * ILO2) solutions use absolute coordinates for their virtual 759 + * pointing devices so that there is one-to-one relationship 760 + * between pointer position on the host screen and virtual 761 + * guest screen, and so their mice use ABS_X, ABS_Y and 3 762 + * primary button events. This clashes with what joydev 763 + * considers to be joysticks (a device with at minimum ABS_X 764 + * axis). 765 + * 766 + * Here we are trying to separate absolute mice from 767 + * joysticks. A device is, for joystick detection purposes, 768 + * considered to be an absolute mouse if the following is 769 + * true: 770 + * 771 + * 1) Event types are exactly EV_ABS, EV_KEY and EV_SYN. 772 + * 2) Absolute events are exactly ABS_X and ABS_Y. 773 + * 3) Keys are exactly BTN_LEFT, BTN_RIGHT and BTN_MIDDLE. 774 + * 4) Device is not on "Amiga" bus. 775 + */ 776 + 777 + bitmap_zero(jd_scratch, EV_CNT); 778 + __set_bit(EV_ABS, jd_scratch); 779 + __set_bit(EV_KEY, jd_scratch); 780 + __set_bit(EV_SYN, jd_scratch); 781 + if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT)) 782 + return false; 783 + 784 + bitmap_zero(jd_scratch, ABS_CNT); 785 + __set_bit(ABS_X, jd_scratch); 786 + __set_bit(ABS_Y, jd_scratch); 787 + if (!bitmap_equal(dev->absbit, jd_scratch, ABS_CNT)) 788 + return false; 789 + 790 + bitmap_zero(jd_scratch, KEY_CNT); 791 + __set_bit(BTN_LEFT, jd_scratch); 792 + __set_bit(BTN_RIGHT, jd_scratch); 793 + __set_bit(BTN_MIDDLE, jd_scratch); 794 + 795 + if (!bitmap_equal(dev->keybit, jd_scratch, KEY_CNT)) 796 + return false; 797 + 798 + /* 799 + * Amiga joystick (amijoy) historically uses left/middle/right 800 + * button events. 801 + */ 802 + if (dev->id.bustype == BUS_AMIGA) 803 + return false; 804 + 805 + return true; 806 + } 750 807 751 808 static bool joydev_match(struct input_handler *handler, struct input_dev *dev) 752 809 { ··· 813 756 814 757 /* Avoid tablets, digitisers and similar devices */ 815 758 if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_DIGI, dev->keybit)) 759 + return false; 760 + 761 + /* Avoid absolute mice */ 762 + if (joydev_dev_is_absolute_mouse(dev)) 816 763 return false; 817 764 818 765 return true;
+1 -1
drivers/input/mouse/Kconfig
··· 156 156 Say Y here if you are running under control of VMware hypervisor 157 157 (ESXi, Workstation or Fusion). Also make sure that when you enable 158 158 this option, you remove the xf86-input-vmmouse user-space driver 159 - or upgrade it to at least xf86-input-vmmouse 13.0.1, which doesn't 159 + or upgrade it to at least xf86-input-vmmouse 13.1.0, which doesn't 160 160 load in the presence of an in-kernel vmmouse driver. 161 161 162 162 If unsure, say N.
+5
drivers/input/mouse/alps.c
··· 941 941 case V7_PACKET_ID_TWO: 942 942 mt[1].x &= ~0x000F; 943 943 mt[1].y |= 0x000F; 944 + /* Detect false-postive touches where x & y report max value */ 945 + if (mt[1].y == 0x7ff && mt[1].x == 0xff0) { 946 + mt[1].x = 0; 947 + /* y gets set to 0 at the end of this function */ 948 + } 944 949 break; 945 950 946 951 case V7_PACKET_ID_MULTI:
+1 -1
drivers/input/mouse/elantech.c
··· 315 315 unsigned int x2, unsigned int y2) 316 316 { 317 317 elantech_set_slot(dev, 0, num_fingers != 0, x1, y1); 318 - elantech_set_slot(dev, 1, num_fingers == 2, x2, y2); 318 + elantech_set_slot(dev, 1, num_fingers >= 2, x2, y2); 319 319 } 320 320 321 321 /*
+1 -1
drivers/input/touchscreen/stmpe-ts.c
··· 164 164 STMPE_TSC_CTRL_TSC_EN, STMPE_TSC_CTRL_TSC_EN); 165 165 166 166 /* start polling for touch_det to detect release */ 167 - schedule_delayed_work(&ts->work, HZ / 50); 167 + schedule_delayed_work(&ts->work, msecs_to_jiffies(50)); 168 168 169 169 return IRQ_HANDLED; 170 170 }
+1 -1
drivers/input/touchscreen/sx8654.c
··· 187 187 return -ENOMEM; 188 188 189 189 input = devm_input_allocate_device(&client->dev); 190 - if (!sx8654) 190 + if (!input) 191 191 return -ENOMEM; 192 192 193 193 input->name = "SX8654 I2C Touchscreen";