linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: fix bit shift for Cintiq Companion 2
@ 2019-07-23 18:09 Aaron Armstrong Skomra
  2019-08-05 12:15 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Aaron Armstrong Skomra @ 2019-07-23 18:09 UTC (permalink / raw)
  To: linux-input, jikos, benjamin.tissoires, pinglinux, jason.gerecke
  Cc: Aaron Armstrong Skomra, # v4 . 5+

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: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Link: https://github.com/linuxwacom/xf86-input-wacom/issues/71
Fixes: c7f0522a1ad1 ("HID: wacom: Slim down wacom_intuos_pad processing")
Cc: <stable@vger.kernel.org> # v4.5+
---
 drivers/hid/wacom_wac.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 8fc36a28081b..7a8ddc999a8e 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -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) {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: fix bit shift for Cintiq Companion 2
  2019-07-23 18:09 [PATCH] HID: wacom: fix bit shift for Cintiq Companion 2 Aaron Armstrong Skomra
@ 2019-08-05 12:15 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2019-08-05 12:15 UTC (permalink / raw)
  To: Aaron Armstrong Skomra
  Cc: linux-input, benjamin.tissoires, pinglinux, jason.gerecke,
	Aaron Armstrong Skomra, # v4 . 5+

On Tue, 23 Jul 2019, Aaron Armstrong Skomra wrote:

> 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: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
> Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
> Link: https://github.com/linuxwacom/xf86-input-wacom/issues/71
> Fixes: c7f0522a1ad1 ("HID: wacom: Slim down wacom_intuos_pad processing")
> Cc: <stable@vger.kernel.org> # v4.5+

Applied to for-5.3/upstream-fixes. Thanks,

-- 
Jiri Kosina
SUSE Labs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-05 12:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-23 18:09 [PATCH] HID: wacom: fix bit shift for Cintiq Companion 2 Aaron Armstrong Skomra
2019-08-05 12:15 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).