Commit 51717869 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent f61fd21d
...@@ -71,23 +71,25 @@ void touchscreen_parse_of_params(struct input_dev *dev, bool multitouch) ...@@ -71,23 +71,25 @@ void touchscreen_parse_of_params(struct input_dev *dev, bool multitouch)
axis = multitouch ? ABS_MT_POSITION_X : ABS_X; axis = multitouch ? ABS_MT_POSITION_X : ABS_X;
data_present = touchscreen_get_prop_u32(np, "touchscreen-size-x", data_present = touchscreen_get_prop_u32(np, "touchscreen-size-x",
input_abs_get_max(dev, axis), input_abs_get_max(dev,
axis) + 1,
&maximum) | &maximum) |
touchscreen_get_prop_u32(np, "touchscreen-fuzz-x", touchscreen_get_prop_u32(np, "touchscreen-fuzz-x",
input_abs_get_fuzz(dev, axis), input_abs_get_fuzz(dev, axis),
&fuzz); &fuzz);
if (data_present) if (data_present)
touchscreen_set_params(dev, axis, maximum, fuzz); touchscreen_set_params(dev, axis, maximum - 1, fuzz);
axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y; axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y;
data_present = touchscreen_get_prop_u32(np, "touchscreen-size-y", data_present = touchscreen_get_prop_u32(np, "touchscreen-size-y",
input_abs_get_max(dev, axis), input_abs_get_max(dev,
axis) + 1,
&maximum) | &maximum) |
touchscreen_get_prop_u32(np, "touchscreen-fuzz-y", touchscreen_get_prop_u32(np, "touchscreen-fuzz-y",
input_abs_get_fuzz(dev, axis), input_abs_get_fuzz(dev, axis),
&fuzz); &fuzz);
if (data_present) if (data_present)
touchscreen_set_params(dev, axis, maximum, fuzz); touchscreen_set_params(dev, axis, maximum - 1, fuzz);
axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE; axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE;
data_present = touchscreen_get_prop_u32(np, "touchscreen-max-pressure", data_present = touchscreen_get_prop_u32(np, "touchscreen-max-pressure",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment