aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/tablet/wacom_sys.c29
-rw-r--r--drivers/input/tablet/wacom_wac.c59
-rw-r--r--drivers/input/tablet/wacom_wac.h1
3 files changed, 65 insertions, 24 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 98e9dd692d68..be13223793fb 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -28,6 +28,7 @@
28#define HID_USAGE_Y_TILT 0x3e 28#define HID_USAGE_Y_TILT 0x3e
29#define HID_USAGE_FINGER 0x22 29#define HID_USAGE_FINGER 0x22
30#define HID_USAGE_STYLUS 0x20 30#define HID_USAGE_STYLUS 0x20
31#define HID_USAGE_CONTACTMAX 0x55
31#define HID_COLLECTION 0xa1 32#define HID_COLLECTION 0xa1
32#define HID_COLLECTION_LOGICAL 0x02 33#define HID_COLLECTION_LOGICAL 0x02
33#define HID_COLLECTION_END 0xc0 34#define HID_COLLECTION_END 0xc0
@@ -201,6 +202,27 @@ static int wacom_parse_logical_collection(unsigned char *report,
201 return length; 202 return length;
202} 203}
203 204
205static void wacom_retrieve_report_data(struct usb_interface *intf,
206 struct wacom_features *features)
207{
208 int result = 0;
209 unsigned char *rep_data;
210
211 rep_data = kmalloc(2, GFP_KERNEL);
212 if (rep_data) {
213
214 rep_data[0] = 12;
215 result = wacom_get_report(intf, WAC_HID_FEATURE_REPORT,
216 rep_data[0], &rep_data, 2,
217 WAC_MSG_RETRIES);
218
219 if (result >= 0 && rep_data[1] > 2)
220 features->touch_max = rep_data[1];
221
222 kfree(rep_data);
223 }
224}
225
204/* 226/*
205 * Interface Descriptor of wacom devices can be incomplete and 227 * Interface Descriptor of wacom devices can be incomplete and
206 * inconsistent so wacom_features table is used to store stylus 228 * inconsistent so wacom_features table is used to store stylus
@@ -377,6 +399,11 @@ static int wacom_parse_hid(struct usb_interface *intf,
377 pen = 1; 399 pen = 1;
378 i++; 400 i++;
379 break; 401 break;
402
403 case HID_USAGE_CONTACTMAX:
404 wacom_retrieve_report_data(intf, features);
405 i++;
406 break;
380 } 407 }
381 break; 408 break;
382 409
@@ -1085,7 +1112,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
1085 1112
1086 endpoint = &intf->cur_altsetting->endpoint[0].desc; 1113 endpoint = &intf->cur_altsetting->endpoint[0].desc;
1087 1114
1088 /* Retrieve the physical and logical size for OEM devices */ 1115 /* Retrieve the physical and logical size for touch devices */
1089 error = wacom_retrieve_hid_descriptor(intf, features); 1116 error = wacom_retrieve_hid_descriptor(intf, features);
1090 if (error) 1117 if (error)
1091 goto fail3; 1118 goto fail3;
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index d96e186f71dc..e5cd0e57d178 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -1434,7 +1434,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1434 __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); 1434 __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
1435 __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); 1435 __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
1436 1436
1437 input_mt_init_slots(input_dev, 16); 1437 input_mt_init_slots(input_dev, features->touch_max);
1438 1438
1439 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 1439 input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
1440 0, 255, 0, 0); 1440 0, 255, 0, 0);
@@ -1467,7 +1467,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1467 case TABLETPC2FG: 1467 case TABLETPC2FG:
1468 if (features->device_type == BTN_TOOL_FINGER) { 1468 if (features->device_type == BTN_TOOL_FINGER) {
1469 1469
1470 input_mt_init_slots(input_dev, 2); 1470 input_mt_init_slots(input_dev, features->touch_max);
1471 input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, 1471 input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE,
1472 0, MT_TOOL_MAX, 0, 0); 1472 0, MT_TOOL_MAX, 0, 0);
1473 input_set_abs_params(input_dev, ABS_MT_POSITION_X, 1473 input_set_abs_params(input_dev, ABS_MT_POSITION_X,
@@ -1522,6 +1522,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1522 1522
1523 __set_bit(BTN_TOOL_FINGER, input_dev->keybit); 1523 __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
1524 __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); 1524 __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
1525 input_mt_init_slots(input_dev, features->touch_max);
1525 1526
1526 if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { 1527 if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
1527 __set_bit(BTN_TOOL_TRIPLETAP, 1528 __set_bit(BTN_TOOL_TRIPLETAP,
@@ -1529,13 +1530,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1529 __set_bit(BTN_TOOL_QUADTAP, 1530 __set_bit(BTN_TOOL_QUADTAP,
1530 input_dev->keybit); 1531 input_dev->keybit);
1531 1532
1532 input_mt_init_slots(input_dev, 16);
1533
1534 input_set_abs_params(input_dev, 1533 input_set_abs_params(input_dev,
1535 ABS_MT_TOUCH_MAJOR, 1534 ABS_MT_TOUCH_MAJOR,
1536 0, 255, 0, 0); 1535 0, 255, 0, 0);
1537 } else {
1538 input_mt_init_slots(input_dev, 2);
1539 } 1536 }
1540 1537
1541 input_set_abs_params(input_dev, ABS_MT_POSITION_X, 1538 input_set_abs_params(input_dev, ABS_MT_POSITION_X,
@@ -1724,13 +1721,16 @@ static const struct wacom_features wacom_features_0xBC =
1724 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1721 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1725static const struct wacom_features wacom_features_0x26 = 1722static const struct wacom_features wacom_features_0x26 =
1726 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 1723 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
1727 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1724 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
1725 .touch_max = 16 };
1728static const struct wacom_features wacom_features_0x27 = 1726static const struct wacom_features wacom_features_0x27 =
1729 { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, 1727 { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
1730 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1728 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
1729 .touch_max = 16 };
1731static const struct wacom_features wacom_features_0x28 = 1730static const struct wacom_features wacom_features_0x28 =
1732 { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 1731 { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
1733 63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1732 63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
1733 .touch_max = 16 };
1734static const struct wacom_features wacom_features_0x29 = 1734static const struct wacom_features wacom_features_0x29 =
1735 { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 1735 { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
1736 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1736 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@ -1778,13 +1778,16 @@ static const struct wacom_features wacom_features_0x9F =
1778 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1778 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1779static const struct wacom_features wacom_features_0xE2 = 1779static const struct wacom_features wacom_features_0xE2 =
1780 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 1780 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1781 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1781 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1782 .touch_max = 2 };
1782static const struct wacom_features wacom_features_0xE3 = 1783static const struct wacom_features wacom_features_0xE3 =
1783 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 1784 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1784 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1785 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1786 .touch_max = 2 };
1785static const struct wacom_features wacom_features_0xE6 = 1787static const struct wacom_features wacom_features_0xE6 =
1786 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, 1788 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
1787 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1789 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1790 .touch_max = 2 };
1788static const struct wacom_features wacom_features_0xEC = 1791static const struct wacom_features wacom_features_0xEC =
1789 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, 1792 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255,
1790 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1793 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1793,19 +1796,22 @@ static const struct wacom_features wacom_features_0x47 =
1793 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1796 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1794static const struct wacom_features wacom_features_0x84 = 1797static const struct wacom_features wacom_features_0x84 =
1795 { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, 1798 { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0,
1796 0, WIRELESS, 0, 0 }; 1799 0, WIRELESS, 0, 0, .touch_max = 16 };
1797static const struct wacom_features wacom_features_0xD0 = 1800static const struct wacom_features wacom_features_0xD0 =
1798 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1801 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1799 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1802 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1803 .touch_max = 2 };
1800static const struct wacom_features wacom_features_0xD1 = 1804static const struct wacom_features wacom_features_0xD1 =
1801 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1805 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1802 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1806 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1807 .touch_max = 2 };
1803static const struct wacom_features wacom_features_0xD2 = 1808static const struct wacom_features wacom_features_0xD2 =
1804 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1809 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1805 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1810 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1806static const struct wacom_features wacom_features_0xD3 = 1811static const struct wacom_features wacom_features_0xD3 =
1807 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, 1812 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1808 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1813 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1814 .touch_max = 2 };
1809static const struct wacom_features wacom_features_0xD4 = 1815static const struct wacom_features wacom_features_0xD4 =
1810 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1816 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1811 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1817 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1814,28 +1820,35 @@ static const struct wacom_features wacom_features_0xD5 =
1814 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1820 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1815static const struct wacom_features wacom_features_0xD6 = 1821static const struct wacom_features wacom_features_0xD6 =
1816 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1822 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1817 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1823 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1824 .touch_max = 2 };
1818static const struct wacom_features wacom_features_0xD7 = 1825static const struct wacom_features wacom_features_0xD7 =
1819 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1826 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1820 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1827 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1828 .touch_max = 2 };
1821static const struct wacom_features wacom_features_0xD8 = 1829static const struct wacom_features wacom_features_0xD8 =
1822 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, 1830 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1823 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1831 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1832 .touch_max = 2 };
1824static const struct wacom_features wacom_features_0xDA = 1833static const struct wacom_features wacom_features_0xDA =
1825 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 1834 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1826 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1835 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1836 .touch_max = 2 };
1827static struct wacom_features wacom_features_0xDB = 1837static struct wacom_features wacom_features_0xDB =
1828 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, 1838 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
1829 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1839 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1840 .touch_max = 2 };
1830static const struct wacom_features wacom_features_0xDD = 1841static const struct wacom_features wacom_features_0xDD =
1831 { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, 1842 { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
1832 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1843 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1833static const struct wacom_features wacom_features_0xDE = 1844static const struct wacom_features wacom_features_0xDE =
1834 { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, 1845 { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023,
1835 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1846 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1847 .touch_max = 16 };
1836static const struct wacom_features wacom_features_0xDF = 1848static const struct wacom_features wacom_features_0xDF =
1837 { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023, 1849 { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023,
1838 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1850 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
1851 .touch_max = 16 };
1839static const struct wacom_features wacom_features_0x6004 = 1852static const struct wacom_features wacom_features_0x6004 =
1840 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 1853 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
1841 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1854 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 17ba1868f0cd..321269c1ac4c 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -99,6 +99,7 @@ struct wacom_features {
99 int pressure_fuzz; 99 int pressure_fuzz;
100 int distance_fuzz; 100 int distance_fuzz;
101 unsigned quirks; 101 unsigned quirks;
102 unsigned touch_max;
102}; 103};
103 104
104struct wacom_shared { 105struct wacom_shared {