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

Input: of_touchscreen - fix setting max values on X/Y axis

The binding specification says that "touchscreen-size-x" and "-y" specify
horizontal and vertical resolution of the touchscreen and therefore maximum
absolute coordinates should be reduced by 1 since we are starting with 0.

Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+6 -4
+6 -4
drivers/input/touchscreen/of_touchscreen.c
··· 71 71 72 72 axis = multitouch ? ABS_MT_POSITION_X : ABS_X; 73 73 data_present = touchscreen_get_prop_u32(np, "touchscreen-size-x", 74 - input_abs_get_max(dev, axis), 74 + input_abs_get_max(dev, 75 + axis) + 1, 75 76 &maximum) | 76 77 touchscreen_get_prop_u32(np, "touchscreen-fuzz-x", 77 78 input_abs_get_fuzz(dev, axis), 78 79 &fuzz); 79 80 if (data_present) 80 - touchscreen_set_params(dev, axis, maximum, fuzz); 81 + touchscreen_set_params(dev, axis, maximum - 1, fuzz); 81 82 82 83 axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y; 83 84 data_present = touchscreen_get_prop_u32(np, "touchscreen-size-y", 84 - input_abs_get_max(dev, axis), 85 + input_abs_get_max(dev, 86 + axis) + 1, 85 87 &maximum) | 86 88 touchscreen_get_prop_u32(np, "touchscreen-fuzz-y", 87 89 input_abs_get_fuzz(dev, axis), 88 90 &fuzz); 89 91 if (data_present) 90 - touchscreen_set_params(dev, axis, maximum, fuzz); 92 + touchscreen_set_params(dev, axis, maximum - 1, fuzz); 91 93 92 94 axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE; 93 95 data_present = touchscreen_get_prop_u32(np, "touchscreen-max-pressure",