Discussion:
[Linuxwacom-devel] [PATCH input-wacom] backport: add support for DTH-1152 on 2.6.30, 2.6.36, 2.6.38, and 3.7
Aaron Armstrong Skomra
2017-07-13 16:34:24 UTC
Permalink
Signed-off-by: Aaron Armstrong Skomra <***@wacom.com>
---
2.6.30/wacom_sys.c | 22 +++++++++++++++++---
2.6.30/wacom_wac.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
2.6.30/wacom_wac.h | 4 ++++
2.6.36/wacom_sys.c | 17 +++++++++++++++-
2.6.36/wacom_wac.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++
2.6.36/wacom_wac.h | 4 ++++
2.6.38/wacom_sys.c | 6 +++++-
2.6.38/wacom_wac.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2.6.38/wacom_wac.h | 3 +++
3.7/wacom_sys.c | 6 +++++-
3.7/wacom_wac.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
3.7/wacom_wac.h | 3 +++
12 files changed, 287 insertions(+), 6 deletions(-)

diff --git a/2.6.30/wacom_sys.c b/2.6.30/wacom_sys.c
index cd175765e809..ef07953b6de7 100644
--- a/2.6.30/wacom_sys.c
+++ b/2.6.30/wacom_sys.c
@@ -262,7 +262,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
features->type == MTTPC ||
features->type == MTTPC_B ||
features->type == MTTPC_C ||
- features->type == WACOM_MSPROT) {
+ features->type == WACOM_MSPROT ||
+ features->type == DTH1152T) {
/* need to reset back */
features->pktlen = WACOM_PKGLEN_TPC2FG;
if (features->type == MTTPC ||
@@ -271,6 +272,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
features->pktlen = WACOM_PKGLEN_MTTPC;
else if (features->type == WACOM_MSPROT)
features->pktlen = WACOM_PKGLEN_MSPROT;
+ else if (features->type == DTH1152T)
+ features->pktlen = WACOM_PKGLEN_27QHDT;
features->device_type = BTN_TOOL_TRIPLETAP;
}
if (features->type == BAMBOO_PT) {
@@ -296,6 +299,13 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
get_unaligned_le16(&report[i + 8]);
features->unit = report[i - 1];
features->unitExpo = report[i - 3];
+ } else if (features->type == DTH1152T) {
+ features->x_max =
+ get_unaligned_le16(&report[i + 3]);
+ features->x_phy =
+ get_unaligned_le16(&report[i + 8]);
+ features->unit = report[i - 1];
+ features->unitExpo = report[i - 3];
} else {
features->x_max =
get_unaligned_le16(&report[i + 3]);
@@ -341,6 +351,11 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
get_unaligned_le16(&report[i + 3]);
features->y_max =
get_unaligned_le16(&report[i + 6]);
+ } else if (features->type == DTH1152T) {
+ features->y_max =
+ get_unaligned_le16(&report[i + 3]);
+ features->y_phy =
+ get_unaligned_le16(&report[i - 2]);
} else {
features->y_max =
features->x_max;
@@ -432,8 +447,9 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT,
report_id, rep_data, 4, 1);
} while ((error < 0 || rep_data[1] != 4) && limit++ < 5);
- }
- else if (features->type == WACOM_MSPROT) {
+
+ } else if (features->type == WACOM_MSPROT ||
+ features->type == DTH1152T) {
do {
rep_data[0] = 14;
rep_data[1] = 2;
diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index f9a19dccafe9..f12f810f8e8d 100644
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -464,6 +464,37 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
}
}

+static int wacom_dth1152_irq(struct wacom_wac *wacom)
+{
+ unsigned char *data = wacom->data;
+ struct input_dev *input = wacom->input;
+ unsigned short prox, pressure = 0;
+
+ if (data[0] != WACOM_REPORT_DTUS) {
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d", __func__, data[0]);
+ return 0;
+ } else {
+ prox = data[1] & 0x80;
+ if (prox) {
+ wacom->tool[0] = BTN_TOOL_PEN;
+ wacom->id[0] = STYLUS_DEVICE_ID;
+ }
+ input_report_key(input, BTN_STYLUS, data[1] & 0x20);
+ input_report_abs(input, ABS_X, get_unaligned_le16(&data[4]));
+ input_report_abs(input, ABS_Y, get_unaligned_le16(&data[6]));
+ pressure = data[2] | (data[3] << 8);
+ input_report_abs(input, ABS_PRESSURE, pressure);
+ input_report_key(input, BTN_TOUCH, data[1] & 0x10);
+
+ if (!prox)
+ wacom->id[0] = 0;
+ input_report_key(input, wacom->tool[0], prox);
+ input_report_abs(input, ABS_MISC, wacom->id[0]);
+ return 1;
+ }
+}
+
static int wacom_graphire_irq(struct wacom_wac *wacom)
{
struct wacom_features *features = &wacom->features;
@@ -1108,6 +1139,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)

switch (features->type) {
case WACOM_MSPROT:
+ case DTH1152T:
current_num_contacts = data[2];
break;
case INTUOSP2:
@@ -1146,6 +1178,14 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
y = get_unaligned_le16(&data[offset + 4]);
break;

+ case DTH1152T:
+ offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
+ prox = data[offset] & 0x1;
+ contact_id = get_unaligned_le16(&data[offset + 1]);
+ x = get_unaligned_le16(&data[offset + 3]);
+ y = get_unaligned_le16(&data[offset + 5]);
+ break;
+
default:
continue;
}
@@ -1710,6 +1750,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_dtus_irq(wacom_wac);
break;

+ case DTH1152:
+ sync = wacom_dth1152_irq(wacom_wac);
+ break;
+
case INTUOS:
case INTUOS3S:
case INTUOS3:
@@ -1732,6 +1776,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_mspro_irq(wacom_wac);
break;

+ case DTH1152T:
case WACOM_MSPROT:
sync = wacom_multitouch_generic(wacom_wac);
break;
@@ -2154,6 +2199,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case MTTPC:
case MTTPC_B:
case MTTPC_C:
+ case DTH1152T:
case WACOM_MSPROT:
if (features->device_type == BTN_TOOL_TRIPLETAP) {
for (i = 0; i < 10; i++)
@@ -2186,6 +2232,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case PL:
case PTU:
case DTU:
+ case DTH1152:
if (features->type == DTUS) {
input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
}
@@ -2517,6 +2564,12 @@ static const struct wacom_features wacom_features_0x357 =
{ "Wacom Co,.Ltd. Wacom Intuos Pro M", WACOM_PKGLEN_INTUOSP2, 44800, 29600, 8191, 63, INTUOSP2, 9 };
static const struct wacom_features wacom_features_0x358 =
{ "Wacom Co,.Ltd. Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191, 63, INTUOSP2, 9 };
+static const struct wacom_features wacom_features_0x35A =
+ { "Wacom Co.,Ltd. DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1024,
+ 0, DTH1152, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x368 };
+static const struct wacom_features wacom_features_0x368 =
+ { "Wacom Co.,Ltd. DTH-1152 Touch", WACOM_PKGLEN_27QHDT, .type = DTH1152T,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x35a }; /* Touch */

#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -2680,6 +2733,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x354) },
{ USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
+ { USB_DEVICE_WACOM(0x35A) },
+ { USB_DEVICE_WACOM(0x368) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/2.6.30/wacom_wac.h b/2.6.30/wacom_wac.h
index 732aabb6d36b..cfbf37ab89bf 100755
--- a/2.6.30/wacom_wac.h
+++ b/2.6.30/wacom_wac.h
@@ -32,6 +32,8 @@
#define WACOM_PKGLEN_INTUOSP2 64
#define WACOM_PKGLEN_INTUOSP2T 44
#define WACOM_PKGLEN_MSPROT 50
+#define WACOM_PKGLEN_27QHDT 64
+#define WACOM_PKGLEN_DTH1152 16

/* wacom data size per MT contact */
#define WACOM_BYTES_PER_MT_PACKET 11
@@ -80,6 +82,7 @@ enum {
DTU,
DTUS,
DTUSX,
+ DTH1152,
INTUOS,
INTUOS3S,
INTUOS3,
@@ -108,6 +111,7 @@ enum {
INTUOSHT2,
BAMBOO_PT,
WACOM_MSPROT,
+ DTH1152T,
INTUOSP2,
TABLETPC,
TABLETPC2FG,
diff --git a/2.6.36/wacom_sys.c b/2.6.36/wacom_sys.c
index b010dcdfda2e..8a52c6298f01 100644
--- a/2.6.36/wacom_sys.c
+++ b/2.6.36/wacom_sys.c
@@ -275,6 +275,8 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
features->pktlen = WACOM_PKGLEN_MTOUCH;
else if (features->type == WACOM_MSPROT)
features->pktlen = WACOM_PKGLEN_MSPROT;
+ else if (features->type == DTH1152T)
+ features->pktlen = WACOM_PKGLEN_27QHDT;

if (features->type == BAMBOO_PT) {
features->pktlen = WACOM_PKGLEN_BBTOUCH;
@@ -291,6 +293,13 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
get_unaligned_le16(&report[i + 6]);
features->unit = report[i - 5];
features->unitExpo = report[i - 3];
+ } else if (features->type == DTH1152T) {
+ features->x_max =
+ get_unaligned_le16(&report[i + 3]);
+ features->x_phy =
+ get_unaligned_le16(&report[i + 8]);
+ features->unit = report[i - 1];
+ features->unitExpo = report[i - 3];
} else {
features->touch_max = 1;
features->x_max =
@@ -327,6 +336,11 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
get_unaligned_le16(&report[i + 3]);
features->y_phy =
get_unaligned_le16(&report[i + 6]);
+ } else if (features->type == DTH1152T) {
+ features->y_max =
+ get_unaligned_le16(&report[i + 3]);
+ features->y_phy =
+ get_unaligned_le16(&report[i - 2]);
} else {
features->y_max =
features->x_max;
@@ -451,7 +465,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
/* only devices support touch need to retrieve the info */
if ((features->type != TABLETPC) && (features->type != TABLETPC2FG) &&
(features->type != BAMBOO_PT) && (features->type != MTSCREEN) &&
- (features->type != WACOM_MSPROT) && (features->type != INTUOSP2))
+ (features->type != WACOM_MSPROT) && (features->type != INTUOSP2) &&
+ (features->type != DTH1152T))
goto out;

if (usb_get_extra_descriptor(interface, HID_DEVICET_HID, &hid_desc)) {
diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
index 7a3009228219..a38dc75eee13 100644
--- a/2.6.36/wacom_wac.c
+++ b/2.6.36/wacom_wac.c
@@ -259,6 +259,37 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
}
}

+static int wacom_dth1152_irq(struct wacom_wac *wacom)
+{
+ unsigned char *data = wacom->data;
+ struct input_dev *input = wacom->input;
+ unsigned short prox, pressure = 0;
+
+ if (data[0] != WACOM_REPORT_DTUS) {
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d", __func__, data[0]);
+ return 0;
+ } else {
+ prox = data[1] & 0x80;
+ if (prox) {
+ wacom->tool[0] = BTN_TOOL_PEN;
+ wacom->id[0] = STYLUS_DEVICE_ID;
+ }
+ input_report_key(input, BTN_STYLUS, data[1] & 0x20);
+ input_report_abs(input, ABS_X, get_unaligned_le16(&data[4]));
+ input_report_abs(input, ABS_Y, get_unaligned_le16(&data[6]));
+ pressure = data[2] | (data[3] << 8);
+ input_report_abs(input, ABS_PRESSURE, pressure);
+ input_report_key(input, BTN_TOUCH, data[1] & 0x10);
+
+ if (!prox)
+ wacom->id[0] = 0;
+ input_report_key(input, wacom->tool[0], prox);
+ input_report_abs(input, ABS_MISC, wacom->id[0]);
+ return 1;
+ }
+}
+
static int wacom_graphire_irq(struct wacom_wac *wacom)
{
struct wacom_features *features = &wacom->features;
@@ -1261,6 +1292,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
int i, current_num_contacts, contacts_to_send;

switch (features->type) {
+ case DTH1152T:
case WACOM_MSPROT:
current_num_contacts = data[2];
break;
@@ -1302,6 +1334,14 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
y = get_unaligned_le16(&data[offset + 4]);
break;

+ case DTH1152T:
+ offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
+ prox = data[offset] & 0x1;
+ contact_id = get_unaligned_le16(&data[offset + 1]);
+ x = get_unaligned_le16(&data[offset + 3]);
+ y = get_unaligned_le16(&data[offset + 5]);
+ break;
+
default:
continue;
}
@@ -1549,6 +1589,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_dtus_irq(wacom_wac);
break;

+ case DTH1152:
+ sync = wacom_dth1152_irq(wacom_wac);
+ break;
+
case INTUOS:
case INTUOS3S:
case INTUOS3:
@@ -1576,6 +1620,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_mspro_irq(wacom_wac);
break;

+ case DTH1152T:
case WACOM_MSPROT:
sync = wacom_multitouch_generic(wacom_wac);
break;
@@ -1889,6 +1934,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
wacom_setup_intuos(wacom_wac);
break;

+ case DTH1152T:
case WACOM_MSPROT:
case TABLETPC2FG:
case MTSCREEN:
@@ -1917,6 +1963,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
case PL:
case PTU:
case DTU:
+ case DTH1152:
if (features->type == DTUS) {
input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
}
@@ -2352,6 +2399,12 @@ static const struct wacom_features wacom_features_0x357 =
static const struct wacom_features wacom_features_0x358 =
{ "Wacom Co,.Ltd. Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191,
63, INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
+static const struct wacom_features wacom_features_0x35A =
+ { "Wacom Co.,Ltd. DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1024,
+ 0, DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x368 =
+ { "Wacom Co.,Ltd. DTH-1152 Touch", WACOM_PKGLEN_27QHDT,
+ .type = DTH1152T }; /* Touch */
static const struct wacom_features wacom_features_0x6004 =
{ "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2491,6 +2544,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x354) },
{ USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
+ { USB_DEVICE_WACOM(0x35A) },
+ { USB_DEVICE_WACOM(0x368) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/2.6.36/wacom_wac.h b/2.6.36/wacom_wac.h
index ada1628e146e..d4207692f359 100644
--- a/2.6.36/wacom_wac.h
+++ b/2.6.36/wacom_wac.h
@@ -30,6 +30,8 @@
#define WACOM_PKGLEN_MSPROT 50
#define WACOM_PKGLEN_INTUOSP2 64
#define WACOM_PKGLEN_INTUOSP2T 44
+#define WACOM_PKGLEN_27QHDT 64
+#define WACOM_PKGLEN_DTH1152 16

/* device IDs */
#define STYLUS_DEVICE_ID 0x02
@@ -77,6 +79,7 @@ enum {
DTU,
DTUS,
DTUSX,
+ DTH1152,
BAMBOO_PT,
INTUOS,
INTUOS3S,
@@ -101,6 +104,7 @@ enum {
WACOM_13HD,
WACOM_MO,
WACOM_MSPROT,
+ DTH1152T,
INTUOSP2,
TABLETPC,
TABLETPCE,
diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c
index d4aa9cc355ec..807ae1f3ce7a 100644
--- a/2.6.38/wacom_sys.c
+++ b/2.6.38/wacom_sys.c
@@ -399,6 +399,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
features->pktlen = WACOM_PKGLEN_MTOUCH;
break;

+ case DTH1152T:
case WACOM_27QHDT:
features->pktlen = WACOM_PKGLEN_27QHDT;
break;
@@ -430,6 +431,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
get_unaligned_le16(&report[i + 8]);
break;

+ case DTH1152T:
case WACOM_24HDT:
features->x_max =
get_unaligned_le16(&report[i + 3]);
@@ -500,6 +502,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
get_unaligned_le16(&report[i + 6]);
break;

+ case DTH1152T:
case WACOM_24HDT:
case MTTPC_C:
features->y_max =
@@ -657,7 +660,8 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
else if (features->type == WACOM_27QHDT) {
return wacom_set_device_mode(intf, 131, 3, 2);
}
- else if (features->type == WACOM_MSPROT) {
+ else if (features->type == WACOM_MSPROT ||
+ features->type == DTH1152T) {
return wacom_set_device_mode(intf, 14, 2, 2);
}
} else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index eec09bd34637..79c50fbcbf61 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -309,6 +309,37 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
}
}

+static int wacom_dth1152_irq(struct wacom_wac *wacom)
+{
+ unsigned char *data = wacom->data;
+ struct input_dev *input = wacom->input;
+ unsigned short prox, pressure = 0;
+
+ if (data[0] != WACOM_REPORT_DTUS) {
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d", __func__, data[0]);
+ return 0;
+ } else {
+ prox = data[1] & 0x80;
+ if (prox) {
+ wacom->tool[0] = BTN_TOOL_PEN;
+ wacom->id[0] = STYLUS_DEVICE_ID;
+ }
+ input_report_key(input, BTN_STYLUS, data[1] & 0x20);
+ input_report_abs(input, ABS_X, get_unaligned_le16(&data[4]));
+ input_report_abs(input, ABS_Y, get_unaligned_le16(&data[6]));
+ pressure = data[2] | (data[3] << 8);
+ input_report_abs(input, ABS_PRESSURE, pressure);
+ input_report_key(input, BTN_TOUCH, data[1] & 0x10);
+
+ if (!prox)
+ wacom->id[0] = 0;
+ input_report_key(input, wacom->tool[0], prox);
+ input_report_abs(input, ABS_MISC, wacom->id[0]);
+ return 1;
+ }
+}
+
static int wacom_graphire_irq(struct wacom_wac *wacom)
{
struct wacom_features *features = &wacom->features;
@@ -1144,6 +1175,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)

switch (features->type) {
case WACOM_MSPROT:
+ case DTH1152T:
current_num_contacts = data[2];
break;
case INTUOSP2:
@@ -1188,6 +1220,16 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
h = data[offset + 7];
break;

+ case DTH1152T:
+ offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
+ prox = data[offset] & 0x1;
+ contact_id = get_unaligned_le16(&data[offset + 1]);
+ x = get_unaligned_le16(&data[offset + 3]);
+ y = get_unaligned_le16(&data[offset + 5]);
+ w = data[offset + 7] * 133;
+ h = data[offset + 8] * 133;
+ break;
+
default:
continue;
}
@@ -2009,6 +2051,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_dtus_irq(wacom_wac);
break;

+ case DTH1152:
+ sync = wacom_dth1152_irq(wacom_wac);
+ break;
+
case INTUOS:
case INTUOS3S:
case INTUOS3:
@@ -2033,6 +2079,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_mspro_irq(wacom_wac);
break;

+ case DTH1152T:
case WACOM_MSPROT:
sync = wacom_multitouch_generic(wacom_wac);
break;
@@ -2483,6 +2530,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
}
/* fall through */

+ case DTH1152T:
case WACOM_MSPROT:
if (features->device_type == BTN_TOOL_FINGER) {
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0);
@@ -2529,6 +2577,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
case DTUSX:
case PL:
case DTU:
+ case DTH1152:
if (features->type == DTUS) {
input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
}
@@ -3200,6 +3249,14 @@ static const struct wacom_features wacom_features_0x357 =
static const struct wacom_features wacom_features_0x358 =
{ "Wacom Co,.Ltd. Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191,
63, INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
+static const struct wacom_features wacom_features_0x35A =
+ { "Wacom Co.,Ltd. DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1024,
+ 0, DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x368 };
+static const struct wacom_features wacom_features_0x368 =
+ { "Wacom Co.,Ltd. DTH-1152 Touch", WACOM_PKGLEN_27QHDT,
+ .type = DTH1152T, .touch_max = 10, .oVid = USB_VENDOR_ID_WACOM,
+ .oPid = 0x35A }; /* Touch */

#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -3381,6 +3438,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x354) },
{ USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
+ { USB_DEVICE_WACOM(0x35A) },
+ { USB_DEVICE_WACOM(0x368) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h
index 09157e6b9fc0..ea1b4f91c7f4 100644
--- a/2.6.38/wacom_wac.h
+++ b/2.6.38/wacom_wac.h
@@ -39,6 +39,7 @@
#define WACOM_PKGLEN_MSPROT 50
#define WACOM_PKGLEN_INTUOSP2 64
#define WACOM_PKGLEN_INTUOSP2T 44
+#define WACOM_PKGLEN_DTH1152 16

/* wacom data size per MT contact */
#define WACOM_BYTES_PER_MT_PACKET 11
@@ -100,6 +101,7 @@ enum {
DTU,
DTUS,
DTUSX,
+ DTH1152,
INTUOS,
INTUOS3S,
INTUOS3,
@@ -131,6 +133,7 @@ enum {
WACOM_24HDT,
WACOM_27QHDT,
WACOM_MSPROT,
+ DTH1152T,
INTUOSP2,
WIRELESS,
REMOTE,
diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c
index a4613c84b3a2..79d30ab6abe6 100644
--- a/3.7/wacom_sys.c
+++ b/3.7/wacom_sys.c
@@ -400,6 +400,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
features->pktlen = WACOM_PKGLEN_MTOUCH;
break;

+ case DTH1152T:
case WACOM_27QHDT:
features->pktlen = WACOM_PKGLEN_27QHDT;
break;
@@ -431,6 +432,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
get_unaligned_le16(&report[i + 8]);
break;

+ case DTH1152T:
case WACOM_24HDT:
features->x_max =
get_unaligned_le16(&report[i + 3]);
@@ -501,6 +503,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
get_unaligned_le16(&report[i + 6]);
break;

+ case DTH1152T:
case WACOM_24HDT:
case MTTPC_C:
features->y_max =
@@ -658,7 +661,8 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat
else if (features->type == WACOM_27QHDT) {
return wacom_set_device_mode(intf, 131, 3, 2);
}
- else if (features->type == WACOM_MSPROT) {
+ else if (features->type == WACOM_MSPROT ||
+ features->type == DTH1152T) {
return wacom_set_device_mode(intf, 14, 2, 2);
}
} else if (features->device_type == BTN_TOOL_PEN) {
diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
index 1d76a12bc57e..34b236944f3c 100644
--- a/3.7/wacom_wac.c
+++ b/3.7/wacom_wac.c
@@ -309,6 +309,37 @@ static int wacom_dtus_irq(struct wacom_wac *wacom)
}
}

+static int wacom_dth1152_irq(struct wacom_wac *wacom)
+{
+ unsigned char *data = wacom->data;
+ struct input_dev *input = wacom->input;
+ unsigned short prox, pressure = 0;
+
+ if (data[0] != WACOM_REPORT_DTUS) {
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d", __func__, data[0]);
+ return 0;
+ } else {
+ prox = data[1] & 0x80;
+ if (prox) {
+ wacom->tool[0] = BTN_TOOL_PEN;
+ wacom->id[0] = STYLUS_DEVICE_ID;
+ }
+ input_report_key(input, BTN_STYLUS, data[1] & 0x20);
+ input_report_abs(input, ABS_X, get_unaligned_le16(&data[4]));
+ input_report_abs(input, ABS_Y, get_unaligned_le16(&data[6]));
+ pressure = data[2] | (data[3] << 8);
+ input_report_abs(input, ABS_PRESSURE, pressure);
+ input_report_key(input, BTN_TOUCH, data[1] & 0x10);
+
+ if (!prox)
+ wacom->id[0] = 0;
+ input_report_key(input, wacom->tool[0], prox);
+ input_report_abs(input, ABS_MISC, wacom->id[0]);
+ return 1;
+ }
+}
+
static int wacom_graphire_irq(struct wacom_wac *wacom)
{
struct wacom_features *features = &wacom->features;
@@ -1124,6 +1155,7 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)

switch (features->type) {
case WACOM_MSPROT:
+ case DTH1152T:
current_num_contacts = data[2];
break;
case INTUOSP2:
@@ -1168,6 +1200,16 @@ static int wacom_multitouch_generic(struct wacom_wac *wacom)
h = data[offset + 7];
break;

+ case DTH1152T:
+ offset = WACOM_BYTES_PER_MSPROT_PACKET * i + 3;
+ prox = data[offset] & 0x1;
+ contact_id = get_unaligned_le16(&data[offset + 1]);
+ x = get_unaligned_le16(&data[offset + 3]);
+ y = get_unaligned_le16(&data[offset + 5]);
+ w = data[offset + 7] * 133;
+ h = data[offset + 8] * 133;
+ break;
+
default:
continue;
}
@@ -1989,6 +2031,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_dtus_irq(wacom_wac);
break;

+ case DTH1152:
+ sync = wacom_dth1152_irq(wacom_wac);
+ break;
+
case INTUOS:
case INTUOS3S:
case INTUOS3:
@@ -2013,6 +2059,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
sync = wacom_mspro_irq(wacom_wac);
break;

+ case DTH1152T:
case WACOM_MSPROT:
sync = wacom_multitouch_generic(wacom_wac);
break;
@@ -2447,6 +2494,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
}
/* fall through */

+ case DTH1152T:
case WACOM_MSPROT:
if (features->device_type == BTN_TOOL_FINGER) {
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0);
@@ -2482,6 +2530,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
case DTUSX:
case PL:
case DTU:
+ case DTH1152:
if (features->type == DTUS) {
input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
}
@@ -3139,6 +3188,14 @@ static const struct wacom_features wacom_features_0x357 =
static const struct wacom_features wacom_features_0x358 =
{ "Wacom Co,.Ltd. Wacom Intuos Pro L", WACOM_PKGLEN_INTUOSP2, 62200, 43200, 8191,
63, INTUOSP2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
+static const struct wacom_features wacom_features_0x35A =
+ { "Wacom Co.,Ltd. DTH-1152", WACOM_PKGLEN_DTH1152, 22320, 12555, 1024,
+ 0, DTH1152, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+ .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x368 };
+static const struct wacom_features wacom_features_0x368 =
+ { "Wacom Co.,Ltd. DTH-1152 Touch", WACOM_PKGLEN_27QHDT,
+ .type = DTH1152T, .touch_max = 10, .oVid = USB_VENDOR_ID_WACOM,
+ .oPid = 0x35A }; /* Touch */

#define USB_DEVICE_WACOM(prod) \
USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -3320,6 +3377,8 @@ const struct usb_device_id wacom_ids[] = {
{ USB_DEVICE_WACOM(0x354) },
{ USB_DEVICE_DETAILED(0x357, USB_CLASS_HID, 0, 0) },
{ USB_DEVICE_DETAILED(0x358, USB_CLASS_HID, 0, 0) },
+ { USB_DEVICE_WACOM(0x35A) },
+ { USB_DEVICE_WACOM(0x368) },
{ USB_DEVICE_LENOVO(0x6004) },
{ }
};
diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h
index 81cfe2db8f64..09e34da245f5 100644
--- a/3.7/wacom_wac.h
+++ b/3.7/wacom_wac.h
@@ -39,6 +39,7 @@
#define WACOM_PKGLEN_MSPROT 50
#define WACOM_PKGLEN_INTUOSP2 64
#define WACOM_PKGLEN_INTUOSP2T 44
+#define WACOM_PKGLEN_DTH1152 16

/* wacom data size per MT contact */
#define WACOM_BYTES_PER_MT_PACKET 11
@@ -100,6 +101,7 @@ enum {
DTU,
DTUS,
DTUSX,
+ DTH1152,
INTUOS,
INTUOS3S,
INTUOS3,
@@ -131,6 +133,7 @@ enum {
WACOM_24HDT,
WACOM_27QHDT,
WACOM_MSPROT,
+ DTH1152T,
INTUOSP2,
WIRELESS,
REMOTE,
--
2.7.4
Loading...