linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2
@ 2014-05-10  1:30 Jason Gerecke
  2014-05-10  1:30 ` [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors Jason Gerecke
  2014-05-14 18:27 ` [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Ping Cheng
  0 siblings, 2 replies; 6+ messages in thread
From: Jason Gerecke @ 2014-05-10  1:30 UTC (permalink / raw)
  To: linux-input, dmitry.torokhov, pingc; +Cc: Jason Gerecke

The Win8 version of the Panasonic CF-H2 includes a new Wacom device.
The pen interface appears to use the same protocol as before, but the
touch interface has been tweaked to send Win8-compatible reports.

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
 drivers/input/tablet/wacom_wac.c | 8 ++++++++
 drivers/input/tablet/wacom_wac.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index a4d8f1d..e4566c3 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1107,6 +1107,10 @@ static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
 			prox = data[0] & 0x01;
 			x = get_unaligned_le16(&data[1]);
 			y = get_unaligned_le16(&data[3]);
+		} else if (len == WACOM_PKGLEN_TPC1FG_B) {
+			prox = data[2] & 0x01;
+			x = le16_to_cpup((__le16 *)&data[3]);
+			y = le16_to_cpup((__le16 *)&data[5]);
 		} else {
 			prox = data[1] & 0x01;
 			x = le16_to_cpup((__le16 *)&data[2]);
@@ -2298,6 +2302,9 @@ static const struct wacom_features wacom_features_0x10E =
 static const struct wacom_features wacom_features_0x10F =
 	{ "Wacom ISDv4 10F",      WACOM_PKGLEN_MTTPC,     27760, 15694,  255,
 	  0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x116 =
+	{ "Wacom ISDv4 116",      WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,
+	  0, TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 static const struct wacom_features wacom_features_0x4001 =
 	{ "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
 	  0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2512,6 +2519,7 @@ const struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE_WACOM(0x10D) },
 	{ USB_DEVICE_WACOM(0x10E) },
 	{ USB_DEVICE_WACOM(0x10F) },
+	{ USB_DEVICE_WACOM(0x116) },
 	{ USB_DEVICE_WACOM(0x300) },
 	{ USB_DEVICE_WACOM(0x301) },
 	{ USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 9f947c3..adf73cb 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -22,6 +22,7 @@
 #define WACOM_PKGLEN_BBFUN	 9
 #define WACOM_PKGLEN_INTUOS	10
 #define WACOM_PKGLEN_TPC1FG	 5
+#define WACOM_PKGLEN_TPC1FG_B	10
 #define WACOM_PKGLEN_TPC2FG	14
 #define WACOM_PKGLEN_BBTOUCH	20
 #define WACOM_PKGLEN_BBTOUCH3	64
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors
  2014-05-10  1:30 [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Jason Gerecke
@ 2014-05-10  1:30 ` Jason Gerecke
  2014-05-14 18:46   ` Dmitry Torokhov
  2014-05-14 18:27 ` [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Ping Cheng
  1 sibling, 1 reply; 6+ messages in thread
From: Jason Gerecke @ 2014-05-10  1:30 UTC (permalink / raw)
  To: linux-input, dmitry.torokhov, pingc; +Cc: Jason Gerecke

This patch adds support for the 0x4004, 0x5000, and 0x5002 sensors found
on what should be the Motion R12, Fujitsu Q704, and Fujitsu T904. These
tablets use a new report ID (3) for their touch packets and a slightly
different HID descriptor format, but are otherwise largely identical in
protocol to the "MTTPC" tablets.

Note:
 * The R12 uses its 0x4004 sensor for touch input only. A pen interface
   is not present in its HID descriptor, though its possible a 0x4004
   may be used for pen input by other tablet PCs in the future.

 * The 0x5002 sensor appears to use a new report ID (8) for its pen
   packets. The other sensors continue to use the traditional report
   ID (2).

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
 drivers/input/tablet/wacom_sys.c | 19 +++++++++++++++++++
 drivers/input/tablet/wacom_wac.c | 20 +++++++++++++++++++-
 drivers/input/tablet/wacom_wac.h |  3 +++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index b16ebef..0056a6d 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -364,6 +364,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							break;
 
 						case MTTPC:
+						case MTTPC_B:
 							features->pktlen = WACOM_PKGLEN_MTTPC;
 							break;
 
@@ -395,6 +396,16 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							i += 12;
 							break;
 
+						case MTTPC_B:
+							features->x_max =
+								get_unaligned_le16(&report[i + 3]);
+							features->x_phy =
+								get_unaligned_le16(&report[i + 6]);
+							features->unit = report[i - 5];
+							features->unitExpo = report[i - 3];
+							i += 9;
+							break;
+
 						default:
 							features->x_max =
 								get_unaligned_le16(&report[i + 3]);
@@ -447,6 +458,14 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							i += 12;
 							break;
 
+						case MTTPC_B:
+							features->y_max =
+								get_unaligned_le16(&report[i + 3]);
+							features->y_phy =
+								get_unaligned_le16(&report[i + 6]);
+							i += 9;
+							break;
+
 						default:
 							features->y_max =
 								features->x_max;
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index e4566c3..12da87e 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1022,7 +1022,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
 	int x_offset = 0;
 
 	/* MTTPC does not support Height and Width */
-	if (wacom->features.type == MTTPC)
+	if (wacom->features.type == MTTPC || wacom->features.type == MTTPC_B)
 		x_offset = -4;
 
 	/*
@@ -1179,6 +1179,9 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 	case WACOM_PKGLEN_TPC2FG:
 		return wacom_tpc_mt_touch(wacom);
 
+	case WACOM_PKGLEN_PENABLED:
+		return wacom_tpc_pen(wacom);
+
 	default:
 		switch (data[0]) {
 		case WACOM_REPORT_TPC1FG:
@@ -1188,6 +1191,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 			return wacom_tpc_single_touch(wacom, len);
 
 		case WACOM_REPORT_TPCMT:
+		case WACOM_REPORT_TPCMT2:
 			return wacom_mt_touch(wacom);
 
 		case WACOM_REPORT_PENABLED:
@@ -1530,6 +1534,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 	case TABLETPC2FG:
 	case MTSCREEN:
 	case MTTPC:
+	case MTTPC_B:
 		sync = wacom_tpc_irq(wacom_wac, len);
 		break;
 
@@ -1871,6 +1876,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
 
 	case MTSCREEN:
 	case MTTPC:
+	case MTTPC_B:
 	case TABLETPC2FG:
 		if (features->device_type == BTN_TOOL_FINGER) {
 			unsigned int flags = INPUT_MT_DIRECT;
@@ -2308,6 +2314,15 @@ static const struct wacom_features wacom_features_0x116 =
 static const struct wacom_features wacom_features_0x4001 =
 	{ "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
 	  0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x4004 =
+	{ "Wacom ISDv4 4004",      WACOM_PKGLEN_MTTPC,     11060, 6220,  255,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x5000 =
+	{ "Wacom ISDv4 5000",      WACOM_PKGLEN_MTTPC,     27848, 15752,  1023,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x5002 =
+	{ "Wacom ISDv4 5002",      WACOM_PKGLEN_MTTPC,     29576, 16724,  1023,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 static const struct wacom_features wacom_features_0x47 =
 	{ "Wacom Intuos2 6x8",    WACOM_PKGLEN_INTUOS,    20320, 16240, 1023,
 	  31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2530,6 +2545,9 @@ const struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_WACOM(0x4001) },
+	{ USB_DEVICE_WACOM(0x4004) },
+	{ USB_DEVICE_WACOM(0x5000) },
+	{ USB_DEVICE_WACOM(0x5002) },
 	{ USB_DEVICE_WACOM(0x47) },
 	{ USB_DEVICE_WACOM(0xF4) },
 	{ USB_DEVICE_WACOM(0xF8) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index adf73cb..84013a7 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -31,6 +31,7 @@
 #define WACOM_PKGLEN_MTOUCH	62
 #define WACOM_PKGLEN_MTTPC	40
 #define WACOM_PKGLEN_DTUS	68
+#define WACOM_PKGLEN_PENABLED	 8
 
 /* wacom data size per MT contact */
 #define WACOM_BYTES_PER_MT_PACKET	11
@@ -53,6 +54,7 @@
 #define WACOM_REPORT_TPC1FG		6
 #define WACOM_REPORT_TPC2FG		13
 #define WACOM_REPORT_TPCMT		13
+#define WACOM_REPORT_TPCMT2		3
 #define WACOM_REPORT_TPCHID		15
 #define WACOM_REPORT_TPCST		16
 #define WACOM_REPORT_DTUS		17
@@ -106,6 +108,7 @@ enum {
 	TABLETPC2FG,
 	MTSCREEN,
 	MTTPC,
+	MTTPC_B,
 	MAX_TYPE
 };
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2
  2014-05-10  1:30 [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Jason Gerecke
  2014-05-10  1:30 ` [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors Jason Gerecke
@ 2014-05-14 18:27 ` Ping Cheng
  2014-05-14 18:47   ` Dmitry Torokhov
  1 sibling, 1 reply; 6+ messages in thread
From: Ping Cheng @ 2014-05-14 18:27 UTC (permalink / raw)
  To: Jason Gerecke; +Cc: linux-input, Dmitry Torokhov

On Fri, May 9, 2014 at 6:30 PM, Jason Gerecke <killertofu@gmail.com> wrote:
> The Win8 version of the Panasonic CF-H2 includes a new Wacom device.
> The pen interface appears to use the same protocol as before, but the
> touch interface has been tweaked to send Win8-compatible reports.
>
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> ---
>  drivers/input/tablet/wacom_wac.c | 8 ++++++++
>  drivers/input/tablet/wacom_wac.h | 1 +
>  2 files changed, 9 insertions(+)
>
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index a4d8f1d..e4566c3 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -1107,6 +1107,10 @@ static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
>                         prox = data[0] & 0x01;
>                         x = get_unaligned_le16(&data[1]);
>                         y = get_unaligned_le16(&data[3]);
> +               } else if (len == WACOM_PKGLEN_TPC1FG_B) {
> +                       prox = data[2] & 0x01;
> +                       x = le16_to_cpup((__le16 *)&data[3]);
> +                       y = le16_to_cpup((__le16 *)&data[5]);

Above two lines should use get_unaligned_le16() instead.
wacom_mt_touch() needs some cleanup too.

Except that, the whole patchset looks good to me.

Reviewed-by: Ping Cheng <pingc@wacom.com>

Ping

>                 } else {
>                         prox = data[1] & 0x01;
>                         x = le16_to_cpup((__le16 *)&data[2]);
> @@ -2298,6 +2302,9 @@ static const struct wacom_features wacom_features_0x10E =
>  static const struct wacom_features wacom_features_0x10F =
>         { "Wacom ISDv4 10F",      WACOM_PKGLEN_MTTPC,     27760, 15694,  255,
>           0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
> +static const struct wacom_features wacom_features_0x116 =
> +       { "Wacom ISDv4 116",      WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,
> +         0, TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
>  static const struct wacom_features wacom_features_0x4001 =
>         { "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
>           0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
> @@ -2512,6 +2519,7 @@ const struct usb_device_id wacom_ids[] = {
>         { USB_DEVICE_WACOM(0x10D) },
>         { USB_DEVICE_WACOM(0x10E) },
>         { USB_DEVICE_WACOM(0x10F) },
> +       { USB_DEVICE_WACOM(0x116) },
>         { USB_DEVICE_WACOM(0x300) },
>         { USB_DEVICE_WACOM(0x301) },
>         { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
> diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
> index 9f947c3..adf73cb 100644
> --- a/drivers/input/tablet/wacom_wac.h
> +++ b/drivers/input/tablet/wacom_wac.h
> @@ -22,6 +22,7 @@
>  #define WACOM_PKGLEN_BBFUN      9
>  #define WACOM_PKGLEN_INTUOS    10
>  #define WACOM_PKGLEN_TPC1FG     5
> +#define WACOM_PKGLEN_TPC1FG_B  10
>  #define WACOM_PKGLEN_TPC2FG    14
>  #define WACOM_PKGLEN_BBTOUCH   20
>  #define WACOM_PKGLEN_BBTOUCH3  64
> --
> 1.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors
  2014-05-10  1:30 ` [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors Jason Gerecke
@ 2014-05-14 18:46   ` Dmitry Torokhov
  2014-05-14 22:31     ` [PATCH v2] " Jason Gerecke
  0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Torokhov @ 2014-05-14 18:46 UTC (permalink / raw)
  To: Jason Gerecke; +Cc: linux-input, pingc

On Fri, May 09, 2014 at 06:30:17PM -0700, Jason Gerecke wrote:
> This patch adds support for the 0x4004, 0x5000, and 0x5002 sensors found
> on what should be the Motion R12, Fujitsu Q704, and Fujitsu T904. These
> tablets use a new report ID (3) for their touch packets and a slightly
> different HID descriptor format, but are otherwise largely identical in
> protocol to the "MTTPC" tablets.
> 
> Note:
>  * The R12 uses its 0x4004 sensor for touch input only. A pen interface
>    is not present in its HID descriptor, though its possible a 0x4004
>    may be used for pen input by other tablet PCs in the future.
> 
>  * The 0x5002 sensor appears to use a new report ID (8) for its pen
>    packets. The other sensors continue to use the traditional report
>    ID (2).
> 
> Signed-off-by: Jason Gerecke <killertofu@gmail.com>

Hmm, that does not apply to my next branch, could it be because I pulled
out a patch unifying some reports that Ping asked me to pull out?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2
  2014-05-14 18:27 ` [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Ping Cheng
@ 2014-05-14 18:47   ` Dmitry Torokhov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2014-05-14 18:47 UTC (permalink / raw)
  To: Ping Cheng; +Cc: Jason Gerecke, linux-input

On Wed, May 14, 2014 at 11:27:27AM -0700, Ping Cheng wrote:
> On Fri, May 9, 2014 at 6:30 PM, Jason Gerecke <killertofu@gmail.com> wrote:
> > The Win8 version of the Panasonic CF-H2 includes a new Wacom device.
> > The pen interface appears to use the same protocol as before, but the
> > touch interface has been tweaked to send Win8-compatible reports.
> >
> > Signed-off-by: Jason Gerecke <killertofu@gmail.com>
> > ---
> >  drivers/input/tablet/wacom_wac.c | 8 ++++++++
> >  drivers/input/tablet/wacom_wac.h | 1 +
> >  2 files changed, 9 insertions(+)
> >
> > diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> > index a4d8f1d..e4566c3 100644
> > --- a/drivers/input/tablet/wacom_wac.c
> > +++ b/drivers/input/tablet/wacom_wac.c
> > @@ -1107,6 +1107,10 @@ static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
> >                         prox = data[0] & 0x01;
> >                         x = get_unaligned_le16(&data[1]);
> >                         y = get_unaligned_le16(&data[3]);
> > +               } else if (len == WACOM_PKGLEN_TPC1FG_B) {
> > +                       prox = data[2] & 0x01;
> > +                       x = le16_to_cpup((__le16 *)&data[3]);
> > +                       y = le16_to_cpup((__le16 *)&data[5]);
> 
> Above two lines should use get_unaligned_le16() instead.
> wacom_mt_touch() needs some cleanup too.
> 
> Except that, the whole patchset looks good to me.
> 
> Reviewed-by: Ping Cheng <pingc@wacom.com>

I changed le16_to_cpup to get_unaligned_le16 locally and applied, thank
you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2] Input: wacom: Add support for three new ISDv4 sensors
  2014-05-14 18:46   ` Dmitry Torokhov
@ 2014-05-14 22:31     ` Jason Gerecke
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Gerecke @ 2014-05-14 22:31 UTC (permalink / raw)
  To: linux-input, pingc, dmitry.torokhov; +Cc: Jason Gerecke

This patch adds support for the 0x4004, 0x5000, and 0x5002 sensors found
on what should be the Motion R12, Fujitsu Q704, and Fujitsu T904. These
tablets use a new report ID (3) for their touch packets and a slightly
different HID descriptor format, but are otherwise largely identical in
protocol to the "MTTPC" tablets.

Note:
 * The R12 uses its 0x4004 sensor for touch input only. A pen interface
   is not present in its HID descriptor, though its possible a 0x4004
   may be used for pen input by other tablet PCs in the future.

 * The 0x5002 sensor appears to use a new report ID (8) for its pen
   packets. The other sensors continue to use the traditional report
   ID (2).

Signed-off-by: Jason Gerecke <killertofu@gmail.com>
---
Changes from v1:
 * None; rebased.

 drivers/input/tablet/wacom_sys.c | 19 +++++++++++++++++++
 drivers/input/tablet/wacom_wac.c | 20 +++++++++++++++++++-
 drivers/input/tablet/wacom_wac.h |  3 +++
 3 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index b16ebef..0056a6d 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -364,6 +364,7 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							break;
 
 						case MTTPC:
+						case MTTPC_B:
 							features->pktlen = WACOM_PKGLEN_MTTPC;
 							break;
 
@@ -395,6 +396,16 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							i += 12;
 							break;
 
+						case MTTPC_B:
+							features->x_max =
+								get_unaligned_le16(&report[i + 3]);
+							features->x_phy =
+								get_unaligned_le16(&report[i + 6]);
+							features->unit = report[i - 5];
+							features->unitExpo = report[i - 3];
+							i += 9;
+							break;
+
 						default:
 							features->x_max =
 								get_unaligned_le16(&report[i + 3]);
@@ -447,6 +458,14 @@ static int wacom_parse_hid(struct usb_interface *intf,
 							i += 12;
 							break;
 
+						case MTTPC_B:
+							features->y_max =
+								get_unaligned_le16(&report[i + 3]);
+							features->y_phy =
+								get_unaligned_le16(&report[i + 6]);
+							i += 9;
+							break;
+
 						default:
 							features->y_max =
 								features->x_max;
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 5baab92..1c779a6 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1022,7 +1022,7 @@ static int wacom_mt_touch(struct wacom_wac *wacom)
 	int x_offset = 0;
 
 	/* MTTPC does not support Height and Width */
-	if (wacom->features.type == MTTPC)
+	if (wacom->features.type == MTTPC || wacom->features.type == MTTPC_B)
 		x_offset = -4;
 
 	/*
@@ -1179,6 +1179,9 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 	case WACOM_PKGLEN_TPC2FG:
 		return wacom_tpc_mt_touch(wacom);
 
+	case WACOM_PKGLEN_PENABLED:
+		return wacom_tpc_pen(wacom);
+
 	default:
 		switch (data[0]) {
 		case WACOM_REPORT_TPC1FG:
@@ -1188,6 +1191,7 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
 			return wacom_tpc_single_touch(wacom, len);
 
 		case WACOM_REPORT_TPCMT:
+		case WACOM_REPORT_TPCMT2:
 			return wacom_mt_touch(wacom);
 
 		case WACOM_REPORT_PENABLED:
@@ -1530,6 +1534,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 	case TABLETPC2FG:
 	case MTSCREEN:
 	case MTTPC:
+	case MTTPC_B:
 		sync = wacom_tpc_irq(wacom_wac, len);
 		break;
 
@@ -1871,6 +1876,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
 
 	case MTSCREEN:
 	case MTTPC:
+	case MTTPC_B:
 	case TABLETPC2FG:
 		if (features->device_type == BTN_TOOL_FINGER) {
 			unsigned int flags = INPUT_MT_DIRECT;
@@ -2308,6 +2314,15 @@ static const struct wacom_features wacom_features_0x116 =
 static const struct wacom_features wacom_features_0x4001 =
 	{ "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
 	  0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x4004 =
+	{ "Wacom ISDv4 4004",      WACOM_PKGLEN_MTTPC,     11060, 6220,  255,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x5000 =
+	{ "Wacom ISDv4 5000",      WACOM_PKGLEN_MTTPC,     27848, 15752,  1023,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+static const struct wacom_features wacom_features_0x5002 =
+	{ "Wacom ISDv4 5002",      WACOM_PKGLEN_MTTPC,     29576, 16724,  1023,
+	  0, MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 static const struct wacom_features wacom_features_0x47 =
 	{ "Wacom Intuos2 6x8",    WACOM_PKGLEN_INTUOS,    20320, 16240, 1023,
 	  31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2530,6 +2545,9 @@ const struct usb_device_id wacom_ids[] = {
 	{ USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) },
 	{ USB_DEVICE_WACOM(0x4001) },
+	{ USB_DEVICE_WACOM(0x4004) },
+	{ USB_DEVICE_WACOM(0x5000) },
+	{ USB_DEVICE_WACOM(0x5002) },
 	{ USB_DEVICE_WACOM(0x47) },
 	{ USB_DEVICE_WACOM(0xF4) },
 	{ USB_DEVICE_WACOM(0xF8) },
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index adf73cb..84013a7 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -31,6 +31,7 @@
 #define WACOM_PKGLEN_MTOUCH	62
 #define WACOM_PKGLEN_MTTPC	40
 #define WACOM_PKGLEN_DTUS	68
+#define WACOM_PKGLEN_PENABLED	 8
 
 /* wacom data size per MT contact */
 #define WACOM_BYTES_PER_MT_PACKET	11
@@ -53,6 +54,7 @@
 #define WACOM_REPORT_TPC1FG		6
 #define WACOM_REPORT_TPC2FG		13
 #define WACOM_REPORT_TPCMT		13
+#define WACOM_REPORT_TPCMT2		3
 #define WACOM_REPORT_TPCHID		15
 #define WACOM_REPORT_TPCST		16
 #define WACOM_REPORT_DTUS		17
@@ -106,6 +108,7 @@ enum {
 	TABLETPC2FG,
 	MTSCREEN,
 	MTTPC,
+	MTTPC_B,
 	MAX_TYPE
 };
 
-- 
1.9.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-14 22:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-10  1:30 [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Jason Gerecke
2014-05-10  1:30 ` [PATCH 2/2] Input: wacom: Add support for three new ISDv4 sensors Jason Gerecke
2014-05-14 18:46   ` Dmitry Torokhov
2014-05-14 22:31     ` [PATCH v2] " Jason Gerecke
2014-05-14 18:27 ` [PATCH 1/2] Input: wacom: Add support for 0x116 sensor on Win8 Panasonic CF-H2 Ping Cheng
2014-05-14 18:47   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).