diff --git a/drivers/input/touchscreen/focaltech_v2_mmi/Android.mk b/drivers/input/touchscreen/focaltech_v2_mmi/Android.mk index b391381bdfcd..381ec41bad6d 100644 --- a/drivers/input/touchscreen/focaltech_v2_mmi/Android.mk +++ b/drivers/input/touchscreen/focaltech_v2_mmi/Android.mk @@ -1,6 +1,12 @@ DLKM_DIR := motorola/kernel/modules LOCAL_PATH := $(call my-dir) +ifneq ($(FOCALTECH_TOUCH_IC_NAME),) + KERNEL_CFLAGS += CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME=$(FOCALTECH_TOUCH_IC_NAME) +else + KERNEL_CFLAGS += CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME=ft3518u +endif + ifneq ($(BOARD_USES_DOUBLE_TAP),) KERNEL_CFLAGS += CONFIG_INPUT_FOCALTECH_MMI_ENABLE_DOUBLE_TAP=y endif diff --git a/drivers/input/touchscreen/focaltech_v2_mmi/Kbuild b/drivers/input/touchscreen/focaltech_v2_mmi/Kbuild index d01bb272f18e..8ebc2dd7d247 100644 --- a/drivers/input/touchscreen/focaltech_v2_mmi/Kbuild +++ b/drivers/input/touchscreen/focaltech_v2_mmi/Kbuild @@ -1,9 +1,9 @@ # add -Wall to try to catch everything we can. EXTRA_CFLAGS += -Wall -EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include \ - -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi \ - -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi/include \ - -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_test +EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include \ + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi \ + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi/include \ + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_test obj-m := focaltech_v2_mmi.o focaltech_v2_mmi-objs += focaltech_core.o @@ -16,6 +16,10 @@ focaltech_v2_mmi-objs += focaltech_flash.o focaltech_v2_mmi-objs += focaltech_flash/focaltech_upgrade_ft3518u.o focaltech_v2_mmi-objs += focaltech_i2c.o +ifneq ($(filter ft3519,$(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME)),) + EXTRA_CFLAGS += -DCONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT3519 +endif + ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI focaltech_v2_mmi-objs += focaltech_ts_mmi.o diff --git a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_common.h b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_common.h index 1bc9fa4abef0..a76622752af4 100644 --- a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_common.h +++ b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_common.h @@ -54,7 +54,11 @@ #define FTS_CHIP_IDC ((FTS_CHIP_TYPE & FLAGBIT(FLAG_IDC_BIT)) == FLAGBIT(FLAG_IDC_BIT)) #define FTS_HID_SUPPORTTED ((FTS_CHIP_TYPE & FLAGBIT(FLAG_HID_BIT)) == FLAGBIT(FLAG_HID_BIT)) +#if defined(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT3519) +#define FTS_CHIP_TYPE_MAPPING {{0x89, 0x54, 0x52, 0x54, 0x52, 0x00, 0x00, 0x54, 0x5E}} +#else #define FTS_CHIP_TYPE_MAPPING {{0x81, 0x54, 0x52, 0x54, 0x52, 0x00, 0x00, 0x54, 0x5C}} +#endif #define FILE_NAME_LENGTH 128 #define ENABLE 1 diff --git a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_config.h b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_config.h index cef285034d1d..22431acca2ae 100644 --- a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_config.h +++ b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_config.h @@ -117,6 +117,8 @@ #define _FT5536L 0x5536E481 #define _FT3418 0x34180481 +#define _FT3519 0x35190489 + #define _FT5446U 0x5446D083 #define _FT5456U 0x5456D083 #define _FT3417U 0x3417D083 @@ -161,8 +163,13 @@ /* * choose your ic chip type of focaltech */ + #if defined(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT3519) +#define FTS_CHIP_TYPE _FT3519 +#define FTS_CHIP_NAME "ft3519" +#else #define FTS_CHIP_TYPE _FT3518U #define FTS_CHIP_NAME "ft3518u" +#endif /******************* Enables *********************/ /*********** 1 to enable, 0 to disable ***********/ diff --git a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_flash.c b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_flash.c index 77602efb782d..1050374e25a0 100644 --- a/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_flash.c +++ b/drivers/input/touchscreen/focaltech_v2_mmi/focaltech_flash.c @@ -1167,7 +1167,9 @@ static int fts_read_file(char *file_name, u8 **file_buf) old_fs = get_fs(); set_fs(KERNEL_DS); pos = 0; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)) ret = vfs_read(filp, *file_buf, file_len , &pos); +#endif if (ret < 0) FTS_ERROR("read file fail"); FTS_INFO("file len:%d read len:%d pos:%d", (u32)file_len, ret, (u32)pos);