From: Henrik Rydberg Date: Sat, 15 Sep 2012 06:57:18 +0000 (+0200) Subject: Input: MT - Allow legacy pressure computation X-Git-Tag: v3.7-rc1~202^2~3^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=22739293402966db7ca3eb0148632d986fe30465;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Signed-off-by: Henrik Rydberg --- diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index 44f5a67..c0ec7d4 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) if (oldest) { int x = input_mt_get_value(oldest, ABS_MT_POSITION_X); int y = input_mt_get_value(oldest, ABS_MT_POSITION_Y); - int p = input_mt_get_value(oldest, ABS_MT_PRESSURE); input_event(dev, EV_ABS, ABS_X, x); input_event(dev, EV_ABS, ABS_Y, y); - input_event(dev, EV_ABS, ABS_PRESSURE, p); + + if (test_bit(ABS_MT_PRESSURE, dev->absbit)) { + int p = input_mt_get_value(oldest, ABS_MT_PRESSURE); + input_event(dev, EV_ABS, ABS_PRESSURE, p); + } } else { - input_event(dev, EV_ABS, ABS_PRESSURE, 0); + if (test_bit(ABS_MT_PRESSURE, dev->absbit)) + input_event(dev, EV_ABS, ABS_PRESSURE, 0); } } EXPORT_SYMBOL(input_mt_report_pointer_emulation);