mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Support touch high resolution
This new protocol supports touch high resolution,for example 8X/10X/16X, but it's not compatible with previous protocol,so need use macro to control. Change-Id: Ib9e8590cd3cf05ba88b83f33fab552909c2d9a5e Signed-off-by: Wenge Zhu <zhuwg1@motorola.com> Reviewed-on: https://gerrit.mot.com/2399367 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Wei Deng <dengwei1@motorola.com> Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
e315ba74d2
commit
c4fe39e1fe
3 changed files with 45 additions and 0 deletions
|
|
@ -40,6 +40,10 @@ ifeq ($(FTS_COMPATIBLE_WITH_GKI),true)
|
|||
KBUILD_OPTIONS += CONFIG_FTS_COMPATIBLE_WITH_GKI=y
|
||||
endif
|
||||
|
||||
ifeq ($(FTS_SUPPORT_HIGH_RESOLUTION),true)
|
||||
KBUILD_OPTIONS += CONFIG_FTS_SUPPORT_HIGH_RESOLUTION=y
|
||||
endif
|
||||
|
||||
else
|
||||
ifneq ($(FOCALTECH_TOUCH_IC_NAME),)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_FOCALTECH_V3_MMI_IC_NAME=$(FOCALTECH_TOUCH_IC_NAME)
|
||||
|
|
|
|||
|
|
@ -59,5 +59,9 @@ ifneq ($(filter m y, $(CONFIG_FTS_DOUBLE_TAP_CONTROL)),)
|
|||
EXTRA_CFLAGS += -DCONFIG_FTS_DOUBLE_TAP_CONTROL
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y, $(CONFIG_FTS_SUPPORT_HIGH_RESOLUTION)),)
|
||||
EXTRA_CFLAGS += -DCONFIG_FTS_SUPPORT_HIGH_RESOLUTION
|
||||
endif
|
||||
|
||||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/../../kernel/msm-$(MODULE_KERNEL_VERSION)/Module.symvers
|
||||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers
|
||||
|
|
|
|||
|
|
@ -876,6 +876,42 @@ static int fts_irq_read_report(struct fts_ts_data *ts_data)
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FTS_SUPPORT_HIGH_RESOLUTION
|
||||
for (i = 0; i < max_touch_num; i++) {
|
||||
base = FTS_ONE_TCH_LEN * i + 2;
|
||||
pointid = (touch_buf[FTS_TOUCH_OFF_ID_YH + base]) >> 4;
|
||||
if (pointid >= FTS_MAX_ID)
|
||||
break;
|
||||
else if (pointid >= max_touch_num) {
|
||||
FTS_ERROR("ID(%d) beyond max_touch_number", pointid);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
events[i].id = pointid;
|
||||
events[i].flag = touch_buf[FTS_TOUCH_OFF_E_XH + base] >> 6;
|
||||
|
||||
//bit[15:12] | bit[11:4] | bit[3:0]
|
||||
events[i].x = ((touch_buf[FTS_TOUCH_OFF_E_XH + base] & 0x0F) << 12) \
|
||||
| ((touch_buf[FTS_TOUCH_OFF_XL + base] & 0xFF) << 4) \
|
||||
| ((touch_buf[FTS_TOUCH_OFF_PRE + base] >> 4) & 0x0F);
|
||||
|
||||
//bit[15:12] | bit[11:4] | bit[3:0]
|
||||
events[i].y = ((touch_buf[FTS_TOUCH_OFF_ID_YH + base] & 0x0F) << 12) \
|
||||
| ((touch_buf[FTS_TOUCH_OFF_YL + base] & 0xFF) << 4) \
|
||||
| (touch_buf[FTS_TOUCH_OFF_PRE + base] & 0x0F);
|
||||
|
||||
events[i].p = touch_buf[FTS_TOUCH_OFF_PRE + base] & 0x0F;
|
||||
events[i].area = touch_buf[FTS_TOUCH_OFF_AREA + base];
|
||||
if (events[i].p <= 0) events[i].p = 0x3F;
|
||||
if (events[i].area <= 0) events[i].area = 0x09;
|
||||
|
||||
event_num++;
|
||||
if (EVENT_DOWN(events[i].flag) && (finger_num == 0)) {
|
||||
FTS_INFO("abnormal touch data from fw");
|
||||
return -EIO;
|
||||
}
|
||||
}
|
||||
#else
|
||||
for (i = 0; i < max_touch_num; i++) {
|
||||
base = FTS_ONE_TCH_LEN * i + 2;
|
||||
pointid = (touch_buf[FTS_TOUCH_OFF_ID_YH + base]) >> 4;
|
||||
|
|
@ -903,6 +939,7 @@ static int fts_irq_read_report(struct fts_ts_data *ts_data)
|
|||
return -EIO;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (event_num == 0) {
|
||||
FTS_INFO("no touch point information(%02x)", touch_buf[2]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue