HID: i2c-hid: fix handling numbered reports with IDs of 15 and above
authorAngela Czubak <acz@semihalf.com>
Tue, 18 Jan 2022 07:26:17 +0000 (23:26 -0800)
committerJiri Kosina <jkosina@suse.cz>
Mon, 14 Feb 2022 09:50:55 +0000 (10:50 +0100)
commitcf5b2fb012c037fe20f617a11eb048ef70ce4b9e
tree428b6668028477cacb0f1f75baa08ef717e616dd
parent9b57f458985742bd1c585f4c7f36d04634ce1143
HID: i2c-hid: fix handling numbered reports with IDs of 15 and above

Special handling of numbered reports with IDs of 15 and above is only
needed when executing what HID-I2C spec is calling "Class Specific
Requests", and not when simply sending output reports.

Additionally, our mangling of report ID in i2c_hid_set_or_send_report()
resulted in incorrect report ID being written into SET_REPORT command
payload.

To solve it let's move all the report ID manipulation into
__i2c_hid_command() where we form the command data structure.

Signed-off-by: Angela Czubak <acz@semihalf.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid-core.c