@@ -769,9 +769,11 @@ static void wacom_intuos_general(struct wacom_wac *wacom)
769
769
t = (t << 1 ) | (data [1 ] & 1 );
770
770
}
771
771
input_report_abs (input , ABS_PRESSURE , t );
772
- input_report_abs (input , ABS_TILT_X ,
772
+ if (features -> type != INTUOSHT2 ) {
773
+ input_report_abs (input , ABS_TILT_X ,
773
774
(((data [7 ] << 1 ) & 0x7e ) | (data [8 ] >> 7 )) - 64 );
774
- input_report_abs (input , ABS_TILT_Y , (data [8 ] & 0x7f ) - 64 );
775
+ input_report_abs (input , ABS_TILT_Y , (data [8 ] & 0x7f ) - 64 );
776
+ }
775
777
input_report_key (input , BTN_STYLUS , data [1 ] & 2 );
776
778
input_report_key (input , BTN_STYLUS2 , data [1 ] & 4 );
777
779
input_report_key (input , BTN_TOUCH , t > 10 );
@@ -799,6 +801,7 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
799
801
data [0 ] != WACOM_REPORT_INTUOSREAD &&
800
802
data [0 ] != WACOM_REPORT_INTUOSWRITE &&
801
803
data [0 ] != WACOM_REPORT_INTUOSPAD &&
804
+ data [0 ] != WACOM_REPORT_INTUOS_PEN &&
802
805
data [0 ] != WACOM_REPORT_CINTIQ &&
803
806
data [0 ] != WACOM_REPORT_CINTIQPAD &&
804
807
data [0 ] != WACOM_REPORT_INTUOS5PAD ) {
@@ -1896,7 +1899,7 @@ static void wacom_bpt3_touch_msg(struct wacom_wac *wacom, unsigned char *data)
1896
1899
int y = (data [3 ] << 4 ) | (data [4 ] & 0x0f );
1897
1900
int width , height ;
1898
1901
1899
- if (features -> type >= INTUOSPS && features -> type <= INTUOSHT ) {
1902
+ if (features -> type >= INTUOSPS && features -> type <= INTUOSHT2 ) {
1900
1903
width = data [5 ] * 100 ;
1901
1904
height = data [6 ] * 100 ;
1902
1905
} else {
@@ -1924,7 +1927,7 @@ static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
1924
1927
struct input_dev * input = wacom -> pad_input ;
1925
1928
struct wacom_features * features = & wacom -> features ;
1926
1929
1927
- if (features -> type == INTUOSHT ) {
1930
+ if (features -> type == INTUOSHT || features -> type == INTUOSHT2 ) {
1928
1931
input_report_key (input , BTN_LEFT , (data [1 ] & 0x02 ) != 0 );
1929
1932
input_report_key (input , BTN_BACK , (data [1 ] & 0x08 ) != 0 );
1930
1933
} else {
@@ -1939,7 +1942,7 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
1939
1942
{
1940
1943
unsigned char * data = wacom -> data ;
1941
1944
int count = data [1 ] & 0x07 ;
1942
- int i ;
1945
+ int touch_changed = 0 , i ;
1943
1946
1944
1947
if (data [0 ] != 0x02 )
1945
1948
return 0 ;
@@ -1949,15 +1952,16 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom)
1949
1952
int offset = (8 * i ) + 2 ;
1950
1953
int msg_id = data [offset ];
1951
1954
1952
- if (msg_id >= 2 && msg_id <= 17 )
1955
+ if (msg_id >= 2 && msg_id <= 17 ) {
1953
1956
wacom_bpt3_touch_msg (wacom , data + offset );
1954
- else if (msg_id == 128 )
1957
+ touch_changed ++ ;
1958
+ } else if (msg_id == 128 )
1955
1959
wacom_bpt3_button_msg (wacom , data + offset );
1956
1960
1957
1961
}
1958
1962
1959
- /* only update the touch if we actually have a touchpad */
1960
- if (wacom -> touch_registered ) {
1963
+ /* only update touch if we actually have a touchpad and touch data changed */
1964
+ if (wacom -> touch_registered && touch_changed ) {
1961
1965
input_mt_sync_frame (wacom -> touch_input );
1962
1966
wacom -> shared -> touch_down = wacom_wac_finger_count_touches (wacom );
1963
1967
}
@@ -2038,7 +2042,13 @@ static int wacom_bpt_pen(struct wacom_wac *wacom)
2038
2042
2039
2043
static int wacom_bpt_irq (struct wacom_wac * wacom , size_t len )
2040
2044
{
2041
- if (len == WACOM_PKGLEN_BBTOUCH )
2045
+ struct wacom_features * features = & wacom -> features ;
2046
+
2047
+ if ((features -> type == INTUOSHT2 ) &&
2048
+ (wacom -> data [0 ] == WACOM_REPORT_INTUOS_PEN ) &&
2049
+ (features -> device_type & WACOM_DEVICETYPE_PEN ))
2050
+ return wacom_intuos_irq (wacom );
2051
+ else if (len == WACOM_PKGLEN_BBTOUCH )
2042
2052
return wacom_bpt_touch (wacom );
2043
2053
else if (len == WACOM_PKGLEN_BBTOUCH3 )
2044
2054
return wacom_bpt3_touch (wacom );
@@ -2145,7 +2155,8 @@ static int wacom_wireless_irq(struct wacom_wac *wacom, size_t len)
2145
2155
if (connected ) {
2146
2156
int pid , battery , charging ;
2147
2157
2148
- if ((wacom -> shared -> type == INTUOSHT ) &&
2158
+ if ((wacom -> shared -> type == INTUOSHT ||
2159
+ wacom -> shared -> type == INTUOSHT2 ) &&
2149
2160
wacom -> shared -> touch_input &&
2150
2161
wacom -> shared -> touch_max ) {
2151
2162
input_report_switch (wacom -> shared -> touch_input ,
@@ -2183,7 +2194,8 @@ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
2183
2194
if (data [0 ] != WACOM_REPORT_USB )
2184
2195
return 0 ;
2185
2196
2186
- if (features -> type == INTUOSHT &&
2197
+ if ((features -> type == INTUOSHT ||
2198
+ features -> type == INTUOSHT2 ) &&
2187
2199
wacom_wac -> shared -> touch_input &&
2188
2200
features -> touch_max ) {
2189
2201
input_report_switch (wacom_wac -> shared -> touch_input ,
@@ -2303,6 +2315,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
2303
2315
case BAMBOO_PEN :
2304
2316
case BAMBOO_TOUCH :
2305
2317
case INTUOSHT :
2318
+ case INTUOSHT2 :
2306
2319
if (wacom_wac -> data [0 ] == WACOM_REPORT_USB )
2307
2320
sync = wacom_status_irq (wacom_wac , len );
2308
2321
else
@@ -2339,22 +2352,31 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
2339
2352
}
2340
2353
}
2341
2354
2342
- static void wacom_setup_cintiq (struct wacom_wac * wacom_wac )
2355
+ static void wacom_setup_basic_pro_pen (struct wacom_wac * wacom_wac )
2343
2356
{
2344
2357
struct input_dev * input_dev = wacom_wac -> pen_input ;
2345
2358
2346
2359
input_set_capability (input_dev , EV_MSC , MSC_SERIAL );
2347
2360
2348
- __set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2349
2361
__set_bit (BTN_TOOL_PEN , input_dev -> keybit );
2350
- __set_bit (BTN_TOOL_BRUSH , input_dev -> keybit );
2351
- __set_bit (BTN_TOOL_PENCIL , input_dev -> keybit );
2352
- __set_bit (BTN_TOOL_AIRBRUSH , input_dev -> keybit );
2353
2362
__set_bit (BTN_STYLUS , input_dev -> keybit );
2354
2363
__set_bit (BTN_STYLUS2 , input_dev -> keybit );
2355
2364
2356
2365
input_set_abs_params (input_dev , ABS_DISTANCE ,
2357
2366
0 , wacom_wac -> features .distance_max , 0 , 0 );
2367
+ }
2368
+
2369
+ static void wacom_setup_cintiq (struct wacom_wac * wacom_wac )
2370
+ {
2371
+ struct input_dev * input_dev = wacom_wac -> pen_input ;
2372
+
2373
+ wacom_setup_basic_pro_pen (wacom_wac );
2374
+
2375
+ __set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2376
+ __set_bit (BTN_TOOL_BRUSH , input_dev -> keybit );
2377
+ __set_bit (BTN_TOOL_PENCIL , input_dev -> keybit );
2378
+ __set_bit (BTN_TOOL_AIRBRUSH , input_dev -> keybit );
2379
+
2358
2380
input_set_abs_params (input_dev , ABS_WHEEL , 0 , 1023 , 0 , 0 );
2359
2381
input_set_abs_params (input_dev , ABS_TILT_X , -64 , 63 , 0 , 0 );
2360
2382
input_abs_set_res (input_dev , ABS_TILT_X , 57 );
@@ -2600,16 +2622,21 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
2600
2622
case INTUOSHT :
2601
2623
case BAMBOO_PT :
2602
2624
case BAMBOO_PEN :
2603
- __clear_bit (ABS_MISC , input_dev -> absbit );
2604
-
2625
+ case INTUOSHT2 :
2605
2626
__set_bit (INPUT_PROP_POINTER , input_dev -> propbit );
2606
- __set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2607
- __set_bit (BTN_TOOL_PEN , input_dev -> keybit );
2608
- __set_bit (BTN_STYLUS , input_dev -> keybit );
2609
- __set_bit (BTN_STYLUS2 , input_dev -> keybit );
2610
- input_set_abs_params (input_dev , ABS_DISTANCE , 0 ,
2627
+
2628
+ if (features -> type == INTUOSHT2 ) {
2629
+ wacom_setup_basic_pro_pen (wacom_wac );
2630
+ } else {
2631
+ __clear_bit (ABS_MISC , input_dev -> absbit );
2632
+ __set_bit (BTN_TOOL_PEN , input_dev -> keybit );
2633
+ __set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2634
+ __set_bit (BTN_STYLUS , input_dev -> keybit );
2635
+ __set_bit (BTN_STYLUS2 , input_dev -> keybit );
2636
+ input_set_abs_params (input_dev , ABS_DISTANCE , 0 ,
2611
2637
features -> distance_max ,
2612
2638
0 , 0 );
2639
+ }
2613
2640
break ;
2614
2641
case BAMBOO_PAD :
2615
2642
__clear_bit (ABS_MISC , input_dev -> absbit );
@@ -2690,6 +2717,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
2690
2717
break ;
2691
2718
2692
2719
case INTUOSHT :
2720
+ case INTUOSHT2 :
2693
2721
input_dev -> evbit [0 ] |= BIT_MASK (EV_SW );
2694
2722
__set_bit (SW_MUTE_DEVICE , input_dev -> swbit );
2695
2723
/* fall through */
@@ -2849,6 +2877,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2849
2877
case INTUOSHT :
2850
2878
case BAMBOO_PT :
2851
2879
case BAMBOO_TOUCH :
2880
+ case INTUOSHT2 :
2852
2881
__clear_bit (ABS_MISC , input_dev -> absbit );
2853
2882
2854
2883
__set_bit (BTN_LEFT , input_dev -> keybit );
@@ -3335,6 +3364,22 @@ static const struct wacom_features wacom_features_0x331 =
3335
3364
{ "Wacom Express Key Remote" , .type = REMOTE ,
3336
3365
.numbered_buttons = 18 , .check_for_hid_type = true,
3337
3366
.hid_type = HID_TYPE_USBNONE };
3367
+ static const struct wacom_features wacom_features_0x33B =
3368
+ { "Wacom Intuos S 2" , 15200 , 9500 , 2047 , 63 ,
3369
+ INTUOSHT2 , WACOM_INTUOS_RES , WACOM_INTUOS_RES ,
3370
+ .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
3371
+ static const struct wacom_features wacom_features_0x33C =
3372
+ { "Wacom Intuos PT S 2" , 15200 , 9500 , 2047 , 63 ,
3373
+ INTUOSHT2 , WACOM_INTUOS_RES , WACOM_INTUOS_RES , .touch_max = 16 ,
3374
+ .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
3375
+ static const struct wacom_features wacom_features_0x33D =
3376
+ { "Wacom Intuos P M 2" , 21600 , 13500 , 2047 , 63 ,
3377
+ INTUOSHT2 , WACOM_INTUOS_RES , WACOM_INTUOS_RES ,
3378
+ .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
3379
+ static const struct wacom_features wacom_features_0x33E =
3380
+ { "Wacom Intuos PT M 2" , 21600 , 13500 , 2047 , 63 ,
3381
+ INTUOSHT2 , WACOM_INTUOS_RES , WACOM_INTUOS_RES , .touch_max = 16 ,
3382
+ .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
3338
3383
3339
3384
static const struct wacom_features wacom_features_HID_ANY_ID =
3340
3385
{ "Wacom HID" , .type = HID_GENERIC };
@@ -3494,6 +3539,10 @@ const struct hid_device_id wacom_ids[] = {
3494
3539
{ USB_DEVICE_WACOM (0x333 ) },
3495
3540
{ USB_DEVICE_WACOM (0x335 ) },
3496
3541
{ USB_DEVICE_WACOM (0x336 ) },
3542
+ { USB_DEVICE_WACOM (0x33B ) },
3543
+ { USB_DEVICE_WACOM (0x33C ) },
3544
+ { USB_DEVICE_WACOM (0x33D ) },
3545
+ { USB_DEVICE_WACOM (0x33E ) },
3497
3546
{ USB_DEVICE_WACOM (0x4001 ) },
3498
3547
{ USB_DEVICE_WACOM (0x4004 ) },
3499
3548
{ USB_DEVICE_WACOM (0x5000 ) },
0 commit comments