diff mbox series

HID: wacom: correct misreported EKR ring values

Message ID 1565982054-29236-1-git-send-email-aaron.skomra@wacom.com (mailing list archive)
State Superseded
Delegated to: Jiri Kosina
Headers show
Series HID: wacom: correct misreported EKR ring values | expand

Commit Message

Aaron Armstrong Skomra Aug. 16, 2019, 7 p.m. UTC
The EKR ring claims a range of 0 to 71 but actually reports
values 1 to 72. The ring is used in relative mode so this
change should not affect users.

Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
Fixes: 72b236d60218f ("HID: wacom: Add support for Express Key Remote.")
Cc: <stable@vger.kernel.org> # v4.3+
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
---
 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Kosina Aug. 20, 2019, 8:43 a.m. UTC | #1
On Fri, 16 Aug 2019, Aaron Armstrong Skomra wrote:

> The EKR ring claims a range of 0 to 71 but actually reports
> values 1 to 72. The ring is used in relative mode so this
> change should not affect users.
> 
> Signed-off-by: Aaron Armstrong Skomra <aaron.skomra@wacom.com>
> Fixes: 72b236d60218f ("HID: wacom: Add support for Express Key Remote.")
> Cc: <stable@vger.kernel.org> # v4.3+
> Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
> Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>

Queued for 5.3, thanks Aaron.
diff mbox series

Patch

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index abc17f2c8ef0..e314a7564236 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1098,7 +1098,7 @@  static int wacom_remote_irq(struct wacom_wac *wacom_wac, size_t len)
 	input_report_key(input, BTN_BASE2, (data[11] & 0x02));
 
 	if (data[12] & 0x80)
-		input_report_abs(input, ABS_WHEEL, (data[12] & 0x7f));
+		input_report_abs(input, ABS_WHEEL, (data[12] & 0x7f) - 1);
 	else
 		input_report_abs(input, ABS_WHEEL, 0);