@@ -158,6 +158,39 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
158158 return 1 ;
159159}
160160
161+ static 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+
161194static int wacom_graphire_irq (struct wacom_wac * wacom )
162195{
163196 struct wacom_features * features = & wacom -> features ;
@@ -844,6 +877,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
844877 sync = wacom_ptu_irq (wacom_wac );
845878 break ;
846879
880+ case DTU :
881+ sync = wacom_dtu_irq (wacom_wac );
882+ break ;
883+
847884 case INTUOS :
848885 case INTUOS3S :
849886 case INTUOS3 :
@@ -1029,6 +1066,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
10291066
10301067 case PL :
10311068 case PTU :
1069+ case DTU :
10321070 __set_bit (BTN_TOOL_PEN , input_dev -> keybit );
10331071 __set_bit (BTN_STYLUS , input_dev -> keybit );
10341072 __set_bit (BTN_STYLUS2 , input_dev -> keybit );
@@ -1154,6 +1192,10 @@ static const struct wacom_features wacom_features_0xC6 =
11541192 { "Wacom Cintiq 12WX" , WACOM_PKGLEN_INTUOS , 53020 , 33440 , 1023 , 63 , WACOM_BEE };
11551193static const struct wacom_features wacom_features_0xC7 =
11561194 { "Wacom DTU1931" , WACOM_PKGLEN_GRAPHIRE , 37832 , 30305 , 511 , 0 , PL };
1195+ static const struct wacom_features wacom_features_0xCE =
1196+ { "Wacom DTU2231" , WACOM_PKGLEN_GRAPHIRE , 47864 , 27011 , 511 , 0 , DTU };
1197+ static const struct wacom_features wacom_features_0xF0 =
1198+ { "Wacom DTU1631" , WACOM_PKGLEN_GRAPHIRE , 34623 , 19553 , 511 , 0 , DTU };
11571199static const struct wacom_features wacom_features_0xCC =
11581200 { "Wacom Cintiq 21UX2" , WACOM_PKGLEN_INTUOS , 87200 , 65600 , 2047 , 63 , WACOM_21UX2 };
11591201static const struct wacom_features wacom_features_0x90 =
@@ -1233,6 +1275,8 @@ const struct usb_device_id wacom_ids[] = {
12331275 { USB_DEVICE_WACOM (0xC5 ) },
12341276 { USB_DEVICE_WACOM (0xC6 ) },
12351277 { USB_DEVICE_WACOM (0xC7 ) },
1278+ { USB_DEVICE_WACOM (0xCE ) },
1279+ { USB_DEVICE_WACOM (0xF0 ) },
12361280 { USB_DEVICE_WACOM (0xCC ) },
12371281 { USB_DEVICE_WACOM (0x90 ) },
12381282 { USB_DEVICE_WACOM (0x93 ) },
0 commit comments