diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2012-09-15 02:57:18 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-09-19 13:50:19 -0400 |
commit | 22739293402966db7ca3eb0148632d986fe30465 (patch) | |
tree | 1bf76203caf01f9d712c5e0db9930dc591034ed8 | |
parent | 17a465a7f2d6ce31738a3a76591afeab165f185a (diff) |
Input: MT - Allow legacy pressure computation
Some drivers like to report ABS_PRESSURE in a special way.
Allow this when ABS_MT_PRESSURE is not defined.
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
-rw-r--r-- | drivers/input/input-mt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 44f5a67aaa69..c0ec7d42c3be 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c | |||
@@ -214,13 +214,17 @@ void input_mt_report_pointer_emulation(struct input_dev *dev, bool use_count) | |||
214 | if (oldest) { | 214 | if (oldest) { |
215 | int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); | 215 | int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); |
216 | int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y); | 216 | int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y); |
217 | int p = input_mt_get_value(oldest, ABS_MT_PRESSURE); | ||
218 | 217 | ||
219 | input_event(dev, EV_ABS, ABS_X, x); | 218 | input_event(dev, EV_ABS, ABS_X, x); |
220 | input_event(dev, EV_ABS, ABS_Y, y); | 219 | input_event(dev, EV_ABS, ABS_Y, y); |
221 | input_event(dev, EV_ABS, ABS_PRESSURE, p); | 220 | |
221 | if (test_bit(ABS_MT_PRESSURE, dev->absbit)) { | ||
222 | int p = input_mt_get_value(oldest, ABS_MT_PRESSURE); | ||
223 | input_event(dev, EV_ABS, ABS_PRESSURE, p); | ||
224 | } | ||
222 | } else { | 225 | } else { |
223 | input_event(dev, EV_ABS, ABS_PRESSURE, 0); | 226 | if (test_bit(ABS_MT_PRESSURE, dev->absbit)) |
227 | input_event(dev, EV_ABS, ABS_PRESSURE, 0); | ||
224 | } | 228 | } |
225 | } | 229 | } |
226 | EXPORT_SYMBOL(input_mt_report_pointer_emulation); | 230 | EXPORT_SYMBOL(input_mt_report_pointer_emulation); |