@@ -2168,7 +2168,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2168
2168
struct wacom_features * features = & wacom -> wacom_wac .features ;
2169
2169
2170
2170
/* touch device found but size is not defined. use default */
2171
- if (features -> device_type == BTN_TOOL_FINGER && !features -> x_max ) {
2171
+ if (features -> device_type & WACOM_DEVICETYPE_TOUCH && !features -> x_max ) {
2172
2172
features -> x_max = 1023 ;
2173
2173
features -> y_max = 1023 ;
2174
2174
}
@@ -2182,7 +2182,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2182
2182
if ((features -> type >= INTUOS5S && features -> type <= INTUOSHT ) ||
2183
2183
(features -> type == BAMBOO_PT )) {
2184
2184
if (features -> pktlen == WACOM_PKGLEN_BBTOUCH3 ) {
2185
- features -> device_type = BTN_TOOL_FINGER ;
2185
+ features -> device_type |= WACOM_DEVICETYPE_TOUCH ;
2186
2186
2187
2187
features -> x_max = 4096 ;
2188
2188
features -> y_max = 4096 ;
@@ -2197,7 +2197,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2197
2197
* so rewrite this one to be of type BTN_TOOL_FINGER.
2198
2198
*/
2199
2199
if (features -> type == BAMBOO_PAD )
2200
- features -> device_type = BTN_TOOL_FINGER ;
2200
+ features -> device_type |= WACOM_DEVICETYPE_TOUCH ;
2201
2201
2202
2202
if (wacom -> hdev -> bus == BUS_BLUETOOTH )
2203
2203
features -> quirks |= WACOM_QUIRK_BATTERY ;
@@ -2218,7 +2218,7 @@ void wacom_setup_device_quirks(struct wacom *wacom)
2218
2218
features -> quirks |= WACOM_QUIRK_NO_INPUT ;
2219
2219
2220
2220
/* must be monitor interface if no device_type set */
2221
- if (! features -> device_type ) {
2221
+ if (features -> device_type == WACOM_DEVICETYPE_NONE ) {
2222
2222
features -> quirks |= WACOM_QUIRK_MONITOR ;
2223
2223
features -> quirks |= WACOM_QUIRK_BATTERY ;
2224
2224
}
@@ -2230,7 +2230,7 @@ static void wacom_abs_set_axis(struct input_dev *input_dev,
2230
2230
{
2231
2231
struct wacom_features * features = & wacom_wac -> features ;
2232
2232
2233
- if (features -> device_type == BTN_TOOL_PEN ) {
2233
+ if (features -> device_type & WACOM_DEVICETYPE_PEN ) {
2234
2234
input_set_abs_params (input_dev , ABS_X , features -> x_min ,
2235
2235
features -> x_max , features -> x_fuzz , 0 );
2236
2236
input_set_abs_params (input_dev , ABS_Y , features -> y_min ,
@@ -2349,7 +2349,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2349
2349
case INTUOSPS :
2350
2350
__set_bit (INPUT_PROP_POINTER , input_dev -> propbit );
2351
2351
2352
- if (features -> device_type == BTN_TOOL_PEN ) {
2352
+ if (features -> device_type & WACOM_DEVICETYPE_PEN ) {
2353
2353
input_set_abs_params (input_dev , ABS_DISTANCE , 0 ,
2354
2354
features -> distance_max ,
2355
2355
0 , 0 );
@@ -2358,7 +2358,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2358
2358
input_abs_set_res (input_dev , ABS_Z , 287 );
2359
2359
2360
2360
wacom_setup_intuos (wacom_wac );
2361
- } else if (features -> device_type == BTN_TOOL_FINGER ) {
2361
+ } else if (features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2362
2362
__clear_bit (ABS_MISC , input_dev -> absbit );
2363
2363
2364
2364
input_set_abs_params (input_dev , ABS_MT_TOUCH_MAJOR ,
@@ -2370,7 +2370,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2370
2370
break ;
2371
2371
2372
2372
case WACOM_24HDT :
2373
- if (features -> device_type == BTN_TOOL_FINGER ) {
2373
+ if (features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2374
2374
input_set_abs_params (input_dev , ABS_MT_TOUCH_MAJOR , 0 , features -> x_max , 0 , 0 );
2375
2375
input_set_abs_params (input_dev , ABS_MT_WIDTH_MAJOR , 0 , features -> x_max , 0 , 0 );
2376
2376
input_set_abs_params (input_dev , ABS_MT_WIDTH_MINOR , 0 , features -> y_max , 0 , 0 );
@@ -2383,7 +2383,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2383
2383
case MTTPC :
2384
2384
case MTTPC_B :
2385
2385
case TABLETPC2FG :
2386
- if (features -> device_type == BTN_TOOL_FINGER && features -> touch_max > 1 )
2386
+ if (features -> device_type & WACOM_DEVICETYPE_TOUCH && features -> touch_max > 1 )
2387
2387
input_mt_init_slots (input_dev , features -> touch_max , INPUT_MT_DIRECT );
2388
2388
/* fall through */
2389
2389
@@ -2393,7 +2393,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2393
2393
2394
2394
__set_bit (INPUT_PROP_DIRECT , input_dev -> propbit );
2395
2395
2396
- if (features -> device_type != BTN_TOOL_PEN )
2396
+ if (!( features -> device_type & WACOM_DEVICETYPE_PEN ) )
2397
2397
break ; /* no need to process stylus stuff */
2398
2398
2399
2399
/* fall through */
@@ -2424,7 +2424,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2424
2424
2425
2425
case INTUOSHT :
2426
2426
if (features -> touch_max &&
2427
- features -> device_type == BTN_TOOL_FINGER ) {
2427
+ features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2428
2428
input_dev -> evbit [0 ] |= BIT_MASK (EV_SW );
2429
2429
__set_bit (SW_MUTE_DEVICE , input_dev -> swbit );
2430
2430
}
@@ -2433,7 +2433,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2433
2433
case BAMBOO_PT :
2434
2434
__clear_bit (ABS_MISC , input_dev -> absbit );
2435
2435
2436
- if (features -> device_type == BTN_TOOL_FINGER ) {
2436
+ if (features -> device_type & WACOM_DEVICETYPE_TOUCH ) {
2437
2437
2438
2438
if (features -> touch_max ) {
2439
2439
if (features -> pktlen == WACOM_PKGLEN_BBTOUCH3 ) {
@@ -2454,7 +2454,7 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
2454
2454
/* PAD is setup by wacom_setup_pad_input_capabilities later */
2455
2455
return 1 ;
2456
2456
}
2457
- } else if (features -> device_type == BTN_TOOL_PEN ) {
2457
+ } else if (features -> device_type & WACOM_DEVICETYPE_PEN ) {
2458
2458
__set_bit (INPUT_PROP_POINTER , input_dev -> propbit );
2459
2459
__set_bit (BTN_TOOL_RUBBER , input_dev -> keybit );
2460
2460
__set_bit (BTN_TOOL_PEN , input_dev -> keybit );
@@ -2619,7 +2619,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2619
2619
case INTUOS5S :
2620
2620
case INTUOSPS :
2621
2621
/* touch interface does not have the pad device */
2622
- if (features -> device_type != BTN_TOOL_PEN )
2622
+ if (!( features -> device_type & WACOM_DEVICETYPE_PEN ) )
2623
2623
return - ENODEV ;
2624
2624
2625
2625
for (i = 0 ; i < 7 ; i ++ )
@@ -2664,7 +2664,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev,
2664
2664
case INTUOSHT :
2665
2665
case BAMBOO_PT :
2666
2666
/* pad device is on the touch interface */
2667
- if ((features -> device_type != BTN_TOOL_FINGER ) ||
2667
+ if (! (features -> device_type & WACOM_DEVICETYPE_TOUCH ) ||
2668
2668
/* Bamboo Pen only tablet does not have pad */
2669
2669
((features -> type == BAMBOO_PT ) && !features -> touch_max ))
2670
2670
return - ENODEV ;
0 commit comments