Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1 | /* |
Dmitry Torokhov | 4104d13 | 2007-05-07 16:16:29 -0400 | [diff] [blame] | 2 | * drivers/input/tablet/wacom_wac.c |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 3 | * |
Ping Cheng | ee54500 | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 4 | * USB Wacom tablet support - Wacom specific code |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 5 | * |
| 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | */ |
Dmitry Torokhov | 51269fe | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 14 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 15 | #include "wacom_wac.h" |
Dmitry Torokhov | 51269fe | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 16 | #include "wacom.h" |
Henrik Rydberg | 47c78e8 | 2010-11-27 09:16:48 +0100 | [diff] [blame] | 17 | #include <linux/input/mt.h> |
Aristeu Rozanski | 1483f55 | 2011-06-22 01:17:17 -0700 | [diff] [blame] | 18 | #include <linux/hid.h> |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 19 | |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 20 | /* resolution for penabled devices */ |
| 21 | #define WACOM_PL_RES 20 |
| 22 | #define WACOM_PENPRTN_RES 40 |
| 23 | #define WACOM_VOLITO_RES 50 |
| 24 | #define WACOM_GRAPHIRE_RES 80 |
| 25 | #define WACOM_INTUOS_RES 100 |
| 26 | #define WACOM_INTUOS3_RES 200 |
| 27 | |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 28 | /* Newer Cintiq and DTU have an offset between tablet and screen areas */ |
| 29 | #define WACOM_DTU_OFFSET 200 |
| 30 | #define WACOM_CINTIQ_OFFSET 400 |
| 31 | |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 32 | /* |
| 33 | * Scale factor relating reported contact size to logical contact area. |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 34 | * 2^14/pi is a good approximation on Intuos5 and 3rd-gen Bamboo |
| 35 | */ |
| 36 | #define WACOM_CONTACT_AREA_SCALE 2607 |
| 37 | |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 38 | /* |
| 39 | * Percent of battery capacity for Graphire. |
| 40 | * 8th value means AC online and show 100% capacity. |
| 41 | */ |
| 42 | static unsigned short batcap_gr[8] = { 1, 15, 25, 35, 50, 70, 100, 100 }; |
| 43 | |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 44 | /* |
| 45 | * Percent of battery capacity for Intuos4 WL, AC has a separate bit. |
| 46 | */ |
| 47 | static unsigned short batcap_i4[8] = { 1, 15, 30, 45, 60, 70, 85, 100 }; |
| 48 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 49 | static int wacom_penpartner_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 50 | { |
| 51 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 52 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 53 | |
| 54 | switch (data[0]) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 55 | case 1: |
| 56 | if (data[5] & 0x80) { |
| 57 | wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 58 | wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 59 | input_report_key(input, wacom->tool[0], 1); |
| 60 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 61 | input_report_abs(input, ABS_X, get_unaligned_le16(&data[1])); |
| 62 | input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 63 | input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127); |
| 64 | input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -127)); |
| 65 | input_report_key(input, BTN_STYLUS, (data[5] & 0x40)); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 66 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 67 | input_report_key(input, wacom->tool[0], 0); |
| 68 | input_report_abs(input, ABS_MISC, 0); /* report tool id */ |
| 69 | input_report_abs(input, ABS_PRESSURE, -1); |
| 70 | input_report_key(input, BTN_TOUCH, 0); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 71 | } |
| 72 | break; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 73 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 74 | case 2: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 75 | input_report_key(input, BTN_TOOL_PEN, 1); |
| 76 | input_report_abs(input, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 77 | input_report_abs(input, ABS_X, get_unaligned_le16(&data[1])); |
| 78 | input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 79 | input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127); |
| 80 | input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); |
| 81 | input_report_key(input, BTN_STYLUS, (data[5] & 0x40)); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 82 | break; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 83 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 84 | default: |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 85 | dev_dbg(input->dev.parent, |
| 86 | "%s: received unknown report #%d\n", __func__, data[0]); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 87 | return 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 88 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 89 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 90 | return 1; |
| 91 | } |
| 92 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 93 | static int wacom_pl_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 94 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 95 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 96 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 97 | struct input_dev *input = wacom->input; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 98 | int prox, pressure; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 99 | |
Ping Cheng | cad7470 | 2009-12-15 00:35:25 -0800 | [diff] [blame] | 100 | if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 101 | dev_dbg(input->dev.parent, |
| 102 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | prox = data[1] & 0x40; |
| 107 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 108 | if (prox) { |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 109 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 110 | pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 111 | if (features->pressure_max > 255) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 112 | pressure = (pressure << 1) | ((data[4] >> 6) & 1); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 113 | pressure += (features->pressure_max + 1) / 2; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 114 | |
| 115 | /* |
| 116 | * if going from out of proximity into proximity select between the eraser |
| 117 | * and the pen based on the state of the stylus2 button, choose eraser if |
| 118 | * pressed else choose pen. if not a proximity change from out to in, send |
| 119 | * an out of proximity for previous tool then a in for new tool. |
| 120 | */ |
| 121 | if (!wacom->tool[0]) { |
| 122 | /* Eraser bit set for DTF */ |
| 123 | if (data[1] & 0x10) |
| 124 | wacom->tool[1] = BTN_TOOL_RUBBER; |
| 125 | else |
| 126 | /* Going into proximity select tool */ |
| 127 | wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 128 | } else { |
| 129 | /* was entered with stylus2 pressed */ |
| 130 | if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) { |
| 131 | /* report out proximity for previous tool */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 132 | input_report_key(input, wacom->tool[1], 0); |
| 133 | input_sync(input); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 134 | wacom->tool[1] = BTN_TOOL_PEN; |
| 135 | return 0; |
| 136 | } |
| 137 | } |
| 138 | if (wacom->tool[1] != BTN_TOOL_RUBBER) { |
| 139 | /* Unknown tool selected default to pen tool */ |
| 140 | wacom->tool[1] = BTN_TOOL_PEN; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 141 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 142 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 143 | input_report_key(input, wacom->tool[1], prox); /* report in proximity for tool */ |
| 144 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
| 145 | input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); |
| 146 | input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); |
| 147 | input_report_abs(input, ABS_PRESSURE, pressure); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 148 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 149 | input_report_key(input, BTN_TOUCH, data[4] & 0x08); |
| 150 | input_report_key(input, BTN_STYLUS, data[4] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 151 | /* Only allow the stylus2 button to be reported for the pen tool. */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 152 | input_report_key(input, BTN_STYLUS2, (wacom->tool[1] == BTN_TOOL_PEN) && (data[4] & 0x20)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 153 | } else { |
| 154 | /* report proximity-out of a (valid) tool */ |
| 155 | if (wacom->tool[1] != BTN_TOOL_RUBBER) { |
| 156 | /* Unknown tool selected default to pen tool */ |
| 157 | wacom->tool[1] = BTN_TOOL_PEN; |
| 158 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 159 | input_report_key(input, wacom->tool[1], prox); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | wacom->tool[0] = prox; /* Save proximity state */ |
| 163 | return 1; |
| 164 | } |
| 165 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 166 | static int wacom_ptu_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 167 | { |
| 168 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 169 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 170 | |
Ping Cheng | cad7470 | 2009-12-15 00:35:25 -0800 | [diff] [blame] | 171 | if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 172 | dev_dbg(input->dev.parent, |
| 173 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 174 | return 0; |
| 175 | } |
| 176 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 177 | if (data[1] & 0x04) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 178 | input_report_key(input, BTN_TOOL_RUBBER, data[1] & 0x20); |
| 179 | input_report_key(input, BTN_TOUCH, data[1] & 0x08); |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 180 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 181 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 182 | input_report_key(input, BTN_TOOL_PEN, data[1] & 0x20); |
| 183 | input_report_key(input, BTN_TOUCH, data[1] & 0x01); |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 184 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 185 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 186 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 187 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 188 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
| 189 | input_report_abs(input, ABS_PRESSURE, le16_to_cpup((__le16 *)&data[6])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 190 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 191 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 192 | return 1; |
| 193 | } |
| 194 | |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 195 | static int wacom_dtu_irq(struct wacom_wac *wacom) |
| 196 | { |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 197 | unsigned char *data = wacom->data; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 198 | struct input_dev *input = wacom->input; |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 199 | int prox = data[1] & 0x20; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 200 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 201 | dev_dbg(input->dev.parent, |
| 202 | "%s: received report #%d", __func__, data[0]); |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 203 | |
| 204 | if (prox) { |
| 205 | /* Going into proximity select tool */ |
| 206 | wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 207 | if (wacom->tool[0] == BTN_TOOL_PEN) |
| 208 | wacom->id[0] = STYLUS_DEVICE_ID; |
| 209 | else |
| 210 | wacom->id[0] = ERASER_DEVICE_ID; |
| 211 | } |
| 212 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 213 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
| 214 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 215 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 216 | input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x01) << 8) | data[6]); |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 217 | input_report_key(input, BTN_TOUCH, data[1] & 0x05); |
| 218 | if (!prox) /* out-prox */ |
| 219 | wacom->id[0] = 0; |
| 220 | input_report_key(input, wacom->tool[0], prox); |
| 221 | input_report_abs(input, ABS_MISC, wacom->id[0]); |
| 222 | return 1; |
| 223 | } |
| 224 | |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 225 | static int wacom_dtus_irq(struct wacom_wac *wacom) |
| 226 | { |
| 227 | char *data = wacom->data; |
| 228 | struct input_dev *input = wacom->input; |
| 229 | unsigned short prox, pressure = 0; |
| 230 | |
| 231 | if (data[0] != WACOM_REPORT_DTUS && data[0] != WACOM_REPORT_DTUSPAD) { |
| 232 | dev_dbg(input->dev.parent, |
| 233 | "%s: received unknown report #%d", __func__, data[0]); |
| 234 | return 0; |
| 235 | } else if (data[0] == WACOM_REPORT_DTUSPAD) { |
Benjamin Tissoires | 422b031 | 2014-07-24 12:50:39 -0700 | [diff] [blame] | 236 | input = wacom->pad_input; |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 237 | input_report_key(input, BTN_0, (data[1] & 0x01)); |
| 238 | input_report_key(input, BTN_1, (data[1] & 0x02)); |
| 239 | input_report_key(input, BTN_2, (data[1] & 0x04)); |
| 240 | input_report_key(input, BTN_3, (data[1] & 0x08)); |
| 241 | input_report_abs(input, ABS_MISC, |
| 242 | data[1] & 0x0f ? PAD_DEVICE_ID : 0); |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 243 | return 1; |
| 244 | } else { |
| 245 | prox = data[1] & 0x80; |
| 246 | if (prox) { |
| 247 | switch ((data[1] >> 3) & 3) { |
| 248 | case 1: /* Rubber */ |
| 249 | wacom->tool[0] = BTN_TOOL_RUBBER; |
| 250 | wacom->id[0] = ERASER_DEVICE_ID; |
| 251 | break; |
| 252 | |
| 253 | case 2: /* Pen */ |
| 254 | wacom->tool[0] = BTN_TOOL_PEN; |
| 255 | wacom->id[0] = STYLUS_DEVICE_ID; |
| 256 | break; |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | input_report_key(input, BTN_STYLUS, data[1] & 0x20); |
| 261 | input_report_key(input, BTN_STYLUS2, data[1] & 0x40); |
| 262 | input_report_abs(input, ABS_X, get_unaligned_be16(&data[3])); |
| 263 | input_report_abs(input, ABS_Y, get_unaligned_be16(&data[5])); |
| 264 | pressure = ((data[1] & 0x03) << 8) | (data[2] & 0xff); |
| 265 | input_report_abs(input, ABS_PRESSURE, pressure); |
| 266 | input_report_key(input, BTN_TOUCH, pressure > 10); |
| 267 | |
| 268 | if (!prox) /* out-prox */ |
| 269 | wacom->id[0] = 0; |
| 270 | input_report_key(input, wacom->tool[0], prox); |
| 271 | input_report_abs(input, ABS_MISC, wacom->id[0]); |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 272 | return 1; |
| 273 | } |
| 274 | } |
| 275 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 276 | static int wacom_graphire_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 277 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 278 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 279 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 280 | struct input_dev *input = wacom->input; |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 281 | struct input_dev *pad_input = wacom->pad_input; |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 282 | int battery_capacity, ps_connected; |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 283 | int prox; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 284 | int rw = 0; |
| 285 | int retval = 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 286 | |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 287 | if (features->type == GRAPHIRE_BT) { |
| 288 | if (data[0] != WACOM_REPORT_PENABLED_BT) { |
| 289 | dev_dbg(input->dev.parent, |
| 290 | "%s: received unknown report #%d\n", __func__, |
| 291 | data[0]); |
| 292 | goto exit; |
| 293 | } |
| 294 | } else if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 295 | dev_dbg(input->dev.parent, |
| 296 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 297 | goto exit; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 298 | } |
| 299 | |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 300 | prox = data[1] & 0x80; |
| 301 | if (prox || wacom->id[0]) { |
| 302 | if (prox) { |
| 303 | switch ((data[1] >> 5) & 3) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 304 | |
| 305 | case 0: /* Pen */ |
| 306 | wacom->tool[0] = BTN_TOOL_PEN; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 307 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 308 | break; |
| 309 | |
| 310 | case 1: /* Rubber */ |
| 311 | wacom->tool[0] = BTN_TOOL_RUBBER; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 312 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 313 | break; |
| 314 | |
| 315 | case 2: /* Mouse with wheel */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 316 | input_report_key(input, BTN_MIDDLE, data[1] & 0x04); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 317 | /* fall through */ |
| 318 | |
| 319 | case 3: /* Mouse without wheel */ |
| 320 | wacom->tool[0] = BTN_TOOL_MOUSE; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 321 | wacom->id[0] = CURSOR_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 322 | break; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 323 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 324 | } |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 325 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 326 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 327 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 328 | if (features->type == GRAPHIRE_BT) |
| 329 | input_report_abs(input, ABS_PRESSURE, data[6] | |
| 330 | (((__u16) (data[1] & 0x08)) << 5)); |
| 331 | else |
| 332 | input_report_abs(input, ABS_PRESSURE, data[6] | |
| 333 | ((data[7] & 0x03) << 8)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 334 | input_report_key(input, BTN_TOUCH, data[1] & 0x01); |
| 335 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 336 | input_report_key(input, BTN_STYLUS2, data[1] & 0x04); |
Dmitry Torokhov | afb567e | 2010-04-13 23:08:58 -0700 | [diff] [blame] | 337 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 338 | input_report_key(input, BTN_LEFT, data[1] & 0x01); |
| 339 | input_report_key(input, BTN_RIGHT, data[1] & 0x02); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 340 | if (features->type == WACOM_G4 || |
| 341 | features->type == WACOM_MO) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 342 | input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f); |
Mike Auty | d9f66c1 | 2010-08-28 20:35:17 -0700 | [diff] [blame] | 343 | rw = (data[7] & 0x04) - (data[7] & 0x03); |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 344 | } else if (features->type == GRAPHIRE_BT) { |
| 345 | /* Compute distance between mouse and tablet */ |
| 346 | rw = 44 - (data[6] >> 2); |
| 347 | rw = clamp_val(rw, 0, 31); |
| 348 | input_report_abs(input, ABS_DISTANCE, rw); |
| 349 | if (((data[1] >> 5) & 3) == 2) { |
| 350 | /* Mouse with wheel */ |
| 351 | input_report_key(input, BTN_MIDDLE, |
| 352 | data[1] & 0x04); |
| 353 | rw = (data[6] & 0x01) ? -1 : |
| 354 | (data[6] & 0x02) ? 1 : 0; |
| 355 | } else { |
| 356 | rw = 0; |
| 357 | } |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 358 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 359 | input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f); |
Mike Auty | d9f66c1 | 2010-08-28 20:35:17 -0700 | [diff] [blame] | 360 | rw = -(signed char)data[6]; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 361 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 362 | input_report_rel(input, REL_WHEEL, rw); |
Dmitry Torokhov | afb567e | 2010-04-13 23:08:58 -0700 | [diff] [blame] | 363 | } |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 364 | |
| 365 | if (!prox) |
| 366 | wacom->id[0] = 0; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 367 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
| 368 | input_report_key(input, wacom->tool[0], prox); |
| 369 | input_sync(input); /* sync last event */ |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 370 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 371 | |
| 372 | /* send pad data */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 373 | switch (features->type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 374 | case WACOM_G4: |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 375 | prox = data[7] & 0xf8; |
| 376 | if (prox || wacom->id[1]) { |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 377 | wacom->id[1] = PAD_DEVICE_ID; |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 378 | input_report_key(pad_input, BTN_BACK, (data[7] & 0x40)); |
| 379 | input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x80)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 380 | rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 381 | input_report_rel(pad_input, REL_WHEEL, rw); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 382 | if (!prox) |
| 383 | wacom->id[1] = 0; |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 384 | input_report_abs(pad_input, ABS_MISC, wacom->id[1]); |
Ping Cheng | ab687b1 | 2010-04-05 23:07:41 -0700 | [diff] [blame] | 385 | retval = 1; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 386 | } |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 387 | break; |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 388 | |
| 389 | case WACOM_MO: |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 390 | prox = (data[7] & 0xf8) || data[8]; |
| 391 | if (prox || wacom->id[1]) { |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 392 | wacom->id[1] = PAD_DEVICE_ID; |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 393 | input_report_key(pad_input, BTN_BACK, (data[7] & 0x08)); |
| 394 | input_report_key(pad_input, BTN_LEFT, (data[7] & 0x20)); |
| 395 | input_report_key(pad_input, BTN_FORWARD, (data[7] & 0x10)); |
| 396 | input_report_key(pad_input, BTN_RIGHT, (data[7] & 0x40)); |
| 397 | input_report_abs(pad_input, ABS_WHEEL, (data[8] & 0x7f)); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 398 | if (!prox) |
| 399 | wacom->id[1] = 0; |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 400 | input_report_abs(pad_input, ABS_MISC, wacom->id[1]); |
Ping Cheng | 8446001 | 2011-07-06 18:05:43 -0700 | [diff] [blame] | 401 | retval = 1; |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 402 | } |
| 403 | break; |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 404 | case GRAPHIRE_BT: |
| 405 | prox = data[7] & 0x03; |
| 406 | if (prox || wacom->id[1]) { |
| 407 | wacom->id[1] = PAD_DEVICE_ID; |
| 408 | input_report_key(pad_input, BTN_0, (data[7] & 0x02)); |
| 409 | input_report_key(pad_input, BTN_1, (data[7] & 0x01)); |
| 410 | if (!prox) |
| 411 | wacom->id[1] = 0; |
| 412 | input_report_abs(pad_input, ABS_MISC, wacom->id[1]); |
| 413 | retval = 1; |
| 414 | } |
| 415 | break; |
| 416 | } |
| 417 | |
| 418 | /* Store current battery capacity and power supply state */ |
| 419 | if (features->type == GRAPHIRE_BT) { |
| 420 | rw = (data[7] >> 2 & 0x07); |
| 421 | battery_capacity = batcap_gr[rw]; |
| 422 | ps_connected = rw == 7; |
| 423 | if ((wacom->battery_capacity != battery_capacity) || |
| 424 | (wacom->ps_connected != ps_connected)) { |
| 425 | wacom->battery_capacity = battery_capacity; |
| 426 | wacom->ps_connected = ps_connected; |
| 427 | wacom_notify_battery(wacom); |
| 428 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 429 | } |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 430 | exit: |
| 431 | return retval; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 432 | } |
| 433 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 434 | static int wacom_intuos_inout(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 435 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 436 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 437 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 438 | struct input_dev *input = wacom->input; |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 439 | int idx = 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 440 | |
| 441 | /* tool number */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 442 | if (features->type == INTUOS) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 443 | idx = data[1] & 0x01; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 444 | |
| 445 | /* Enter report */ |
| 446 | if ((data[1] & 0xfc) == 0xc0) { |
Ping Cheng | 71348162 | 2014-01-16 16:28:47 -0800 | [diff] [blame] | 447 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 448 | wacom->shared->stylus_in_proximity = true; |
| 449 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 450 | /* serial number of the tool */ |
| 451 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
| 452 | (data[4] << 20) + (data[5] << 12) + |
| 453 | (data[6] << 4) + (data[7] >> 4); |
| 454 | |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 455 | wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) | |
| 456 | ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 457 | |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 458 | switch (wacom->id[idx]) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 459 | case 0x812: /* Inking pen */ |
| 460 | case 0x801: /* Intuos3 Inking pen */ |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 461 | case 0x120802: /* Intuos4/5 Inking Pen */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 462 | case 0x012: |
| 463 | wacom->tool[idx] = BTN_TOOL_PENCIL; |
| 464 | break; |
| 465 | |
| 466 | case 0x822: /* Pen */ |
| 467 | case 0x842: |
| 468 | case 0x852: |
| 469 | case 0x823: /* Intuos3 Grip Pen */ |
| 470 | case 0x813: /* Intuos3 Classic Pen */ |
| 471 | case 0x885: /* Intuos3 Marker Pen */ |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 472 | case 0x802: /* Intuos4/5 13HD/24HD General Pen */ |
| 473 | case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 474 | case 0x022: |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 475 | case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */ |
| 476 | case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */ |
| 477 | case 0x160802: /* Cintiq 13HD Pro Pen */ |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 478 | case 0x180802: /* DTH2242 Pen */ |
Ping Cheng | 7d753b0 | 2013-06-18 23:14:25 -0700 | [diff] [blame] | 479 | case 0x100802: /* Intuos4/5 13HD/24HD General Pen */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 480 | wacom->tool[idx] = BTN_TOOL_PEN; |
| 481 | break; |
| 482 | |
| 483 | case 0x832: /* Stroke pen */ |
| 484 | case 0x032: |
| 485 | wacom->tool[idx] = BTN_TOOL_BRUSH; |
| 486 | break; |
| 487 | |
| 488 | case 0x007: /* Mouse 4D and 2D */ |
| 489 | case 0x09c: |
| 490 | case 0x094: |
| 491 | case 0x017: /* Intuos3 2D Mouse */ |
| 492 | case 0x806: /* Intuos4 Mouse */ |
| 493 | wacom->tool[idx] = BTN_TOOL_MOUSE; |
| 494 | break; |
| 495 | |
| 496 | case 0x096: /* Lens cursor */ |
| 497 | case 0x097: /* Intuos3 Lens cursor */ |
| 498 | case 0x006: /* Intuos4 Lens cursor */ |
| 499 | wacom->tool[idx] = BTN_TOOL_LENS; |
| 500 | break; |
| 501 | |
| 502 | case 0x82a: /* Eraser */ |
| 503 | case 0x85a: |
| 504 | case 0x91a: |
| 505 | case 0xd1a: |
| 506 | case 0x0fa: |
| 507 | case 0x82b: /* Intuos3 Grip Pen Eraser */ |
| 508 | case 0x81b: /* Intuos3 Classic Pen Eraser */ |
| 509 | case 0x91b: /* Intuos3 Airbrush Eraser */ |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 510 | case 0x80c: /* Intuos4/5 13HD/24HD Marker Pen Eraser */ |
| 511 | case 0x80a: /* Intuos4/5 13HD/24HD General Pen Eraser */ |
| 512 | case 0x90a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ |
| 513 | case 0x14080a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */ |
| 514 | case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */ |
| 515 | case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */ |
| 516 | case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */ |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 517 | case 0x18080a: /* DTH2242 Eraser */ |
Ping Cheng | 7d753b0 | 2013-06-18 23:14:25 -0700 | [diff] [blame] | 518 | case 0x10080a: /* Intuos4/5 13HD/24HD General Pen Eraser */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 519 | wacom->tool[idx] = BTN_TOOL_RUBBER; |
| 520 | break; |
| 521 | |
| 522 | case 0xd12: |
| 523 | case 0x912: |
| 524 | case 0x112: |
| 525 | case 0x913: /* Intuos3 Airbrush */ |
Ping Cheng | f0aacea | 2013-05-05 19:59:05 -0700 | [diff] [blame] | 526 | case 0x902: /* Intuos4/5 13HD/24HD Airbrush */ |
| 527 | case 0x100902: /* Intuos4/5 13HD/24HD Airbrush */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 528 | wacom->tool[idx] = BTN_TOOL_AIRBRUSH; |
| 529 | break; |
| 530 | |
| 531 | default: /* Unknown tool */ |
| 532 | wacom->tool[idx] = BTN_TOOL_PEN; |
| 533 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 534 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 535 | return 1; |
| 536 | } |
| 537 | |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 538 | /* older I4 styli don't work with new Cintiqs */ |
| 539 | if (!((wacom->id[idx] >> 20) & 0x01) && |
| 540 | (features->type == WACOM_21UX2)) |
| 541 | return 1; |
| 542 | |
Jason Gerecke | 4eb1830 | 2013-09-20 09:48:46 -0700 | [diff] [blame] | 543 | /* Range Report */ |
| 544 | if ((data[1] & 0xfe) == 0x20) { |
| 545 | input_report_key(input, BTN_TOUCH, 0); |
| 546 | input_report_abs(input, ABS_PRESSURE, 0); |
| 547 | input_report_abs(input, ABS_DISTANCE, wacom->features.distance_max); |
Ping Cheng | 805a876 | 2014-05-29 00:08:20 -0700 | [diff] [blame] | 548 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) |
| 549 | wacom->shared->stylus_in_proximity = true; |
Jason Gerecke | 4eb1830 | 2013-09-20 09:48:46 -0700 | [diff] [blame] | 550 | } |
| 551 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 552 | /* Exit report */ |
| 553 | if ((data[1] & 0xfe) == 0x80) { |
Ping Cheng | 71348162 | 2014-01-16 16:28:47 -0800 | [diff] [blame] | 554 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 555 | wacom->shared->stylus_in_proximity = false; |
| 556 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 557 | /* |
| 558 | * Reset all states otherwise we lose the initial states |
| 559 | * when in-prox next time |
| 560 | */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 561 | input_report_abs(input, ABS_X, 0); |
| 562 | input_report_abs(input, ABS_Y, 0); |
| 563 | input_report_abs(input, ABS_DISTANCE, 0); |
| 564 | input_report_abs(input, ABS_TILT_X, 0); |
| 565 | input_report_abs(input, ABS_TILT_Y, 0); |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 566 | if (wacom->tool[idx] >= BTN_TOOL_MOUSE) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 567 | input_report_key(input, BTN_LEFT, 0); |
| 568 | input_report_key(input, BTN_MIDDLE, 0); |
| 569 | input_report_key(input, BTN_RIGHT, 0); |
| 570 | input_report_key(input, BTN_SIDE, 0); |
| 571 | input_report_key(input, BTN_EXTRA, 0); |
| 572 | input_report_abs(input, ABS_THROTTLE, 0); |
| 573 | input_report_abs(input, ABS_RZ, 0); |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 574 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 575 | input_report_abs(input, ABS_PRESSURE, 0); |
| 576 | input_report_key(input, BTN_STYLUS, 0); |
| 577 | input_report_key(input, BTN_STYLUS2, 0); |
| 578 | input_report_key(input, BTN_TOUCH, 0); |
| 579 | input_report_abs(input, ABS_WHEEL, 0); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 580 | if (features->type >= INTUOS3S) |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 581 | input_report_abs(input, ABS_Z, 0); |
Ping Cheng | 8d32e3a | 2006-09-26 13:34:47 -0700 | [diff] [blame] | 582 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 583 | input_report_key(input, wacom->tool[idx], 0); |
| 584 | input_report_abs(input, ABS_MISC, 0); /* reset tool id */ |
| 585 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 586 | wacom->id[idx] = 0; |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 587 | return 2; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 588 | } |
| 589 | return 0; |
| 590 | } |
| 591 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 592 | static void wacom_intuos_general(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 593 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 594 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 595 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 596 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 597 | unsigned int t; |
| 598 | |
| 599 | /* general pen packet */ |
| 600 | if ((data[1] & 0xb8) == 0xa0) { |
| 601 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 602 | if (features->type >= INTUOS4S && features->type <= CINTIQ_HYBRID) { |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 603 | t = (t << 1) | (data[1] & 1); |
Aristeu Rozanski | ca047fe | 2010-10-10 14:12:33 -0700 | [diff] [blame] | 604 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 605 | input_report_abs(input, ABS_PRESSURE, t); |
| 606 | input_report_abs(input, ABS_TILT_X, |
Jason Gerecke | ec5fc1c | 2014-11-18 16:50:08 -0800 | [diff] [blame] | 607 | (((data[7] << 1) & 0x7e) | (data[8] >> 7)) - 64); |
| 608 | input_report_abs(input, ABS_TILT_Y, (data[8] & 0x7f) - 64); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 609 | input_report_key(input, BTN_STYLUS, data[1] & 2); |
| 610 | input_report_key(input, BTN_STYLUS2, data[1] & 4); |
| 611 | input_report_key(input, BTN_TOUCH, t > 10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | /* airbrush second packet */ |
| 615 | if ((data[1] & 0xbc) == 0xb4) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 616 | input_report_abs(input, ABS_WHEEL, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 617 | (data[6] << 2) | ((data[7] >> 6) & 3)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 618 | input_report_abs(input, ABS_TILT_X, |
Jason Gerecke | ec5fc1c | 2014-11-18 16:50:08 -0800 | [diff] [blame] | 619 | (((data[7] << 1) & 0x7e) | (data[8] >> 7)) - 64); |
| 620 | input_report_abs(input, ABS_TILT_Y, (data[8] & 0x7f) - 64); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 621 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 622 | } |
| 623 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 624 | static int wacom_intuos_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 625 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 626 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 627 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 628 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 629 | unsigned int t; |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 630 | int idx = 0, result; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 631 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 632 | if (data[0] != WACOM_REPORT_PENABLED && |
| 633 | data[0] != WACOM_REPORT_INTUOSREAD && |
| 634 | data[0] != WACOM_REPORT_INTUOSWRITE && |
| 635 | data[0] != WACOM_REPORT_INTUOSPAD && |
| 636 | data[0] != WACOM_REPORT_INTUOS5PAD) { |
| 637 | dev_dbg(input->dev.parent, |
| 638 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 639 | return 0; |
| 640 | } |
| 641 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 642 | /* tool number */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 643 | if (features->type == INTUOS) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 644 | idx = data[1] & 0x01; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 645 | |
| 646 | /* pad packets. Works as a second tool and is always in prox */ |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 647 | if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { |
Benjamin Tissoires | 10059cdc | 2014-07-24 12:49:08 -0700 | [diff] [blame] | 648 | input = wacom->pad_input; |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 649 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 650 | input_report_key(input, BTN_0, (data[2] & 0x01)); |
| 651 | input_report_key(input, BTN_1, (data[3] & 0x01)); |
| 652 | input_report_key(input, BTN_2, (data[3] & 0x02)); |
| 653 | input_report_key(input, BTN_3, (data[3] & 0x04)); |
| 654 | input_report_key(input, BTN_4, (data[3] & 0x08)); |
| 655 | input_report_key(input, BTN_5, (data[3] & 0x10)); |
| 656 | input_report_key(input, BTN_6, (data[3] & 0x20)); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 657 | if (data[1] & 0x80) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 658 | input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f)); |
Ping Cheng | a862952 | 2009-06-02 16:59:58 -0700 | [diff] [blame] | 659 | } else { |
| 660 | /* Out of proximity, clear wheel value. */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 661 | input_report_abs(input, ABS_WHEEL, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 662 | } |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 663 | if (features->type != INTUOS4S) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 664 | input_report_key(input, BTN_7, (data[3] & 0x40)); |
| 665 | input_report_key(input, BTN_8, (data[3] & 0x80)); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 666 | } |
| 667 | if (data[1] | (data[2] & 0x01) | data[3]) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 668 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 669 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 670 | input_report_abs(input, ABS_MISC, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 671 | } |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 672 | } else if (features->type == DTK) { |
| 673 | input_report_key(input, BTN_0, (data[6] & 0x01)); |
| 674 | input_report_key(input, BTN_1, (data[6] & 0x02)); |
| 675 | input_report_key(input, BTN_2, (data[6] & 0x04)); |
| 676 | input_report_key(input, BTN_3, (data[6] & 0x08)); |
| 677 | input_report_key(input, BTN_4, (data[6] & 0x10)); |
| 678 | input_report_key(input, BTN_5, (data[6] & 0x20)); |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 679 | if (data[6] & 0x3f) { |
| 680 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 681 | } else { |
| 682 | input_report_abs(input, ABS_MISC, 0); |
| 683 | } |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 684 | } else if (features->type == WACOM_13HD) { |
| 685 | input_report_key(input, BTN_0, (data[3] & 0x01)); |
| 686 | input_report_key(input, BTN_1, (data[4] & 0x01)); |
| 687 | input_report_key(input, BTN_2, (data[4] & 0x02)); |
| 688 | input_report_key(input, BTN_3, (data[4] & 0x04)); |
| 689 | input_report_key(input, BTN_4, (data[4] & 0x08)); |
| 690 | input_report_key(input, BTN_5, (data[4] & 0x10)); |
| 691 | input_report_key(input, BTN_6, (data[4] & 0x20)); |
| 692 | input_report_key(input, BTN_7, (data[4] & 0x40)); |
| 693 | input_report_key(input, BTN_8, (data[4] & 0x80)); |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 694 | if ((data[3] & 0x01) | data[4]) { |
| 695 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 696 | } else { |
| 697 | input_report_abs(input, ABS_MISC, 0); |
| 698 | } |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 699 | } else if (features->type == WACOM_24HD) { |
| 700 | input_report_key(input, BTN_0, (data[6] & 0x01)); |
| 701 | input_report_key(input, BTN_1, (data[6] & 0x02)); |
| 702 | input_report_key(input, BTN_2, (data[6] & 0x04)); |
| 703 | input_report_key(input, BTN_3, (data[6] & 0x08)); |
| 704 | input_report_key(input, BTN_4, (data[6] & 0x10)); |
| 705 | input_report_key(input, BTN_5, (data[6] & 0x20)); |
| 706 | input_report_key(input, BTN_6, (data[6] & 0x40)); |
| 707 | input_report_key(input, BTN_7, (data[6] & 0x80)); |
| 708 | input_report_key(input, BTN_8, (data[8] & 0x01)); |
| 709 | input_report_key(input, BTN_9, (data[8] & 0x02)); |
| 710 | input_report_key(input, BTN_A, (data[8] & 0x04)); |
| 711 | input_report_key(input, BTN_B, (data[8] & 0x08)); |
| 712 | input_report_key(input, BTN_C, (data[8] & 0x10)); |
| 713 | input_report_key(input, BTN_X, (data[8] & 0x20)); |
| 714 | input_report_key(input, BTN_Y, (data[8] & 0x40)); |
| 715 | input_report_key(input, BTN_Z, (data[8] & 0x80)); |
| 716 | |
| 717 | /* |
| 718 | * Three "buttons" are available on the 24HD which are |
| 719 | * physically implemented as a touchstrip. Each button |
| 720 | * is approximately 3 bits wide with a 2 bit spacing. |
| 721 | * The raw touchstrip bits are stored at: |
| 722 | * ((data[3] & 0x1f) << 8) | data[4]) |
| 723 | */ |
| 724 | input_report_key(input, KEY_PROG1, data[4] & 0x07); |
| 725 | input_report_key(input, KEY_PROG2, data[4] & 0xE0); |
| 726 | input_report_key(input, KEY_PROG3, data[3] & 0x1C); |
| 727 | |
| 728 | if (data[1] & 0x80) { |
| 729 | input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f)); |
| 730 | } else { |
| 731 | /* Out of proximity, clear wheel value. */ |
| 732 | input_report_abs(input, ABS_WHEEL, 0); |
| 733 | } |
| 734 | |
| 735 | if (data[2] & 0x80) { |
| 736 | input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f)); |
| 737 | } else { |
| 738 | /* Out of proximity, clear second wheel value. */ |
| 739 | input_report_abs(input, ABS_THROTTLE, 0); |
| 740 | } |
| 741 | |
| 742 | if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) { |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 743 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 744 | } else { |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 745 | input_report_abs(input, ABS_MISC, 0); |
| 746 | } |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 747 | } else if (features->type == CINTIQ_HYBRID) { |
| 748 | /* |
| 749 | * Do not send hardware buttons under Android. They |
| 750 | * are already sent to the system through GPIO (and |
| 751 | * have different meaning). |
| 752 | */ |
| 753 | input_report_key(input, BTN_1, (data[4] & 0x01)); |
| 754 | input_report_key(input, BTN_2, (data[4] & 0x02)); |
| 755 | input_report_key(input, BTN_3, (data[4] & 0x04)); |
| 756 | input_report_key(input, BTN_4, (data[4] & 0x08)); |
| 757 | |
| 758 | input_report_key(input, BTN_5, (data[4] & 0x10)); /* Right */ |
| 759 | input_report_key(input, BTN_6, (data[4] & 0x20)); /* Up */ |
| 760 | input_report_key(input, BTN_7, (data[4] & 0x40)); /* Left */ |
| 761 | input_report_key(input, BTN_8, (data[4] & 0x80)); /* Down */ |
| 762 | input_report_key(input, BTN_0, (data[3] & 0x01)); /* Center */ |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 763 | } else if (features->type >= INTUOS5S && features->type <= INTUOSPL) { |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 764 | int i; |
| 765 | |
| 766 | /* Touch ring mode switch has no capacitive sensor */ |
| 767 | input_report_key(input, BTN_0, (data[3] & 0x01)); |
| 768 | |
| 769 | /* |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 770 | * ExpressKeys on Intuos5/Intuos Pro have a capacitive sensor in |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 771 | * addition to the mechanical switch. Switch data is |
| 772 | * stored in data[4], capacitive data in data[5]. |
| 773 | */ |
| 774 | for (i = 0; i < 8; i++) |
| 775 | input_report_key(input, BTN_1 + i, data[4] & (1 << i)); |
| 776 | |
| 777 | if (data[2] & 0x80) { |
| 778 | input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f)); |
| 779 | } else { |
| 780 | /* Out of proximity, clear wheel value. */ |
| 781 | input_report_abs(input, ABS_WHEEL, 0); |
| 782 | } |
| 783 | |
Jason Gerecke | 5e056ef | 2012-09-24 09:21:31 -0700 | [diff] [blame] | 784 | if (data[2] | (data[3] & 0x01) | data[4] | data[5]) { |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 785 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 786 | } else { |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 787 | input_report_abs(input, ABS_MISC, 0); |
| 788 | } |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 789 | } else { |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 790 | if (features->type == WACOM_21UX2 || features->type == WACOM_22HD) { |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 791 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
| 792 | input_report_key(input, BTN_1, (data[6] & 0x01)); |
| 793 | input_report_key(input, BTN_2, (data[6] & 0x02)); |
| 794 | input_report_key(input, BTN_3, (data[6] & 0x04)); |
| 795 | input_report_key(input, BTN_4, (data[6] & 0x08)); |
| 796 | input_report_key(input, BTN_5, (data[6] & 0x10)); |
| 797 | input_report_key(input, BTN_6, (data[6] & 0x20)); |
| 798 | input_report_key(input, BTN_7, (data[6] & 0x40)); |
| 799 | input_report_key(input, BTN_8, (data[6] & 0x80)); |
| 800 | input_report_key(input, BTN_9, (data[7] & 0x01)); |
| 801 | input_report_key(input, BTN_A, (data[8] & 0x01)); |
| 802 | input_report_key(input, BTN_B, (data[8] & 0x02)); |
| 803 | input_report_key(input, BTN_C, (data[8] & 0x04)); |
| 804 | input_report_key(input, BTN_X, (data[8] & 0x08)); |
| 805 | input_report_key(input, BTN_Y, (data[8] & 0x10)); |
| 806 | input_report_key(input, BTN_Z, (data[8] & 0x20)); |
| 807 | input_report_key(input, BTN_BASE, (data[8] & 0x40)); |
| 808 | input_report_key(input, BTN_BASE2, (data[8] & 0x80)); |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 809 | |
| 810 | if (features->type == WACOM_22HD) { |
| 811 | input_report_key(input, KEY_PROG1, data[9] & 0x01); |
| 812 | input_report_key(input, KEY_PROG2, data[9] & 0x02); |
| 813 | input_report_key(input, KEY_PROG3, data[9] & 0x04); |
| 814 | } |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 815 | } else { |
| 816 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
| 817 | input_report_key(input, BTN_1, (data[5] & 0x02)); |
| 818 | input_report_key(input, BTN_2, (data[5] & 0x04)); |
| 819 | input_report_key(input, BTN_3, (data[5] & 0x08)); |
| 820 | input_report_key(input, BTN_4, (data[6] & 0x01)); |
| 821 | input_report_key(input, BTN_5, (data[6] & 0x02)); |
| 822 | input_report_key(input, BTN_6, (data[6] & 0x04)); |
| 823 | input_report_key(input, BTN_7, (data[6] & 0x08)); |
| 824 | input_report_key(input, BTN_8, (data[5] & 0x10)); |
| 825 | input_report_key(input, BTN_9, (data[6] & 0x10)); |
| 826 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 827 | input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
| 828 | input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 829 | |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 830 | if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) | |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 831 | data[2] | (data[3] & 0x1f) | data[4] | data[8] | |
| 832 | (data[7] & 0x01)) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 833 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 834 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 835 | input_report_abs(input, ABS_MISC, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 836 | } |
| 837 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 838 | return 1; |
| 839 | } |
| 840 | |
| 841 | /* process in/out prox events */ |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 842 | result = wacom_intuos_inout(wacom); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 843 | if (result) |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 844 | return result - 1; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 845 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 846 | /* don't proceed if we don't know the ID */ |
| 847 | if (!wacom->id[idx]) |
| 848 | return 0; |
| 849 | |
| 850 | /* Only large Intuos support Lense Cursor */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 851 | if (wacom->tool[idx] == BTN_TOOL_LENS && |
| 852 | (features->type == INTUOS3 || |
| 853 | features->type == INTUOS3S || |
| 854 | features->type == INTUOS4 || |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 855 | features->type == INTUOS4S || |
| 856 | features->type == INTUOS5 || |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 857 | features->type == INTUOS5S || |
| 858 | features->type == INTUOSPM || |
| 859 | features->type == INTUOSPS)) { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 860 | |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 861 | return 0; |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 862 | } |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 863 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 864 | /* Cintiq doesn't send data when RDY bit isn't set */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 865 | if (features->type == CINTIQ && !(data[1] & 0x40)) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 866 | return 0; |
| 867 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 868 | if (features->type >= INTUOS3S) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 869 | input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |
| 870 | input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); |
| 871 | input_report_abs(input, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 872 | } else { |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 873 | input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[2])); |
| 874 | input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[4])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 875 | input_report_abs(input, ABS_DISTANCE, ((data[9] >> 3) & 0x1f)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 876 | } |
| 877 | |
| 878 | /* process general packets */ |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 879 | wacom_intuos_general(wacom); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 880 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 881 | /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */ |
| 882 | if ((data[1] & 0xbc) == 0xa8 || (data[1] & 0xbe) == 0xb0 || (data[1] & 0xbc) == 0xac) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 883 | |
| 884 | if (data[1] & 0x02) { |
| 885 | /* Rotation packet */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 886 | if (features->type >= INTUOS3S) { |
Ping Cheng | 0e1763f | 2008-03-13 16:46:46 -0400 | [diff] [blame] | 887 | /* I3 marker pen rotation */ |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 888 | t = (data[6] << 3) | ((data[7] >> 5) & 7); |
| 889 | t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : |
| 890 | ((t-1) / 2 + 450)) : (450 - t / 2) ; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 891 | input_report_abs(input, ABS_Z, t); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 892 | } else { |
| 893 | /* 4D mouse rotation packet */ |
| 894 | t = (data[6] << 3) | ((data[7] >> 5) & 7); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 895 | input_report_abs(input, ABS_RZ, (data[7] & 0x20) ? |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 896 | ((t - 1) / 2) : -t / 2); |
| 897 | } |
| 898 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 899 | } else if (!(data[1] & 0x10) && features->type < INTUOS3S) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 900 | /* 4D mouse packet */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 901 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
| 902 | input_report_key(input, BTN_MIDDLE, data[8] & 0x02); |
| 903 | input_report_key(input, BTN_RIGHT, data[8] & 0x04); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 904 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 905 | input_report_key(input, BTN_SIDE, data[8] & 0x20); |
| 906 | input_report_key(input, BTN_EXTRA, data[8] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 907 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 908 | input_report_abs(input, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 909 | |
| 910 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 911 | /* I4 mouse */ |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 912 | if (features->type >= INTUOS4S && features->type <= INTUOSPL) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 913 | input_report_key(input, BTN_LEFT, data[6] & 0x01); |
| 914 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); |
| 915 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); |
| 916 | input_report_rel(input, REL_WHEEL, ((data[7] & 0x80) >> 7) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 917 | - ((data[7] & 0x40) >> 6)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 918 | input_report_key(input, BTN_SIDE, data[6] & 0x08); |
| 919 | input_report_key(input, BTN_EXTRA, data[6] & 0x10); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 920 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 921 | input_report_abs(input, ABS_TILT_X, |
Jason Gerecke | ec5fc1c | 2014-11-18 16:50:08 -0800 | [diff] [blame] | 922 | (((data[7] << 1) & 0x7e) | (data[8] >> 7)) - 64); |
| 923 | input_report_abs(input, ABS_TILT_Y, (data[8] & 0x7f) - 64); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 924 | } else { |
| 925 | /* 2D mouse packet */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 926 | input_report_key(input, BTN_LEFT, data[8] & 0x04); |
| 927 | input_report_key(input, BTN_MIDDLE, data[8] & 0x08); |
| 928 | input_report_key(input, BTN_RIGHT, data[8] & 0x10); |
| 929 | input_report_rel(input, REL_WHEEL, (data[8] & 0x01) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 930 | - ((data[8] & 0x02) >> 1)); |
| 931 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 932 | /* I3 2D mouse side buttons */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 933 | if (features->type >= INTUOS3S && features->type <= INTUOS3L) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 934 | input_report_key(input, BTN_SIDE, data[8] & 0x40); |
| 935 | input_report_key(input, BTN_EXTRA, data[8] & 0x20); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 936 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 937 | } |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 938 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 939 | features->type == INTUOS4L || features->type == INTUOS5L || |
| 940 | features->type == INTUOSPL) && |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 941 | wacom->tool[idx] == BTN_TOOL_LENS) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 942 | /* Lens cursor packets */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 943 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
| 944 | input_report_key(input, BTN_MIDDLE, data[8] & 0x02); |
| 945 | input_report_key(input, BTN_RIGHT, data[8] & 0x04); |
| 946 | input_report_key(input, BTN_SIDE, data[8] & 0x10); |
| 947 | input_report_key(input, BTN_EXTRA, data[8] & 0x08); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 948 | } |
| 949 | } |
| 950 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 951 | input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ |
| 952 | input_report_key(input, wacom->tool[idx], 1); |
| 953 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 954 | return 1; |
| 955 | } |
| 956 | |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 957 | static int int_dist(int x1, int y1, int x2, int y2) |
| 958 | { |
| 959 | int x = x2 - x1; |
| 960 | int y = y2 - y1; |
| 961 | |
| 962 | return int_sqrt(x*x + y*y); |
| 963 | } |
| 964 | |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 965 | static void wacom_intuos_bt_process_data(struct wacom_wac *wacom, |
| 966 | unsigned char *data) |
| 967 | { |
| 968 | memcpy(wacom->data, data, 10); |
| 969 | wacom_intuos_irq(wacom); |
| 970 | |
| 971 | input_sync(wacom->input); |
| 972 | if (wacom->pad_input) |
| 973 | input_sync(wacom->pad_input); |
| 974 | } |
| 975 | |
| 976 | static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) |
| 977 | { |
| 978 | unsigned char data[WACOM_PKGLEN_MAX]; |
| 979 | int i = 1; |
| 980 | unsigned power_raw, battery_capacity, bat_charging, ps_connected; |
| 981 | |
| 982 | memcpy(data, wacom->data, len); |
| 983 | |
| 984 | switch (data[0]) { |
| 985 | case 0x04: |
| 986 | wacom_intuos_bt_process_data(wacom, data + i); |
| 987 | i += 10; |
| 988 | /* fall through */ |
| 989 | case 0x03: |
| 990 | wacom_intuos_bt_process_data(wacom, data + i); |
| 991 | i += 10; |
| 992 | wacom_intuos_bt_process_data(wacom, data + i); |
| 993 | i += 10; |
| 994 | power_raw = data[i]; |
| 995 | bat_charging = (power_raw & 0x08) ? 1 : 0; |
| 996 | ps_connected = (power_raw & 0x10) ? 1 : 0; |
| 997 | battery_capacity = batcap_i4[power_raw & 0x07]; |
| 998 | if ((wacom->battery_capacity != battery_capacity) || |
| 999 | (wacom->bat_charging != bat_charging) || |
| 1000 | (wacom->ps_connected != ps_connected)) { |
| 1001 | wacom->battery_capacity = battery_capacity; |
| 1002 | wacom->bat_charging = bat_charging; |
| 1003 | wacom->ps_connected = ps_connected; |
| 1004 | wacom_notify_battery(wacom); |
| 1005 | } |
| 1006 | |
| 1007 | break; |
| 1008 | default: |
| 1009 | dev_dbg(wacom->input->dev.parent, |
| 1010 | "Unknown report: %d,%d size:%zu\n", |
| 1011 | data[0], data[1], len); |
| 1012 | return 0; |
| 1013 | } |
| 1014 | return 0; |
| 1015 | } |
| 1016 | |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1017 | static int wacom_24hdt_irq(struct wacom_wac *wacom) |
| 1018 | { |
| 1019 | struct input_dev *input = wacom->input; |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 1020 | unsigned char *data = wacom->data; |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1021 | int i; |
| 1022 | int current_num_contacts = data[61]; |
| 1023 | int contacts_to_send = 0; |
| 1024 | |
| 1025 | /* |
| 1026 | * First packet resets the counter since only the first |
| 1027 | * packet in series will have non-zero current_num_contacts. |
| 1028 | */ |
| 1029 | if (current_num_contacts) |
| 1030 | wacom->num_contacts_left = current_num_contacts; |
| 1031 | |
| 1032 | /* There are at most 4 contacts per packet */ |
| 1033 | contacts_to_send = min(4, wacom->num_contacts_left); |
| 1034 | |
| 1035 | for (i = 0; i < contacts_to_send; i++) { |
| 1036 | int offset = (WACOM_BYTES_PER_24HDT_PACKET * i) + 1; |
| 1037 | bool touch = data[offset] & 0x1 && !wacom->shared->stylus_in_proximity; |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 1038 | int slot = input_mt_get_slot_by_key(input, data[offset + 1]); |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1039 | |
| 1040 | if (slot < 0) |
| 1041 | continue; |
| 1042 | input_mt_slot(input, slot); |
| 1043 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1044 | |
| 1045 | if (touch) { |
Jason Gerecke | edc8e20a | 2014-05-14 16:53:30 -0700 | [diff] [blame] | 1046 | int t_x = get_unaligned_le16(&data[offset + 2]); |
| 1047 | int c_x = get_unaligned_le16(&data[offset + 4]); |
| 1048 | int t_y = get_unaligned_le16(&data[offset + 6]); |
| 1049 | int c_y = get_unaligned_le16(&data[offset + 8]); |
| 1050 | int w = get_unaligned_le16(&data[offset + 10]); |
| 1051 | int h = get_unaligned_le16(&data[offset + 12]); |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1052 | |
| 1053 | input_report_abs(input, ABS_MT_POSITION_X, t_x); |
| 1054 | input_report_abs(input, ABS_MT_POSITION_Y, t_y); |
| 1055 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, min(w,h)); |
| 1056 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, min(w, h) + int_dist(t_x, t_y, c_x, c_y)); |
| 1057 | input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h)); |
| 1058 | input_report_abs(input, ABS_MT_ORIENTATION, w > h); |
| 1059 | } |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1060 | } |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1061 | input_mt_report_pointer_emulation(input, true); |
| 1062 | |
| 1063 | wacom->num_contacts_left -= contacts_to_send; |
| 1064 | if (wacom->num_contacts_left <= 0) |
| 1065 | wacom->num_contacts_left = 0; |
| 1066 | |
| 1067 | return 1; |
| 1068 | } |
| 1069 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1070 | static int wacom_mt_touch(struct wacom_wac *wacom) |
| 1071 | { |
| 1072 | struct input_dev *input = wacom->input; |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 1073 | unsigned char *data = wacom->data; |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1074 | int i; |
| 1075 | int current_num_contacts = data[2]; |
| 1076 | int contacts_to_send = 0; |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 1077 | int x_offset = 0; |
| 1078 | |
| 1079 | /* MTTPC does not support Height and Width */ |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 1080 | if (wacom->features.type == MTTPC || wacom->features.type == MTTPC_B) |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 1081 | x_offset = -4; |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1082 | |
| 1083 | /* |
| 1084 | * First packet resets the counter since only the first |
| 1085 | * packet in series will have non-zero current_num_contacts. |
| 1086 | */ |
| 1087 | if (current_num_contacts) |
| 1088 | wacom->num_contacts_left = current_num_contacts; |
| 1089 | |
| 1090 | /* There are at most 5 contacts per packet */ |
| 1091 | contacts_to_send = min(5, wacom->num_contacts_left); |
| 1092 | |
| 1093 | for (i = 0; i < contacts_to_send; i++) { |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 1094 | int offset = (WACOM_BYTES_PER_MT_PACKET + x_offset) * i + 3; |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1095 | bool touch = data[offset] & 0x1; |
Jason Gerecke | edc8e20a | 2014-05-14 16:53:30 -0700 | [diff] [blame] | 1096 | int id = get_unaligned_le16(&data[offset + 1]); |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 1097 | int slot = input_mt_get_slot_by_key(input, id); |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1098 | |
| 1099 | if (slot < 0) |
| 1100 | continue; |
| 1101 | |
| 1102 | input_mt_slot(input, slot); |
| 1103 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1104 | if (touch) { |
Jason Gerecke | edc8e20a | 2014-05-14 16:53:30 -0700 | [diff] [blame] | 1105 | int x = get_unaligned_le16(&data[offset + x_offset + 7]); |
| 1106 | int y = get_unaligned_le16(&data[offset + x_offset + 9]); |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1107 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1108 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
| 1109 | } |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1110 | } |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1111 | input_mt_report_pointer_emulation(input, true); |
| 1112 | |
| 1113 | wacom->num_contacts_left -= contacts_to_send; |
| 1114 | if (wacom->num_contacts_left < 0) |
| 1115 | wacom->num_contacts_left = 0; |
| 1116 | |
| 1117 | return 1; |
| 1118 | } |
| 1119 | |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1120 | static int wacom_tpc_mt_touch(struct wacom_wac *wacom) |
| 1121 | { |
| 1122 | struct input_dev *input = wacom->input; |
| 1123 | unsigned char *data = wacom->data; |
| 1124 | int contact_with_no_pen_down_count = 0; |
| 1125 | int i; |
| 1126 | |
| 1127 | for (i = 0; i < 2; i++) { |
| 1128 | int p = data[1] & (1 << i); |
| 1129 | bool touch = p && !wacom->shared->stylus_in_proximity; |
| 1130 | |
| 1131 | input_mt_slot(input, i); |
| 1132 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1133 | if (touch) { |
| 1134 | int x = le16_to_cpup((__le16 *)&data[i * 2 + 2]) & 0x7fff; |
| 1135 | int y = le16_to_cpup((__le16 *)&data[i * 2 + 6]) & 0x7fff; |
| 1136 | |
| 1137 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1138 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
| 1139 | contact_with_no_pen_down_count++; |
| 1140 | } |
| 1141 | } |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 1142 | input_mt_report_pointer_emulation(input, true); |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1143 | |
| 1144 | /* keep touch state for pen event */ |
| 1145 | wacom->shared->touch_down = (contact_with_no_pen_down_count > 0); |
| 1146 | |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1147 | return 1; |
| 1148 | } |
| 1149 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1150 | static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len) |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1151 | { |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 1152 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1153 | struct input_dev *input = wacom->input; |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1154 | bool prox; |
| 1155 | int x = 0, y = 0; |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1156 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1157 | if (wacom->features.touch_max > 1 || len > WACOM_PKGLEN_TPC2FG) |
| 1158 | return 0; |
| 1159 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1160 | if (!wacom->shared->stylus_in_proximity) { |
| 1161 | if (len == WACOM_PKGLEN_TPC1FG) { |
| 1162 | prox = data[0] & 0x01; |
| 1163 | x = get_unaligned_le16(&data[1]); |
| 1164 | y = get_unaligned_le16(&data[3]); |
Jason Gerecke | 61616ed | 2014-05-14 11:42:22 -0700 | [diff] [blame] | 1165 | } else if (len == WACOM_PKGLEN_TPC1FG_B) { |
| 1166 | prox = data[2] & 0x01; |
| 1167 | x = get_unaligned_le16(&data[3]); |
| 1168 | y = get_unaligned_le16(&data[5]); |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1169 | } else { |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1170 | prox = data[1] & 0x01; |
| 1171 | x = le16_to_cpup((__le16 *)&data[2]); |
| 1172 | y = le16_to_cpup((__le16 *)&data[4]); |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1173 | } |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1174 | } else |
| 1175 | /* force touch out when pen is in prox */ |
| 1176 | prox = 0; |
| 1177 | |
| 1178 | if (prox) { |
| 1179 | input_report_abs(input, ABS_X, x); |
| 1180 | input_report_abs(input, ABS_Y, y); |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1181 | } |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1182 | input_report_key(input, BTN_TOUCH, prox); |
| 1183 | |
| 1184 | /* keep touch state for pen events */ |
| 1185 | wacom->shared->touch_down = prox; |
| 1186 | |
| 1187 | return 1; |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1188 | } |
| 1189 | |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1190 | static int wacom_tpc_pen(struct wacom_wac *wacom) |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1191 | { |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 1192 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1193 | struct input_dev *input = wacom->input; |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1194 | bool prox = data[1] & 0x20; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1195 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1196 | if (!wacom->shared->stylus_in_proximity) /* first in prox */ |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1197 | /* Going into proximity select tool */ |
| 1198 | wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1199 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1200 | /* keep pen state for touch events */ |
| 1201 | wacom->shared->stylus_in_proximity = prox; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1202 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1203 | /* send pen events only when touch is up or forced out */ |
| 1204 | if (!wacom->shared->touch_down) { |
| 1205 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 1206 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
| 1207 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 1208 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
Jason Gerecke | 0b335ca | 2014-07-24 13:15:31 -0700 | [diff] [blame] | 1209 | input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x07) << 8) | data[6]); |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1210 | input_report_key(input, BTN_TOUCH, data[1] & 0x05); |
| 1211 | input_report_key(input, wacom->tool[0], prox); |
| 1212 | return 1; |
| 1213 | } |
| 1214 | |
| 1215 | return 0; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1216 | } |
| 1217 | |
| 1218 | static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) |
| 1219 | { |
Jason Gerecke | 74b6341 | 2014-04-19 13:50:22 -0700 | [diff] [blame] | 1220 | unsigned char *data = wacom->data; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1221 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 1222 | dev_dbg(wacom->input->dev.parent, |
| 1223 | "%s: received report #%d\n", __func__, data[0]); |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1224 | |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1225 | switch (len) { |
| 1226 | case WACOM_PKGLEN_TPC1FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1227 | return wacom_tpc_single_touch(wacom, len); |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1228 | |
| 1229 | case WACOM_PKGLEN_TPC2FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1230 | return wacom_tpc_mt_touch(wacom); |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1231 | |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 1232 | case WACOM_PKGLEN_PENABLED: |
| 1233 | return wacom_tpc_pen(wacom); |
| 1234 | |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1235 | default: |
| 1236 | switch (data[0]) { |
| 1237 | case WACOM_REPORT_TPC1FG: |
| 1238 | case WACOM_REPORT_TPCHID: |
| 1239 | case WACOM_REPORT_TPCST: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1240 | case WACOM_REPORT_TPC1FGE: |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1241 | return wacom_tpc_single_touch(wacom, len); |
| 1242 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1243 | case WACOM_REPORT_TPCMT: |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 1244 | case WACOM_REPORT_TPCMT2: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1245 | return wacom_mt_touch(wacom); |
| 1246 | |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1247 | case WACOM_REPORT_PENABLED: |
| 1248 | return wacom_tpc_pen(wacom); |
| 1249 | } |
| 1250 | } |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1251 | |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 1252 | return 0; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1253 | } |
| 1254 | |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1255 | static void wacom_map_usage(struct wacom *wacom, struct hid_usage *usage, |
| 1256 | struct hid_field *field, __u8 type, __u16 code, int fuzz) |
| 1257 | { |
| 1258 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1259 | struct input_dev *input = wacom_wac->input; |
| 1260 | int fmin = field->logical_minimum; |
| 1261 | int fmax = field->logical_maximum; |
| 1262 | |
| 1263 | usage->type = type; |
| 1264 | usage->code = code; |
| 1265 | |
| 1266 | set_bit(type, input->evbit); |
| 1267 | |
| 1268 | switch (type) { |
| 1269 | case EV_ABS: |
| 1270 | input_set_abs_params(input, code, fmin, fmax, fuzz, 0); |
| 1271 | input_abs_set_res(input, code, |
| 1272 | hidinput_calc_abs_res(field, code)); |
| 1273 | break; |
| 1274 | case EV_KEY: |
| 1275 | input_set_capability(input, EV_KEY, code); |
| 1276 | break; |
| 1277 | case EV_MSC: |
| 1278 | input_set_capability(input, EV_MSC, code); |
| 1279 | break; |
| 1280 | } |
| 1281 | } |
| 1282 | |
| 1283 | static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, |
| 1284 | struct hid_field *field, struct hid_usage *usage) |
| 1285 | { |
| 1286 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1287 | |
| 1288 | switch (usage->hid) { |
| 1289 | case HID_GD_X: |
| 1290 | wacom_map_usage(wacom, usage, field, EV_ABS, ABS_X, 4); |
| 1291 | break; |
| 1292 | case HID_GD_Y: |
| 1293 | wacom_map_usage(wacom, usage, field, EV_ABS, ABS_Y, 4); |
| 1294 | break; |
| 1295 | case HID_DG_TIPPRESSURE: |
| 1296 | wacom_map_usage(wacom, usage, field, EV_ABS, ABS_PRESSURE, 0); |
| 1297 | break; |
| 1298 | case HID_DG_INRANGE: |
| 1299 | wacom_map_usage(wacom, usage, field, EV_KEY, BTN_TOOL_PEN, 0); |
| 1300 | break; |
| 1301 | case HID_DG_INVERT: |
| 1302 | wacom_map_usage(wacom, usage, field, EV_KEY, |
| 1303 | BTN_TOOL_RUBBER, 0); |
| 1304 | break; |
| 1305 | case HID_DG_ERASER: |
| 1306 | case HID_DG_TIPSWITCH: |
| 1307 | wacom_map_usage(wacom, usage, field, EV_KEY, BTN_TOUCH, 0); |
| 1308 | break; |
| 1309 | case HID_DG_BARRELSWITCH: |
| 1310 | wacom_map_usage(wacom, usage, field, EV_KEY, BTN_STYLUS, 0); |
| 1311 | break; |
| 1312 | case HID_DG_BARRELSWITCH2: |
| 1313 | wacom_map_usage(wacom, usage, field, EV_KEY, BTN_STYLUS2, 0); |
| 1314 | break; |
| 1315 | case HID_DG_TOOLSERIALNUMBER: |
| 1316 | wacom_map_usage(wacom, usage, field, EV_MSC, MSC_SERIAL, 0); |
| 1317 | break; |
| 1318 | } |
| 1319 | } |
| 1320 | |
| 1321 | static int wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field, |
| 1322 | struct hid_usage *usage, __s32 value) |
| 1323 | { |
| 1324 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1325 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1326 | struct input_dev *input = wacom_wac->input; |
| 1327 | |
| 1328 | /* checking which Tool / tip switch to send */ |
| 1329 | switch (usage->hid) { |
| 1330 | case HID_DG_INRANGE: |
| 1331 | wacom_wac->hid_data.inrange_state = value; |
| 1332 | return 0; |
| 1333 | case HID_DG_INVERT: |
| 1334 | wacom_wac->hid_data.invert_state = value; |
| 1335 | return 0; |
| 1336 | case HID_DG_ERASER: |
| 1337 | case HID_DG_TIPSWITCH: |
| 1338 | wacom_wac->hid_data.tipswitch |= value; |
| 1339 | return 0; |
| 1340 | } |
| 1341 | |
| 1342 | /* send pen events only when touch is up or forced out */ |
| 1343 | if (!usage->type || wacom_wac->shared->touch_down) |
| 1344 | return 0; |
| 1345 | |
| 1346 | input_event(input, usage->type, usage->code, value); |
| 1347 | |
| 1348 | return 0; |
| 1349 | } |
| 1350 | |
| 1351 | static void wacom_wac_pen_report(struct hid_device *hdev, |
| 1352 | struct hid_report *report) |
| 1353 | { |
| 1354 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1355 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1356 | struct input_dev *input = wacom_wac->input; |
| 1357 | bool prox = wacom_wac->hid_data.inrange_state; |
| 1358 | |
| 1359 | if (!wacom_wac->shared->stylus_in_proximity) /* first in prox */ |
| 1360 | /* Going into proximity select tool */ |
| 1361 | wacom_wac->tool[0] = wacom_wac->hid_data.invert_state ? |
| 1362 | BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 1363 | |
| 1364 | /* keep pen state for touch events */ |
| 1365 | wacom_wac->shared->stylus_in_proximity = prox; |
| 1366 | |
| 1367 | /* send pen events only when touch is up or forced out */ |
| 1368 | if (!wacom_wac->shared->touch_down) { |
| 1369 | input_report_key(input, BTN_TOUCH, |
| 1370 | wacom_wac->hid_data.tipswitch); |
| 1371 | input_report_key(input, wacom_wac->tool[0], prox); |
| 1372 | |
| 1373 | wacom_wac->hid_data.tipswitch = false; |
| 1374 | |
| 1375 | input_sync(input); |
| 1376 | } |
| 1377 | } |
| 1378 | |
Benjamin Tissoires | 5ae6e89 | 2014-09-23 12:08:09 -0400 | [diff] [blame] | 1379 | static void wacom_wac_finger_usage_mapping(struct hid_device *hdev, |
| 1380 | struct hid_field *field, struct hid_usage *usage) |
| 1381 | { |
| 1382 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1383 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1384 | struct input_dev *input = wacom_wac->input; |
| 1385 | unsigned touch_max = wacom_wac->features.touch_max; |
| 1386 | |
| 1387 | switch (usage->hid) { |
| 1388 | case HID_GD_X: |
| 1389 | if (touch_max == 1) |
| 1390 | wacom_map_usage(wacom, usage, field, EV_ABS, ABS_X, 4); |
| 1391 | else |
| 1392 | wacom_map_usage(wacom, usage, field, EV_ABS, |
| 1393 | ABS_MT_POSITION_X, 4); |
| 1394 | break; |
| 1395 | case HID_GD_Y: |
| 1396 | if (touch_max == 1) |
| 1397 | wacom_map_usage(wacom, usage, field, EV_ABS, ABS_Y, 4); |
| 1398 | else |
| 1399 | wacom_map_usage(wacom, usage, field, EV_ABS, |
| 1400 | ABS_MT_POSITION_Y, 4); |
| 1401 | break; |
| 1402 | case HID_DG_CONTACTID: |
| 1403 | input_mt_init_slots(input, wacom_wac->features.touch_max, |
| 1404 | INPUT_MT_DIRECT); |
| 1405 | break; |
| 1406 | case HID_DG_INRANGE: |
| 1407 | break; |
| 1408 | case HID_DG_INVERT: |
| 1409 | break; |
| 1410 | case HID_DG_TIPSWITCH: |
| 1411 | wacom_map_usage(wacom, usage, field, EV_KEY, BTN_TOUCH, 0); |
| 1412 | break; |
| 1413 | } |
| 1414 | } |
| 1415 | |
| 1416 | static int wacom_wac_finger_event(struct hid_device *hdev, |
| 1417 | struct hid_field *field, struct hid_usage *usage, __s32 value) |
| 1418 | { |
| 1419 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1420 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1421 | |
| 1422 | switch (usage->hid) { |
| 1423 | case HID_GD_X: |
| 1424 | wacom_wac->hid_data.x = value; |
| 1425 | break; |
| 1426 | case HID_GD_Y: |
| 1427 | wacom_wac->hid_data.y = value; |
| 1428 | break; |
| 1429 | case HID_DG_CONTACTID: |
| 1430 | wacom_wac->hid_data.id = value; |
| 1431 | break; |
| 1432 | case HID_DG_TIPSWITCH: |
| 1433 | wacom_wac->hid_data.tipswitch = value; |
| 1434 | break; |
| 1435 | } |
| 1436 | |
| 1437 | |
| 1438 | return 0; |
| 1439 | } |
| 1440 | |
| 1441 | static void wacom_wac_finger_mt_report(struct wacom_wac *wacom_wac, |
| 1442 | struct input_dev *input, bool touch) |
| 1443 | { |
| 1444 | int slot; |
| 1445 | struct hid_data *hid_data = &wacom_wac->hid_data; |
| 1446 | |
| 1447 | slot = input_mt_get_slot_by_key(input, hid_data->id); |
| 1448 | |
| 1449 | input_mt_slot(input, slot); |
| 1450 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1451 | if (touch) { |
| 1452 | input_report_abs(input, ABS_MT_POSITION_X, hid_data->x); |
| 1453 | input_report_abs(input, ABS_MT_POSITION_Y, hid_data->y); |
| 1454 | } |
| 1455 | input_mt_sync_frame(input); |
| 1456 | } |
| 1457 | |
| 1458 | static void wacom_wac_finger_single_touch_report(struct wacom_wac *wacom_wac, |
| 1459 | struct input_dev *input, bool touch) |
| 1460 | { |
| 1461 | struct hid_data *hid_data = &wacom_wac->hid_data; |
| 1462 | |
| 1463 | if (touch) { |
| 1464 | input_report_abs(input, ABS_X, hid_data->x); |
| 1465 | input_report_abs(input, ABS_Y, hid_data->y); |
| 1466 | } |
| 1467 | input_report_key(input, BTN_TOUCH, touch); |
| 1468 | } |
| 1469 | |
| 1470 | static void wacom_wac_finger_report(struct hid_device *hdev, |
| 1471 | struct hid_report *report) |
| 1472 | { |
| 1473 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1474 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1475 | struct input_dev *input = wacom_wac->input; |
| 1476 | bool touch = wacom_wac->hid_data.tipswitch && |
| 1477 | !wacom_wac->shared->stylus_in_proximity; |
| 1478 | unsigned touch_max = wacom_wac->features.touch_max; |
| 1479 | |
| 1480 | if (touch_max > 1) |
| 1481 | wacom_wac_finger_mt_report(wacom_wac, input, touch); |
| 1482 | else |
| 1483 | wacom_wac_finger_single_touch_report(wacom_wac, input, touch); |
| 1484 | input_sync(input); |
| 1485 | |
| 1486 | /* keep touch state for pen event */ |
| 1487 | wacom_wac->shared->touch_down = touch; |
| 1488 | } |
| 1489 | |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1490 | #define WACOM_PEN_FIELD(f) (((f)->logical == HID_DG_STYLUS) || \ |
Jason Gerecke | c376e71 | 2014-11-24 15:32:12 -0800 | [diff] [blame] | 1491 | ((f)->physical == HID_DG_STYLUS) || \ |
| 1492 | ((f)->application == HID_DG_PEN)) |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1493 | #define WACOM_FINGER_FIELD(f) (((f)->logical == HID_DG_FINGER) || \ |
Jason Gerecke | c376e71 | 2014-11-24 15:32:12 -0800 | [diff] [blame] | 1494 | ((f)->physical == HID_DG_FINGER) || \ |
| 1495 | ((f)->application == HID_DG_TOUCHSCREEN)) |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1496 | |
| 1497 | void wacom_wac_usage_mapping(struct hid_device *hdev, |
| 1498 | struct hid_field *field, struct hid_usage *usage) |
| 1499 | { |
| 1500 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1501 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1502 | struct input_dev *input = wacom_wac->input; |
| 1503 | |
| 1504 | /* currently, only direct devices have proper hid report descriptors */ |
| 1505 | __set_bit(INPUT_PROP_DIRECT, input->propbit); |
| 1506 | |
| 1507 | if (WACOM_PEN_FIELD(field)) |
| 1508 | return wacom_wac_pen_usage_mapping(hdev, field, usage); |
Benjamin Tissoires | 5ae6e89 | 2014-09-23 12:08:09 -0400 | [diff] [blame] | 1509 | |
| 1510 | if (WACOM_FINGER_FIELD(field)) |
| 1511 | return wacom_wac_finger_usage_mapping(hdev, field, usage); |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1512 | } |
| 1513 | |
| 1514 | int wacom_wac_event(struct hid_device *hdev, struct hid_field *field, |
| 1515 | struct hid_usage *usage, __s32 value) |
| 1516 | { |
| 1517 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1518 | |
| 1519 | if (wacom->wacom_wac.features.type != HID_GENERIC) |
| 1520 | return 0; |
| 1521 | |
| 1522 | if (WACOM_PEN_FIELD(field)) |
| 1523 | return wacom_wac_pen_event(hdev, field, usage, value); |
| 1524 | |
Benjamin Tissoires | 5ae6e89 | 2014-09-23 12:08:09 -0400 | [diff] [blame] | 1525 | if (WACOM_FINGER_FIELD(field)) |
| 1526 | return wacom_wac_finger_event(hdev, field, usage, value); |
| 1527 | |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1528 | return 0; |
| 1529 | } |
| 1530 | |
| 1531 | void wacom_wac_report(struct hid_device *hdev, struct hid_report *report) |
| 1532 | { |
| 1533 | struct wacom *wacom = hid_get_drvdata(hdev); |
| 1534 | struct wacom_wac *wacom_wac = &wacom->wacom_wac; |
| 1535 | struct hid_field *field = report->field[0]; |
| 1536 | |
| 1537 | if (wacom_wac->features.type != HID_GENERIC) |
| 1538 | return; |
| 1539 | |
| 1540 | if (WACOM_PEN_FIELD(field)) |
| 1541 | return wacom_wac_pen_report(hdev, report); |
Benjamin Tissoires | 5ae6e89 | 2014-09-23 12:08:09 -0400 | [diff] [blame] | 1542 | |
| 1543 | if (WACOM_FINGER_FIELD(field)) |
| 1544 | return wacom_wac_finger_report(hdev, report); |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 1545 | } |
| 1546 | |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 1547 | static int wacom_bpt_touch(struct wacom_wac *wacom) |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1548 | { |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1549 | struct wacom_features *features = &wacom->features; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1550 | struct input_dev *input = wacom->input; |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 1551 | struct input_dev *pad_input = wacom->pad_input; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1552 | unsigned char *data = wacom->data; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1553 | int i; |
| 1554 | |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 1555 | if (data[0] != 0x02) |
| 1556 | return 0; |
| 1557 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1558 | for (i = 0; i < 2; i++) { |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 1559 | int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); |
| 1560 | bool touch = data[offset + 3] & 0x80; |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 1561 | |
Chris Bagwell | 33d5f71 | 2010-09-12 00:12:28 -0700 | [diff] [blame] | 1562 | /* |
| 1563 | * Touch events need to be disabled while stylus is |
| 1564 | * in proximity because user's hand is resting on touchpad |
| 1565 | * and sending unwanted events. User expects tablet buttons |
| 1566 | * to continue working though. |
| 1567 | */ |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 1568 | touch = touch && !wacom->shared->stylus_in_proximity; |
| 1569 | |
| 1570 | input_mt_slot(input, i); |
| 1571 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 1572 | if (touch) { |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 1573 | int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff; |
| 1574 | int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff; |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1575 | if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { |
| 1576 | x <<= 5; |
| 1577 | y <<= 5; |
| 1578 | } |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1579 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1580 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1581 | } |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1582 | } |
| 1583 | |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 1584 | input_mt_report_pointer_emulation(input, true); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1585 | |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 1586 | input_report_key(pad_input, BTN_LEFT, (data[1] & 0x08) != 0); |
| 1587 | input_report_key(pad_input, BTN_FORWARD, (data[1] & 0x04) != 0); |
| 1588 | input_report_key(pad_input, BTN_BACK, (data[1] & 0x02) != 0); |
| 1589 | input_report_key(pad_input, BTN_RIGHT, (data[1] & 0x01) != 0); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1590 | |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 1591 | return 1; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1592 | } |
| 1593 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1594 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) |
| 1595 | { |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1596 | struct wacom_features *features = &wacom->features; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1597 | struct input_dev *input = wacom->input; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1598 | bool touch = data[1] & 0x80; |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 1599 | int slot = input_mt_get_slot_by_key(input, data[0]); |
| 1600 | |
| 1601 | if (slot < 0) |
| 1602 | return; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1603 | |
| 1604 | touch = touch && !wacom->shared->stylus_in_proximity; |
| 1605 | |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 1606 | input_mt_slot(input, slot); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1607 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1608 | |
| 1609 | if (touch) { |
| 1610 | int x = (data[2] << 4) | (data[4] >> 4); |
| 1611 | int y = (data[3] << 4) | (data[4] & 0x0f); |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1612 | int width, height; |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 1613 | |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1614 | if (features->type >= INTUOSPS && features->type <= INTUOSPL) { |
Jason Gerecke | 0b279da | 2013-11-25 18:43:16 -0800 | [diff] [blame] | 1615 | width = data[5] * 100; |
| 1616 | height = data[6] * 100; |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1617 | } else { |
| 1618 | /* |
| 1619 | * "a" is a scaled-down area which we assume is |
| 1620 | * roughly circular and which can be described as: |
| 1621 | * a=(pi*r^2)/C. |
| 1622 | */ |
| 1623 | int a = data[5]; |
Ping Cheng | d7da3a3 | 2014-06-13 13:37:33 -0700 | [diff] [blame] | 1624 | int x_res = input_abs_get_res(input, ABS_MT_POSITION_X); |
| 1625 | int y_res = input_abs_get_res(input, ABS_MT_POSITION_Y); |
| 1626 | width = 2 * int_sqrt(a * WACOM_CONTACT_AREA_SCALE); |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1627 | height = width * y_res / x_res; |
| 1628 | } |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1629 | |
| 1630 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1631 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 1632 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, width); |
| 1633 | input_report_abs(input, ABS_MT_TOUCH_MINOR, height); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1634 | } |
| 1635 | } |
| 1636 | |
| 1637 | static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) |
| 1638 | { |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 1639 | struct input_dev *input = wacom->pad_input; |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 1640 | struct wacom_features *features = &wacom->features; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1641 | |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 1642 | if (features->type == INTUOSHT) { |
| 1643 | input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0); |
| 1644 | input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0); |
| 1645 | } else { |
| 1646 | input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); |
| 1647 | input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); |
| 1648 | } |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1649 | input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1650 | input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); |
| 1651 | } |
| 1652 | |
| 1653 | static int wacom_bpt3_touch(struct wacom_wac *wacom) |
| 1654 | { |
| 1655 | struct input_dev *input = wacom->input; |
| 1656 | unsigned char *data = wacom->data; |
Jason Gerecke | 19d57d3 | 2012-03-06 10:19:19 -0800 | [diff] [blame] | 1657 | int count = data[1] & 0x07; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1658 | int i; |
| 1659 | |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 1660 | if (data[0] != 0x02) |
| 1661 | return 0; |
| 1662 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1663 | /* data has up to 7 fixed sized 8-byte messages starting at data[2] */ |
| 1664 | for (i = 0; i < count; i++) { |
| 1665 | int offset = (8 * i) + 2; |
| 1666 | int msg_id = data[offset]; |
| 1667 | |
| 1668 | if (msg_id >= 2 && msg_id <= 17) |
| 1669 | wacom_bpt3_touch_msg(wacom, data + offset); |
| 1670 | else if (msg_id == 128) |
| 1671 | wacom_bpt3_button_msg(wacom, data + offset); |
| 1672 | |
| 1673 | } |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1674 | input_mt_report_pointer_emulation(input, true); |
| 1675 | |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 1676 | return 1; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1677 | } |
| 1678 | |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1679 | static int wacom_bpt_pen(struct wacom_wac *wacom) |
| 1680 | { |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1681 | struct wacom_features *features = &wacom->features; |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1682 | struct input_dev *input = wacom->input; |
| 1683 | unsigned char *data = wacom->data; |
| 1684 | int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; |
| 1685 | |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1686 | if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_USB) |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 1687 | return 0; |
| 1688 | |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1689 | if (data[0] == WACOM_REPORT_USB) { |
Ping Cheng | 44b9683 | 2014-11-06 17:30:51 -0800 | [diff] [blame] | 1690 | if (features->type == INTUOSHT && |
| 1691 | wacom->shared->touch_input && |
| 1692 | features->touch_max) { |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1693 | input_report_switch(wacom->shared->touch_input, |
| 1694 | SW_MUTE_DEVICE, data[8] & 0x40); |
| 1695 | input_sync(wacom->shared->touch_input); |
| 1696 | } |
| 1697 | return 0; |
| 1698 | } |
| 1699 | |
Chris Bagwell | c598141 | 2011-10-26 22:28:34 -0700 | [diff] [blame] | 1700 | prox = (data[1] & 0x20) == 0x20; |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1701 | |
| 1702 | /* |
| 1703 | * All reports shared between PEN and RUBBER tool must be |
| 1704 | * forced to a known starting value (zero) when transitioning to |
| 1705 | * out-of-prox. |
| 1706 | * |
| 1707 | * If not reset then, to userspace, it will look like lost events |
| 1708 | * if new tool comes in-prox with same values as previous tool sent. |
| 1709 | * |
| 1710 | * Hardware does report zero in most out-of-prox cases but not all. |
| 1711 | */ |
| 1712 | if (prox) { |
| 1713 | if (!wacom->shared->stylus_in_proximity) { |
| 1714 | if (data[1] & 0x08) { |
| 1715 | wacom->tool[0] = BTN_TOOL_RUBBER; |
| 1716 | wacom->id[0] = ERASER_DEVICE_ID; |
| 1717 | } else { |
| 1718 | wacom->tool[0] = BTN_TOOL_PEN; |
| 1719 | wacom->id[0] = STYLUS_DEVICE_ID; |
| 1720 | } |
| 1721 | wacom->shared->stylus_in_proximity = true; |
| 1722 | } |
| 1723 | x = le16_to_cpup((__le16 *)&data[2]); |
| 1724 | y = le16_to_cpup((__le16 *)&data[4]); |
| 1725 | p = le16_to_cpup((__le16 *)&data[6]); |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1726 | /* |
| 1727 | * Convert distance from out prox to distance from tablet. |
| 1728 | * distance will be greater than distance_max once |
| 1729 | * touching and applying pressure; do not report negative |
| 1730 | * distance. |
| 1731 | */ |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1732 | if (data[8] <= features->distance_max) |
| 1733 | d = features->distance_max - data[8]; |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1734 | |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1735 | pen = data[1] & 0x01; |
| 1736 | btn1 = data[1] & 0x02; |
| 1737 | btn2 = data[1] & 0x04; |
| 1738 | } |
| 1739 | |
| 1740 | input_report_key(input, BTN_TOUCH, pen); |
| 1741 | input_report_key(input, BTN_STYLUS, btn1); |
| 1742 | input_report_key(input, BTN_STYLUS2, btn2); |
| 1743 | |
| 1744 | input_report_abs(input, ABS_X, x); |
| 1745 | input_report_abs(input, ABS_Y, y); |
| 1746 | input_report_abs(input, ABS_PRESSURE, p); |
| 1747 | input_report_abs(input, ABS_DISTANCE, d); |
| 1748 | |
| 1749 | if (!prox) { |
| 1750 | wacom->id[0] = 0; |
| 1751 | wacom->shared->stylus_in_proximity = false; |
| 1752 | } |
| 1753 | |
| 1754 | input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */ |
| 1755 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */ |
| 1756 | |
| 1757 | return 1; |
| 1758 | } |
| 1759 | |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 1760 | static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) |
| 1761 | { |
| 1762 | if (len == WACOM_PKGLEN_BBTOUCH) |
| 1763 | return wacom_bpt_touch(wacom); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1764 | else if (len == WACOM_PKGLEN_BBTOUCH3) |
| 1765 | return wacom_bpt3_touch(wacom); |
| 1766 | else if (len == WACOM_PKGLEN_BBFUN || len == WACOM_PKGLEN_BBPEN) |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1767 | return wacom_bpt_pen(wacom); |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 1768 | |
| 1769 | return 0; |
| 1770 | } |
| 1771 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1772 | static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) |
| 1773 | { |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1774 | unsigned char *data = wacom->data; |
| 1775 | int connected; |
| 1776 | |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 1777 | if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL) |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1778 | return 0; |
| 1779 | |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1780 | connected = data[1] & 0x01; |
| 1781 | if (connected) { |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1782 | int pid, battery, ps_connected; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1783 | |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1784 | if ((wacom->shared->type == INTUOSHT) && |
Ping Cheng | 44b9683 | 2014-11-06 17:30:51 -0800 | [diff] [blame] | 1785 | wacom->shared->touch_input && |
| 1786 | wacom->shared->touch_max) { |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 1787 | input_report_switch(wacom->shared->touch_input, |
| 1788 | SW_MUTE_DEVICE, data[5] & 0x40); |
| 1789 | input_sync(wacom->shared->touch_input); |
| 1790 | } |
| 1791 | |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1792 | pid = get_unaligned_be16(&data[6]); |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1793 | battery = (data[5] & 0x3f) * 100 / 31; |
| 1794 | ps_connected = !!(data[5] & 0x80); |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1795 | if (wacom->pid != pid) { |
| 1796 | wacom->pid = pid; |
| 1797 | wacom_schedule_work(wacom); |
| 1798 | } |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1799 | |
| 1800 | if (wacom->shared->type && |
| 1801 | (battery != wacom->battery_capacity || |
| 1802 | ps_connected != wacom->ps_connected)) { |
| 1803 | wacom->battery_capacity = battery; |
| 1804 | wacom->ps_connected = ps_connected; |
| 1805 | wacom->bat_charging = ps_connected && |
| 1806 | wacom->battery_capacity < 100; |
| 1807 | wacom_notify_battery(wacom); |
| 1808 | } |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1809 | } else if (wacom->pid != 0) { |
| 1810 | /* disconnected while previously connected */ |
| 1811 | wacom->pid = 0; |
| 1812 | wacom_schedule_work(wacom); |
Chris Bagwell | a1d552c | 2012-03-25 23:26:30 -0700 | [diff] [blame] | 1813 | wacom->battery_capacity = 0; |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1814 | wacom->bat_charging = 0; |
| 1815 | wacom->ps_connected = 0; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1816 | } |
| 1817 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1818 | return 0; |
| 1819 | } |
| 1820 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1821 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1822 | { |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1823 | bool sync; |
| 1824 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 1825 | switch (wacom_wac->features.type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1826 | case PENPARTNER: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1827 | sync = wacom_penpartner_irq(wacom_wac); |
| 1828 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1829 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1830 | case PL: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1831 | sync = wacom_pl_irq(wacom_wac); |
| 1832 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1833 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1834 | case WACOM_G4: |
| 1835 | case GRAPHIRE: |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 1836 | case GRAPHIRE_BT: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1837 | case WACOM_MO: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1838 | sync = wacom_graphire_irq(wacom_wac); |
| 1839 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1840 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1841 | case PTU: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1842 | sync = wacom_ptu_irq(wacom_wac); |
| 1843 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1844 | |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 1845 | case DTU: |
| 1846 | sync = wacom_dtu_irq(wacom_wac); |
| 1847 | break; |
| 1848 | |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 1849 | case DTUS: |
Ping Cheng | fff00bf | 2014-12-04 18:23:04 -0800 | [diff] [blame^] | 1850 | case DTUSX: |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 1851 | sync = wacom_dtus_irq(wacom_wac); |
| 1852 | break; |
| 1853 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1854 | case INTUOS: |
| 1855 | case INTUOS3S: |
| 1856 | case INTUOS3: |
| 1857 | case INTUOS3L: |
| 1858 | case INTUOS4S: |
| 1859 | case INTUOS4: |
| 1860 | case INTUOS4L: |
| 1861 | case CINTIQ: |
| 1862 | case WACOM_BEE: |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 1863 | case WACOM_13HD: |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 1864 | case WACOM_21UX2: |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 1865 | case WACOM_22HD: |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 1866 | case WACOM_24HD: |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 1867 | case DTK: |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 1868 | case CINTIQ_HYBRID: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1869 | sync = wacom_intuos_irq(wacom_wac); |
| 1870 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1871 | |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 1872 | case INTUOS4WL: |
| 1873 | sync = wacom_intuos_bt_irq(wacom_wac, len); |
| 1874 | break; |
| 1875 | |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 1876 | case WACOM_24HDT: |
| 1877 | sync = wacom_24hdt_irq(wacom_wac); |
| 1878 | break; |
| 1879 | |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 1880 | case INTUOS5S: |
| 1881 | case INTUOS5: |
| 1882 | case INTUOS5L: |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 1883 | case INTUOSPS: |
| 1884 | case INTUOSPM: |
| 1885 | case INTUOSPL: |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 1886 | if (len == WACOM_PKGLEN_BBTOUCH3) |
| 1887 | sync = wacom_bpt3_touch(wacom_wac); |
| 1888 | else |
| 1889 | sync = wacom_intuos_irq(wacom_wac); |
| 1890 | break; |
| 1891 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1892 | case TABLETPC: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1893 | case TABLETPCE: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1894 | case TABLETPC2FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1895 | case MTSCREEN: |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 1896 | case MTTPC: |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 1897 | case MTTPC_B: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1898 | sync = wacom_tpc_irq(wacom_wac, len); |
| 1899 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1900 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1901 | case BAMBOO_PT: |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 1902 | case INTUOSHT: |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1903 | sync = wacom_bpt_irq(wacom_wac, len); |
| 1904 | break; |
| 1905 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1906 | case WIRELESS: |
| 1907 | sync = wacom_wireless_irq(wacom_wac, len); |
| 1908 | break; |
| 1909 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1910 | default: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1911 | sync = false; |
| 1912 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1913 | } |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1914 | |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 1915 | if (sync) { |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1916 | input_sync(wacom_wac->input); |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 1917 | if (wacom_wac->pad_input) |
| 1918 | input_sync(wacom_wac->pad_input); |
| 1919 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1920 | } |
| 1921 | |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1922 | static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1923 | { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1924 | struct input_dev *input_dev = wacom_wac->input; |
| 1925 | |
| 1926 | input_set_capability(input_dev, EV_MSC, MSC_SERIAL); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1927 | |
| 1928 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1929 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1930 | __set_bit(BTN_TOOL_BRUSH, input_dev->keybit); |
| 1931 | __set_bit(BTN_TOOL_PENCIL, input_dev->keybit); |
| 1932 | __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1933 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 1934 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
| 1935 | |
| 1936 | input_set_abs_params(input_dev, ABS_DISTANCE, |
| 1937 | 0, wacom_wac->features.distance_max, 0, 0); |
| 1938 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); |
Jason Gerecke | ec5fc1c | 2014-11-18 16:50:08 -0800 | [diff] [blame] | 1939 | input_set_abs_params(input_dev, ABS_TILT_X, -64, 63, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 1940 | input_abs_set_res(input_dev, ABS_TILT_X, 57); |
Jason Gerecke | ec5fc1c | 2014-11-18 16:50:08 -0800 | [diff] [blame] | 1941 | input_set_abs_params(input_dev, ABS_TILT_Y, -64, 63, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 1942 | input_abs_set_res(input_dev, ABS_TILT_Y, 57); |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1943 | } |
| 1944 | |
| 1945 | static void wacom_setup_intuos(struct wacom_wac *wacom_wac) |
| 1946 | { |
| 1947 | struct input_dev *input_dev = wacom_wac->input; |
| 1948 | |
| 1949 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 1950 | |
| 1951 | wacom_setup_cintiq(wacom_wac); |
| 1952 | |
| 1953 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 1954 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 1955 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
| 1956 | __set_bit(BTN_SIDE, input_dev->keybit); |
| 1957 | __set_bit(BTN_EXTRA, input_dev->keybit); |
| 1958 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); |
| 1959 | __set_bit(BTN_TOOL_LENS, input_dev->keybit); |
| 1960 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1961 | input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 1962 | input_abs_set_res(input_dev, ABS_RZ, 287); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1963 | input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); |
| 1964 | } |
| 1965 | |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1966 | void wacom_setup_device_quirks(struct wacom_features *features) |
| 1967 | { |
| 1968 | |
| 1969 | /* touch device found but size is not defined. use default */ |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1970 | if (features->device_type == BTN_TOOL_FINGER && !features->x_max) { |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1971 | features->x_max = 1023; |
| 1972 | features->y_max = 1023; |
| 1973 | } |
| 1974 | |
| 1975 | /* these device have multiple inputs */ |
Ping Cheng | ea2e602 | 2012-06-12 00:14:12 -0700 | [diff] [blame] | 1976 | if (features->type >= WIRELESS || |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 1977 | (features->type >= INTUOS5S && features->type <= INTUOSHT) || |
Jason Gerecke | aea2bf6 | 2012-10-21 00:38:03 -0700 | [diff] [blame] | 1978 | (features->oVid && features->oPid)) |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1979 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1980 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1981 | /* quirk for bamboo touch with 2 low res touches */ |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1982 | if (features->type == BAMBOO_PT && |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1983 | features->pktlen == WACOM_PKGLEN_BBTOUCH) { |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1984 | features->x_max <<= 5; |
| 1985 | features->y_max <<= 5; |
| 1986 | features->x_fuzz <<= 5; |
| 1987 | features->y_fuzz <<= 5; |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1988 | features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1989 | } |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1990 | |
| 1991 | if (features->type == WIRELESS) { |
| 1992 | |
| 1993 | /* monitor never has input and pen/touch have delayed create */ |
| 1994 | features->quirks |= WACOM_QUIRK_NO_INPUT; |
| 1995 | |
| 1996 | /* must be monitor interface if no device_type set */ |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1997 | if (!features->device_type) { |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1998 | features->quirks |= WACOM_QUIRK_MONITOR; |
Benjamin Tissoires | ac8d101 | 2014-07-25 17:29:48 -0700 | [diff] [blame] | 1999 | features->quirks |= WACOM_QUIRK_BATTERY; |
| 2000 | } |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 2001 | } |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 2002 | } |
| 2003 | |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2004 | static void wacom_abs_set_axis(struct input_dev *input_dev, |
| 2005 | struct wacom_wac *wacom_wac) |
| 2006 | { |
| 2007 | struct wacom_features *features = &wacom_wac->features; |
| 2008 | |
| 2009 | if (features->device_type == BTN_TOOL_PEN) { |
Ping Cheng | ac414da | 2014-05-29 00:08:41 -0700 | [diff] [blame] | 2010 | input_set_abs_params(input_dev, ABS_X, features->x_min, |
| 2011 | features->x_max, features->x_fuzz, 0); |
| 2012 | input_set_abs_params(input_dev, ABS_Y, features->y_min, |
| 2013 | features->y_max, features->y_fuzz, 0); |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2014 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, |
| 2015 | features->pressure_max, features->pressure_fuzz, 0); |
| 2016 | |
| 2017 | /* penabled devices have fixed resolution for each model */ |
| 2018 | input_abs_set_res(input_dev, ABS_X, features->x_resolution); |
| 2019 | input_abs_set_res(input_dev, ABS_Y, features->y_resolution); |
| 2020 | } else { |
Ping Cheng | d7da3a3 | 2014-06-13 13:37:33 -0700 | [diff] [blame] | 2021 | if (features->touch_max == 1) { |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2022 | input_set_abs_params(input_dev, ABS_X, 0, |
| 2023 | features->x_max, features->x_fuzz, 0); |
| 2024 | input_set_abs_params(input_dev, ABS_Y, 0, |
| 2025 | features->y_max, features->y_fuzz, 0); |
| 2026 | input_abs_set_res(input_dev, ABS_X, |
Ping Cheng | 401d7d1 | 2013-07-28 00:38:54 -0700 | [diff] [blame] | 2027 | features->x_resolution); |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2028 | input_abs_set_res(input_dev, ABS_Y, |
Ping Cheng | 401d7d1 | 2013-07-28 00:38:54 -0700 | [diff] [blame] | 2029 | features->y_resolution); |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2030 | } |
| 2031 | |
| 2032 | if (features->touch_max > 1) { |
| 2033 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, |
| 2034 | features->x_max, features->x_fuzz, 0); |
| 2035 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, |
| 2036 | features->y_max, features->y_fuzz, 0); |
| 2037 | input_abs_set_res(input_dev, ABS_MT_POSITION_X, |
Ping Cheng | 401d7d1 | 2013-07-28 00:38:54 -0700 | [diff] [blame] | 2038 | features->x_resolution); |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2039 | input_abs_set_res(input_dev, ABS_MT_POSITION_Y, |
Ping Cheng | 401d7d1 | 2013-07-28 00:38:54 -0700 | [diff] [blame] | 2040 | features->y_resolution); |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2041 | } |
| 2042 | } |
| 2043 | } |
| 2044 | |
Ping Cheng | 30ebc1a | 2014-11-18 13:29:16 -0800 | [diff] [blame] | 2045 | int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev, |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 2046 | struct wacom_wac *wacom_wac) |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2047 | { |
| 2048 | struct wacom_features *features = &wacom_wac->features; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2049 | |
| 2050 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
| 2051 | |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 2052 | if (features->type == HID_GENERIC) |
| 2053 | /* setup has already been done */ |
| 2054 | return 0; |
| 2055 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2056 | __set_bit(BTN_TOUCH, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2057 | __set_bit(ABS_MISC, input_dev->absbit); |
| 2058 | |
Ping Cheng | 8c0e0a4 | 2013-01-04 23:53:52 -0800 | [diff] [blame] | 2059 | wacom_abs_set_axis(input_dev, wacom_wac); |
| 2060 | |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 2061 | switch (features->type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2062 | case WACOM_MO: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2063 | case WACOM_G4: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2064 | /* fall through */ |
| 2065 | |
| 2066 | case GRAPHIRE: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2067 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 2068 | |
| 2069 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 2070 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 2071 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
| 2072 | |
| 2073 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 2074 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| 2075 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); |
| 2076 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2077 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2078 | |
| 2079 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2080 | break; |
| 2081 | |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 2082 | case GRAPHIRE_BT: |
| 2083 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 2084 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
| 2085 | features->distance_max, |
| 2086 | 0, 0); |
| 2087 | |
| 2088 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 2089 | |
| 2090 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 2091 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 2092 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
| 2093 | |
| 2094 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 2095 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| 2096 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); |
| 2097 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2098 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
| 2099 | |
| 2100 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 2101 | break; |
| 2102 | |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 2103 | case WACOM_24HD: |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 2104 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2105 | input_abs_set_res(input_dev, ABS_Z, 287); |
Ping Cheng | c73a1af | 2013-05-14 23:34:53 -0700 | [diff] [blame] | 2106 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 2107 | /* fall through */ |
| 2108 | |
| 2109 | case DTK: |
Jason Gerecke | 88fd449 | 2012-10-24 23:53:02 -0700 | [diff] [blame] | 2110 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2111 | |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 2112 | wacom_setup_cintiq(wacom_wac); |
| 2113 | break; |
| 2114 | |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 2115 | case WACOM_22HD: |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 2116 | case WACOM_21UX2: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2117 | case WACOM_BEE: |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 2118 | case CINTIQ: |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 2119 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2120 | input_abs_set_res(input_dev, ABS_Z, 287); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2121 | |
| 2122 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2123 | |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 2124 | wacom_setup_cintiq(wacom_wac); |
| 2125 | break; |
| 2126 | |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2127 | case WACOM_13HD: |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2128 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2129 | input_abs_set_res(input_dev, ABS_Z, 287); |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2130 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2131 | wacom_setup_cintiq(wacom_wac); |
| 2132 | break; |
| 2133 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2134 | case INTUOS3: |
| 2135 | case INTUOS3L: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2136 | case INTUOS3S: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2137 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2138 | input_abs_set_res(input_dev, ABS_Z, 287); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2139 | /* fall through */ |
| 2140 | |
| 2141 | case INTUOS: |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2142 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 2143 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2144 | wacom_setup_intuos(wacom_wac); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2145 | break; |
| 2146 | |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2147 | case INTUOS5: |
| 2148 | case INTUOS5L: |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 2149 | case INTUOSPM: |
| 2150 | case INTUOSPL: |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2151 | case INTUOS5S: |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 2152 | case INTUOSPS: |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2153 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 2154 | |
| 2155 | if (features->device_type == BTN_TOOL_PEN) { |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2156 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
| 2157 | features->distance_max, |
| 2158 | 0, 0); |
| 2159 | |
| 2160 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2161 | input_abs_set_res(input_dev, ABS_Z, 287); |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2162 | |
| 2163 | wacom_setup_intuos(wacom_wac); |
| 2164 | } else if (features->device_type == BTN_TOOL_FINGER) { |
| 2165 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 2166 | |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2167 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 2168 | 0, features->x_max, 0, 0); |
| 2169 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MINOR, |
| 2170 | 0, features->y_max, 0, 0); |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 2171 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_POINTER); |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 2172 | } |
| 2173 | break; |
| 2174 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2175 | case INTUOS4: |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 2176 | case INTUOS4WL: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2177 | case INTUOS4L: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2178 | case INTUOS4S: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2179 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2180 | input_abs_set_res(input_dev, ABS_Z, 287); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2181 | wacom_setup_intuos(wacom_wac); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2182 | |
| 2183 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2184 | break; |
| 2185 | |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 2186 | case WACOM_24HDT: |
| 2187 | if (features->device_type == BTN_TOOL_FINGER) { |
| 2188 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0); |
| 2189 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, features->x_max, 0, 0); |
| 2190 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, 0, features->y_max, 0, 0); |
| 2191 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0); |
| 2192 | } |
| 2193 | /* fall through */ |
| 2194 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 2195 | case MTSCREEN: |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 2196 | case MTTPC: |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 2197 | case MTTPC_B: |
Ping Cheng | 6795a52 | 2012-06-28 16:49:00 -0700 | [diff] [blame] | 2198 | case TABLETPC2FG: |
Ping Cheng | d7da3a3 | 2014-06-13 13:37:33 -0700 | [diff] [blame] | 2199 | if (features->device_type == BTN_TOOL_FINGER && features->touch_max > 1) |
| 2200 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_DIRECT); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2201 | /* fall through */ |
| 2202 | |
| 2203 | case TABLETPC: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 2204 | case TABLETPCE: |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 2205 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 2206 | |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2207 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2208 | |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 2209 | if (features->device_type != BTN_TOOL_PEN) |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2210 | break; /* no need to process stylus stuff */ |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 2211 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2212 | /* fall through */ |
| 2213 | |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 2214 | case DTUS: |
Ping Cheng | fff00bf | 2014-12-04 18:23:04 -0800 | [diff] [blame^] | 2215 | case DTUSX: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2216 | case PL: |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 2217 | case DTU: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2218 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2219 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2220 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2221 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2222 | |
| 2223 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2224 | break; |
| 2225 | |
| 2226 | case PTU: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2227 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
| 2228 | /* fall through */ |
| 2229 | |
| 2230 | case PENPARTNER: |
Jason Gerecke | 1fab84a | 2011-08-26 23:18:22 -0700 | [diff] [blame] | 2231 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2232 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
Jason Gerecke | 1fab84a | 2011-08-26 23:18:22 -0700 | [diff] [blame] | 2233 | __set_bit(BTN_STYLUS, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 2234 | |
| 2235 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 2236 | break; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 2237 | |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2238 | case INTUOSHT: |
Ping Cheng | 961794a | 2013-12-05 12:54:53 -0800 | [diff] [blame] | 2239 | if (features->touch_max && |
| 2240 | features->device_type == BTN_TOOL_FINGER) { |
| 2241 | input_dev->evbit[0] |= BIT_MASK(EV_SW); |
| 2242 | __set_bit(SW_MUTE_DEVICE, input_dev->swbit); |
| 2243 | } |
| 2244 | /* fall through */ |
| 2245 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 2246 | case BAMBOO_PT: |
| 2247 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 2248 | |
Ping Cheng | 8b4a0c1 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 2249 | if (features->device_type == BTN_TOOL_FINGER) { |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 2250 | |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2251 | if (features->touch_max) { |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2252 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { |
| 2253 | input_set_abs_params(input_dev, |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2254 | ABS_MT_TOUCH_MAJOR, |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 2255 | 0, features->x_max, 0, 0); |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2256 | input_set_abs_params(input_dev, |
Jason Gerecke | 4e90495 | 2012-10-03 17:19:11 -0700 | [diff] [blame] | 2257 | ABS_MT_TOUCH_MINOR, |
| 2258 | 0, features->y_max, 0, 0); |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2259 | } |
Ping Cheng | d7da3a3 | 2014-06-13 13:37:33 -0700 | [diff] [blame] | 2260 | input_mt_init_slots(input_dev, features->touch_max, INPUT_MT_POINTER); |
Ping Cheng | 02295e6 | 2013-01-04 23:56:00 -0800 | [diff] [blame] | 2261 | } else { |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2262 | /* buttons/keys only interface */ |
| 2263 | __clear_bit(ABS_X, input_dev->absbit); |
| 2264 | __clear_bit(ABS_Y, input_dev->absbit); |
| 2265 | __clear_bit(BTN_TOUCH, input_dev->keybit); |
Ping Cheng | 30ebc1a | 2014-11-18 13:29:16 -0800 | [diff] [blame] | 2266 | |
| 2267 | /* PAD is setup by wacom_setup_pad_input_capabilities later */ |
| 2268 | return 1; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2269 | } |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 2270 | } else if (features->device_type == BTN_TOOL_PEN) { |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2271 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 2272 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 2273 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| 2274 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2275 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 2276 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
| 2277 | features->distance_max, |
| 2278 | 0, 0); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 2279 | } |
| 2280 | break; |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 2281 | |
| 2282 | case CINTIQ_HYBRID: |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 2283 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 26fe412 | 2014-11-18 16:50:09 -0800 | [diff] [blame] | 2284 | input_abs_set_res(input_dev, ABS_Z, 287); |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 2285 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 2286 | |
| 2287 | wacom_setup_cintiq(wacom_wac); |
| 2288 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 2289 | } |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 2290 | return 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 2291 | } |
| 2292 | |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 2293 | int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, |
| 2294 | struct wacom_wac *wacom_wac) |
| 2295 | { |
| 2296 | struct wacom_features *features = &wacom_wac->features; |
Benjamin Tissoires | 10059cdc | 2014-07-24 12:49:08 -0700 | [diff] [blame] | 2297 | int i; |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 2298 | |
| 2299 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
| 2300 | |
| 2301 | /* kept for making legacy xf86-input-wacom working with the wheels */ |
| 2302 | __set_bit(ABS_MISC, input_dev->absbit); |
| 2303 | |
| 2304 | /* kept for making legacy xf86-input-wacom accepting the pad */ |
| 2305 | input_set_abs_params(input_dev, ABS_X, 0, 1, 0, 0); |
| 2306 | input_set_abs_params(input_dev, ABS_Y, 0, 1, 0, 0); |
| 2307 | |
Benjamin Tissoires | 12969e3 | 2014-09-11 13:14:04 -0400 | [diff] [blame] | 2308 | /* kept for making udev and libwacom accepting the pad */ |
| 2309 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2310 | |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 2311 | switch (features->type) { |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 2312 | case GRAPHIRE_BT: |
| 2313 | __set_bit(BTN_0, input_dev->keybit); |
| 2314 | __set_bit(BTN_1, input_dev->keybit); |
| 2315 | break; |
| 2316 | |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 2317 | case WACOM_MO: |
| 2318 | __set_bit(BTN_BACK, input_dev->keybit); |
| 2319 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 2320 | __set_bit(BTN_FORWARD, input_dev->keybit); |
| 2321 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 2322 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 2323 | break; |
| 2324 | |
| 2325 | case WACOM_G4: |
| 2326 | __set_bit(BTN_BACK, input_dev->keybit); |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 2327 | __set_bit(BTN_FORWARD, input_dev->keybit); |
Benjamin Tissoires | 3813810 | 2014-07-24 12:51:03 -0700 | [diff] [blame] | 2328 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 2329 | break; |
| 2330 | |
Benjamin Tissoires | 10059cdc | 2014-07-24 12:49:08 -0700 | [diff] [blame] | 2331 | case WACOM_24HD: |
| 2332 | __set_bit(BTN_A, input_dev->keybit); |
| 2333 | __set_bit(BTN_B, input_dev->keybit); |
| 2334 | __set_bit(BTN_C, input_dev->keybit); |
| 2335 | __set_bit(BTN_X, input_dev->keybit); |
| 2336 | __set_bit(BTN_Y, input_dev->keybit); |
| 2337 | __set_bit(BTN_Z, input_dev->keybit); |
| 2338 | |
| 2339 | for (i = 0; i < 10; i++) |
| 2340 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2341 | |
| 2342 | __set_bit(KEY_PROG1, input_dev->keybit); |
| 2343 | __set_bit(KEY_PROG2, input_dev->keybit); |
| 2344 | __set_bit(KEY_PROG3, input_dev->keybit); |
| 2345 | |
| 2346 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 2347 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); |
| 2348 | break; |
| 2349 | |
| 2350 | case DTK: |
| 2351 | for (i = 0; i < 6; i++) |
| 2352 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2353 | |
| 2354 | break; |
| 2355 | |
| 2356 | case WACOM_22HD: |
| 2357 | __set_bit(KEY_PROG1, input_dev->keybit); |
| 2358 | __set_bit(KEY_PROG2, input_dev->keybit); |
| 2359 | __set_bit(KEY_PROG3, input_dev->keybit); |
| 2360 | /* fall through */ |
| 2361 | |
| 2362 | case WACOM_21UX2: |
| 2363 | __set_bit(BTN_A, input_dev->keybit); |
| 2364 | __set_bit(BTN_B, input_dev->keybit); |
| 2365 | __set_bit(BTN_C, input_dev->keybit); |
| 2366 | __set_bit(BTN_X, input_dev->keybit); |
| 2367 | __set_bit(BTN_Y, input_dev->keybit); |
| 2368 | __set_bit(BTN_Z, input_dev->keybit); |
| 2369 | __set_bit(BTN_BASE, input_dev->keybit); |
| 2370 | __set_bit(BTN_BASE2, input_dev->keybit); |
| 2371 | /* fall through */ |
| 2372 | |
| 2373 | case WACOM_BEE: |
| 2374 | __set_bit(BTN_8, input_dev->keybit); |
| 2375 | __set_bit(BTN_9, input_dev->keybit); |
| 2376 | /* fall through */ |
| 2377 | |
| 2378 | case CINTIQ: |
| 2379 | for (i = 0; i < 8; i++) |
| 2380 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2381 | |
| 2382 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
| 2383 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
| 2384 | break; |
| 2385 | |
| 2386 | case WACOM_13HD: |
| 2387 | for (i = 0; i < 9; i++) |
| 2388 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2389 | |
| 2390 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 2391 | break; |
| 2392 | |
| 2393 | case INTUOS3: |
| 2394 | case INTUOS3L: |
| 2395 | __set_bit(BTN_4, input_dev->keybit); |
| 2396 | __set_bit(BTN_5, input_dev->keybit); |
| 2397 | __set_bit(BTN_6, input_dev->keybit); |
| 2398 | __set_bit(BTN_7, input_dev->keybit); |
| 2399 | |
| 2400 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
| 2401 | /* fall through */ |
| 2402 | |
| 2403 | case INTUOS3S: |
| 2404 | __set_bit(BTN_0, input_dev->keybit); |
| 2405 | __set_bit(BTN_1, input_dev->keybit); |
| 2406 | __set_bit(BTN_2, input_dev->keybit); |
| 2407 | __set_bit(BTN_3, input_dev->keybit); |
| 2408 | |
| 2409 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
| 2410 | break; |
| 2411 | |
| 2412 | case INTUOS5: |
| 2413 | case INTUOS5L: |
| 2414 | case INTUOSPM: |
| 2415 | case INTUOSPL: |
| 2416 | __set_bit(BTN_7, input_dev->keybit); |
| 2417 | __set_bit(BTN_8, input_dev->keybit); |
| 2418 | /* fall through */ |
| 2419 | |
| 2420 | case INTUOS5S: |
| 2421 | case INTUOSPS: |
| 2422 | /* touch interface does not have the pad device */ |
| 2423 | if (features->device_type != BTN_TOOL_PEN) |
Ping Cheng | b3c8e93 | 2014-11-18 13:27:48 -0800 | [diff] [blame] | 2424 | return -ENODEV; |
Benjamin Tissoires | 10059cdc | 2014-07-24 12:49:08 -0700 | [diff] [blame] | 2425 | |
| 2426 | for (i = 0; i < 7; i++) |
| 2427 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2428 | |
| 2429 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 2430 | break; |
| 2431 | |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 2432 | case INTUOS4WL: |
| 2433 | /* |
| 2434 | * For Bluetooth devices, the udev rule does not work correctly |
| 2435 | * for pads unless we add a stylus capability, which forces |
| 2436 | * ID_INPUT_TABLET to be set. |
| 2437 | */ |
| 2438 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 2439 | /* fall through */ |
| 2440 | |
Benjamin Tissoires | 10059cdc | 2014-07-24 12:49:08 -0700 | [diff] [blame] | 2441 | case INTUOS4: |
| 2442 | case INTUOS4L: |
| 2443 | __set_bit(BTN_7, input_dev->keybit); |
| 2444 | __set_bit(BTN_8, input_dev->keybit); |
| 2445 | /* fall through */ |
| 2446 | |
| 2447 | case INTUOS4S: |
| 2448 | for (i = 0; i < 7; i++) |
| 2449 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2450 | |
| 2451 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 2452 | break; |
| 2453 | |
| 2454 | case CINTIQ_HYBRID: |
| 2455 | for (i = 0; i < 9; i++) |
| 2456 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2457 | |
| 2458 | break; |
| 2459 | |
Benjamin Tissoires | 422b031 | 2014-07-24 12:50:39 -0700 | [diff] [blame] | 2460 | case DTUS: |
| 2461 | for (i = 0; i < 4; i++) |
| 2462 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 2463 | break; |
| 2464 | |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 2465 | case INTUOSHT: |
| 2466 | case BAMBOO_PT: |
| 2467 | /* pad device is on the touch interface */ |
Ping Cheng | 30ebc1a | 2014-11-18 13:29:16 -0800 | [diff] [blame] | 2468 | if ((features->device_type != BTN_TOOL_FINGER) || |
| 2469 | /* Bamboo Pen only tablet does not have pad */ |
| 2470 | ((features->type == BAMBOO_PT) && !features->touch_max)) |
Ping Cheng | b3c8e93 | 2014-11-18 13:27:48 -0800 | [diff] [blame] | 2471 | return -ENODEV; |
Benjamin Tissoires | 3116871 | 2014-07-24 12:50:10 -0700 | [diff] [blame] | 2472 | |
| 2473 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 2474 | |
| 2475 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 2476 | __set_bit(BTN_FORWARD, input_dev->keybit); |
| 2477 | __set_bit(BTN_BACK, input_dev->keybit); |
| 2478 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 2479 | |
| 2480 | break; |
| 2481 | |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 2482 | default: |
| 2483 | /* no pad supported */ |
Ping Cheng | b3c8e93 | 2014-11-18 13:27:48 -0800 | [diff] [blame] | 2484 | return -ENODEV; |
Benjamin Tissoires | d2d13f1 | 2014-07-24 12:48:28 -0700 | [diff] [blame] | 2485 | } |
| 2486 | return 0; |
| 2487 | } |
| 2488 | |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2489 | static const struct wacom_features wacom_features_0x00 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2490 | { "Wacom Penpartner", 5040, 3780, 255, 0, |
| 2491 | PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2492 | static const struct wacom_features wacom_features_0x10 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2493 | { "Wacom Graphire", 10206, 7422, 511, 63, |
| 2494 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 2495 | static const struct wacom_features wacom_features_0x81 = |
| 2496 | { "Wacom Graphire BT", 16704, 12064, 511, 32, |
| 2497 | GRAPHIRE_BT, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2498 | static const struct wacom_features wacom_features_0x11 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2499 | { "Wacom Graphire2 4x5", 10206, 7422, 511, 63, |
| 2500 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2501 | static const struct wacom_features wacom_features_0x12 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2502 | { "Wacom Graphire2 5x7", 13918, 10206, 511, 63, |
| 2503 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2504 | static const struct wacom_features wacom_features_0x13 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2505 | { "Wacom Graphire3", 10208, 7424, 511, 63, |
| 2506 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2507 | static const struct wacom_features wacom_features_0x14 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2508 | { "Wacom Graphire3 6x8", 16704, 12064, 511, 63, |
| 2509 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2510 | static const struct wacom_features wacom_features_0x15 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2511 | { "Wacom Graphire4 4x5", 10208, 7424, 511, 63, |
| 2512 | WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2513 | static const struct wacom_features wacom_features_0x16 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2514 | { "Wacom Graphire4 6x8", 16704, 12064, 511, 63, |
| 2515 | WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2516 | static const struct wacom_features wacom_features_0x17 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2517 | { "Wacom BambooFun 4x5", 14760, 9225, 511, 63, |
| 2518 | WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2519 | static const struct wacom_features wacom_features_0x18 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2520 | { "Wacom BambooFun 6x8", 21648, 13530, 511, 63, |
| 2521 | WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2522 | static const struct wacom_features wacom_features_0x19 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2523 | { "Wacom Bamboo1 Medium", 16704, 12064, 511, 63, |
| 2524 | GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2525 | static const struct wacom_features wacom_features_0x60 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2526 | { "Wacom Volito", 5104, 3712, 511, 63, |
| 2527 | GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2528 | static const struct wacom_features wacom_features_0x61 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2529 | { "Wacom PenStation2", 3250, 2320, 255, 63, |
| 2530 | GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2531 | static const struct wacom_features wacom_features_0x62 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2532 | { "Wacom Volito2 4x5", 5104, 3712, 511, 63, |
| 2533 | GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2534 | static const struct wacom_features wacom_features_0x63 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2535 | { "Wacom Volito2 2x3", 3248, 2320, 511, 63, |
| 2536 | GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2537 | static const struct wacom_features wacom_features_0x64 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2538 | { "Wacom PenPartner2", 3250, 2320, 511, 63, |
| 2539 | GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2540 | static const struct wacom_features wacom_features_0x65 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2541 | { "Wacom Bamboo", 14760, 9225, 511, 63, |
| 2542 | WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2543 | static const struct wacom_features wacom_features_0x69 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2544 | { "Wacom Bamboo1", 5104, 3712, 511, 63, |
| 2545 | GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 2546 | static const struct wacom_features wacom_features_0x6A = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2547 | { "Wacom Bamboo1 4x6", 14760, 9225, 1023, 63, |
| 2548 | GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 2549 | static const struct wacom_features wacom_features_0x6B = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2550 | { "Wacom Bamboo1 5x8", 21648, 13530, 1023, 63, |
| 2551 | GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2552 | static const struct wacom_features wacom_features_0x20 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2553 | { "Wacom Intuos 4x5", 12700, 10600, 1023, 31, |
| 2554 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2555 | static const struct wacom_features wacom_features_0x21 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2556 | { "Wacom Intuos 6x8", 20320, 16240, 1023, 31, |
| 2557 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2558 | static const struct wacom_features wacom_features_0x22 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2559 | { "Wacom Intuos 9x12", 30480, 24060, 1023, 31, |
| 2560 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2561 | static const struct wacom_features wacom_features_0x23 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2562 | { "Wacom Intuos 12x12", 30480, 31680, 1023, 31, |
| 2563 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2564 | static const struct wacom_features wacom_features_0x24 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2565 | { "Wacom Intuos 12x18", 45720, 31680, 1023, 31, |
| 2566 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2567 | static const struct wacom_features wacom_features_0x30 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2568 | { "Wacom PL400", 5408, 4056, 255, 0, |
| 2569 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2570 | static const struct wacom_features wacom_features_0x31 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2571 | { "Wacom PL500", 6144, 4608, 255, 0, |
| 2572 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2573 | static const struct wacom_features wacom_features_0x32 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2574 | { "Wacom PL600", 6126, 4604, 255, 0, |
| 2575 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2576 | static const struct wacom_features wacom_features_0x33 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2577 | { "Wacom PL600SX", 6260, 5016, 255, 0, |
| 2578 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2579 | static const struct wacom_features wacom_features_0x34 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2580 | { "Wacom PL550", 6144, 4608, 511, 0, |
| 2581 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2582 | static const struct wacom_features wacom_features_0x35 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2583 | { "Wacom PL800", 7220, 5780, 511, 0, |
| 2584 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2585 | static const struct wacom_features wacom_features_0x37 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2586 | { "Wacom PL700", 6758, 5406, 511, 0, |
| 2587 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2588 | static const struct wacom_features wacom_features_0x38 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2589 | { "Wacom PL510", 6282, 4762, 511, 0, |
| 2590 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2591 | static const struct wacom_features wacom_features_0x39 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2592 | { "Wacom DTU710", 34080, 27660, 511, 0, |
| 2593 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2594 | static const struct wacom_features wacom_features_0xC4 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2595 | { "Wacom DTF521", 6282, 4762, 511, 0, |
| 2596 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2597 | static const struct wacom_features wacom_features_0xC0 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2598 | { "Wacom DTF720", 6858, 5506, 511, 0, |
| 2599 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2600 | static const struct wacom_features wacom_features_0xC2 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2601 | { "Wacom DTF720a", 6858, 5506, 511, 0, |
| 2602 | PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2603 | static const struct wacom_features wacom_features_0x03 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2604 | { "Wacom Cintiq Partner", 20480, 15360, 511, 0, |
| 2605 | PTU, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2606 | static const struct wacom_features wacom_features_0x41 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2607 | { "Wacom Intuos2 4x5", 12700, 10600, 1023, 31, |
| 2608 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2609 | static const struct wacom_features wacom_features_0x42 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2610 | { "Wacom Intuos2 6x8", 20320, 16240, 1023, 31, |
| 2611 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2612 | static const struct wacom_features wacom_features_0x43 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2613 | { "Wacom Intuos2 9x12", 30480, 24060, 1023, 31, |
| 2614 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2615 | static const struct wacom_features wacom_features_0x44 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2616 | { "Wacom Intuos2 12x12", 30480, 31680, 1023, 31, |
| 2617 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2618 | static const struct wacom_features wacom_features_0x45 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2619 | { "Wacom Intuos2 12x18", 45720, 31680, 1023, 31, |
| 2620 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2621 | static const struct wacom_features wacom_features_0xB0 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2622 | { "Wacom Intuos3 4x5", 25400, 20320, 1023, 63, |
| 2623 | INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2624 | static const struct wacom_features wacom_features_0xB1 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2625 | { "Wacom Intuos3 6x8", 40640, 30480, 1023, 63, |
| 2626 | INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2627 | static const struct wacom_features wacom_features_0xB2 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2628 | { "Wacom Intuos3 9x12", 60960, 45720, 1023, 63, |
| 2629 | INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2630 | static const struct wacom_features wacom_features_0xB3 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2631 | { "Wacom Intuos3 12x12", 60960, 60960, 1023, 63, |
| 2632 | INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2633 | static const struct wacom_features wacom_features_0xB4 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2634 | { "Wacom Intuos3 12x19", 97536, 60960, 1023, 63, |
| 2635 | INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2636 | static const struct wacom_features wacom_features_0xB5 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2637 | { "Wacom Intuos3 6x11", 54204, 31750, 1023, 63, |
| 2638 | INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2639 | static const struct wacom_features wacom_features_0xB7 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2640 | { "Wacom Intuos3 4x6", 31496, 19685, 1023, 63, |
| 2641 | INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2642 | static const struct wacom_features wacom_features_0xB8 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2643 | { "Wacom Intuos4 4x6", 31496, 19685, 2047, 63, |
| 2644 | INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2645 | static const struct wacom_features wacom_features_0xB9 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2646 | { "Wacom Intuos4 6x9", 44704, 27940, 2047, 63, |
| 2647 | INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2648 | static const struct wacom_features wacom_features_0xBA = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2649 | { "Wacom Intuos4 8x13", 65024, 40640, 2047, 63, |
| 2650 | INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2651 | static const struct wacom_features wacom_features_0xBB = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2652 | { "Wacom Intuos4 12x19", 97536, 60960, 2047, 63, |
| 2653 | INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 2654 | static const struct wacom_features wacom_features_0xBC = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2655 | { "Wacom Intuos4 WL", 40640, 25400, 2047, 63, |
| 2656 | INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 2657 | static const struct wacom_features wacom_features_0xBD = |
| 2658 | { "Wacom Intuos4 WL", 40640, 25400, 2047, 63, |
| 2659 | INTUOS4WL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2660 | static const struct wacom_features wacom_features_0x26 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2661 | { "Wacom Intuos5 touch S", 31496, 19685, 2047, 63, |
| 2662 | INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2663 | static const struct wacom_features wacom_features_0x27 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2664 | { "Wacom Intuos5 touch M", 44704, 27940, 2047, 63, |
| 2665 | INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2666 | static const struct wacom_features wacom_features_0x28 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2667 | { "Wacom Intuos5 touch L", 65024, 40640, 2047, 63, |
| 2668 | INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2669 | static const struct wacom_features wacom_features_0x29 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2670 | { "Wacom Intuos5 S", 31496, 19685, 2047, 63, |
| 2671 | INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2672 | static const struct wacom_features wacom_features_0x2A = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2673 | { "Wacom Intuos5 M", 44704, 27940, 2047, 63, |
| 2674 | INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 2675 | static const struct wacom_features wacom_features_0x314 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2676 | { "Wacom Intuos Pro S", 31496, 19685, 2047, 63, |
| 2677 | INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2678 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 2679 | static const struct wacom_features wacom_features_0x315 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2680 | { "Wacom Intuos Pro M", 44704, 27940, 2047, 63, |
| 2681 | INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2682 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | 9a35c41 | 2013-09-20 09:51:56 -0700 | [diff] [blame] | 2683 | static const struct wacom_features wacom_features_0x317 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2684 | { "Wacom Intuos Pro L", 65024, 40640, 2047, 63, |
| 2685 | INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .touch_max = 16, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2686 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 2687 | static const struct wacom_features wacom_features_0xF4 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2688 | { "Wacom Cintiq 24HD", 104280, 65400, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2689 | WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2690 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; |
Jason Gerecke | 6f4d038 | 2012-08-21 22:11:59 -0700 | [diff] [blame] | 2691 | static const struct wacom_features wacom_features_0xF8 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2692 | { "Wacom Cintiq 24HD touch", 104280, 65400, 2047, 63, /* Pen */ |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2693 | WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2694 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, |
Ping Cheng | 3bd1f7e | 2013-05-23 10:22:33 -0700 | [diff] [blame] | 2695 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; |
Jason Gerecke | b1e4279 | 2012-10-21 00:38:04 -0700 | [diff] [blame] | 2696 | static const struct wacom_features wacom_features_0xF6 = |
| 2697 | { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2698 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10, |
| 2699 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2700 | static const struct wacom_features wacom_features_0x3F = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2701 | { "Wacom Cintiq 21UX", 87200, 65600, 1023, 63, |
| 2702 | CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2703 | static const struct wacom_features wacom_features_0xC5 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2704 | { "Wacom Cintiq 20WSX", 86680, 54180, 1023, 63, |
| 2705 | WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2706 | static const struct wacom_features wacom_features_0xC6 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2707 | { "Wacom Cintiq 12WX", 53020, 33440, 1023, 63, |
| 2708 | WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2709 | static const struct wacom_features wacom_features_0x304 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2710 | { "Wacom Cintiq 13HD", 59352, 33648, 1023, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2711 | WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2712 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2713 | static const struct wacom_features wacom_features_0xC7 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2714 | { "Wacom DTU1931", 37832, 30305, 511, 0, |
| 2715 | PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 2716 | static const struct wacom_features wacom_features_0xCE = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2717 | { "Wacom DTU2231", 47864, 27011, 511, 0, |
| 2718 | DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2719 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBMOUSE }; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 2720 | static const struct wacom_features wacom_features_0xF0 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2721 | { "Wacom DTU1631", 34623, 19553, 511, 0, |
| 2722 | DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 497ab1f | 2014-01-20 20:18:04 -0800 | [diff] [blame] | 2723 | static const struct wacom_features wacom_features_0xFB = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2724 | { "Wacom DTU1031", 22096, 13960, 511, 0, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2725 | DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 2726 | WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; |
Ping Cheng | fff00bf | 2014-12-04 18:23:04 -0800 | [diff] [blame^] | 2727 | static const struct wacom_features wacom_features_0x32F = |
| 2728 | { "Wacom DTU1031X", 22472, 12728, 511, 0, |
| 2729 | DTUSX, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 2730 | WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2731 | static const struct wacom_features wacom_features_0x57 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2732 | { "Wacom DTK2241", 95640, 54060, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2733 | DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2734 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 2735 | static const struct wacom_features wacom_features_0x59 = /* Pen */ |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2736 | { "Wacom DTH2242", 95640, 54060, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2737 | DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2738 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 2739 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5D }; |
| 2740 | static const struct wacom_features wacom_features_0x5D = /* Touch */ |
| 2741 | { "Wacom DTH2242", .type = WACOM_24HDT, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2742 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x59, .touch_max = 10, |
| 2743 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 2744 | static const struct wacom_features wacom_features_0xCC = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2745 | { "Wacom Cintiq 21UX2", 87000, 65400, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2746 | WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2747 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 2748 | static const struct wacom_features wacom_features_0xFA = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2749 | { "Wacom Cintiq 22HD", 95640, 54060, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2750 | WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2751 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET }; |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2752 | static const struct wacom_features wacom_features_0x5B = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2753 | { "Wacom Cintiq 22HDT", 95640, 54060, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2754 | WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2755 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, |
Ping Cheng | 3bd1f7e | 2013-05-23 10:22:33 -0700 | [diff] [blame] | 2756 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2757 | static const struct wacom_features wacom_features_0x5E = |
| 2758 | { "Wacom Cintiq 22HDT", .type = WACOM_24HDT, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2759 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10, |
| 2760 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2761 | static const struct wacom_features wacom_features_0x90 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2762 | { "Wacom ISDv4 90", 26202, 16325, 255, 0, |
| 2763 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2764 | static const struct wacom_features wacom_features_0x93 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2765 | { "Wacom ISDv4 93", 26202, 16325, 255, 0, |
| 2766 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 2767 | static const struct wacom_features wacom_features_0x97 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2768 | { "Wacom ISDv4 97", 26202, 16325, 511, 0, |
| 2769 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2770 | static const struct wacom_features wacom_features_0x9A = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2771 | { "Wacom ISDv4 9A", 26202, 16325, 255, 0, |
| 2772 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2773 | static const struct wacom_features wacom_features_0x9F = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2774 | { "Wacom ISDv4 9F", 26202, 16325, 255, 0, |
| 2775 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2776 | static const struct wacom_features wacom_features_0xE2 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2777 | { "Wacom ISDv4 E2", 26202, 16325, 255, 0, |
| 2778 | TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2779 | static const struct wacom_features wacom_features_0xE3 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2780 | { "Wacom ISDv4 E3", 26202, 16325, 255, 0, |
| 2781 | TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 2782 | static const struct wacom_features wacom_features_0xE5 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2783 | { "Wacom ISDv4 E5", 26202, 16325, 255, 0, |
| 2784 | MTSCREEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Manoj Iyer | 26fcd2a | 2011-03-31 22:39:43 -0700 | [diff] [blame] | 2785 | static const struct wacom_features wacom_features_0xE6 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2786 | { "Wacom ISDv4 E6", 27760, 15694, 255, 0, |
| 2787 | TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Chris Bagwell | 0d0e306 | 2011-12-11 23:50:59 -0800 | [diff] [blame] | 2788 | static const struct wacom_features wacom_features_0xEC = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2789 | { "Wacom ISDv4 EC", 25710, 14500, 255, 0, |
| 2790 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 2791 | static const struct wacom_features wacom_features_0xED = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2792 | { "Wacom ISDv4 ED", 26202, 16325, 255, 0, |
| 2793 | TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 2794 | static const struct wacom_features wacom_features_0xEF = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2795 | { "Wacom ISDv4 EF", 26202, 16325, 255, 0, |
| 2796 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 2797 | static const struct wacom_features wacom_features_0x100 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2798 | { "Wacom ISDv4 100", 26202, 16325, 255, 0, |
| 2799 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 2800 | static const struct wacom_features wacom_features_0x101 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2801 | { "Wacom ISDv4 101", 26202, 16325, 255, 0, |
| 2802 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Stephan Frank | 5869483 | 2013-03-07 14:08:50 -0800 | [diff] [blame] | 2803 | static const struct wacom_features wacom_features_0x10D = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2804 | { "Wacom ISDv4 10D", 26202, 16325, 255, 0, |
| 2805 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | 2d3163f | 2013-10-22 15:35:30 -0700 | [diff] [blame] | 2806 | static const struct wacom_features wacom_features_0x10E = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2807 | { "Wacom ISDv4 10E", 27760, 15694, 255, 0, |
| 2808 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | 9b4f60e | 2013-10-15 23:46:34 -0700 | [diff] [blame] | 2809 | static const struct wacom_features wacom_features_0x10F = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2810 | { "Wacom ISDv4 10F", 27760, 15694, 255, 0, |
| 2811 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | 61616ed | 2014-05-14 11:42:22 -0700 | [diff] [blame] | 2812 | static const struct wacom_features wacom_features_0x116 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2813 | { "Wacom ISDv4 116", 26202, 16325, 255, 0, |
| 2814 | TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | aeaf50d | 2014-07-28 10:53:16 -0700 | [diff] [blame] | 2815 | static const struct wacom_features wacom_features_0x12C = |
| 2816 | { "Wacom ISDv4 12C", 27848, 15752, 2047, 0, |
| 2817 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | edbe265 | 2012-11-21 13:12:50 -0800 | [diff] [blame] | 2818 | static const struct wacom_features wacom_features_0x4001 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2819 | { "Wacom ISDv4 4001", 26202, 16325, 255, 0, |
| 2820 | MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 2821 | static const struct wacom_features wacom_features_0x4004 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2822 | { "Wacom ISDv4 4004", 11060, 6220, 255, 0, |
| 2823 | MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 2824 | static const struct wacom_features wacom_features_0x5000 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2825 | { "Wacom ISDv4 5000", 27848, 15752, 1023, 0, |
| 2826 | MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 2827 | static const struct wacom_features wacom_features_0x5002 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2828 | { "Wacom ISDv4 5002", 29576, 16724, 1023, 0, |
| 2829 | MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 2830 | static const struct wacom_features wacom_features_0x47 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2831 | { "Wacom Intuos2 6x8", 20320, 16240, 1023, 31, |
| 2832 | INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 2833 | static const struct wacom_features wacom_features_0x84 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2834 | { "Wacom Wireless Receiver", 0, 0, 0, 0, |
| 2835 | WIRELESS, 0, 0, .touch_max = 16 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2836 | static const struct wacom_features wacom_features_0xD0 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2837 | { "Wacom Bamboo 2FG", 14720, 9200, 1023, 31, |
| 2838 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2839 | static const struct wacom_features wacom_features_0xD1 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2840 | { "Wacom Bamboo 2FG 4x5", 14720, 9200, 1023, 31, |
| 2841 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2842 | static const struct wacom_features wacom_features_0xD2 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2843 | { "Wacom Bamboo Craft", 14720, 9200, 1023, 31, |
| 2844 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2845 | static const struct wacom_features wacom_features_0xD3 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2846 | { "Wacom Bamboo 2FG 6x8", 21648, 13700, 1023, 31, |
| 2847 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Kevin Granade | 57a7872 | 2010-12-10 23:04:02 -0800 | [diff] [blame] | 2848 | static const struct wacom_features wacom_features_0xD4 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2849 | { "Wacom Bamboo Pen", 14720, 9200, 1023, 31, |
| 2850 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Gerard Braad | 18adad1 | 2011-08-16 00:17:56 -0700 | [diff] [blame] | 2851 | static const struct wacom_features wacom_features_0xD5 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2852 | { "Wacom Bamboo Pen 6x8", 21648, 13700, 1023, 31, |
| 2853 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2854 | static const struct wacom_features wacom_features_0xD6 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2855 | { "Wacom BambooPT 2FG 4x5", 14720, 9200, 1023, 31, |
| 2856 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2857 | static const struct wacom_features wacom_features_0xD7 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2858 | { "Wacom BambooPT 2FG Small", 14720, 9200, 1023, 31, |
| 2859 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2860 | static const struct wacom_features wacom_features_0xD8 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2861 | { "Wacom Bamboo Comic 2FG", 21648, 13700, 1023, 31, |
| 2862 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 2863 | static const struct wacom_features wacom_features_0xDA = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2864 | { "Wacom Bamboo 2FG 4x5 SE", 14720, 9200, 1023, 31, |
| 2865 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Ping Cheng | f41a64e | 2013-08-21 09:14:49 -0700 | [diff] [blame] | 2866 | static const struct wacom_features wacom_features_0xDB = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2867 | { "Wacom Bamboo 2FG 6x8 SE", 21648, 13700, 1023, 31, |
| 2868 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 }; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2869 | static const struct wacom_features wacom_features_0xDD = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2870 | { "Wacom Bamboo Connect", 14720, 9200, 1023, 31, |
| 2871 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2872 | static const struct wacom_features wacom_features_0xDE = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2873 | { "Wacom Bamboo 16FG 4x5", 14720, 9200, 1023, 31, |
| 2874 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 }; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2875 | static const struct wacom_features wacom_features_0xDF = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2876 | { "Wacom Bamboo 16FG 6x8", 21648, 13700, 1023, 31, |
| 2877 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 }; |
Ping Cheng | f41a64e | 2013-08-21 09:14:49 -0700 | [diff] [blame] | 2878 | static const struct wacom_features wacom_features_0x300 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2879 | { "Wacom Bamboo One S", 14720, 9225, 1023, 31, |
| 2880 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | f41a64e | 2013-08-21 09:14:49 -0700 | [diff] [blame] | 2881 | static const struct wacom_features wacom_features_0x301 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2882 | { "Wacom Bamboo One M", 21648, 13530, 1023, 31, |
| 2883 | BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2884 | static const struct wacom_features wacom_features_0x302 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2885 | { "Wacom Intuos PT S", 15200, 9500, 1023, 31, |
| 2886 | INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2887 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2888 | static const struct wacom_features wacom_features_0x303 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2889 | { "Wacom Intuos PT M", 21600, 13500, 1023, 31, |
| 2890 | INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2891 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | b5fd2a3 | 2013-11-25 18:44:55 -0800 | [diff] [blame] | 2892 | static const struct wacom_features wacom_features_0x30E = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2893 | { "Wacom Intuos S", 15200, 9500, 1023, 31, |
| 2894 | INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2895 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 2896 | static const struct wacom_features wacom_features_0x6004 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2897 | { "ISD-V4", 12800, 8000, 255, 0, |
| 2898 | TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2899 | static const struct wacom_features wacom_features_0x307 = |
Benjamin Tissoires | 80befa9 | 2014-07-24 13:05:19 -0700 | [diff] [blame] | 2900 | { "Wacom ISDv5 307", 59352, 33648, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2901 | CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2902 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 2903 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 }; |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2904 | static const struct wacom_features wacom_features_0x309 = |
Jason Gerecke | 36d3c51 | 2013-09-20 09:47:35 -0700 | [diff] [blame] | 2905 | { "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */ |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2906 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10, |
| 2907 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Benjamin Tissoires | 89f2ab5 | 2014-09-03 15:43:25 -0400 | [diff] [blame] | 2908 | static const struct wacom_features wacom_features_0x30A = |
| 2909 | { "Wacom ISDv5 30A", 59352, 33648, 2047, 63, |
Ping Cheng | fa77034 | 2014-12-01 13:44:28 -0800 | [diff] [blame] | 2910 | CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 2911 | WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, |
Benjamin Tissoires | 89f2ab5 | 2014-09-03 15:43:25 -0400 | [diff] [blame] | 2912 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30C }; |
| 2913 | static const struct wacom_features wacom_features_0x30C = |
| 2914 | { "Wacom ISDv5 30C", .type = WACOM_24HDT, /* Touch */ |
| 2915 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30A, .touch_max = 10, |
| 2916 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Ping Cheng | fefb391 | 2014-11-11 12:52:08 -0800 | [diff] [blame] | 2917 | static const struct wacom_features wacom_features_0x323 = |
| 2918 | { "Wacom Intuos P M", 21600, 13500, 1023, 31, |
| 2919 | INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 2920 | .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE }; |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2921 | |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 2922 | static const struct wacom_features wacom_features_HID_ANY_ID = |
| 2923 | { "Wacom HID", .type = HID_GENERIC }; |
| 2924 | |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2925 | #define USB_DEVICE_WACOM(prod) \ |
| 2926 | HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ |
| 2927 | .driver_data = (kernel_ulong_t)&wacom_features_##prod |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2928 | |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 2929 | #define BT_DEVICE_WACOM(prod) \ |
| 2930 | HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\ |
| 2931 | .driver_data = (kernel_ulong_t)&wacom_features_##prod |
Aristeu Rozanski | 1483f55 | 2011-06-22 01:17:17 -0700 | [diff] [blame] | 2932 | |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 2933 | #define USB_DEVICE_LENOVO(prod) \ |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2934 | HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ |
| 2935 | .driver_data = (kernel_ulong_t)&wacom_features_##prod |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 2936 | |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2937 | const struct hid_device_id wacom_ids[] = { |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2938 | { USB_DEVICE_WACOM(0x00) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2939 | { USB_DEVICE_WACOM(0x03) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2940 | { USB_DEVICE_WACOM(0x10) }, |
| 2941 | { USB_DEVICE_WACOM(0x11) }, |
| 2942 | { USB_DEVICE_WACOM(0x12) }, |
| 2943 | { USB_DEVICE_WACOM(0x13) }, |
| 2944 | { USB_DEVICE_WACOM(0x14) }, |
| 2945 | { USB_DEVICE_WACOM(0x15) }, |
| 2946 | { USB_DEVICE_WACOM(0x16) }, |
| 2947 | { USB_DEVICE_WACOM(0x17) }, |
| 2948 | { USB_DEVICE_WACOM(0x18) }, |
| 2949 | { USB_DEVICE_WACOM(0x19) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2950 | { USB_DEVICE_WACOM(0x20) }, |
| 2951 | { USB_DEVICE_WACOM(0x21) }, |
| 2952 | { USB_DEVICE_WACOM(0x22) }, |
| 2953 | { USB_DEVICE_WACOM(0x23) }, |
| 2954 | { USB_DEVICE_WACOM(0x24) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2955 | { USB_DEVICE_WACOM(0x26) }, |
| 2956 | { USB_DEVICE_WACOM(0x27) }, |
| 2957 | { USB_DEVICE_WACOM(0x28) }, |
| 2958 | { USB_DEVICE_WACOM(0x29) }, |
| 2959 | { USB_DEVICE_WACOM(0x2A) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2960 | { USB_DEVICE_WACOM(0x30) }, |
| 2961 | { USB_DEVICE_WACOM(0x31) }, |
| 2962 | { USB_DEVICE_WACOM(0x32) }, |
| 2963 | { USB_DEVICE_WACOM(0x33) }, |
| 2964 | { USB_DEVICE_WACOM(0x34) }, |
| 2965 | { USB_DEVICE_WACOM(0x35) }, |
| 2966 | { USB_DEVICE_WACOM(0x37) }, |
| 2967 | { USB_DEVICE_WACOM(0x38) }, |
| 2968 | { USB_DEVICE_WACOM(0x39) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2969 | { USB_DEVICE_WACOM(0x3F) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2970 | { USB_DEVICE_WACOM(0x41) }, |
| 2971 | { USB_DEVICE_WACOM(0x42) }, |
| 2972 | { USB_DEVICE_WACOM(0x43) }, |
| 2973 | { USB_DEVICE_WACOM(0x44) }, |
| 2974 | { USB_DEVICE_WACOM(0x45) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2975 | { USB_DEVICE_WACOM(0x47) }, |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2976 | { USB_DEVICE_WACOM(0x57) }, |
Ping Cheng | a112e9f | 2013-02-13 20:20:01 -0800 | [diff] [blame] | 2977 | { USB_DEVICE_WACOM(0x59) }, |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 2978 | { USB_DEVICE_WACOM(0x5B) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2979 | { USB_DEVICE_WACOM(0x5D) }, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 2980 | { USB_DEVICE_WACOM(0x5E) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2981 | { USB_DEVICE_WACOM(0x60) }, |
| 2982 | { USB_DEVICE_WACOM(0x61) }, |
| 2983 | { USB_DEVICE_WACOM(0x62) }, |
| 2984 | { USB_DEVICE_WACOM(0x63) }, |
| 2985 | { USB_DEVICE_WACOM(0x64) }, |
| 2986 | { USB_DEVICE_WACOM(0x65) }, |
| 2987 | { USB_DEVICE_WACOM(0x69) }, |
| 2988 | { USB_DEVICE_WACOM(0x6A) }, |
| 2989 | { USB_DEVICE_WACOM(0x6B) }, |
Benjamin Tissoires | 387142b | 2014-08-06 13:52:56 -0700 | [diff] [blame] | 2990 | { BT_DEVICE_WACOM(0x81) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 2991 | { USB_DEVICE_WACOM(0x84) }, |
| 2992 | { USB_DEVICE_WACOM(0x90) }, |
| 2993 | { USB_DEVICE_WACOM(0x93) }, |
| 2994 | { USB_DEVICE_WACOM(0x97) }, |
| 2995 | { USB_DEVICE_WACOM(0x9A) }, |
| 2996 | { USB_DEVICE_WACOM(0x9F) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2997 | { USB_DEVICE_WACOM(0xB0) }, |
| 2998 | { USB_DEVICE_WACOM(0xB1) }, |
| 2999 | { USB_DEVICE_WACOM(0xB2) }, |
| 3000 | { USB_DEVICE_WACOM(0xB3) }, |
| 3001 | { USB_DEVICE_WACOM(0xB4) }, |
| 3002 | { USB_DEVICE_WACOM(0xB5) }, |
| 3003 | { USB_DEVICE_WACOM(0xB7) }, |
| 3004 | { USB_DEVICE_WACOM(0xB8) }, |
| 3005 | { USB_DEVICE_WACOM(0xB9) }, |
| 3006 | { USB_DEVICE_WACOM(0xBA) }, |
| 3007 | { USB_DEVICE_WACOM(0xBB) }, |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 3008 | { USB_DEVICE_WACOM(0xBC) }, |
Benjamin Tissoires | 81af7e6 | 2014-08-06 13:55:56 -0700 | [diff] [blame] | 3009 | { BT_DEVICE_WACOM(0xBD) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 3010 | { USB_DEVICE_WACOM(0xC0) }, |
| 3011 | { USB_DEVICE_WACOM(0xC2) }, |
| 3012 | { USB_DEVICE_WACOM(0xC4) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 3013 | { USB_DEVICE_WACOM(0xC5) }, |
| 3014 | { USB_DEVICE_WACOM(0xC6) }, |
| 3015 | { USB_DEVICE_WACOM(0xC7) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 3016 | { USB_DEVICE_WACOM(0xCC) }, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 3017 | { USB_DEVICE_WACOM(0xCE) }, |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 3018 | { USB_DEVICE_WACOM(0xD0) }, |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 3019 | { USB_DEVICE_WACOM(0xD1) }, |
| 3020 | { USB_DEVICE_WACOM(0xD2) }, |
| 3021 | { USB_DEVICE_WACOM(0xD3) }, |
Kevin Granade | 57a7872 | 2010-12-10 23:04:02 -0800 | [diff] [blame] | 3022 | { USB_DEVICE_WACOM(0xD4) }, |
Gerard Braad | 18adad1 | 2011-08-16 00:17:56 -0700 | [diff] [blame] | 3023 | { USB_DEVICE_WACOM(0xD5) }, |
Ping Cheng | d38acb4 | 2011-01-24 09:32:50 -0800 | [diff] [blame] | 3024 | { USB_DEVICE_WACOM(0xD6) }, |
| 3025 | { USB_DEVICE_WACOM(0xD7) }, |
David Foley | a318e6b | 2010-11-30 23:45:46 -0800 | [diff] [blame] | 3026 | { USB_DEVICE_WACOM(0xD8) }, |
| 3027 | { USB_DEVICE_WACOM(0xDA) }, |
David Foley | 47d0923 | 2010-12-07 21:05:59 -0800 | [diff] [blame] | 3028 | { USB_DEVICE_WACOM(0xDB) }, |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 3029 | { USB_DEVICE_WACOM(0xDD) }, |
| 3030 | { USB_DEVICE_WACOM(0xDE) }, |
| 3031 | { USB_DEVICE_WACOM(0xDF) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 3032 | { USB_DEVICE_WACOM(0xE2) }, |
| 3033 | { USB_DEVICE_WACOM(0xE3) }, |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 3034 | { USB_DEVICE_WACOM(0xE5) }, |
Manoj Iyer | 26fcd2a | 2011-03-31 22:39:43 -0700 | [diff] [blame] | 3035 | { USB_DEVICE_WACOM(0xE6) }, |
Chris Bagwell | 0d0e306 | 2011-12-11 23:50:59 -0800 | [diff] [blame] | 3036 | { USB_DEVICE_WACOM(0xEC) }, |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 3037 | { USB_DEVICE_WACOM(0xED) }, |
| 3038 | { USB_DEVICE_WACOM(0xEF) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 3039 | { USB_DEVICE_WACOM(0xF0) }, |
| 3040 | { USB_DEVICE_WACOM(0xF4) }, |
| 3041 | { USB_DEVICE_WACOM(0xF6) }, |
| 3042 | { USB_DEVICE_WACOM(0xF8) }, |
| 3043 | { USB_DEVICE_WACOM(0xFA) }, |
| 3044 | { USB_DEVICE_WACOM(0xFB) }, |
Ping Cheng | 6afdc28 | 2012-11-03 12:16:15 -0700 | [diff] [blame] | 3045 | { USB_DEVICE_WACOM(0x100) }, |
| 3046 | { USB_DEVICE_WACOM(0x101) }, |
Stephan Frank | 5869483 | 2013-03-07 14:08:50 -0800 | [diff] [blame] | 3047 | { USB_DEVICE_WACOM(0x10D) }, |
Jason Gerecke | 2d3163f | 2013-10-22 15:35:30 -0700 | [diff] [blame] | 3048 | { USB_DEVICE_WACOM(0x10E) }, |
Jason Gerecke | 9b4f60e | 2013-10-15 23:46:34 -0700 | [diff] [blame] | 3049 | { USB_DEVICE_WACOM(0x10F) }, |
Jason Gerecke | 61616ed | 2014-05-14 11:42:22 -0700 | [diff] [blame] | 3050 | { USB_DEVICE_WACOM(0x116) }, |
Jason Gerecke | aeaf50d | 2014-07-28 10:53:16 -0700 | [diff] [blame] | 3051 | { USB_DEVICE_WACOM(0x12C) }, |
Ping Cheng | f41a64e | 2013-08-21 09:14:49 -0700 | [diff] [blame] | 3052 | { USB_DEVICE_WACOM(0x300) }, |
| 3053 | { USB_DEVICE_WACOM(0x301) }, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 3054 | { USB_DEVICE_WACOM(0x302) }, |
| 3055 | { USB_DEVICE_WACOM(0x303) }, |
Ping Cheng | 5621856 | 2013-05-05 19:56:18 -0700 | [diff] [blame] | 3056 | { USB_DEVICE_WACOM(0x304) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 3057 | { USB_DEVICE_WACOM(0x307) }, |
| 3058 | { USB_DEVICE_WACOM(0x309) }, |
Benjamin Tissoires | 89f2ab5 | 2014-09-03 15:43:25 -0400 | [diff] [blame] | 3059 | { USB_DEVICE_WACOM(0x30A) }, |
| 3060 | { USB_DEVICE_WACOM(0x30C) }, |
Benjamin Tissoires | a3e6f65 | 2014-07-24 13:05:49 -0700 | [diff] [blame] | 3061 | { USB_DEVICE_WACOM(0x30E) }, |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 3062 | { USB_DEVICE_WACOM(0x314) }, |
| 3063 | { USB_DEVICE_WACOM(0x315) }, |
| 3064 | { USB_DEVICE_WACOM(0x317) }, |
Ping Cheng | fefb391 | 2014-11-11 12:52:08 -0800 | [diff] [blame] | 3065 | { USB_DEVICE_WACOM(0x323) }, |
Ping Cheng | fff00bf | 2014-12-04 18:23:04 -0800 | [diff] [blame^] | 3066 | { USB_DEVICE_WACOM(0x32F) }, |
Ping Cheng | edbe265 | 2012-11-21 13:12:50 -0800 | [diff] [blame] | 3067 | { USB_DEVICE_WACOM(0x4001) }, |
Jason Gerecke | d51ddb2 | 2014-05-14 17:14:29 -0700 | [diff] [blame] | 3068 | { USB_DEVICE_WACOM(0x4004) }, |
| 3069 | { USB_DEVICE_WACOM(0x5000) }, |
| 3070 | { USB_DEVICE_WACOM(0x5002) }, |
Benjamin Tissoires | 7704ac9 | 2014-09-23 12:08:08 -0400 | [diff] [blame] | 3071 | |
| 3072 | { USB_DEVICE_WACOM(HID_ANY_ID) }, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 3073 | { } |
| 3074 | }; |
Benjamin Tissoires | 29b4739 | 2014-07-24 12:52:23 -0700 | [diff] [blame] | 3075 | MODULE_DEVICE_TABLE(hid, wacom_ids); |