]> git.baikalelectronics.ru Git - kernel.git/commit
HID: wacom: Fix logic used for 3rd barrel switch emulation
authorJason Gerecke <killertofu@gmail.com>
Thu, 3 Nov 2022 17:33:04 +0000 (10:33 -0700)
committerJiri Kosina <jkosina@suse.cz>
Fri, 4 Nov 2022 08:34:38 +0000 (09:34 +0100)
commit01c1073a25f0192562fcc4c0078fccad9954bcf9
treecbaa313d7fd1dd5fa95bcd665a012096da888016
parentc39bde10c9bfe491248fd5467c3a96a196cfddd3
HID: wacom: Fix logic used for 3rd barrel switch emulation

When support was added for devices using an explicit 3rd barrel switch,
the logic used by devices emulating this feature was broken. The 'if'
statement / block that was introduced only handles the case where the
button is pressed (i.e. 'barrelswitch' and 'barrelswitch2' are both set)
but not the case where it is released (i.e. one or both being cleared).
This results in a BTN_STYLUS3 "down" event being sent when the button
is pressed, but no "up" event ever being sent afterwards.

This patch restores the previously-used logic for determining button
states in the emulated case so that switches are reported correctly
again.

Link: https://github.com/linuxwacom/xf86-input-wacom/issues/292
Fixes: 70a4fbe10b70 ("HID: wacom: Adding Support for new usages")
CC: stable@vger.kernel.org #v5.19+
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Tested-by: Joshua Dickens <joshua.dickens@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/wacom_wac.c