diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-13 14:40:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-13 14:40:42 -0700 |
commit | 073c916bc00571d8662b89a294eba265481b6fbb (patch) | |
tree | edc0238b56251dd056137323e7171d1452407516 /drivers/input/joydev.c | |
parent | a2d79c7174aeb43b13020dd53d85a7aefdd9f3e5 (diff) | |
parent | 597473720f4dc69749542bfcfed4a927a43d935e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
- an update to Elan touchpad SMBus driver to fetch device parameters
(size, resolution) while it is still in PS/2 mode, before switching
over to SMBus, as in that mode some devices return garbage dimensions
- update to iforce joystick driver
- miscellaneous driver fixes
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (48 commits)
Input: gpio_keys_polled - allow specifying name of input device
Input: edt-ft5x06 - simplify event reporting code
Input: max77650-onkey - add MODULE_ALIAS()
Input: atmel_mxt_ts - fix leak in mxt_update_cfg()
Input: synaptics - enable SMBUS on T480 thinkpad trackpad
Input: atmel_mxt_ts - fix -Wunused-const-variable
Input: joydev - extend absolute mouse detection
HID: quirks: Refactor ELAN 400 and 401 handling
Input: elan_i2c - export the device id whitelist
Input: edt-ft5x06 - use get_unaligned_be16()
Input: iforce - add the Saitek R440 Force Wheel
Input: iforce - use unaligned accessors, where appropriate
Input: iforce - drop couple of temps from transport code
Input: iforce - drop bus type from iforce structure
Input: iforce - use DMA-safe buffores for USB transfers
Input: iforce - allow callers supply data buffer when fetching device IDs
Input: iforce - only call iforce_process_packet() if initialized
Input: iforce - signal command completion from transport code
Input: iforce - do not combine arguments for iforce_process_packet()
Input: iforce - factor out hat handling when parsing packets
...
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r-- | drivers/input/joydev.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index ac21c050fdb0..a2b5fbba2d3b 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c @@ -808,6 +808,7 @@ static bool joydev_dev_is_blacklisted(struct input_dev *dev) static bool joydev_dev_is_absolute_mouse(struct input_dev *dev) { DECLARE_BITMAP(jd_scratch, KEY_CNT); + bool ev_match = false; BUILD_BUG_ON(ABS_CNT > KEY_CNT || EV_CNT > KEY_CNT); @@ -826,17 +827,36 @@ static bool joydev_dev_is_absolute_mouse(struct input_dev *dev) * considered to be an absolute mouse if the following is * true: * - * 1) Event types are exactly EV_ABS, EV_KEY and EV_SYN. + * 1) Event types are exactly + * EV_ABS, EV_KEY and EV_SYN + * or + * EV_ABS, EV_KEY, EV_SYN and EV_MSC + * or + * EV_ABS, EV_KEY, EV_SYN, EV_MSC and EV_REL. * 2) Absolute events are exactly ABS_X and ABS_Y. * 3) Keys are exactly BTN_LEFT, BTN_RIGHT and BTN_MIDDLE. * 4) Device is not on "Amiga" bus. */ bitmap_zero(jd_scratch, EV_CNT); + /* VMware VMMouse, HP ILO2 */ __set_bit(EV_ABS, jd_scratch); __set_bit(EV_KEY, jd_scratch); __set_bit(EV_SYN, jd_scratch); - if (!bitmap_equal(jd_scratch, dev->evbit, EV_CNT)) + if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT)) + ev_match = true; + + /* HP ILO2, AMI BMC firmware */ + __set_bit(EV_MSC, jd_scratch); + if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT)) + ev_match = true; + + /* VMware Virtual USB Mouse, QEMU USB Tablet, ATEN BMC firmware */ + __set_bit(EV_REL, jd_scratch); + if (bitmap_equal(jd_scratch, dev->evbit, EV_CNT)) + ev_match = true; + + if (!ev_match) return false; bitmap_zero(jd_scratch, ABS_CNT); |