HID: asus: ignore declared dummy usages
authorMatjaz Hegedic <matjaz.hegedic@gmail.com>
Wed, 8 Mar 2017 23:31:14 +0000 (00:31 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 30 Mar 2017 09:16:53 +0000 (11:16 +0200)
commit0485b1ec280cb9b2b6ed6e44e999294b4c698182
treee86b1c61d5097beed35419813bef3058f84b6791
parenta93913e1496d6103ec0b76d8397fc04ece55f570
HID: asus: ignore declared dummy usages

Keyboards handled by hid-asus declare special key functions
using a vendor-specific page, however, alongside legitimate
key functions, dummy usages with seemingly arbitrary values
are also declared and can lead to keyboards being detected
as pointer devices by some software (such as X.org).

In addition, for the I2C keyboard volume controls are
separately declared in a Consumer Usage page, with the same
dummy usage problem.

The fix in 1989dada7ce0 ("HID: input: ignore System Control
application usages if not System Controls") does not mitigate
the problem described above, therefore dummy usages need to
be ignored in the driver itself.

This fix properly ignores dummy usages and introduces a quirk
for custom handling of the Consumer Usages on the I2C keyboard.

Signed-off-by: Matjaz Hegedic <matjaz.hegedic@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-asus.c