Commit c7f0522 incorrectly constructs the 'buttons' variable for the
CINTIQ_COMPANION_2 case. The high nybble of data[2] is shifted four
bits too far, leaving the bits associated with BTN_7 through BTN_A
unset.

Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
[jason.gere...@wacom.com: Imported into input-wacom repository (0402b6b)]
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
[jason.gere...@wacom.com: backported from input-wacom 60d0c9f]
Signed-off-by: Jason Gerecke <jason.gere...@wacom.com>
---
 2.6.38/wacom_wac.c | 2 +-
 3.7/wacom_wac.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index b4296de..fbf07ea 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -465,7 +465,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
                 * d-pad down   -> data[4] & 0x80
                 * d-pad center -> data[3] & 0x01
                 */
-               buttons = ((data[2] & 0xF0) << 7) |
+               buttons = ((data[2] >> 4) << 7) |
                          ((data[1] & 0x04) << 6) |
                          ((data[2] & 0x0F) << 2) |
                          (data[1] & 0x03);
diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
index 8580060..9bc8dc7 100644
--- a/3.7/wacom_wac.c
+++ b/3.7/wacom_wac.c
@@ -465,7 +465,7 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
                 * d-pad down   -> data[4] & 0x80
                 * d-pad center -> data[3] & 0x01
                 */
-               buttons = ((data[2] & 0xF0) << 7) |
+               buttons = ((data[2] >> 4) << 7) |
                          ((data[1] & 0x04) << 6) |
                          ((data[2] & 0x0F) << 2) |
                          (data[1] & 0x03);
-- 
2.7.1


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to