Add TW_IGNORE_MT_POSITION_0 touch flag

This fixes touch on the a11 when fastboot booting the image. We
are also adding event logging for ABS_MT_POSITION data which we
should have been logging before but for some reason we did not.

Change-Id: I1b38c31c716efdcbe48db4faa5d0cef97c91c58e
This commit is contained in:
Ethan Yonker
2014-12-29 08:13:23 -06:00
committed by Dees Troy
parent dc3223adb2
commit 32f68a3c92
2 changed files with 16 additions and 0 deletions

View File

@@ -85,6 +85,10 @@ ifeq ($(TW_IGNORE_MAJOR_AXIS_0), true)
LOCAL_CFLAGS += -DTW_IGNORE_MAJOR_AXIS_0
endif
ifeq ($(TW_IGNORE_MT_POSITION_0), true)
LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
endif
ifneq ($(TW_INPUT_BLACKLIST),)
LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
endif

View File

@@ -458,15 +458,27 @@ static int vk_modify(struct ev *e, struct input_event *ev)
e->mt_p.synced = 0x03;
if (ev->value == (1 << 31))
{
#ifndef TW_IGNORE_MT_POSITION_0
e->mt_p.x = 0;
e->mt_p.y = 0;
lastWasSynReport = 1;
#endif
#ifdef _EVENT_LOGGING
#ifndef TW_IGNORE_MT_POSITION_0
printf("EV: %s => EV_ABS ABS_MT_POSITION %d, set x and y to 0 and lastWasSynReport to 1\n", e->deviceName, ev->value);
#else
printf("Ignoring ABS_MT_POSITION 0\n", e->deviceName, ev->value);
#endif
#endif
}
else
{
lastWasSynReport = 0;
e->mt_p.x = (ev->value & 0x7FFF0000) >> 16;
e->mt_p.y = (ev->value & 0xFFFF);
#ifdef _EVENT_LOGGING
printf("EV: %s => EV_ABS ABS_MT_POSITION %d, set x: %d and y: %d and lastWasSynReport to 0\n", e->deviceName, ev->value, (ev->value & 0x7FFF0000) >> 16, (ev->value & 0xFFFF));
#endif
}
break;