android_kernel_samsung_a7y1.../drivers/hid
Candle Sun cfee4d26d2 HID: core: check whether Usage Page item is after Usage ID items
commit 1cb0d2aee26335d0bccf29100c7bed00ebece851 upstream.

Upstream commit 58e75155009c ("HID: core: move Usage Page concatenation
to Main item") adds support for Usage Page item after Usage ID items
(such as keyboards manufactured by Primax).

Usage Page concatenation in Main item works well for following report
descriptor patterns:

    USAGE_PAGE (Keyboard)                   05 07
    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    INPUT (Data,Var,Abs)                    81 02

-------------

    USAGE_MINIMUM (Keyboard LeftControl)    19 E0
    USAGE_MAXIMUM (Keyboard Right GUI)      29 E7
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (8)                        95 08
    USAGE_PAGE (Keyboard)                   05 07
    INPUT (Data,Var,Abs)                    81 02

But it makes the parser act wrong for the following report
descriptor pattern(such as some Gamepads):

    USAGE_PAGE (Button)                     05 09
    USAGE (Button 1)                        09 01
    USAGE (Button 2)                        09 02
    USAGE (Button 4)                        09 04
    USAGE (Button 5)                        09 05
    USAGE (Button 7)                        09 07
    USAGE (Button 8)                        09 08
    USAGE (Button 14)                       09 0E
    USAGE (Button 15)                       09 0F
    USAGE (Button 13)                       09 0D
    USAGE_PAGE (Consumer Devices)           05 0C
    USAGE (Back)                            0a 24 02
    USAGE (HomePage)                        0a 23 02
    LOGICAL_MINIMUM (0)                     15 00
    LOGICAL_MAXIMUM (1)                     25 01
    REPORT_SIZE (1)                         75 01
    REPORT_COUNT (11)                       95 0B
    INPUT (Data,Var,Abs)                    81 02

With Usage Page concatenation in Main item, parser recognizes all the
11 Usages as consumer keys, it is not the HID device's real intention.

This patch checks whether Usage Page is really defined after Usage ID
items by comparing usage page using status.

Usage Page concatenation on currently defined Usage Page will always
do in local parsing when Usage ID items encountered.

When Main item is parsing, concatenation will do again with last
defined Usage Page if this page has not been used in the previous
usages concatenation.

Signed-off-by: Candle Sun <candle.sun@unisoc.com>
Signed-off-by: Nianfu Bai <nianfu.bai@unisoc.com>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Cc: Siarhei Vishniakou <svv@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 12:43:42 +02:00
..
i2c-hid A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usbhid HID: Add quirk for HP X1200 PIXART OEM mouse 2020-04-06 20:28:01 +02:00
hid-a4tech.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-apple.c HID: apple: Fix stuck function keys when using FN 2020-04-07 07:43:36 +02:00
hid-appleir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-aureal.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-axff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-belkin.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-betopff.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-cherry.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-chicony.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-core.c HID: core: check whether Usage Page item is after Usage ID items 2020-04-07 12:43:42 +02:00
hid-corsair.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-cp2112.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-cypress.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-debug.c HID: debug: fix race condition with between rdesc_show() and device removal 2020-04-06 16:42:06 +02:00
hid-dr.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-elecom.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-elo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-emsff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-ezkey.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-gaff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-gembird.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-generic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-gfrm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-gt683r.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-gyration.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-holtek-kbd.c HID: holtek: test for sanity of intfdata 2020-04-06 20:48:02 +02:00
hid-holtek-mouse.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-holtekff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-hyperv.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-icade.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-ids.h HID: Add quirk for HP X1200 PIXART OEM mouse 2020-04-06 20:28:01 +02:00
hid-input.c HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys 2020-04-06 16:43:27 +02:00
hid-kensington.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-keytouch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-kye.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-lcpower.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-lenovo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-lg.c HID: logitech: Fix general protection fault caused by Logitech driver 2020-04-07 07:36:25 +02:00
hid-lg.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-lg2ff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-lg3ff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-lg4ff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-lg4ff.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-lgff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-logitech-dj.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-logitech-hidpp.c HID: logitech-hidpp: use RAP instead of FAP to get the protocol version 2020-04-06 18:18:31 +02:00
hid-madcatz.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-magicmouse.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-microsoft.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-monterey.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-multitouch.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-ntrig.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-ortek.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-ovr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-penmount.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-petalynx.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_backlight.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_cir.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_debugfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_fb.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_lcd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd_leds.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-picolcd.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-pl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-plantronics.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-primax.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-prodikeys.c HID: prodikeys: Fix general protection fault during probe 2020-04-07 07:36:19 +02:00
hid-rmi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-arvo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-arvo.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-common.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-common.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-isku.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-isku.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-kone.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-kone.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-koneplus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-koneplus.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-konepure.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-kovaplus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-kovaplus.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-lua.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-lua.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-pyra.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-pyra.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-ryos.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-savu.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat-savu.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-roccat.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-saitek.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-samsung.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-sensor-custom.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-sensor-hub.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-sjoy.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-sony.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-speedlink.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-steelseries.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-sunplus.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-synaptics-bt.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-thingm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-tivo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-tmff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-topseed.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-twinhan.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-uclogic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-waltop.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-wiimote-core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-wiimote-debug.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-wiimote-modules.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-wiimote.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-xinmo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hid-zpff.c HID: Fix assumption that devices have inputs 2020-04-07 09:28:20 +02:00
hid-zydacron.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hidraw.c HID: hidraw: Fix invalid read in hidraw_ioctl 2020-04-07 07:36:28 +02:00
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uhid.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
wacom_sys.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
wacom_wac.c HID: wacom: correct misreported EKR ring values 2020-04-06 20:53:39 +02:00
wacom_wac.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
wacom.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30