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 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 28 | static int wacom_penpartner_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 29 | { |
| 30 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 31 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 32 | |
| 33 | switch (data[0]) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 34 | case 1: |
| 35 | if (data[5] & 0x80) { |
| 36 | wacom->tool[0] = (data[5] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 37 | wacom->id[0] = (data[5] & 0x20) ? ERASER_DEVICE_ID : STYLUS_DEVICE_ID; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 38 | input_report_key(input, wacom->tool[0], 1); |
| 39 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 40 | input_report_abs(input, ABS_X, get_unaligned_le16(&data[1])); |
| 41 | input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 42 | input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127); |
| 43 | input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -127)); |
| 44 | input_report_key(input, BTN_STYLUS, (data[5] & 0x40)); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 45 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 46 | input_report_key(input, wacom->tool[0], 0); |
| 47 | input_report_abs(input, ABS_MISC, 0); /* report tool id */ |
| 48 | input_report_abs(input, ABS_PRESSURE, -1); |
| 49 | input_report_key(input, BTN_TOUCH, 0); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 50 | } |
| 51 | break; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 52 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 53 | case 2: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 54 | input_report_key(input, BTN_TOOL_PEN, 1); |
| 55 | input_report_abs(input, ABS_MISC, STYLUS_DEVICE_ID); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 56 | input_report_abs(input, ABS_X, get_unaligned_le16(&data[1])); |
| 57 | input_report_abs(input, ABS_Y, get_unaligned_le16(&data[3])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 58 | input_report_abs(input, ABS_PRESSURE, (signed char)data[6] + 127); |
| 59 | input_report_key(input, BTN_TOUCH, ((signed char)data[6] > -80) && !(data[5] & 0x20)); |
| 60 | input_report_key(input, BTN_STYLUS, (data[5] & 0x40)); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 61 | break; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 62 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 63 | default: |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 64 | dev_dbg(input->dev.parent, |
| 65 | "%s: received unknown report #%d\n", __func__, data[0]); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 66 | return 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 67 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 68 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 69 | return 1; |
| 70 | } |
| 71 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 72 | static int wacom_pl_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 73 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 74 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 75 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 76 | struct input_dev *input = wacom->input; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 77 | int prox, pressure; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 78 | |
Ping Cheng | cad7470 | 2009-12-15 00:35:25 -0800 | [diff] [blame] | 79 | if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 80 | dev_dbg(input->dev.parent, |
| 81 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | prox = data[1] & 0x40; |
| 86 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 87 | if (prox) { |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 88 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 89 | pressure = (signed char)((data[7] << 1) | ((data[4] >> 2) & 1)); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 90 | if (features->pressure_max > 255) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 91 | pressure = (pressure << 1) | ((data[4] >> 6) & 1); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 92 | pressure += (features->pressure_max + 1) / 2; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 93 | |
| 94 | /* |
| 95 | * if going from out of proximity into proximity select between the eraser |
| 96 | * and the pen based on the state of the stylus2 button, choose eraser if |
| 97 | * pressed else choose pen. if not a proximity change from out to in, send |
| 98 | * an out of proximity for previous tool then a in for new tool. |
| 99 | */ |
| 100 | if (!wacom->tool[0]) { |
| 101 | /* Eraser bit set for DTF */ |
| 102 | if (data[1] & 0x10) |
| 103 | wacom->tool[1] = BTN_TOOL_RUBBER; |
| 104 | else |
| 105 | /* Going into proximity select tool */ |
| 106 | wacom->tool[1] = (data[4] & 0x20) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 107 | } else { |
| 108 | /* was entered with stylus2 pressed */ |
| 109 | if (wacom->tool[1] == BTN_TOOL_RUBBER && !(data[4] & 0x20)) { |
| 110 | /* report out proximity for previous tool */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 111 | input_report_key(input, wacom->tool[1], 0); |
| 112 | input_sync(input); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 113 | wacom->tool[1] = BTN_TOOL_PEN; |
| 114 | return 0; |
| 115 | } |
| 116 | } |
| 117 | if (wacom->tool[1] != BTN_TOOL_RUBBER) { |
| 118 | /* Unknown tool selected default to pen tool */ |
| 119 | wacom->tool[1] = BTN_TOOL_PEN; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 120 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 121 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 122 | input_report_key(input, wacom->tool[1], prox); /* report in proximity for tool */ |
| 123 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
| 124 | input_report_abs(input, ABS_X, data[3] | (data[2] << 7) | ((data[1] & 0x03) << 14)); |
| 125 | input_report_abs(input, ABS_Y, data[6] | (data[5] << 7) | ((data[4] & 0x03) << 14)); |
| 126 | input_report_abs(input, ABS_PRESSURE, pressure); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 127 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 128 | input_report_key(input, BTN_TOUCH, data[4] & 0x08); |
| 129 | input_report_key(input, BTN_STYLUS, data[4] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 130 | /* Only allow the stylus2 button to be reported for the pen tool. */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 131 | 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] | 132 | } else { |
| 133 | /* report proximity-out of a (valid) tool */ |
| 134 | if (wacom->tool[1] != BTN_TOOL_RUBBER) { |
| 135 | /* Unknown tool selected default to pen tool */ |
| 136 | wacom->tool[1] = BTN_TOOL_PEN; |
| 137 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 138 | input_report_key(input, wacom->tool[1], prox); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | wacom->tool[0] = prox; /* Save proximity state */ |
| 142 | return 1; |
| 143 | } |
| 144 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 145 | static int wacom_ptu_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 146 | { |
| 147 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 148 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 149 | |
Ping Cheng | cad7470 | 2009-12-15 00:35:25 -0800 | [diff] [blame] | 150 | if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 151 | dev_dbg(input->dev.parent, |
| 152 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 153 | return 0; |
| 154 | } |
| 155 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 156 | if (data[1] & 0x04) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 157 | input_report_key(input, BTN_TOOL_RUBBER, data[1] & 0x20); |
| 158 | input_report_key(input, BTN_TOUCH, data[1] & 0x08); |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 159 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 160 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 161 | input_report_key(input, BTN_TOOL_PEN, data[1] & 0x20); |
| 162 | input_report_key(input, BTN_TOUCH, data[1] & 0x01); |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 163 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 164 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 165 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 166 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 167 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
| 168 | input_report_abs(input, ABS_PRESSURE, le16_to_cpup((__le16 *)&data[6])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 169 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 170 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 171 | return 1; |
| 172 | } |
| 173 | |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 174 | static int wacom_dtu_irq(struct wacom_wac *wacom) |
| 175 | { |
| 176 | struct wacom_features *features = &wacom->features; |
| 177 | char *data = wacom->data; |
| 178 | struct input_dev *input = wacom->input; |
| 179 | int prox = data[1] & 0x20, pressure; |
| 180 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 181 | dev_dbg(input->dev.parent, |
| 182 | "%s: received report #%d", __func__, data[0]); |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 183 | |
| 184 | if (prox) { |
| 185 | /* Going into proximity select tool */ |
| 186 | wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
| 187 | if (wacom->tool[0] == BTN_TOOL_PEN) |
| 188 | wacom->id[0] = STYLUS_DEVICE_ID; |
| 189 | else |
| 190 | wacom->id[0] = ERASER_DEVICE_ID; |
| 191 | } |
| 192 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 193 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
| 194 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 195 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
| 196 | pressure = ((data[7] & 0x01) << 8) | data[6]; |
| 197 | if (pressure < 0) |
| 198 | pressure = features->pressure_max + pressure + 1; |
| 199 | input_report_abs(input, ABS_PRESSURE, pressure); |
| 200 | input_report_key(input, BTN_TOUCH, data[1] & 0x05); |
| 201 | if (!prox) /* out-prox */ |
| 202 | wacom->id[0] = 0; |
| 203 | input_report_key(input, wacom->tool[0], prox); |
| 204 | input_report_abs(input, ABS_MISC, wacom->id[0]); |
| 205 | return 1; |
| 206 | } |
| 207 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 208 | static int wacom_graphire_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 209 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 210 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 211 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 212 | struct input_dev *input = wacom->input; |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 213 | int prox; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 214 | int rw = 0; |
| 215 | int retval = 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 216 | |
Ping Cheng | cad7470 | 2009-12-15 00:35:25 -0800 | [diff] [blame] | 217 | if (data[0] != WACOM_REPORT_PENABLED) { |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 218 | dev_dbg(input->dev.parent, |
| 219 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 220 | goto exit; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 221 | } |
| 222 | |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 223 | prox = data[1] & 0x80; |
| 224 | if (prox || wacom->id[0]) { |
| 225 | if (prox) { |
| 226 | switch ((data[1] >> 5) & 3) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 227 | |
| 228 | case 0: /* Pen */ |
| 229 | wacom->tool[0] = BTN_TOOL_PEN; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 230 | wacom->id[0] = STYLUS_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 231 | break; |
| 232 | |
| 233 | case 1: /* Rubber */ |
| 234 | wacom->tool[0] = BTN_TOOL_RUBBER; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 235 | wacom->id[0] = ERASER_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 236 | break; |
| 237 | |
| 238 | case 2: /* Mouse with wheel */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 239 | input_report_key(input, BTN_MIDDLE, data[1] & 0x04); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 240 | /* fall through */ |
| 241 | |
| 242 | case 3: /* Mouse without wheel */ |
| 243 | wacom->tool[0] = BTN_TOOL_MOUSE; |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 244 | wacom->id[0] = CURSOR_DEVICE_ID; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 245 | break; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 246 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 247 | } |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 248 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 249 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 250 | if (wacom->tool[0] != BTN_TOOL_MOUSE) { |
Chris Bagwell | 6dc4635 | 2012-06-12 00:25:48 -0700 | [diff] [blame] | 251 | input_report_abs(input, ABS_PRESSURE, data[6] | ((data[7] & 0x03) << 8)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 252 | input_report_key(input, BTN_TOUCH, data[1] & 0x01); |
| 253 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 254 | input_report_key(input, BTN_STYLUS2, data[1] & 0x04); |
Dmitry Torokhov | afb567e | 2010-04-13 23:08:58 -0700 | [diff] [blame] | 255 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 256 | input_report_key(input, BTN_LEFT, data[1] & 0x01); |
| 257 | input_report_key(input, BTN_RIGHT, data[1] & 0x02); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 258 | if (features->type == WACOM_G4 || |
| 259 | features->type == WACOM_MO) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 260 | input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f); |
Mike Auty | d9f66c1 | 2010-08-28 20:35:17 -0700 | [diff] [blame] | 261 | rw = (data[7] & 0x04) - (data[7] & 0x03); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 262 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 263 | input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f); |
Mike Auty | d9f66c1 | 2010-08-28 20:35:17 -0700 | [diff] [blame] | 264 | rw = -(signed char)data[6]; |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 265 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 266 | input_report_rel(input, REL_WHEEL, rw); |
Dmitry Torokhov | afb567e | 2010-04-13 23:08:58 -0700 | [diff] [blame] | 267 | } |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 268 | |
| 269 | if (!prox) |
| 270 | wacom->id[0] = 0; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 271 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* report tool id */ |
| 272 | input_report_key(input, wacom->tool[0], prox); |
Ping Cheng | 998c454 | 2011-07-06 18:05:41 -0700 | [diff] [blame] | 273 | input_event(input, EV_MSC, MSC_SERIAL, 1); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 274 | input_sync(input); /* sync last event */ |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 275 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 276 | |
| 277 | /* send pad data */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 278 | switch (features->type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 279 | case WACOM_G4: |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 280 | prox = data[7] & 0xf8; |
| 281 | if (prox || wacom->id[1]) { |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 282 | wacom->id[1] = PAD_DEVICE_ID; |
Ping Cheng | 0bd10ef | 2011-07-06 18:05:42 -0700 | [diff] [blame] | 283 | input_report_key(input, BTN_BACK, (data[7] & 0x40)); |
| 284 | input_report_key(input, BTN_FORWARD, (data[7] & 0x80)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 285 | rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 286 | input_report_rel(input, REL_WHEEL, rw); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 287 | if (!prox) |
| 288 | wacom->id[1] = 0; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 289 | input_report_abs(input, ABS_MISC, wacom->id[1]); |
| 290 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); |
Ping Cheng | ab687b1 | 2010-04-05 23:07:41 -0700 | [diff] [blame] | 291 | retval = 1; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 292 | } |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 293 | break; |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 294 | |
| 295 | case WACOM_MO: |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 296 | prox = (data[7] & 0xf8) || data[8]; |
| 297 | if (prox || wacom->id[1]) { |
Ping Cheng | e34b9d2 | 2008-05-05 11:36:41 -0400 | [diff] [blame] | 298 | wacom->id[1] = PAD_DEVICE_ID; |
Ping Cheng | 0bd10ef | 2011-07-06 18:05:42 -0700 | [diff] [blame] | 299 | input_report_key(input, BTN_BACK, (data[7] & 0x08)); |
| 300 | input_report_key(input, BTN_LEFT, (data[7] & 0x20)); |
| 301 | input_report_key(input, BTN_FORWARD, (data[7] & 0x10)); |
| 302 | input_report_key(input, BTN_RIGHT, (data[7] & 0x40)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 303 | input_report_abs(input, ABS_WHEEL, (data[8] & 0x7f)); |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 304 | if (!prox) |
| 305 | wacom->id[1] = 0; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 306 | input_report_abs(input, ABS_MISC, wacom->id[1]); |
| 307 | input_event(input, EV_MSC, MSC_SERIAL, 0xf0); |
Ping Cheng | 8446001 | 2011-07-06 18:05:43 -0700 | [diff] [blame] | 308 | retval = 1; |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 309 | } |
| 310 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 311 | } |
Ping Cheng | 3b57ca0 | 2010-03-04 21:50:59 -0800 | [diff] [blame] | 312 | exit: |
| 313 | return retval; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 314 | } |
| 315 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 316 | static int wacom_intuos_inout(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 317 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 318 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 319 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 320 | struct input_dev *input = wacom->input; |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 321 | int idx = 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 322 | |
| 323 | /* tool number */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 324 | if (features->type == INTUOS) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 325 | idx = data[1] & 0x01; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 326 | |
| 327 | /* Enter report */ |
| 328 | if ((data[1] & 0xfc) == 0xc0) { |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 329 | if (features->type >= INTUOS5S && features->type <= INTUOS5L) |
| 330 | wacom->shared->stylus_in_proximity = true; |
| 331 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 332 | /* serial number of the tool */ |
| 333 | wacom->serial[idx] = ((data[3] & 0x0f) << 28) + |
| 334 | (data[4] << 20) + (data[5] << 12) + |
| 335 | (data[6] << 4) + (data[7] >> 4); |
| 336 | |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 337 | wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) | |
| 338 | ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 339 | |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 340 | switch (wacom->id[idx] & 0xfffff) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 341 | case 0x812: /* Inking pen */ |
| 342 | case 0x801: /* Intuos3 Inking pen */ |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 343 | case 0x20802: /* Intuos4 Inking Pen */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 344 | case 0x012: |
| 345 | wacom->tool[idx] = BTN_TOOL_PENCIL; |
| 346 | break; |
| 347 | |
| 348 | case 0x822: /* Pen */ |
| 349 | case 0x842: |
| 350 | case 0x852: |
| 351 | case 0x823: /* Intuos3 Grip Pen */ |
| 352 | case 0x813: /* Intuos3 Classic Pen */ |
| 353 | case 0x885: /* Intuos3 Marker Pen */ |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 354 | case 0x802: /* Intuos4 General Pen */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 355 | case 0x804: /* Intuos4 Marker Pen */ |
| 356 | case 0x40802: /* Intuos4 Classic Pen */ |
| 357 | case 0x022: |
| 358 | wacom->tool[idx] = BTN_TOOL_PEN; |
| 359 | break; |
| 360 | |
| 361 | case 0x832: /* Stroke pen */ |
| 362 | case 0x032: |
| 363 | wacom->tool[idx] = BTN_TOOL_BRUSH; |
| 364 | break; |
| 365 | |
| 366 | case 0x007: /* Mouse 4D and 2D */ |
| 367 | case 0x09c: |
| 368 | case 0x094: |
| 369 | case 0x017: /* Intuos3 2D Mouse */ |
| 370 | case 0x806: /* Intuos4 Mouse */ |
| 371 | wacom->tool[idx] = BTN_TOOL_MOUSE; |
| 372 | break; |
| 373 | |
| 374 | case 0x096: /* Lens cursor */ |
| 375 | case 0x097: /* Intuos3 Lens cursor */ |
| 376 | case 0x006: /* Intuos4 Lens cursor */ |
| 377 | wacom->tool[idx] = BTN_TOOL_LENS; |
| 378 | break; |
| 379 | |
| 380 | case 0x82a: /* Eraser */ |
| 381 | case 0x85a: |
| 382 | case 0x91a: |
| 383 | case 0xd1a: |
| 384 | case 0x0fa: |
| 385 | case 0x82b: /* Intuos3 Grip Pen Eraser */ |
| 386 | case 0x81b: /* Intuos3 Classic Pen Eraser */ |
| 387 | case 0x91b: /* Intuos3 Airbrush Eraser */ |
| 388 | case 0x80c: /* Intuos4 Marker Pen Eraser */ |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 389 | case 0x80a: /* Intuos4 General Pen Eraser */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 390 | case 0x4080a: /* Intuos4 Classic Pen Eraser */ |
| 391 | case 0x90a: /* Intuos4 Airbrush Eraser */ |
| 392 | wacom->tool[idx] = BTN_TOOL_RUBBER; |
| 393 | break; |
| 394 | |
| 395 | case 0xd12: |
| 396 | case 0x912: |
| 397 | case 0x112: |
| 398 | case 0x913: /* Intuos3 Airbrush */ |
| 399 | case 0x902: /* Intuos4 Airbrush */ |
| 400 | wacom->tool[idx] = BTN_TOOL_AIRBRUSH; |
| 401 | break; |
| 402 | |
| 403 | default: /* Unknown tool */ |
| 404 | wacom->tool[idx] = BTN_TOOL_PEN; |
| 405 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 406 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 407 | return 1; |
| 408 | } |
| 409 | |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 410 | /* older I4 styli don't work with new Cintiqs */ |
| 411 | if (!((wacom->id[idx] >> 20) & 0x01) && |
| 412 | (features->type == WACOM_21UX2)) |
| 413 | return 1; |
| 414 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 415 | /* Exit report */ |
| 416 | if ((data[1] & 0xfe) == 0x80) { |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 417 | if (features->type >= INTUOS5S && features->type <= INTUOS5L) |
| 418 | wacom->shared->stylus_in_proximity = false; |
| 419 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 420 | /* |
| 421 | * Reset all states otherwise we lose the initial states |
| 422 | * when in-prox next time |
| 423 | */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 424 | input_report_abs(input, ABS_X, 0); |
| 425 | input_report_abs(input, ABS_Y, 0); |
| 426 | input_report_abs(input, ABS_DISTANCE, 0); |
| 427 | input_report_abs(input, ABS_TILT_X, 0); |
| 428 | input_report_abs(input, ABS_TILT_Y, 0); |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 429 | if (wacom->tool[idx] >= BTN_TOOL_MOUSE) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 430 | input_report_key(input, BTN_LEFT, 0); |
| 431 | input_report_key(input, BTN_MIDDLE, 0); |
| 432 | input_report_key(input, BTN_RIGHT, 0); |
| 433 | input_report_key(input, BTN_SIDE, 0); |
| 434 | input_report_key(input, BTN_EXTRA, 0); |
| 435 | input_report_abs(input, ABS_THROTTLE, 0); |
| 436 | input_report_abs(input, ABS_RZ, 0); |
Ping Cheng | 7ecfbfd | 2007-06-14 23:32:48 -0400 | [diff] [blame] | 437 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 438 | input_report_abs(input, ABS_PRESSURE, 0); |
| 439 | input_report_key(input, BTN_STYLUS, 0); |
| 440 | input_report_key(input, BTN_STYLUS2, 0); |
| 441 | input_report_key(input, BTN_TOUCH, 0); |
| 442 | input_report_abs(input, ABS_WHEEL, 0); |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 443 | if (features->type >= INTUOS3S) |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 444 | input_report_abs(input, ABS_Z, 0); |
Ping Cheng | 8d32e3a | 2006-09-26 13:34:47 -0700 | [diff] [blame] | 445 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 446 | input_report_key(input, wacom->tool[idx], 0); |
| 447 | input_report_abs(input, ABS_MISC, 0); /* reset tool id */ |
| 448 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 449 | wacom->id[idx] = 0; |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 450 | return 2; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 451 | } |
| 452 | return 0; |
| 453 | } |
| 454 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 455 | static void wacom_intuos_general(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 456 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 457 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 458 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 459 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 460 | unsigned int t; |
| 461 | |
| 462 | /* general pen packet */ |
| 463 | if ((data[1] & 0xb8) == 0xa0) { |
| 464 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
Aristeu Rozanski | ca047fe | 2010-10-10 14:12:33 -0700 | [diff] [blame] | 465 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 466 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 467 | (features->type >= WACOM_21UX2 && features->type <= WACOM_24HD)) { |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 468 | t = (t << 1) | (data[1] & 1); |
Aristeu Rozanski | ca047fe | 2010-10-10 14:12:33 -0700 | [diff] [blame] | 469 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 470 | input_report_abs(input, ABS_PRESSURE, t); |
| 471 | input_report_abs(input, ABS_TILT_X, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 472 | ((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 473 | input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f); |
| 474 | input_report_key(input, BTN_STYLUS, data[1] & 2); |
| 475 | input_report_key(input, BTN_STYLUS2, data[1] & 4); |
| 476 | input_report_key(input, BTN_TOUCH, t > 10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 477 | } |
| 478 | |
| 479 | /* airbrush second packet */ |
| 480 | if ((data[1] & 0xbc) == 0xb4) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 481 | input_report_abs(input, ABS_WHEEL, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 482 | (data[6] << 2) | ((data[7] >> 6) & 3)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 483 | input_report_abs(input, ABS_TILT_X, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 484 | ((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 485 | input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 486 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 487 | } |
| 488 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 489 | static int wacom_intuos_irq(struct wacom_wac *wacom) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 490 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 491 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 492 | unsigned char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 493 | struct input_dev *input = wacom->input; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 494 | unsigned int t; |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 495 | int idx = 0, result; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 496 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 497 | if (data[0] != WACOM_REPORT_PENABLED && |
| 498 | data[0] != WACOM_REPORT_INTUOSREAD && |
| 499 | data[0] != WACOM_REPORT_INTUOSWRITE && |
| 500 | data[0] != WACOM_REPORT_INTUOSPAD && |
| 501 | data[0] != WACOM_REPORT_INTUOS5PAD) { |
| 502 | dev_dbg(input->dev.parent, |
| 503 | "%s: received unknown report #%d\n", __func__, data[0]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 504 | return 0; |
| 505 | } |
| 506 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 507 | /* tool number */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 508 | if (features->type == INTUOS) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 509 | idx = data[1] & 0x01; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 510 | |
| 511 | /* pad packets. Works as a second tool and is always in prox */ |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 512 | if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 513 | if (features->type >= INTUOS4S && features->type <= INTUOS4L) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 514 | input_report_key(input, BTN_0, (data[2] & 0x01)); |
| 515 | input_report_key(input, BTN_1, (data[3] & 0x01)); |
| 516 | input_report_key(input, BTN_2, (data[3] & 0x02)); |
| 517 | input_report_key(input, BTN_3, (data[3] & 0x04)); |
| 518 | input_report_key(input, BTN_4, (data[3] & 0x08)); |
| 519 | input_report_key(input, BTN_5, (data[3] & 0x10)); |
| 520 | input_report_key(input, BTN_6, (data[3] & 0x20)); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 521 | if (data[1] & 0x80) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 522 | input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f)); |
Ping Cheng | a862952 | 2009-06-02 16:59:58 -0700 | [diff] [blame] | 523 | } else { |
| 524 | /* Out of proximity, clear wheel value. */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 525 | input_report_abs(input, ABS_WHEEL, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 526 | } |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 527 | if (features->type != INTUOS4S) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 528 | input_report_key(input, BTN_7, (data[3] & 0x40)); |
| 529 | input_report_key(input, BTN_8, (data[3] & 0x80)); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 530 | } |
| 531 | if (data[1] | (data[2] & 0x01) | data[3]) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 532 | input_report_key(input, wacom->tool[1], 1); |
| 533 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 534 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 535 | input_report_key(input, wacom->tool[1], 0); |
| 536 | input_report_abs(input, ABS_MISC, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 537 | } |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 538 | } else if (features->type == WACOM_24HD) { |
| 539 | input_report_key(input, BTN_0, (data[6] & 0x01)); |
| 540 | input_report_key(input, BTN_1, (data[6] & 0x02)); |
| 541 | input_report_key(input, BTN_2, (data[6] & 0x04)); |
| 542 | input_report_key(input, BTN_3, (data[6] & 0x08)); |
| 543 | input_report_key(input, BTN_4, (data[6] & 0x10)); |
| 544 | input_report_key(input, BTN_5, (data[6] & 0x20)); |
| 545 | input_report_key(input, BTN_6, (data[6] & 0x40)); |
| 546 | input_report_key(input, BTN_7, (data[6] & 0x80)); |
| 547 | input_report_key(input, BTN_8, (data[8] & 0x01)); |
| 548 | input_report_key(input, BTN_9, (data[8] & 0x02)); |
| 549 | input_report_key(input, BTN_A, (data[8] & 0x04)); |
| 550 | input_report_key(input, BTN_B, (data[8] & 0x08)); |
| 551 | input_report_key(input, BTN_C, (data[8] & 0x10)); |
| 552 | input_report_key(input, BTN_X, (data[8] & 0x20)); |
| 553 | input_report_key(input, BTN_Y, (data[8] & 0x40)); |
| 554 | input_report_key(input, BTN_Z, (data[8] & 0x80)); |
| 555 | |
| 556 | /* |
| 557 | * Three "buttons" are available on the 24HD which are |
| 558 | * physically implemented as a touchstrip. Each button |
| 559 | * is approximately 3 bits wide with a 2 bit spacing. |
| 560 | * The raw touchstrip bits are stored at: |
| 561 | * ((data[3] & 0x1f) << 8) | data[4]) |
| 562 | */ |
| 563 | input_report_key(input, KEY_PROG1, data[4] & 0x07); |
| 564 | input_report_key(input, KEY_PROG2, data[4] & 0xE0); |
| 565 | input_report_key(input, KEY_PROG3, data[3] & 0x1C); |
| 566 | |
| 567 | if (data[1] & 0x80) { |
| 568 | input_report_abs(input, ABS_WHEEL, (data[1] & 0x7f)); |
| 569 | } else { |
| 570 | /* Out of proximity, clear wheel value. */ |
| 571 | input_report_abs(input, ABS_WHEEL, 0); |
| 572 | } |
| 573 | |
| 574 | if (data[2] & 0x80) { |
| 575 | input_report_abs(input, ABS_THROTTLE, (data[2] & 0x7f)); |
| 576 | } else { |
| 577 | /* Out of proximity, clear second wheel value. */ |
| 578 | input_report_abs(input, ABS_THROTTLE, 0); |
| 579 | } |
| 580 | |
| 581 | if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) { |
| 582 | input_report_key(input, wacom->tool[1], 1); |
| 583 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 584 | } else { |
| 585 | input_report_key(input, wacom->tool[1], 0); |
| 586 | input_report_abs(input, ABS_MISC, 0); |
| 587 | } |
Jason Gerecke | f860e58 | 2012-04-03 15:48:35 -0700 | [diff] [blame] | 588 | } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { |
| 589 | int i; |
| 590 | |
| 591 | /* Touch ring mode switch has no capacitive sensor */ |
| 592 | input_report_key(input, BTN_0, (data[3] & 0x01)); |
| 593 | |
| 594 | /* |
| 595 | * ExpressKeys on Intuos5 have a capacitive sensor in |
| 596 | * addition to the mechanical switch. Switch data is |
| 597 | * stored in data[4], capacitive data in data[5]. |
| 598 | */ |
| 599 | for (i = 0; i < 8; i++) |
| 600 | input_report_key(input, BTN_1 + i, data[4] & (1 << i)); |
| 601 | |
| 602 | if (data[2] & 0x80) { |
| 603 | input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f)); |
| 604 | } else { |
| 605 | /* Out of proximity, clear wheel value. */ |
| 606 | input_report_abs(input, ABS_WHEEL, 0); |
| 607 | } |
| 608 | |
| 609 | if (data[2] | (data[3] & 0x01) | data[4]) { |
| 610 | input_report_key(input, wacom->tool[1], 1); |
| 611 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
| 612 | } else { |
| 613 | input_report_key(input, wacom->tool[1], 0); |
| 614 | input_report_abs(input, ABS_MISC, 0); |
| 615 | } |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 616 | } else { |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 617 | if (features->type == WACOM_21UX2 || features->type == WACOM_22HD) { |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 618 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
| 619 | input_report_key(input, BTN_1, (data[6] & 0x01)); |
| 620 | input_report_key(input, BTN_2, (data[6] & 0x02)); |
| 621 | input_report_key(input, BTN_3, (data[6] & 0x04)); |
| 622 | input_report_key(input, BTN_4, (data[6] & 0x08)); |
| 623 | input_report_key(input, BTN_5, (data[6] & 0x10)); |
| 624 | input_report_key(input, BTN_6, (data[6] & 0x20)); |
| 625 | input_report_key(input, BTN_7, (data[6] & 0x40)); |
| 626 | input_report_key(input, BTN_8, (data[6] & 0x80)); |
| 627 | input_report_key(input, BTN_9, (data[7] & 0x01)); |
| 628 | input_report_key(input, BTN_A, (data[8] & 0x01)); |
| 629 | input_report_key(input, BTN_B, (data[8] & 0x02)); |
| 630 | input_report_key(input, BTN_C, (data[8] & 0x04)); |
| 631 | input_report_key(input, BTN_X, (data[8] & 0x08)); |
| 632 | input_report_key(input, BTN_Y, (data[8] & 0x10)); |
| 633 | input_report_key(input, BTN_Z, (data[8] & 0x20)); |
| 634 | input_report_key(input, BTN_BASE, (data[8] & 0x40)); |
| 635 | input_report_key(input, BTN_BASE2, (data[8] & 0x80)); |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 636 | |
| 637 | if (features->type == WACOM_22HD) { |
| 638 | input_report_key(input, KEY_PROG1, data[9] & 0x01); |
| 639 | input_report_key(input, KEY_PROG2, data[9] & 0x02); |
| 640 | input_report_key(input, KEY_PROG3, data[9] & 0x04); |
| 641 | } |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 642 | } else { |
| 643 | input_report_key(input, BTN_0, (data[5] & 0x01)); |
| 644 | input_report_key(input, BTN_1, (data[5] & 0x02)); |
| 645 | input_report_key(input, BTN_2, (data[5] & 0x04)); |
| 646 | input_report_key(input, BTN_3, (data[5] & 0x08)); |
| 647 | input_report_key(input, BTN_4, (data[6] & 0x01)); |
| 648 | input_report_key(input, BTN_5, (data[6] & 0x02)); |
| 649 | input_report_key(input, BTN_6, (data[6] & 0x04)); |
| 650 | input_report_key(input, BTN_7, (data[6] & 0x08)); |
| 651 | input_report_key(input, BTN_8, (data[5] & 0x10)); |
| 652 | input_report_key(input, BTN_9, (data[6] & 0x10)); |
| 653 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 654 | input_report_abs(input, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); |
| 655 | input_report_abs(input, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 656 | |
Ping Cheng | 493630b | 2010-06-22 11:21:34 -0700 | [diff] [blame] | 657 | if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) | |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 658 | data[2] | (data[3] & 0x1f) | data[4] | data[8] | |
| 659 | (data[7] & 0x01)) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 660 | input_report_key(input, wacom->tool[1], 1); |
| 661 | input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 662 | } else { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 663 | input_report_key(input, wacom->tool[1], 0); |
| 664 | input_report_abs(input, ABS_MISC, 0); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 665 | } |
| 666 | } |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 667 | input_event(input, EV_MSC, MSC_SERIAL, 0xffffffff); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 668 | return 1; |
| 669 | } |
| 670 | |
| 671 | /* process in/out prox events */ |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 672 | result = wacom_intuos_inout(wacom); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 673 | if (result) |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 674 | return result - 1; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 675 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 676 | /* don't proceed if we don't know the ID */ |
| 677 | if (!wacom->id[idx]) |
| 678 | return 0; |
| 679 | |
| 680 | /* Only large Intuos support Lense Cursor */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 681 | if (wacom->tool[idx] == BTN_TOOL_LENS && |
| 682 | (features->type == INTUOS3 || |
| 683 | features->type == INTUOS3S || |
| 684 | features->type == INTUOS4 || |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 685 | features->type == INTUOS4S || |
| 686 | features->type == INTUOS5 || |
| 687 | features->type == INTUOS5S)) { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 688 | |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 689 | return 0; |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 690 | } |
Ping Cheng | 80d4e8e | 2007-02-23 12:22:48 -0800 | [diff] [blame] | 691 | |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 692 | /* Cintiq doesn't send data when RDY bit isn't set */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 693 | if (features->type == CINTIQ && !(data[1] & 0x40)) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 694 | return 0; |
| 695 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 696 | if (features->type >= INTUOS3S) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 697 | input_report_abs(input, ABS_X, (data[2] << 9) | (data[3] << 1) | ((data[9] >> 1) & 1)); |
| 698 | input_report_abs(input, ABS_Y, (data[4] << 9) | (data[5] << 1) | (data[9] & 1)); |
| 699 | input_report_abs(input, ABS_DISTANCE, ((data[9] >> 2) & 0x3f)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 700 | } else { |
Dmitry Torokhov | 252f776 | 2010-03-19 22:33:38 -0700 | [diff] [blame] | 701 | input_report_abs(input, ABS_X, be16_to_cpup((__be16 *)&data[2])); |
| 702 | input_report_abs(input, ABS_Y, be16_to_cpup((__be16 *)&data[4])); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 703 | input_report_abs(input, ABS_DISTANCE, ((data[9] >> 3) & 0x1f)); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 704 | } |
| 705 | |
| 706 | /* process general packets */ |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 707 | wacom_intuos_general(wacom); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 708 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 709 | /* 4D mouse, 2D mouse, marker pen rotation, tilt mouse, or Lens cursor packets */ |
| 710 | 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] | 711 | |
| 712 | if (data[1] & 0x02) { |
| 713 | /* Rotation packet */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 714 | if (features->type >= INTUOS3S) { |
Ping Cheng | 0e1763f | 2008-03-13 16:46:46 -0400 | [diff] [blame] | 715 | /* I3 marker pen rotation */ |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 716 | t = (data[6] << 3) | ((data[7] >> 5) & 7); |
| 717 | t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : |
| 718 | ((t-1) / 2 + 450)) : (450 - t / 2) ; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 719 | input_report_abs(input, ABS_Z, t); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 720 | } else { |
| 721 | /* 4D mouse rotation packet */ |
| 722 | t = (data[6] << 3) | ((data[7] >> 5) & 7); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 723 | input_report_abs(input, ABS_RZ, (data[7] & 0x20) ? |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 724 | ((t - 1) / 2) : -t / 2); |
| 725 | } |
| 726 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 727 | } else if (!(data[1] & 0x10) && features->type < INTUOS3S) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 728 | /* 4D mouse packet */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 729 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
| 730 | input_report_key(input, BTN_MIDDLE, data[8] & 0x02); |
| 731 | input_report_key(input, BTN_RIGHT, data[8] & 0x04); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 732 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 733 | input_report_key(input, BTN_SIDE, data[8] & 0x20); |
| 734 | input_report_key(input, BTN_EXTRA, data[8] & 0x10); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 735 | t = (data[6] << 2) | ((data[7] >> 6) & 3); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 736 | input_report_abs(input, ABS_THROTTLE, (data[8] & 0x08) ? -t : t); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 737 | |
| 738 | } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) { |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 739 | /* I4 mouse */ |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 740 | if ((features->type >= INTUOS4S && features->type <= INTUOS4L) || |
| 741 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 742 | input_report_key(input, BTN_LEFT, data[6] & 0x01); |
| 743 | input_report_key(input, BTN_MIDDLE, data[6] & 0x02); |
| 744 | input_report_key(input, BTN_RIGHT, data[6] & 0x04); |
| 745 | input_report_rel(input, REL_WHEEL, ((data[7] & 0x80) >> 7) |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 746 | - ((data[7] & 0x40) >> 6)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 747 | input_report_key(input, BTN_SIDE, data[6] & 0x08); |
| 748 | input_report_key(input, BTN_EXTRA, data[6] & 0x10); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 749 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 750 | input_report_abs(input, ABS_TILT_X, |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 751 | ((data[7] << 1) & 0x7e) | (data[8] >> 7)); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 752 | input_report_abs(input, ABS_TILT_Y, data[8] & 0x7f); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 753 | } else { |
| 754 | /* 2D mouse packet */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 755 | input_report_key(input, BTN_LEFT, data[8] & 0x04); |
| 756 | input_report_key(input, BTN_MIDDLE, data[8] & 0x08); |
| 757 | input_report_key(input, BTN_RIGHT, data[8] & 0x10); |
| 758 | input_report_rel(input, REL_WHEEL, (data[8] & 0x01) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 759 | - ((data[8] & 0x02) >> 1)); |
| 760 | |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 761 | /* I3 2D mouse side buttons */ |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 762 | if (features->type >= INTUOS3S && features->type <= INTUOS3L) { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 763 | input_report_key(input, BTN_SIDE, data[8] & 0x40); |
| 764 | input_report_key(input, BTN_EXTRA, data[8] & 0x20); |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 765 | } |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 766 | } |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 767 | } else if ((features->type < INTUOS3S || features->type == INTUOS3L || |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 768 | features->type == INTUOS4L || features->type == INTUOS5L) && |
Ping Cheng | 6f660f1 | 2009-05-08 18:30:33 -0700 | [diff] [blame] | 769 | wacom->tool[idx] == BTN_TOOL_LENS) { |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 770 | /* Lens cursor packets */ |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 771 | input_report_key(input, BTN_LEFT, data[8] & 0x01); |
| 772 | input_report_key(input, BTN_MIDDLE, data[8] & 0x02); |
| 773 | input_report_key(input, BTN_RIGHT, data[8] & 0x04); |
| 774 | input_report_key(input, BTN_SIDE, data[8] & 0x10); |
| 775 | input_report_key(input, BTN_EXTRA, data[8] & 0x08); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 776 | } |
| 777 | } |
| 778 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 779 | input_report_abs(input, ABS_MISC, wacom->id[idx]); /* report tool id */ |
| 780 | input_report_key(input, wacom->tool[idx], 1); |
| 781 | input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 782 | return 1; |
| 783 | } |
| 784 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 785 | static int find_slot_from_contactid(struct wacom_wac *wacom, int contactid) |
| 786 | { |
| 787 | int touch_max = wacom->features.touch_max; |
| 788 | int i; |
| 789 | |
| 790 | if (!wacom->slots) |
| 791 | return -1; |
| 792 | |
| 793 | for (i = 0; i < touch_max; ++i) { |
| 794 | if (wacom->slots[i] == contactid) |
| 795 | return i; |
| 796 | } |
| 797 | for (i = 0; i < touch_max; ++i) { |
| 798 | if (wacom->slots[i] == -1) |
| 799 | return i; |
| 800 | } |
| 801 | return -1; |
| 802 | } |
| 803 | |
| 804 | static int wacom_mt_touch(struct wacom_wac *wacom) |
| 805 | { |
| 806 | struct input_dev *input = wacom->input; |
| 807 | char *data = wacom->data; |
| 808 | int i; |
| 809 | int current_num_contacts = data[2]; |
| 810 | int contacts_to_send = 0; |
| 811 | |
| 812 | /* |
| 813 | * First packet resets the counter since only the first |
| 814 | * packet in series will have non-zero current_num_contacts. |
| 815 | */ |
| 816 | if (current_num_contacts) |
| 817 | wacom->num_contacts_left = current_num_contacts; |
| 818 | |
| 819 | /* There are at most 5 contacts per packet */ |
| 820 | contacts_to_send = min(5, wacom->num_contacts_left); |
| 821 | |
| 822 | for (i = 0; i < contacts_to_send; i++) { |
| 823 | int offset = (WACOM_BYTES_PER_MT_PACKET * i) + 3; |
| 824 | bool touch = data[offset] & 0x1; |
| 825 | int id = le16_to_cpup((__le16 *)&data[offset + 1]); |
| 826 | int slot = find_slot_from_contactid(wacom, id); |
| 827 | |
| 828 | if (slot < 0) |
| 829 | continue; |
| 830 | |
| 831 | input_mt_slot(input, slot); |
| 832 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 833 | if (touch) { |
| 834 | int x = le16_to_cpup((__le16 *)&data[offset + 7]); |
| 835 | int y = le16_to_cpup((__le16 *)&data[offset + 9]); |
| 836 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 837 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
| 838 | } |
| 839 | wacom->slots[slot] = touch ? id : -1; |
| 840 | } |
| 841 | |
| 842 | input_mt_report_pointer_emulation(input, true); |
| 843 | |
| 844 | wacom->num_contacts_left -= contacts_to_send; |
| 845 | if (wacom->num_contacts_left < 0) |
| 846 | wacom->num_contacts_left = 0; |
| 847 | |
| 848 | return 1; |
| 849 | } |
| 850 | |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 851 | static int wacom_tpc_mt_touch(struct wacom_wac *wacom) |
| 852 | { |
| 853 | struct input_dev *input = wacom->input; |
| 854 | unsigned char *data = wacom->data; |
| 855 | int contact_with_no_pen_down_count = 0; |
| 856 | int i; |
| 857 | |
| 858 | for (i = 0; i < 2; i++) { |
| 859 | int p = data[1] & (1 << i); |
| 860 | bool touch = p && !wacom->shared->stylus_in_proximity; |
| 861 | |
| 862 | input_mt_slot(input, i); |
| 863 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 864 | if (touch) { |
| 865 | int x = le16_to_cpup((__le16 *)&data[i * 2 + 2]) & 0x7fff; |
| 866 | int y = le16_to_cpup((__le16 *)&data[i * 2 + 6]) & 0x7fff; |
| 867 | |
| 868 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 869 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
| 870 | contact_with_no_pen_down_count++; |
| 871 | } |
| 872 | } |
| 873 | |
| 874 | /* keep touch state for pen event */ |
| 875 | wacom->shared->touch_down = (contact_with_no_pen_down_count > 0); |
| 876 | |
| 877 | input_mt_report_pointer_emulation(input, true); |
| 878 | |
| 879 | return 1; |
| 880 | } |
| 881 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 882 | 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] | 883 | { |
| 884 | char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 885 | struct input_dev *input = wacom->input; |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 886 | bool prox; |
| 887 | int x = 0, y = 0; |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 888 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 889 | if (wacom->features.touch_max > 1 || len > WACOM_PKGLEN_TPC2FG) |
| 890 | return 0; |
| 891 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 892 | if (!wacom->shared->stylus_in_proximity) { |
| 893 | if (len == WACOM_PKGLEN_TPC1FG) { |
| 894 | prox = data[0] & 0x01; |
| 895 | x = get_unaligned_le16(&data[1]); |
| 896 | y = get_unaligned_le16(&data[3]); |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 897 | } else { |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 898 | prox = data[1] & 0x01; |
| 899 | x = le16_to_cpup((__le16 *)&data[2]); |
| 900 | y = le16_to_cpup((__le16 *)&data[4]); |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 901 | } |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 902 | } else |
| 903 | /* force touch out when pen is in prox */ |
| 904 | prox = 0; |
| 905 | |
| 906 | if (prox) { |
| 907 | input_report_abs(input, ABS_X, x); |
| 908 | input_report_abs(input, ABS_Y, y); |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 909 | } |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 910 | input_report_key(input, BTN_TOUCH, prox); |
| 911 | |
| 912 | /* keep touch state for pen events */ |
| 913 | wacom->shared->touch_down = prox; |
| 914 | |
| 915 | return 1; |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 916 | } |
| 917 | |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 918 | static int wacom_tpc_pen(struct wacom_wac *wacom) |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 919 | { |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 920 | struct wacom_features *features = &wacom->features; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 921 | char *data = wacom->data; |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 922 | struct input_dev *input = wacom->input; |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 923 | int pressure; |
| 924 | bool prox = data[1] & 0x20; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 925 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 926 | if (!wacom->shared->stylus_in_proximity) /* first in prox */ |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 927 | /* Going into proximity select tool */ |
| 928 | wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 929 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 930 | /* keep pen state for touch events */ |
| 931 | wacom->shared->stylus_in_proximity = prox; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 932 | |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 933 | /* send pen events only when touch is up or forced out */ |
| 934 | if (!wacom->shared->touch_down) { |
| 935 | input_report_key(input, BTN_STYLUS, data[1] & 0x02); |
| 936 | input_report_key(input, BTN_STYLUS2, data[1] & 0x10); |
| 937 | input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2])); |
| 938 | input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4])); |
| 939 | pressure = ((data[7] & 0x01) << 8) | data[6]; |
| 940 | if (pressure < 0) |
| 941 | pressure = features->pressure_max + pressure + 1; |
| 942 | input_report_abs(input, ABS_PRESSURE, pressure); |
| 943 | input_report_key(input, BTN_TOUCH, data[1] & 0x05); |
| 944 | input_report_key(input, wacom->tool[0], prox); |
| 945 | return 1; |
| 946 | } |
| 947 | |
| 948 | return 0; |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 949 | } |
| 950 | |
| 951 | static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) |
| 952 | { |
| 953 | char *data = wacom->data; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 954 | |
Dmitry Torokhov | eb71d1b | 2012-05-02 00:13:38 -0700 | [diff] [blame] | 955 | dev_dbg(wacom->input->dev.parent, |
| 956 | "%s: received report #%d\n", __func__, data[0]); |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 957 | |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 958 | switch (len) { |
| 959 | case WACOM_PKGLEN_TPC1FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 960 | return wacom_tpc_single_touch(wacom, len); |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 961 | |
| 962 | case WACOM_PKGLEN_TPC2FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 963 | return wacom_tpc_mt_touch(wacom); |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 964 | |
| 965 | default: |
| 966 | switch (data[0]) { |
| 967 | case WACOM_REPORT_TPC1FG: |
| 968 | case WACOM_REPORT_TPCHID: |
| 969 | case WACOM_REPORT_TPCST: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 970 | case WACOM_REPORT_TPC1FGE: |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 971 | return wacom_tpc_single_touch(wacom, len); |
| 972 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 973 | case WACOM_REPORT_TPCMT: |
| 974 | return wacom_mt_touch(wacom); |
| 975 | |
Ping Cheng | 31175a8 | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 976 | case WACOM_REPORT_PENABLED: |
| 977 | return wacom_tpc_pen(wacom); |
| 978 | } |
| 979 | } |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 980 | |
Ping Cheng | 8aa9a9a | 2011-03-12 20:34:11 -0800 | [diff] [blame] | 981 | return 0; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 982 | } |
| 983 | |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 984 | static int wacom_bpt_touch(struct wacom_wac *wacom) |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 985 | { |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 986 | struct wacom_features *features = &wacom->features; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 987 | struct input_dev *input = wacom->input; |
| 988 | unsigned char *data = wacom->data; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 989 | int i; |
| 990 | |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 991 | if (data[0] != 0x02) |
| 992 | return 0; |
| 993 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 994 | for (i = 0; i < 2; i++) { |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 995 | int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); |
| 996 | bool touch = data[offset + 3] & 0x80; |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 997 | |
Chris Bagwell | 33d5f71 | 2010-09-12 00:12:28 -0700 | [diff] [blame] | 998 | /* |
| 999 | * Touch events need to be disabled while stylus is |
| 1000 | * in proximity because user's hand is resting on touchpad |
| 1001 | * and sending unwanted events. User expects tablet buttons |
| 1002 | * to continue working though. |
| 1003 | */ |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 1004 | touch = touch && !wacom->shared->stylus_in_proximity; |
| 1005 | |
| 1006 | input_mt_slot(input, i); |
| 1007 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 1008 | if (touch) { |
Chris Bagwell | 8f90686 | 2011-09-09 13:38:10 -0700 | [diff] [blame] | 1009 | int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff; |
| 1010 | int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff; |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1011 | if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { |
| 1012 | x <<= 5; |
| 1013 | y <<= 5; |
| 1014 | } |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1015 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1016 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1017 | } |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1018 | } |
| 1019 | |
Henrik Rydberg | c5f4dec | 2010-12-15 13:50:34 +0100 | [diff] [blame] | 1020 | input_mt_report_pointer_emulation(input, true); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1021 | |
| 1022 | input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); |
| 1023 | input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); |
| 1024 | input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); |
| 1025 | input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); |
| 1026 | |
| 1027 | input_sync(input); |
| 1028 | |
| 1029 | return 0; |
| 1030 | } |
| 1031 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1032 | static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data) |
| 1033 | { |
| 1034 | struct input_dev *input = wacom->input; |
| 1035 | int slot_id = data[0] - 2; /* data[0] is between 2 and 17 */ |
| 1036 | bool touch = data[1] & 0x80; |
| 1037 | |
| 1038 | touch = touch && !wacom->shared->stylus_in_proximity; |
| 1039 | |
| 1040 | input_mt_slot(input, slot_id); |
| 1041 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); |
| 1042 | |
| 1043 | if (touch) { |
| 1044 | int x = (data[2] << 4) | (data[4] >> 4); |
| 1045 | int y = (data[3] << 4) | (data[4] & 0x0f); |
| 1046 | int w = data[6]; |
| 1047 | |
| 1048 | input_report_abs(input, ABS_MT_POSITION_X, x); |
| 1049 | input_report_abs(input, ABS_MT_POSITION_Y, y); |
| 1050 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, w); |
| 1051 | } |
| 1052 | } |
| 1053 | |
| 1054 | static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data) |
| 1055 | { |
| 1056 | struct input_dev *input = wacom->input; |
| 1057 | |
| 1058 | input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0); |
| 1059 | input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0); |
| 1060 | input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0); |
| 1061 | input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0); |
| 1062 | } |
| 1063 | |
| 1064 | static int wacom_bpt3_touch(struct wacom_wac *wacom) |
| 1065 | { |
| 1066 | struct input_dev *input = wacom->input; |
| 1067 | unsigned char *data = wacom->data; |
Jason Gerecke | 19d57d3 | 2012-03-06 10:19:19 -0800 | [diff] [blame] | 1068 | int count = data[1] & 0x07; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1069 | int i; |
| 1070 | |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 1071 | if (data[0] != 0x02) |
| 1072 | return 0; |
| 1073 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1074 | /* data has up to 7 fixed sized 8-byte messages starting at data[2] */ |
| 1075 | for (i = 0; i < count; i++) { |
| 1076 | int offset = (8 * i) + 2; |
| 1077 | int msg_id = data[offset]; |
| 1078 | |
| 1079 | if (msg_id >= 2 && msg_id <= 17) |
| 1080 | wacom_bpt3_touch_msg(wacom, data + offset); |
| 1081 | else if (msg_id == 128) |
| 1082 | wacom_bpt3_button_msg(wacom, data + offset); |
| 1083 | |
| 1084 | } |
| 1085 | |
| 1086 | input_mt_report_pointer_emulation(input, true); |
| 1087 | |
| 1088 | input_sync(input); |
| 1089 | |
| 1090 | return 0; |
| 1091 | } |
| 1092 | |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1093 | static int wacom_bpt_pen(struct wacom_wac *wacom) |
| 1094 | { |
| 1095 | struct input_dev *input = wacom->input; |
| 1096 | unsigned char *data = wacom->data; |
| 1097 | int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0; |
| 1098 | |
Chris Bagwell | 5a6c865 | 2011-11-07 19:52:42 -0800 | [diff] [blame] | 1099 | if (data[0] != 0x02) |
| 1100 | return 0; |
| 1101 | |
Chris Bagwell | c598141 | 2011-10-26 22:28:34 -0700 | [diff] [blame] | 1102 | prox = (data[1] & 0x20) == 0x20; |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1103 | |
| 1104 | /* |
| 1105 | * All reports shared between PEN and RUBBER tool must be |
| 1106 | * forced to a known starting value (zero) when transitioning to |
| 1107 | * out-of-prox. |
| 1108 | * |
| 1109 | * If not reset then, to userspace, it will look like lost events |
| 1110 | * if new tool comes in-prox with same values as previous tool sent. |
| 1111 | * |
| 1112 | * Hardware does report zero in most out-of-prox cases but not all. |
| 1113 | */ |
| 1114 | if (prox) { |
| 1115 | if (!wacom->shared->stylus_in_proximity) { |
| 1116 | if (data[1] & 0x08) { |
| 1117 | wacom->tool[0] = BTN_TOOL_RUBBER; |
| 1118 | wacom->id[0] = ERASER_DEVICE_ID; |
| 1119 | } else { |
| 1120 | wacom->tool[0] = BTN_TOOL_PEN; |
| 1121 | wacom->id[0] = STYLUS_DEVICE_ID; |
| 1122 | } |
| 1123 | wacom->shared->stylus_in_proximity = true; |
| 1124 | } |
| 1125 | x = le16_to_cpup((__le16 *)&data[2]); |
| 1126 | y = le16_to_cpup((__le16 *)&data[4]); |
| 1127 | p = le16_to_cpup((__le16 *)&data[6]); |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1128 | /* |
| 1129 | * Convert distance from out prox to distance from tablet. |
| 1130 | * distance will be greater than distance_max once |
| 1131 | * touching and applying pressure; do not report negative |
| 1132 | * distance. |
| 1133 | */ |
| 1134 | if (data[8] <= wacom->features.distance_max) |
| 1135 | d = wacom->features.distance_max - data[8]; |
| 1136 | |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1137 | pen = data[1] & 0x01; |
| 1138 | btn1 = data[1] & 0x02; |
| 1139 | btn2 = data[1] & 0x04; |
| 1140 | } |
| 1141 | |
| 1142 | input_report_key(input, BTN_TOUCH, pen); |
| 1143 | input_report_key(input, BTN_STYLUS, btn1); |
| 1144 | input_report_key(input, BTN_STYLUS2, btn2); |
| 1145 | |
| 1146 | input_report_abs(input, ABS_X, x); |
| 1147 | input_report_abs(input, ABS_Y, y); |
| 1148 | input_report_abs(input, ABS_PRESSURE, p); |
| 1149 | input_report_abs(input, ABS_DISTANCE, d); |
| 1150 | |
| 1151 | if (!prox) { |
| 1152 | wacom->id[0] = 0; |
| 1153 | wacom->shared->stylus_in_proximity = false; |
| 1154 | } |
| 1155 | |
| 1156 | input_report_key(input, wacom->tool[0], prox); /* PEN or RUBBER */ |
| 1157 | input_report_abs(input, ABS_MISC, wacom->id[0]); /* TOOL ID */ |
| 1158 | |
| 1159 | return 1; |
| 1160 | } |
| 1161 | |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 1162 | static int wacom_bpt_irq(struct wacom_wac *wacom, size_t len) |
| 1163 | { |
| 1164 | if (len == WACOM_PKGLEN_BBTOUCH) |
| 1165 | return wacom_bpt_touch(wacom); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1166 | else if (len == WACOM_PKGLEN_BBTOUCH3) |
| 1167 | return wacom_bpt3_touch(wacom); |
| 1168 | else if (len == WACOM_PKGLEN_BBFUN || len == WACOM_PKGLEN_BBPEN) |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1169 | return wacom_bpt_pen(wacom); |
Chris Bagwell | e1d38e4 | 2010-09-12 00:09:27 -0700 | [diff] [blame] | 1170 | |
| 1171 | return 0; |
| 1172 | } |
| 1173 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1174 | static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len) |
| 1175 | { |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1176 | unsigned char *data = wacom->data; |
| 1177 | int connected; |
| 1178 | |
| 1179 | if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80) |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1180 | return 0; |
| 1181 | |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1182 | connected = data[1] & 0x01; |
| 1183 | if (connected) { |
Chris Bagwell | a1d552c | 2012-03-25 23:26:30 -0700 | [diff] [blame] | 1184 | int pid, battery; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1185 | |
| 1186 | pid = get_unaligned_be16(&data[6]); |
Chris Bagwell | a1d552c | 2012-03-25 23:26:30 -0700 | [diff] [blame] | 1187 | battery = data[5] & 0x3f; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1188 | if (wacom->pid != pid) { |
| 1189 | wacom->pid = pid; |
| 1190 | wacom_schedule_work(wacom); |
| 1191 | } |
Chris Bagwell | a1d552c | 2012-03-25 23:26:30 -0700 | [diff] [blame] | 1192 | wacom->battery_capacity = battery; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1193 | } else if (wacom->pid != 0) { |
| 1194 | /* disconnected while previously connected */ |
| 1195 | wacom->pid = 0; |
| 1196 | wacom_schedule_work(wacom); |
Chris Bagwell | a1d552c | 2012-03-25 23:26:30 -0700 | [diff] [blame] | 1197 | wacom->battery_capacity = 0; |
Chris Bagwell | 16bf288 | 2012-03-25 23:26:20 -0700 | [diff] [blame] | 1198 | } |
| 1199 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1200 | return 0; |
| 1201 | } |
| 1202 | |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1203 | void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1204 | { |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1205 | bool sync; |
| 1206 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 1207 | switch (wacom_wac->features.type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1208 | case PENPARTNER: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1209 | sync = wacom_penpartner_irq(wacom_wac); |
| 1210 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1211 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1212 | case PL: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1213 | sync = wacom_pl_irq(wacom_wac); |
| 1214 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1215 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1216 | case WACOM_G4: |
| 1217 | case GRAPHIRE: |
| 1218 | case WACOM_MO: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1219 | sync = wacom_graphire_irq(wacom_wac); |
| 1220 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1221 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1222 | case PTU: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1223 | sync = wacom_ptu_irq(wacom_wac); |
| 1224 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1225 | |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 1226 | case DTU: |
| 1227 | sync = wacom_dtu_irq(wacom_wac); |
| 1228 | break; |
| 1229 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1230 | case INTUOS: |
| 1231 | case INTUOS3S: |
| 1232 | case INTUOS3: |
| 1233 | case INTUOS3L: |
| 1234 | case INTUOS4S: |
| 1235 | case INTUOS4: |
| 1236 | case INTUOS4L: |
| 1237 | case CINTIQ: |
| 1238 | case WACOM_BEE: |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 1239 | case WACOM_21UX2: |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 1240 | case WACOM_22HD: |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 1241 | case WACOM_24HD: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1242 | sync = wacom_intuos_irq(wacom_wac); |
| 1243 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1244 | |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 1245 | case INTUOS5S: |
| 1246 | case INTUOS5: |
| 1247 | case INTUOS5L: |
| 1248 | if (len == WACOM_PKGLEN_BBTOUCH3) |
| 1249 | sync = wacom_bpt3_touch(wacom_wac); |
| 1250 | else |
| 1251 | sync = wacom_intuos_irq(wacom_wac); |
| 1252 | break; |
| 1253 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1254 | case TABLETPC: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1255 | case TABLETPCE: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1256 | case TABLETPC2FG: |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1257 | case MTSCREEN: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1258 | sync = wacom_tpc_irq(wacom_wac, len); |
| 1259 | break; |
Ping Cheng | 545f4e9 | 2008-11-24 11:44:27 -0500 | [diff] [blame] | 1260 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1261 | case BAMBOO_PT: |
| 1262 | sync = wacom_bpt_irq(wacom_wac, len); |
| 1263 | break; |
| 1264 | |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1265 | case WIRELESS: |
| 1266 | sync = wacom_wireless_irq(wacom_wac, len); |
| 1267 | break; |
| 1268 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1269 | default: |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1270 | sync = false; |
| 1271 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1272 | } |
Dmitry Torokhov | 95dd3b3 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1273 | |
| 1274 | if (sync) |
| 1275 | input_sync(wacom_wac->input); |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1276 | } |
| 1277 | |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1278 | static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1279 | { |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1280 | struct input_dev *input_dev = wacom_wac->input; |
| 1281 | |
| 1282 | input_set_capability(input_dev, EV_MSC, MSC_SERIAL); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1283 | |
| 1284 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1285 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1286 | __set_bit(BTN_TOOL_BRUSH, input_dev->keybit); |
| 1287 | __set_bit(BTN_TOOL_PENCIL, input_dev->keybit); |
| 1288 | __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1289 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 1290 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
| 1291 | |
| 1292 | input_set_abs_params(input_dev, ABS_DISTANCE, |
| 1293 | 0, wacom_wac->features.distance_max, 0, 0); |
| 1294 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); |
| 1295 | input_set_abs_params(input_dev, ABS_TILT_X, 0, 127, 0, 0); |
| 1296 | input_set_abs_params(input_dev, ABS_TILT_Y, 0, 127, 0, 0); |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1297 | } |
| 1298 | |
| 1299 | static void wacom_setup_intuos(struct wacom_wac *wacom_wac) |
| 1300 | { |
| 1301 | struct input_dev *input_dev = wacom_wac->input; |
| 1302 | |
| 1303 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 1304 | |
| 1305 | wacom_setup_cintiq(wacom_wac); |
| 1306 | |
| 1307 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 1308 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 1309 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
| 1310 | __set_bit(BTN_SIDE, input_dev->keybit); |
| 1311 | __set_bit(BTN_EXTRA, input_dev->keybit); |
| 1312 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); |
| 1313 | __set_bit(BTN_TOOL_LENS, input_dev->keybit); |
| 1314 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1315 | input_set_abs_params(input_dev, ABS_RZ, -900, 899, 0, 0); |
| 1316 | input_set_abs_params(input_dev, ABS_THROTTLE, -1023, 1023, 0, 0); |
| 1317 | } |
| 1318 | |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1319 | void wacom_setup_device_quirks(struct wacom_features *features) |
| 1320 | { |
| 1321 | |
| 1322 | /* touch device found but size is not defined. use default */ |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1323 | if (features->device_type == BTN_TOOL_FINGER && !features->x_max) { |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1324 | features->x_max = 1023; |
| 1325 | features->y_max = 1023; |
| 1326 | } |
| 1327 | |
| 1328 | /* these device have multiple inputs */ |
Ping Cheng | ea2e602 | 2012-06-12 00:14:12 -0700 | [diff] [blame] | 1329 | if (features->type >= WIRELESS || |
| 1330 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1331 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1332 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1333 | /* quirk for bamboo touch with 2 low res touches */ |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1334 | if (features->type == BAMBOO_PT && |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1335 | features->pktlen == WACOM_PKGLEN_BBTOUCH) { |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1336 | features->x_max <<= 5; |
| 1337 | features->y_max <<= 5; |
| 1338 | features->x_fuzz <<= 5; |
| 1339 | features->y_fuzz <<= 5; |
Henrik Rydberg | f4ccbef | 2010-09-05 12:57:13 -0700 | [diff] [blame] | 1340 | features->quirks |= WACOM_QUIRK_BBTOUCH_LOWRES; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1341 | } |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1342 | |
| 1343 | if (features->type == WIRELESS) { |
| 1344 | |
| 1345 | /* monitor never has input and pen/touch have delayed create */ |
| 1346 | features->quirks |= WACOM_QUIRK_NO_INPUT; |
| 1347 | |
| 1348 | /* must be monitor interface if no device_type set */ |
| 1349 | if (!features->device_type) |
| 1350 | features->quirks |= WACOM_QUIRK_MONITOR; |
| 1351 | } |
Henrik Rydberg | bc73dd3 | 2010-09-05 12:26:16 -0700 | [diff] [blame] | 1352 | } |
| 1353 | |
Ping Cheng | 409550f | 2011-01-25 18:03:13 -0800 | [diff] [blame] | 1354 | static unsigned int wacom_calculate_touch_res(unsigned int logical_max, |
| 1355 | unsigned int physical_max) |
| 1356 | { |
| 1357 | /* Touch physical dimensions are in 100th of mm */ |
| 1358 | return (logical_max * 100) / physical_max; |
| 1359 | } |
| 1360 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1361 | int wacom_setup_input_capabilities(struct input_dev *input_dev, |
| 1362 | struct wacom_wac *wacom_wac) |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1363 | { |
| 1364 | struct wacom_features *features = &wacom_wac->features; |
| 1365 | int i; |
| 1366 | |
| 1367 | input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
| 1368 | |
| 1369 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 1370 | |
Henrik Rydberg | fed87e6 | 2010-09-05 12:25:11 -0700 | [diff] [blame] | 1371 | input_set_abs_params(input_dev, ABS_X, 0, features->x_max, |
| 1372 | features->x_fuzz, 0); |
| 1373 | input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, |
| 1374 | features->y_fuzz, 0); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1375 | |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1376 | if (features->device_type == BTN_TOOL_PEN) { |
Ping Cheng | cfb7d55 | 2011-08-26 23:10:02 -0700 | [diff] [blame] | 1377 | input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, |
| 1378 | features->pressure_fuzz, 0); |
| 1379 | |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1380 | /* penabled devices have fixed resolution for each model */ |
| 1381 | input_abs_set_res(input_dev, ABS_X, features->x_resolution); |
| 1382 | input_abs_set_res(input_dev, ABS_Y, features->y_resolution); |
| 1383 | } else { |
| 1384 | input_abs_set_res(input_dev, ABS_X, |
| 1385 | wacom_calculate_touch_res(features->x_max, |
| 1386 | features->x_phy)); |
| 1387 | input_abs_set_res(input_dev, ABS_Y, |
| 1388 | wacom_calculate_touch_res(features->y_max, |
| 1389 | features->y_phy)); |
| 1390 | } |
| 1391 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1392 | __set_bit(ABS_MISC, input_dev->absbit); |
| 1393 | |
Jason Childs | e33da8a | 2010-02-17 22:38:31 -0800 | [diff] [blame] | 1394 | switch (wacom_wac->features.type) { |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1395 | case WACOM_MO: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1396 | input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); |
| 1397 | /* fall through */ |
Ping Cheng | ec67bbe | 2009-12-15 00:35:24 -0800 | [diff] [blame] | 1398 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1399 | case WACOM_G4: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1400 | input_set_capability(input_dev, EV_MSC, MSC_SERIAL); |
| 1401 | |
Ping Cheng | 0bd10ef | 2011-07-06 18:05:42 -0700 | [diff] [blame] | 1402 | __set_bit(BTN_BACK, input_dev->keybit); |
| 1403 | __set_bit(BTN_FORWARD, input_dev->keybit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1404 | /* fall through */ |
| 1405 | |
| 1406 | case GRAPHIRE: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1407 | input_set_capability(input_dev, EV_REL, REL_WHEEL); |
| 1408 | |
| 1409 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 1410 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 1411 | __set_bit(BTN_MIDDLE, input_dev->keybit); |
| 1412 | |
| 1413 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1414 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| 1415 | __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); |
| 1416 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 1417 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1418 | |
| 1419 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1420 | break; |
| 1421 | |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 1422 | case WACOM_24HD: |
| 1423 | __set_bit(BTN_A, input_dev->keybit); |
| 1424 | __set_bit(BTN_B, input_dev->keybit); |
| 1425 | __set_bit(BTN_C, input_dev->keybit); |
| 1426 | __set_bit(BTN_X, input_dev->keybit); |
| 1427 | __set_bit(BTN_Y, input_dev->keybit); |
| 1428 | __set_bit(BTN_Z, input_dev->keybit); |
| 1429 | |
| 1430 | for (i = 0; i < 10; i++) |
| 1431 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 1432 | |
| 1433 | __set_bit(KEY_PROG1, input_dev->keybit); |
| 1434 | __set_bit(KEY_PROG2, input_dev->keybit); |
| 1435 | __set_bit(KEY_PROG3, input_dev->keybit); |
| 1436 | |
| 1437 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
| 1438 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); |
| 1439 | wacom_setup_cintiq(wacom_wac); |
| 1440 | break; |
| 1441 | |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 1442 | case WACOM_22HD: |
| 1443 | __set_bit(KEY_PROG1, input_dev->keybit); |
| 1444 | __set_bit(KEY_PROG2, input_dev->keybit); |
| 1445 | __set_bit(KEY_PROG3, input_dev->keybit); |
| 1446 | /* fall through */ |
| 1447 | |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 1448 | case WACOM_21UX2: |
| 1449 | __set_bit(BTN_A, input_dev->keybit); |
| 1450 | __set_bit(BTN_B, input_dev->keybit); |
| 1451 | __set_bit(BTN_C, input_dev->keybit); |
| 1452 | __set_bit(BTN_X, input_dev->keybit); |
| 1453 | __set_bit(BTN_Y, input_dev->keybit); |
| 1454 | __set_bit(BTN_Z, input_dev->keybit); |
| 1455 | __set_bit(BTN_BASE, input_dev->keybit); |
| 1456 | __set_bit(BTN_BASE2, input_dev->keybit); |
| 1457 | /* fall through */ |
| 1458 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1459 | case WACOM_BEE: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1460 | __set_bit(BTN_8, input_dev->keybit); |
| 1461 | __set_bit(BTN_9, input_dev->keybit); |
| 1462 | /* fall through */ |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1463 | |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1464 | case CINTIQ: |
| 1465 | for (i = 0; i < 8; i++) |
| 1466 | __set_bit(BTN_0 + i, input_dev->keybit); |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1467 | |
Jason Gerecke | d6069da | 2011-10-04 22:50:45 -0700 | [diff] [blame] | 1468 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
| 1469 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1470 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1471 | |
| 1472 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 1473 | |
Ping Cheng | 6521d0b | 2010-10-24 21:53:40 -0700 | [diff] [blame] | 1474 | wacom_setup_cintiq(wacom_wac); |
| 1475 | break; |
| 1476 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1477 | case INTUOS3: |
| 1478 | case INTUOS3L: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1479 | __set_bit(BTN_4, input_dev->keybit); |
| 1480 | __set_bit(BTN_5, input_dev->keybit); |
| 1481 | __set_bit(BTN_6, input_dev->keybit); |
| 1482 | __set_bit(BTN_7, input_dev->keybit); |
| 1483 | |
| 1484 | input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1485 | /* fall through */ |
| 1486 | |
| 1487 | case INTUOS3S: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1488 | __set_bit(BTN_0, input_dev->keybit); |
| 1489 | __set_bit(BTN_1, input_dev->keybit); |
| 1490 | __set_bit(BTN_2, input_dev->keybit); |
| 1491 | __set_bit(BTN_3, input_dev->keybit); |
| 1492 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1493 | input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); |
| 1494 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1495 | /* fall through */ |
| 1496 | |
| 1497 | case INTUOS: |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1498 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 1499 | |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1500 | wacom_setup_intuos(wacom_wac); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1501 | break; |
| 1502 | |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 1503 | case INTUOS5: |
| 1504 | case INTUOS5L: |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 1505 | if (features->device_type == BTN_TOOL_PEN) { |
| 1506 | __set_bit(BTN_7, input_dev->keybit); |
| 1507 | __set_bit(BTN_8, input_dev->keybit); |
| 1508 | } |
| 1509 | /* fall through */ |
| 1510 | |
| 1511 | case INTUOS5S: |
| 1512 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 1513 | |
| 1514 | if (features->device_type == BTN_TOOL_PEN) { |
| 1515 | for (i = 0; i < 7; i++) |
| 1516 | __set_bit(BTN_0 + i, input_dev->keybit); |
| 1517 | |
| 1518 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
| 1519 | features->distance_max, |
| 1520 | 0, 0); |
| 1521 | |
| 1522 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
| 1523 | |
| 1524 | wacom_setup_intuos(wacom_wac); |
| 1525 | } else if (features->device_type == BTN_TOOL_FINGER) { |
| 1526 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 1527 | |
| 1528 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
| 1529 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
| 1530 | __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit); |
| 1531 | __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit); |
| 1532 | |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1533 | input_mt_init_slots(input_dev, features->touch_max); |
Jason Gerecke | ae584ca | 2012-04-03 15:50:40 -0700 | [diff] [blame] | 1534 | |
| 1535 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, |
| 1536 | 0, 255, 0, 0); |
| 1537 | |
| 1538 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
| 1539 | 0, features->x_max, |
| 1540 | features->x_fuzz, 0); |
| 1541 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
| 1542 | 0, features->y_max, |
| 1543 | features->y_fuzz, 0); |
| 1544 | } |
| 1545 | break; |
| 1546 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1547 | case INTUOS4: |
| 1548 | case INTUOS4L: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1549 | __set_bit(BTN_7, input_dev->keybit); |
| 1550 | __set_bit(BTN_8, input_dev->keybit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1551 | /* fall through */ |
| 1552 | |
| 1553 | case INTUOS4S: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1554 | for (i = 0; i < 7; i++) |
| 1555 | __set_bit(BTN_0 + i, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1556 | |
| 1557 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
| 1558 | wacom_setup_intuos(wacom_wac); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1559 | |
| 1560 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1561 | break; |
| 1562 | |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1563 | case MTSCREEN: |
Ping Cheng | 8b4a0c1f | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1564 | if (features->device_type == BTN_TOOL_FINGER) { |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1565 | wacom_wac->slots = kmalloc(features->touch_max * |
| 1566 | sizeof(int), |
| 1567 | GFP_KERNEL); |
| 1568 | if (!wacom_wac->slots) |
| 1569 | return -ENOMEM; |
| 1570 | |
| 1571 | for (i = 0; i < features->touch_max; i++) |
| 1572 | wacom_wac->slots[i] = -1; |
Ping Cheng | 6795a52 | 2012-06-28 16:49:00 -0700 | [diff] [blame] | 1573 | } |
| 1574 | /* fall through */ |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1575 | |
Ping Cheng | 6795a52 | 2012-06-28 16:49:00 -0700 | [diff] [blame] | 1576 | case TABLETPC2FG: |
| 1577 | if (features->device_type == BTN_TOOL_FINGER) { |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1578 | input_mt_init_slots(input_dev, features->touch_max); |
Ping Cheng | 84eb5aa | 2011-03-12 20:35:18 -0800 | [diff] [blame] | 1579 | input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, |
| 1580 | 0, MT_TOOL_MAX, 0, 0); |
| 1581 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
| 1582 | 0, features->x_max, 0, 0); |
| 1583 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
| 1584 | 0, features->y_max, 0, 0); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1585 | } |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1586 | /* fall through */ |
| 1587 | |
| 1588 | case TABLETPC: |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1589 | case TABLETPCE: |
Ping Cheng | a43c7c5 | 2011-03-12 20:34:42 -0800 | [diff] [blame] | 1590 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 1591 | |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1592 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 1593 | |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1594 | if (features->device_type != BTN_TOOL_PEN) |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1595 | break; /* no need to process stylus stuff */ |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1596 | |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1597 | /* fall through */ |
| 1598 | |
| 1599 | case PL: |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 1600 | case DTU: |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1601 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1602 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1603 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 1604 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1605 | |
| 1606 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); |
| 1607 | break; |
| 1608 | |
| 1609 | case PTU: |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1610 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
| 1611 | /* fall through */ |
| 1612 | |
| 1613 | case PENPARTNER: |
Jason Gerecke | 1fab84a | 2011-08-26 23:18:22 -0700 | [diff] [blame] | 1614 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
Dmitry Torokhov | 8da23fc | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1615 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
Jason Gerecke | 1fab84a | 2011-08-26 23:18:22 -0700 | [diff] [blame] | 1616 | __set_bit(BTN_STYLUS, input_dev->keybit); |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1617 | |
| 1618 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
Dmitry Torokhov | 73a97f4 | 2010-03-19 22:18:15 -0700 | [diff] [blame] | 1619 | break; |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1620 | |
| 1621 | case BAMBOO_PT: |
| 1622 | __clear_bit(ABS_MISC, input_dev->absbit); |
| 1623 | |
Jason Gerecke | 3512069 | 2011-09-08 09:38:14 -0700 | [diff] [blame] | 1624 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 1625 | |
Ping Cheng | 8b4a0c1f | 2012-01-31 00:07:33 -0800 | [diff] [blame] | 1626 | if (features->device_type == BTN_TOOL_FINGER) { |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1627 | __set_bit(BTN_LEFT, input_dev->keybit); |
| 1628 | __set_bit(BTN_FORWARD, input_dev->keybit); |
| 1629 | __set_bit(BTN_BACK, input_dev->keybit); |
| 1630 | __set_bit(BTN_RIGHT, input_dev->keybit); |
| 1631 | |
| 1632 | __set_bit(BTN_TOOL_FINGER, input_dev->keybit); |
| 1633 | __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1634 | input_mt_init_slots(input_dev, features->touch_max); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1635 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1636 | if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) { |
| 1637 | __set_bit(BTN_TOOL_TRIPLETAP, |
| 1638 | input_dev->keybit); |
| 1639 | __set_bit(BTN_TOOL_QUADTAP, |
| 1640 | input_dev->keybit); |
| 1641 | |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1642 | input_set_abs_params(input_dev, |
| 1643 | ABS_MT_TOUCH_MAJOR, |
| 1644 | 0, 255, 0, 0); |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1645 | } |
| 1646 | |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1647 | input_set_abs_params(input_dev, ABS_MT_POSITION_X, |
| 1648 | 0, features->x_max, |
| 1649 | features->x_fuzz, 0); |
| 1650 | input_set_abs_params(input_dev, ABS_MT_POSITION_Y, |
| 1651 | 0, features->y_max, |
| 1652 | features->y_fuzz, 0); |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 1653 | } else if (features->device_type == BTN_TOOL_PEN) { |
| 1654 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
| 1655 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
| 1656 | __set_bit(BTN_STYLUS, input_dev->keybit); |
| 1657 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1658 | input_set_abs_params(input_dev, ABS_DISTANCE, 0, |
| 1659 | features->distance_max, |
| 1660 | 0, 0); |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 1661 | } |
| 1662 | break; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1663 | } |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1664 | return 0; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 1665 | } |
| 1666 | |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1667 | static const struct wacom_features wacom_features_0x00 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1668 | { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, |
| 1669 | 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1670 | static const struct wacom_features wacom_features_0x10 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1671 | { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, |
| 1672 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1673 | static const struct wacom_features wacom_features_0x11 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1674 | { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, |
| 1675 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1676 | static const struct wacom_features wacom_features_0x12 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1677 | { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511, |
| 1678 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1679 | static const struct wacom_features wacom_features_0x13 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1680 | { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, |
| 1681 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1682 | static const struct wacom_features wacom_features_0x14 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1683 | { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, |
| 1684 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1685 | static const struct wacom_features wacom_features_0x15 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1686 | { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, |
| 1687 | 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1688 | static const struct wacom_features wacom_features_0x16 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1689 | { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, |
| 1690 | 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1691 | static const struct wacom_features wacom_features_0x17 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1692 | { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, |
| 1693 | 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1694 | static const struct wacom_features wacom_features_0x18 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1695 | { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511, |
| 1696 | 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1697 | static const struct wacom_features wacom_features_0x19 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1698 | { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, |
| 1699 | 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1700 | static const struct wacom_features wacom_features_0x60 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1701 | { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, |
| 1702 | 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1703 | static const struct wacom_features wacom_features_0x61 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1704 | { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255, |
| 1705 | 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1706 | static const struct wacom_features wacom_features_0x62 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1707 | { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, |
| 1708 | 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1709 | static const struct wacom_features wacom_features_0x63 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1710 | { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511, |
| 1711 | 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1712 | static const struct wacom_features wacom_features_0x64 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1713 | { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511, |
| 1714 | 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1715 | static const struct wacom_features wacom_features_0x65 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1716 | { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, |
| 1717 | 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1718 | static const struct wacom_features wacom_features_0x69 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1719 | { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, |
| 1720 | 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 1721 | static const struct wacom_features wacom_features_0x6A = |
| 1722 | { "Wacom Bamboo1 4x6", WACOM_PKGLEN_GRAPHIRE, 14760, 9225, 1023, |
| 1723 | 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
| 1724 | static const struct wacom_features wacom_features_0x6B = |
| 1725 | { "Wacom Bamboo1 5x8", WACOM_PKGLEN_GRAPHIRE, 21648, 13530, 1023, |
| 1726 | 63, GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1727 | static const struct wacom_features wacom_features_0x20 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1728 | { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, |
| 1729 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1730 | static const struct wacom_features wacom_features_0x21 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1731 | { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, |
| 1732 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1733 | static const struct wacom_features wacom_features_0x22 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1734 | { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, |
| 1735 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1736 | static const struct wacom_features wacom_features_0x23 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1737 | { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, |
| 1738 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1739 | static const struct wacom_features wacom_features_0x24 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1740 | { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, |
| 1741 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1742 | static const struct wacom_features wacom_features_0x30 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1743 | { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255, |
| 1744 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1745 | static const struct wacom_features wacom_features_0x31 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1746 | { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255, |
| 1747 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1748 | static const struct wacom_features wacom_features_0x32 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1749 | { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255, |
| 1750 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1751 | static const struct wacom_features wacom_features_0x33 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1752 | { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255, |
| 1753 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1754 | static const struct wacom_features wacom_features_0x34 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1755 | { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511, |
| 1756 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1757 | static const struct wacom_features wacom_features_0x35 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1758 | { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511, |
| 1759 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1760 | static const struct wacom_features wacom_features_0x37 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1761 | { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511, |
| 1762 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1763 | static const struct wacom_features wacom_features_0x38 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1764 | { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, |
| 1765 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1766 | static const struct wacom_features wacom_features_0x39 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1767 | { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511, |
| 1768 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1769 | static const struct wacom_features wacom_features_0xC4 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1770 | { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, |
| 1771 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1772 | static const struct wacom_features wacom_features_0xC0 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1773 | { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, |
| 1774 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1775 | static const struct wacom_features wacom_features_0xC2 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1776 | { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, |
| 1777 | 0, PL, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1778 | static const struct wacom_features wacom_features_0x03 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1779 | { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511, |
| 1780 | 0, PTU, WACOM_PL_RES, WACOM_PL_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1781 | static const struct wacom_features wacom_features_0x41 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1782 | { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, |
| 1783 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1784 | static const struct wacom_features wacom_features_0x42 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1785 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, |
| 1786 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1787 | static const struct wacom_features wacom_features_0x43 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1788 | { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, |
| 1789 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1790 | static const struct wacom_features wacom_features_0x44 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1791 | { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, |
| 1792 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1793 | static const struct wacom_features wacom_features_0x45 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1794 | { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, |
| 1795 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1796 | static const struct wacom_features wacom_features_0xB0 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1797 | { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023, |
| 1798 | 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1799 | static const struct wacom_features wacom_features_0xB1 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1800 | { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023, |
| 1801 | 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1802 | static const struct wacom_features wacom_features_0xB2 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1803 | { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023, |
| 1804 | 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1805 | static const struct wacom_features wacom_features_0xB3 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1806 | { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023, |
| 1807 | 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1808 | static const struct wacom_features wacom_features_0xB4 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1809 | { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023, |
| 1810 | 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1811 | static const struct wacom_features wacom_features_0xB5 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1812 | { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023, |
| 1813 | 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1814 | static const struct wacom_features wacom_features_0xB7 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1815 | { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023, |
| 1816 | 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1817 | static const struct wacom_features wacom_features_0xB8 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1818 | { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, |
| 1819 | 63, INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1820 | static const struct wacom_features wacom_features_0xB9 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1821 | { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, |
| 1822 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1823 | static const struct wacom_features wacom_features_0xBA = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1824 | { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, |
| 1825 | 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1826 | static const struct wacom_features wacom_features_0xBB = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1827 | { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, |
| 1828 | 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 1829 | static const struct wacom_features wacom_features_0xBC = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1830 | { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, |
| 1831 | 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 1832 | static const struct wacom_features wacom_features_0x26 = |
| 1833 | { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1834 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 1835 | .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 1836 | static const struct wacom_features wacom_features_0x27 = |
| 1837 | { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1838 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 1839 | .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 1840 | static const struct wacom_features wacom_features_0x28 = |
| 1841 | { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1842 | 63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
| 1843 | .touch_max = 16 }; |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 1844 | static const struct wacom_features wacom_features_0x29 = |
| 1845 | { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, |
| 1846 | 63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
| 1847 | static const struct wacom_features wacom_features_0x2A = |
| 1848 | { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, |
| 1849 | 63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 1850 | static const struct wacom_features wacom_features_0xF4 = |
Jason Gerecke | 6f4d038 | 2012-08-21 22:11:59 -0700 | [diff] [blame] | 1851 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
| 1852 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
| 1853 | static const struct wacom_features wacom_features_0xF8 = |
| 1854 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 1855 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1856 | static const struct wacom_features wacom_features_0x3F = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1857 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, |
| 1858 | 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1859 | static const struct wacom_features wacom_features_0xC5 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1860 | { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023, |
| 1861 | 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1862 | static const struct wacom_features wacom_features_0xC6 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1863 | { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, |
| 1864 | 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1865 | static const struct wacom_features wacom_features_0xC7 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1866 | { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, |
| 1867 | 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 1868 | static const struct wacom_features wacom_features_0xCE = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1869 | { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, |
| 1870 | 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 1871 | static const struct wacom_features wacom_features_0xF0 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1872 | { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, |
| 1873 | 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 1874 | static const struct wacom_features wacom_features_0xCC = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1875 | { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, |
| 1876 | 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 1877 | static const struct wacom_features wacom_features_0xFA = |
| 1878 | { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, |
| 1879 | 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1880 | static const struct wacom_features wacom_features_0x90 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1881 | { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1882 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1883 | static const struct wacom_features wacom_features_0x93 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1884 | { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1885 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 1886 | static const struct wacom_features wacom_features_0x97 = |
| 1887 | { "Wacom ISDv4 97", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 511, |
| 1888 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1889 | static const struct wacom_features wacom_features_0x9A = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1890 | { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1891 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1892 | static const struct wacom_features wacom_features_0x9F = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1893 | { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1894 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1895 | static const struct wacom_features wacom_features_0xE2 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1896 | { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1897 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1898 | .touch_max = 2 }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1899 | static const struct wacom_features wacom_features_0xE3 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1900 | { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1901 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1902 | .touch_max = 2 }; |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 1903 | static const struct wacom_features wacom_features_0xE5 = |
| 1904 | { "Wacom ISDv4 E5", WACOM_PKGLEN_MTOUCH, 26202, 16325, 255, |
| 1905 | 0, MTSCREEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Manoj Iyer | 26fcd2a | 2011-03-31 22:39:43 -0700 | [diff] [blame] | 1906 | static const struct wacom_features wacom_features_0xE6 = |
| 1907 | { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1908 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1909 | .touch_max = 2 }; |
Chris Bagwell | 0d0e306 | 2011-12-11 23:50:59 -0800 | [diff] [blame] | 1910 | static const struct wacom_features wacom_features_0xEC = |
| 1911 | { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, |
| 1912 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 1913 | static const struct wacom_features wacom_features_0xED = |
| 1914 | { "Wacom ISDv4 ED", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1915 | 0, TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
| 1916 | static const struct wacom_features wacom_features_0xEF = |
| 1917 | { "Wacom ISDv4 EF", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, |
| 1918 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Dmitry Torokhov | e87a344 | 2010-02-18 01:51:47 -0800 | [diff] [blame] | 1919 | static const struct wacom_features wacom_features_0x47 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1920 | { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, |
| 1921 | 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 1922 | static const struct wacom_features wacom_features_0x84 = |
| 1923 | { "Wacom Wireless Receiver", WACOM_PKGLEN_WIRELESS, 0, 0, 0, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1924 | 0, WIRELESS, 0, 0, .touch_max = 16 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1925 | static const struct wacom_features wacom_features_0xD0 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1926 | { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1927 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1928 | .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1929 | static const struct wacom_features wacom_features_0xD1 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1930 | { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1931 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1932 | .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1933 | static const struct wacom_features wacom_features_0xD2 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1934 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1935 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1936 | static const struct wacom_features wacom_features_0xD3 = |
Chris Bagwell | ae92756 | 2011-10-10 08:52:32 -0700 | [diff] [blame] | 1937 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1938 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1939 | .touch_max = 2 }; |
Kevin Granade | 57a7872 | 2010-12-10 23:04:02 -0800 | [diff] [blame] | 1940 | static const struct wacom_features wacom_features_0xD4 = |
Ping Cheng | a001a8f | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 1941 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1942 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Gerard Braad | 18adad1 | 2011-08-16 00:17:56 -0700 | [diff] [blame] | 1943 | static const struct wacom_features wacom_features_0xD5 = |
Chris Bagwell | ae92756 | 2011-10-10 08:52:32 -0700 | [diff] [blame] | 1944 | { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
Chris Bagwell | c18c2ce | 2011-10-10 08:52:13 -0700 | [diff] [blame] | 1945 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1946 | static const struct wacom_features wacom_features_0xD6 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1947 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1948 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1949 | .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1950 | static const struct wacom_features wacom_features_0xD7 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1951 | { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1952 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1953 | .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1954 | static const struct wacom_features wacom_features_0xD8 = |
Chris Bagwell | ae92756 | 2011-10-10 08:52:32 -0700 | [diff] [blame] | 1955 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1956 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1957 | .touch_max = 2 }; |
Ping Cheng | 7b824bb | 2011-03-26 21:16:04 -0700 | [diff] [blame] | 1958 | static const struct wacom_features wacom_features_0xDA = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1959 | { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1960 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1961 | .touch_max = 2 }; |
David Foley | 47d0923 | 2010-12-07 21:05:59 -0800 | [diff] [blame] | 1962 | static struct wacom_features wacom_features_0xDB = |
Chris Bagwell | ae92756 | 2011-10-10 08:52:32 -0700 | [diff] [blame] | 1963 | { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1964 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1965 | .touch_max = 2 }; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1966 | static const struct wacom_features wacom_features_0xDD = |
| 1967 | { "Wacom Bamboo Connect", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, |
| 1968 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
| 1969 | static const struct wacom_features wacom_features_0xDE = |
| 1970 | { "Wacom Bamboo 16FG 4x5", WACOM_PKGLEN_BBPEN, 14720, 9200, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1971 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1972 | .touch_max = 16 }; |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 1973 | static const struct wacom_features wacom_features_0xDF = |
| 1974 | { "Wacom Bamboo 16FG 6x8", WACOM_PKGLEN_BBPEN, 21648, 13700, 1023, |
Ping Cheng | f393ee2 | 2012-04-29 21:09:17 -0700 | [diff] [blame] | 1975 | 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
| 1976 | .touch_max = 16 }; |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 1977 | static const struct wacom_features wacom_features_0x6004 = |
Ping Cheng | e35fb8c | 2011-03-26 21:16:05 -0700 | [diff] [blame] | 1978 | { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, |
| 1979 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 1980 | |
| 1981 | #define USB_DEVICE_WACOM(prod) \ |
| 1982 | USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ |
| 1983 | .driver_info = (kernel_ulong_t)&wacom_features_##prod |
| 1984 | |
Aristeu Rozanski | 1483f55 | 2011-06-22 01:17:17 -0700 | [diff] [blame] | 1985 | #define USB_DEVICE_DETAILED(prod, class, sub, proto) \ |
| 1986 | USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_WACOM, prod, class, \ |
| 1987 | sub, proto), \ |
| 1988 | .driver_info = (kernel_ulong_t)&wacom_features_##prod |
| 1989 | |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 1990 | #define USB_DEVICE_LENOVO(prod) \ |
| 1991 | USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ |
| 1992 | .driver_info = (kernel_ulong_t)&wacom_features_##prod |
| 1993 | |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 1994 | const struct usb_device_id wacom_ids[] = { |
| 1995 | { USB_DEVICE_WACOM(0x00) }, |
| 1996 | { USB_DEVICE_WACOM(0x10) }, |
| 1997 | { USB_DEVICE_WACOM(0x11) }, |
| 1998 | { USB_DEVICE_WACOM(0x12) }, |
| 1999 | { USB_DEVICE_WACOM(0x13) }, |
| 2000 | { USB_DEVICE_WACOM(0x14) }, |
| 2001 | { USB_DEVICE_WACOM(0x15) }, |
| 2002 | { USB_DEVICE_WACOM(0x16) }, |
| 2003 | { USB_DEVICE_WACOM(0x17) }, |
| 2004 | { USB_DEVICE_WACOM(0x18) }, |
| 2005 | { USB_DEVICE_WACOM(0x19) }, |
| 2006 | { USB_DEVICE_WACOM(0x60) }, |
| 2007 | { USB_DEVICE_WACOM(0x61) }, |
| 2008 | { USB_DEVICE_WACOM(0x62) }, |
| 2009 | { USB_DEVICE_WACOM(0x63) }, |
| 2010 | { USB_DEVICE_WACOM(0x64) }, |
| 2011 | { USB_DEVICE_WACOM(0x65) }, |
| 2012 | { USB_DEVICE_WACOM(0x69) }, |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 2013 | { USB_DEVICE_WACOM(0x6A) }, |
| 2014 | { USB_DEVICE_WACOM(0x6B) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2015 | { USB_DEVICE_WACOM(0x20) }, |
| 2016 | { USB_DEVICE_WACOM(0x21) }, |
| 2017 | { USB_DEVICE_WACOM(0x22) }, |
| 2018 | { USB_DEVICE_WACOM(0x23) }, |
| 2019 | { USB_DEVICE_WACOM(0x24) }, |
| 2020 | { USB_DEVICE_WACOM(0x30) }, |
| 2021 | { USB_DEVICE_WACOM(0x31) }, |
| 2022 | { USB_DEVICE_WACOM(0x32) }, |
| 2023 | { USB_DEVICE_WACOM(0x33) }, |
| 2024 | { USB_DEVICE_WACOM(0x34) }, |
| 2025 | { USB_DEVICE_WACOM(0x35) }, |
| 2026 | { USB_DEVICE_WACOM(0x37) }, |
| 2027 | { USB_DEVICE_WACOM(0x38) }, |
| 2028 | { USB_DEVICE_WACOM(0x39) }, |
| 2029 | { USB_DEVICE_WACOM(0xC4) }, |
| 2030 | { USB_DEVICE_WACOM(0xC0) }, |
| 2031 | { USB_DEVICE_WACOM(0xC2) }, |
| 2032 | { USB_DEVICE_WACOM(0x03) }, |
| 2033 | { USB_DEVICE_WACOM(0x41) }, |
| 2034 | { USB_DEVICE_WACOM(0x42) }, |
| 2035 | { USB_DEVICE_WACOM(0x43) }, |
| 2036 | { USB_DEVICE_WACOM(0x44) }, |
| 2037 | { USB_DEVICE_WACOM(0x45) }, |
| 2038 | { USB_DEVICE_WACOM(0xB0) }, |
| 2039 | { USB_DEVICE_WACOM(0xB1) }, |
| 2040 | { USB_DEVICE_WACOM(0xB2) }, |
| 2041 | { USB_DEVICE_WACOM(0xB3) }, |
| 2042 | { USB_DEVICE_WACOM(0xB4) }, |
| 2043 | { USB_DEVICE_WACOM(0xB5) }, |
| 2044 | { USB_DEVICE_WACOM(0xB7) }, |
| 2045 | { USB_DEVICE_WACOM(0xB8) }, |
| 2046 | { USB_DEVICE_WACOM(0xB9) }, |
| 2047 | { USB_DEVICE_WACOM(0xBA) }, |
| 2048 | { USB_DEVICE_WACOM(0xBB) }, |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 2049 | { USB_DEVICE_WACOM(0xBC) }, |
Jason Gerecke | 9fee619 | 2012-04-03 15:47:22 -0700 | [diff] [blame] | 2050 | { USB_DEVICE_WACOM(0x26) }, |
| 2051 | { USB_DEVICE_WACOM(0x27) }, |
| 2052 | { USB_DEVICE_WACOM(0x28) }, |
| 2053 | { USB_DEVICE_WACOM(0x29) }, |
| 2054 | { USB_DEVICE_WACOM(0x2A) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2055 | { USB_DEVICE_WACOM(0x3F) }, |
| 2056 | { USB_DEVICE_WACOM(0xC5) }, |
| 2057 | { USB_DEVICE_WACOM(0xC6) }, |
| 2058 | { USB_DEVICE_WACOM(0xC7) }, |
Aristeu Rozanski | 1483f55 | 2011-06-22 01:17:17 -0700 | [diff] [blame] | 2059 | /* |
| 2060 | * DTU-2231 has two interfaces on the same configuration, |
| 2061 | * only one is used. |
| 2062 | */ |
| 2063 | { USB_DEVICE_DETAILED(0xCE, USB_CLASS_HID, |
| 2064 | USB_INTERFACE_SUBCLASS_BOOT, |
| 2065 | USB_INTERFACE_PROTOCOL_MOUSE) }, |
Chris Bagwell | d3825d5 | 2012-03-25 23:26:11 -0700 | [diff] [blame] | 2066 | { USB_DEVICE_WACOM(0x84) }, |
Henrik Rydberg | cb734c0 | 2010-09-05 12:53:16 -0700 | [diff] [blame] | 2067 | { USB_DEVICE_WACOM(0xD0) }, |
Chris Bagwell | 2aaacb1 | 2010-09-12 00:11:35 -0700 | [diff] [blame] | 2068 | { USB_DEVICE_WACOM(0xD1) }, |
| 2069 | { USB_DEVICE_WACOM(0xD2) }, |
| 2070 | { USB_DEVICE_WACOM(0xD3) }, |
Kevin Granade | 57a7872 | 2010-12-10 23:04:02 -0800 | [diff] [blame] | 2071 | { USB_DEVICE_WACOM(0xD4) }, |
Gerard Braad | 18adad1 | 2011-08-16 00:17:56 -0700 | [diff] [blame] | 2072 | { USB_DEVICE_WACOM(0xD5) }, |
Ping Cheng | d38acb4 | 2011-01-24 09:32:50 -0800 | [diff] [blame] | 2073 | { USB_DEVICE_WACOM(0xD6) }, |
| 2074 | { USB_DEVICE_WACOM(0xD7) }, |
David Foley | a318e6b | 2010-11-30 23:45:46 -0800 | [diff] [blame] | 2075 | { USB_DEVICE_WACOM(0xD8) }, |
| 2076 | { USB_DEVICE_WACOM(0xDA) }, |
David Foley | 47d0923 | 2010-12-07 21:05:59 -0800 | [diff] [blame] | 2077 | { USB_DEVICE_WACOM(0xDB) }, |
Chris Bagwell | 73149ab | 2011-10-26 22:34:21 -0700 | [diff] [blame] | 2078 | { USB_DEVICE_WACOM(0xDD) }, |
| 2079 | { USB_DEVICE_WACOM(0xDE) }, |
| 2080 | { USB_DEVICE_WACOM(0xDF) }, |
Ping Cheng | c8f2edc | 2010-06-28 01:10:51 -0700 | [diff] [blame] | 2081 | { USB_DEVICE_WACOM(0xF0) }, |
Ping Cheng | 3a4b4aa | 2010-06-03 22:10:21 -0700 | [diff] [blame] | 2082 | { USB_DEVICE_WACOM(0xCC) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2083 | { USB_DEVICE_WACOM(0x90) }, |
| 2084 | { USB_DEVICE_WACOM(0x93) }, |
Ping Cheng | 11d0cf8 | 2011-06-27 12:57:58 -0700 | [diff] [blame] | 2085 | { USB_DEVICE_WACOM(0x97) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2086 | { USB_DEVICE_WACOM(0x9A) }, |
| 2087 | { USB_DEVICE_WACOM(0x9F) }, |
| 2088 | { USB_DEVICE_WACOM(0xE2) }, |
| 2089 | { USB_DEVICE_WACOM(0xE3) }, |
Ping Cheng | 1963518 | 2012-04-29 21:09:18 -0700 | [diff] [blame] | 2090 | { USB_DEVICE_WACOM(0xE5) }, |
Manoj Iyer | 26fcd2a | 2011-03-31 22:39:43 -0700 | [diff] [blame] | 2091 | { USB_DEVICE_WACOM(0xE6) }, |
Chris Bagwell | 0d0e306 | 2011-12-11 23:50:59 -0800 | [diff] [blame] | 2092 | { USB_DEVICE_WACOM(0xEC) }, |
Ping Cheng | ac17383 | 2012-06-12 00:15:06 -0700 | [diff] [blame] | 2093 | { USB_DEVICE_WACOM(0xED) }, |
| 2094 | { USB_DEVICE_WACOM(0xEF) }, |
Bastian Blank | b036f6f | 2010-02-10 23:06:23 -0800 | [diff] [blame] | 2095 | { USB_DEVICE_WACOM(0x47) }, |
Jason Gerecke | 803296b | 2011-12-12 00:11:45 -0800 | [diff] [blame] | 2096 | { USB_DEVICE_WACOM(0xF4) }, |
Jason Gerecke | 6f4d038 | 2012-08-21 22:11:59 -0700 | [diff] [blame] | 2097 | { USB_DEVICE_WACOM(0xF8) }, |
Ping Cheng | d838c64 | 2012-07-24 23:54:11 -0700 | [diff] [blame] | 2098 | { USB_DEVICE_WACOM(0xFA) }, |
Ajay Ramaswamy | 7b4b306 | 2010-12-23 01:19:39 -0800 | [diff] [blame] | 2099 | { USB_DEVICE_LENOVO(0x6004) }, |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 2100 | { } |
| 2101 | }; |
Ping Cheng | 3bea733 | 2006-07-13 18:01:36 -0700 | [diff] [blame] | 2102 | MODULE_DEVICE_TABLE(usb, wacom_ids); |