@@ -210,6 +210,62 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
210
210
return 1 ;
211
211
}
212
212
213
+ static int wacom_dtus_irq (struct wacom_wac * wacom )
214
+ {
215
+ char * data = wacom -> data ;
216
+ struct input_dev * input = wacom -> input ;
217
+ unsigned short prox , pressure = 0 ;
218
+
219
+ if (data [0 ] != WACOM_REPORT_DTUS && data [0 ] != WACOM_REPORT_DTUSPAD ) {
220
+ dev_dbg (input -> dev .parent ,
221
+ "%s: received unknown report #%d" , __func__ , data [0 ]);
222
+ return 0 ;
223
+ } else if (data [0 ] == WACOM_REPORT_DTUSPAD ) {
224
+ input_report_key (input , BTN_0 , (data [1 ] & 0x01 ));
225
+ input_report_key (input , BTN_1 , (data [1 ] & 0x02 ));
226
+ input_report_key (input , BTN_2 , (data [1 ] & 0x04 ));
227
+ input_report_key (input , BTN_3 , (data [1 ] & 0x08 ));
228
+ input_report_abs (input , ABS_MISC ,
229
+ data [1 ] & 0x0f ? PAD_DEVICE_ID : 0 );
230
+ /*
231
+ * Serial number is required when expresskeys are
232
+ * reported through pen interface.
233
+ */
234
+ input_event (input , EV_MSC , MSC_SERIAL , 0xf0 );
235
+ return 1 ;
236
+ } else {
237
+ prox = data [1 ] & 0x80 ;
238
+ if (prox ) {
239
+ switch ((data [1 ] >> 3 ) & 3 ) {
240
+ case 1 : /* Rubber */
241
+ wacom -> tool [0 ] = BTN_TOOL_RUBBER ;
242
+ wacom -> id [0 ] = ERASER_DEVICE_ID ;
243
+ break ;
244
+
245
+ case 2 : /* Pen */
246
+ wacom -> tool [0 ] = BTN_TOOL_PEN ;
247
+ wacom -> id [0 ] = STYLUS_DEVICE_ID ;
248
+ break ;
249
+ }
250
+ }
251
+
252
+ input_report_key (input , BTN_STYLUS , data [1 ] & 0x20 );
253
+ input_report_key (input , BTN_STYLUS2 , data [1 ] & 0x40 );
254
+ input_report_abs (input , ABS_X , get_unaligned_be16 (& data [3 ]));
255
+ input_report_abs (input , ABS_Y , get_unaligned_be16 (& data [5 ]));
256
+ pressure = ((data [1 ] & 0x03 ) << 8 ) | (data [2 ] & 0xff );
257
+ input_report_abs (input , ABS_PRESSURE , pressure );
258
+ input_report_key (input , BTN_TOUCH , pressure > 10 );
259
+
260
+ if (!prox ) /* out-prox */
261
+ wacom -> id [0 ] = 0 ;
262
+ input_report_key (input , wacom -> tool [0 ], prox );
263
+ input_report_abs (input , ABS_MISC , wacom -> id [0 ]);
264
+ input_event (input , EV_MSC , MSC_SERIAL , 1 );
265
+ return 1 ;
266
+ }
267
+ }
268
+
213
269
static int wacom_graphire_irq (struct wacom_wac * wacom )
214
270
{
215
271
struct wacom_features * features = & wacom -> features ;
@@ -1371,6 +1427,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1371
1427
sync = wacom_dtu_irq (wacom_wac );
1372
1428
break ;
1373
1429
1430
+ case DTUS :
1431
+ sync = wacom_dtus_irq (wacom_wac );
1432
+ break ;
1433
+
1374
1434
case INTUOS :
1375
1435
case INTUOS3S :
1376
1436
case INTUOS3 :
@@ -1562,7 +1622,7 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1562
1622
1563
1623
wacom_abs_set_axis (input_dev , wacom_wac );
1564
1624
1565
- switch (wacom_wac -> features . type ) {
1625
+ switch (features -> type ) {
1566
1626
case WACOM_MO :
1567
1627
input_set_abs_params (input_dev , ABS_WHEEL , 0 , 71 , 0 , 0 );
1568
1628
/* fall through */
@@ -1773,8 +1833,14 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1773
1833
1774
1834
/* fall through */
1775
1835
1836
+ case DTUS :
1776
1837
case PL :
1777
1838
case DTU :
1839
+ if (features -> type == DTUS ) {
1840
+ input_set_capability (input_dev , EV_MSC , MSC_SERIAL );
1841
+ for (i = 0 ; i < 3 ; i ++ )
1842
+ __set_bit (BTN_0 + i , input_dev -> keybit );
1843
+ }
1778
1844
__set_bit (BTN_TOOL_PEN , input_dev -> keybit );
1779
1845
__set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
1780
1846
__set_bit (BTN_STYLUS , input_dev -> keybit );
@@ -2096,6 +2162,9 @@ static const struct wacom_features wacom_features_0xCE =
2096
2162
static const struct wacom_features wacom_features_0xF0 =
2097
2163
{ "Wacom DTU1631" , WACOM_PKGLEN_GRAPHIRE , 34623 , 19553 , 511 ,
2098
2164
0 , DTU , WACOM_INTUOS_RES , WACOM_INTUOS_RES };
2165
+ static const struct wacom_features wacom_features_0xFB =
2166
+ { "Wacom DTU1031" , WACOM_PKGLEN_DTUS , 22096 , 13960 , 511 ,
2167
+ 0 , DTUS , WACOM_INTUOS_RES , WACOM_INTUOS_RES };
2099
2168
static const struct wacom_features wacom_features_0x57 =
2100
2169
{ "Wacom DTK2241" , WACOM_PKGLEN_INTUOS , 95840 , 54260 , 2047 ,
2101
2170
63 , DTK , WACOM_INTUOS3_RES , WACOM_INTUOS3_RES };
@@ -2402,6 +2471,7 @@ const struct usb_device_id wacom_ids[] = {
2402
2471
{ USB_DEVICE_WACOM (0xF8 ) },
2403
2472
{ USB_DEVICE_DETAILED (0xF6 , USB_CLASS_HID , 0 , 0 ) },
2404
2473
{ USB_DEVICE_WACOM (0xFA ) },
2474
+ { USB_DEVICE_WACOM (0xFB ) },
2405
2475
{ USB_DEVICE_WACOM (0x0307 ) },
2406
2476
{ USB_DEVICE_DETAILED (0x0309 , USB_CLASS_HID , 0 , 0 ) },
2407
2477
{ USB_DEVICE_LENOVO (0x6004 ) },
0 commit comments