diff options
author | Tai Kuo <taikuo@google.com> | 2021-12-15 12:44:53 +0800 |
---|---|---|
committer | Tai Kuo <taikuo@google.com> | 2021-12-28 03:04:35 +0000 |
commit | b1348bbf79b84911616554844d6de03c4a491fe4 (patch) | |
tree | 4c35a067cee493aeb75b7d814e055bdbbf5c29cf | |
parent | a27f955c5f5daa04e640634b33fb64a57cc4f3bc (diff) | |
download | fts_touch-b1348bbf79b84911616554844d6de03c4a491fe4.tar.gz |
ftm5: fix the touch_offload major/minor scale
Apply the AREA_SCALE once read get the major/minor from the IC.
Bug: 212328023
Test: getevent
Signed-off-by: Tai Kuo <taikuo@google.com>
Change-Id: Ib1f1588ed9c1a8e01a51dbf4622954505b6eb857
-rw-r--r-- | ftm5/fts.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2985,8 +2985,8 @@ static bool fts_enter_pointer_event_handler(struct fts_ts_info *info, unsigned #endif z = 1; /* smallest non-zero pressure value */ } - major = (int)(((event[0] & 0x0C) << 2) | ((event[6] & 0xF0) >> 4)); - minor = (int)(((event[7] & 0xC0) >> 2) | (event[6] & 0x0F)); + major = (int)((((event[0] & 0x0C) << 2) | ((event[6] & 0xF0) >> 4)) * AREA_SCALE); + minor = (int)((((event[7] & 0xC0) >> 2) | (event[6] & 0x0F)) * AREA_SCALE); /* TODO: check with fw how they will report distance */ distance = 0; /* if the tool is touching the display * the distance should be 0 */ @@ -3079,8 +3079,8 @@ static bool fts_enter_pointer_event_handler(struct fts_ts_info *info, unsigned input_mt_report_slot_state(info->input_dev, tool, 1); input_report_abs(info->input_dev, ABS_MT_POSITION_X, x); input_report_abs(info->input_dev, ABS_MT_POSITION_Y, y); - input_report_abs(info->input_dev, ABS_MT_TOUCH_MAJOR, major * AREA_SCALE); - input_report_abs(info->input_dev, ABS_MT_TOUCH_MINOR, minor * AREA_SCALE); + input_report_abs(info->input_dev, ABS_MT_TOUCH_MAJOR, major); + input_report_abs(info->input_dev, ABS_MT_TOUCH_MINOR, minor); #ifndef SKIP_PRESSURE input_report_abs(info->input_dev, ABS_MT_PRESSURE, z); #endif @@ -4514,9 +4514,9 @@ static void fts_offload_report(void *handle, input_report_abs(info->input_dev, ABS_MT_POSITION_Y, report->coords[i].y); input_report_abs(info->input_dev, ABS_MT_TOUCH_MAJOR, - report->coords[i].major * AREA_SCALE); + report->coords[i].major); input_report_abs(info->input_dev, ABS_MT_TOUCH_MINOR, - report->coords[i].minor * AREA_SCALE); + report->coords[i].minor); #ifndef SKIP_PRESSURE if ((int)report->coords[i].pressure <= 0) { |