aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 415f6306105d..ce0b4608dad9 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -158,6 +158,39 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
158 return 1; 158 return 1;
159} 159}
160 160
161static int wacom_dtu_irq(struct wacom_wac *wacom)
162{
163 struct wacom_features *features = &wacom->features;
164 char *data = wacom->data;
165 struct input_dev *input = wacom->input;
166 int prox = data[1] & 0x20, pressure;
167
168 dbg("wacom_dtu_irq: received report #%d", data[0]);
169
170 if (prox) {
171 /* Going into proximity select tool */
172 wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN;
173 if (wacom->tool[0] == BTN_TOOL_PEN)
174 wacom->id[0] = STYLUS_DEVICE_ID;
175 else
176 wacom->id[0] = ERASER_DEVICE_ID;
177 }
178 input_report_key(input, BTN_STYLUS, data[1] & 0x02);
179 input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
180 input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
181 input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
182 pressure = ((data[7] & 0x01) << 8) | data[6];
183 if (pressure < 0)
184 pressure = features->pressure_max + pressure + 1;
185 input_report_abs(input, ABS_PRESSURE, pressure);
186 input_report_key(input, BTN_TOUCH, data[1] & 0x05);
187 if (!prox) /* out-prox */
188 wacom->id[0] = 0;
189 input_report_key(input, wacom->tool[0], prox);
190 input_report_abs(input, ABS_MISC, wacom->id[0]);
191 return 1;
192}
193
161static int wacom_graphire_irq(struct wacom_wac *wacom) 194static int wacom_graphire_irq(struct wacom_wac *wacom)
162{ 195{
163 struct wacom_features *features = &wacom->features; 196 struct wacom_features *features = &wacom->features;
@@ -845,6 +878,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
845 sync = wacom_ptu_irq(wacom_wac); 878 sync = wacom_ptu_irq(wacom_wac);
846 break; 879 break;
847 880
881 case DTU:
882 sync = wacom_dtu_irq(wacom_wac);
883 break;
884
848 case INTUOS: 885 case INTUOS:
849 case INTUOS3S: 886 case INTUOS3S:
850 case INTUOS3: 887 case INTUOS3:
@@ -1030,6 +1067,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1030 1067
1031 case PL: 1068 case PL:
1032 case PTU: 1069 case PTU:
1070 case DTU:
1033 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1071 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1034 __set_bit(BTN_STYLUS, input_dev->keybit); 1072 __set_bit(BTN_STYLUS, input_dev->keybit);
1035 __set_bit(BTN_STYLUS2, input_dev->keybit); 1073 __set_bit(BTN_STYLUS2, input_dev->keybit);
@@ -1155,6 +1193,10 @@ static const struct wacom_features wacom_features_0xC6 =
1155 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; 1193 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE };
1156static const struct wacom_features wacom_features_0xC7 = 1194static const struct wacom_features wacom_features_0xC7 =
1157 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; 1195 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL };
1196static const struct wacom_features wacom_features_0xCE =
1197 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 0, DTU };
1198static const struct wacom_features wacom_features_0xF0 =
1199 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 0, DTU };
1158static const struct wacom_features wacom_features_0xCC = 1200static const struct wacom_features wacom_features_0xCC =
1159 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; 1201 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 };
1160static const struct wacom_features wacom_features_0x90 = 1202static const struct wacom_features wacom_features_0x90 =
@@ -1234,6 +1276,8 @@ const struct usb_device_id wacom_ids[] = {
1234 { USB_DEVICE_WACOM(0xC5) }, 1276 { USB_DEVICE_WACOM(0xC5) },
1235 { USB_DEVICE_WACOM(0xC6) }, 1277 { USB_DEVICE_WACOM(0xC6) },
1236 { USB_DEVICE_WACOM(0xC7) }, 1278 { USB_DEVICE_WACOM(0xC7) },
1279 { USB_DEVICE_WACOM(0xCE) },
1280 { USB_DEVICE_WACOM(0xF0) },
1237 { USB_DEVICE_WACOM(0xCC) }, 1281 { USB_DEVICE_WACOM(0xCC) },
1238 { USB_DEVICE_WACOM(0x90) }, 1282 { USB_DEVICE_WACOM(0x90) },
1239 { USB_DEVICE_WACOM(0x93) }, 1283 { USB_DEVICE_WACOM(0x93) },