提交 693c3dab 编写于 作者: A Aaron Armstrong Skomra 提交者: Jiri Kosina

HID: wacom: fix bit shift for Cintiq Companion 2

The bit indicating BTN_6 on this device is overshifted
by 2 bits, resulting in the incorrect button being
reported.

Also fix copy-paste mistake in comments.
Signed-off-by: NAaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: NPing Cheng <ping.cheng@wacom.com>
Link: https://github.com/linuxwacom/xf86-input-wacom/issues/71
Fixes: c7f0522a ("HID: wacom: Slim down wacom_intuos_pad processing")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 7bc74853
......@@ -533,14 +533,14 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
*/
buttons = (data[4] << 1) | (data[3] & 0x01);
} else if (features->type == CINTIQ_COMPANION_2) {
/* d-pad right -> data[4] & 0x10
* d-pad up -> data[4] & 0x20
* d-pad left -> data[4] & 0x40
* d-pad down -> data[4] & 0x80
* d-pad center -> data[3] & 0x01
/* d-pad right -> data[2] & 0x10
* d-pad up -> data[2] & 0x20
* d-pad left -> data[2] & 0x40
* d-pad down -> data[2] & 0x80
* d-pad center -> data[1] & 0x01
*/
buttons = ((data[2] >> 4) << 7) |
((data[1] & 0x04) << 6) |
((data[1] & 0x04) << 4) |
((data[2] & 0x0F) << 2) |
(data[1] & 0x03);
} else if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册