diff options
author | Ping Cheng <pinglinux@gmail.com> | 2013-09-20 12:51:56 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-09-20 12:59:01 -0400 |
commit | 9a35c411f904a662d3a39edea406d95ead8acea6 (patch) | |
tree | 16aba3df397e93d7f1cfd0bdbadbe65b0fd8522f | |
parent | c2b0c273e59f66ded73fe04a9460fa1bcd494aa5 (diff) |
Input: wacom - add support for three new Intuos Pro devices
Acked-by: Chris Bagwell <chris@cnpbagwell.com>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 10 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 61 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.h | 3 |
3 files changed, 58 insertions, 16 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index e21197be6a5a..63971b8188b0 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -716,7 +716,7 @@ static int wacom_led_control(struct wacom *wacom) | |||
716 | return -ENOMEM; | 716 | return -ENOMEM; |
717 | 717 | ||
718 | if (wacom->wacom_wac.features.type >= INTUOS5S && | 718 | if (wacom->wacom_wac.features.type >= INTUOS5S && |
719 | wacom->wacom_wac.features.type <= INTUOS5L) { | 719 | wacom->wacom_wac.features.type <= INTUOSPL) { |
720 | /* | 720 | /* |
721 | * Touch Ring and crop mark LED luminance may take on | 721 | * Touch Ring and crop mark LED luminance may take on |
722 | * one of four values: | 722 | * one of four values: |
@@ -978,6 +978,9 @@ static int wacom_initialize_leds(struct wacom *wacom) | |||
978 | case INTUOS5S: | 978 | case INTUOS5S: |
979 | case INTUOS5: | 979 | case INTUOS5: |
980 | case INTUOS5L: | 980 | case INTUOS5L: |
981 | case INTUOSPS: | ||
982 | case INTUOSPM: | ||
983 | case INTUOSPL: | ||
981 | if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) { | 984 | if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) { |
982 | wacom->led.select[0] = 0; | 985 | wacom->led.select[0] = 0; |
983 | wacom->led.select[1] = 0; | 986 | wacom->led.select[1] = 0; |
@@ -1024,6 +1027,9 @@ static void wacom_destroy_leds(struct wacom *wacom) | |||
1024 | case INTUOS5S: | 1027 | case INTUOS5S: |
1025 | case INTUOS5: | 1028 | case INTUOS5: |
1026 | case INTUOS5L: | 1029 | case INTUOS5L: |
1030 | case INTUOSPS: | ||
1031 | case INTUOSPM: | ||
1032 | case INTUOSPL: | ||
1027 | if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) | 1033 | if (wacom->wacom_wac.features.device_type == BTN_TOOL_PEN) |
1028 | sysfs_remove_group(&wacom->intf->dev.kobj, | 1034 | sysfs_remove_group(&wacom->intf->dev.kobj, |
1029 | &intuos5_led_attr_group); | 1035 | &intuos5_led_attr_group); |
@@ -1299,7 +1305,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
1299 | * HID descriptor. If this is the touch interface (wMaxPacketSize | 1305 | * HID descriptor. If this is the touch interface (wMaxPacketSize |
1300 | * of WACOM_PKGLEN_BBTOUCH3), override the table values. | 1306 | * of WACOM_PKGLEN_BBTOUCH3), override the table values. |
1301 | */ | 1307 | */ |
1302 | if (features->type >= INTUOS5S && features->type <= INTUOS5L) { | 1308 | if (features->type >= INTUOS5S && features->type <= INTUOSPL) { |
1303 | if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) { | 1309 | if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) { |
1304 | features->device_type = BTN_TOOL_FINGER; | 1310 | features->device_type = BTN_TOOL_FINGER; |
1305 | features->pktlen = WACOM_PKGLEN_BBTOUCH3; | 1311 | features->pktlen = WACOM_PKGLEN_BBTOUCH3; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 102480621079..9c8eded2e504 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -644,14 +644,14 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
644 | input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */ | 644 | input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */ |
645 | input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */ | 645 | input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */ |
646 | input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */ | 646 | input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */ |
647 | } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { | 647 | } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) { |
648 | int i; | 648 | int i; |
649 | 649 | ||
650 | /* Touch ring mode switch has no capacitive sensor */ | 650 | /* Touch ring mode switch has no capacitive sensor */ |
651 | input_report_key(input, BTN_0, (data[3] & 0x01)); | 651 | input_report_key(input, BTN_0, (data[3] & 0x01)); |
652 | 652 | ||
653 | /* | 653 | /* |
654 | * ExpressKeys on Intuos5 have a capacitive sensor in | 654 | * ExpressKeys on Intuos5/Intuos Pro have a capacitive sensor in |
655 | * addition to the mechanical switch. Switch data is | 655 | * addition to the mechanical switch. Switch data is |
656 | * stored in data[4], capacitive data in data[5]. | 656 | * stored in data[4], capacitive data in data[5]. |
657 | */ | 657 | */ |
@@ -739,7 +739,9 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
739 | features->type == INTUOS4 || | 739 | features->type == INTUOS4 || |
740 | features->type == INTUOS4S || | 740 | features->type == INTUOS4S || |
741 | features->type == INTUOS5 || | 741 | features->type == INTUOS5 || |
742 | features->type == INTUOS5S)) { | 742 | features->type == INTUOS5S || |
743 | features->type == INTUOSPM || | ||
744 | features->type == INTUOSPS)) { | ||
743 | 745 | ||
744 | return 0; | 746 | return 0; |
745 | } | 747 | } |
@@ -792,8 +794,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
792 | 794 | ||
793 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { | 795 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { |
794 | /* I4 mouse */ | 796 | /* I4 mouse */ |
795 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || | 797 | if (features->type >= INTUOS4S && features->type <= INTUOSPL) { |
796 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) { | ||
797 | input_report_key(input, BTN_LEFT, data[6] & 0x01); | 798 | input_report_key(input, BTN_LEFT, data[6] & 0x01); |
798 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); | 799 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); |
799 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); | 800 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); |
@@ -820,7 +821,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom) | |||
820 | } | 821 | } |
821 | } | 822 | } |
822 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || | 823 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || |
823 | features->type == INTUOS4L || features->type == INTUOS5L) && | 824 | features->type == INTUOS4L || features->type == INTUOS5L || |
825 | features->type == INTUOSPL) && | ||
824 | wacom->tool[idx] == BTN_TOOL_LENS) { | 826 | wacom->tool[idx] == BTN_TOOL_LENS) { |
825 | /* Lens cursor packets */ | 827 | /* Lens cursor packets */ |
826 | input_report_key(input, BTN_LEFT, data[8] & 0x01); | 828 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
@@ -1130,6 +1132,7 @@ static int wacom_bpt_touch(struct wacom_wac *wacom) | |||
1130 | 1132 | ||
1131 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) | 1133 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) |
1132 | { | 1134 | { |
1135 | struct wacom_features *features = &wacom->features; | ||
1133 | struct input_dev *input = wacom->input; | 1136 | struct input_dev *input = wacom->input; |
1134 | bool touch = data[1] & 0x80; | 1137 | bool touch = data[1] & 0x80; |
1135 | int slot = input_mt_get_slot_by_key(input, data[0]); | 1138 | 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) | |||
1145 | if (touch) { | 1148 | if (touch) { |
1146 | int x = (data[2] << 4) | (data[4] >> 4); | 1149 | int x = (data[2] << 4) | (data[4] >> 4); |
1147 | int y = (data[3] << 4) | (data[4] & 0x0f); | 1150 | int y = (data[3] << 4) | (data[4] & 0x0f); |
1148 | int a = data[5]; | 1151 | int width, height; |
1149 | 1152 | ||
1150 | // "a" is a scaled-down area which we assume is roughly | 1153 | if (features->type >= INTUOSPS && features->type <= INTUOSPL) { |
1151 | // circular and which can be described as: a=(pi*r^2)/C. | 1154 | width = data[5]; |
1152 | int x_res = input_abs_get_res(input, ABS_X); | 1155 | height = data[6]; |
1153 | int y_res = input_abs_get_res(input, ABS_Y); | 1156 | } else { |
1154 | int width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE); | 1157 | /* |
1155 | int height = width * y_res / x_res; | 1158 | * "a" is a scaled-down area which we assume is |
1159 | * roughly circular and which can be described as: | ||
1160 | * a=(pi*r^2)/C. | ||
1161 | */ | ||
1162 | int a = data[5]; | ||
1163 | int x_res = input_abs_get_res(input, ABS_X); | ||
1164 | int y_res = input_abs_get_res(input, ABS_Y); | ||
1165 | width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE); | ||
1166 | height = width * y_res / x_res; | ||
1167 | } | ||
1156 | 1168 | ||
1157 | input_report_abs(input, ABS_MT_POSITION_X, x); | 1169 | input_report_abs(input, ABS_MT_POSITION_X, x); |
1158 | input_report_abs(input, ABS_MT_POSITION_Y, y); | 1170 | 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) | |||
1361 | case INTUOS5S: | 1373 | case INTUOS5S: |
1362 | case INTUOS5: | 1374 | case INTUOS5: |
1363 | case INTUOS5L: | 1375 | case INTUOS5L: |
1376 | case INTUOSPS: | ||
1377 | case INTUOSPM: | ||
1378 | case INTUOSPL: | ||
1364 | if (len == WACOM_PKGLEN_BBTOUCH3) | 1379 | if (len == WACOM_PKGLEN_BBTOUCH3) |
1365 | sync = wacom_bpt3_touch(wacom_wac); | 1380 | sync = wacom_bpt3_touch(wacom_wac); |
1366 | else | 1381 | else |
@@ -1444,7 +1459,7 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
1444 | 1459 | ||
1445 | /* these device have multiple inputs */ | 1460 | /* these device have multiple inputs */ |
1446 | if (features->type >= WIRELESS || | 1461 | if (features->type >= WIRELESS || |
1447 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || | 1462 | (features->type >= INTUOS5S && features->type <= INTUOSPL) || |
1448 | (features->oVid && features->oPid)) | 1463 | (features->oVid && features->oPid)) |
1449 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; | 1464 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
1450 | 1465 | ||
@@ -1651,6 +1666,8 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1651 | 1666 | ||
1652 | case INTUOS5: | 1667 | case INTUOS5: |
1653 | case INTUOS5L: | 1668 | case INTUOS5L: |
1669 | case INTUOSPM: | ||
1670 | case INTUOSPL: | ||
1654 | if (features->device_type == BTN_TOOL_PEN) { | 1671 | if (features->device_type == BTN_TOOL_PEN) { |
1655 | __set_bit(BTN_7, input_dev->keybit); | 1672 | __set_bit(BTN_7, input_dev->keybit); |
1656 | __set_bit(BTN_8, input_dev->keybit); | 1673 | __set_bit(BTN_8, input_dev->keybit); |
@@ -1658,6 +1675,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1658 | /* fall through */ | 1675 | /* fall through */ |
1659 | 1676 | ||
1660 | case INTUOS5S: | 1677 | case INTUOS5S: |
1678 | case INTUOSPS: | ||
1661 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | 1679 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
1662 | 1680 | ||
1663 | if (features->device_type == BTN_TOOL_PEN) { | 1681 | if (features->device_type == BTN_TOOL_PEN) { |
@@ -1994,6 +2012,18 @@ static const struct wacom_features wacom_features_0x29 = | |||
1994 | static const struct wacom_features wacom_features_0x2A = | 2012 | static const struct wacom_features wacom_features_0x2A = |
1995 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | 2013 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, |
1996 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 2014 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
2015 | static const struct wacom_features wacom_features_0x314 = | ||
2016 | { "Wacom Intuos Pro S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, | ||
2017 | 63, INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
2018 | .touch_max = 16 }; | ||
2019 | static const struct wacom_features wacom_features_0x315 = | ||
2020 | { "Wacom Intuos Pro M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, | ||
2021 | 63, INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
2022 | .touch_max = 16 }; | ||
2023 | static const struct wacom_features wacom_features_0x317 = | ||
2024 | { "Wacom Intuos Pro L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, | ||
2025 | 63, INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, | ||
2026 | .touch_max = 16 }; | ||
1997 | static const struct wacom_features wacom_features_0xF4 = | 2027 | static const struct wacom_features wacom_features_0xF4 = |
1998 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 2028 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
1999 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 2029 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
@@ -2300,6 +2330,9 @@ const struct usb_device_id wacom_ids[] = { | |||
2300 | { USB_DEVICE_WACOM(0x300) }, | 2330 | { USB_DEVICE_WACOM(0x300) }, |
2301 | { USB_DEVICE_WACOM(0x301) }, | 2331 | { USB_DEVICE_WACOM(0x301) }, |
2302 | { USB_DEVICE_WACOM(0x304) }, | 2332 | { USB_DEVICE_WACOM(0x304) }, |
2333 | { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) }, | ||
2334 | { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) }, | ||
2335 | { USB_DEVICE_DETAILED(0x317, USB_CLASS_HID, 0, 0) }, | ||
2303 | { USB_DEVICE_WACOM(0x4001) }, | 2336 | { USB_DEVICE_WACOM(0x4001) }, |
2304 | { USB_DEVICE_WACOM(0x47) }, | 2337 | { USB_DEVICE_WACOM(0x47) }, |
2305 | { USB_DEVICE_WACOM(0xF4) }, | 2338 | { USB_DEVICE_WACOM(0xF4) }, |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 90ce10dadb33..2a432e688e51 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
@@ -76,6 +76,9 @@ enum { | |||
76 | INTUOS5S, | 76 | INTUOS5S, |
77 | INTUOS5, | 77 | INTUOS5, |
78 | INTUOS5L, | 78 | INTUOS5L, |
79 | INTUOSPS, | ||
80 | INTUOSPM, | ||
81 | INTUOSPL, | ||
79 | WACOM_21UX2, | 82 | WACOM_21UX2, |
80 | WACOM_22HD, | 83 | WACOM_22HD, |
81 | DTK, | 84 | DTK, |