diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-08 13:49:28 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-06-08 13:49:28 -0400 |
| commit | 00fda1682efdbd62a20a8a21aee52d994c323c7f (patch) | |
| tree | f49cee6c892019f193bf29985604951dd81ea94d /drivers/input | |
| parent | 1c4b1d73bacc546ba4e42f7eb4cb88c54139820b (diff) | |
| parent | d4a4f75cd8f29cd9464a5a32e9224a91571d6649 (diff) | |
Merge 4.1-rc7 into tty-next
This fixes up a merge issue with the amba-pl011.c driver, and we want
the fixes in this branch as well.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/joydev.c | 61 | ||||
| -rw-r--r-- | drivers/input/mouse/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/input/mouse/alps.c | 10 | ||||
| -rw-r--r-- | drivers/input/mouse/elantech.c | 10 | ||||
| -rw-r--r-- | drivers/input/touchscreen/stmpe-ts.c | 2 | ||||
| -rw-r--r-- | drivers/input/touchscreen/sx8654.c | 2 |
6 files changed, 77 insertions, 10 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index f362883c94e3..1d247bcf2ae2 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -747,6 +747,63 @@ static void joydev_cleanup(struct joydev *joydev) | |||
| 747 | input_close_device(handle); | 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 | static bool joydev_match(struct input_handler *handler, struct input_dev *dev) | 808 | static bool joydev_match(struct input_handler *handler, struct input_dev *dev) |
| 752 | { | 809 | { |
| @@ -758,6 +815,10 @@ static bool joydev_match(struct input_handler *handler, struct input_dev *dev) | |||
| 758 | if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_DIGI, dev->keybit)) | 815 | if (test_bit(EV_KEY, dev->evbit) && test_bit(BTN_DIGI, dev->keybit)) |
| 759 | return false; | 816 | return false; |
| 760 | 817 | ||
| 818 | /* Avoid absolute mice */ | ||
| 819 | if (joydev_dev_is_absolute_mouse(dev)) | ||
| 820 | return false; | ||
| 821 | |||
| 761 | return true; | 822 | return true; |
| 762 | } | 823 | } |
| 763 | 824 | ||
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 7462d2fc8cfe..d7820d1152d2 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig | |||
| @@ -156,7 +156,7 @@ config MOUSE_PS2_VMMOUSE | |||
| 156 | Say Y here if you are running under control of VMware hypervisor | 156 | Say Y here if you are running under control of VMware hypervisor |
| 157 | (ESXi, Workstation or Fusion). Also make sure that when you enable | 157 | (ESXi, Workstation or Fusion). Also make sure that when you enable |
| 158 | this option, you remove the xf86-input-vmmouse user-space driver | 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 | load in the presence of an in-kernel vmmouse driver. | 160 | load in the presence of an in-kernel vmmouse driver. |
| 161 | 161 | ||
| 162 | If unsure, say N. | 162 | If unsure, say N. |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index e6708f6efb4d..a353b7de6d22 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -941,6 +941,11 @@ static void alps_get_finger_coordinate_v7(struct input_mt_pos *mt, | |||
| 941 | case V7_PACKET_ID_TWO: | 941 | case V7_PACKET_ID_TWO: |
| 942 | mt[1].x &= ~0x000F; | 942 | mt[1].x &= ~0x000F; |
| 943 | mt[1].y |= 0x000F; | 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 | break; | 949 | break; |
| 945 | 950 | ||
| 946 | case V7_PACKET_ID_MULTI: | 951 | case V7_PACKET_ID_MULTI: |
| @@ -1058,9 +1063,8 @@ static void alps_process_trackstick_packet_v7(struct psmouse *psmouse) | |||
| 1058 | right = (packet[1] & 0x02) >> 1; | 1063 | right = (packet[1] & 0x02) >> 1; |
| 1059 | middle = (packet[1] & 0x04) >> 2; | 1064 | middle = (packet[1] & 0x04) >> 2; |
| 1060 | 1065 | ||
| 1061 | /* Divide 2 since trackpoint's speed is too fast */ | 1066 | input_report_rel(dev2, REL_X, (char)x); |
| 1062 | input_report_rel(dev2, REL_X, (char)x / 2); | 1067 | input_report_rel(dev2, REL_Y, -((char)y)); |
| 1063 | input_report_rel(dev2, REL_Y, -((char)y / 2)); | ||
| 1064 | 1068 | ||
| 1065 | input_report_key(dev2, BTN_LEFT, left); | 1069 | input_report_key(dev2, BTN_LEFT, left); |
| 1066 | input_report_key(dev2, BTN_RIGHT, right); | 1070 | input_report_key(dev2, BTN_RIGHT, right); |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index 991dc6b20a58..ce3d40004458 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -315,7 +315,7 @@ static void elantech_report_semi_mt_data(struct input_dev *dev, | |||
| 315 | unsigned int x2, unsigned int y2) | 315 | unsigned int x2, unsigned int y2) |
| 316 | { | 316 | { |
| 317 | elantech_set_slot(dev, 0, num_fingers != 0, x1, y1); | 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 | /* |
| @@ -1376,10 +1376,11 @@ static bool elantech_is_signature_valid(const unsigned char *param) | |||
| 1376 | return true; | 1376 | return true; |
| 1377 | 1377 | ||
| 1378 | /* | 1378 | /* |
| 1379 | * Some models have a revision higher then 20. Meaning param[2] may | 1379 | * Some hw_version >= 4 models have a revision higher then 20. Meaning |
| 1380 | * be 10 or 20, skip the rates check for these. | 1380 | * that param[2] may be 10 or 20, skip the rates check for these. |
| 1381 | */ | 1381 | */ |
| 1382 | if (param[0] == 0x46 && (param[1] & 0xef) == 0x0f && param[2] < 40) | 1382 | if ((param[0] & 0x0f) >= 0x06 && (param[1] & 0xaf) == 0x0f && |
| 1383 | param[2] < 40) | ||
| 1383 | return true; | 1384 | return true; |
| 1384 | 1385 | ||
| 1385 | for (i = 0; i < ARRAY_SIZE(rates); i++) | 1386 | for (i = 0; i < ARRAY_SIZE(rates); i++) |
| @@ -1555,6 +1556,7 @@ static int elantech_set_properties(struct elantech_data *etd) | |||
| 1555 | case 9: | 1556 | case 9: |
| 1556 | case 10: | 1557 | case 10: |
| 1557 | case 13: | 1558 | case 13: |
| 1559 | case 14: | ||
| 1558 | etd->hw_version = 4; | 1560 | etd->hw_version = 4; |
| 1559 | break; | 1561 | break; |
| 1560 | default: | 1562 | default: |
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index 2d5ff86b343f..e4c31256a74d 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c | |||
| @@ -164,7 +164,7 @@ static irqreturn_t stmpe_ts_handler(int irq, void *data) | |||
| 164 | STMPE_TSC_CTRL_TSC_EN, STMPE_TSC_CTRL_TSC_EN); | 164 | STMPE_TSC_CTRL_TSC_EN, STMPE_TSC_CTRL_TSC_EN); |
| 165 | 165 | ||
| 166 | /* start polling for touch_det to detect release */ | 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 | return IRQ_HANDLED; | 169 | return IRQ_HANDLED; |
| 170 | } | 170 | } |
diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index aecb9ad2e701..642f4a53de50 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c | |||
| @@ -187,7 +187,7 @@ static int sx8654_probe(struct i2c_client *client, | |||
| 187 | return -ENOMEM; | 187 | return -ENOMEM; |
| 188 | 188 | ||
| 189 | input = devm_input_allocate_device(&client->dev); | 189 | input = devm_input_allocate_device(&client->dev); |
| 190 | if (!sx8654) | 190 | if (!input) |
| 191 | return -ENOMEM; | 191 | return -ENOMEM; |
| 192 | 192 | ||
| 193 | input->name = "SX8654 I2C Touchscreen"; | 193 | input->name = "SX8654 I2C Touchscreen"; |
