From dbeabe11a5b4dd7c12138a663dfcf26db16247bd Mon Sep 17 00:00:00 2001 From: haojl2 Date: Mon, 22 Apr 2019 19:06:52 +0800 Subject: [PATCH] focaltech_0_flash_mmi: select IC based on device config. If FOCALTECH_TOUCH_IC_NAME defined in device.mk, use this to select different IC. Default option is ft8719 Change-Id: I9ef108d26d1fc8aae8f63f7d2b65fff0680633e9 Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1341266 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1356394 --- drivers/input/touchscreen/focaltech_0flash_mmi/Android.mk | 6 ++++++ drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild | 6 +++++- .../touchscreen/focaltech_0flash_mmi/focaltech_config.h | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/Android.mk b/drivers/input/touchscreen/focaltech_0flash_mmi/Android.mk index dbb456fd2b86..3e044ab3bc04 100644 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/Android.mk +++ b/drivers/input/touchscreen/focaltech_0flash_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=ft8719 +endif + include $(CLEAR_VARS) LOCAL_MODULE := focaltech_0flash_mmi.ko LOCAL_MODULE_TAGS := optional diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild b/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild index 7bd808dc9e53..c653a1577004 100644 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild @@ -16,4 +16,8 @@ focaltech_0flash_mmi-objs += focaltech_point_report_check.o focaltech_0flash_mmi-objs += focaltech_spi.o focaltech_0flash_mmi-objs += focaltech_test/focaltech_test.o focaltech_0flash_mmi-objs += focaltech_test/focaltech_test_ini.o -focaltech_0flash_mmi-objs += focaltech_test/supported_ic/focaltech_test_ft8719.o + +ifneq ($(filter ft8719,$(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME)),) + EXTRA_CFLAGS += -DCONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT8719 + focaltech_0flash_mmi-objs += focaltech_test/supported_ic/focaltech_test_ft8719.o +endif diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h index 7e3ac65a4350..d08cdd37f38f 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h @@ -114,7 +114,13 @@ /* * choose your ic chip type of focaltech */ +#ifdef CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT8719 #define FTS_CHIP_TYPE _FT8719 +#define FTS_CHIP_NAME "ft8719" +#else +#define FTS_CHIP_TYPE _FT8719 +#define FTS_CHIP_NAME "ft8719" +#endif /******************* Enables *********************/ /*********** 1 to enable, 0 to disable ***********/