Discussion:
[Linuxwacom-devel] [PATCH] Fix a Cintiq 27QHD touch issue
Jason Gerecke
2016-06-27 23:19:42 UTC
Permalink
From: Ping Cheng <***@wacom.com>

The HID descriptor for the Cintiq 27QHD touch contains a single-touch
report which follows the multitouch report we're interested in. The
wacom_parse_hid function does not properly parse the single-touch report,
resulting in incorrect values being set. To prevent this from causing
problems, do not change the values after they have been set properly
while parsing the multitouch report.

Signed-off-by: Ping Cheng <***@wacom.com>
Signed-off-by: Jason Gerecke <***@wacom.com>
---
2.6.38/wacom_sys.c | 24 ++++++++++++++----------
3.7/wacom_sys.c | 24 ++++++++++++++----------
2 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c
index 191ea92..fb6cc62 100644
--- a/2.6.38/wacom_sys.c
+++ b/2.6.38/wacom_sys.c
@@ -410,12 +410,14 @@ static int wacom_parse_hid(struct usb_interface *intf,
break;

case WACOM_27QHDT:
- features->x_max =
- get_unaligned_le16(&report[i - 4]);
- features->x_phy =
- get_unaligned_le16(&report[i - 7]);
- features->unit = report[i - 13];
- features->unitExpo = report[i - 11];
+ if (!features->x_max) {
+ features->x_max =
+ get_unaligned_le16(&report[i - 4]);
+ features->x_phy =
+ get_unaligned_le16(&report[i - 7]);
+ features->unit = report[i - 13];
+ features->unitExpo = report[i - 11];
+ }
i += 9;
break;

@@ -472,10 +474,12 @@ static int wacom_parse_hid(struct usb_interface *intf,
break;

case WACOM_27QHDT:
- features->y_max =
- get_unaligned_le16(&report[i - 2]);
- features->y_phy =
- get_unaligned_le16(&report[i - 5]);
+ if (!features->y_max) {
+ features->y_max =
+ get_unaligned_le16(&report[i - 2]);
+ features->y_phy =
+ get_unaligned_le16(&report[i - 5]);
+ }
i += 2;
break;

diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c
index 8afeeb2..5fc85e9 100644
--- a/3.7/wacom_sys.c
+++ b/3.7/wacom_sys.c
@@ -411,12 +411,14 @@ static int wacom_parse_hid(struct usb_interface *intf,
break;

case WACOM_27QHDT:
- features->x_max =
- get_unaligned_le16(&report[i - 4]);
- features->x_phy =
- get_unaligned_le16(&report[i - 7]);
- features->unit = report[i - 13];
- features->unitExpo = report[i - 11];
+ if (!features->x_max) {
+ features->x_max =
+ get_unaligned_le16(&report[i - 4]);
+ features->x_phy =
+ get_unaligned_le16(&report[i - 7]);
+ features->unit = report[i - 13];
+ features->unitExpo = report[i - 11];
+ }
i += 9;
break;

@@ -473,10 +475,12 @@ static int wacom_parse_hid(struct usb_interface *intf,
break;

case WACOM_27QHDT:
- features->y_max =
- get_unaligned_le16(&report[i - 2]);
- features->y_phy =
- get_unaligned_le16(&report[i - 5]);
+ if (!features->y_max) {
+ features->y_max =
+ get_unaligned_le16(&report[i - 2]);
+ features->y_phy =
+ get_unaligned_le16(&report[i - 5]);
+ }
i += 2;
break;
--
1.9.1
Loading...