Commit db4572ff authored by H. Nikolaus Schaller's avatar H. Nikolaus Schaller Committed by Dmitry Torokhov

Input: tsc2007 - correctly report pressure and not resistance to user space

Previously, tsc2007 would report as ABS_PRESSURE:
0              for no pressure (resistance infinite)
high value     for soft pressure (high resistance)
low value      for firm pressure (lower resistance)

This does not matter for most applications (e.g. GUI, Menu, Scrolling etc.)
where the ABS_PRESSURE is ignored and only BTN_TOUCH is processed to detect
screen taps.

Only some special graphics applications read the pressure channel and they
will be mixed up by this non-monotonic relation.

So we fix it to become:
0              for no pressure (resistance infinite)
low value      for soft pressure (high resistance)
high value     for firm pressure (lower resistance)

While this patch changes the values reported to userspace, ABS_PRESSURE is
used rarely by userspace. Most software only relies on BTN_TOUCH (boolean),
which is not affected by this patch. Some graphics software makes use of
the interface and does not work correctly with the currently used inverted
behaviour.
Signed-off-by: default avatarH. Nikolaus Schaller <hns@goldelico.com>
Reviewed-By: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent deec586d
...@@ -141,6 +141,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle) ...@@ -141,6 +141,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
"DOWN point(%4d,%4d), resistance (%4u)\n", "DOWN point(%4d,%4d), resistance (%4u)\n",
tc.x, tc.y, rt); tc.x, tc.y, rt);
rt = ts->max_rt - rt;
input_report_key(input, BTN_TOUCH, 1); input_report_key(input, BTN_TOUCH, 1);
input_report_abs(input, ABS_X, tc.x); input_report_abs(input, ABS_X, tc.x);
input_report_abs(input, ABS_Y, tc.y); input_report_abs(input, ABS_Y, tc.y);
......
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