diff --git a/drivers/input/touchscreen/focaltech_touch_v3/Android.mk b/drivers/input/touchscreen/focaltech_touch_v3/Android.mk index 05b378e586bb..ce6050d728eb 100644 --- a/drivers/input/touchscreen/focaltech_touch_v3/Android.mk +++ b/drivers/input/touchscreen/focaltech_touch_v3/Android.mk @@ -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) diff --git a/drivers/input/touchscreen/focaltech_touch_v3/Kbuild b/drivers/input/touchscreen/focaltech_touch_v3/Kbuild index 35bce3c382a3..91c8d1e2bf80 100644 --- a/drivers/input/touchscreen/focaltech_touch_v3/Kbuild +++ b/drivers/input/touchscreen/focaltech_touch_v3/Kbuild @@ -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 diff --git a/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c index 49e4bcdbd82e..a8a0d58d0ee3 100644 --- a/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_touch_v3/focaltech_core.c @@ -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]);