summaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-06 23:57:54 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-07-12 02:26:37 +0200
commit517178692ccd730a95b278bd8cd67e11498a9a84 (patch)
tree003f65c61a620de968ed2455a99d935d14aaa646 /drivers/input/touchscreen
parentInput: of_touchscreen - always issue warning if axis is not set up (diff)
downloadlinux-517178692ccd730a95b278bd8cd67e11498a9a84.tar.xz
linux-517178692ccd730a95b278bd8cd67e11498a9a84.zip
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>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r--drivers/input/touchscreen/of_touchscreen.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
index 759cf4b8ba09..50bc0f219547 100644
--- a/drivers/input/touchscreen/of_touchscreen.c
+++ b/drivers/input/touchscreen/of_touchscreen.c
@@ -71,23 +71,25 @@ void touchscreen_parse_of_params(struct input_dev *dev, bool multitouch)
axis = multitouch ? ABS_MT_POSITION_X : ABS_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) |
touchscreen_get_prop_u32(np, "touchscreen-fuzz-x",
input_abs_get_fuzz(dev, axis),
&fuzz);
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;
data_present = touchscreen_get_prop_u32(np, "touchscreen-size-y",
- input_abs_get_max(dev, axis),
+ input_abs_get_max(dev,
+ axis) + 1,
&maximum) |
touchscreen_get_prop_u32(np, "touchscreen-fuzz-y",
input_abs_get_fuzz(dev, axis),
&fuzz);
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;
data_present = touchscreen_get_prop_u32(np, "touchscreen-max-pressure",