]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 18 Jan 2022 07:26:18 +0000 (23:26 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:38 +0000 (11:57 +0200)
commitb92712fe55aad2f37f54efcfa789c50a70ece436
treed2160ce0d6f5be1b602321bb7fca030c046fabab
parent90ce169bf3b05dfe80bc6a3edbb98e334469c015
HID: i2c-hid: fix GET/SET_REPORT for unnumbered reports

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit a5e5e03e94764148a01757b2fa4737d3445c13a6 ]

Internally kernel prepends all report buffers, for both numbered and
unnumbered reports, with report ID, therefore to properly handle unnumbered
reports we should prepend it ourselves.

For the same reason we should skip the first byte of the buffer when
calling i2c_hid_set_or_send_report() which then will take care of properly
formatting the transfer buffer based on its separate report ID argument
along with report payload.

[jkosina@suse.cz: finalize trimmed sentence in changelog as spotted by Benjamin]
Fixes: 9b5a9ae88573 ("HID: i2c-hid: implement ll_driver transport-layer callbacks")
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit b5b285818754befc80a4f56180f27b92ba80040e)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/hid/i2c-hid/i2c-hid-core.c