# \[PATCH\] HID: wacom: bits shifted too much for 9th and 10th buttons

- Subsystems: HID CORE LAYER, HID WACOM DRIVER, THE REST
- Maintainers: Jiri Kosina, Benjamin Tissoires, Ping Cheng, Jason Gerecke, Linus Torvalds
- Status: REVIEWED · 1 review, 0 by maintainers (Matthieu Robin)
- Reviewed.
- 1 review trailer.
- List: linux-input
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2017/08/8930368/t

## \[PATCH\] HID: wacom: bits shifted too much for 9th and 10th buttons

- From: Ping Cheng \<hidden\>
- Date: 2017-08-31 22:50:12 
- Message: https://ratatoskr.run/linux-input/2017/08/8930368.md

```text
Cintiq 12 has 10 expresskey buttons. The bit shift for the last
two buttons were off by 5.

Fixes: c7f0522 ("HID: wacom: Slim down wacom_intuos_pad processing")

Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
Tested-by: Matthieu Robin <redacted>
---
 drivers/hid/wacom_wac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 9f94029..801889c 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -567,8 +567,8 @@ static int wacom_intuos_pad(struct wacom_wac *wacom)
 				keys = data[9] & 0x07;
 			}
 		} else {
-			buttons = ((data[6] & 0x10) << 10) |
-			          ((data[5] & 0x10) << 9)  |
+			buttons = ((data[6] & 0x10) << 5)  |
+			          ((data[5] & 0x10) << 4)  |
 			          ((data[6] & 0x0F) << 4)  |
 			          (data[5] & 0x0F);
 		}
-- 
2.7.4

```

## Re: \[PATCH\] HID: wacom: bits shifted too much for 9th and 10th buttons

- From: Jiri Kosina \<jikos@kernel.org\>
- Date: 2017-09-06 08:47:04 
- Message: https://ratatoskr.run/linux-input/2017/09/8930375.md

```text
On Thu, 31 Aug 2017, Ping Cheng wrote:

> Cintiq 12 has 10 expresskey buttons. The bit shift for the last
> two buttons were off by 5.
> 
> Fixes: c7f0522 ("HID: wacom: Slim down wacom_intuos_pad processing")
> 
> Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
> Tested-by: Matthieu Robin <redacted>

Applied to for-4.14/upstream-fixes.

-- 
Jiri Kosina
SUSE Labs

```
