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

Configure Feed

Select the types of activity you want to include in your feed.

Input: goodix-berlin - report a resolution of 10 units/mm

Without a reported resolution, userspace was assuming 1 unit/mm which
is wildly wrong: a regular smartphone is clearly not 2.4 meters tall.
Most applications do not care much for this kind of raw mm value,
but Phosh's on-screen keyboard would accidentally trigger swipe-to-close
gestures due to misinterpreting small movements as huge ones.

Do what the older goodix.c driver does and set the resolution to 10
units/mm to make sure the numbers calculated by userspace are reasonable.

Signed-off-by: Val Packett <val@packett.cool>
Link: https://patch.msgid.link/20260321073242.556253-1-val@packett.cool
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Val Packett and committed by
Dmitry Torokhov
653f3100 79df764d

+8
+8
drivers/input/touchscreen/goodix_berlin_core.c
··· 628 628 629 629 touchscreen_parse_properties(cd->input_dev, true, &cd->props); 630 630 631 + /* 632 + * The resolution of these touchscreens is about 10 units/mm, the actual 633 + * resolution does not matter much since we set INPUT_PROP_DIRECT. 634 + * Set it to 10 to ensure userspace isn't off by an order of magnitude. 635 + */ 636 + input_abs_set_res(cd->input_dev, ABS_MT_POSITION_X, 10); 637 + input_abs_set_res(cd->input_dev, ABS_MT_POSITION_Y, 10); 638 + 631 639 error = input_mt_init_slots(cd->input_dev, GOODIX_BERLIN_MAX_TOUCH, 632 640 INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); 633 641 if (error)