@@ -2167,6 +2167,15 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2167
2167
{
2168
2168
struct wacom_features * features = & wacom -> wacom_wac .features ;
2169
2169
2170
+ /* The pen and pad share the same interface on most devices */
2171
+ if (features -> type == GRAPHIRE_BT || features -> type == WACOM_G4 ||
2172
+ features -> type == DTUS || features -> type == WACOM_MO ||
2173
+ (features -> type >= INTUOS3S && features -> type <= WACOM_13HD &&
2174
+ features -> type != INTUOSHT )) {
2175
+ if (features -> device_type & WACOM_DEVICETYPE_PEN )
2176
+ features -> device_type |= WACOM_DEVICETYPE_PAD ;
2177
+ }
2178
+
2170
2179
/* touch device found but size is not defined. use default */
2171
2180
if (features -> device_type & WACOM_DEVICETYPE_TOUCH && !features -> x_max ) {
2172
2181
features -> x_max = 1023 ;
@@ -2182,7 +2191,10 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2182
2191
if ((features -> type >= INTUOS5S && features -> type <= INTUOSHT ) ||
2183
2192
(features -> type == BAMBOO_PT )) {
2184
2193
if (features -> pktlen == WACOM_PKGLEN_BBTOUCH3 ) {
2185
- features -> device_type |= WACOM_DEVICETYPE_TOUCH ;
2194
+ if (features -> touch_max )
2195
+ features -> device_type |= WACOM_DEVICETYPE_TOUCH ;
2196
+ if (features -> type == BAMBOO_PT || features -> type == INTUOSHT )
2197
+ features -> device_type |= WACOM_DEVICETYPE_PAD ;
2186
2198
2187
2199
features -> x_max = 4096 ;
2188
2200
features -> y_max = 4096 ;
@@ -2241,7 +2253,7 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
2241
2253
/* penabled devices have fixed resolution for each model */
2242
2254
input_abs_set_res (input_dev , ABS_X , features -> x_resolution );
2243
2255
input_abs_set_res (input_dev , ABS_Y , features -> y_resolution );
2244
- } else {
2256
+ } else if ( features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2245
2257
if (features -> touch_max == 1 ) {
2246
2258
input_set_abs_params (input_dev , ABS_X , 0 ,
2247
2259
features -> x_max , features -> x_fuzz , 0 );
@@ -2423,8 +2435,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2423
2435
break ;
2424
2436
2425
2437
case INTUOSHT :
2426
- if (features -> touch_max &&
2427
- features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2438
+ if (features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2428
2439
input_dev -> evbit [0 ] |= BIT_MASK (EV_SW );
2429
2440
__set_bit (SW_MUTE_DEVICE , input_dev -> swbit );
2430
2441
}
@@ -2434,27 +2445,26 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2434
2445
__clear_bit (ABS_MISC , input_dev -> absbit );
2435
2446
2436
2447
if (features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2437
-
2438
- if (features -> touch_max ) {
2439
- if (features -> pktlen == WACOM_PKGLEN_BBTOUCH3 ) {
2440
- input_set_abs_params (input_dev ,
2441
- ABS_MT_TOUCH_MAJOR ,
2442
- 0 , features -> x_max , 0 , 0 );
2443
- input_set_abs_params (input_dev ,
2444
- ABS_MT_TOUCH_MINOR ,
2445
- 0 , features -> y_max , 0 , 0 );
2446
- }
2447
- input_mt_init_slots (input_dev , features -> touch_max , INPUT_MT_POINTER );
2448
- } else {
2449
- /* buttons/keys only interface */
2450
- __clear_bit (ABS_X , input_dev -> absbit );
2451
- __clear_bit (ABS_Y , input_dev -> absbit );
2452
- __clear_bit (BTN_TOUCH , input_dev -> keybit );
2453
-
2454
- /* PAD is setup by wacom_setup_pad_input_capabilities later */
2455
- return 1 ;
2448
+ if (features -> pktlen == WACOM_PKGLEN_BBTOUCH3 ) {
2449
+ input_set_abs_params (input_dev ,
2450
+ ABS_MT_TOUCH_MAJOR ,
2451
+ 0 , features -> x_max , 0 , 0 );
2452
+ input_set_abs_params (input_dev ,
2453
+ ABS_MT_TOUCH_MINOR ,
2454
+ 0 , features -> y_max , 0 , 0 );
2456
2455
}
2457
- } else if (features -> device_type & WACOM_DEVICETYPE_PEN ) {
2456
+ input_mt_init_slots (input_dev , features -> touch_max , INPUT_MT_POINTER );
2457
+ }
2458
+ if (features -> device_type & WACOM_DEVICETYPE_PAD ) {
2459
+ /* buttons/keys only interface */
2460
+ __clear_bit (ABS_X , input_dev -> absbit );
2461
+ __clear_bit (ABS_Y , input_dev -> absbit );
2462
+ __clear_bit (BTN_TOUCH , input_dev -> keybit );
2463
+
2464
+ /* PAD is setup by wacom_setup_pad_input_capabilities later */
2465
+ return 1 ;
2466
+ }
2467
+ if (features -> device_type & WACOM_DEVICETYPE_PEN ) {
2458
2468
__set_bit (INPUT_PROP_POINTER , input_dev -> propbit );
2459
2469
__set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2460
2470
__set_bit (BTN_TOOL_PEN , input_dev -> keybit );
@@ -2482,6 +2492,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2482
2492
struct wacom_features * features = & wacom_wac -> features ;
2483
2493
int i ;
2484
2494
2495
+ if (!(features -> device_type & WACOM_DEVICETYPE_PAD ))
2496
+ return - ENODEV ;
2497
+
2485
2498
input_dev -> evbit [0 ] |= BIT_MASK (EV_KEY ) | BIT_MASK (EV_ABS );
2486
2499
2487
2500
/* kept for making legacy xf86-input-wacom working with the wheels */
@@ -2618,10 +2631,6 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2618
2631
2619
2632
case INTUOS5S :
2620
2633
case INTUOSPS :
2621
- /* touch interface does not have the pad device */
2622
- if (!(features -> device_type & WACOM_DEVICETYPE_PEN ))
2623
- return - ENODEV ;
2624
-
2625
2634
for (i = 0 ; i < 7 ; i ++ )
2626
2635
__set_bit (BTN_0 + i , input_dev -> keybit );
2627
2636
@@ -2663,12 +2672,6 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2663
2672
2664
2673
case INTUOSHT :
2665
2674
case BAMBOO_PT :
2666
- /* pad device is on the touch interface */
2667
- if (!(features -> device_type & WACOM_DEVICETYPE_TOUCH ) ||
2668
- /* Bamboo Pen only tablet does not have pad */
2669
- ((features -> type == BAMBOO_PT ) && !features -> touch_max ))
2670
- return - ENODEV ;
2671
-
2672
2675
__clear_bit (ABS_MISC , input_dev -> absbit );
2673
2676
2674
2677
__set_bit (BTN_LEFT , input_dev -> keybit );
0 commit comments