Acked-by: Chris Bagwell <ch...@cnpbagwell.com>
Signed-off-by: Ping Cheng <pi...@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torok...@gmail.com>
Signed-off-by: Jason Gerecke <killert...@gmail.com>
---
 2.6.30/wacom_sys.c | 12 ++++++++---
 2.6.30/wacom_wac.c | 29 ++++++++++++++++++++------
 2.6.30/wacom_wac.h |  3 +++
 2.6.36/wacom_sys.c | 10 +++++++--
 2.6.36/wacom_wac.c | 37 ++++++++++++++++++++++++++-------
 2.6.36/wacom_wac.h |  3 +++
 2.6.38/wacom_sys.c | 10 +++++++--
 2.6.38/wacom_wac.c | 61 +++++++++++++++++++++++++++++++++++++++++-------------
 2.6.38/wacom_wac.h |  3 +++
 3.7/wacom_sys.c    | 10 +++++++--
 3.7/wacom_wac.c    | 61 +++++++++++++++++++++++++++++++++++++++++-------------
 3.7/wacom_wac.h    |  3 +++
 12 files changed, 192 insertions(+), 50 deletions(-)
 mode change 100755 => 100644 2.6.30/wacom_sys.c

diff --git a/2.6.30/wacom_sys.c b/2.6.30/wacom_sys.c
old mode 100755
new mode 100644
index da077bc..0c1cff8
--- a/2.6.30/wacom_sys.c
+++ b/2.6.30/wacom_sys.c
@@ -515,7 +515,7 @@ static int wacom_led_control(struct wacom *wacom)
                return -ENOMEM;
 
        if (wacom->wacom_wac.features.type >= INTUOS5S &&
-           wacom->wacom_wac.features.type <= INTUOS5L) {
+           wacom->wacom_wac.features.type <= INTUOSPL) {
                /* Touch Ring and crop mark LED luminance may take on
                 * one of four values:
                 *    0 = Low; 1 = Medium; 2 = High; 3 = Off
@@ -647,6 +647,9 @@ static int wacom_initialize_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) {
                        wacom->led.select[0] = 0;
                        wacom->led.select[1] = 0;
@@ -692,6 +695,9 @@ static void wacom_destroy_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN)
                        sysfs_remove_group(&wacom->intf->dev.kobj,
                                           &intuos5_led_attr_group);
@@ -764,7 +770,7 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
          * HID descriptor. If this is the touch interface (wMaxPacketSize
          * of WACOM_PKGLEN_BBTOUCH3), override the table values.
          */
-       if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
+       if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
                if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
                         features->device_type = BTN_TOOL_DOUBLETAP;
                         features->pktlen = WACOM_PKGLEN_BBTOUCH3;
@@ -778,7 +784,7 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
 
        strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
 
-       if (features->type >= BAMBOO_PT || (features->type >= INTUOS5S && 
features->type <= INTUOS5L)) {
+       if (features->type >= BAMBOO_PT || (features->type >= INTUOS5S && 
features->type <= INTUOSPL)) {
                /* Append the device type to the name */
                strlcat(wacom_wac->name,
                        features->device_type == BTN_TOOL_PEN ?
diff --git a/2.6.30/wacom_wac.c b/2.6.30/wacom_wac.c
index 6978e67..4fe556f 100644
--- a/2.6.30/wacom_wac.c
+++ b/2.6.30/wacom_wac.c
@@ -816,13 +816,13 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                        } else {
                                input_report_abs(input, ABS_MISC, 0);
                        }
-               } else if (features->type >= INTUOS5S && features->type <= 
INTUOS5L) {
+               } else if (features->type >= INTUOS5S && features->type <= 
INTUOSPL) {
                        int i;
 
                        /* Touch ring mode switch has no capacitive sensor */
                        input_report_key(input, BTN_0, (data[3] & 0x01));
 
-                       /* ExpressKeys on Intuos5 have a capacitive sensor in
+                       /* ExpressKeys on Intuos5/Intuos Pro have a capacitive 
sensor in
                         * addition to the mechanical switch. Switch data is
                         * stored in data[4], capacitive data in data[5].
                         */
@@ -909,7 +909,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
             features->type == INTUOS4 ||
             features->type == INTUOS4S ||
             features->type == INTUOS5 ||
-            features->type == INTUOS5S)) {
+            features->type == INTUOS5S ||
+            features->type == INTUOSPM ||
+            features->type == INTUOSPS)) {
 
                return 0;
        }
@@ -962,8 +964,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 
                } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
                        /* I4 mouse */
-                       if ((features->type >= INTUOS4S && features->type <= 
INTUOS4L) ||
-                           (features->type >= INTUOS5S && features->type <= 
INTUOS5L)) {
+                       if (features->type >= INTUOS4S && features->type <= 
INTUOSPL) {
                                input_report_key(input, BTN_LEFT,   data[6] & 
0x01);
                                input_report_key(input, BTN_MIDDLE, data[6] & 
0x02);
                                input_report_key(input, BTN_RIGHT,  data[6] & 
0x04);
@@ -990,7 +991,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                                }
                        }
                } else if ((features->type < INTUOS3S || features->type == 
INTUOS3L ||
-                               features->type == INTUOS4L || features->type == 
INTUOS5L) &&
+                               features->type == INTUOS4L || features->type == 
INTUOS5L ||
+                               features->type == INTUOSPL) &&
                           wacom->tool[idx] == BTN_TOOL_LENS) {
                        /* Lens cursor packets */
                        input_report_key(input, BTN_LEFT,   data[8] & 0x01);
@@ -1319,6 +1321,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
        case CINTIQ:
        case WACOM_BEE:
        case WACOM_13HD:
@@ -1548,6 +1553,8 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                wacom_setup_intuos(wacom_wac);
                break;
 
+       case INTUOSPM:
+       case INTUOSPL:
        case INTUOS5:
        case INTUOS5L:
        case INTUOS4:
@@ -1556,6 +1563,7 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                __set_bit(BTN_8, input_dev->keybit);
                /* fall through */
 
+       case INTUOSPS:
        case INTUOS5S:
        case INTUOS4S:
                for (i = 0; i < 7; i++)
@@ -1757,6 +1765,12 @@ static const struct wacom_features wacom_features_0x29 =
         { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047, 63, 
INTUOS5S };
 static const struct wacom_features wacom_features_0x2A =
         { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047, 63, 
INTUOS5 };
+static const struct wacom_features wacom_features_0x314 =
+       { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047, 63, 
INTUOSPS };
+static const struct wacom_features wacom_features_0x315 =
+       { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047, 63, 
INTUOSPM };
+static const struct wacom_features wacom_features_0x317 =
+       { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS,  65024, 40640, 2047, 63, 
INTUOSPL };
 static const struct wacom_features wacom_features_0xF4 =
        { "Wacom Cintiq 24HD",       WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, 
63, WACOM_24HD };
 static const struct wacom_features wacom_features_0xF8 =
@@ -1931,6 +1945,9 @@ const struct usb_device_id wacom_ids[] = {
        { USB_DEVICE_WACOM(0x10D) },
        { USB_DEVICE_WACOM(0x4001) },
        { USB_DEVICE_WACOM(0x304) },
+       { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) },
        { USB_DEVICE_WACOM(0x47) },
        { USB_DEVICE_WACOM(0xF4) },
        { USB_DEVICE_WACOM(0xF8) },
diff --git a/2.6.30/wacom_wac.h b/2.6.30/wacom_wac.h
index d3cfe71..454e2a4 100755
--- a/2.6.30/wacom_wac.h
+++ b/2.6.30/wacom_wac.h
@@ -62,6 +62,9 @@ enum {
        INTUOS5S,
        INTUOS5,
        INTUOS5L,
+       INTUOSPS,
+       INTUOSPM,
+       INTUOSPL,
        WACOM_21UX2,
        WACOM_22HD,
        DTK,
diff --git a/2.6.36/wacom_sys.c b/2.6.36/wacom_sys.c
index 68a2fd8..878a5c5 100644
--- a/2.6.36/wacom_sys.c
+++ b/2.6.36/wacom_sys.c
@@ -491,7 +491,7 @@ static int wacom_led_control(struct wacom *wacom)
                return -ENOMEM;
 
        if (wacom->wacom_wac.features.type >= INTUOS5S &&
-           wacom->wacom_wac.features.type <= INTUOS5L) {
+           wacom->wacom_wac.features.type <= INTUOSPL) {
                /* Touch Ring and crop mark LED luminance may take on
                 * one of four values:
                 *    0 = Low; 1 = Medium; 2 = High; 3 = Off
@@ -748,6 +748,9 @@ static int wacom_initialize_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) {
                        wacom->led.select[0] = 0;
                        wacom->led.select[1] = 0;
@@ -794,6 +797,9 @@ static void wacom_destroy_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN)
                        sysfs_remove_group(&wacom->intf->dev.kobj,
                                           &intuos5_led_attr_group);
@@ -859,7 +865,7 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
                goto fail3;
 
        /* Ignore Intuos5 touch interface until BPT3 touch support backported */
-       if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
+       if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
                if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
                        error = -ENODEV;
                        goto fail2;
diff --git a/2.6.36/wacom_wac.c b/2.6.36/wacom_wac.c
index bc99290..979fa6f 100644
--- a/2.6.36/wacom_wac.c
+++ b/2.6.36/wacom_wac.c
@@ -608,13 +608,13 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                        } else {
                                input_report_abs(input, ABS_MISC, 0);
                        }
-               } else if (features->type >= INTUOS5S && features->type <= 
INTUOS5L) {
+               } else if (features->type >= INTUOS5S && features->type <= 
INTUOSPL) {
                        int i;
 
                        /* Touch ring mode switch has no capacitive sensor */
                        input_report_key(input, BTN_0, (data[3] & 0x01));
 
-                       /* ExpressKeys on Intuos5 have a capacitive sensor in
+                       /* ExpressKeys on Intuos5/Intuos Pro have a capacitive 
sensor in
                         * addition to the mechanical switch. Switch data is
                         * stored in data[4], capacitive data in data[5].
                         */
@@ -702,7 +702,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
             features->type == INTUOS4 ||
             features->type == INTUOS4S ||
             features->type == INTUOS5 ||
-            features->type == INTUOS5S)) {
+            features->type == INTUOS5S ||
+            features->type == INTUOSPM ||
+            features->type == INTUOSPS)) {
 
                return 0;
        }
@@ -755,8 +757,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 
                } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
                        /* I4 mouse */
-                       if ((features->type >= INTUOS4S && features->type <= 
INTUOS4L) ||
-                           (features->type >= INTUOS5S && features->type <= 
INTUOS5L)) {
+                       if (features->type >= INTUOS4S && features->type <= 
INTUOSPL) {
                                input_report_key(input, BTN_LEFT,   data[6] & 
0x01);
                                input_report_key(input, BTN_MIDDLE, data[6] & 
0x02);
                                input_report_key(input, BTN_RIGHT,  data[6] & 
0x04);
@@ -783,7 +784,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                                }
                        }
                } else if ((features->type < INTUOS3S || features->type == 
INTUOS3L ||
-                               features->type == INTUOS4L || features->type == 
INTUOS5L) &&
+                               features->type == INTUOS4L || features->type == 
INTUOS5L ||
+                               features->type == INTUOSPL) &&
                           wacom->tool[idx] == BTN_TOOL_LENS) {
                        /* Lens cursor packets */
                        input_report_key(input, BTN_LEFT,   data[8] & 0x01);
@@ -1175,6 +1177,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
        case CINTIQ:
        case WACOM_BEE:
        case WACOM_13HD:
@@ -1257,7 +1262,7 @@ void wacom_setup_device_quirks(struct wacom_features 
*features)
        /* these device have multiple inputs */
        if (features->type == TABLETPC || features->type == TABLETPC2FG ||
            features->type == BAMBOO_PT || features->type == MTSCREEN ||
-           (features->type >= INTUOS5S && features->type <= INTUOS5L))
+           (features->type >= INTUOS5S && features->type <= INTUOSPL))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
 
        /* quirks for bamboo touch */
@@ -1425,6 +1430,8 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                wacom_setup_intuos(wacom_wac);
                break;
 
+       case INTUOSPM:
+       case INTUOSPL:
        case INTUOS5:
        case INTUOS5L:
        case INTUOS4:
@@ -1433,6 +1440,7 @@ void wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                __set_bit(BTN_8, input_dev->keybit);
                /* fall through */
 
+       case INTUOSPS:
        case INTUOS5S:
        case INTUOS4S:
                for (i = 0; i < 7; i++)
@@ -1694,6 +1702,18 @@ static const struct wacom_features wacom_features_0x29 =
 static const struct wacom_features wacom_features_0x2A =
         { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
           63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x314 =
+       { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
+       63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+       .touch_max = 16 };
+static const struct wacom_features wacom_features_0x315 =
+       { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
+       63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+       .touch_max = 16 };
+static const struct wacom_features wacom_features_0x317 =
+       { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS,  65024, 40640, 2047,
+       63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+       .touch_max = 16 };
 static const struct wacom_features wacom_features_0xF4 =
        { "Wacom Cintiq 24HD",       WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
          63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -1914,6 +1934,9 @@ const struct usb_device_id wacom_ids[] = {
        { USB_DEVICE_WACOM(0xE5) },
        { USB_DEVICE_WACOM(0xE6) },
        { USB_DEVICE_WACOM(0x304) },
+       { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) },
        { USB_DEVICE_WACOM(0x47) },
        { USB_DEVICE_WACOM(0xF4) },
        { USB_DEVICE_WACOM(0xF8) },
diff --git a/2.6.36/wacom_wac.h b/2.6.36/wacom_wac.h
index 3196a8f..85369a8 100644
--- a/2.6.36/wacom_wac.h
+++ b/2.6.36/wacom_wac.h
@@ -71,6 +71,9 @@ enum {
        INTUOS5S,
        INTUOS5,
        INTUOS5L,
+       INTUOSPS,
+       INTUOSPM,
+       INTUOSPL,
        WACOM_21UX2,
        WACOM_22HD,
        DTK,
diff --git a/2.6.38/wacom_sys.c b/2.6.38/wacom_sys.c
index 7165da9..e9927b4 100644
--- a/2.6.38/wacom_sys.c
+++ b/2.6.38/wacom_sys.c
@@ -718,7 +718,7 @@ static int wacom_led_control(struct wacom *wacom)
                return -ENOMEM;
 
        if (wacom->wacom_wac.features.type >= INTUOS5S &&
-           wacom->wacom_wac.features.type <= INTUOS5L) {
+           wacom->wacom_wac.features.type <= INTUOSPL) {
                /*
                 * Touch Ring and crop mark LED luminance may take on
                 * one of four values:
@@ -980,6 +980,9 @@ static int wacom_initialize_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) {
                        wacom->led.select[0] = 0;
                        wacom->led.select[1] = 0;
@@ -1026,6 +1029,9 @@ static void wacom_destroy_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN)
                        sysfs_remove_group(&wacom->intf->dev.kobj,
                                           &intuos5_led_attr_group);
@@ -1300,7 +1306,7 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
         * HID descriptor. If this is the touch interface (wMaxPacketSize
         * of WACOM_PKGLEN_BBTOUCH3), override the table values.
         */
-       if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
+       if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
                if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
                        features->device_type = BTN_TOOL_FINGER;
                        features->pktlen = WACOM_PKGLEN_BBTOUCH3;
diff --git a/2.6.38/wacom_wac.c b/2.6.38/wacom_wac.c
index 481c773..3185274 100644
--- a/2.6.38/wacom_wac.c
+++ b/2.6.38/wacom_wac.c
@@ -644,14 +644,14 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                        input_report_key(input, BTN_7, (data[4] & 0x40)); /* 
Left   */
                        input_report_key(input, BTN_8, (data[4] & 0x80)); /* 
Down   */
                        input_report_key(input, BTN_0, (data[3] & 0x01)); /* 
Center */
-               } else if (features->type >= INTUOS5S && features->type <= 
INTUOS5L) {
+               } else if (features->type >= INTUOS5S && features->type <= 
INTUOSPL) {
                        int i;
 
                        /* Touch ring mode switch has no capacitive sensor */
                        input_report_key(input, BTN_0, (data[3] & 0x01));
 
                        /*
-                        * ExpressKeys on Intuos5 have a capacitive sensor in
+                        * ExpressKeys on Intuos5/Intuos Pro have a capacitive 
sensor in
                         * addition to the mechanical switch. Switch data is
                         * stored in data[4], capacitive data in data[5].
                         */
@@ -739,7 +739,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
             features->type == INTUOS4 ||
             features->type == INTUOS4S ||
             features->type == INTUOS5 ||
-            features->type == INTUOS5S)) {
+            features->type == INTUOS5S ||
+            features->type == INTUOSPM ||
+            features->type == INTUOSPS)) {
 
                return 0;
        }
@@ -792,8 +794,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 
                } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
                        /* I4 mouse */
-                       if ((features->type >= INTUOS4S && features->type <= 
INTUOS4L) ||
-                           (features->type >= INTUOS5S && features->type <= 
INTUOS5L)) {
+                       if (features->type >= INTUOS4S && features->type <= 
INTUOSPL) {
                                input_report_key(input, BTN_LEFT,   data[6] & 
0x01);
                                input_report_key(input, BTN_MIDDLE, data[6] & 
0x02);
                                input_report_key(input, BTN_RIGHT,  data[6] & 
0x04);
@@ -820,7 +821,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                                }
                        }
                } else if ((features->type < INTUOS3S || features->type == 
INTUOS3L ||
-                               features->type == INTUOS4L || features->type == 
INTUOS5L) &&
+                               features->type == INTUOS4L || features->type == 
INTUOS5L ||
+                               features->type == INTUOSPL) &&
                           wacom->tool[idx] == BTN_TOOL_LENS) {
                        /* Lens cursor packets */
                        input_report_key(input, BTN_LEFT,   data[8] & 0x01);
@@ -1155,6 +1157,7 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
 
 static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
 {
+       struct wacom_features *features = &wacom->features;
        struct input_dev *input = wacom->input;
        int slot_id = data[0] - 2;  /* data[0] is between 2 and 17 */
        bool touch = data[1] & 0x80;
@@ -1167,14 +1170,23 @@ static void wacom_bpt3_touch_msg(struct wacom_wac 
*wacom, unsigned char *data)
        if (touch) {
                int x = (data[2] << 4) | (data[4] >> 4);
                int y = (data[3] << 4) | (data[4] & 0x0f);
-               int a = data[5];
+               int width, height;
 
-               // "a" is a scaled-down area which we assume is roughly
-               // circular and which can be described as: a=(pi*r^2)/C.
-               int x_res  = input_abs_get_res(input, ABS_X);
-               int y_res  = input_abs_get_res(input, ABS_Y);
-               int width  = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
-               int height = width * y_res / x_res;
+               if (features->type >= INTUOSPS && features->type <= INTUOSPL) {
+                       width  = data[5];
+                       height = data[6];
+               } else {
+                       /*
+                        * "a" is a scaled-down area which we assume is
+                        * roughly circular and which can be described as:
+                        * a=(pi*r^2)/C.
+                        */
+                       int a = data[5];
+                       int x_res  = input_abs_get_res(input, ABS_X);
+                       int y_res  = input_abs_get_res(input, ABS_Y);
+                       width  = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
+                       height = width * y_res / x_res;
+               }
 
                input_report_abs(input, ABS_MT_POSITION_X, x);
                input_report_abs(input, ABS_MT_POSITION_Y, y);
@@ -1384,6 +1396,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (len == WACOM_PKGLEN_BBTOUCH3)
                        sync = wacom_bpt3_touch(wacom_wac);
                else
@@ -1467,7 +1482,7 @@ void wacom_setup_device_quirks(struct wacom_features 
*features)
 
        /* these device have multiple inputs */
        if (features->type >= WIRELESS ||
-           (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
+           (features->type >= INTUOS5S && features->type <= INTUOSPL) ||
            (features->oVid && features->oPid))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
 
@@ -1674,6 +1689,8 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
 
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPM:
+       case INTUOSPL:
                if (features->device_type == BTN_TOOL_PEN) {
                        __set_bit(BTN_7, input_dev->keybit);
                        __set_bit(BTN_8, input_dev->keybit);
@@ -1681,6 +1698,7 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                /* fall through */
 
        case INTUOS5S:
+       case INTUOSPS:
                __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
 
                if (features->device_type == BTN_TOOL_PEN) {
@@ -2051,6 +2069,18 @@ static const struct wacom_features wacom_features_0x29 =
 static const struct wacom_features wacom_features_0x2A =
        { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
          63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x314 =
+       { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
+         63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
+static const struct wacom_features wacom_features_0x315 =
+       { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
+         63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
+static const struct wacom_features wacom_features_0x317 =
+       { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS,  65024, 40640, 2047,
+         63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
 static const struct wacom_features wacom_features_0xF4 =
        { "Wacom Cintiq 24HD",       WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
          63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -2357,6 +2387,9 @@ const struct usb_device_id wacom_ids[] = {
        { USB_DEVICE_WACOM(0x300) },
        { USB_DEVICE_WACOM(0x301) },
        { USB_DEVICE_WACOM(0x304) },
+       { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
+       { 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(0x47) },
        { USB_DEVICE_WACOM(0xF4) },
diff --git a/2.6.38/wacom_wac.h b/2.6.38/wacom_wac.h
index 560681d..5e50fa3 100644
--- a/2.6.38/wacom_wac.h
+++ b/2.6.38/wacom_wac.h
@@ -76,6 +76,9 @@ enum {
        INTUOS5S,
        INTUOS5,
        INTUOS5L,
+       INTUOSPS,
+       INTUOSPM,
+       INTUOSPL,
        WACOM_21UX2,
        WACOM_22HD,
        DTK,
diff --git a/3.7/wacom_sys.c b/3.7/wacom_sys.c
index 0aa3bd7..1bc73dc 100644
--- a/3.7/wacom_sys.c
+++ b/3.7/wacom_sys.c
@@ -716,7 +716,7 @@ static int wacom_led_control(struct wacom *wacom)
                return -ENOMEM;
 
        if (wacom->wacom_wac.features.type >= INTUOS5S &&
-           wacom->wacom_wac.features.type <= INTUOS5L) {
+           wacom->wacom_wac.features.type <= INTUOSPL) {
                /*
                 * Touch Ring and crop mark LED luminance may take on
                 * one of four values:
@@ -978,6 +978,9 @@ static int wacom_initialize_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) {
                        wacom->led.select[0] = 0;
                        wacom->led.select[1] = 0;
@@ -1024,6 +1027,9 @@ static void wacom_destroy_leds(struct wacom *wacom)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN)
                        sysfs_remove_group(&wacom->intf->dev.kobj,
                                           &intuos5_led_attr_group);
@@ -1295,7 +1301,7 @@ static int wacom_probe(struct usb_interface *intf, const 
struct usb_device_id *i
         * HID descriptor. If this is the touch interface (wMaxPacketSize
         * of WACOM_PKGLEN_BBTOUCH3), override the table values.
         */
-       if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
+       if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
                if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
                        features->device_type = BTN_TOOL_FINGER;
                        features->pktlen = WACOM_PKGLEN_BBTOUCH3;
diff --git a/3.7/wacom_wac.c b/3.7/wacom_wac.c
index f9afa1d..72a49cc 100644
--- a/3.7/wacom_wac.c
+++ b/3.7/wacom_wac.c
@@ -644,14 +644,14 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                        input_report_key(input, BTN_7, (data[4] & 0x40)); /* 
Left   */
                        input_report_key(input, BTN_8, (data[4] & 0x80)); /* 
Down   */
                        input_report_key(input, BTN_0, (data[3] & 0x01)); /* 
Center */
-               } else if (features->type >= INTUOS5S && features->type <= 
INTUOS5L) {
+               } else if (features->type >= INTUOS5S && features->type <= 
INTUOSPL) {
                        int i;
 
                        /* Touch ring mode switch has no capacitive sensor */
                        input_report_key(input, BTN_0, (data[3] & 0x01));
 
                        /*
-                        * ExpressKeys on Intuos5 have a capacitive sensor in
+                        * ExpressKeys on Intuos5/Intuos Pro have a capacitive 
sensor in
                         * addition to the mechanical switch. Switch data is
                         * stored in data[4], capacitive data in data[5].
                         */
@@ -739,7 +739,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
             features->type == INTUOS4 ||
             features->type == INTUOS4S ||
             features->type == INTUOS5 ||
-            features->type == INTUOS5S)) {
+            features->type == INTUOS5S ||
+            features->type == INTUOSPM ||
+            features->type == INTUOSPS)) {
 
                return 0;
        }
@@ -792,8 +794,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
 
                } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
                        /* I4 mouse */
-                       if ((features->type >= INTUOS4S && features->type <= 
INTUOS4L) ||
-                           (features->type >= INTUOS5S && features->type <= 
INTUOS5L)) {
+                       if (features->type >= INTUOS4S && features->type <= 
INTUOSPL) {
                                input_report_key(input, BTN_LEFT,   data[6] & 
0x01);
                                input_report_key(input, BTN_MIDDLE, data[6] & 
0x02);
                                input_report_key(input, BTN_RIGHT,  data[6] & 
0x04);
@@ -820,7 +821,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
                                }
                        }
                } else if ((features->type < INTUOS3S || features->type == 
INTUOS3L ||
-                               features->type == INTUOS4L || features->type == 
INTUOS5L) &&
+                               features->type == INTUOS4L || features->type == 
INTUOS5L ||
+                               features->type == INTUOSPL) &&
                           wacom->tool[idx] == BTN_TOOL_LENS) {
                        /* Lens cursor packets */
                        input_report_key(input, BTN_LEFT,   data[8] & 0x01);
@@ -1130,6 +1132,7 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
 
 static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
 {
+       struct wacom_features *features = &wacom->features;
        struct input_dev *input = wacom->input;
        bool touch = data[1] & 0x80;
        int slot = input_mt_get_slot_by_key(input, data[0]);
@@ -1145,14 +1148,23 @@ static void wacom_bpt3_touch_msg(struct wacom_wac 
*wacom, unsigned char *data)
        if (touch) {
                int x = (data[2] << 4) | (data[4] >> 4);
                int y = (data[3] << 4) | (data[4] & 0x0f);
-               int a = data[5];
+               int width, height;
 
-               // "a" is a scaled-down area which we assume is roughly
-               // circular and which can be described as: a=(pi*r^2)/C.
-               int x_res  = input_abs_get_res(input, ABS_X);
-               int y_res  = input_abs_get_res(input, ABS_Y);
-               int width  = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
-               int height = width * y_res / x_res;
+               if (features->type >= INTUOSPS && features->type <= INTUOSPL) {
+                       width  = data[5];
+                       height = data[6];
+               } else {
+                       /*
+                        * "a" is a scaled-down area which we assume is
+                        * roughly circular and which can be described as:
+                        * a=(pi*r^2)/C.
+                        */
+                       int a = data[5];
+                       int x_res  = input_abs_get_res(input, ABS_X);
+                       int y_res  = input_abs_get_res(input, ABS_Y);
+                       width  = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE);
+                       height = width * y_res / x_res;
+               }
 
                input_report_abs(input, ABS_MT_POSITION_X, x);
                input_report_abs(input, ABS_MT_POSITION_Y, y);
@@ -1361,6 +1373,9 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t 
len)
        case INTUOS5S:
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPS:
+       case INTUOSPM:
+       case INTUOSPL:
                if (len == WACOM_PKGLEN_BBTOUCH3)
                        sync = wacom_bpt3_touch(wacom_wac);
                else
@@ -1444,7 +1459,7 @@ void wacom_setup_device_quirks(struct wacom_features 
*features)
 
        /* these device have multiple inputs */
        if (features->type >= WIRELESS ||
-           (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
+           (features->type >= INTUOS5S && features->type <= INTUOSPL) ||
            (features->oVid && features->oPid))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
 
@@ -1653,6 +1668,8 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
 
        case INTUOS5:
        case INTUOS5L:
+       case INTUOSPM:
+       case INTUOSPL:
                if (features->device_type == BTN_TOOL_PEN) {
                        __set_bit(BTN_7, input_dev->keybit);
                        __set_bit(BTN_8, input_dev->keybit);
@@ -1660,6 +1677,7 @@ int wacom_setup_input_capabilities(struct input_dev 
*input_dev,
                /* fall through */
 
        case INTUOS5S:
+       case INTUOSPS:
                __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
 
                if (features->device_type == BTN_TOOL_PEN) {
@@ -1996,6 +2014,18 @@ static const struct wacom_features wacom_features_0x29 =
 static const struct wacom_features wacom_features_0x2A =
        { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
          63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
+static const struct wacom_features wacom_features_0x314 =
+       { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
+         63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
+static const struct wacom_features wacom_features_0x315 =
+       { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
+         63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
+static const struct wacom_features wacom_features_0x317 =
+       { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS,  65024, 40640, 2047,
+         63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
+         .touch_max = 16 };
 static const struct wacom_features wacom_features_0xF4 =
        { "Wacom Cintiq 24HD",       WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
          63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -2302,6 +2332,9 @@ const struct usb_device_id wacom_ids[] = {
        { USB_DEVICE_WACOM(0x300) },
        { USB_DEVICE_WACOM(0x301) },
        { USB_DEVICE_WACOM(0x304) },
+       { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
+       { 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(0x47) },
        { USB_DEVICE_WACOM(0xF4) },
diff --git a/3.7/wacom_wac.h b/3.7/wacom_wac.h
index 90ce10d..2a432e6 100644
--- a/3.7/wacom_wac.h
+++ b/3.7/wacom_wac.h
@@ -76,6 +76,9 @@ enum {
        INTUOS5S,
        INTUOS5,
        INTUOS5L,
+       INTUOSPS,
+       INTUOSPM,
+       INTUOSPL,
        WACOM_21UX2,
        WACOM_22HD,
        DTK,
-- 
1.8.4


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to