Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: wacom: Add fuzz factor to distance and tilt axes

The fuzz present on the distance and tilt axes is noticable when a puck is
present, and userspace (specifically libinput) would like the ability to
filter out the noise. To facilitate this, we assign a fuzz value of '1'
for the distance and tilt axes. This is large enough to cover most of the
natural variation in distance value as the puck is moved around, and
enough to cover the jitter in rotation (reported through tilt axes) when
the puck is left alone.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Jason Gerecke and committed by
Jiri Kosina
bef7e200 1c74a7f8

+10 -7
+2 -1
drivers/hid/wacom_sys.c
··· 493 493 features->x_fuzz = 4; 494 494 features->y_fuzz = 4; 495 495 features->pressure_fuzz = 0; 496 - features->distance_fuzz = 0; 496 + features->distance_fuzz = 1; 497 + features->tilt_fuzz = 1; 497 498 498 499 /* 499 500 * The wireless device HID is basic and layout conflicts with
+7 -6
drivers/hid/wacom_wac.c
··· 2343 2343 __set_bit(BTN_STYLUS2, input_dev->keybit); 2344 2344 2345 2345 input_set_abs_params(input_dev, ABS_DISTANCE, 2346 - 0, wacom_wac->features.distance_max, 0, 0); 2346 + 0, wacom_wac->features.distance_max, wacom_wac->features.distance_fuzz, 0); 2347 2347 } 2348 2348 2349 2349 static void wacom_setup_cintiq(struct wacom_wac *wacom_wac) 2350 2350 { 2351 2351 struct input_dev *input_dev = wacom_wac->pen_input; 2352 + struct wacom_features *features = &wacom_wac->features; 2352 2353 2353 2354 wacom_setup_basic_pro_pen(wacom_wac); 2354 2355 ··· 2359 2358 __set_bit(BTN_TOOL_AIRBRUSH, input_dev->keybit); 2360 2359 2361 2360 input_set_abs_params(input_dev, ABS_WHEEL, 0, 1023, 0, 0); 2362 - input_set_abs_params(input_dev, ABS_TILT_X, -64, 63, 0, 0); 2361 + input_set_abs_params(input_dev, ABS_TILT_X, -64, 63, features->tilt_fuzz, 0); 2363 2362 input_abs_set_res(input_dev, ABS_TILT_X, 57); 2364 - input_set_abs_params(input_dev, ABS_TILT_Y, -64, 63, 0, 0); 2363 + input_set_abs_params(input_dev, ABS_TILT_Y, -64, 63, features->tilt_fuzz, 0); 2365 2364 input_abs_set_res(input_dev, ABS_TILT_Y, 57); 2366 2365 } 2367 2366 ··· 2507 2506 case WACOM_G4: 2508 2507 input_set_abs_params(input_dev, ABS_DISTANCE, 0, 2509 2508 features->distance_max, 2510 - 0, 0); 2509 + features->distance_fuzz, 0); 2511 2510 /* fall through */ 2512 2511 2513 2512 case GRAPHIRE: ··· 2569 2568 2570 2569 input_set_abs_params(input_dev, ABS_DISTANCE, 0, 2571 2570 features->distance_max, 2572 - 0, 0); 2571 + features->distance_fuzz, 0); 2573 2572 2574 2573 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 2575 2574 input_abs_set_res(input_dev, ABS_Z, 287); ··· 2628 2627 __set_bit(BTN_STYLUS2, input_dev->keybit); 2629 2628 input_set_abs_params(input_dev, ABS_DISTANCE, 0, 2630 2629 features->distance_max, 2631 - 0, 0); 2630 + features->distance_fuzz, 0); 2632 2631 } 2633 2632 break; 2634 2633 case BAMBOO_PAD:
+1
drivers/hid/wacom_wac.h
··· 177 177 int y_fuzz; 178 178 int pressure_fuzz; 179 179 int distance_fuzz; 180 + int tilt_fuzz; 180 181 unsigned quirks; 181 182 unsigned touch_max; 182 183 int oVid;