alistair23-linux/drivers/hid
Benjamin Tissoires 1989dada7c HID: input: ignore System Control application usages if not System Controls
Microsoft is reusing its report descriptor again and again, and part of it
looks like this:

0x05, 0x01,                    // Usage Page (Generic Desktop)        299
0x09, 0x80,                    // Usage (System Control)              301
0xa1, 0x01,                    // Collection (Application)            303
0x85, 0x03,                    //  Report ID (3)                      305
0x19, 0x00,                    //  Usage Minimum (0)                  307
0x29, 0xff,                    //  Usage Maximum (255)                309
0x15, 0x00,                    //  Logical Minimum (0)                311
0x26, 0xff, 0x00,              //  Logical Maximum (255)              313
0x81, 0x00,                    //  Input (Data,Arr,Abs)               316
0xc0,                          // End Collection                      318

While there is nothing wrong in term of processing, we do however blindly
map the full usage range (it's an array) from 0x00 to 0xff, which creates
some interesting axis, like ABS_X|Y, and a bunch of ABS_MISC + n.

While libinput and other stacks don't care that much (we can detect them),
joydev is very happy and attaches itself to the mouse or keyboard.

The problem is that joydev now handles the device as a joystick, but given
that we have a HID array, it sets all the ABS_* values to 0. And in its
world, 0 means -32767 (minimum value), which sends spurious events to games
(think Steam).

It looks like hid-microsoft tries to tackle the very same problem with its
.report_fixup callback. But fixing the report descriptor is an endless task
and is quite obfuscated.

So take the hammer, and decide that if the application is meant to be
System Control, any other usage not in the System Control range should
be ignored.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=1325354
Link: https://bugzilla.kernel.org/show_bug.cgi?id=28912
Link: https://github.com/ValveSoftware/steam-for-linux/issues/3384
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1325354
Link: https://bugzilla.kernel.org/show_bug.cgi?id=37982

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-09-19 14:02:25 +02:00
..
i2c-hid HID: i2c-hid: set power sleep before shutdown 2016-06-21 13:07:15 +02:00
usbhid HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands 2016-06-24 10:21:39 +02:00
hid-a4tech.c
hid-alps.c HID: alps: a few cleanups 2016-06-23 08:56:36 +02:00
hid-apple.c HID: add usb device id for Apple Magic Keyboard 2016-07-11 17:41:31 +02:00
hid-appleir.c HID: hid-input: allow input_configured callback return errors 2015-11-05 09:51:50 -08:00
hid-asus.c HID: asus: add support for VivoBook E200HA 2016-04-04 09:59:21 +02:00
hid-aureal.c HID: fix some indenting issues 2015-10-21 13:15:53 +02:00
hid-axff.c
hid-belkin.c
hid-betopff.c
hid-cherry.c
hid-chicony.c HID: chicony: Add support for Acer Aspire Switch 12 2015-07-29 14:12:26 +02:00
hid-cmedia.c HID: Support for CMedia CM6533 HID audio jack controls 2016-03-02 10:31:36 +01:00
hid-core.c Merge branch 'for-4.8/hid-led' into for-linus 2016-07-28 10:49:23 +02:00
hid-corsair.c HID: corsair: fix mapping of non-keyboard usages 2016-02-23 14:21:19 +01:00
hid-cp2112.c GPIO bulk updates for the v4.5 kernel cycle: 2016-01-17 12:32:01 -08:00
hid-cypress.c
hid-debug.c HID: debug: improve hid_debug_event() 2015-11-27 00:02:59 +01:00
hid-dr.c HID: dragonrise: fix a typo in descriptors comments s/Joystik/Joystick/ 2016-01-29 17:12:31 +01:00
hid-elecom.c HID: fix some indenting issues 2015-10-21 13:15:53 +02:00
hid-elo.c HID: elo: kill not flush the work 2016-06-01 14:08:17 +02:00
hid-emsff.c
hid-ezkey.c
hid-gaff.c
hid-gembird.c HID: gembird: add new driver to fix Gembird JPD-DualForce 2 2015-08-18 15:03:43 +02:00
hid-generic.c
hid-gfrm.c HID: hid-gfrm: avoid warning for input_configured API change 2015-11-05 10:15:35 -08:00
hid-gt683r.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-gyration.c
hid-holtek-kbd.c
hid-holtek-mouse.c
hid-holtekff.c
hid-hyperv.c
hid-icade.c
hid-ids.h Merge branch 'for-4.8/hid-led' into for-linus 2016-07-28 10:49:23 +02:00
hid-input.c HID: input: ignore System Control application usages if not System Controls 2016-09-19 14:02:25 +02:00
hid-kensington.c
hid-keytouch.c
hid-kye.c
hid-lcpower.c
hid-led.c HID: hid-led: fix Delcom support on big endian systems 2016-07-08 12:36:03 +02:00
hid-lenovo.c HID: lenovo: Don't use stack variables for DMA buffers 2016-03-29 15:39:36 +02:00
hid-lg.c HID: lg: fix a typo in descriptors comments s/Joystik/Joystick/ 2016-02-10 11:31:10 +01:00
hid-lg.h
hid-lg2ff.c
hid-lg3ff.c
hid-lg4ff.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-lg4ff.h
hid-lgff.c
hid-logitech-dj.c
hid-logitech-hidpp.c HID: logitech-hidpp: limit visibility of init/deinit functions 2016-01-28 14:28:39 +01:00
hid-magicmouse.c HID: hid-input: allow input_configured callback return errors 2015-11-05 09:51:50 -08:00
hid-microsoft.c HID: microsoft: add support for 3 more devices 2016-04-04 15:56:16 +02:00
hid-monterey.c
hid-multitouch.c HID: multitouch: enable palm rejection for Windows Precision Touchpad 2016-06-28 13:24:14 +02:00
hid-ntrig.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-ortek.c
hid-penmount.c HID: penmount: report only one button for PenMount 6000 USB touchscreen controller 2016-03-10 17:17:26 +01:00
hid-petalynx.c
hid-picolcd.h
hid-picolcd_backlight.c
hid-picolcd_cir.c
hid-picolcd_core.c
hid-picolcd_debugfs.c
hid-picolcd_fb.c
hid-picolcd_lcd.c
hid-picolcd_leds.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-pl.c
hid-plantronics.c
hid-primax.c
hid-prodikeys.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-rmi.c HID: rmi: Check that the device is a RMI device in suspend and resume callbacks 2016-01-27 22:39:32 +01:00
hid-roccat-arvo.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-arvo.h
hid-roccat-common.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-common.h
hid-roccat-isku.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-isku.h
hid-roccat-kone.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-kone.h
hid-roccat-koneplus.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-koneplus.h
hid-roccat-konepure.c
hid-roccat-kovaplus.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-kovaplus.h
hid-roccat-lua.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-lua.h
hid-roccat-pyra.c HID: use kobj_to_dev() 2015-12-28 13:41:51 +01:00
hid-roccat-pyra.h
hid-roccat-ryos.c
hid-roccat-savu.c
hid-roccat-savu.h
hid-roccat.c HID: roccat: silence an uninitialized variable warning 2016-04-04 09:49:12 +02:00
hid-saitek.c HID: saitek: mode button quirk for Mad Catz R.A.T.5 2015-09-04 14:44:44 +02:00
hid-samsung.c
hid-sensor-custom.c
hid-sensor-hub.c asm-generic changes for 4.5 2016-01-20 17:30:20 -08:00
hid-sjoy.c
hid-sony.c Merge branches 'for-4.5/upstream-fixes', 'for-4.6/cmedia', 'for-4.6/i2c-hid', 'for-4.6/logitech', 'for-4.6/multitouch', 'for-4.6/penmount', 'for-4.6/sony', 'for-4.6/thingm', 'for-4.6/upstream' and 'for-4.6/wacom' into for-linus 2016-03-17 13:51:54 +01:00
hid-speedlink.c
hid-steelseries.c HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-sunplus.c
hid-tivo.c
hid-tmff.c
hid-topseed.c
hid-twinhan.c
hid-uclogic.c HID: hid-input: allow input_configured callback return errors 2015-11-05 09:51:50 -08:00
hid-waltop.c
hid-wiimote-core.c
hid-wiimote-debug.c
hid-wiimote-modules.c HID: wiimote: Fix wiimote mp scale linearization 2016-03-18 17:31:38 +01:00
hid-wiimote.h HID: use to_hid_device() 2015-12-28 13:41:44 +01:00
hid-xinmo.c
hid-zpff.c
hid-zydacron.c
hidraw.c Merge branch 'for-4.7/upstream' into for-linus 2016-05-17 12:41:22 +02:00
Kconfig Merge branch 'for-4.8/hid-led' into for-linus 2016-07-28 10:49:23 +02:00
Makefile Merge branch 'for-4.8/hid-led' into for-linus 2016-07-28 10:49:23 +02:00
uhid.c HID: uhid: fix timeout when probe races with IO 2016-06-01 16:24:54 +02:00
wacom.h HID: wacom: Add support for Express Key Remote. 2015-08-28 20:43:20 +02:00
wacom_sys.c HID: wacom: Add fuzz factor to distance and tilt axes 2016-05-03 11:55:05 +02:00
wacom_wac.c Merge branch 'for-4.7/wacom' into for-linus 2016-05-17 12:42:27 +02:00
wacom_wac.h HID: wacom: Add fuzz factor to distance and tilt axes 2016-05-03 11:55:05 +02:00